text
stringlengths
957
885k
import numpy as np from subprocess import call import os import sys sys.path.insert(1,'../') import banner import pc import pylhe import kinematics as kin import collections from scipy import interpolate, integrate, optimize # Extract the axion from banner def get_mass_from_pc(rd,pid=622, banner_tag='HPS'): bf...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ##...
<gh_stars>10-100 # Copyright (C) 2010-2011 <NAME> # Copyright (C) 2011 <NAME> # Copyright (C) 2015 <NAME> # Copyright (C) 2016 <NAME>, KKG - <EMAIL> # # 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 S...
<reponame>ffcccc/MachineLearning """ @ Filename: AssociationAnalysis.py @ Author: Danc1elion @ Create Date: 2019-05-27 @ Update Date: 2019-06-02 @ Description: Implement AssociationAnalysis """ class Apriori: def __init__(self, min_support=0.5, min_confidence=0.6): self.min_suppor...
#!/usr/bin/env python import dbm.gnu import os import os.path import sys from google.cloud import pubsub_v1, storage from tqdm import tqdm from shared import ( encode_int, encode_json, future_waiter, get_mogile_files_from_database, get_state_int, make_bucket_map, make_db_connection, m...
<reponame>AmaxJ/TaskWhip #run this file to create and populate a db with some dummy values from datetime import datetime import sys import os sys.path.insert(0, os.path.abspath('..')) from api import db from api.models.users import User from api.models.tasks import Task from api.models.groups import Group, Company de...
# coding=utf-8 """ Module to detect the folder type. """ import os import re import configparser def get_files(path, exclude=(), ignore_symlinks=True): """ Function to get files Parameters ---------- path : str Path walk through. exclude : List[str] or Tuple[str] List of file...
<filename>rc_pose_controller/src/pose_controller_with_reg_func_goal_tolerance.py #! /usr/bin/env python # coding: utf-8 # This is pos controller for like-car robot import math import numpy as np import time import rospy import tf from geometry_msgs.msg import Twist, Pose, TwistStamped, PoseStamped from geometry_msgs...
### Task Serializers ### from datetime import timedelta from django.utils import timezone from django.core.urlresolvers import reverse from rest_framework import serializers from task.models import Task, TaskDirectory, Assignment from item.models import Item from slave.settings import * class AssignmentSerial...
#!/usr/bin/env python # coding: utf-8 # In[1]: """ LICENSE MIT 2020 <NAME> Website : http://www.covidtracker.fr Mail : <EMAIL> README: This file contains scripts that download data from data.gouv.fr and then process it to build many graphes. I'm currently cleaning the code, please ask me if something is not clear ...
<reponame>usualoma/mt-plugin-PerformanceProfiler import pytest from performance_profiler.normalizer.sql_normalizer import SQLNormalizer normalizer = SQLNormalizer() @pytest.mark.parametrize( "identical_queries", [ [ # SELECT # Generally, results from this queries are not iden...
#!/usr/bin/env python3 # TODO: REVISE USING NEW HARDWARE CLASSES __author__ = 'anton' import evdev from hardware.motors import DriveBase, Picker from hardware.sensors import BallSensor from hardware.gamepad import GamePadStub import threading import time MAX_SPEED = 20 # cm per s MIN_SPEED = 3 MAX_TURNRATE = 80 # ...
# _*_ coding:utf-8 _*_ import re import json from pyquery import PyQuery as pq from app.spider_store.common import ( match1, get_html, get_content, ) from app.spider_store.utils.content_cleaner import cleaner def sohu_news_download(url,): html = get_content(url, ) doc = pq(html) if "www.sohu....
# -*- coding: utf-8 -*- """Demonstration / usage example for the new features. Created on Fri Mar 24 13:58:36 2017 @author: <NAME>, <EMAIL> """ from __future__ import division, print_function, absolute_import import numpy as np import matplotlib.pyplot as plt import matplotlib.cm import matplotlib.colors import b...
from functools import partial import asyncio from concurrent.futures import Executor from function_scheduling_distributed_framework.concurrent_pool.custom_threadpool_executor import ThreadPoolExecutorShrinkAble # 没有使用内置的concurrent.futures.ThreadpoolExecutor线程池,而是使用智能伸缩线程池。 async_executor_default = ThreadPoolExecutorSh...
#!/usr/bin/env python """Contains classes that represent biological sequence data. These provide generic biological sequence manipulation functions, plus functions that are critical for the EVOLVE calculations. WARNING: Do not import sequence classes directly! It is expected that you will access them through the molty...
""" List of some ECP URLs and strings """ import re from urllib.parse import quote_plus BASE_URL = "https://api.emea.ecp.electrolux.com" X_API_KEY = "<KEY>" BRAND = "Electrolux" _region_params = { "emea": ["https://api.emea.ecp.electrolux.com", "714fc3c7-ad68-4c2f-9a1a-b3dbe1c8bb35", ...
#! /usr/bin/python3 # HTML frontend from flask import render_template, request, Flask # Email functionality import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText # Random crap import time import unidecode import sys # Create Flask app app = Flask(__name__) def read_pr...
<filename>scripts/hard_box.py # -*- coding: utf-8 -*- """ Program: hard_box Created: Apr 2020 @author: <NAME> (RRCC) <EMAIL> """ ### IMPORTS import random import math as m import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.ticker import Au...
<reponame>jeremyjyang/BioClients<gh_stars>1-10 #!/usr/bin/env python3 """ TCRD db client utility (see also Pharos GraphQL API) """ import os,sys,argparse,re,time,json,logging from ...idg import tcrd from ...util import yaml as util_yaml ############################################################################# if ...
<filename>data.py import matplotlib.pyplot as plt import math import numpy as np from utils import tool import torch def add_particle(img_sz, particle): """ This method cannot build very small particle image. """ u, v = np.meshgrid(np.arange(0, img_sz[0]),np.arange(0, img_sz[1])) u, v = u[:...
<reponame>diogo1790team/inphinity_DM<filename>objects_new/Couples_new.py # -*- coding: utf-8 -*- """ Created on Tue Oct 31 14:40:55 2017 @author: Diogo """ from SQL_obj_new.Couple_sql_new import _Couple_sql_new class Couple(object): """ This class treat the Couples object has it exists in COUPLES table datab...
<reponame>pstephens/project-5g #!/usr/bin/env python3 import argparse import itertools import json import sys def load_data(f): data = [] for line in f: data.append(json.loads(line)) return data def Deg(r): return r["Deg"] n def Values(path): parts = [x for x in path.split(".") if x] ...
from __future__ import absolute_import import os import sys from collections import defaultdict from .gemini_constants import * from . import GeminiQuery class Site(object): def __init__(self, row): self.chrom = row['chrom'] self.end = int(row['end']) self.gt_type = None def _prune_run(ru...
import subprocess import fpga import pathlib import os import time def modelsim_write(proc,command): proc.stdin.write(command) proc.stdin.flush() def modelsim_read(proc): dat = "" dat_out = "" while (True): dat = proc.stdout.read(1) if (not dat) or (dat == ">"): break dat_out=dat_out+dat return dat_...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import numpy from PyQt4 import QtCore, QtGui from gui.qtgen.matrizdialog import Ui_MatrizDialog try: _tr = QtCore.QString.fromUtf8 except AttributeError: _tr = lambda s: s class ShowMatrizDialog(QtGui.QDialog): u""" ...
import os import random import re from datetime import datetime import pytest from invoke.context import Context import test.test_utils.ec2 as ec2_utils import test.test_utils.eks as eks_utils from src.github import GitHubHandler from test.test_utils import is_pr_context, SKIP_PR_REASON # Test only runs in regio...
<filename>chandra_aca/planets.py # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Functions for planet position relative to Chandra, Earth, or Solar System Barycenter. Estimated accuracy of planet coordinates (RA, Dec) is as follows, where the JPL Horizons positions are used as the "truth". - `get_...
<reponame>EvanKepner/m """ API --- These are high level objects for interacting with ``mutatest``. The primary objects include: 1. The ``Genome`` 2. The ``GenomeGroup`` 3. The ``Mutant`` ``Genomes`` are representations of a Python source code file. This includes a representation of the Abstract Syntax Tree (AST) and...
<filename>vmcnet/physics/spin.py """Spin calculations.""" from typing import Callable import jax.numpy as jnp from vmcnet.utils.distribute import get_mean_over_first_axis_fn from vmcnet.utils.typing import Array, P, ModelApply, SLArray def create_spin_square_expectation( local_spin_exchange: ModelApply[P], nele...
<gh_stars>1-10 """surf URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.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')...
<filename>bundle/sagemaker_rl_agent/lib/python3.6/site-packages/markov/gazebo_utils/model_updater.py import time import rospy import markov.rollout_constants as const from markov.log_handler.deepracer_exceptions import GenericRolloutException from markov.domain_randomizations.constants import GazeboServiceName from mar...
""" Ingress example for Kusto DB (from CSV file) There must be a file called ".env" in this folder with the environment variables (each is NAME_OF_VAR=value, one per line). It must be an AAD application that is cleared by the engineering team for access to the databases below and the variables needed are: - TENANT_...
<filename>omnicanvas/svg.py def generate_graphic_svg(graphic, include_fill=None): width = "stroke-width:%.1f;" % graphic.line_width() pattern = "stroke-dasharray:%s;" % { "-": "1,0", "--": "%.1f,%.1f" % (10 * graphic.line_width(), 5 * graphic.line_width()), "..": "%.1f,%.1f" % (1 * graphic.line_w...
<filename>limited/core/admin.py<gh_stars>0 # -*- coding: utf-8 -*- from django.contrib import admin from django import forms from django.contrib.auth.admin import UserAdmin from django.template.defaultfilters import filesizeformat from limited.core.models import FileLib, Permission, Home, History, Link, LUser, Profil...
# coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. from collections import OrderedDict import numpy as np import os import pandas import posixpath import warnings from ast...
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@rules_python//python:pip.bzl", "pip_install") _PANDOC_BUILD_FILE = """ filegroup( name = "pandoc", srcs = ["bin/pandoc"], visibility = ["//visibility:public"], )""" def gapic_generator_python(): _maybe( pip_install, ...
<reponame>HosodaMath/creative_to_svg<filename>Python/testLine.py from mathematics.vector import Vector2 from geometry import line as li from testBaseSVG import TestSVG class Line2Test: def __init__(self, init_position1: Vector2, init_position2: Vector2) -> None: """ line test lineテストの定義クラス ...
from . import SpecValidator AzureSpec = { 'available_os': { 'CentOS7': { 'publisher': SpecValidator(type='string', default="OpenLogic"), 'offer': SpecValidator(type='string', default="CentOS"), 'sku': SpecValidator(type='string', default="7.7"), 'ssh_user': S...
""" OpenVINO DL Workbench Endpoints to work with downloading of files Copyright (c) 2018 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...
<gh_stars>0 # import random # # x = [] # for j in range(0, 10000): # num = random.randint(1, 2000000) # picking between 1-200000 numbers value into num variable # x.append(num) #adding num value to array # with open('originalList5.txt', 'w') as filehandle: #Writing to original list files, i did it 5 time...
""" The models implemented here are the architectures to use the original EmbraceNets and the proposed EmbraceNet +. """ import torch import torch.nn as nn import torch.nn.functional as F from .utils.componets import WeightedSum, EmbraceNet import numpy as np class ModelOne(nn.Module): ''' EembraceNet ''' def...
<reponame>oceanobservatories/ooi-instrument-agent<filename>ooi_instrument_agent/client.py<gh_stars>0 import logging import six import zmq.green as zmq log = logging.getLogger(__name__) context = zmq.Context() DEFAULT_TIMEOUT = 60 class TimeoutException(Exception): status_code = 408 def __init__(self, mess...
<filename>monai/deploy/core/resource.py # Copyright 2021 MONAI Consortium # 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 a...
# This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative works of this code must retain this # copyright notice, and mod...
<filename>test/compiler/test_enot_compiler.py import os import subprocess import unittest from os import listdir from os.path import join from mock import patch import test from enot.__main__ import create from enot.compiler.enot import EnotCompiler from enot.pac_cache.local_cache import LocalCache from enot.packages...
<filename>examples/domain.py # File: domain.py # Author: <NAME> # Created On: 23 Oct 2019 # Purpose: # Defines a combinatorial domain. # Notes: # from .alternative import Alternative from random import randint class Domain: # Precond: # attributes is an integer representing the number of attributes in the...
<gh_stars>0 #!/usr/bin/env python import os import sys sys.path.insert(0,os.environ['HOME']+'/P3D-PLASMA-PIC/p3dpy/') import numpy as np from mpi4py import MPI from subs import create_object from AnalysisFunctions import fcorr # # MPI INITIALIZATION # comm = MPI.COMM_WORLD size = comm.Get_size() rank = comm.Get_rank(...
"""Plugin to read FSM file.""" # Copyright (c) 2017 # Authors: <NAME> <<EMAIL>> # License: BSD 3 clause from __future__ import absolute_import, print_function, division import struct from os.path import basename import numpy as np from six import string_types from .. import formats from ..core import Format from ....
<reponame>nizikawa-worms/WA-Errorlog-Parser<filename>errorlog.py import logging import argparse import pathlib import re from range_key_dict import RangeKeyDict from tabulate import tabulate class Module: # WA 3.8.1 WASegments = RangeKeyDict({ (0x00400000, 0x00401000 - 1): '.HEADER', (0x00401000, 0x0061A000 - 1...
import logging from typing import IO, Any, Dict, Optional, Tuple, cast import yaml from sqlalchemy import create_engine, text from sqlalchemy.engine import Engine from panoramic.cli.config.storage import read_context, update_context from panoramic.cli.errors import ( ConnectionCreateException, ConnectionUrlNo...
<filename>src/audiobook_split_ffmpeg/util.py # Copyright 2018 <NAME> (MawKKe) # # 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 req...
import bson import re from collections import defaultdict import numpy as np import pandas as pd from scipy import sparse as sp from spacy.en import English from sqlalchemy import create_engine import psycopg2 from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction import DictVect...
<gh_stars>0 import os import unittest from abc import ABC from shutil import rmtree import numpy as np import z5py try: import zarr import numcodecs zarr_version = zarr.__version__ except ImportError: zarr = None zarr_version = "0.0.0" class ZarrTestMixin(ABC): shape = (100, 100) chunks ...
import math from enum import Enum import torch.nn as nn import torch.nn.functional as F from pytorch_pretrained_bert import BertModel from pytorch_pretrained_bert.modeling import BertLayerNorm import flint.span_util as span_util import flint.torch_util as torch_util import torch def gelu(x): """Implementation ...
<reponame>ATestGroup233/mindspore # Copyright 2021 Huawei Technologies Co., Ltd # # 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 requi...
<reponame>dkkim93/meta-mapg import torch import gym import numpy as np import torch.nn.functional as F from gym_env import make_env from meta.dice import get_dice_loss from meta.linear_baseline import LinearFeatureBaseline from torch.autograd import Variable from torch.distributions import Categorical, Normal from coll...
"""This submodule implements some convenience dictionaries for working with the periodic table. Data was scraped from a combination of the periodictable Python package (on which matador used to depend) and pymatgen. """ from typing import Dict from dataclasses import dataclass __all__ = ("PERIODIC_TABLE",) @datacl...
<reponame>daesookimds/AWS-DynamoDB-connector import time import boto3 import pandas as pd from boto3.dynamodb.conditions import Key, Attr class DynomoConnector(object): def __init__(self, **param): param = {key: value for key, value in param.items()} self.aws_access_key_id = param["aws_access_key_i...
<filename>django/bin/WebShop/WebShop/usermanager.py #-*- coding:utf-8-*- ######################################################################################## #作者:韩望 #修改者: #日期:2016-04-05 #版本:version 1.0 #备注:用户管理函数,主要解决用户的增,删,查,改 #######################################################################################...
<reponame>MatthewGerber/rl<filename>src/rlai/models/sklearn.py import sys import threading import time from argparse import ArgumentParser from typing import Tuple, List, Optional, Any, Dict import matplotlib.pyplot as plt import numpy as np from matplotlib.backends.backend_pdf import PdfPages from numpy.random import...
from kivy.metrics import dp from kivy.uix.boxlayout import BoxLayout from kivy.uix.image import Image from kivy.uix.label import Label from kivy.uix.screenmanager import ScreenManager, SlideTransition, Screen from kivy.properties import StringProperty, ObjectProperty, BooleanProperty, NumericProperty, ListProperty from...
import numpy as np import lasagne import theano import sys from lasagne import layers from lasagne.nonlinearities import sigmoid, rectify, leaky_rectify, identity from data_aug_necrosis import data_aug sys.path.append('..') from common.batch_norms import batch_norm from common.shape import ReshapeLayer # Parameters...
from django.db import models from django.utils.translation import ugettext as _ from .userAuthenticated import UserAuthenticated from newspaper.models import Journalist, Section, SubSection, Classifield from django.contrib.auth.models import Group, Permission class Redator(UserAuthenticated): def registeringJournalis...
# -*- coding: utf-8 -*- try: from django.db.models import QuerySet, FieldDoesNotExist from django.db.models.fields.related import RelatedField except ImportError: QuerySet = None FieldDoesNotExist = None class Preparer(object): """ A plain preparation object which just passes through data. ...
import json import logging import time import unittest import pytest from tests.cook import mesos, util @pytest.mark.multi_user @unittest.skipUnless(util.multi_user_tests_enabled(), 'Requires using multi-user coniguration ' '(e.g., BasicAuth) for Cook Scheduler'...
"""Test duplicate behavior.""" import graphene import pytest import graphanno from .test_objects import duplicated from .utils import to_dict @graphanno.graph_annotations class Duplicated: """ Wrapper for the Duplicate class. The name is purposely the same as the name of the model, this will cause the n...
ORIGINAL_SERVER_CONFIG=""" bootstrap.servers=ansiblebroker1.example.com:9092 config.storage.replication.factor=3 config.storage.topic=connect-cluster-configs confluent.license.topic=_confluent-command confluent.metadata.basic.auth.user.info=connect_worker:<PASSWORD> confluent.metadata.bootstrap.server.urls=https://ansi...
# DISCLAIMER: This is jank from __future__ import print_function import argparse import csv import json import os import zerorpc from collections import defaultdict from flask import Flask, flash, jsonify, redirect, render_template, url_for from werkzeug.exceptions import NotFound from poketrainer.poke_lvl_data impo...
from __future__ import absolute_import import cPickle as pickle import datetime import json import sys from . import progress from .backup import BackupFile, NewBackup from .cache import Slot from .config import argument_parser, configure, conf, log from .site import Site from .storage import Storage def main(args):...
<gh_stars>0 import pandas as pd import numpy as np import torch from torch import nn from torch.autograd import Variable from sklearn.ensemble import GradientBoostingRegressor import joblib import matplotlib.pyplot as plt from sklearn import metrics #### 使用torch构建LSTM模型 #### class lstm(nn.Module): def __init__(sel...
<filename>scsr_api/scsr/models/test_behaviors.py import json import unittest from mongoengine.connection import _get_db from scsr.models.elements import ElementAO, ElementDB, ElementReferenceDB, ElementReferenceAO, ElementGameMappingAO, ElementGameMappingDB from scsr.models.behaviors import BehaviorAO, BehaviorDB from ...
import appdaemon.plugins.hass.hassapi as hass import datetime # # App which toggles entities for single/double/hold presses of Xiaomi buttons connected via deconz # # Args: # # id: id of the xiaomi button # actor_single: actor to toggle on single click # actor_double: actor to toggle on double click # actor_hold: acto...
""" Utility functions for building neural networks in theano. Most of these are taken from http://deeplearning.net/tutorial/. """ from __future__ import print_function import os import sys import timeit import gzip import pickle import numpy as np import theano import theano.tensor as T def load_data(dataset): ...
<gh_stars>1-10 # 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")...
<filename>Test.py from python_helper import ObjectHelper from reinforcement_learning import hash as hashModule from reinforcement_learning import Set, Dictionary, Tuple, List def getWorksAsIntended(): #arrange simpleSet = {1,2,3} anotherSimpleSet = {1,2,3} anotherSimpleSetInAnotherOrder = {1,3,2} d...
<reponame>kafee23/Deep_Learning_AV<gh_stars>0 # -*- coding: utf-8 -*- """ """ from keras.models import Sequential from keras.layers import Dense, Dropout from keras.wrappers.scikit_learn import KerasRegressor, KerasClassifier from sklearn.model_selection import cross_val_score from sklearn.model_selection im...
<gh_stars>1-10 import os import bpy from bpy.app.handlers import persistent bl_info = { "name": "Auto FBX export", "author": "Flavelius", "description":"Automatically export fbx when saving file", "version": (0, 1), "blender": (2, 80, 0), "category":"Import-Export", "support":"COMMUNITY", ...
# Copyright (c) <NAME>. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory. from fcmaes.astro import MessFull, Messenger, Cassini2, Rosetta, Gtoc1, Cassini1 from fcmaes.optimizer import Optimizer, logger from fcmaes.advretry import Store, retry, minimize def mess...
<gh_stars>0 #! python3 import datetime import matplotlib.pyplot as plt import matplotlib.dates as mdates from color import GREEN, YELLOW, YELLOW_BRIGHT def _get_text_bbox(text): ''' Argument -------- text (matplotlib.Text) Returns ------- bbox (matplotlib.BBox) ''' bbox =...
import cv2 from utils import to_gray, has_alpha, blend_white, get_image_paths import numpy as np import glob import sys from timeit import default_timer as timer def resize(patch): target_height = 15 * 8 curr_height = patch.shape[0] mul = target_height / (1.0 * curr_height) return cv2.resize(patch, N...
<filename>bench/visualize.py ''' Module containing Visualizers. Classes embody Function Plots, for visualization of data. ''' import numpy, matplotlib.pyplot class UnivariatePlot: ''' Univariate Function Plots ''' # assumed to have a univariate function already defined def __init__(self, lowerlimit = None, up...
<gh_stars>100-1000 """Optimizations that rewrite graph interfaces.""" import operator from dataclasses import dataclass from functools import lru_cache, reduce from types import SimpleNamespace as NS from ..info import About from ..ir import Graph, Parameter from ..operations import primitives as P from ..utils impor...
<filename>apps/downtimes.py<gh_stars>1-10 import dash_table import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html import pandas as pd import plotly.graph_objects as go import numpy as np import statistics from plotly.subplots import make_subplots from database_c...
""" Plot electric potential output from CHARMM PBEQ calculation. These units are labeled as Angstrom for grid and unitCharge/Angstrom for potential. Verify these with CHARMM configuration file. By: <NAME> Example: python plotpbeq.py -d /path/to/dir -i -1 -c X """ import os import re import sys import pandas as pd i...
import numpy as np import pandas as pd import subprocess import os import classes def get_sn_from_file(pathToSN, magFlag=False): """Reads photometric data of SN from file formatted as in SNPhotCC Keyword arguments: pathToSN -- path to file from which extract data. Returns: sn -- object of class ...
<gh_stars>1-10 import torch from model import AudioToPose, PoseDiscriminator from transforms import BVHtoMocapData, MocapDataToExpMap, Pipeline, AudioToLogMelSpec from pathlib import Path from argparse import Namespace import torch.nn as nn import librosa d = 1 class GesturePrediction: def __init__(self, checkpo...
<reponame>TuringApproved/Turing_Neural_Networks __author__ = "<NAME>" """In this file, a R-ANN is constructed from a sample Turing Machine. Specifically, the TM decides if an input unary string is composed by an even number of 1's. A Generalized Shift is first created from the TM description. Subsequently, an NDA si...
<filename>bin/headlines.py<gh_stars>0 from mutation import * np.random.seed(1) random.seed(1) def parse_args(): import argparse parser = argparse.ArgumentParser(description='Headline analysis') parser.add_argument('model_name', type=str, help='Type of language model (e.g., hmm, lst...
import yaml import json import requests import csv import pandas as pd from tempfile import NamedTemporaryFile import shutil allowedVocabs = ['ICD10', 'ICD10CM', 'ICD10CN', 'ICD10GM', 'ICD10PCS', 'ICD9CM', 'ICD9Proc', 'ICD9ProcCN', 'LOINC', 'RxNorm', 'RxNorm Extension', 'SNOMED'] def checkIdExits(ID): node_norm...
""" Utilities for exploring the anchor network within a model in order to find the optimal procedure for steering the system to the different anchors. """ import numpy as np try: import openmm.unit as unit except ModuleNotFoundError: import simtk.unit as unit def find_edge_distance(model, src_anchor_index, de...
<filename>client/pyre.py # Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import logging import os import shutil import sys import time import traceback from dataclasses import dat...
''' ## Aliyun ROS HBR Construct Library This module is part of the AliCloud ROS Cloud Development Kit (ROS CDK) project. ```python # Example automatically generated from non-compiling source. May contain errors. import * as HBR from '@alicloud/ros-cdk-hbr'; ``` ''' import abc import builtins import datetime import en...
"""Bilinear layer for NeuralPy""" from torch.nn import Bilinear as _BiLinear from neuralpy.utils import CustomLayer class Bilinear(CustomLayer): """ A bilinear layer is a function of two inputs x and y that is linear in each input separately. Simple bilinear functions on vectors are the dot produ...
from django.http import HttpResponse,HttpResponseRedirect,HttpResponseNotFound from django.http import QueryDict import json from django.contrib.auth.models import User, Group from django.contrib import messages from django.core import serializers from sampledbapp.models import * import django_rq from datetime import d...
<reponame>zhanqxun/cv_fish import win32com import win32com.client if type(__path__)==type(''): # For freeze to work! import sys try: import adsi sys.modules['win32com.adsi.adsi'] = adsi except ImportError: pass else: # See if we have a special directory for the binaries (for developers) win32c...
<filename>change_detection/archive/models/smallunet.py # <NAME> # https://rcdaudt.github.io/ # <NAME>., <NAME>., & <NAME>. "Fully convolutional siamese networks for change detection". In 2018 25th IEEE International Conference on Image Processing (ICIP) (pp. 4063-4067). IEEE. import torch import torch.nn as nn import ...
<reponame>acady14/transitEval __author__ = 'acady' import googlemaps import json import time import csv import math import numpy as np import datetime as dt import pickle import random from RouteClass import route from GmapsConnection import * from geometry import * query_name=str(dt.datetime.now().y...
from __future__ import annotations import logging import os import shutil from distutils.dir_util import copy_tree from functools import lru_cache from typing import List, Tuple import git from ogr.abstract import GitProject from packit.config import PackageConfig from packit.constants import DG_PR_COMMENT_KEY_SG_PR...
<reponame>nakamura196/neural-neighbors import numpy as np import faiss import time import json def main(): with open('data.json', 'r') as f: xb = np.array([np.array(json.loads(l.strip())).astype('float32') for l in f]) for i in range(len(xb)): xb[i][0] += np.random.random() nq = 1 xq ...