text
stringlengths
1
927k
class Solution(object): def rob(self, nums): """ :type nums: List[int] :rtype: int """ if not nums: return 0 if len(nums) == 1: return nums[0] if len(nums) == 2: return max(nums) if len(nums) == 3: return...
#!/usr/bin/env python """ A command-line program that produces a live plot of the progress of a SYNAPPS task. Requires the path to the yaml of the running SYNAPPS instance and path to a running log of the SYNAPPS process as produced, for example by the following commands: ::: synapps SN2011dh.yaml > synapps.log :...
import tensorflow as tf import numpy as np from utils.utils import * from model import * import sys import os import math import time from utils.data_helper import data_loader from model import xavier_init, he_normal_init dataset = sys.argv[1] model_name = sys.argv[2] prev_iter = int(sys.argv[3]) mb_size, X_dim, widt...
def to_center(title, space, object=str()): """ This function is reponsible for centralizing the title. accepted at least two vestments. :param title: receive any title, only string. :param space: receive any value, only numbers. :param object: receive any object, ex: - . = ~ < > _ | between others. ...
from __future__ import absolute_import from lark import Transformer, Tree from lark.lexer import Token from azext_script.compilers.HandlerManager import HandlerManager from .TranspilationResult import AZCLICommand, CommandResult, ExportCommand, EmptyCommand from knack.log import get_logger logger = get_logger(__name_...
from rest_framework import generics from .models import Patient,Doctor,Appt from .serializers import PatientSerializer,DoctorSerializer,ApptSerializer from django.http import HttpResponse import datetime # generic views -- core of CRUD apps # view -- takes request, returns response ''' request -- can come from fronten...
from rest_framework.views import APIView class BlindDetail(APIView): def get(self): pass def put(self): pass def post(self): pass def delete(self): pass
#!/usr/bin/python # -*- coding: utf-8 -*- # # Air quality monitoring # Science project based on RaspberryPi, GrovePi and Grove sensors and actuators # ## License: Open Source The MIT License (MIT) # LIBRARIES WE ARE USING import os import time from ISStreamer.Streamer import Streamer import atexit # date and time impo...
""" Classes that bring interpretability into tensor representations """ import itertools class State(object): """ This class describes state of the ``Tensor`` and tracks reshaping modifications Attributes ---------- _normal_shape : tuple Shape of a ``Tensor`` object in normal format (without ...
import googlemaps class GeoLocate: def __init__(self, address=None, city=None, country=None): self.gmaps = googlemaps.Client(key="AIzaSyC1ullKaTqRdkIy8djqWq7pIkh5A1JaINQ") self.geocode = self.geo_locate(address, city, country) def geo_locate(self, address, city, country): geocode = s...
def can_build(env, plat): return plat=="android" or plat=="iphone" def configure(env): if (env['platform'] == 'android'): env.android_add_maven_repository("url 'https://maven.google.com'") #env.android_add_default_config("manifestPlaceholders = [FACEBOOK_APP_ID: '843075892565403']") env...
__author__ = 'bg' class p001: def __init__(self): nums = range(2, 50)
# coding: utf-8 from __future__ import unicode_literals import re from ..utils import unsmuggle_url from .common import InfoExtractor class JWPlatformIE(InfoExtractor): _VALID_URL = r"(?:https?://(?:content\.jwplatform|cdn\.jwplayer)\.com/(?:(?:feed|player|thumb|preview)s|jw6|v2/media)/|jwplatform:)(?P<id>[a-zA...
from django.apps import AppConfig class RestfConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'restF'
def magic_square_test(my_matrix): iSize = len(my_matrix[0]) sum_list = [] #Horizontal Part: sum_list.extend([sum (lines) for lines in my_matrix]) #Vertical Part: for col in range(iSize): sum_list.append(sum(row[col] for row in my_matrix)) #Diagonals Part result1 = 0...
import tornado.web class FixTasks(tornado.web.UIModule): def embedded_css(self): return """ #tasks-table, .dataTable { table-layout: fixed; } #tasks-table th:nth-child(3), .dataTable th:nth-child(3) { width: 50px !important; } #tasks-table th:nth-child(4), .dataTable th:nth-child(4) { width: 1...
import os import pytest from dbt.tests.util import run_dbt, check_relations_equal, check_table_does_not_exist from tests.functional.simple_snapshot.fixtures import ( seeds__seed_newcol_csv, seeds__seed_csv, models__schema_yml, models__ref_snapshot_sql, macros__test_no_overlaps_sql, snapshots_pg_...
''' New Integration test for testing imagecache cleanup after vm migration between hosts. @author: quarkonics ''' import os import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.resource_operatio...
#!/usr/bin/python # -*- coding: utf-8 -*- import time import json import telegram.ext import telegram import sys import datetime import os import logging import threading import six if six.PY2: reload(sys) sys.setdefaultencoding('utf8') Version_Code = 'v1.0.0' logging.basicConfig(level=logging.INFO, ...
import datetime import re from django.conf import settings from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core import mail from django.core import management from django.test import TestCase from django.utils.hashcompat import sha_constructor from registration.mod...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Emall.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportEr...
'''This module is responsible for launching evaluation jobs''' import argparse import json import logging import os import time import rospy from rl_coach.base_parameters import TaskParameters from rl_coach.core_types import EnvironmentSteps from rl_coach.data_stores.data_store import SyncFiles from markov import util...
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from rest_framework import generics, permissions as drf_permissions from rest_framework.exceptions import ValidationError, NotFound, PermissionDenied from framework.auth.oauth_scopes import CoreScopes from osf.models import AbstractNode, Registration, OSFUser from api.base import permissions as base_permissions from a...
import time from datetime import datetime from . import utils # Thanks to Dan Jacob and Sean Vieira for making the following snippet # available at http://flask.pocoo.org/snippets/33/ @utils.app_template_filter('humanize') def humanize_time(dt, past_='ago', future_='from now', default='just now'): """ Return...
from account import Account from person import Person class CurrentAccount(Account): def __init__(self, nombre, apellido, numeroCuenta, cantidad, tipo = 0.0, tarjetaDebito = False, tarjetaCredito = False, cuota = 0.0): Account.__init__(self, numeroCuenta, cantidad) self.__tipoInteres = 1 + float(tipo) self.__ta...
# language-learning/src/grammar_learner/pqa_table.py # 190410 # Test Grammar Learner to fill in ULL Project Plan Parses spreadshit import logging # TODO: refactor 81217 wide_rows (archived) and ppln.py (make independent) import os, sys, time from ..common import handle_path_string from ..grammar_te...
# Create your models here. from django.db import models from django.contrib.auth.models import BaseUserManager from django.contrib.auth.base_user import AbstractBaseUser import datetime import django.utils as ut class Credentials(models.Model): email = models.CharField(verbose_name='email', max_length=255, default...
from decimal import Decimal, ROUND_HALF_UP from django.test import TestCase from .utils import create_test_expenses from ..models import Expense from ..reports import summary_overall class ReportsTestCase(TestCase): """Test reports utilities for the expenses""" def setUp(self) -> None: """Set up fo...
from labjackcontroller.labtools import LabjackReader duration = 10 # seconds frequency = 100 # sampling frequency in Hz channels = ["AIN0", "DIO1"] # read Analog INput 0, Digital INput 1. analog_voltages = [10.0] # i.e. read input voltages from -10 to 10 volts # Instantiate a LabjackReader with LabjackReader("T...
from sklearn import svm def train(data, target, C, gamma): clf = svm.SVC(C, 'rbf', gamma=gamma) clf.fit(data[:90], target[:90]) return clf
# -*- coding: utf-8 -*- """INI simulator with time-to-first-spike code and corrective spikes. @author: rbodo """ # noinspection PyUnresolvedReferences from snntoolbox.simulation.target_simulators.INI_temporal_mean_rate_target_sim \ import SNN
from . import callbacks from . import models
from .characters import Characters
# flake8: noqa """ Copyright 2020 - Present Okta, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
# Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights # reserved. Use of this source code is governed by a BSD-style license that # can be found in the LICENSE file. from cef_json_builder import cef_json_builder import datetime import math import os import sys # Class used to build the cefbuilds HT...
from abc import abstractmethod from datetime import datetime from bullets.portfolio.portfolio import Portfolio from bullets.data_source.data_source_interface import DataSourceInterface, Resolution from bullets import logger class Strategy: def __init__(self, resolution: Resolution, start_time: datetime, end_time:...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. # 2019, SMART Health IT. import os import io import unittest import json from . import claim from .fhirdate import FHIRDate class ClaimTests(unittest.TestCase): def instantiate_from(self, filename): d...
import fnmatch import glob import os.path import sys from _pydev_bundle import pydev_log import pydevd_file_utils import json from collections import namedtuple from _pydev_imps._pydev_saved_modules import threading try: xrange # noqa except NameError: xrange = range # noqa ExcludeFilter = namedtuple('Excl...
print "How is everything?"
# -*- coding: utf-8 -*- # -------------------------- # Copyright © 2014 - Qentinel Group. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LIC...
from __future__ import absolute_import from __future__ import unicode_literals from django.conf.urls import url, include from corehq.apps.api.urls import CommCareHqApi from corehq.apps.zapier.api.v0_5 import ( ZapierXFormInstanceResource, ZapierCustomFieldCaseResource, ZapierCustomTriggerFieldFormResource,...
from unittest import mock from yaspin.spinners import Spinners from inquirer import Text, List, Checkbox, Password, Confirm from beauty_ocean.core import config def test_config_constants(): assert config.DEFAULT_ENV_NAME == "DO_TOKEN" assert config.DEFAULT_QUESTION_NAME == "choice" assert config.SORRY =...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== from __future__ import print_function from cntk import * from cntk.initializer impo...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'homework_board.settings') try: from django.core.management import execute_from_command_line exce...
import time import requests from tests.integration.aurorabridge_test.client import api from tests.integration.util import load_config TEST_CONFIG_DIR = '/aurorabridge_test/test_configs' def wait_for_rolled_forward(client, job_update_key): '''Wait for job update to be in "ROLLED_FORWARD" state, triggers ass...
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
from werkzeug.security import safe_str_cmp from user import User users = [ User(1, 'bob', '1234') ] username_mapping = {u.username: u for u in users} userid_mapping = {u.id: u for u in users} def authenticate(username, password): user = User.find_by_username(username) if user and safe_str_cmp(user.password, passw...
import functions def to_dict(csq): return { 'so_accession': csq['SO_accession'], 'so_term': csq['SO_term'], 'impact': csq['impact'], 'rank': csq['rank'] } class Consequence(object): @staticmethod def impact_score(imp): return \ { im...
import pathlib from cldfbench import Dataset as BaseDataset class Dataset(BaseDataset): dir = pathlib.Path(__file__).parent id = "test_bench" def cldf_specs(self): # A dataset must declare all CLDF sets it creates. return super().cldf_specs() def cmd_download(self, args): """ ...
from rest_framework import mixins from rest_framework.viewsets import GenericViewSet from lego.apps.permissions.api.views import AllowedPermissionsMixin from lego.apps.users.filters import PenaltyFilterSet from lego.apps.users.models import Penalty from lego.apps.users.serializers.penalties import PenaltySerializer ...
#!/usr/bin/env python3 '''Filters the RTX "KG2" second-generation knowledge graph, simplifying predicates and removing redundant edges. Usage: filter_kg_and_remap_predicates.py <predicate-remap.yaml> <kg-input.json> <kg-output.json> ''' __author__ = 'Stephen Ramsey' __copyright__ = 'Oregon State University' __cred...
from django.shortcuts import render, redirect from django.contrib.auth.forms import UserCreationForm from django.contrib import messages from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm from django.contrib.auth.decorators import login_required def register(request): if request.method == 'POST...
import torch import numpy as np from sklearn.cluster import SpectralClustering from cogdl.utils import spmm from .. import BaseModel, register_model @register_model("agc") class AGC(BaseModel): r"""The AGC model from the `"Attributed Graph Clustering via Adaptive Graph Convolution" <https://arxiv.org/abs/190...
from ..utils.constants import * from ..utils.parse_chord import CHORDS_ANALYSIS_2 from ..utils.structured import str_to_root, chord_type_to_pitch_relation, root_to_pitch_low from ..utils.utils import Logging class Chord: # TODO finish chord class def __init__(self, root=None, attr=None, name=None): s...
""" Copyright (c) 2012-2017, Zenotech Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and th...
from datetime import datetime from flask import render_template, flash, redirect, url_for, request, g, jsonify, current_app from flask_login import current_user, login_required from flask_babel import _, get_locale from guess_language import guess_language from app import db from app.main.forms import EditProfileForm, ...
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http: // www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
""" Implementation of all available options """ from __future__ import print_function import configargparse from onmt.models.sru import CheckSRU def config_opts(parser): parser.add('-config', '--config', required=False, is_config_file_arg=True, help='config file path') parser.add('-save_config...
import argparse import copy from distutils import ccompiler from distutils import errors from distutils import msvccompiler from distutils import sysconfig from distutils import unixccompiler import os from os import path import shutil import sys import pkg_resources import setuptools from setuptools.command import bu...
# pylint: disable=wrong-or-nonexistent-copyright-notice from typing import Optional, Sequence, Tuple, TYPE_CHECKING import numpy as np from cirq import devices, ops, protocols if TYPE_CHECKING: import cirq def _asinsin(x: float) -> float: """Computes arcsin(sin(x)) for any x. Return value in [-π/2, π/2].""...
import _plotly_utils.basevalidators class ArraysrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="arraysrc", parent_name="scatter.error_y", **kwargs): super(ArraysrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
from fixtures import GaeTestCase from gutter.client import arguments from gutter.appengine import registry class User(arguments.Container): nickname = arguments.String(lambda self: self.input.nickname()) email = arguments.String(lambda self: self.input.email()) user_id = arguments.String(lambda self: se...
import torch.nn as nn import math import torch.utils.model_zoo as model_zoo import torch.nn.init as weight_init import torch __all__ = ['MultipleBasicBlock','MultipleBasicBlock_4'] def conv3x3(in_planes, out_planes, dilation = 1, stride=1): "3x3 convolution with padding" return nn.Conv2d(in_planes, out_planes, ...
# Generated by Django 2.2.4 on 2019-08-26 08:39 import django.contrib.postgres.fields.jsonb from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Fingerprint', f...
_base_ = './hv_pointpillars_fpn_sbn-all_free-anchor_4x8_2x_nus-3d.py' model = dict( pretrained=dict(pts='open-mmlab://regnetx_1.6gf'), pts_backbone=dict( _delete_=True, type='NoStemRegNet', arch='regnetx_1.6gf', out_indices=(1, 2, 3), frozen_stages=-1, strides=(1...
# Copyright 2019 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
""" MIT License Copyright (c) 2021 Vítor Mussa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, d...
# -*- coding: utf-8 -*- import numpy as np from .timestamp import Timestamp from .movement_model_base import MovementModelBase class LinearMovementModel(MovementModelBase): """Продвигает автомобиль вперед с его текущей скоростью""" def __init__(self, *args, **kwargs): super(LinearMovementModel, self)....
# (c) 2018, NetApp Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from ansible_collections.community.general.plugins.modules.storage.netapp.netapp_e_syslog import Syslog from ansible_collections.community.general.tests.unit.modules.utils import AnsibleFailJson, Module...
# coding: utf-8 """ Xero oAuth 2 identity service This specifing endpoints related to managing authentication tokens and identity for Xero API # noqa: E501 OpenAPI spec version: 2.4.0 Contact: api@xero.com Generated by: https://openapi-generator.tech """ import re # noqa: F401 from xero_pyth...
lista = enumerate('zero um dois três quatro cinco seis sete oito nove'.split()) numero_string=dict(lista) string_numero={valor:chave for chave,valor in numero_string.items()} print (numero_string) print(string_numero) def para_numeral(n): numeros=[] for digito in str(n): numeros.append(numero_string[in...
# -*- coding: UTF-8 -*- import getopt import os import sys def update_web_files(): import shutil shutil.rmtree('static') shutil.copytree("web/dist", "static") def commit_web_file(): os.system('git add static/') os.system('git commit -m "更新前端文件"') def static_file_updated(): try: # 1...
from Calculator.Square import squaring from Calculator.Division import division from Calculator.Addition import addition from Calculator.Subtraction import subtraction from Statistics.PopulationMean import populationmean from Statistics.StandardDeviation import stddev def zscore(num): zmean = populationmean(num) ...
"""Soft Actor-Critic implementation""" from typing import Dict, Optional, Sequence from acme import core from acme import specs from acme.jax import networks as networks_lib from acme.utils import counting from acme.utils import loggers import dm_env import jax import reverb from magi.agents.sac import builder from m...
# coding: utf-8 from __future__ import absolute_import import unittest from flask import json from six import BytesIO from openapi_server.test import BaseTestCase class TestTestController(BaseTestCase): """TestController integration test stubs""" def test_test_systemtest_post(self): """Test case f...
# -*- coding: utf-8 -*- # Copyright © 2012-2018 Roberto Alsina and others. # Permission is hereby granted, free of charge, to any # person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the # Software without restriction, including without limitation # the rights t...
import numpy as np import sys import time import os import json import argparse from sort.sort import Sort def track_from_detections(detection_path, output_path, num_classes): ''' Runs tracking on detections and saves result to a json file on form list(class_db) Where each class_db is on the form: - t...
#! /usr/bin/python # -*- coding: utf-8 -*- import numpy as np; np.random.seed(1234) import pandas as pd ntrain = 150000 data = pd.read_csv('../ratings.txt', sep='\t', quoting=3) data = pd.DataFrame(np.random.permutation(data)) trn, tst = data[:ntrain], data[ntrain:] header = 'id document label'.split() trn.to_csv(...
#--------------------------------------------------------------------------- # This python module is used to customize a supported toolchain for your # project specific settings. # # Notes: # - ONLY edit/add statements in the sections marked by BEGIN/END EDITS # markers. # - Maintain indentation level and u...
from application import db class Users(db.Model): id = db.Column(db.Integer, primary_key=True) first_name = db.Column(db.String(30), nullable=False) last_name = db.Column(db.String(30), nullable=False) account_number = db.Column(db.String(15), nullable=False) message = db.Column(db.String(300), nul...
#!/usr/bin/env python3 # # This payload requires HatSploit: https://hatsploit.netlify.app # Current source: https://github.com/EntySec/HatSploit # from hatsploit.lib.payload import Payload class HatSploitPayload(Payload): details = { 'Category': "stager", 'Name': "Linux x64 Shell Bind TCP", ...
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies and Contributors # License: MIT. See LICENSE import unittest import frappe from frappe.core.doctype.session_default_settings.session_default_settings import ( clear_session_defaults, set_session_default_values, ) class TestSessionDefaultSettings(uni...
# ATCA Rapid Response API # Python library # Jamie.Stevens@csiro.au from .api import api,responseError
"""An augmentation to randomly rotate an image.""" import random from discolight.params.params import Params from .augmentation.types import Augmentation, NumericalRange from .rotate import Rotate from .decorators.accepts_probs import accepts_probs @accepts_probs class RandomRotate(Augmentation): """Randomly rot...
from django import forms from . models import Image,Profile,Comments from django.forms import ModelForm from .models import Photo class PhotoForm(ModelForm): class Meta: model = Photo class PhotoForm(ModelForm): class Meta: model = Photo exclude = ['profile','likes','comments','user'...
from options import pv, european_call_value, european_put_value from fama_french_48 import sic_to_ff_48
# Pyrogram - Telegram MTProto API Client Library for Python # Copyright (C) 2017-2020 Dan <https://github.com/delivrance> # # This file is part of Pyrogram. # # Pyrogram is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free...
import youtube_dl import os import threading import logging import json logger = logging.getLogger("RaspberryCast") volume = 0 def launchvideo(url, config, sub=False): setState("2") os.system("echo -n q > /tmp/cmd &") # Kill previous instance of OMX if config["new_log"]: os.system("sudo fbi -T ...
#!/usr/bin/python3 import shutil import os from GuestFS import GuestFS from GuestFS_registry import GuestFS_Registry from datetime import datetime import zipfile import urllib """ LibGuestFS Wrapper for Disk Information Extraction This class is responsible for extracting the required logs and configuration files fro...
'''Contains helper function for this project filenames and example band dictionary and list''' def dirname(measurement): '''Returns directory of .asc file in CMIP5 dataset''' _dirname_prefix = 'bcc_csm1_1_m_rcp8_5_2080s' _dirname_postfix = '10min_r1i1p1_no_tile_asc' _dirname_global = './data/CMIP5' ...
from toee import * import char_class_utils import char_editor ################################################### def GetConditionName(): # used by API return "Ranger" # def GetSpellCasterConditionName(): # return "Ranger Spellcasting" def GetCategory(): return "Core 3.5 Ed Classes" def GetClassDefinitionFlags(...
# -*- coding: utf-8 -*- # # SIMPLE documentation build configuration file, created by # sphinx-quickstart on Sun Feb 23 13:39:13 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
import torch from torch import nn, einsum import torch.nn.functional as F import math from einops import rearrange, repeat from einops.layers.torch import Rearrange from siren.init import siren_uniform_ def sine_init(x): siren_uniform_(x, mode='fan_in', c=6) class Sine(nn.Module): def __init__(self, w0 = 1.)...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @copyright &copy; 2010 - 2021, Fraunhofer-Gesellschaft zur Foerderung der # angewandten Forschung e.V. All rights reserved. # # BSD 3-Clause License # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
# coding: utf-8 from __future__ import unicode_literals import itertools import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( clean_html, determine_ext, dict_get, extract_attributes, ExtractorError, float_or_none, int_or_none, parse_duration...
import os import smart_open import json import re import urllib.request def load_http_text(url): with urllib.request.urlopen(url) as f: return f.read().decode("utf-8") def load_text(path): if path.startswith("http://") or path.startswith("https://"): return load_http_text(path) else: ...
class FileManagerInterface: """FileManagerInterface defines interface for handling read/write files to its asset/meta storage inside tintin's projects """ def list(self, prefix: str) -> [str]: """list: list all elements (including files and dirs) under the prefix Args: pref...
#!/usr/bin/env python data = '../data/fm_train_real.dat' parameter_list = [[data]] def converter_factoranalysis(data_fname): try: import numpy from shogun import FactorAnalysis, EuclideanDistance, CSVFile features = sg.create_features(CSVFile(data_fname)) converter = FactorAnalysis() converter.set_target_...