code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np import matplotlib.pyplot as plt import argparse import scipy.io as sio import collections def main(): exps = ['path/result.mat'] labels = ['method'] print(exps, labels) num = 0 for exp, label in zip(exps, labels): mat = sio.loadmat(exp) prs = mat['sumprecisio...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "scipy.io.loadmat", "matplotlib.pyplot.legend", "matplotlib.pyplot.axis", "numpy.arange", "numpy.array", "numpy.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid" ]
[((1245, 1273), 'numpy.linspace', 'np.linspace', (['(0.2)', '(0.8)'], {'num': '(8)'}), '(0.2, 0.8, num=8)\n', (1256, 1273), True, 'import numpy as np\n'), ((1539, 1553), 'matplotlib.pyplot.grid', 'plt.grid', (['(True)'], {}), '(True)\n', (1547, 1553), True, 'import matplotlib.pyplot as plt\n'), ((1559, 1589), 'matplotl...
import time import torch from DominantSparseEigenAD.Lanczos import symeigLanczos, DominantSymeig def test_normal(): n = 1000 A = 0.1 * torch.rand(n, n, dtype=torch.float64) A = A + A.T k = 300 print("\n----- test_normal -----") print("----- Dimension of real symmetric matrix A: %d -----" % n) ...
[ "torch.ones", "torch.symeig", "torch.autograd.grad", "torch.randn", "torch.diag", "DominantSparseEigenAD.Lanczos.symeigLanczos", "time.time", "numpy.linspace", "torch.rand", "torch.matmul", "torch.allclose", "torch.from_numpy" ]
[((361, 372), 'time.time', 'time.time', ([], {}), '()\n', (370, 372), False, 'import time\n'), ((432, 451), 'DominantSparseEigenAD.Lanczos.symeigLanczos', 'symeigLanczos', (['A', 'k'], {}), '(A, k)\n', (445, 451), False, 'from DominantSparseEigenAD.Lanczos import symeigLanczos, DominantSymeig\n'), ((462, 473), 'time.ti...
import numpy as np # random land generator civ_arr = ['#', '.'] civ_cont = np.random.choice(civ_arr, size=(11,11)) print(civ_cont) # area of land unique, counts = np.unique(civ_cont, return_counts = True) land_sea_count = dict(zip(unique, counts)) print(land_sea_count) land_area = str(land_sea_count['#']) print("Tota...
[ "numpy.argwhere", "numpy.unique", "numpy.random.choice" ]
[((76, 116), 'numpy.random.choice', 'np.random.choice', (['civ_arr'], {'size': '(11, 11)'}), '(civ_arr, size=(11, 11))\n', (92, 116), True, 'import numpy as np\n'), ((165, 204), 'numpy.unique', 'np.unique', (['civ_cont'], {'return_counts': '(True)'}), '(civ_cont, return_counts=True)\n', (174, 204), True, 'import numpy ...
import numpy as np import os from os.path import sep, dirname, realpath import pyqtgraph as pg from pyqtgraph import opengl as gl from pyqtgraph.Qt import QtCore, QtGui import sys path = os.path.dirname(os.path.abspath(__file__)) path = path.split("throttle")[0] sys.path.insert(0, path) import analisis_functions as af...
[ "pyqtgraph.opengl.GLScatterPlotItem", "os.path.abspath", "numpy.load", "pyqtgraph.Qt.QtGui.QApplication.instance", "numpy.empty", "os.path.realpath", "pyqtgraph.Qt.QtGui.QVector3D", "sys.path.insert", "pyqtgraph.Qt.QtCore.QTimer", "pyqtgraph.opengl.GLViewWidget", "pyqtgraph.Qt.QtGui.QApplication...
[((264, 288), 'sys.path.insert', 'sys.path.insert', (['(0)', 'path'], {}), '(0, path)\n', (279, 288), False, 'import sys\n'), ((204, 229), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (219, 229), False, 'import os\n'), ((785, 799), 'numpy.empty', 'np.empty', (['(3,)'], {}), '((3,))\n', (793...
import csv from imdb import IMDb import progressbar from random import shuffle import os.path from zipfile import ZipFile import re import numpy as np def clean_str(string): """ Tokenization/string cleaning for all datasets except for SST. Original taken from https://github.com/yoonkim/CNN_sentence/blob/m...
[ "csv.reader", "zipfile.ZipFile", "numpy.std", "random.shuffle", "numpy.asarray", "numpy.mean", "progressbar.ProgressBar", "re.sub" ]
[((363, 409), 're.sub', 're.sub', (['"""[^A-Za-z0-9(),!?\\\\\'\\\\`]"""', '""" """', 'string'], {}), '("[^A-Za-z0-9(),!?\\\\\'\\\\`]", \' \', string)\n', (369, 409), False, 'import re\n'), ((422, 451), 're.sub', 're.sub', (['"""\\\\\'s"""', '""" \'s"""', 'string'], {}), '("\\\\\'s", " \'s", string)\n', (428, 451), Fals...
import tclab import numpy as np import time import matplotlib.pyplot as plt from gekko import GEKKO # Connect to Arduino a = tclab.TCLab() # Get Version print(a.version) # Turn LED on print('LED On') a.LED(100) # Run time in minutes run_time = 5.0 # Number of cycles with 3 second intervals loop...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "gekko.GEKKO", "matplotlib.pyplot.legend", "numpy.zeros", "numpy.ones", "time.time", "matplotlib.pyplot.draw", "matplotlib.pyplot.ion", "matplotlib.pyplot.figure", "time.sleep", "numpy...
[((133, 146), 'tclab.TCLab', 'tclab.TCLab', ([], {}), '()\n', (144, 146), False, 'import tclab\n'), ((349, 364), 'numpy.zeros', 'np.zeros', (['loops'], {}), '(loops)\n', (357, 364), True, 'import numpy as np\n'), ((875, 898), 'gekko.GEKKO', 'GEKKO', ([], {'name': '"""tclab-mpc"""'}), "(name='tclab-mpc')\n", (880, 898),...
""" Configure HYDRAD simulations """ import os import copy import datetime import tempfile import shutil from distutils.dir_util import copy_tree import numpy as np import astropy.units as u from jinja2 import Environment, PackageLoader, ChoiceLoader, DictLoader import asdf from . import filters from .util import run...
[ "copy.deepcopy", "tempfile.TemporaryDirectory", "numpy.logical_and", "asdf.AsdfFile", "shutil.rmtree", "astropy.units.UnitConversionError", "numpy.floor", "numpy.polyfit", "os.path.exists", "jinja2.Environment", "jinja2.PackageLoader", "datetime.datetime.utcnow", "shutil.copytree", "os.pat...
[((723, 744), 'copy.deepcopy', 'copy.deepcopy', (['config'], {}), '(config)\n', (736, 744), False, 'import copy\n'), ((919, 945), 'jinja2.Environment', 'Environment', ([], {'loader': 'loader'}), '(loader=loader)\n', (930, 945), False, 'from jinja2 import Environment, PackageLoader, ChoiceLoader, DictLoader\n'), ((10883...
import os import argparse import numpy as np import torch from torch.utils.data import DataLoader from model import Encoder, Decoder from dataset import PanoDataset from utils import StatisticDict from pano import get_ini_cor from pano_opt import optimize_cor_id from utils_eval import eval_PE, eval_3diou, augment, aug...
[ "torch.no_grad", "argparse.ArgumentParser", "utils_eval.augment", "torch.load", "model.Decoder", "utils.StatisticDict", "pano_opt.optimize_cor_id", "torch.FloatTensor", "pano.get_ini_cor", "utils_eval.eval_3diou", "torch.sigmoid", "model.Encoder", "torch.device", "numpy.sqrt", "os.path.j...
[((341, 420), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n', (364, 420), False, 'import argparse\n'), ((1875, 1900), 'torch.device', 'torch.device', (['args.device'], {}), '(args.dev...
"""Testing DVS Noise filter implementation. Author: <NAME> Email : <EMAIL> """ from __future__ import print_function, absolute_import import cv2 import numpy as np from pyaer.dvs128 import DVS128 device = DVS128(noise_filter=True) print ("Device ID:", device.device_id) if device.device_is_master: print ("Devic...
[ "cv2.waitKey", "numpy.histogram2d", "numpy.logical_not", "pyaer.dvs128.DVS128", "numpy.clip" ]
[((209, 234), 'pyaer.dvs128.DVS128', 'DVS128', ([], {'noise_filter': '(True)'}), '(noise_filter=True)\n', (215, 234), False, 'from pyaer.dvs128 import DVS128\n'), ((1475, 1497), 'numpy.logical_not', 'np.logical_not', (['pol_on'], {}), '(pol_on)\n', (1489, 1497), True, 'import numpy as np\n'), ((1521, 1620), 'numpy.hist...
import numpy as np from deep_utils.vision.face_detection.main.main_face_detection import FaceDetector from deep_utils.utils.lib_utils.lib_decorators import get_from_config, expand_input, get_elapsed_time, rgb2bgr from deep_utils.utils.lib_utils.download_utils import download_decorator from deep_utils.utils.box_utils.bo...
[ "deep_utils.utils.box_utils.boxes.Box.box2box", "deep_utils.utils.lib_utils.lib_decorators.rgb2bgr", "deep_utils.utils.lib_utils.lib_decorators.expand_input", "numpy.expand_dims", "numpy.where", "deep_utils.utils.box_utils.boxes.Point.point2point", "numpy.vstack", "numpy.round", "numpy.concatenate" ...
[((1103, 1117), 'deep_utils.utils.lib_utils.lib_decorators.rgb2bgr', 'rgb2bgr', (['"""rgb"""'], {}), "('rgb')\n", (1110, 1117), False, 'from deep_utils.utils.lib_utils.lib_decorators import get_from_config, expand_input, get_elapsed_time, rgb2bgr\n'), ((1145, 1160), 'deep_utils.utils.lib_utils.lib_decorators.expand_inp...
"""Spherical linear interpolation (SLERP).""" import numpy as np from ._utils import (check_axis_angle, check_quaternion, angle_between_vectors, check_rotor) def axis_angle_slerp(start, end, t): """Spherical linear interpolation. Parameters ---------- start : array-like, shape (4...
[ "numpy.zeros_like", "numpy.ones_like", "numpy.sin", "numpy.linalg.norm", "numpy.array" ]
[((858, 889), 'numpy.array', 'np.array', (['[w1, w1, w1, 1.0 - t]'], {}), '([w1, w1, w1, 1.0 - t])\n', (866, 889), True, 'import numpy as np\n'), ((901, 926), 'numpy.array', 'np.array', (['[w2, w2, w2, t]'], {}), '([w2, w2, w2, t])\n', (909, 926), True, 'import numpy as np\n'), ((3506, 3553), 'numpy.linalg.norm', 'np.l...
import BeamlineStatusLogger.utils as utils import imageio import pytest from pytest import approx from glob import glob import numpy as np def eccentricity(sx, sy): if sx < sy: sx, sy = sy, sx return np.sqrt(1 - sy**2/sx**2) class TestUtils: @pytest.mark.parametrize('repeat', range(20)) def ...
[ "numpy.load", "BeamlineStatusLogger.utils.get_peak_parameters", "imageio.imread", "BeamlineStatusLogger.utils.create_test_image", "pytest.raises", "BeamlineStatusLogger.utils.np.random.seed", "glob.glob", "pytest.mark.parametrize", "pytest.approx", "numpy.sqrt" ]
[((218, 248), 'numpy.sqrt', 'np.sqrt', (['(1 - sy ** 2 / sx ** 2)'], {}), '(1 - sy ** 2 / sx ** 2)\n', (225, 248), True, 'import numpy as np\n'), ((1966, 3778), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""file, params"""', "[('tests/images/beam/LM10_2018-3-14_21-14-17.png', (13.51, 247.12, 314.11, \n ...
import matplotlib.pyplot as plt import matplotlib.patches as mpatches import numpy as np Data = np.loadtxt('/Users/changjin/Desktop/test.txt',skiprows=5) Time = Data[:,0] Amp = Data[:,1] n=len(Time) dt=2.5/1000000000000 nu=np.fft.fftfreq(n,dt) fk=np.fft.fft(Amp/n) plt.plot(nu,fk.real,'r') plt.show() #print(dt) #p...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.fft.fft", "numpy.fft.fftfreq", "numpy.loadtxt" ]
[((97, 155), 'numpy.loadtxt', 'np.loadtxt', (['"""/Users/changjin/Desktop/test.txt"""'], {'skiprows': '(5)'}), "('/Users/changjin/Desktop/test.txt', skiprows=5)\n", (107, 155), True, 'import numpy as np\n'), ((228, 249), 'numpy.fft.fftfreq', 'np.fft.fftfreq', (['n', 'dt'], {}), '(n, dt)\n', (242, 249), True, 'import nu...
import numpy as np import airsim import gym from gym import error, spaces, utils from gym.utils import seeding from gym.spaces import Tuple, Box, Discrete, MultiDiscrete from collections import OrderedDict import time from event_sim import EventSimulator from event_processor import EventProcessor import cv2 import t...
[ "gym.spaces.Discrete", "airsim.ImageRequest", "airsim.to_quaternion", "torch.no_grad", "gym.utils.seeding.np_random", "airsim.Pose", "cv2.cvtColor", "event_processor.EventProcessor", "numpy.fromstring", "gym.envs.classic_control.rendering.SimpleImageViewer", "numpy.dstack", "numpy.hstack", "...
[((1344, 1367), 'gym.utils.seeding.np_random', 'seeding.np_random', (['seed'], {}), '(seed)\n', (1361, 1367), False, 'from gym.utils import seeding\n'), ((2500, 2542), 'airsim.Vector3r', 'airsim.Vector3r', (['goal[0]', 'goal[1]', 'goal[2]'], {}), '(goal[0], goal[1], goal[2])\n', (2515, 2542), False, 'import airsim\n'),...
from flask import Flask, render_template, request from flask.ext.socketio import SocketIO, emit import random import numpy as np from Algorithms import * import base64, zipfile, csv from io import StringIO, BytesIO app = Flask(__name__) app.config['SECRET_KEY'] = str(random.random()) socketio = SocketIO(app) @app.rou...
[ "flask.ext.socketio.SocketIO", "numpy.matrix", "io.BytesIO", "io.StringIO", "zipfile.ZipFile", "csv.reader", "flask.ext.socketio.emit", "flask.Flask", "base64.b64decode", "random.random", "numpy.array", "flask.render_template" ]
[((222, 237), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (227, 237), False, 'from flask import Flask, render_template, request\n'), ((297, 310), 'flask.ext.socketio.SocketIO', 'SocketIO', (['app'], {}), '(app)\n', (305, 310), False, 'from flask.ext.socketio import SocketIO, emit\n'), ((269, 284), 'rand...
from dynamic_graph.sot.core.matrix_util import matrixToTuple, vectorToTuple,rotate, matrixToRPY from dynamic_graph.sot.torque_control.control_manager import * from dynamic_graph.sot.torque_control.tests.robot_data_test import initRobotData from numpy import matrix, identity, zeros, eye, array, pi, ndarray, ones # Inst...
[ "dynamic_graph.sot.torque_control.tests.robot_data_test.initRobotData", "numpy.zeros", "numpy.ones" ]
[((377, 410), 'numpy.zeros', 'zeros', (['(initRobotData.nbJoints + 6)'], {}), '(initRobotData.nbJoints + 6)\n', (382, 410), False, 'from numpy import matrix, identity, zeros, eye, array, pi, ndarray, ones\n'), ((412, 441), 'numpy.zeros', 'zeros', (['initRobotData.nbJoints'], {}), '(initRobotData.nbJoints)\n', (417, 441...
# https://datascience.oneoffcoder.com/autograd-poisson-regression-gradient-descent.html import numpy as np import matplotlib.pyplot as plt import seaborn as sns from numpy.random import normal from scipy.stats import poisson from autograd import grad # define the loss function def loss(w, X, y): y_pred = np.exp(np...
[ "seaborn.kdeplot", "numpy.random.seed", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "autograd.grad", "numpy.array", "numpy.exp", "numpy.random.normal", "numpy.dot", "seaborn.set" ]
[((1911, 1929), 'numpy.random.seed', 'np.random.seed', (['(37)'], {}), '(37)\n', (1925, 1929), True, 'import numpy as np\n'), ((1930, 1955), 'seaborn.set', 'sns.set', ([], {'color_codes': '(True)'}), '(color_codes=True)\n', (1937, 1955), True, 'import seaborn as sns\n'), ((2181, 2190), 'numpy.exp', 'np.exp', (['z'], {}...
import os import logging logging.basicConfig(level=logging.DEBUG) from argparse import ArgumentParser import mxnet as mx import numpy as np from descriptor import get_content_excutor, get_loss_excutor, get_style_excutor, get_tv_grad_executor from generator import get_module from utils import exists, preprocess_img, ...
[ "generator.get_module", "argparse.ArgumentParser", "mxnet.io.DataBatch", "utils.exists", "mxnet.nd.ones", "os.path.exists", "mxnet.nd.load", "descriptor.get_loss_excutor", "os.path.normpath", "mxnet.gpu", "utils.get_img", "mxnet.cpu", "mxnet.nd.array", "utils.img_generator", "os.listdir"...
[((26, 66), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (45, 66), False, 'import logging\n'), ((588, 604), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (602, 604), False, 'from argparse import ArgumentParser\n'), ((3280, 3336), 'utils.exis...
import os.path import random import torchvision.transforms as transforms import torch import numpy as np from data.base_dataset import BaseDataset from data.audio import Audio #from data.image_folder import make_dataset from PIL import Image #def make_dataset(dir): # images = [] # assert os.path.isdir(dir), '%s ...
[ "numpy.load", "numpy.resize", "numpy.floor", "data.audio.Audio", "numpy.zeros", "numpy.clip", "numpy.random.randint", "numpy.memmap", "torch.tensor", "torchvision.transforms.ToTensor" ]
[((2029, 2088), 'data.audio.Audio', 'Audio', (["(input_dir + '/audio.mp3')"], {'write_mel_spectogram': '(False)'}), "(input_dir + '/audio.mp3', write_mel_spectogram=False)\n", (2034, 2088), False, 'from data.audio import Audio\n'), ((3830, 3870), 'torch.tensor', 'torch.tensor', (['self.expressions[frame_id]'], {}), '(s...
""" Copyright 2020 The Secure, Reliable, and Intelligent Systems Lab, ETH Zurich 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 appl...
[ "pandas.DataFrame", "os.mkdir", "json.dump", "training.Training", "argparse.ArgumentParser", "loop_utils.generate_model_index", "numpy.std", "utils.read_exp_file", "numpy.zeros", "sys.path.insert", "os.path.exists", "time.time", "json.dumps", "joblib.Parallel", "numpy.mean", "itertools...
[((763, 791), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""common"""'], {}), "(1, 'common')\n", (778, 791), False, 'import sys\n'), ((5980, 6005), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (6003, 6005), False, 'import argparse\n'), ((6220, 6245), 'utils.read_exp_file', 'utils.read_ex...
from __future__ import annotations import logging import cirq import numpy as np from factor import Add, MAdd, MMult, Ua, MExp, utils TEST_RNG = np.random.default_rng(seed=2022) TEST_N_TRIALS = 3 def _eval( gate: cirq.Gate, register_lengths: list[int], inputs: list[int], expected_outputs: list[int...
[ "factor.utils.prepare_state", "factor.Ua", "numpy.gcd", "factor.utils.bits_to_integer", "cirq.Simulator", "numpy.random.default_rng", "logging.info", "factor.MAdd", "factor.Add", "cirq.Circuit", "factor.MMult", "cirq.LineQubit.range", "cirq.measure", "factor.MExp" ]
[((149, 181), 'numpy.random.default_rng', 'np.random.default_rng', ([], {'seed': '(2022)'}), '(seed=2022)\n', (170, 181), True, 'import numpy as np\n'), ((874, 908), 'cirq.LineQubit.range', 'cirq.LineQubit.range', (['total_qubits'], {}), '(total_qubits)\n', (894, 908), False, 'import cirq\n'), ((947, 961), 'cirq.Circui...
import os import sys import numpy as np from eval_utils import * from sklearn.svm import SVC import seaborn as sns import torch.nn as nn #sys.path.append("../URP") def distance_old(model, model0): distance=0 normalization=0 for (k, p), (k0, p0) in zip(model.named_parameters(), model0.named_parameters()):...
[ "seaborn.lineplot", "numpy.abs", "numpy.log", "matplotlib.cm.get_cmap", "os.getcwd", "torch.nn.CrossEntropyLoss", "numpy.random.RandomState", "numpy.linalg.norm", "numpy.array", "sklearn.svm.SVC", "numpy.round", "os.path.join", "numpy.sqrt" ]
[((607, 624), 'numpy.sqrt', 'np.sqrt', (['distance'], {}), '(distance)\n', (614, 624), True, 'import numpy as np\n'), ((2573, 2594), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (2592, 2594), True, 'import torch.nn as nn\n'), ((7670, 7706), 'sklearn.svm.SVC', 'SVC', ([], {'C': '(3)', 'gamma': '...
import os import time import numpy as np from functools import reduce import torch import torch.nn as nn import torch.nn.functional as F from carle.env import CARLE from carle.mcl import RND2D, AE2D from game_of_carle.agents.agent import Agent class ConvGRNN(Agent): def __init__(self, **kwargs): """ ...
[ "numpy.save", "torch.nn.ConvTranspose2d", "numpy.random.randn", "torch.nn.Conv2d", "functools.reduce", "torch.cat", "time.time", "torch.rand_like", "numpy.mean", "numpy.array", "numpy.random.multivariate_normal", "numpy.matmul", "torch.zeros", "numpy.diag", "torch.nn.LeakyReLU", "numpy...
[((946, 969), 'numpy.mean', 'np.mean', (['params'], {'axis': '(0)'}), '(params, axis=0)\n', (953, 969), True, 'import numpy as np\n'), ((984, 1006), 'numpy.var', 'np.var', (['params'], {'axis': '(0)'}), '(params, axis=0)\n', (990, 1006), True, 'import numpy as np\n'), ((4008, 4020), 'numpy.array', 'np.array', (['[]'], ...
import unittest import numpy as np import tensorflow as tf import keras.backend.numpy_backend import EggNet def indices(a, func): return [i for (i, val) in enumerate(a) if func(val)] def ind2sub(ind, shape): d = np.cumprod(list(reversed(shape))) s = [] for (i, shape_i) in enumerate(shape): ...
[ "unittest.main", "numpy.abs", "numpy.array_equal", "numpy.allclose", "numpy.zeros", "EggNet.MaxPool2dLayer", "EggNet.pooling_max", "numpy.array", "numpy.reshape", "EggNet.Conv2dLayer", "numpy.random.rand" ]
[((6715, 6730), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6728, 6730), False, 'import unittest\n'), ((462, 491), 'EggNet.MaxPool2dLayer', 'EggNet.MaxPool2dLayer', ([], {'size': '(2)'}), '(size=2)\n', (483, 491), False, 'import EggNet\n'), ((507, 575), 'numpy.array', 'np.array', (['[[1, 2, 1, 1], [1, 1, 3, 1]...
# $Id$ # # Copyright (C) 2002-2008 <NAME> and Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ command line utility to...
[ "traceback.print_exc", "getopt.getopt", "rdkit.ML.Data.Stats.MeanAndDev", "numpy.transpose", "numpy.zeros", "rdkit.ML.DecTree.TreeUtils.CollectDescriptorNames", "rdkit.Dbase.DbConnection.DbConnect", "numpy.argsort", "rdkit.six.moves.cPickle.loads", "rdkit.ML.ScreenComposite.CalcEnrichment", "rdk...
[((3380, 3410), 'numpy.zeros', 'numpy.zeros', (['nPts', 'numpy.float'], {}), '(nPts, numpy.float)\n', (3391, 3410), False, 'import numpy\n'), ((3429, 3459), 'numpy.zeros', 'numpy.zeros', (['nPts', 'numpy.float'], {}), '(nPts, numpy.float)\n', (3440, 3459), False, 'import numpy\n'), ((3508, 3538), 'numpy.zeros', 'numpy....
import math import numpy as np import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import pyplot as pb import random from datetime import datetime import time # distance Calculation def dist(x, y, pos): return math.sqrt((pos[0]-x)**2 + (pos[1]-y)**2) # Simul...
[ "numpy.sum", "numpy.average", "math.sqrt", "numpy.subtract", "numpy.std", "time.time", "random.random", "math.log10", "numpy.arange", "random.randrange", "numpy.random.normal", "datetime.datetime.now" ]
[((2789, 2825), 'numpy.arange', 'np.arange', (['(0)', 'areaSize[1]', 'STEP_SIZE'], {}), '(0, areaSize[1], STEP_SIZE)\n', (2798, 2825), True, 'import numpy as np\n'), ((2889, 2925), 'numpy.arange', 'np.arange', (['(0)', 'areaSize[0]', 'STEP_SIZE'], {}), '(0, areaSize[0], STEP_SIZE)\n', (2898, 2925), True, 'import numpy ...
"""Various reusable functions ranging from lidar specific to those which are more generic. """ import numpy as np import xarray as xr from math import degrees, atan2 def generate_beam_coords(lidar_pos, meas_pt_pos): """ Generates beam steering coordinates in spherical coordinate system. Parameters --...
[ "numpy.arctan2", "numpy.sum", "numpy.abs", "math.atan2", "numpy.einsum", "numpy.sin", "numpy.round", "numpy.full", "numpy.arccos", "numpy.radians", "numpy.fill_diagonal", "numpy.roll", "numpy.linalg.inv", "numpy.cos", "numpy.where", "numpy.array", "numpy.random.multivariate_normal", ...
[((1480, 1566), 'numpy.array', 'np.array', (['[lidar_pos[0] - x_array, lidar_pos[1] - y_array, lidar_pos[2] - z_array]'], {}), '([lidar_pos[0] - x_array, lidar_pos[1] - y_array, lidar_pos[2] -\n z_array])\n', (1488, 1566), True, 'import numpy as np\n'), ((1858, 1916), 'numpy.arctan2', 'np.arctan2', (['(x_array - lid...
# -*- coding: utf-8 -*- import collections import dash import dill import json import numpy as np from os import listdir from os.path import isfile, join import pandas as pd import plotly.graph_objects as go import dash_core_components as dcc import dash_html_components as html import dash_table from dash.dependencie...
[ "os.path.join", "pandas.DataFrame", "dash.Dash", "dash_html_components.Div", "dill.load", "numpy.insert", "dash_html_components.Th", "plotly.graph_objects.Figure", "dash.dependencies.Input", "numpy.sort", "dash_core_components.Dropdown", "dash_core_components.Graph", "dash_html_components.Td...
[((1875, 2166), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['method', 'method_id', 'n_episodes', 'nmax_steps', 'gamma',\n 'start_at_random', 'epsilon__init_epsilon', 'epsilon__decay_epsilon',\n 'epsilon__min_epsilon', 'alpha__init_alpha', 'alpha__decay_alpha',\n 'alpha__min_alpha', 'init_Q_type', 'K...
import numpy as np def getIJK(i,j,k,NX,NY,NZ): #Convert index [i,j,k] to a flat 3D matrix index [ijk] return i + (NX)*(j + k*(NY)) def Cartesian2UnstructGrid(DX,DY,DZ,TOPS,NX,NY,NZ): #Convert self.DX to coordiantes-X of unstructure gridblocks #Used in [write_VTU] debug=0 coordX,coordY,co...
[ "matplotlib.pyplot.show", "numpy.log", "numpy.average", "numpy.random.randn", "scipy.ndimage.gaussian_filter", "numpy.zeros", "numpy.min", "numpy.mean", "numpy.max", "numpy.exp", "numpy.log10", "matplotlib.pyplot.subplots" ]
[((4120, 4208), 'matplotlib.pyplot.subplots', 'plt.subplots', (['NumRows', '(3)'], {'figsize': '(4 * 3, NumRows * 3)', 'facecolor': '"""w"""', 'edgecolor': '"""k"""'}), "(NumRows, 3, figsize=(4 * 3, NumRows * 3), facecolor='w',\n edgecolor='k')\n", (4132, 4208), True, 'import matplotlib.pyplot as plt\n'), ((4823, 48...
""" Script to run pan-cancer/cross-cancer classification experiments (i.e. train on one gene across all but one cancer types, test on another gene in another cancer type). """ import sys import argparse import itertools as it from pathlib import Path import numpy as np import pandas as pd from tqdm import tqdm import...
[ "pandas.DataFrame", "pancancer_evaluation.utilities.data_utilities.load_vogelstein", "pancancer_evaluation.utilities.data_utilities.load_sample_info", "pancancer_evaluation.utilities.file_utilities.write_log_file", "argparse.ArgumentParser", "pandas.read_csv", "pancancer_evaluation.data_models.tcga_data...
[((896, 921), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (919, 921), False, 'import argparse\n'), ((2441, 2554), 'pancancer_evaluation.data_models.tcga_data_model.TCGADataModel', 'TCGADataModel', ([], {'seed': 'args.seed', 'subset_mad_genes': 'args.subset_mad_genes', 'verbose': 'args.verbos...
import itertools import pickle import dill import numpy as np from sb3_contrib import TQC model_path = "learned_models/FetchSlide-v1/FetchSlide-v1.zip" args_path = "learned_models/FetchSlide-v1/args.yml" with open("learned_models/saved_fetch_slippy_env", "rb") as f: env = pickle.load(f) with open("learned_model...
[ "sb3_contrib.TQC.load", "numpy.zeros", "dill.load", "numpy.append", "pickle.load", "numpy.array", "numpy.linalg.norm", "numpy.linspace", "itertools.product" ]
[((471, 541), 'sb3_contrib.TQC.load', 'TQC.load', (['model_path'], {'env': 'env', 'custom_objects': 'custom_objects'}), '(model_path, env=env, custom_objects=custom_objects, **kwargs)\n', (479, 541), False, 'from sb3_contrib import TQC\n'), ((609, 688), 'numpy.linspace', 'np.linspace', (['(-inner_env.target_range)', 'i...
import random from string import Template import logging import pandas as pd import numpy as np import scipy.stats from tqdm import tqdm from holoclean.dataset import DBengine from synthesizer.helper import get_relevant_dcs, _get_env, _get_num_attrs, _get_sampling_paras, _update_cnf, _get_weights tbl_name = 'syn' s...
[ "pandas.DataFrame", "numpy.argmax", "numpy.asarray", "string.Template", "logging.info", "synthesizer.helper._get_num_attrs", "synthesizer.helper._get_weights", "numpy.exp", "numpy.random.normal", "numpy.random.choice", "holoclean.dataset.DBengine", "synthesizer.helper._get_sampling_paras", "...
[((1878, 1957), 'string.Template', 'Template', (['"""select count(*) from "$tbl_name" t1 where t1."tid" != $tid and $cnf"""'], {}), '(\'select count(*) from "$tbl_name" t1 where t1."tid" != $tid and $cnf\')\n', (1886, 1957), False, 'from string import Template\n'), ((1104, 1114), 'synthesizer.helper._get_env', '_get_en...
import numpy as np import pandas as pd import tensorflow as tf from sklearn.utils import shuffle from sklearn.model_selection import train_test_split import gc ''' File that manages the data inputs ''' def load_data(fname): print("Parsing Data...") # reads into dataframe df = pd.read_csv(fname, dtype=...
[ "pandas.read_csv", "sklearn.model_selection.train_test_split", "tensorflow.convert_to_tensor", "gc.collect", "sklearn.utils.shuffle", "numpy.delete" ]
[((295, 361), 'pandas.read_csv', 'pd.read_csv', (['fname'], {'dtype': 'np.float64', 'engine': '"""python"""', 'header': 'None'}), "(fname, dtype=np.float64, engine='python', header=None)\n", (306, 361), True, 'import pandas as pd\n'), ((397, 427), 'sklearn.utils.shuffle', 'shuffle', (['df'], {'random_state': 'None'}), ...
""" build.py """ from time import perf_counter from sys import stdout import numpy as np from sklearn.svm import SVC from sklearn.decomposition import PCA from sklearn.model_selection import GridSearchCV # from sklearn.metrics import classification_report # from sklearn.metrics import confusion_matrix from skimage im...
[ "matplotlib.pyplot.title", "helper.image.check_format", "numpy.sum", "matplotlib.pyplot.bar", "numpy.argmin", "matplotlib.pyplot.step", "matplotlib.pyplot.figure", "numpy.mean", "numpy.linalg.norm", "skimage.img_as_float", "sklearn.svm.SVC", "matplotlib.pyplot.tight_layout", "numpy.std", "...
[((1038, 1056), 'numpy.mean', 'np.mean', (['S'], {'axis': '(0)'}), '(S, axis=0)\n', (1045, 1056), True, 'import numpy as np\n'), ((1066, 1083), 'numpy.std', 'np.std', (['S'], {'axis': '(0)'}), '(S, axis=0)\n', (1072, 1083), True, 'import numpy as np\n'), ((1156, 1178), 'numpy.mean', 'np.mean', (['image'], {'axis': '(0)...
import pandas as pd import numpy as np import os '''首先读入grid2loc.csv确定每个基站数据放入一维向量的位置''' coordi = pd.read_csv('grid2loc.csv',index_col=0) #print(coordi.shape) gridlocdict = {} #字典:基站坐标--1d向量位置 for i in range(len(coordi)): grid = coordi.index[i] # 二维展成一维后的坐标, x_cor是列数,y_cor是行数 loc1d = coordi.at[grid, 'x_...
[ "numpy.full", "pandas.read_csv", "pandas.Series", "pandas.read_table", "os.path.join", "os.listdir" ]
[((99, 139), 'pandas.read_csv', 'pd.read_csv', (['"""grid2loc.csv"""'], {'index_col': '(0)'}), "('grid2loc.csv', index_col=0)\n", (110, 139), True, 'import pandas as pd\n'), ((496, 541), 'pandas.Series', 'pd.Series', (['zerocoordi'], {'name': '"""zerocoordinates"""'}), "(zerocoordi, name='zerocoordinates')\n", (505, 54...
import os import pickle import numpy as np import scipy.stats as st import matplotlib as mpl from matplotlib import pyplot as plt # from labellines import labelLines from qubo_nn.plots.lib import cmap_mod NAME = os.path.splitext(os.path.basename(__file__))[0][5:] mpl.font_manager._rebuild() plt.rc('font', family='...
[ "matplotlib.pyplot.axhline", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "os.path.basename", "matplotlib.font_manager._rebuild", "matplotlib.pyplot.cycler", "numpy.isnan", "numpy.mean", "numpy.array", "matplotlib.pyplot.rc", "pickle.load", "scipy.stats.sem", "matplotlib.pyplo...
[((269, 296), 'matplotlib.font_manager._rebuild', 'mpl.font_manager._rebuild', ([], {}), '()\n', (294, 296), True, 'import matplotlib as mpl\n'), ((297, 329), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'family': '"""Raleway"""'}), "('font', family='Raleway')\n", (303, 329), True, 'from matplotlib import pyplot...
import numpy as np import pandas as pd from stockstats import StockDataFrame as Sdf from config import config def load_dataset(symbol): ohlcv = pd.read_csv(f'data/{symbol}-5m-data.csv') ohlcv['rank_'] = ohlcv.groupby('timestamp')['volume'].rank(method='first', ascending=True) ohlcv = ohlcv[ohlcv.rank_ == ...
[ "pandas.DataFrame", "talib.abstract.BBANDS", "pandas.read_csv", "talib.abstract.CCI", "talib.abstract.STOCH", "pandas.to_datetime", "numpy.mean", "numpy.linalg.inv", "talib.abstract.RSI", "talib.abstract.ADX", "talib.abstract.MACD" ]
[((150, 191), 'pandas.read_csv', 'pd.read_csv', (['f"""data/{symbol}-5m-data.csv"""'], {}), "(f'data/{symbol}-5m-data.csv')\n", (161, 191), True, 'import pandas as pd\n'), ((348, 382), 'pandas.to_datetime', 'pd.to_datetime', (["ohlcv['timestamp']"], {}), "(ohlcv['timestamp'])\n", (362, 382), True, 'import pandas as pd\...
from astropy.table import Table import numpy as np import pytest @pytest.fixture(scope='session') def my_tmp_path(tmp_path_factory): return tmp_path_factory.mktemp('foo') def test_to_csv(my_tmp_path): t = Table({'a': [1, 2, 3], 'b': [4, 5, 6]}) t.write(my_tmp_path / 'test.csv') read = Table.read(my...
[ "astropy.table.Table", "pytest.fixture", "numpy.all", "astropy.table.Table.read" ]
[((67, 98), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (81, 98), False, 'import pytest\n'), ((217, 256), 'astropy.table.Table', 'Table', (["{'a': [1, 2, 3], 'b': [4, 5, 6]}"], {}), "({'a': [1, 2, 3], 'b': [4, 5, 6]})\n", (222, 256), False, 'from astropy.table import Tab...
from typing import Union, Tuple, Any import gym import collections import numpy as np import torch __all__ = ["wrap_env"] class Wrapper(object): def __init__(self, env: Any) -> None: """Base wrapper class for RL environments :param env: The environment to wrap :type env: Any supported ...
[ "numpy.full", "cv2.waitKey", "cv2.cvtColor", "gym.spaces.Discrete", "torch.cuda.is_available", "torch.device", "torch.tensor" ]
[((17457, 17471), 'cv2.waitKey', 'cv2.waitKey', (['(1)'], {}), '(1)\n', (17468, 17471), False, 'import cv2\n'), ((480, 510), 'torch.device', 'torch.device', (['self._env.device'], {}), '(self._env.device)\n', (492, 510), False, 'import torch\n'), ((12780, 12816), 'gym.spaces.Discrete', 'gym.spaces.Discrete', (['spec.nu...
import numpy as np class Sudoku: """ A class that represents a Sudoku board The board is stored internally as a numpy array Zeroes preresent blank spaces """ def __init__(self, degree, matrix=None): self.degree = degree if matrix is None: self.matrix = np.zeros((deg...
[ "numpy.random.randint", "numpy.zeros", "numpy.sqrt" ]
[((307, 346), 'numpy.zeros', 'np.zeros', (['(degree, degree)'], {'dtype': '"""int"""'}), "((degree, degree), dtype='int')\n", (315, 346), True, 'import numpy as np\n'), ((723, 743), 'numpy.sqrt', 'np.sqrt', (['self.degree'], {}), '(self.degree)\n', (730, 743), True, 'import numpy as np\n'), ((1794, 1827), 'numpy.random...
import tsnet import numpy as np # Open an example network and create a transient model inp_file = 'examples/networks/Tnet1.inp' tm = tsnet.network.TransientModel(inp_file) # Set wavespeed tm.set_wavespeed(1200.) # m/s # Set time options dt = 0.1 # time step [s], if not given, use the maximum allowed dt tf = 60 # s...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "tsnet.network.TransientModel", "numpy.linspace", "matplotlib.pyplot.ylabel", "tsnet.simulation.Initializer", "matplotlib.pyplot.xlabel", "tsnet.simulation.MOCSim...
[((134, 172), 'tsnet.network.TransientModel', 'tsnet.network.TransientModel', (['inp_file'], {}), '(inp_file)\n', (162, 172), False, 'import tsnet\n'), ((577, 600), 'numpy.linspace', 'np.linspace', (['(100)', '(0)', '(11)'], {}), '(100, 0, 11)\n', (588, 600), True, 'import numpy as np\n'), ((913, 957), 'tsnet.simulatio...
import cv2 as cv import numpy as np from matplotlib import pyplot as plt import sys sift = cv.xfeatures2d.SIFT_create() def read_image(img_name, read_mode): img = cv.imread(img_name, read_mode) return img def detect_features(img1, img2): global sift kp1, desc1 = sift.detectAndCompute(...
[ "cv2.warpPerspective", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "numpy.float32", "cv2.FlannBasedMatcher", "cv2.imread", "cv2.xfeatures2d.SIFT_create", "cv2.findHomography" ]
[((92, 120), 'cv2.xfeatures2d.SIFT_create', 'cv.xfeatures2d.SIFT_create', ([], {}), '()\n', (118, 120), True, 'import cv2 as cv\n'), ((174, 204), 'cv2.imread', 'cv.imread', (['img_name', 'read_mode'], {}), '(img_name, read_mode)\n', (183, 204), True, 'import cv2 as cv\n'), ((537, 586), 'cv2.FlannBasedMatcher', 'cv.Flan...
# Trial # CODING_METHOD = 'FREQ' CODING_METHOD = 'MANCHESTER_MODE' # CODING_METHOD = 'INFRAME++' # CODING_METHOD = 'DESIGNED_CODE' # print('Choose Coding Method: (current is ' + CODING_METHOD + ')') # print('\t1. FREQ') # print('\t2. MANCHESTER_MODE') # print('\t3. 10B12B') # print('\t4. Designed Code') # chose_num = i...
[ "numpy.array" ]
[((2087, 2110), 'numpy.array', 'np.array', (['PREAMBLE_LIST'], {}), '(PREAMBLE_LIST)\n', (2095, 2110), True, 'import numpy as np\n')]
import matplotlib.pyplot as plt import numpy as np from scipy.signal import spectrogram as sp def get_spect(sig, Fs, BW = 0, DR = 0, ylim = [], xlim = [], Window = 'hamming', shading = 'goraud', colormap = 'viridis', title = 'Spectrogram', ytitle = 'Frequency (Hz)', xtitle = 'Time (s)'): if BW == 0: BW = ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "numpy.log2", "matplotlib.pyplot.figure", "numpy.sin", "numpy.arange", "numpy.exp", "matplotlib.pyplot.pcolormesh", "numpy.cos", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", ...
[((1529, 1546), 'numpy.exp', 'np.exp', (['(-time / 5)'], {}), '(-time / 5)\n', (1535, 1546), True, 'import numpy as np\n'), ((373, 394), 'numpy.round', 'np.round', (['(4 * Fs / BW)'], {}), '(4 * Fs / BW)\n', (381, 394), True, 'import numpy as np\n'), ((482, 515), 'numpy.round', 'np.round', (['(Nwindow / OverlapFactor)'...
import numpy as np import torch FloatTensor = torch.FloatTensor LongTensor = torch.LongTensor class ReplayBuffer(): def __init__(self, buffer_size, state_dim, action_dim): # params self.buffer_size = buffer_size self.state_dim = state_dim self.action_dim = action_dim sel...
[ "torch.zeros", "numpy.random.randint" ]
[((379, 424), 'torch.zeros', 'torch.zeros', (['self.buffer_size', 'self.state_dim'], {}), '(self.buffer_size, self.state_dim)\n', (390, 424), False, 'import torch\n'), ((448, 494), 'torch.zeros', 'torch.zeros', (['self.buffer_size', 'self.action_dim'], {}), '(self.buffer_size, self.action_dim)\n', (459, 494), False, 'i...
import kilonovanet import numpy as np import torch import pytest torch.manual_seed(42) np.random.seed(42) DISTANCE = 40.0 * 10 ** 6 * 3.086e18 FILTERS = np.array(["LSST_u", "LSST_z", "LSST_y"]) FILTER_LIB = "data/filter_data" # bulla_bns, bulla_bhns, kasen_bns METADATA = [ "data/metadata_bulla_bns.json", ...
[ "numpy.random.seed", "torch.manual_seed", "numpy.testing.assert_allclose", "kilonovanet.Model", "numpy.array", "pytest.mark.parametrize" ]
[((67, 88), 'torch.manual_seed', 'torch.manual_seed', (['(42)'], {}), '(42)\n', (84, 88), False, 'import torch\n'), ((89, 107), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (103, 107), True, 'import numpy as np\n'), ((157, 197), 'numpy.array', 'np.array', (["['LSST_u', 'LSST_z', 'LSST_y']"], {}), "(...
import cv2 import numpy as np import time from lib.core.api.face_landmark import FaceLandmark from lib.core.api.face_detector import FaceDetector from lib.core.LK.lk import GroupTrack from config import config as cfg class FaceAna(): ''' by default the top3 facea sorted by area will be calculated for time r...
[ "numpy.sum", "cv2.absdiff", "time.time", "numpy.min", "numpy.max", "numpy.array", "lib.core.api.face_landmark.FaceLandmark", "lib.core.LK.lk.GroupTrack", "lib.core.api.face_detector.FaceDetector" ]
[((388, 402), 'lib.core.api.face_detector.FaceDetector', 'FaceDetector', ([], {}), '()\n', (400, 402), False, 'from lib.core.api.face_detector import FaceDetector\n'), ((432, 446), 'lib.core.api.face_landmark.FaceLandmark', 'FaceLandmark', ([], {}), '()\n', (444, 446), False, 'from lib.core.api.face_landmark import Fac...
import numpy as np """ Code taken from R2RILS by <NAME>, <NAME> and <NAME> """ def generate_matrix(n1, n2, singular_values): """ Generate a matrix with specific singular values :param int n1: number of rows :param int n2: number of columns :param list singular_values: required singular...
[ "numpy.diag", "numpy.linalg.qr", "numpy.random.randn" ]
[((379, 404), 'numpy.random.randn', 'np.random.randn', (['n1', 'rank'], {}), '(n1, rank)\n', (394, 404), True, 'import numpy as np\n'), ((414, 439), 'numpy.random.randn', 'np.random.randn', (['n2', 'rank'], {}), '(n2, rank)\n', (429, 439), True, 'import numpy as np\n'), ((449, 464), 'numpy.linalg.qr', 'np.linalg.qr', (...
#!/usr/bin/env python ''' Parses Pythia-style JSON files and inventories most frequent words in the corpus. ''' import sys import json import os.path from os.path import basename from collections import defaultdict, namedtuple, OrderedDict import nltk from nltk.tokenize import word_tokenize import numpy def parse_json...
[ "numpy.random.RandomState", "collections.defaultdict", "numpy.argsort", "collections.OrderedDict", "nltk.tokenize.word_tokenize" ]
[((1078, 1094), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (1089, 1094), False, 'from collections import defaultdict, namedtuple, OrderedDict\n'), ((1111, 1127), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (1122, 1127), False, 'from collections import defaultdict, namedt...
#!/usr/bin/env python """ psola.pitch.estimation Implements a ``sawtooth waveform inspired pitch estimator'' (SWIPE) [1] A previous swipe implementation in python [2] was also used as a reference References: [1] <NAME>., & <NAME>. (2008). A sawtooth waveform inspired pitch estimator for speech and music....
[ "numpy.abs", "numpy.polyfit", "numpy.argmax", "numpy.empty", "numpy.ones", "scipy.io.wavfile.read", "numpy.arange", "numpy.linalg.norm", "numpy.tile", "scipy.interpolate.interp1d", "numpy.round", "psola.experiment_config.ExperimentConfig", "warnings.simplefilter", "psola.utilities.find.fin...
[((2047, 2081), 'numpy.arange', 'np.arange', (['lp_min', 'lp_max', 'lp_step'], {}), '(lp_min, lp_max, lp_step)\n', (2056, 2081), True, 'import numpy as np\n'), ((2163, 2208), 'numpy.zeros', 'np.zeros', (['(pitch_candidates.size, times.size)'], {}), '((pitch_candidates.size, times.size))\n', (2171, 2208), True, 'import ...
#-*- encoding: utf-8 -*- """ solve stochastic differential equations Copyright (c) 2016 @myuuuuun Released under the MIT license. """ import math import numpy as np import pandas as pd import ode import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.cm as cm np.set_printoptions(precision=3) np.set...
[ "numpy.set_printoptions", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "math.sqrt", "matplotlib.pyplot.legend", "numpy.zeros", "numpy.random.RandomState", "ode.euler", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.exp", "matplotlib.pyplot.ylabel", "m...
[((281, 313), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(3)'}), '(precision=3)\n', (300, 313), True, 'import numpy as np\n'), ((314, 348), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': '(400)'}), '(linewidth=400)\n', (333, 348), True, 'import numpy as np\n'), ((349, 390)...
# -*- coding: utf-8 -*- """ Created on Sun Jan 3 10:50:02 2021 @author: Mateo """ from HARK.Calibration.Income.IncomeTools import ( parse_income_spec, find_profile, Cagetti_income, CGM_income, ) import numpy as np import matplotlib.pyplot as plt # What year to use as the base monetary year? # (pick...
[ "matplotlib.pyplot.title", "HARK.Calibration.Income.IncomeTools.Cagetti_income.items", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "HARK.Calibration.Income.IncomeTools.find_profile", "HARK.Calibration.Income.IncomeTools.parse_income_spec", "matplotlib.pyplot.figure"...
[((485, 516), 'numpy.arange', 'np.arange', (['age_min', '(age_max + 1)'], {}), '(age_min, age_max + 1)\n', (494, 516), True, 'import numpy as np\n'), ((518, 530), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (528, 530), True, 'import matplotlib.pyplot as plt\n'), ((543, 561), 'HARK.Calibration.Income.Inc...
import numpy as np import unittest import os, sys class Testing(unittest.TestCase): """ """ def test_demo(self): """ Usage: export CUDA_VISIBLE_DEVICES=1,2,3,4; python -c "import test_train; \ test_train.Testing().test_demo()" :return: """ a = np.arange(25).reshape(...
[ "numpy.trace", "numpy.multiply", "numpy.sum", "numpy.tensordot", "numpy.einsum", "numpy.zeros", "numpy.arange", "numpy.inner", "numpy.dot", "numpy.diag" ]
[((334, 346), 'numpy.arange', 'np.arange', (['(5)'], {}), '(5)\n', (343, 346), True, 'import numpy as np\n'), ((387, 405), 'numpy.einsum', 'np.einsum', (['"""ii"""', 'a'], {}), "('ii', a)\n", (396, 405), True, 'import numpy as np\n'), ((410, 430), 'numpy.einsum', 'np.einsum', (['a', '[0, 0]'], {}), '(a, [0, 0])\n', (41...
#!/usr/bin/env python3 """rstool is an open source command-line program for reading and converting native radiosonde data to NetCDF and calculation of derived physical quantities. Usage: rstool <input_type> <output_type> <input> <output> Arguments: - `input_type` - See Input types below. - `output_type` - See Output...
[ "numpy.seterr", "rstoollib.postprocess", "rstoollib.prof", "datetime.datetime.utcnow", "ds_format.read", "ds_format.write", "sys.stderr.write", "sys.exit" ]
[((3574, 3593), 'ds_format.write', 'ds.write', (['output', 'd'], {}), '(output, d)\n', (3582, 3593), True, 'import ds_format as ds\n'), ((3937, 3960), 'numpy.seterr', 'np.seterr', ([], {'all': '"""ignore"""'}), "(all='ignore')\n", (3946, 3960), True, 'import numpy as np\n'), ((1304, 1315), 'sys.exit', 'sys.exit', (['(0...
import numpy as np def get_params_dict(params_path): param_data = np.loadtxt(params_path, dtype=str, delimiter='|') params = {} for entry in param_data: if entry[1] == 'False': params[entry[0]] = False elif entry[1] == 'True': params[entry[0]] = True else: ...
[ "numpy.argwhere", "numpy.savetxt", "numpy.loadtxt" ]
[((71, 120), 'numpy.loadtxt', 'np.loadtxt', (['params_path'], {'dtype': 'str', 'delimiter': '"""|"""'}), "(params_path, dtype=str, delimiter='|')\n", (81, 120), True, 'import numpy as np\n'), ((1678, 1770), 'numpy.savetxt', 'np.savetxt', (["(motif_dir + '/tomtom/tomtom_annotated.tsv')", 'final'], {'delimiter': '"""\t""...
import numpy as np import torch import matplotlib.pyplot as plt import copy import os from torch.nn.utils.rnn import pad_sequence from . import VecEnvWrapper class VecPretextNormalize(VecEnvWrapper): """ A vectorized wrapper that normalizes the observations and returns from an environment. ...
[ "torch.from_numpy", "torch.stack", "torch.logical_not", "numpy.zeros", "torch.cat", "torch.device", "torch.zeros", "torch.nn.utils.rnn.pad_sequence", "torch.no_grad", "torch.logical_and" ]
[((462, 524), 'torch.device', 'torch.device', (["('cuda:0' if self.config.training.cuda else 'cpu')"], {}), "('cuda:0' if self.config.training.cuda else 'cpu')\n", (474, 524), False, 'import torch\n'), ((2070, 2131), 'torch.zeros', 'torch.zeros', (['self.nenv', 'self.human_num', '(2)'], {'device': 'self.device'}), '(se...
import unittest import numpy as np import sys import os sys.path.append(os.path.abspath('..')) from ols import ols class test_beta(unittest.TestCase): def test_beta(self): # Generate fake data K = 10 N = 100000 mu = 5 sigma = 5 beta = np.random.randint(0, 5, (K, 1)...
[ "unittest.main", "os.path.abspath", "numpy.random.randint", "ols.ols", "numpy.random.normal" ]
[((74, 95), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (89, 95), False, 'import os\n'), ((661, 676), 'unittest.main', 'unittest.main', ([], {}), '()\n', (674, 676), False, 'import unittest\n'), ((290, 321), 'numpy.random.randint', 'np.random.randint', (['(0)', '(5)', '(K, 1)'], {}), '(0, 5, (...
# -*- coding: utf-8 -*- # Compatible with Python 3.8 # Copyright (C) 2020-2021 <NAME> # mailto: <EMAIL> r"""This script calculates the numerical storage and retrieval of the optimal input signal that the analytic theory suggests using feasible parameters and getting high efficiency. """ from __future__ import print_fun...
[ "orca_memories.orca.calculate_Gammap", "numpy.abs", "orca_memories.orca.calculate_optimal_input_Z", "numpy.angle", "numpy.allclose", "orca_memories.orca.calculate_pulse_energy", "matplotlib.pyplot.close", "orca_memories.orca.calculate_optimal_input_xi", "orca_memories.graphical.sketch_frame_transfor...
[((2726, 2755), 'orca_memories.orca.set_parameters_ladder', 'set_parameters_ladder', (['params'], {}), '(params)\n', (2747, 2755), False, 'from orca_memories.orca import set_parameters_ladder, print_params, build_mesh_fdm, calculate_xi0, calculate_Gammap, calculate_optimal_input_xi, calculate_optimal_input_Z, calculate...
# python-3 # Author name: <NAME> (<EMAIL>) # Creation date: December 01, 2016 # This script contains method to generate all beauty related features from images. # Very expensive when run serially. from skimage import io, color, feature, transform import numpy as np, pandas as pd import time, json, argparse, math, os ...
[ "argparse.ArgumentParser", "pandas.DataFrame.from_csv", "numpy.histogram", "numpy.mean", "skimage.transform.resize", "numpy.linalg.norm", "pandas.DataFrame", "skimage.color.rgb2gray", "numpy.std", "numpy.identity", "numpy.max", "skimage.io.imread", "json.dump", "os.path.basename", "sklea...
[((631, 669), 'skimage.transform.resize', 'transform.resize', (['gray_img', '(600, 600)'], {}), '(gray_img, (600, 600))\n', (647, 669), False, 'from skimage import io, color, feature, transform\n'), ((987, 997), 'numpy.mean', 'np.mean', (['v'], {}), '(v)\n', (994, 997), True, 'import numpy as np, pandas as pd\n'), ((10...
# # Scalers for rainfall dataset # import numpy as np class LogScaler(): # class for scaling of rainfall values def __init__(self): # coeff for intensity -> reflecivity self.a = 256.0 self.b = 1.42 self.rmax = 201.0 # max rainfall intensity self.c1 = 0.0 self.c...
[ "numpy.log10", "numpy.array", "numpy.maximum" ]
[((3557, 3572), 'numpy.array', 'np.array', (['[0.0]'], {}), '([0.0])\n', (3565, 3572), True, 'import numpy as np\n'), ((3654, 3671), 'numpy.array', 'np.array', (['[0.001]'], {}), '([0.001])\n', (3662, 3671), True, 'import numpy as np\n'), ((3815, 3831), 'numpy.array', 'np.array', (['[0.01]'], {}), '([0.01])\n', (3823, ...
import unittest from ResoFit.simulation import Simulation import numpy as np class TestSimulation(unittest.TestCase): energy_min = 7 energy_max = 10 energy_step = 1 database = '_data_for_unittest' simulation = Simulation(energy_min=energy_min, energy_max=energy_max, ...
[ "numpy.array", "ResoFit.simulation.Simulation" ]
[((232, 349), 'ResoFit.simulation.Simulation', 'Simulation', ([], {'energy_min': 'energy_min', 'energy_max': 'energy_max', 'energy_step': 'energy_step', 'database': '"""_data_for_unittest"""'}), "(energy_min=energy_min, energy_max=energy_max, energy_step=\n energy_step, database='_data_for_unittest')\n", (242, 349),...
# -*- coding: utf-8 -*- """ Created on Sat Oct 7 17:15:03 2017 @author: af5u13 """ import os import shutil import numpy as np import h5py def sofaExtractDelay( inFileName, outFileName, dtype = np.float32, fdAdjust = False ): if not os.path.exists( inFileName ): raise ValueError( "SOFA file does not exis...
[ "h5py.File", "numpy.fft.rfft", "numpy.ndindex", "numpy.fft.irfft", "numpy.abs", "os.remove", "os.getcwd", "numpy.angle", "numpy.floor", "os.path.exists", "numpy.unwrap", "numpy.zeros", "numpy.min", "numpy.exp", "shutil.copyfile", "numpy.dot", "os.path.join" ]
[((3132, 3143), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (3141, 3143), False, 'import os\n'), ((3161, 3207), 'os.path.join', 'os.path.join', (['currDir', '"""data/dtf_b_nh169.sofa"""'], {}), "(currDir, 'data/dtf_b_nh169.sofa')\n", (3173, 3207), False, 'import os\n'), ((3229, 3285), 'os.path.join', 'os.path.join', ([...
from typing import Dict import numpy from overrides import overrides from allennlp.data.fields.field import Field class ArrayField(Field[numpy.ndarray]): """ A class representing an array, which could have arbitrary dimensions. A batch of these arrays are padded to the max dimension length in the batch ...
[ "numpy.array", "numpy.ones" ]
[((911, 943), 'numpy.ones', 'numpy.ones', (['max_shape', '"""float32"""'], {}), "(max_shape, 'float32')\n", (921, 943), False, 'import numpy\n'), ((1582, 1614), 'numpy.array', 'numpy.array', (['[]'], {'dtype': '"""float32"""'}), "([], dtype='float32')\n", (1593, 1614), False, 'import numpy\n')]
import numpy as np def poynting(lamda, Bz, Bx, By, Ux, Uy, Uz=0, polar=0): """PURPOSE: Calculate the Poynting flux given a vector magnetogram and the three components of the velocity field NOTE : Based on the analysis of Kusano et al. (2002) Parameters --------- lamda : pixel size of...
[ "numpy.sin", "numpy.cos" ]
[((1730, 1741), 'numpy.cos', 'np.cos', (['phi'], {}), '(phi)\n', (1736, 1741), True, 'import numpy as np\n'), ((1760, 1771), 'numpy.sin', 'np.sin', (['phi'], {}), '(phi)\n', (1766, 1771), True, 'import numpy as np\n')]
# RUN: %PYTHON %s import numpy as np from shark.shark_importer import SharkImporter import pytest model_path = "https://tfhub.dev/tensorflow/lite-model/albert_lite_base/squadv1/1?lite-format=tflite" # Inputs modified to be useful albert inputs. def generate_inputs(input_details): for input in input_details: ...
[ "numpy.zeros", "numpy.ones", "shark.shark_importer.SharkImporter", "pytest.param", "numpy.random.randint" ]
[((1319, 1455), 'shark.shark_importer.SharkImporter', 'SharkImporter', ([], {'model_path': 'model_path', 'model_type': '"""tflite"""', 'model_source_hub': '"""tfhub"""', 'device': 'device', 'dynamic': 'dynamic', 'jit_trace': '(True)'}), "(model_path=model_path, model_type='tflite', model_source_hub=\n 'tfhub', devic...
"""Test smoother.""" import altair_recipes as ar from altair_recipes.common import viz_reg_test from altair_recipes.display_pweave import show_test import numpy as np import pandas as pd #' <h2>Smoother</h2> @viz_reg_test def test_smoother(): x = np.random.uniform(size=100) data = pd.DataFrame(dict(x=x, y=n...
[ "altair_recipes.display_pweave.show_test", "numpy.random.uniform" ]
[((410, 434), 'altair_recipes.display_pweave.show_test', 'show_test', (['test_smoother'], {}), '(test_smoother)\n', (419, 434), False, 'from altair_recipes.display_pweave import show_test\n'), ((255, 282), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(100)'}), '(size=100)\n', (272, 282), True, 'import nu...
'''Example script showing how to use stateful RNNs to model long sequences efficiently. https://github.com/fchollet/keras/blob/master/examples/stateful_lstm.py _________________________________________________________________ Layer (type) Output Shape Param # ===============================...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "numpy.argmax", "scipy.integrate.odeint", "matplotlib.pyplot.close", "keras.layers.LSTM", "numpy.zeros", "keras.optimizers.Adam", "matplotlib.pyplot.figure", "keras.layers.Dense", "num...
[((1477, 1499), 'numpy.zeros', 'np.zeros', (['(5000, 1, 1)'], {}), '((5000, 1, 1))\n', (1485, 1499), True, 'import numpy as np\n'), ((1653, 1678), 'numpy.linspace', 'np.linspace', (['(0)', '(200)', '(5001)'], {}), '(0, 200, 5001)\n', (1664, 1678), True, 'import numpy as np\n'), ((1685, 1717), 'scipy.integrate.odeint', ...
"""Test built-in callback routines.""" __copyright__ = """ Copyright (C) 2021 University of Illinois Board of Trustees """ __license__ = """ 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 withou...
[ "mirgecom.initializers.Vortex2D", "grudge.eager.EagerDGDiscretization", "mirgecom.simutil.compare_fluid_solutions", "mirgecom.eos.IdealSingleGas", "mirgecom.simutil.check_naninf_local", "numpy.dot", "meshmode.mesh.generation.generate_regular_rect_mesh", "mirgecom.fluid.make_conserved", "mirgecom.sim...
[((1711, 1809), 'meshmode.mesh.generation.generate_regular_rect_mesh', 'generate_regular_rect_mesh', ([], {'a': '((1.0,) * dim)', 'b': '((2.0,) * dim)', 'nelements_per_axis': '((nel_1d,) * dim)'}), '(a=(1.0,) * dim, b=(2.0,) * dim,\n nelements_per_axis=(nel_1d,) * dim)\n', (1737, 1809), False, 'from meshmode.mesh.ge...
## This file alters the game described in new_simpy_fire_smdp.py # Here, agents receive a local observation (location,strength,status,interest) for 5 closest fires # Also, each fire gets random number of UAV-minutes needed to extinguish it, where the mean is a # function of fire level # Rewards are equal to the fire l...
[ "numpy.random.random_sample", "scipy.stats.truncnorm", "numpy.argsort", "numpy.linalg.norm", "gym.utils.seeding.np_random", "simpy.AllOf", "dateutil.tz.tzlocal", "eventdriven.rltools.util.EzPickle.__init__", "math.log", "copy.deepcopy", "math.ceil", "rllab.envs.env_spec.EnvSpec", "numpy.isin...
[((992, 1007), 'math.log', 'math.log', (['(0.005)'], {}), '(0.005)\n', (1000, 1007), False, 'import math\n'), ((17430, 17455), 'FirestormProject.runners.RunnerParser', 'RunnerParser', (['ENV_OPTIONS'], {}), '(ENV_OPTIONS)\n', (17442, 17455), False, 'from FirestormProject.runners import RunnerParser\n'), ((17502, 17527)...
import pandas import numpy from copy import copy, deepcopy from scipy import stats from . import models def score_strains(exps, comp): """ Use anova analysis to score strains according their ability to seperate induction states of interest. Input: exps : [dynomics.Experiment] ...
[ "scipy.stats.f_oneway", "copy.deepcopy", "pandas.Series", "numpy.isfinite" ]
[((2275, 2296), 'pandas.Series', 'pandas.Series', (['scores'], {}), '(scores)\n', (2288, 2296), False, 'import pandas\n'), ((907, 920), 'copy.deepcopy', 'deepcopy', (['exp'], {}), '(exp)\n', (915, 920), False, 'from copy import copy, deepcopy\n'), ((933, 1039), 'pandas.Series', 'pandas.Series', ([], {'index': 'e.loadin...
# -*- coding: utf-8 -*- """ :Author: <NAME> Notes ----- This is a script with all the components for running an investigation. I would recommend making a copy of this for each successful investigation and storing it with the data. """ #%% Import useful functions # Other used function import numpy as np ...
[ "numpy.ones" ]
[((717, 755), 'numpy.ones', 'np.ones', (['(number_actions, number_cues)'], {}), '((number_actions, number_cues))\n', (724, 755), True, 'import numpy as np\n'), ((790, 813), 'numpy.ones', 'np.ones', (['number_actions'], {}), '(number_actions)\n', (797, 813), True, 'import numpy as np\n')]
"""SequencePairProperties.py - Computing metrics for aligned sequences ====================================================================== This module provides methods for extracting and reporting sequence properties of aligned nucleotide sequences such as percent identity, substitution rate, etc. Usage is the same...
[ "numpy.trace", "numpy.sum", "numpy.ravel", "cgat.Mali.Mali", "cgat.WrapperCodeML.BaseML", "numpy.zeros" ]
[((1772, 1794), 'cgat.WrapperCodeML.BaseML', 'WrapperCodeML.BaseML', ([], {}), '()\n', (1792, 1794), True, 'from cgat import WrapperCodeML as WrapperCodeML\n'), ((2065, 2076), 'cgat.Mali.Mali', 'Mali.Mali', ([], {}), '()\n', (2074, 2076), True, 'from cgat import Mali as Mali\n'), ((4105, 4145), 'numpy.zeros', 'numpy.ze...
""" prdc Copyright (c) 2020-present NAVER Corp. MIT license """ import numpy as np import sklearn.metrics __all__ = ['compute_prdc'] def compute_pairwise_distance(data_x, data_y=None): """ Args: data_x: numpy.ndarray([N, feature_dim], dtype=np.float32) data_y: numpy.ndarray([N,...
[ "numpy.argpartition", "numpy.linalg.norm", "numpy.take_along_axis", "numpy.expand_dims" ]
[((910, 958), 'numpy.take_along_axis', 'np.take_along_axis', (['unsorted', 'indices'], {'axis': 'axis'}), '(unsorted, indices, axis=axis)\n', (928, 958), True, 'import numpy as np\n'), ((3092, 3120), 'numpy.linalg.norm', 'np.linalg.norm', (['diff'], {'axis': '(1)'}), '(diff, axis=1)\n', (3106, 3120), True, 'import nump...
import numpy as np from autolens.model.profiles import light_and_mass_profiles as lmp, light_profiles as lp, mass_profiles as mp grid = np.array([[1.0, 1.0], [2.0, 2.0], [3.0, 3.0], [2.0, 4.0]]) class TestSersic(object): def test__grid_calculations__same_as_sersic(self): sersic_lp = lp.EllipticalSersic...
[ "autolens.model.profiles.light_and_mass_profiles.EllipticalSersicRadialGradient", "autolens.model.profiles.light_profiles.EllipticalExponential", "autolens.model.profiles.mass_profiles.EllipticalExponential", "autolens.model.profiles.light_and_mass_profiles.SphericalExponential", "autolens.model.profiles.li...
[((138, 196), 'numpy.array', 'np.array', (['[[1.0, 1.0], [2.0, 2.0], [3.0, 3.0], [2.0, 4.0]]'], {}), '([[1.0, 1.0], [2.0, 2.0], [3.0, 3.0], [2.0, 4.0]])\n', (146, 196), True, 'import numpy as np\n'), ((301, 404), 'autolens.model.profiles.light_profiles.EllipticalSersic', 'lp.EllipticalSersic', ([], {'axis_ratio': '(0.7...
#Import libraries from flask import Flask, request, jsonify import pickle import warnings warnings.filterwarnings("ignore") import os, argparse import keras import cv2, spacy, numpy as np from keras.models import model_from_json from keras.optimizers import SGD import joblib from keras import backend as K ...
[ "keras.optimizers.SGD", "warnings.filterwarnings", "flask.Flask", "numpy.zeros", "numpy.expand_dims", "keras.models.Model", "keras.backend.set_image_data_format", "numpy.argsort", "spacy.load", "cv2.imread", "keras.applications.vgg16.VGG16", "joblib.load", "keras.backend.clear_session" ]
[((96, 129), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (119, 129), False, 'import warnings\n'), ((367, 408), 'keras.backend.set_image_data_format', 'K.set_image_data_format', (['"""channels_first"""'], {}), "('channels_first')\n", (390, 408), True, 'from keras import ...
################################################################################ # Copyright (c) 2015 IBM Corporation # # 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, in...
[ "numpy.dot", "numpy.loadtxt", "argparse.ArgumentParser" ]
[((1834, 1882), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (1857, 1882), False, 'import argparse\n'), ((2864, 2884), 'numpy.loadtxt', 'np.loadtxt', (['AmatFile'], {}), '(AmatFile)\n', (2874, 2884), True, 'import numpy as np\n'), ((3187, 320...
import pandas as pd # dataset = pd.read_csv('Distance.csv', header=None) # dataset = dataset.iloc[1:, :].values # distance = [] # for i in range(0, len(dataset)): # distance.append(dataset[i][4]) # x = [] # for i in range(0, 400): # for j in range(0, 400): # x.append([i, j]) # category = [] # for i in r...
[ "pandas.DataFrame", "numpy.trace", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pandas.read_csv", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.bar", "sklearn.metrics.confusion_matrix" ]
[((686, 725), 'pandas.read_csv', 'pd.read_csv', (['"""Dataset.csv"""'], {'header': 'None'}), "('Dataset.csv', header=None)\n", (697, 725), True, 'import pandas as pd\n'), ((795, 843), 'pandas.read_csv', 'pd.read_csv', (['"""Distance_Updated.csv"""'], {'header': 'None'}), "('Distance_Updated.csv', header=None)\n", (806,...
import numpy as np import pytest import scipy.stats as stats from tbats.tbats import Components, ModelParams, Model, Context class TestTBATSModel(object): def create_model(self, params): return Model(params, Context()) def test_fit_alpha_only(self): alpha = 0.7 np.random.seed(345) ...
[ "numpy.random.seed", "numpy.sum", "numpy.abs", "scipy.stats.normaltest", "tbats.tbats.Components", "numpy.allclose", "scipy.stats.ttest_1samp", "numpy.sin", "numpy.array", "numpy.arange", "numpy.random.normal", "numpy.cos", "numpy.array_equal", "pytest.mark.parametrize", "tbats.tbats.Con...
[((1266, 1684), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""seasonal_periods, seasonal_harmonics, starting_values"""', '[[[4], [1], [[2, 0]]], [[365], [2], [[1, 2, 0.5, 0.6]]], [[7, 365], [2, 3],\n [[1, 2, 0.5, 0.6], [0.5, 0.2, 0.4, 0.1, 0.9, 0.3]]], [[7.2, 12.25], [2,\n 1], [[0.4, 0.7, 0.2, 0.1],...
import numpy as np from hypernet.src.thermophysicalModels.chemistry.reactions.reactionType import Basic class MicroReversible(Basic): # Initialization ########################################################################### def __init__( self, specieThermos, reactionRate, ...
[ "numpy.sum" ]
[((2158, 2233), 'numpy.sum', 'np.sum', (['(spTh.intPF.dQdT * spTh.transPF.Q + spTh.intPF.Q * spTh.transPF.dQdT)'], {}), '(spTh.intPF.dQdT * spTh.transPF.Q + spTh.intPF.Q * spTh.transPF.dQdT)\n', (2164, 2233), True, 'import numpy as np\n')]
def test(): import numpy array = numpy.random.rand(1024 * 1024, 1) numpy.exp(array) if __name__ == '__main__': import timeit print(timeit.timeit( stmt="test()", setup='from __main__ import test', number=100))
[ "numpy.random.rand", "numpy.exp", "timeit.timeit" ]
[((41, 74), 'numpy.random.rand', 'numpy.random.rand', (['(1024 * 1024)', '(1)'], {}), '(1024 * 1024, 1)\n', (58, 74), False, 'import numpy\n'), ((79, 95), 'numpy.exp', 'numpy.exp', (['array'], {}), '(array)\n', (88, 95), False, 'import numpy\n'), ((153, 228), 'timeit.timeit', 'timeit.timeit', ([], {'stmt': '"""test()""...
# -*- coding: utf-8 -*- """ Created on Fri Apr 2 13:53:33 2021 @author: amari """ import scipy.stats import numpy as np def rotation(theta): """Defintion of the rotation matrix in space-2""" M=[[np.cos(theta), - np.sin(theta)], [np.sin(theta), np.cos(theta)]] M=np.array(M) ...
[ "numpy.histogram", "numpy.sin", "numpy.array", "numpy.cos" ]
[((303, 314), 'numpy.array', 'np.array', (['M'], {}), '(M)\n', (311, 314), True, 'import numpy as np\n'), ((707, 756), 'numpy.histogram', 'np.histogram', (['Rotated_whitened_X[0, :]'], {'bins': '(1000)'}), '(Rotated_whitened_X[0, :], bins=1000)\n', (719, 756), True, 'import numpy as np\n'), ((769, 818), 'numpy.histogra...
from perceptual.filterbank import Steerable import cv2 from PIL import Image import numpy as np import os import util.util as tool import math datappp = '1+2_scale_0.1_fre_2' datapath = 'D:/database/action1-person1-white/frame' datapath = 'data/'+datappp frames_num = 500 output_num = 100 basicframe = 0 start = 1 ...
[ "os.mkdir", "numpy.arctan2", "numpy.fft.fft", "numpy.transpose", "os.path.exists", "math.floor", "PIL.Image.open", "numpy.min", "numpy.max", "numpy.array", "PIL.Image.fromarray", "perceptual.filterbank.Steerable" ]
[((767, 795), 'perceptual.filterbank.Steerable', 'Steerable', (['(2 + pynums)', 'bands'], {}), '(2 + pynums, bands)\n', (776, 795), False, 'from perceptual.filterbank import Steerable\n'), ((543, 581), 'PIL.Image.open', 'Image.open', (["(datapath + '/%d.png' % num)"], {}), "(datapath + '/%d.png' % num)\n", (553, 581), ...
# A simple CO on NaCl charge-dipole interaction calculator # Using simple columb equations and a layer-by-layer extensive cluster model import numpy as np # Import charge point data import xlrd workbook = xlrd.open_workbook('CO_NaCl.xlsx', on_demand=True) charge_xyz = workbook.sheet_by_index(18) # Define constants z...
[ "numpy.deg2rad", "xlrd.open_workbook", "numpy.array", "numpy.linalg.norm", "numpy.dot" ]
[((207, 257), 'xlrd.open_workbook', 'xlrd.open_workbook', (['"""CO_NaCl.xlsx"""'], {'on_demand': '(True)'}), "('CO_NaCl.xlsx', on_demand=True)\n", (225, 257), False, 'import xlrd\n'), ((3078, 3112), 'numpy.array', 'np.array', (['[xd - x, yd - y, zd - z]'], {}), '([xd - x, yd - y, zd - z])\n', (3086, 3112), True, 'impor...
# Function to return feature scaled points import cv2 import numpy as np from . import plot_image def scale_features(obj, mask, points, boundary_line, device, debug=None): """scale_features: returns feature scaled points This is a function to transform the coordinates of landmark points onto a common scale ...
[ "cv2.moments", "numpy.zeros", "numpy.shape", "numpy.any", "numpy.array", "cv2.flip", "cv2.boundingRect" ]
[((1364, 1378), 'numpy.shape', 'np.shape', (['mask'], {}), '(mask)\n', (1372, 1378), True, 'import numpy as np\n'), ((1405, 1426), 'cv2.boundingRect', 'cv2.boundingRect', (['obj'], {}), '(obj)\n', (1421, 1426), False, 'import cv2\n'), ((1435, 1470), 'cv2.moments', 'cv2.moments', (['mask'], {'binaryImage': '(True)'}), '...
import torch import numpy as np import seaborn as sns import matplotlib.pyplot as plt import pandas as pd from a2c_ppo_acktr.multi_agent.utils import tsne import joblib import networkx as nx def hashing(fg): h = 0 for x in fg: h = h * 5 + x return h def distance(fg1, fg2): return np.not_equa...
[ "networkx.DiGraph", "matplotlib.pyplot.show", "networkx.draw_shell", "numpy.not_equal" ]
[((360, 372), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (370, 372), True, 'import networkx as nx\n'), ((1388, 1418), 'networkx.draw_shell', 'nx.draw_shell', (['G'], {'node_size': '(30)'}), '(G, node_size=30)\n', (1401, 1418), True, 'import networkx as nx\n'), ((1423, 1433), 'matplotlib.pyplot.show', 'plt.show...
# Copyright 2021 National Technology & Engineering Solutions # of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, # the U.S. Government retains certain rights in this software. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance ...
[ "logging.getLogger", "numpy.array", "logging.basicConfig" ]
[((856, 895), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (875, 895), False, 'import logging\n'), ((992, 1011), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1009, 1011), False, 'import logging\n'), ((1155, 1169), 'numpy.array', 'numpy.array', ...
import random from scipy import ndimage import numpy as np import tensorflow as tf @tf.function def rotate(volume): """Rotate the volume by a few degrees""" def scipy_rotate(volume): # define some rotation angles angles = [-20, -10, -5, 5, 10, 20] # pick angles at random angle...
[ "tensorflow.cond", "tensorflow.math.subtract", "tensorflow.math.less", "tensorflow.math.maximum", "tensorflow.numpy_function", "tensorflow.random_uniform_initializer", "tensorflow.random.uniform", "tensorflow.stack", "tensorflow.cast", "tensorflow.random.normal", "tensorflow.math.reduce_max", ...
[((539, 592), 'tensorflow.numpy_function', 'tf.numpy_function', (['scipy_rotate', '[volume]', 'tf.float32'], {}), '(scipy_rotate, [volume], tf.float32)\n', (556, 592), True, 'import tensorflow as tf\n'), ((790, 820), 'tensorflow.expand_dims', 'tf.expand_dims', (['volume'], {'axis': '(3)'}), '(volume, axis=3)\n', (804, ...
#!/usr/bin/env python """ utilities for XRF display """ import copy from functools import partial import time import numpy as np import wx import wx.lib.colourselect as csel from wxutils import (SimpleText, FloatCtrl, Choice, Font, pack, Button, Check, HyperText, HLine, GridPanel, CEN, LEFT, RIG...
[ "functools.partial", "copy.deepcopy", "wxutils.Check", "larch_plugins.xrf.xrf_calib_apply", "wxutils.SimpleText", "wxutils.GridPanel", "wxutils.FloatCtrl", "wxutils.Button", "numpy.zeros", "larch_plugins.xrf.xrf_calib_compute", "numpy.ones", "time.time", "wx.lib.colourselect.ColourSelect", ...
[((743, 841), 'wx.Frame.__init__', 'wx.Frame.__init__', (['self', 'parent', '(-1)', '"""Calibrate MCA"""'], {'size': 'size', 'style': 'wx.DEFAULT_FRAME_STYLE'}), "(self, parent, -1, 'Calibrate MCA', size=size, style=wx.\n DEFAULT_FRAME_STYLE)\n", (760, 841), False, 'import wx\n'), ((910, 925), 'wxutils.GridPanel', '...
from os import truncate import torch import torch.nn as nn import torch.nn.functional as F # from .emd_utils import * from Models.models.mmd_utils import gaussian_kernel, mmd import timm from einops import rearrange import numpy as np def get_mmd_distance(proto, query): """ 计算query与proto之间的MMD距离 Ar...
[ "torch.stack", "torch.nn.functional.cross_entropy", "torch.randn", "einops.rearrange", "Models.models.mmd_utils.mmd", "numpy.random.normal", "numpy.array" ]
[((1459, 1512), 'torch.stack', 'torch.stack', (['(data_1, data_2, data_3, data_4, data_5)'], {}), '((data_1, data_2, data_3, data_4, data_5))\n', (1470, 1512), False, 'import torch\n'), ((1517, 1581), 'einops.rearrange', 'rearrange', (['proto', '"""b (rows cols) dim -> b dim rows cols"""'], {'rows': '(5)'}), "(proto, '...
# -*- coding: utf-8 -*- import pyfits from pylab import * import Marsh import numpy import scipy from scipy.signal import medfilt def getSpectrum(filename,b,Aperture,minimum_column,maximum_column): hdulist = pyfits.open(filename) # Here we obtain the image... data=hdulist[0].data ...
[ "pyfits.open", "numpy.arange", "pyfits.getdata" ]
[((759, 788), 'pyfits.getdata', 'pyfits.getdata', (['"""Orders.fits"""'], {}), "('Orders.fits')\n", (773, 788), False, 'import pyfits\n'), ((884, 908), 'pyfits.getdata', 'pyfits.getdata', (['FileName'], {}), '(FileName)\n', (898, 908), False, 'import pyfits\n'), ((211, 232), 'pyfits.open', 'pyfits.open', (['filename'],...
## DAG module import numpy as np from functools import reduce import networkx as nx # only for charting # Helper function that builds adjacency matrix: def build_adj_matrix(scm): d = len(scm) mat = np.zeros((d,d)) for i, key_i in enumerate(scm): for j, key_j in enumerate(scm): if key_j ...
[ "networkx.DiGraph", "numpy.zeros", "networkx.draw" ]
[((207, 223), 'numpy.zeros', 'np.zeros', (['(d, d)'], {}), '((d, d))\n', (215, 223), True, 'import numpy as np\n'), ((7329, 7341), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (7339, 7341), True, 'import networkx as nx\n'), ((7458, 7487), 'networkx.draw', 'nx.draw', (['gr'], {'with_labels': '(True)'}), '(gr, wit...
import numpy as np with open("day11.txt") as f: c = np.array([list(map(int, line.rstrip())) for line in f.readlines()]) x,y = c.shape total_number_of_flashing_octopuses = 0 for step in range(1000): c += 1 while True: excited_octopodes = np.where(c>9) if len(excited_octopodes[0]) == 0: ...
[ "numpy.where", "numpy.all" ]
[((506, 521), 'numpy.where', 'np.where', (['(c < 0)'], {}), '(c < 0)\n', (514, 521), True, 'import numpy as np\n'), ((620, 634), 'numpy.all', 'np.all', (['(c == 0)'], {}), '(c == 0)\n', (626, 634), True, 'import numpy as np\n'), ((260, 275), 'numpy.where', 'np.where', (['(c > 9)'], {}), '(c > 9)\n', (268, 275), True, '...
import numpy as np # [1] <NAME> et.al., "Low temperature characterization of 14nm FDSOI CMOS devices" # [2] <NAME> et.al., "Modeling of a standard 0.35μm CMOS technology operating from 77 K to 300 K" class temperature_dependency: '''INPUT''' temperature = None node = None Vdd = None Vth0_300k...
[ "numpy.average" ]
[((3896, 3942), 'numpy.average', 'np.average', (['[u0_77k, u0_300k]'], {'weights': 'weight_'}), '([u0_77k, u0_300k], weights=weight_)\n', (3906, 3942), True, 'import numpy as np\n'), ((3300, 3372), 'numpy.average', 'np.average', (['[u0n_cryo[low_index], u0n_cryo[high_index]]'], {'weights': 'weight_'}), '([u0n_cryo[low_...
__author__ = "<NAME>" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules import os import numpy as np # RiBuild Modules from delphin_6_automation.file_parsing import weather_parser from delphin_6_automation....
[ "delphin_6_automation.file_parsing.weather_parser.list_to_ccd", "delphin_6_automation.delphin_setup.weather_modeling.short_wave_radiation", "numpy.array", "delphin_6_automation.file_parsing.weather_parser.ccd_to_list", "os.path.join" ]
[((602, 656), 'os.path.join', 'os.path.join', (['folder', '"""DWD_Weimar_DirectRadiation.ccd"""'], {}), "(folder, 'DWD_Weimar_DirectRadiation.ccd')\n", (614, 656), False, 'import os\n'), ((667, 722), 'os.path.join', 'os.path.join', (['folder', '"""DWD_Weimar_DiffuseRadiation.ccd"""'], {}), "(folder, 'DWD_Weimar_Diffuse...
import random import math import numpy as np import neighborgrid from matplotlib import pyplot as plt class Vicsek: '''This is the Vicsek Model a flocking model, in this model there are arrows or 2d spins that move forward in their direction and align their direcation to thier neighbors within a...
[ "neighborgrid.neigborgrid", "math.sqrt", "math.atan2", "math.floor", "math.sin", "random.random", "numpy.sin", "math.cos", "numpy.cos", "random.gauss" ]
[((854, 876), 'math.sqrt', 'math.sqrt', (['(2 * Dr * dt)'], {}), '(2 * Dr * dt)\n', (863, 876), False, 'import math\n'), ((1222, 1256), 'neighborgrid.neigborgrid', 'neighborgrid.neigborgrid', ([], {'R': 'self.R'}), '(R=self.R)\n', (1246, 1256), False, 'import neighborgrid\n'), ((4179, 4213), 'math.sqrt', 'math.sqrt', (...
import deepracing from deepracing.backend.ImageBackends import ImageLMDBWrapper, ImageFolderWrapper import pickle as pkl import yaml import argparse import os import numpy as np import random import scipy, scipy.stats import sklearn from sklearn.decomposition import PCA, IncrementalPCA import matplotlib.pyplot as plt i...
[ "yaml.load", "pickle.dump", "numpy.sum", "argparse.ArgumentParser", "numpy.random.randint", "numpy.arange", "torch.std_mean", "deepracing.backend.ImageLMDBWrapper", "os.path.join", "numpy.prod", "torch.FloatTensor", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "torchvision.trans...
[((432, 498), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Get PCA of an image dataset"""'}), "(description='Get PCA of an image dataset')\n", (455, 498), False, 'import argparse\n'), ((2626, 2660), 'os.path.split', 'os.path.split', (['dataset_config_file'], {}), '(dataset_config_file)...
import numpy as np import scipy from scipy.signal import savgol_filter from metapredict.metapredict_exceptions import DomainError """ Functions for extracting out discrete disordered domains based on the linear disorder score calculated by metapredict. """ # ----------------------------------------------------------...
[ "scipy.signal.savgol_filter", "numpy.mean", "metapredict.metapredict_exceptions.DomainError", "numpy.sum" ]
[((13766, 13820), 'scipy.signal.savgol_filter', 'savgol_filter', (['disorder', 'window_size', 'polynomial_order'], {}), '(disorder, window_size, polynomial_order)\n', (13779, 13820), False, 'from scipy.signal import savgol_filter\n'), ((5192, 5293), 'metapredict.metapredict_exceptions.DomainError', 'DomainError', (['""...
#!/usr/bin/env python '''Compilation of observed and derived astrophysical trends for galaxies. @author: <NAME> @contact: <EMAIL> @status: Development ''' import math import numpy as np import os import pandas as pd import scipy.interpolate as interp from scipy.optimize import newton import scipy.special import sys i...
[ "verdict.Dict", "sys.stdout.write", "math.exp", "numpy.log", "pandas.read_csv", "os.path.dirname", "numpy.asarray", "numpy.zeros", "math.log", "math.log10", "numpy.arange", "numpy.array", "scipy.optimize.newton", "numpy.exp", "scipy.interpolate.interp1d", "numpy.log10", "os.path.join...
[((1041, 1090), 'numpy.sqrt', 'np.sqrt', (['(constants.G_UNIV * m_vir_cgs / r_vir_cgs)'], {}), '(constants.G_UNIV * m_vir_cgs / r_vir_cgs)\n', (1048, 1090), True, 'import numpy as np\n'), ((2059, 2085), 'numpy.log', 'np.log', (['(1.0 + m_enc / mass)'], {}), '(1.0 + m_enc / mass)\n', (2065, 2085), True, 'import numpy as...
""" Example for ME325 - Machine Component Design Plot functions to plot the safety zones /safety envelopes for ductile and brittle failure theories. <NAME> Iowa State University Jan 2017 <EMAIL> All rights reserved """ from pylab import * import numpy as np; import matplotlib.pyplot as plt from enum import Enum ...
[ "numpy.sin", "numpy.cos", "matplotlib.pyplot.plot" ]
[((631, 695), 'matplotlib.pyplot.plot', 'plt.plot', (['[Sut, Sut]', '[-Suc, Sut]', '"""k-"""'], {'color': '"""b"""', 'lw': 'linewidth'}), "([Sut, Sut], [-Suc, Sut], 'k-', color='b', lw=linewidth)\n", (639, 695), True, 'import matplotlib.pyplot as plt\n'), ((700, 764), 'matplotlib.pyplot.plot', 'plt.plot', (['[Sut, -Suc...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 4 19:55:24 2019 @author: avelinojaver """ import sys from pathlib import Path dname = Path(__file__).resolve().parents[1] sys.path.append(str(dname)) import torch import pandas as pd import numpy as np import matplotlib.pylab as plt import tqdm...
[ "tqdm.tqdm", "torch.from_numpy", "skimage.feature.peak_local_max", "pathlib.Path.home", "torch.load", "cell_localization.evaluation.localmaxima.evaluate_coordinates", "numpy.zeros", "pathlib.Path", "cell_localization.models.UNet", "numpy.rollaxis", "matplotlib.pylab.subplots", "torch.no_grad",...
[((1588, 1653), 'cell_localization.models.UNet', 'UNet', ([], {'n_channels': 'n_ch_in', 'n_classes': 'n_ch_out', 'batchnorm': 'batchnorm'}), '(n_channels=n_ch_in, n_classes=n_ch_out, batchnorm=batchnorm)\n', (1592, 1653), False, 'from cell_localization.models import UNet\n'), ((1680, 1722), 'torch.load', 'torch.load', ...