text
stringlengths
1
927k
import os from flask import Flask def create_app(test_config=None): # create and configure the app app = Flask(__name__, instance_relative_config=True) app.config.from_mapping( SECRET_KEY='dev', DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'), ) if test_config is None: ...
# Inspired in # https://github.com/grizzlypeaksoftware/Flask-Stock-Widget # https://github.com/rubenafo/yfMongo import sys, os import re import csv import json from datetime import datetime, date, time, timedelta from itertools import zip_longest import numpy as np import pytz import yfinance as yf import ast import c...
import json import logging import os import platform import shutil from subprocess import DEVNULL, call, Popen, PIPE import sys logger = logging.getLogger(__name__) on_linux = platform.system() == "Linux" def check_cmd(argv): try: call(argv, stdout=DEVNULL, stderr=DEVNULL, close_fds=True) return ...
"""config URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based ...
import connexion import six from swagger_server.models.access_token import AccessToken # noqa: E501 from swagger_server.models.errors import Errors # noqa: E501 from swagger_server.models.graph_list_type import GraphListType # noqa: E501 from swagger_server.models.results import Results # noqa: E501 from swagger_s...
import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer from decimal import Decimal import csv def processFile(inFile): lst = [] with open(inFile) as f: for line in f: tmp = line.strip().split(",") lst.append(tmp) # sums = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# coding=utf-8 from __future__ import absolute_import, division, print_function from click import Choice, option class OperatingSystem(object): """ An enumeration of supported operating systems for Vagrant provisioning of VMs. """ fedora = 'fedora' centos = 'centos' rhel = 'rhel' class ...
import os import sys from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) if sys.version_info.major > ...
# # Copyright 2016 Quantopian, 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 wr...
#!/usr/bin/env python3 # This code is released under the MIT License in association with the following paper: # # CLOSURE: Assessing Systematic Generalization of CLEVR Models (https://arxiv.org/abs/1912.05783). # # Full copyright and license information (including third party attribution) in the NOTICE file (https://g...
from PySide6.QtGui import * from PySide6.QtCore import * from PySide6.QtWidgets import * from config import * __all__ = ['PreferenceDialog'] class PrimerTagLabel(QLabel): base_url = "https://primer3.org/manual.html#{}" def __init__(self, name, tag, parent=None): super().__init__(parent) self.tag = tag self....
#!#-*-coding:utf-8 -*-
import sys import pygame from pygame.locals import * import moyu_engine.config.data.constants as C import moyu_engine.config.system.tilemap_system class MainWindow: def blit(): blit_surface = pygame.Surface(C.window['size']).convert_alpha() background_surface = pygame.Surface(C.window['size'])....
import jsons import pika from pika.exchange_type import ExchangeType class MQPublisher(object): EXCHANGE = 'SatTrackerWorker' QUEUE = 'WorkerIn' ROUTING_KEY = 'In' def __init__(self, amqp_url) -> None: self._connection = None self._channel = None self._deliveries = None ...
import os import cv2 import time import argparse import torch import warnings import numpy as np from detector import build_detector from deep_sort import build_tracker from utils.draw import draw_boxes from utils.parser import get_config from utils.log import get_logger from utils.io import write_results class Vide...
from __future__ import absolute_import from __future__ import unicode_literals from datetime import date, datetime, time from decimal import Decimal, InvalidOperation from six import string_types from corehq.util.dates import iso_string_to_date, iso_string_to_datetime import six class TransformedGetter(object): "...
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/structure/shared_installation_mining_liquid.iff" result.at...
import dataclasses from typing import List, Tuple, Iterator, Optional from blspy import G2Element from chinilla.types.blockchain_format.coin import Coin, coin_as_list from chinilla.types.blockchain_format.program import Program, INFINITE_COST from chinilla.types.blockchain_format.sized_bytes import bytes32 from chini...
from orbsim.r3b_2d.simulators import run_sim from multiprocessing import Pool import matplotlib.pyplot as plt import numpy as np # import pygmo as pg # from pygmo import algorithm import os import sys from orbsim.r3b_2d.simulators import run_sim # from orbsim.plotting import orbitplot2d, orbitplot_non_inertial from ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import test_anglo_saxon_valuation_reconciliation from . import test_sale_stock from . import test_sale_stock_lead_time from . import test_sale_order_dates
''' Created on May 7, 2021 @author: mballance ''' import cocotb from fwnoc_tests.fwnoc.fwnoc_test_base import FwnocTestBase from fwnoc_bfms.fwnoc_channel_bfm import FwNocPacket class SingleInflightP2P(FwnocTestBase): async def run(self): pkt = FwNocPacket() pkt.src_tile_x = 0 pkt.src_...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
import pandas as pd from sklearn.preprocessing import OneHotEncoder from sklearn.feature_extraction.text import CountVectorizer from sklearn.naive_bayes import GaussianNB from sklearn2pmml import sklearn2pmml from sklearn2pmml.decoration import ContinuousDomain, CategoricalDomain from sklearn2pmml.pipeline import PMMLP...
# Generated by Django 2.0.2 on 2018-03-04 18:41 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Tweet', fields=[ ('id', models.AutoField(au...
import cv2 as cv cap = cv.VideoCapture(0) while(True): ret, frame = cap.read() cv.imshow('Frame', frame) if cv.waitKey(1) & 0xFF == ord('q'): break cap.release() cv.destroyAllWindows()
import platform import sys from pathlib import Path import pytest from _pytest import pytester HERE = Path(__file__).absolute().parent if platform.system() == "Windows" and (sys.version_info.major >= 3 and sys.version_info.minor >= 8): AIOHTTP_OUTPUT = "DEBUG:asyncio:Using proactor: IocpProactor" else: AIOHT...
################################################## # Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2020 # ################################################################## # Regularized Evolution for Image Classifier Architecture Search # ################################################################## import os, sys, t...
import os import csv # Set path for data file csvpath = os.path.join('Resources','pybank.csv') #define formula for average P&L def average(x): return sum(x)/len(x) #Open File to read and analyze with open(csvpath,'r') as datafile: #Set Comma as delimiter datafile = csv.reader(datafile, delimiter=',') #S...
import logging import os from typing import Text, Optional, Dict, List, Union import rasa.shared.data import rasa.shared.utils.io from rasa.shared.core.domain import Domain from rasa.shared.core.training_data.story_reader.markdown_story_reader import ( MarkdownStoryReader, ) from rasa.shared.core.training_data.sto...
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE import pytest # noqa: F401 import numpy as np # noqa: F401 import awkward as ak # noqa: F401 def test(): one = ak.Array([1, 2, 3, 4]) two = ak.Array(["aa", "bb", "cc", "dd"]) with pytest.raises(ValueError): ...
class ParameterDefinition(object): def __init__(self, name, param_type=None, value=None): self.name = name self.param_type = param_type self.value = value class Parameter(object): def __init__(self, definition): self.definition = definition self.value = definition.value...
""" Use Jinja and data from Home Assistant to generate your README.md file For more details about this component, please refer to https://github.com/custom-components/readme """ from __future__ import annotations import asyncio import json import os from shutil import copyfile from typing import Any, List import hom...
def falling(n, k): """Compute the falling factorial of n to depth k. >>> falling(6, 3) # 6 * 5 * 4 120 >>> falling(4, 3) # 4 * 3 * 2 24 >>> falling(4, 1) # 4 4 >>> falling(4, 0) 1 """ "*** YOUR CODE HERE ***" def sum_digits(y): """Sum all the digits of y. >>> ...
import asyncio import gc import logging import os import pickle import random import subprocess import sys import threading import traceback import warnings import weakref import zipfile from collections import deque from contextlib import suppress from functools import partial from operator import add from threading i...
""" This module is experimental. :meta private: """ # Can't import this high-level node type before importing graphs.nodes, # because it requires .graphs, and .graphs requires .nodes! from collections import OrderedDict # TODO ## COMPLETELY UNTESTED work in progress # This was partially implemented as a way to thin...
import torch from torch.autograd import Function from torch import nn import torch.nn.functional as F def op_copy(optimizer): for param_group in optimizer.param_groups: param_group['lr0'] = param_group['lr'] return optimizer def lr_scheduler(optimizer, iter_num, max_iter, gamma=10, power=0.75): de...
# -*- coding: utf-8 -*- # Copyright 2017 IBM RESEARCH. 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 requ...
from unittest import TestCase import elegy import jax.numpy as jnp import pytest class MetricTest(TestCase): def test_basic(self): class MAE(elegy.Metric): def call(self, y_true, y_pred): return jnp.abs(y_true - y_pred) y_true = jnp.array([1.0, 2.0, 3.0]) y_pr...
import requests import os import json import base64 import random import re import string import datetime import sqlite3 import pyautogui import secrets import shutil import zipfile import socket #from Crypto.Cipher import AES class Grabber: def __init__(self): self.tokens = [] self.valid = [] ...
# -*- coding: utf-8 -*- # # michael a.g. aïvázis # orthologue # (c) 1998-2021 all rights reserved # # externals import re # for the formula compiler import weakref # to keep a reference to my model import operator # for the computation of my value import functools # for the computation of my value # my declaration ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-07-19 14:42 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('accounts', '0012_user_department'), ...
# MINLP written by GAMS Convert at 04/21/18 13:52:41 # # Equation counts # Total E G L N X C B # 1786 418 0 1368 0 0 0 0 # # Variable counts # x b i s1s s2s sc ...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
''' a simple Yes/No Popup LICENSE : MIT ''' from kivy.uix.popup import Popup from kivy.properties import StringProperty from kivy.lang.builder import Builder Builder.load_string(''' #<KvLang> <YesNoPopup>: FloatLayout: Label: size_hint: 0.8, 0.6 pos_hint: {'x': 0.1, 'y':0.4}...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This is an Astropy affiliated package. """ # Affiliated packages may add whatever they like to this file, but # should keep this content at the top. # ---------------------------------------------------------------------------- from ._astropy_init im...
""" mss.tutorials.tutorial_kml ~~~~~~~~~~~~~~~~~~~~~~~~~~ This python script generates an automatic demonstration of how to overlay kml flles on top of the map in topview. kml(key hole markup language) is an XML based file format for demonstrating geographical context. This will demonstrate how to ...
from code.api.core.Screen import Screen from code.api.core.Surface import Surface from code.api.core.Frame import Frame from code.api.data.Images import Images from code.api.data.Text import Text, TextFormat from code.api.event.Action import Runclass class sort(Screen): def __init__(self): super().__init_...
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-10-31 06:58 from __future__ import unicode_literals import django.db.models.manager from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Creat...
# coding=utf-8 # Copyright 2021 The Facebook Inc. and The HuggingFace Inc. team. 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/LI...
"""Global fixtures for integration_blueprint integration.""" # Fixtures allow you to replace functions with a Mock object. You can perform # many options via the Mock to reflect a particular behavior from the original # function that you want to see without going through the function's actual logic. # Fixtures can eith...
from sys import version_info from unittest import TestCase from xml.etree import ElementTree from pyclarity_lims.entities import ProtocolStep, StepActions, Researcher, Artifact, \ Step, StepPlacements, Container, Stage, ReagentKit, ReagentLot, Sample, Project from pyclarity_lims.lims import Lims from tests import N...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Attachment', fields=[ ], options={ ...
from pprint import pprint from visdom import Visdom import pathlib import json import sys import matplotlib.pyplot as plt def download_env(env): vis = Visdom('http://logserver.duckdns.org', port=5010) data = vis.get_window_data(env=env) d = json.loads(data) n_deleted = [] test_acc_avg = [] ...
import os import datetime # move to correct path FILE_PATH = os.path.join(os.path.dirname( os.path.realpath(__file__)), "backend") os.chdir(FILE_PATH) # day before first fetch date date = datetime.datetime(2019, 10, 1) for i in range(0, 52): date += datetime.timedelta(days=1) dateStr = date.strftime('%Y-...
import numpy as np import logging from plain_fdm.servicesFDM.utils import Utils logging.basicConfig(filename='pid_regler.log', filemode='w', level=logging.DEBUG) # siehe auch Drohne-Code Unity class PidRegler(object): def __init__(self): self.utils = Utils() self.kpaElevator = 110 self...
import git import os import sys import subprocess from tools.config import Config from tools.logger import log_error, log_info def exit_if_not_executed_in_ide_environment(): '''This part checks if environment variables is set or not.''' if not ("ICSD_FILESERVER_USER" and "ICSD_FILESERVER_PASSWD") in os.envir...
import abc import numpy as np import tensorflow as tf from elasticdl.python.common.constants import DistributionStrategy from elasticdl.python.common.log_utils import default_logger as logger from elasticdl.python.common.save_utils import CheckpointSaver from elasticdl.python.elasticdl.layers.embedding import Embeddi...
# -*-coding:utf-8-*- import tensorflow as tf import numpy as np from tensorflow.python import pywrap_tensorflow import os # The save address of the weight of baseline quantization. FILE_PATH_old = "/home/zxc/Liu/Bit-Bottleneck-ResNet/logs_Bit_Bottleneck/old/model.ckpt" # The new address used to save the transfer weig...
"""PBX object types""" import enum from typing import cast, List, Optional import deserialize from .pbxobject import PBXObject from .buildphases import PBXBuildPhase from .buildrules import PBXBuildRule from .pathobjects import PBXFileReference from .xcobjects import XCConfigurationList class PBXProductType(enum.E...
from django import forms from django.forms import fields,widgets from django.contrib.auth.models import User from django.db.models import Q from .models import Department,Plan from .models import Assets class PlanapplicationsForm(forms.Form): department = forms.CharField( label='申报部门', widget=forms...
""" Copyright (c) 2022 Intel Corporation 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 writin...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import re from ctypes import CDLL, c_void_p, c_char_p, c_int, c_ulong, c_uint, c_long, c_size_t, POINTER from .. import _backend_config from .._errors import pretty_message from .._ffi import FFIEngineError, get_librar...
import os import threading import time import warnings from django.core.signals import setting_changed from django.db import connections, router from django.db.utils import ConnectionRouter from django.dispatch import Signal, receiver from django.utils import timezone from django.utils.functional import empty templat...
#!/usr/bin/env python import os, sys, codecs import gzip def usage(): print "Usage info for chunki.py" print " chunki.py size file file ..." print "Where:" print " size - chunk size" print " file - corpus file, plain UTF8, same number of lines each" print " output - chunk_000/files" print ...
import os from dotenv import load_dotenv, find_dotenv # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname( os.path.dirname( os.path.dirname( os.path.abspath(__file__) ) ) ) # Environment variables # Check for and load environment vari...
import logging from shutit_module import ShutItModule from minishift_library import cicd from minishift_library import staticip from minishift_library import kopf from minishift_library import helmflux from minishift_library import networkpolicy class shutit_minishift(ShutItModule): def build(self, shutit): plat...
import dash_html_components as html def layout(): return html.Div( html.P(f"This is the content of the Home page.") )
""" Defines a solver using :mod:`scipy.integrate` .. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de> """ from typing import Callable import numpy as np from ..fields.base import FieldBase from ..pdes.base import PDEBase from .base import SolverBase class ScipySolver(SolverBase): """class for solving ...
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
import logging import os # TODO move to config LOG_FILENAME = "messages.log" LOG_FORMAT = "%(asctime)s [%(threadName)-12.12s] [%(levelname)-5.5s]\t%(message)s" LOG_LEVEL = os.environ.get('LOG_LEVEL', 'DEBUG').upper() assert LOG_LEVEL in ['DEBUG', 'INFO', 'WARNING', 'ERROR'] def configure_logger(): logging.basi...
{ 'variables': { 'SMRF_LIB_DIR': '/usr/local/lib', 'SMRF_INCLUDE_DIR': '/usr/local/include' }, 'targets': [ { 'target_name': 'smrf-native-cpp', 'sources': [ 'src/smrf.cpp' ], 'cflags_cc': [ '-std=c++14' ], 'cflags!': [ '-fno-exceptions'], 'cflags_cc!': [ '-fno-exceptions'], 'incl...
''' nome = input('Insira seu nome: ') if nome == 'Mendes': print('Que nome lindo você tem!') else: print('Seu nome é tão normal!') print('Bom dia {}!'.format(nome)) ''' #DESAFIO_28 ''' from random import randint from time import sleep x = randint(0,5) y = int(input('Digite um número de 0 à 5: ')) print('Loading...
import re from copy import copy from typing import List from voluptuous import MatchInvalid, Schema, Required from .items import UNDEFINED, LeafBase class DatabaseLeaf(LeafBase): _pattern = re.compile(r'([a-z0-9\+]{1,})://([^:]+):([^@]+)@(([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]).([01]?[0-9]?[0-9]|2[0-4][0-9]|25[...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test wallet import RPCs. Test rescan behavior of importaddress, importpubkey, importprivkey, and impor...
#=============================================================================== # Imports #=============================================================================== from tracer.dbgeng import ( Struct, ) #=============================================================================== # Tests #==============...
from rest_framework import serializers from django.contrib.auth.models import User from django.contrib.auth import authenticate # user serializer class userSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('id','username','email') # register serializer class registerSe...
#!/usr/bin/env python """ Various utility functions for PSF measurement. Basically trying to consolidate/improve what is common between the several different scripts that do this. Hazen 03/18 """ import numpy import scipy import scipy.ndimage import storm_analysis.sa_library.imagecorrelation as imgCorr class ZScal...
import math import numpy as np from PyQt5.QtCore import Qt, QPoint, QPointF, QSize, QRect, pyqtSignal from PyQt5.QtGui import QImage, QPainter, QPen from PyQt5.QtWidgets import QWidget, QToolTip # FIXME[todo] # * analyse the possible data types of the matrices that can be displayed # and adapt the code according...
""" To generate a Bernstein-Vazirani algorithm using 5 qubits, type the following. python bv_gen.py -q 5 -o bv5 The resulting circuit is stored at bv5.qasm and its drawing at bv5.tex. For more details, run the above command with -h or --help argument. @author Raymond Harry Rudy rudyhar@jp.ibm.com """ import sys impo...
#/usr/bin/python import serial import time import matplotlib.pyplot as plt import numpy as np import os """"""""""""""""""""""""""""""""""" """""""NEVS BEER SCRIPT"""""""""""" """"""""""""""""""""""""""""""""""" ###need to add exception handler for serial disconnection ## SETUP SERIAL PORT try: ser = serial....
#!/usr/bin/env python3 import json import requests # Configuration skipFailure = 0 # Disable environment import to avoid proxying requests session = requests.Session() session.trust_env = False success = 1 response = None try: response = session.get("http://127.0.0.1:8088/api/getLastTWCResponse", timeout=30) e...
from abc import ABC, abstractmethod from domain.errors.failure import Failure from domain.errors.image_failure import ImageFailure from domain.repositories.image_repository_abstraction import ImageRepositoryAbstraction class GetAllGlaucomatousImagesPathsAbstraction(ABC): @abstractmethod def __init__(self, re...
""" Module to test approval workflows """ import json import pytest from pinakes.main.approval.tests.factories import ( TemplateFactory, ) from pinakes.main.approval.tests.factories import ( WorkflowFactory, ) from pinakes.main.catalog.tests.factories import ( PortfolioFactory, ) from pinakes.main.approval....
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
#!D:\Study\noompy\venv\Scripts\python.exe # Copyright (c) 2005-2012 Stephen John Machin, Lingfo Pty Ltd # This script is part of the xlrd package, which is released under a # BSD-style licence. from __future__ import print_function cmd_doc = """ Commands: 2rows Print the contents of first and last row in e...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ] operations = [ migrations.CreateModel( name='TimelineItem', ...
from __future__ import division import math import vec3, vec4 def identity(): return (0.0,0.0,0.0,1.0) def fromaxisangle(axisangle): axis,angle= axisangle ang_2= angle/2.0 s_ang= math.sin(ang_2) c_ang= math.cos(ang_2) q= vec3.mulN(axis, s_ang) + (c_ang,) return normalize(q) def fromnormals(n1,n2): axis,an...
from google.appengine.ext import webapp from wsgiref.handlers import CGIHandler from model import Membership from model import Group class WhoHandler(webapp.RequestHandler): def get(self): page = self.request.get('p'); if page is None or page == '': page = 1 else: page = int(page) offset = (page -...
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-10-26 20:17 from __future__ import unicode_literals from django.db import migrations import lego.apps.content.fields class Migration(migrations.Migration): dependencies = [("comments", "0003_auto_20170903_2206")] operations = [ migration...
#!/usr/bin/env python3 from testUtils import Utils from Cluster import Cluster from WalletMgr import WalletMgr from TestHelper import TestHelper import random Print=Utils.Print errorExit=Utils.errorExit args=TestHelper.parse_args({"-p","-n","-d","-s","--nodes-file","--seed","--p2p-plugin" ...
""" Base and utility classes for pandas objects. """ import builtins from collections import OrderedDict import textwrap import warnings import numpy as np import pandas._libs.lib as lib from pandas.compat import PYPY from pandas.compat.numpy import function as nv from pandas.errors import AbstractMethodError from pa...
""" .. currentmodule:: dgl DGLGraph and Node/edge Features =============================== **Author**: `Minjie Wang <https://jermainewang.github.io/>`_, Quan Gan, Yu Gai, Zheng Zhang In this tutorial, you learn how to create a graph and how to read and write node and edge representations. """ ######################...
import sqlalchemy import sqlalchemy.orm from entity import * class Schedule: """Represents a full GTFS data set.""" def __init__(self, db_connection): self.db_connection = db_connection self.db_filename = None if '://' not in db_connection: self.db_connection = 'sqlite:...
import ai.causalcell.utils.configuration as configuration import ai.causalcell.datasets.synthetic_dataset as sd import logging import numpy as np import torch import random import os import copy import dill as pickle import skopt from collections import OrderedDict # from ai.causalcell.datasets.synthetic_dataset impor...
if __name__ == '__main__': import sys import os import distutils.util build_lib = 'build/lib' build_lib_ext = os.path.join( 'build', 'lib.%s-%s' % (distutils.util.get_platform(), sys.version[0:3]) ) sys.path.insert(0, build_lib) sys.path.insert(0, build_lib_ext) import test_...
import torch import torch.nn as nn import torch.nn.functional as F import pdb class BLSTMMaskEstimator(nn.Module): def __init__(self, input_dim=513, hidden_dim=512, num_layers=1, dropout=0.3, bidirectional=True): super(BLSTMMaskEstimator, self).__init__() self.dropout = dropout # blstm_layer...
"""core URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vi...
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 5 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from isi_sdk_8_1_0.models.cluster...