code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import os import shutil import numpy as np import pandas as pd import pytest from sklearn.datasets import load_boston from vivid.cacheable import cacheable, CacheFunctionFactory from vivid.env import Settings from vivid.setup import setup_project class CountLoader: def __init__(self, loader): self.loade...
[ "pandas.DataFrame", "numpy.random.uniform", "vivid.cacheable.CacheFunctionFactory.list_keys", "pytest.warns", "os.path.exists", "pytest.fixture", "vivid.cacheable.cacheable", "pytest.raises", "vivid.setup.setup_project", "shutil.rmtree", "numpy.testing.assert_array_almost_equal", "os.path.join...
[((471, 499), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (485, 499), False, 'import pytest\n'), ((712, 744), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (726, 744), False, 'import pytest\n'), ((2165, 2201), 'pytest.mark.usefixt...
import unittest import numpy as np from bltest import attr from lace.serialization import bsf, ply from lace.cache import vc class TestBSF(unittest.TestCase): @attr('missing_assets') def test_load_bsf(self): expected_mesh = ply.load(vc('/unittest/bsf/bsf_example.ply')) bsf_mesh = bsf.load(vc('...
[ "numpy.testing.assert_array_almost_equal", "bltest.attr", "lace.cache.vc", "numpy.testing.assert_equal" ]
[((166, 188), 'bltest.attr', 'attr', (['"""missing_assets"""'], {}), "('missing_assets')\n", (170, 188), False, 'from bltest import attr\n'), ((361, 426), 'numpy.testing.assert_array_almost_equal', 'np.testing.assert_array_almost_equal', (['bsf_mesh.v', 'expected_mesh.v'], {}), '(bsf_mesh.v, expected_mesh.v)\n', (397, ...
import io, os, time from flask import Flask, jsonify, request from sklearn.externals import joblib import numpy as np import constants as const app = Flask(__name__) transformations = {} def __initialize_model(): os.environ["CUDA_VISIBLE_DEVICES"] = "-1" files = [os.path.join(const.transformer_path, f) fo...
[ "keras.models.load_model", "os.listdir", "os.path.basename", "flask.Flask", "time.time", "numpy.array", "sklearn.externals.joblib.load", "numpy.float64", "os.path.join", "flask.request.get_json", "numpy.concatenate" ]
[((151, 166), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (156, 166), False, 'from flask import Flask, jsonify, request\n'), ((749, 767), 'flask.request.get_json', 'request.get_json', ([], {}), '()\n', (765, 767), False, 'from flask import Flask, jsonify, request\n'), ((1981, 2493), 'numpy.array', 'np.a...
############################################################## ### Copyright (c) 2018-present, <NAME> ### ### Style Aggregated Network for Facial Landmark Detection ### ### Computer Vision and Pattern Recognition, 2018 ### ############################################################## import num...
[ "numpy.abs", "numpy.mean", "numpy.array", "numpy.linalg.norm", "sklearn.preprocessing.normalize" ]
[((511, 532), 'numpy.linalg.norm', 'np.linalg.norm', (['(x - y)'], {}), '(x - y)\n', (525, 532), True, 'import numpy as np\n'), ((645, 678), 'numpy.mean', 'np.mean', (['cluster_features'], {'axis': '(0)'}), '(cluster_features, axis=0)\n', (652, 678), True, 'import numpy as np\n'), ((976, 992), 'numpy.array', 'np.array'...
# -------------------------------------------------------- # Focal loss # Licensed under The Apache-2.0 License [see LICENSE for details] # Written by unsky https://github.com/unsky/ # -------------------------------------------------------- """ Focal loss """ import mxnet as mx import numpy as np class FocalLossOpe...
[ "numpy.log", "numpy.power", "mxnet.operator.register", "numpy.arange", "mxnet.nd.array" ]
[((2443, 2476), 'mxnet.operator.register', 'mx.operator.register', (['"""FocalLoss"""'], {}), "('FocalLoss')\n", (2463, 2476), True, 'import mxnet as mx\n'), ((1392, 1404), 'numpy.log', 'np.log', (['pro_'], {}), '(pro_)\n', (1398, 1404), True, 'import numpy as np\n'), ((1518, 1535), 'mxnet.nd.array', 'mx.nd.array', (['...
import os import numpy as np from smartsim import Experiment, constants from smartsim.database import PBSOrchestrator from smartredis import Client """ Launch a distributed, in memory database cluster and use the SmartRedis python client to send and recieve some numpy arrays. This example runs in an interactive al...
[ "smartsim.database.PBSOrchestrator", "smartredis.Client", "numpy.array", "smartsim.Experiment" ]
[((2022, 2069), 'smartsim.Experiment', 'Experiment', (['"""launch_cluster_db"""'], {'launcher': '"""pbs"""'}), "('launch_cluster_db', launcher='pbs')\n", (2032, 2069), False, 'from smartsim import Experiment, constants\n'), ((2467, 2507), 'smartredis.Client', 'Client', ([], {'address': 'db_address', 'cluster': '(True)'...
import noise from .Math import fit_11_to_01 from noise import pnoise1, pnoise2, pnoise3 import numpy as np ''' for i in range(octaves): result = amplitude * noise(pos * frequency) frequency *= lacunarity amplitude *= gain octaves: level of detail persistence(gain): steo of amplitude lacunarity: step...
[ "noise.pnoise1", "noise.pnoise3", "noise.snoise3", "noise.snoise2", "numpy.random.random", "noise.snoise4", "noise.pnoise2" ]
[((3037, 3062), 'numpy.random.random', 'np.random.random', (['(10, 2)'], {}), '((10, 2))\n', (3053, 3062), True, 'import numpy as np\n'), ((524, 575), 'noise.pnoise1', 'pnoise1', (['x', 'octaves', 'gain', 'lacunarity', 'repeat', 'base'], {}), '(x, octaves, gain, lacunarity, repeat, base)\n', (531, 575), False, 'from no...
import numpy as np import pandas as pd from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D N_features = 2 # Number of features N_train = 1000 # Number of train samples N_test = 10000 # Number of test samples N_labels = 2 # Number of classes # Clas...
[ "matplotlib.pyplot.title", "numpy.random.uniform", "matplotlib.pyplot.show", "numpy.eye", "matplotlib.pyplot.scatter", "numpy.zeros", "numpy.hstack", "numpy.reshape", "numpy.random.rand", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((385, 407), 'numpy.zeros', 'np.zeros', (['(1, N_train)'], {}), '((1, N_train))\n', (393, 407), True, 'import numpy as np\n'), ((566, 587), 'numpy.zeros', 'np.zeros', (['(1, N_test)'], {}), '((1, N_test))\n', (574, 587), True, 'import numpy as np\n'), ((787, 824), 'numpy.zeros', 'np.zeros', ([], {'shape': '[N_train, N...
import sys import torch from torchvision import transforms import cv2 import yaml import numpy as np from PIL import Image import json import uuid import time import humanfriendly import cougarvision_utils.cropping as crop_util # Adds CameraTraps to Sys path, import specific utilities with open("config/cameratra...
[ "numpy.random.seed", "cv2.VideoWriter_fourcc", "yaml.safe_load", "torchvision.transforms.Normalize", "torch.no_grad", "sys.path.append", "detection.run_tf_detector.TFDetector", "torch.softmax", "torchvision.transforms.CenterCrop", "cougarvision_utils.cropping.crop", "torch.topk", "numpy.asarra...
[((811, 829), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (825, 829), True, 'import numpy as np\n'), ((1210, 1221), 'time.time', 'time.time', ([], {}), '()\n', (1219, 1221), False, 'import time\n'), ((1236, 1272), 'detection.run_tf_detector.TFDetector', 'TFDetector', (["config['detector_model']"], ...
import numpy as np from scipy.stats import lomax from survival.distributions.basemodel import * from survival.optimization.optimizn import bisection class Lomax(Base): ''' We can instantiate a Lomax distribution (https://en.wikipedia.org/wiki/Lomax_distribution) with this class. ''' def __ini...
[ "survival.optimization.optimizn.bisection", "numpy.log", "numpy.random.exponential", "numpy.zeros", "numpy.isfinite", "numpy.random.gamma", "numpy.mean", "numpy.array", "scipy.stats.lomax.rvs" ]
[((15490, 15530), 'numpy.random.gamma', 'np.random.gamma', (['k', '(1 / theta)'], {'size': '(1000)'}), '(k, 1 / theta, size=1000)\n', (15505, 15530), True, 'import numpy as np\n'), ((15541, 15570), 'numpy.random.exponential', 'np.random.exponential', (['(1 / lm)'], {}), '(1 / lm)\n', (15562, 15570), True, 'import numpy...
import numpy as np import numpy.matlib as mat from scipy import signal import scipy as sci import matplotlib.pyplot as plt import random import os import shutil class edgelink(object): """ EDGELINK - Link edge points in an image into lists *****************************************************************...
[ "numpy.sum", "numpy.abs", "numpy.argmax", "numpy.floor", "numpy.ones", "numpy.argmin", "matplotlib.pyplot.figure", "numpy.exp", "shutil.rmtree", "random.randint", "numpy.power", "matplotlib.pyplot.close", "os.path.exists", "scipy.sparse.coo_matrix", "numpy.max", "numpy.reshape", "num...
[((13222, 13248), 'numpy.array', 'np.array', (['[rstart, cstart]'], {}), '([rstart, cstart])\n', (13230, 13248), True, 'import numpy as np\n'), ((13308, 13338), 'numpy.reshape', 'np.reshape', (['edgepoints', '[1, 2]'], {}), '(edgepoints, [1, 2])\n', (13318, 13338), True, 'import numpy as np\n'), ((19878, 19899), 'numpy...
from os.path import join import numpy as np from gym import spaces from environment.base import BaseEnv class Arm2TouchEnv(BaseEnv): def __init__(self, continuous, max_steps, geofence=.08, history_len=1, neg_reward=True, action_multiplier=1): BaseEnv.__init__(self, ...
[ "numpy.random.uniform", "numpy.copy", "numpy.argmax", "numpy.square", "numpy.zeros", "gym.spaces.Discrete", "numpy.clip", "numpy.random.randint", "numpy.array", "gym.spaces.Box", "environment.base.BaseEnv.step", "os.path.join" ]
[((1134, 1178), 'gym.spaces.Box', 'spaces.Box', (['(-np.inf)', 'np.inf'], {'shape': 'obs_shape'}), '(-np.inf, np.inf, shape=obs_shape)\n', (1144, 1178), False, 'from gym import spaces\n'), ((1422, 1452), 'numpy.array', 'np.array', (['[-0.15, -0.25, 0.49]'], {}), '([-0.15, -0.25, 0.49])\n', (1430, 1452), True, 'import n...
from __future__ import absolute_import, division, print_function, unicode_literals import functools import tensorflow as tf import numpy as np from tensorflow import keras import csv train_data = [] train_label = [] test_data = [] test_label = [] with open('C:/Users/felix/MakeUofT/venv/src/test_data.csv','rt') as f: ...
[ "tensorflow.keras.layers.Dense", "csv.reader", "numpy.array", "tensorflow.keras.models.load_model" ]
[((641, 660), 'numpy.array', 'np.array', (['test_data'], {}), '(test_data)\n', (649, 660), True, 'import numpy as np\n'), ((674, 694), 'numpy.array', 'np.array', (['test_label'], {}), '(test_label)\n', (682, 694), True, 'import numpy as np\n'), ((1095, 1115), 'numpy.array', 'np.array', (['train_data'], {}), '(train_dat...
import logging, time import numpy as np import torch try: from fedml_core.trainer.model_trainer import ModelTrainer except ImportError: from FedML.fedml_core.trainer.model_trainer import ModelTrainer from .utils import EvaluationMetricsKeeper class DModelTrainer(ModelTrainer): def __init__(self, mo...
[ "torch.no_grad", "numpy.array", "time.time" ]
[((4100, 4111), 'time.time', 'time.time', ([], {}), '()\n', (4109, 4111), False, 'import logging, time\n'), ((1177, 1216), 'numpy.array', 'np.array', (['fake_samples'], {'dtype': '"""float32"""'}), "(fake_samples, dtype='float32')\n", (1185, 1216), True, 'import numpy as np\n'), ((2164, 2175), 'time.time', 'time.time',...
# ---------------------------------------------------------------------------- # This module includes Genetic Algorithm class for CVRP. # Chromosome representation is composed of 2 parts. First part is job part, which includes # job ids in genes and second part is vehicle part, which includes vehicles by gene order. # ...
[ "numpy.empty", "numpy.average", "numpy.array", "json_parser.JsonParser.write_json_data" ]
[((1911, 1964), 'numpy.empty', 'np.empty', (['(self.chromosomes, self.genes)'], {'dtype': '"""int"""'}), "((self.chromosomes, self.genes), dtype='int')\n", (1919, 1964), True, 'import numpy as np\n'), ((2392, 2421), 'numpy.array', 'np.array', (['chromosome_job_part'], {}), '(chromosome_job_part)\n', (2400, 2421), True,...
import numpy as np from sklearn.neighbors import KernelDensity from scipy.spatial.distance import euclidean from sklearn.metrics.pairwise import rbf_kernel from cvxopt import matrix, solvers from sklearn.model_selection import GridSearchCV, LeaveOneOut, KFold def gaussian_kernel(X, h, d): """ Apply gaussian k...
[ "numpy.abs", "numpy.sum", "numpy.logspace", "numpy.ones", "numpy.mean", "numpy.exp", "numpy.diag", "numpy.std", "numpy.identity", "cvxopt.solvers.qp", "numpy.random.shuffle", "numpy.trapz", "numpy.minimum", "cvxopt.matrix", "numpy.median", "sklearn.neighbors.KernelDensity", "sklearn....
[((2347, 2357), 'numpy.sqrt', 'np.sqrt', (['t'], {}), '(t)\n', (2354, 2357), True, 'import numpy as np\n'), ((4741, 4763), 'numpy.median', 'np.median', (['res'], {'axis': '(0)'}), '(res, axis=0)\n', (4750, 4763), True, 'import numpy as np\n'), ((4796, 4808), 'numpy.mean', 'np.mean', (['res'], {}), '(res)\n', (4803, 480...
import tensorflow as tf import numpy as np import math from lib.Layer import Layer class ConvToFullyConnected(Layer): def __init__(self, input_shape): self.shape = input_shape ################################################################### def get_weights(self): return [] ...
[ "tensorflow.shape", "numpy.prod" ]
[((372, 391), 'numpy.prod', 'np.prod', (['self.shape'], {}), '(self.shape)\n', (379, 391), True, 'import numpy as np\n'), ((498, 509), 'tensorflow.shape', 'tf.shape', (['X'], {}), '(X)\n', (506, 509), True, 'import tensorflow as tf\n'), ((709, 721), 'tensorflow.shape', 'tf.shape', (['AI'], {}), '(AI)\n', (717, 721), Tr...
import csv import cv2 import numpy as np import sklearn from keras.models import Sequential from keras.layers import Dense, Activation, Flatten, Dropout, Lambda, Conv2D, Convolution2D, MaxPooling2D, Cropping2D from sklearn.model_selection import train_test_split from sklearn.utils import shuffle BATCH_SIZE = 32 def ...
[ "csv.reader", "keras.layers.Cropping2D", "sklearn.model_selection.train_test_split", "keras.layers.Dropout", "keras.layers.Flatten", "cv2.flip", "keras.layers.Dense", "keras.layers.Lambda", "numpy.array", "keras.layers.Conv2D", "keras.models.Sequential", "sklearn.utils.shuffle", "keras.layer...
[((4236, 4285), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X_train', 'y_train'], {'test_size': '(0.2)'}), '(X_train, y_train, test_size=0.2)\n', (4252, 4285), False, 'from sklearn.model_selection import train_test_split\n'), ((1627, 1643), 'numpy.array', 'np.array', (['images'], {}), '(images)\n...
from torchvision import datasets, transforms import torch import numpy as np from PIL import Image import PIL from config import options class CIFAR10: def __init__(self, mode='train'): self.mode = mode if mode == 'train': train_dataset = datasets.CIFAR10(root='./dataset', train=True, ...
[ "torchvision.transforms.RandomHorizontalFlip", "torchvision.transforms.RandomRotation", "torchvision.datasets.CIFAR10", "numpy.array", "PIL.Image.fromarray", "torchvision.transforms.RandomResizedCrop", "torch.tensor", "torchvision.transforms.ToTensor" ]
[((273, 334), 'torchvision.datasets.CIFAR10', 'datasets.CIFAR10', ([], {'root': '"""./dataset"""', 'train': '(True)', 'download': '(True)'}), "(root='./dataset', train=True, download=True)\n", (289, 334), False, 'from torchvision import datasets, transforms\n'), ((406, 437), 'numpy.array', 'np.array', (['train_dataset....
# coding: utf-8 from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys import argparse import os import numpy as np from .read_files import split_imdb_files, split_yahoo_files, split_agnews_files, split_snli_files from .word_level_process import word_pro...
[ "os.makedirs", "numpy.argmax", "modified_bert_tokenizer.ModifiedXLNetTokenizer.from_pretrained", "random.shuffle", "os.path.exists", "time.clock", "time.time", "modified_bert_tokenizer.ModifiedBertTokenizer.from_pretrained", "modified_bert_tokenizer.ModifiedRobertaTokenizer.from_pretrained", "mult...
[((2178, 2204), 'random.seed', 'random.seed', (['opt.rand_seed'], {}), '(opt.rand_seed)\n', (2189, 2204), False, 'import random\n'), ((2209, 2232), 'random.shuffle', 'random.shuffle', (['indexes'], {}), '(indexes)\n', (2223, 2232), False, 'import random\n'), ((3626, 3637), 'time.time', 'time.time', ([], {}), '()\n', (3...
import helstrom import numpy as np import sys if __name__ == "__main__": ''' Change rho_0 and rho_1 here ''' rho0 = np.array([[1, 0], [0, 0]]) rho1 = np.array([[0.5, 0], [0, 0.5]]) if len(sys.argv) == 3: rho0 = np.matrix(sys.argv[1]) rho1 = np.matrix(sys.argv[2]) rho0 ...
[ "numpy.matrix", "numpy.asarray", "numpy.array", "helstrom.sdp" ]
[((135, 161), 'numpy.array', 'np.array', (['[[1, 0], [0, 0]]'], {}), '([[1, 0], [0, 0]])\n', (143, 161), True, 'import numpy as np\n'), ((173, 203), 'numpy.array', 'np.array', (['[[0.5, 0], [0, 0.5]]'], {}), '([[0.5, 0], [0, 0.5]])\n', (181, 203), True, 'import numpy as np\n'), ((375, 399), 'helstrom.sdp', 'helstrom.sd...
# -*- coding: utf-8 -*- # @Author: <NAME> # @Email: <EMAIL> # @Date: 2020-09-24 15:30:34 # @Last Modified by: <NAME> # @Last Modified time: 2021-03-23 00:36:39 import os import pickle import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt from PySONIC.core import EffectiveVariablesL...
[ "pickle.dump", "numpy.abs", "numpy.empty", "numpy.ones", "PySONIC.core.EffectiveVariablesLookup", "os.path.isfile", "numpy.mean", "numpy.arange", "pickle.load", "numpy.sin", "os.path.join", "scipy.integrate.odeint", "numpy.linspace", "matplotlib.pyplot.subplots", "numpy.vectorize", "nu...
[((4422, 4461), 'numpy.arange', 'np.arange', (['*self.pneuron.Qbounds', '(1e-05)'], {}), '(*self.pneuron.Qbounds, 1e-05)\n', (4431, 4461), True, 'import numpy as np\n'), ((5570, 5608), 'PySONIC.core.EffectiveVariablesLookup', 'EffectiveVariablesLookup', (['refs', 'tables'], {}), '(refs, tables)\n', (5594, 5608), False,...
#!/usr/bin/env python # coding=utf-8 """ Showcasing data inspection This example script needs PIL (Pillow package) to load images from disk. """ import os import sys import numpy as np # Extend the python path sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) from iminspect.inspector i...
[ "os.path.abspath", "vito.imutils.imread", "numpy.arange", "vito.flowutils.floread", "iminspect.inspector.inspect" ]
[((481, 494), 'iminspect.inspector.inspect', 'inspect', (['None'], {}), '(None)\n', (488, 494), False, 'from iminspect.inspector import inspect, DataType\n'), ((601, 614), 'iminspect.inspector.inspect', 'inspect', (['mask'], {}), '(mask)\n', (608, 614), False, 'from iminspect.inspector import inspect, DataType\n'), ((1...
"""Functions for mapping between geo regions.""" # -*- coding: utf-8 -*- import numpy as np import pandas as pd from delphi_utils import GeoMapper from .constants import METRICS, COMBINED_METRIC gmpr = GeoMapper() def generate_transition_matrix(geo_res): """ Generate transition matrix from county to msa/hrr. ...
[ "pandas.DataFrame", "delphi_utils.GeoMapper", "pandas.pivot_table", "numpy.matmul" ]
[((203, 214), 'delphi_utils.GeoMapper', 'GeoMapper', ([], {}), '()\n', (212, 214), False, 'from delphi_utils import GeoMapper\n'), ((1945, 1977), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'df.columns'}), '(columns=df.columns)\n', (1957, 1977), True, 'import pandas as pd\n'), ((2228, 2279), 'numpy.matmul', 'n...
# import numpy as np import cv2 import face_recognition from PIL import Image,ImageFont,ImageDraw import face_recognition from apps.cve.model.m_face_embedding_manager import MFaceEmbeddingManager from apps.cve.view.v_face_embedding_manager import VFaceEmbeddingManager class CFaceEmbeddingManager(object): def __in...
[ "cv2.waitKey", "face_recognition.face_encodings", "face_recognition.load_image_file", "cv2.imshow", "cv2.VideoCapture", "apps.cve.model.m_face_embedding_manager.MFaceEmbeddingManager", "apps.cve.view.v_face_embedding_manager.VFaceEmbeddingManager", "numpy.reshape", "cv2.rectangle", "face_recogniti...
[((376, 399), 'apps.cve.model.m_face_embedding_manager.MFaceEmbeddingManager', 'MFaceEmbeddingManager', ([], {}), '()\n', (397, 399), False, 'from apps.cve.model.m_face_embedding_manager import MFaceEmbeddingManager\n'), ((448, 506), 'face_recognition.load_image_file', 'face_recognition.load_image_file', (['"""images/s...
# Copyright (c) 2020-present, Assistive Robotics Lab # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from common.data_utils import read_h5 from common.logging import logger import h5py import argparse import sys import g...
[ "h5py.File", "argparse.ArgumentParser", "common.data_utils.read_h5", "numpy.append", "common.logging.logger.error", "common.logging.logger.info", "glob.glob", "sys.exit" ]
[((511, 536), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (534, 536), False, 'import argparse\n'), ((2450, 2558), 'common.logging.logger.info', 'logger.info', (['"""Participant numbers for training, validation, or testing dataset were not provided."""'], {}), "(\n 'Participant numbers for...
""" Visualize and save group detections """ from utils import read_cad_frames, read_cad_annotations, get_interaction_features, add_annotation, custom_interaction_features from matplotlib import pyplot as plt from keras.models import Model from keras.layers import Input, Dense from keras.layers.merge import add from k...
[ "keras.models.load_model", "utils.custom_interaction_features", "keras.backend.epsilon", "utils.read_cad_frames", "numpy.isnan", "utils.read_cad_annotations", "sklearn.cluster.DBSCAN", "numpy.savetxt", "os.path.exists", "numpy.genfromtxt", "numpy.max", "keras.backend.max", "os.makedirs", "...
[((2167, 2189), 'keras.models.load_model', 'load_model', (['model_path'], {}), '(model_path)\n', (2177, 2189), False, 'from keras.models import load_model\n'), ((710, 737), 'keras.backend.max', 'kb.max', (['(y_pred - 1 + y_true)'], {}), '(y_pred - 1 + y_true)\n', (716, 737), True, 'import keras.backend as kb\n'), ((759...
"""Just for testing purposes. Change at will.""" import numpy as np X = np.array([[30, 0], [50, 0], [70, 1], [30, 1], [50, 1], [60, 0], [61, 0], [40, 0], [39, 0], [40, 1], [39, ...
[ "sklearn.ensemble.RandomForestClassifier", "numpy.std", "sklearn.neighbors.KNeighborsClassifier", "numpy.mean", "numpy.array", "sklearn.svm.SVC", "alchemy.binary_model" ]
[((75, 189), 'numpy.array', 'np.array', (['[[30, 0], [50, 0], [70, 1], [30, 1], [50, 1], [60, 0], [61, 0], [40, 0], [\n 39, 0], [40, 1], [39, 1]]'], {}), '([[30, 0], [50, 0], [70, 1], [30, 1], [50, 1], [60, 0], [61, 0], [\n 40, 0], [39, 0], [40, 1], [39, 1]])\n', (83, 189), True, 'import numpy as np\n'), ((329, 3...
import RPi.GPIO as GPIO import time import datetime import csv import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation trig = 13 echo = 15 print('setting up the pins') #GPIO.cleanup() GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(trig,GPIO.OUT) GPIO.setup(echo,GPIO.I...
[ "matplotlib.pyplot.title", "numpy.matrix", "RPi.GPIO.setmode", "matplotlib.pyplot.show", "csv.writer", "RPi.GPIO.cleanup", "RPi.GPIO.setup", "numpy.transpose", "time.sleep", "matplotlib.animation.FuncAnimation", "time.time", "matplotlib.pyplot.figure", "numpy.linalg.inv", "RPi.GPIO.input",...
[((223, 247), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BOARD'], {}), '(GPIO.BOARD)\n', (235, 247), True, 'import RPi.GPIO as GPIO\n'), ((248, 271), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (264, 271), True, 'import RPi.GPIO as GPIO\n'), ((272, 298), 'RPi.GPIO.setup', 'GPIO.setup', ...
######################################## # MIT License # # Copyright (c) 2020 <NAME> ######################################## ''' Basic functions and classes to do minimizations. ''' from ..base import data_types from ..base import exceptions from ..base import parameters from ..base.core import DocMeta import collect...
[ "warnings.simplefilter", "numpy.asarray", "numpy.allclose", "warnings.catch_warnings", "collections.namedtuple", "numpy.array", "numpy.diag", "warnings.warn" ]
[((562, 631), 'collections.namedtuple', 'collections.namedtuple', (['"""MinimizationResult"""', "['valid', 'fcn', 'cov']"], {}), "('MinimizationResult', ['valid', 'fcn', 'cov'])\n", (584, 631), False, 'import collections\n'), ((3133, 3151), 'numpy.asarray', 'np.asarray', (['values'], {}), '(values)\n', (3143, 3151), Tr...
# -*- coding: utf-8 -*- """ Discreption : Data crawler, automatically get treasury rates and interpolate Created on Tue May 12 14:07:21 2020 @author : <NAME> email : <EMAIL> """ import pandas as pd import numpy as np from selenium import webdriver from selenium.webdriver.chrome.options import Optio...
[ "selenium.webdriver.chrome.options.Options", "numpy.zeros", "numpy.array", "selenium.webdriver.Chrome", "scipy.interpolate.interp1d", "numpy.repeat" ]
[((805, 814), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (812, 814), False, 'from selenium.webdriver.chrome.options import Options\n'), ((1016, 1074), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['chromdriver_path'], {'options': 'chrome_options'}), '(chromdriver_path, options=chrome...
import numpy as np import os import cv2 def main(info, datadir, resultdir): level = len(info) img_width, img_height = info[0][1] filename = '0-1.png' filepath = os.path.join(datadir, filename) img_zero = cv2.imread(filepath, cv2.IMREAD_COLOR) result_name = 'clean0.png' result_path = o...
[ "numpy.seterr", "numpy.empty", "cv2.imwrite", "cv2.imread", "os.path.join" ]
[((183, 214), 'os.path.join', 'os.path.join', (['datadir', 'filename'], {}), '(datadir, filename)\n', (195, 214), False, 'import os\n'), ((230, 268), 'cv2.imread', 'cv2.imread', (['filepath', 'cv2.IMREAD_COLOR'], {}), '(filepath, cv2.IMREAD_COLOR)\n', (240, 268), False, 'import cv2\n'), ((319, 355), 'os.path.join', 'os...
# Orthogonal Lowrank Embedding for Caffe # # Copyright (c) <NAME>, 2017 # # <EMAIL> # MAKE SURE scipy is linked against openblas import caffe import numpy as np import scipy as sp class OLELossLayer(caffe.Layer): """ Computes the OLE Loss in CPU """ def setup(self, bottom, top): # check i...
[ "numpy.zeros_like", "numpy.sum", "numpy.zeros", "numpy.float", "scipy.linalg.svd", "numpy.unique" ]
[((489, 516), 'numpy.float', 'np.float', (["params['lambda_']"], {}), "(params['lambda_'])\n", (497, 516), True, 'import numpy as np\n'), ((792, 839), 'numpy.zeros_like', 'np.zeros_like', (['bottom[0].data'], {'dtype': 'np.float32'}), '(bottom[0].data, dtype=np.float32)\n', (805, 839), True, 'import numpy as np\n'), ((...
from builtin_interfaces.msg import Duration from ros2pkg.api import get_prefix_path from geometry_msgs.msg import Pose from std_srvs.srv import Empty from std_msgs.msg import String from gazebo_msgs.msg import ContactState, ModelState from gazebo_msgs.srv import DeleteEntity from control_msgs.msg import JointTrajectory...
[ "gym_gazebo2.utils.ut_mara.getTrajectoryMessage", "rclpy.spin_once", "numpy.arctan2", "gym_gazebo2.utils.ut_mara.getJacobians", "numpy.sum", "gym_gazebo2.utils.ut_mara.processObservations", "rclpy.shutdown", "numpy.arange", "cv2.imshow", "pandas.DataFrame", "gym_gazebo2.utils.general_utils.forwa...
[((1259, 1283), 'gym.logger.set_level', 'gym.logger.set_level', (['(40)'], {}), '(40)\n', (1279, 1283), False, 'import gym\n'), ((16836, 16857), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (16846, 16857), False, 'import rclpy\n'), ((16882, 16904), 'rclpy.spin_once', 'rclpy.spin_once', (['robot'...
# Copyright 2020 The TensorFlow Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
[ "pickle.dump", "tensorflow.io.decode_image", "matplotlib.pyplot.clf", "tensorflow.reshape", "numpy.ones", "matplotlib.pyplot.figure", "numpy.sin", "numpy.tile", "numpy.diag", "matplotlib.pyplot.tight_layout", "os.path.join", "matplotlib.pyplot.imshow", "matplotlib.pyplot.colorbar", "numpy....
[((1144, 1170), 'tensorflow.expand_dims', 'tf.expand_dims', (['data_np', '(0)'], {}), '(data_np, 0)\n', (1158, 1170), True, 'import tensorflow as tf\n'), ((1363, 1395), 'numpy.expand_dims', 'np.expand_dims', (['centers'], {'axis': '(-1)'}), '(centers, axis=-1)\n', (1377, 1395), True, 'import numpy as np\n'), ((1785, 18...
"""A module to help perform analyses on various observatioanl studies. This module was implemented following studies of M249, Book 1. Dependencies: - **scipy** - **statsmodels** - **pandas** - **numpy** """ from __future__ import annotations as _annotations import math as _math from scipy import st...
[ "pandas.DataFrame", "scipy.stats.norm.ppf", "numpy.divide", "scipy.stats.norm", "numpy.sum", "numpy.log", "math.sqrt", "math.exp", "numpy.empty", "numpy.square", "scipy.stats.chi2_contingency", "scipy.stats.chi2", "scipy.stats.contingency.expected_freq" ]
[((861, 876), 'numpy.sum', '_np.sum', (['obs[0]'], {}), '(obs[0])\n', (868, 876), True, 'import numpy as _np\n'), ((886, 948), 'pandas.DataFrame', '_pd.DataFrame', ([], {'index': "['riskratio', 'stderr', 'lower', 'upper']"}), "(index=['riskratio', 'stderr', 'lower', 'upper'])\n", (899, 948), True, 'import pandas as _pd...
import os import sys from sys import exit, argv, path from os.path import realpath, dirname import csv import yaml import numpy as np CODE_DIR = '{}/..'.format(dirname(realpath(__file__))) path.insert(1, '{}/src'.format(CODE_DIR)) use_settings_path = False if 'hde_glm' not in sys.modules: import hde_glm as glm _...
[ "yaml.load", "hde_glm.save_glm_estimates_to_CSV_Experiments", "hde_glm.get_temporal_depth", "hde_glm.preprocess_spiketimes", "hde_glm.load_and_preprocess_spiketimes_experiments", "hde_glm.compute_estimates_Simulation", "hde_glm.compute_estimates_Experiments", "os.path.realpath", "hde_glm.save_glm_es...
[((2091, 2142), 'hde_glm.preprocess_spiketimes', 'glm.preprocess_spiketimes', (['spiketimes', 'glm_settings'], {}), '(spiketimes, glm_settings)\n', (2116, 2142), True, 'import hde_glm as glm\n'), ((2465, 2543), 'hde_glm.compute_estimates_Simulation', 'glm.compute_estimates_Simulation', (['past_range', 'spiketimes', 'co...
import numpy as np # type: ignore import pytest # type: ignore # TODO: remove NOQA when isort is fixed from layg.emulator.cholesky_nn_emulator import ( # NOQA all_monomials, monomials_deg, n_coef, ) @pytest.mark.parametrize( ["n", "delta", "true"], [ # Degree 0 -> only 1 (1, 0,...
[ "layg.emulator.cholesky_nn_emulator.monomials_deg", "layg.emulator.cholesky_nn_emulator.all_monomials", "layg.emulator.cholesky_nn_emulator.n_coef", "numpy.sort", "numpy.arange", "numpy.array", "pytest.mark.parametrize" ]
[((218, 360), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["['n', 'delta', 'true']", '[(1, 0, 1), (2, 0, 1), (8, 0, 1), (1, 1, 2), (2, 1, 3), (8, 1, 9), (1, 2, 3\n ), (2, 2, 6)]'], {}), "(['n', 'delta', 'true'], [(1, 0, 1), (2, 0, 1), (8, \n 0, 1), (1, 1, 2), (2, 1, 3), (8, 1, 9), (1, 2, 3), (2, 2, 6)]...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import os import pathlib import io import re import string import tqdm import numpy as np import tensorflow as tf from tensorflow.keras import layers from modules.reader.reader import DataReader from modules.preprocessing.nlp import NLPPreprocessor fro...
[ "modules.preprocessing.nlp.NLPPreprocessor", "os.makedirs", "argparse.ArgumentParser", "os.path.getsize", "modules.modeling.word_embedding.Word2Vec", "os.path.realpath", "tensorflow.data.Dataset.from_tensor_slices", "modules.reader.reader.DataReader", "tensorflow.keras.losses.CategoricalCrossentropy...
[((695, 726), 'os.path.getsize', 'os.path.getsize', (['data_directory'], {}), '(data_directory)\n', (710, 726), False, 'import os\n'), ((746, 793), 'os.path.join', 'os.path.join', (['data_directory', '"""shakespeare.txt"""'], {}), "(data_directory, 'shakespeare.txt')\n", (758, 793), False, 'import os\n'), ((3886, 3903)...
#!/usr/bin/env python # coding=utf-8 ''' Author: <NAME> / Yulv Email: <EMAIL> Date: 2022-03-19 10:33:38 Motto: Entities should not be multiplied unnecessarily. LastEditors: <NAME> LastEditTime: 2022-03-23 00:32:15 FilePath: /Awesome-Ultrasound-Standard-Plane-Detection/src/ITN/utils/plane.py Description: Functions for p...
[ "numpy.stack", "numpy.meshgrid", "numpy.eye", "utils.geometry.quaternion_from_matrix", "utils.geometry.quaternion_matrix", "numpy.transpose", "numpy.expand_dims", "numpy.cross", "numpy.zeros", "numpy.ones", "numpy.linalg.svd", "numpy.array", "utils.geometry.unit_vector", "numpy.linspace", ...
[((715, 731), 'numpy.linalg.svd', 'np.linalg.svd', (['A'], {}), '(A)\n', (728, 731), True, 'import numpy as np\n'), ((1546, 1562), 'numpy.linalg.svd', 'np.linalg.svd', (['A'], {}), '(A)\n', (1559, 1562), True, 'import numpy as np\n'), ((4055, 4102), 'numpy.linspace', 'np.linspace', (['(-mesh_r[0])', 'mesh_r[0]', 'mesh_...
from models.volume_rendering import volume_render import torch import numpy as np from tqdm import tqdm def get_rays_opencv_np(intrinsics: np.ndarray, c2w: np.ndarray, H: int, W: int): ''' ray batch sampling < opencv / colmap convention, standard pinhole camera > the camera is facing [+z] dir...
[ "numpy.moveaxis", "numpy.ones_like", "numpy.clip", "numpy.linalg.inv", "numpy.arange", "models.volume_rendering.volume_render", "torch.no_grad", "torch.from_numpy" ]
[((1348, 1375), 'numpy.moveaxis', 'np.moveaxis', (['rays_d', '(-1)', '(-2)'], {}), '(rays_d, -1, -2)\n', (1359, 1375), True, 'import numpy as np\n'), ((826, 838), 'numpy.arange', 'np.arange', (['W'], {}), '(W)\n', (835, 838), True, 'import numpy as np\n'), ((840, 852), 'numpy.arange', 'np.arange', (['H'], {}), '(H)\n',...
import os import numpy as np import cv2 import torch from torch.utils.data.dataset import Dataset from torchvision import transforms from PIL import Image, ImageFilter class Gaze360(Dataset): def __init__(self, path, root, transform, angle, binwidth, train=True): self.transform = transform ...
[ "numpy.digitize", "torch.FloatTensor", "os.path.join", "torch.from_numpy" ]
[((2491, 2522), 'torch.FloatTensor', 'torch.FloatTensor', (['[pitch, yaw]'], {}), '([pitch, yaw])\n', (2508, 2522), False, 'import torch\n'), ((4910, 4941), 'torch.FloatTensor', 'torch.FloatTensor', (['[pitch, yaw]'], {}), '([pitch, yaw])\n', (4927, 4941), False, 'import torch\n'), ((1944, 1973), 'os.path.join', 'os.pa...
# MIT License # # Copyright (c) 2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
[ "numpy.full", "dpemu.nodes.Array", "dpemu.filters.time_series.SensorDrift", "numpy.random.RandomState", "numpy.isnan", "numpy.array", "numpy.arange", "dpemu.filters.time_series.Gap", "numpy.array_equal" ]
[((1298, 1366), 'numpy.array', 'np.array', (['[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]'], {}), '([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])\n', (1306, 1366), True, 'import numpy as np\n'), ((1380, 1387), 'dpemu.nodes.Array', 'Array', ([], {}), '()\n', (1385, 1387), False, 'from dpemu....
import python2latex as p2l import sys, os sys.path.append(os.getcwd()) from datetime import datetime import csv import numpy as np from experiments.datasets.datasets import dataset_list from partitioning_machines import func_to_cmd class MeanWithStd(float, p2l.TexObject): def __new__(cls, array): mean =...
[ "csv.reader", "os.getcwd", "python2latex.Document", "python2latex.Table", "numpy.isnan", "numpy.array" ]
[((58, 69), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (67, 69), False, 'import sys, os\n'), ((977, 1014), 'python2latex.Table', 'p2l.Table', (['(7, 5)'], {'float_format': '""".3f"""'}), "((7, 5), float_format='.3f')\n", (986, 1014), True, 'import python2latex as p2l\n'), ((3813, 3864), 'python2latex.Document', 'p2l.D...
# Clean and Plot Linked URLS # Import Modules import os import pandas as pd import numpy as np import csv from tqdm import tqdm import matplotlib.pyplot as plt from matplotlib.ticker import PercentFormatter linked_url = pd.read_csv('Outputs/CS_FULL/LinkedURLs_CS.csv') linked_url = linked_url.sort_values(by=['Times_L...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "pandas.read_csv", "matplotlib.pyplot.bar", "matplotlib.pyplot.yticks", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.subplots" ]
[((222, 270), 'pandas.read_csv', 'pd.read_csv', (['"""Outputs/CS_FULL/LinkedURLs_CS.csv"""'], {}), "('Outputs/CS_FULL/LinkedURLs_CS.csv')\n", (233, 270), True, 'import pandas as pd\n'), ((535, 577), 'numpy.arange', 'np.arange', (['(0)', '(max_links + spacing)', 'spacing'], {}), '(0, max_links + spacing, spacing)\n', (5...
from models import MVDNet as MVDNet import argparse import time import csv import numpy as np import torch from torch.autograd import Variable import torch.backends.cudnn as cudnn import torch.optim import torch.nn as nn import torch.nn.functional as F import torch.utils.data import custom_transforms f...
[ "os.mkdir", "argparse.ArgumentParser", "utils.adjust_learning_rate", "custom_transforms.Normalize", "torch.cat", "custom_transforms.ArrayToTensor", "torch.no_grad", "utils.save_path_formatter", "torch.utils.data.DataLoader", "torch.load", "numpy.savetxt", "torch.squeeze", "path.Path", "cus...
[((885, 1059), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Structure from Motion Learner training on KITTI and CityScapes Dataset"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description=\n 'Structure from Motion Learner training on KITTI and CityScapes Dat...
import os import numpy as np import tensorflow as tf import tqdm class Callback: """Callback object for customizing trainer. """ def __init__(self): pass def interval(self): """Callback interval, -1 for epochs, positives for steps """ raise NotImplementedError('Callba...
[ "tqdm.tqdm", "tensorflow.summary.image", "tensorflow.summary.scalar", "numpy.random.randint", "tensorflow.summary.create_file_writer", "os.path.join" ]
[((1175, 1210), 'os.path.join', 'os.path.join', (['summary_path', '"""train"""'], {}), "(summary_path, 'train')\n", (1187, 1210), False, 'import os\n'), ((1231, 1265), 'os.path.join', 'os.path.join', (['summary_path', '"""test"""'], {}), "(summary_path, 'test')\n", (1243, 1265), False, 'import os\n'), ((1295, 1336), 't...
import argparse import os import numpy as np from Models import HIV4O_c as model # pylint: disable=no-name-in-module from Structures import ModelGeometry, PairMat, CompilerParameters, NNModel, TrainingParameters # pylint: disable=import-error from datetime import datetime # First we define an argument parser so we c...
[ "os.path.abspath", "argparse.ArgumentParser", "Models.HIV4O_c", "numpy.argmax", "os.makedirs", "os.path.dirname", "Structures.TrainingParameters", "Structures.ModelGeometry", "numpy.amax", "Structures.PairMat", "datetime.datetime.now", "Structures.CompilerParameters" ]
[((369, 458), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Accepts paths to validation and training data"""'}), "(description=\n 'Accepts paths to validation and training data')\n", (392, 458), False, 'import argparse\n'), ((1095, 1143), 'Structures.PairMat', 'PairMat', (['args.test...
import numpy as np import pytest from astropy import units as u from astropy.io import fits from astropy.nddata import NDData from astropy.table import Table from astropy.utils.exceptions import AstropyDeprecationWarning from ginga.ColorDist import ColorDistBase from ..core import ImageWidget, ALLOWED_CURSOR_LOCATI...
[ "pytest.warns", "astropy.nddata.NDData", "astropy.io.fits.PrimaryHDU", "pytest.raises", "numpy.random.random", "numpy.random.randint", "pytest.mark.xfail" ]
[((1697, 1744), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""Not implemented yet"""'}), "(reason='Not implemented yet')\n", (1714, 1744), False, 'import pytest\n'), ((385, 413), 'numpy.random.random', 'np.random.random', (['[100, 100]'], {}), '([100, 100])\n', (401, 413), True, 'import numpy as np\n'),...
""" Some codes from https://github.com/Newmu/dcgan_code """ from __future__ import division import math import json import random import pprint import scipy.misc import os import numpy as np from time import gmtime, strftime from six.moves import xrange from glob import glob import tensorflow as tf imp...
[ "tensorflow.trainable_variables", "numpy.empty", "numpy.floor", "random.shuffle", "numpy.random.randint", "numpy.arange", "numpy.tile", "numpy.zeros_like", "random.randint", "numpy.copy", "numpy.empty_like", "os.path.exists", "numpy.append", "numpy.reshape", "numpy.linspace", "numpy.ra...
[((364, 386), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {}), '()\n', (384, 386), False, 'import pprint\n'), ((507, 531), 'tensorflow.trainable_variables', 'tf.trainable_variables', ([], {}), '()\n', (529, 531), True, 'import tensorflow as tf\n'), ((535, 596), 'tensorflow.contrib.slim.model_analyzer.analyze_v...
#!/usr/bin/env python # written by <NAME>, last edited 1/9/2021 # supervised by Prof. <NAME> # inspiration from M Del Ben et al., Physical Review B 99, 125128 (2019) # this program takes an inverse epsilon matrix, .h5 format, and writes an inverse epsilon matrix # simplified by the static subspace approximati...
[ "h5py.File", "numpy.argmax", "numpy.identity", "numpy.linalg.eigh", "numpy.diagonal", "numpy.linalg.inv", "numpy.diag", "sys.exit", "numpy.sqrt" ]
[((1290, 1315), 'numpy.diag', 'np.diag', (['vcoul[qpt, :N_g]'], {}), '(vcoul[qpt, :N_g])\n', (1297, 1315), True, 'import numpy as np\n'), ((1331, 1362), 'numpy.diag', 'np.diag', (['(1.0 / vcoul[qpt, :N_g])'], {}), '(1.0 / vcoul[qpt, :N_g])\n', (1338, 1362), True, 'import numpy as np\n'), ((2228, 2253), 'numpy.linalg.ei...
from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import pandas as pd from nose.tools import assert_true from ggplot import * from ggplot.components.colors import assign_continuous_colors, \ assign_discrete_colors from ggplot....
[ "ggplot.components.colors.assign_continuous_colors", "numpy.random.randn", "numpy.arange", "ggplot.components.colors.assign_discrete_colors" ]
[((1019, 1075), 'ggplot.components.colors.assign_continuous_colors', 'assign_continuous_colors', (['df', 'gg_int', '"""color"""', 'color_col'], {}), "(df, gg_int, 'color', color_col)\n", (1043, 1075), False, 'from ggplot.components.colors import assign_continuous_colors, assign_discrete_colors\n'), ((1425, 1481), 'ggpl...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # 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 wo...
[ "unittest.main", "qiskit.algorithms.optimizers.SPSA", "qiskit.providers.basicaer.QasmSimulatorPy", "warnings.filterwarnings", "numpy.random.random", "qiskit_nature.algorithms.ground_state_solvers.GroundStateEigensolver", "qiskit.circuit.library.RealAmplitudes", "qiskit_nature.mappers.second_quantizati...
[((3525, 3540), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3538, 3540), False, 'import unittest\n'), ((1453, 1470), 'qiskit.circuit.library.RealAmplitudes', 'RealAmplitudes', (['(3)'], {}), '(3)\n', (1467, 1470), False, 'from qiskit.circuit.library import RealAmplitudes\n'), ((1524, 1564), 'numpy.random.rando...
from typing import Any, List, Union, Optional, cast from warnings import warn import numpy as np import pandas as pd from numpy.fft import rfftfreq from scipy.interpolate import interp1d import base64 def find_nearest_val(array: Union[List[float], np.ndarray], value: float) -> float: """ Find the nearest valu...
[ "numpy.fft.rfft", "numpy.abs", "typing.cast", "base64.b64decode", "numpy.exp", "numpy.interp", "scipy.interpolate.interp1d", "numpy.diag", "pandas.DataFrame", "numpy.fft.irfft", "numpy.log10", "numpy.median", "numpy.frombuffer", "numpy.asarray", "numpy.log2", "numpy.fft.rfftfreq", "n...
[((3141, 3165), 'numpy.array', 'np.array', (['wavelength_tmp'], {}), '(wavelength_tmp)\n', (3149, 3165), True, 'import numpy as np\n'), ((4349, 4385), 'numpy.sqrt', 'np.sqrt', (['((1 - rv / c) / (1 + rv / c))'], {}), '((1 - rv / c) / (1 + rv / c))\n', (4356, 4385), True, 'import numpy as np\n'), ((4448, 4485), 'numpy.i...
from .policies import hard_limit, greedy_epsilon, choose_randomly from .policies import _get_max_dict_val import operator from copy import deepcopy from gym.spaces.box import Box, Space import numpy as np import random from .discretizers import Discretizer, Box_Discretizer def policy_changed(dict1, dict2): ''' ...
[ "copy.deepcopy", "numpy.random.seed", "numpy.sum", "gym.spaces.box.Space", "numpy.nonzero", "random.seed", "numpy.arange", "numpy.array" ]
[((1792, 1817), 'copy.deepcopy', 'deepcopy', (['self.S_A_values'], {}), '(self.S_A_values)\n', (1800, 1817), False, 'from copy import deepcopy\n'), ((1912, 1919), 'gym.spaces.box.Space', 'Space', ([], {}), '()\n', (1917, 1919), False, 'from gym.spaces.box import Box, Space\n'), ((2009, 2026), 'random.seed', 'random.see...
import numpy import algopy def f_fcn(x): A = algopy.zeros((2,2), dtype=x) A[0,0] = x[0] A[1,0] = x[1] * x[0] A[0,1] = x[1] Q,R = algopy.qr(A) return R[0,0] # Method 1: Complex-step derivative approximation (CSDA) h = 10**-20 x0 = numpy.array([3,2],dtype=float) x1 = numpy.array([1,0]) yc = num...
[ "numpy.zeros", "numpy.array", "algopy.qr", "algopy.zeros" ]
[((257, 289), 'numpy.array', 'numpy.array', (['[3, 2]'], {'dtype': 'float'}), '([3, 2], dtype=float)\n', (268, 289), False, 'import numpy\n'), ((293, 312), 'numpy.array', 'numpy.array', (['[1, 0]'], {}), '([1, 0])\n', (304, 312), False, 'import numpy\n'), ((50, 79), 'algopy.zeros', 'algopy.zeros', (['(2, 2)'], {'dtype'...
import os import numpy as np if not os.path.exists('./npydata'): os.makedirs('./npydata') jhu_root = 'jhu_crowd_v2.0' try: Jhu_train_path = jhu_root + '/train/images_2048/' Jhu_val_path = jhu_root + '/val/images_2048/' jhu_test_path = jhu_root + '/test/images_2048/' train_list = [] for fil...
[ "os.listdir", "numpy.save", "os.path.exists", "os.makedirs" ]
[((37, 64), 'os.path.exists', 'os.path.exists', (['"""./npydata"""'], {}), "('./npydata')\n", (51, 64), False, 'import os\n'), ((70, 94), 'os.makedirs', 'os.makedirs', (['"""./npydata"""'], {}), "('./npydata')\n", (81, 94), False, 'import os\n'), ((329, 355), 'os.listdir', 'os.listdir', (['Jhu_train_path'], {}), '(Jhu_...
import copy import numpy as np import gsw from .operation import QCOperation, QCOperationError from .flag import Flag class ChlaTest(QCOperation): def run_impl(self): # note - need to calculate CHLA up here from FLUORESCENCE_CHLA # not sure where it will come from - need from Anh fluo = ...
[ "copy.deepcopy", "numpy.abs", "gsw.SA_from_SP", "numpy.nanmedian", "gsw.CT_from_t", "numpy.median", "gsw.sigma0", "numpy.any", "numpy.percentile", "numpy.diff", "numpy.array", "numpy.arange", "numpy.where", "numpy.nanmax" ]
[((2261, 2281), 'numpy.nanmax', 'np.nanmax', (['chla.pres'], {}), '(chla.pres)\n', (2270, 2281), True, 'import numpy as np\n'), ((6229, 6288), 'gsw.SA_from_SP', 'gsw.SA_from_SP', (['psal.value', 'pres.value', 'longitude', 'latitude'], {}), '(psal.value, pres.value, longitude, latitude)\n', (6243, 6288), False, 'import ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import scipy.special import numpy as np def post_proba(Q, x, actions, T=1): """Posteria proba of c in actions {p(a|x)} ~ softmax(Q(x,a)) Arguments: Q {dict} -- Q table x {array} -- state actions {array|list} -- array of actions ...
[ "numpy.sum", "numpy.log", "numpy.argmax" ]
[((1387, 1399), 'numpy.argmax', 'np.argmax', (['A'], {}), '(A)\n', (1396, 1399), True, 'import numpy as np\n'), ((1252, 1269), 'numpy.sum', 'np.sum', (['P'], {'axis': '(0)'}), '(P, axis=0)\n', (1258, 1269), True, 'import numpy as np\n'), ((1280, 1290), 'numpy.log', 'np.log', (['pp'], {}), '(pp)\n', (1286, 1290), True, ...
"""Default hyperparameters for 1D time-dep Burgers Equation.""" import numpy as np import tensorflow as tf HP = {} # Dimension of u(x, t, mu) HP["n_v"] = 1 # Space HP["n_x"] = 256 HP["x_min"] = 0. HP["x_max"] = 1.5 # Time HP["n_t"] = 1000 HP["t_min"] = 1. HP["t_max"] = 5. # Snapshots count HP["n_s"] = 300 HP["n_s_hi...
[ "tensorflow.random.set_seed", "numpy.random.seed" ]
[((761, 781), 'numpy.random.seed', 'np.random.seed', (['(1111)'], {}), '(1111)\n', (775, 781), True, 'import numpy as np\n'), ((782, 806), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(1111)'], {}), '(1111)\n', (800, 806), True, 'import tensorflow as tf\n')]
import sc2 from sc2 import run_game, maps, Race, Difficulty, position from sc2.player import Bot, Computer from sc2.constants import * import random import cv2 import numpy as np import time #from sc2.data import race_townhalls # the point of this class is to set all the attack type options for the units to ...
[ "sc2.position.Pointlike", "cv2.waitKey", "numpy.zeros", "random.choice", "time.time", "numpy.array", "random.randrange", "cv2.flip", "cv2.imshow", "cv2.resize" ]
[((1213, 1305), 'numpy.zeros', 'np.zeros', (['(draf_bot.game_info.map_size[1], draf_bot.game_info.map_size[0], 3)', 'np.uint8'], {}), '((draf_bot.game_info.map_size[1], draf_bot.game_info.map_size[0], 3\n ), np.uint8)\n', (1221, 1305), True, 'import numpy as np\n'), ((3332, 3354), 'cv2.flip', 'cv2.flip', (['game_dat...
import math import numpy import random # note that this only works for a single layer of depth INPUT_NODES = 2 OUTPUT_NODES = 1 HIDDEN_NODES = 2 ALPHA = 3.0 # Max seed, this is so we can experiment consistently MAX_SEED = 10000 # 15000 iterations is a good point for playing with learning rate MAX_ITERATIONS = 10000 ...
[ "math.exp", "math.pow", "numpy.zeros", "random.random", "random.seed" ]
[((954, 983), 'numpy.zeros', 'numpy.zeros', (['self.total_nodes'], {}), '(self.total_nodes)\n', (965, 983), False, 'import numpy\n'), ((1014, 1043), 'numpy.zeros', 'numpy.zeros', (['self.total_nodes'], {}), '(self.total_nodes)\n', (1025, 1043), False, 'import numpy\n'), ((1070, 1099), 'numpy.zeros', 'numpy.zeros', (['s...
# -*- coding: utf-8 -*- """ Created on Sun Oct 31 10:36:53 2021 @author: TK >>>> Norlys ET -- Quant exercise <<<< One of your colleagues have discovered a trading strategy that looks to be quite profitable. The strategy works by opening a position on the DAH (Day Ahead) market, and then trade this o...
[ "matplotlib.pyplot.title", "seaborn.heatmap", "numpy.ravel", "pandas.read_csv", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.boxplot", "sklearn.model_selection.cross_val_score", "sklearn.metrics.accuracy_score", "sklearn.metrics.classification_report", "sklearn.tree.DecisionTreeC...
[((2454, 2495), 'pandas.read_csv', 'pd.read_csv', (['filename'], {'parse_dates': "['ts']"}), "(filename, parse_dates=['ts'])\n", (2465, 2495), True, 'import pandas as pd\n'), ((3761, 3806), 'numpy.where', 'np.where', (["(df['market'] > df['spot'])", '(1.0)', '(0.0)'], {}), "(df['market'] > df['spot'], 1.0, 0.0)\n", (37...
""" This file contains the code for training the speaker verification lstm model """ import speaker_diarization from configuration import get_config import os import numpy as np import speaker_verification_lstm_model import signal_processing import librosa import speaker_verfier # get arguments from parser config = ...
[ "signal_processing.extract_spectrograms_from_utterances", "speaker_verification_lstm_model.extract_embedding", "os.makedirs", "speaker_verfier.get_single_speaker_embeddings_from_call_center_call", "librosa.core.load", "numpy.mean", "configuration.get_config", "os.path.join", "os.listdir", "numpy.c...
[((320, 332), 'configuration.get_config', 'get_config', ([], {}), '()\n', (330, 332), False, 'from configuration import get_config\n'), ((708, 737), 'os.listdir', 'os.listdir', (['utterances_folder'], {}), '(utterances_folder)\n', (718, 737), False, 'import os\n'), ((1112, 1184), 'signal_processing.extract_spectrograms...
import os import csv import numpy as np import cv2 from albumentations import (ToGray, OneOf, Compose, RandomBrightnessContrast, RandomGamma, GaussianBlur, MotionBlur, ToSepia, InvertImg, RandomSnow, RandomSunFlare, RandomRain, RandomShadow, HueSaturationValue, HorizontalFlip) from albumentations import BboxParams from...
[ "csv.reader", "numpy.sum", "numpy.empty", "albumentations.RandomShadow", "numpy.exp", "numpy.round", "albumentations.MotionBlur", "numpy.zeros_like", "matplotlib.pyplot.imshow", "albumentations.ToGray", "cv2.resize", "matplotlib.pyplot.show", "albumentations.ToSepia", "albumentations.Rando...
[((1426, 1477), 'cv2.createCLAHE', 'cv2.createCLAHE', ([], {'clipLimit': '(2.0)', 'tileGridSize': '(8, 8)'}), '(clipLimit=2.0, tileGridSize=(8, 8))\n', (1441, 1477), False, 'import cv2\n'), ((3163, 3249), 'numpy.empty', 'np.empty', (['(self.batch_size, self.img_height, self.img_width, 3)'], {'dtype': 'np.float32'}), '(...
from ..builder import PIPELINES from .transforms import Resize, RandomFlip, RandomCrop import numpy as np @PIPELINES.register_module() class RResize(Resize): """ Resize images & rotated bbox Inherit Resize pipeline class to handle rotated bboxes """ def __init__(self, img...
[ "numpy.sqrt" ]
[((1030, 1056), 'numpy.sqrt', 'np.sqrt', (['(w_scale * h_scale)'], {}), '(w_scale * h_scale)\n', (1037, 1056), True, 'import numpy as np\n')]
#! /usr/bin/env python import argparse import os import cv2 import numpy as np from tqdm import tqdm from preprocessing import parse_annotation from utils import * from utils import BoundBox from frontend import YOLO import json from skimage import io from keras.models import Sequential from keras.layers...
[ "keras.models.load_model", "numpy.moveaxis", "argparse.ArgumentParser", "frontend.YOLO", "cv2.VideoWriter_fourcc", "skimage.transform.resize", "numpy.copy", "cv2.imwrite", "skimage.io.imsave", "skimage.io.imread", "tqdm.tqdm", "numpy.uint8", "os.path.basename", "os.listdir", "json.load",...
[((779, 870), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train and validate YOLO_v2 model on any dataset"""'}), "(description=\n 'Train and validate YOLO_v2 model on any dataset')\n", (802, 870), False, 'import argparse\n'), ((1223, 1244), 'keras.models.load_model', 'load_model', ...
import sys import random import numpy as np import json # Bestandsnamen voor de huidige telling, doorgegeven voorkeuren, nieuwe telling & selectie output tellingIn, voorkeurIn, tellingOut, selectieOut = sys.argv[1:] # test telling vanuit csv # tellingData = np.genfromtxt("telling.csv", names=True, dtype=No...
[ "random.shuffle", "numpy.array", "numpy.genfromtxt", "json.dumps" ]
[((1062, 1141), 'numpy.genfromtxt', 'np.genfromtxt', (['voorkeurIn'], {'names': '(True)', 'dtype': 'None', 'delimiter': '""","""', 'encoding': 'None'}), "(voorkeurIn, names=True, dtype=None, delimiter=',', encoding=None)\n", (1075, 1141), True, 'import numpy as np\n'), ((6878, 6897), 'json.dumps', 'json.dumps', (['tell...
import pandas as pd import numpy as np from statsmodels.tsa.stattools import kpss from statsmodels.tsa.stattools import adfuller def get_ts_strength(tt, st, rt): trend_strength = np.var(rt)/np.var(tt+rt) trend_strength = max([0, 1-trend_strength]) seasonal_strength = np.var(rt)/np.var(st+rt) se...
[ "pandas.DataFrame", "statsmodels.tsa.stattools.adfuller", "statsmodels.tsa.stattools.kpss", "pandas.Series", "numpy.var" ]
[((383, 487), 'pandas.DataFrame', 'pd.DataFrame', (['[trend_strength, seasonal_strength]'], {'columns': "['Strength']", 'index': "['Trend', 'Seasonal']"}), "([trend_strength, seasonal_strength], columns=['Strength'],\n index=['Trend', 'Seasonal'])\n", (395, 487), True, 'import pandas as pd\n'), ((593, 640), 'statsmo...
""" Utility functions """ import csv import torch import os import warnings import numpy as np from skimage import io, img_as_uint from tqdm import tqdm from zipfile import ZipFile from Evaluator import shift_cPSNR from DataLoader import ImageSet def read_baseline_CPSNR(path): """ Reads the baseline cPSNR sc...
[ "torch.ones", "tqdm.tqdm", "csv.reader", "zipfile.ZipFile", "os.makedirs", "torch.stack", "skimage.img_as_uint", "warnings.simplefilter", "torch.cat", "numpy.clip", "torch.cuda.is_available", "warnings.catch_warnings", "torch.zeros", "os.path.join", "os.listdir" ]
[((4847, 4878), 'os.makedirs', 'os.makedirs', (['out'], {'exist_ok': '(True)'}), '(out, exist_ok=True)\n', (4858, 4878), False, 'import os\n'), ((4897, 4916), 'tqdm.tqdm', 'tqdm', (['imset_dataset'], {}), '(imset_dataset)\n', (4901, 4916), False, 'from tqdm import tqdm\n'), ((5437, 5467), 'zipfile.ZipFile', 'ZipFile', ...
import astropy.constants as const import astropy.units as u import numpy as np import scipy.interpolate import xarray as xr from .base import ModelOutput from psipy.io import read_mas_file, get_mas_variables __all__ = ['MASOutput'] # A mapping from unit names to their units, and factors the data needs to be # multi...
[ "numpy.stack", "numpy.allclose", "psipy.io.read_mas_file", "numpy.append", "numpy.diff", "psipy.io.get_mas_variables" ]
[((1496, 1524), 'psipy.io.get_mas_variables', 'get_mas_variables', (['self.path'], {}), '(self.path)\n', (1513, 1524), False, 'from psipy.io import read_mas_file, get_mas_variables\n'), ((1571, 1600), 'psipy.io.read_mas_file', 'read_mas_file', (['self.path', 'var'], {}), '(self.path, var)\n', (1584, 1600), False, 'from...
import time import numpy as np import scipy.sparse as sp import ed_geometry as geom import ed_symmetry as symm import ed_base class spinSystem(ed_base.ed_base): #nbasis = 2 nspecies = 1 # index that "looks" the same as the spatial index from the perspective of constructing operators. E.g. for ...
[ "ed_base.ed_base.get_sum_op", "scipy.sparse.kron", "numpy.sum", "scipy.sparse.eye", "numpy.zeros", "time.perf_counter", "numpy.ones", "numpy.reciprocal", "scipy.sparse.csc_matrix", "scipy.sparse.csr_matrix", "numpy.array", "numpy.arange", "scipy.sparse.coo_matrix", "numpy.diag", "scipy.s...
[((504, 530), 'numpy.array', 'np.array', (['[[0, 0], [0, 1]]'], {}), '([[0, 0], [0, 1]])\n', (512, 530), True, 'import numpy as np\n'), ((541, 567), 'numpy.array', 'np.array', (['[[1, 0], [0, 0]]'], {}), '([[1, 0], [0, 0]])\n', (549, 567), True, 'import numpy as np\n'), ((678, 744), 'numpy.array', 'np.array', (['[[1, 0...
import os import argparse from sklearn.model_selection import train_test_split import random import numpy as np import json def read_jsonl(path): examples = [] with open(path, 'r') as f: for line in f: line = line.strip() if line: ex = json.loads(line) examples.append(ex) return examples def wri...
[ "os.mkdir", "json.dump", "json.load", "numpy.random.seed", "argparse.ArgumentParser", "json.loads", "os.path.exists", "json.dumps", "random.seed", "os.path.join" ]
[((516, 541), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (539, 541), False, 'import argparse\n'), ((922, 947), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (936, 947), True, 'import numpy as np\n'), ((949, 971), 'random.seed', 'random.seed', (['args.seed'], {...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import time import socket from multiprocessing import Process, Pipe #from PyQt5.QtWidgets import QListView, QAction, QWidget from PyQt5.QtWidgets import QWidget, QFileDialog from PyQt5 import QtWidgets, uic #, QtCore, QtGui from PyQt5.QtGui import QIc...
[ "atomize.general_modules.general_functions.plot_1d", "atomize.device_modules.BH_15.BH_15", "os.path.abspath", "PyQt5.QtGui.QIcon", "os.getcwd", "socket.socket", "numpy.zeros", "atomize.device_modules.PB_ESR_500_pro.PB_ESR_500_Pro", "PyQt5.uic.loadUi", "time.sleep", "multiprocessing.Pipe", "ato...
[((53148, 53180), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (53170, 53180), False, 'from PyQt5 import QtWidgets, uic\n'), ((851, 907), 'os.path.join', 'os.path.join', (['path_to_main', '"""gui/phasing_main_window.ui"""'], {}), "(path_to_main, 'gui/phasing_main_window....
import numpy as np from keras.layers import Input, Dense from keras.models import Model from keras.optimizers import Adam from sklearn.base import BaseEstimator from .losses import MDNLossLayer, keras_mean_pred_loss class MixtureDensityRegressor(BaseEstimator): """Fit a Mixture Density Network (MDN).""" de...
[ "numpy.random.randn", "numpy.random.rand", "keras.optimizers.Adam", "keras.models.Model", "keras.layers.Dense", "numpy.arange", "keras.layers.Input", "numpy.repeat" ]
[((975, 996), 'keras.layers.Input', 'Input', (['(1,)'], {'name': '"""X"""'}), "((1,), name='X')\n", (980, 996), False, 'from keras.layers import Input, Dense\n'), ((1020, 1041), 'keras.layers.Input', 'Input', (['(1,)'], {'name': '"""y"""'}), "((1,), name='y')\n", (1025, 1041), False, 'from keras.layers import Input, De...
import csv import logging import os import pickle import sys from typing import Optional, Union import h5py # type: ignore import numpy as np import torch from probing_project.constants import TEXT_MODELS from probing_project.data.probing_dataset import ProbingDataset from probing_project.tasks import TaskBase from p...
[ "sys.path.append", "h5py.File", "os.path.basename", "os.path.dirname", "csv.field_size_limit", "os.path.isfile", "pickle.load", "numpy.mean", "torch.tensor", "torch.no_grad", "logging.getLogger" ]
[((448, 475), 'sys.path.append', 'sys.path.append', (['"""../volta"""'], {}), "('../volta')\n", (463, 475), False, 'import sys\n'), ((476, 500), 'sys.path.append', 'sys.path.append', (['"""volta"""'], {}), "('volta')\n", (491, 500), False, 'import sys\n'), ((671, 698), 'logging.getLogger', 'logging.getLogger', (['__nam...
'''' Motion History Image (MHI) is used to calculate the movement coefficient. It shows recent motion in the image. ''' import imutils import numpy as np import sys import cv2 __this = sys.modules[__name__] __this.is_initialized = False __this.mhi_duration = None __this.min_time_delta, __this.max_time_delta = None, ...
[ "cv2.contourArea", "cv2.absdiff", "numpy.zeros", "numpy.clip", "cv2.motempl.updateMotionHistory", "cv2.imshow" ]
[((1146, 1252), 'cv2.motempl.updateMotionHistory', 'cv2.motempl.updateMotionHistory', (['fgmask', '__this.motion_history', '__this.timestamp', '__this.mhi_duration'], {}), '(fgmask, __this.motion_history, __this.\n timestamp, __this.mhi_duration)\n', (1177, 1252), False, 'import cv2\n'), ((750, 778), 'numpy.zeros', ...
import os from skimage import io from skimage.color import rgb2gray import numpy as np import dlib import argparse import collections from tqdm import tqdm import cv2 import matplotlib.pyplot as plt IMG_EXTENSIONS = ['.png'] def is_image_file(filename): return any(filename.endswith(extension) for extension in IMG...
[ "numpy.sum", "argparse.ArgumentParser", "numpy.empty", "os.walk", "cv2.fillPoly", "dlib.shape_predictor", "os.path.join", "numpy.zeros_like", "numpy.multiply", "skimage.color.rgb2gray", "os.path.dirname", "numpy.savetxt", "os.path.exists", "numpy.max", "skimage.io.imread", "numpy.ones_...
[((450, 468), 'os.path.isdir', 'os.path.isdir', (['dir'], {}), '(dir)\n', (463, 468), False, 'import os\n'), ((2072, 2091), 'numpy.zeros_like', 'np.zeros_like', (['gray'], {}), '(gray)\n', (2085, 2091), True, 'import numpy as np\n'), ((2096, 2125), 'cv2.fillPoly', 'cv2.fillPoly', (['im', '[points]', '(1)'], {}), '(im, ...
import numpy as np import matplotlib.pyplot as plt import pandas as pd import h5pyd import dateutil from pyproj import Proj from operational_analysis.toolkits import timeseries from operational_analysis.toolkits import filters from operational_analysis.toolkits import power_curve from operational_analysis import logge...
[ "matplotlib.pyplot.title", "numpy.empty", "numpy.isnan", "matplotlib.pyplot.figure", "numpy.arange", "h5pyd.File", "matplotlib.pyplot.tight_layout", "pandas.DataFrame", "pandas.Timedelta", "operational_analysis.toolkits.timeseries.gap_fill_data_frame", "matplotlib.pyplot.show", "numpy.ceil", ...
[((385, 412), 'operational_analysis.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (402, 412), False, 'from operational_analysis import logging\n'), ((3592, 3653), 'operational_analysis.toolkits.timeseries.find_time_gaps', 'timeseries.find_time_gaps', (['self._df[self._t]'], {'freq': 'self...
import time from collections import defaultdict import math import torch from data_tools.data_interface import GraphContainer from model_wrapper import ModelWrapper from models.HiLi.model import Model from models.tgn.utils import get_neighbor_finder, EarlyStopMonitor, MLP import torch.nn.functional as F import evaluat...
[ "os.mkdir", "torch.eye", "models.tgn.utils.EarlyStopMonitor", "time.ctime", "torch.cat", "collections.defaultdict", "os.path.isfile", "numpy.mean", "models.tgn.utils.MLP", "os.path.join", "models.HiLi.model.Model", "evaluation.eval_edge_prediction", "torch.nn.BCELoss", "torch.load", "mod...
[((2335, 2462), 'models.HiLi.model.Model', 'Model', (["self.config['emb_dim']", "self.config['emb_dim']", 'self.num_users', 'self.num_items', 'self.num_feats', "self.config['size']"], {}), "(self.config['emb_dim'], self.config['emb_dim'], self.num_users, self.\n num_items, self.num_feats, self.config['size'])\n", (2...
#!/usr/bin/env python import cv2 import numpy as np #detecting contours around img def detectContours(image): greyImage = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) edges = cv2.Canny(greyImage, (30, 200)) _,contours,_ = cv2.findContours(edges,cv2.RETR_EXTERNAL) cv2.drawContours(image,contours,-1,(0,255,0),2) re...
[ "cv2.Canny", "cv2.bitwise_and", "cv2.cvtColor", "cv2.waitKey", "cv2.VideoCapture", "numpy.array", "cv2.drawContours", "cv2.destoryALlWindows", "cv2.imshow", "cv2.inRange", "cv2.findContours" ]
[((386, 405), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (402, 405), False, 'import cv2\n'), ((1018, 1041), 'cv2.destoryALlWindows', 'cv2.destoryALlWindows', ([], {}), '()\n', (1039, 1041), False, 'import cv2\n'), ((129, 168), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '...
import numpy as np import spikeextractors as se class OutputRecordingExtractor(se.RecordingExtractor): def __init__(self, *, base_recording, block_size): super().__init__() self._base_recording = base_recording self._block_size = block_size self.copy_channel_properties(recording=sel...
[ "numpy.array", "numpy.concatenate" ]
[((3338, 3374), 'numpy.concatenate', 'np.concatenate', (['trace_blocks'], {'axis': '(1)'}), '(trace_blocks, axis=1)\n', (3352, 3374), True, 'import numpy as np\n'), ((2290, 2302), 'numpy.array', 'np.array', (['aa'], {}), '(aa)\n', (2298, 2302), True, 'import numpy as np\n')]
#!/usr/bin/env python # coding: utf-8 import json import logging import os import sys import warnings from collections import namedtuple import fiona import geopandas import numpy import pandas import rasterio from shapely.geometry import mapping, shape from shapely.ops import linemerge, polygonize from snail.inters...
[ "pandas.read_csv", "tqdm.tqdm.pandas", "os.path.join", "shapely.geometry.shape", "pandas.DataFrame", "logging.error", "os.path.dirname", "os.path.exists", "fiona.listlayers", "geopandas.GeoDataFrame", "geopandas.read_file", "os.path.basename", "shapely.ops.polygonize", "shapely.ops.linemer...
[((3924, 3988), 'collections.namedtuple', 'namedtuple', (['"""Transform"""', "['crs', 'width', 'height', 'transform']"], {}), "('Transform', ['crs', 'width', 'height', 'transform'])\n", (3934, 3988), False, 'from collections import namedtuple\n'), ((749, 777), 'pandas.read_csv', 'pandas.read_csv', (['hazards_csv'], {})...
import numpy as np import torch from gwd.eda.kmeans import kmeans from mmdet.core.anchor import AnchorGenerator, build_anchor_generator def main(): anchor_generator_cfg = dict(type="AnchorGenerator", scales=[8], ratios=[0.5, 1.0, 2.0], strides=[4, 8, 16, 32, 64]) anchor_generator: AnchorGenerator = build_anc...
[ "numpy.stack", "mmdet.core.anchor.build_anchor_generator", "torch.cat", "torch.Size", "gwd.eda.kmeans.kmeans", "numpy.sqrt" ]
[((311, 355), 'mmdet.core.anchor.build_anchor_generator', 'build_anchor_generator', (['anchor_generator_cfg'], {}), '(anchor_generator_cfg)\n', (333, 355), False, 'from mmdet.core.anchor import AnchorGenerator, build_anchor_generator\n'), ((801, 836), 'numpy.stack', 'np.stack', (['[heights, widths]'], {'axis': '(1)'}),...
import numpy as np import tensorflow as tf import random import dqn # at current directory from collections import deque import gym env = gym.make('CartPole-v0') input_size = env.observation_space.shape[0] # 4 output_size = env.action_space.n # 2 dis = 0.9 REPLAY_MEMORY = 50000 def simple_replay_train(DQ...
[ "gym.make", "tensorflow.get_collection", "numpy.empty", "tensorflow.global_variables_initializer", "collections.deque", "tensorflow.Session", "random.sample", "dqn.DQN", "numpy.random.rand", "numpy.vstack" ]
[((139, 162), 'gym.make', 'gym.make', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (147, 162), False, 'import gym\n'), ((1797, 1870), 'tensorflow.get_collection', 'tf.get_collection', (['tf.GraphKeys.TRAINABLE_VARIABLES'], {'scope': 'src_scope_name'}), '(tf.GraphKeys.TRAINABLE_VARIABLES, scope=src_scope_name)\n', ...
from pynwb.behavior import SpatialSeries, CompassDirection import numpy as np from nwbinspector import InspectorMessage, Importance from nwbinspector.checks.behavior import check_compass_direction_unit, check_spatial_series_dims def test_check_spatial_series_dims(): spatial_series = SpatialSeries( name=...
[ "nwbinspector.InspectorMessage", "nwbinspector.checks.behavior.check_compass_direction_unit", "numpy.ones", "nwbinspector.checks.behavior.check_spatial_series_dims" ]
[((481, 522), 'nwbinspector.checks.behavior.check_spatial_series_dims', 'check_spatial_series_dims', (['spatial_series'], {}), '(spatial_series)\n', (506, 522), False, 'from nwbinspector.checks.behavior import check_compass_direction_unit, check_spatial_series_dims\n'), ((526, 808), 'nwbinspector.InspectorMessage', 'In...
# library imports import unittest from pathlib import Path from skimage import io import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import KMeans import PIL from PIL import Image from sklearn.metrics import pairwise_distances_argmin from sklearn.utils import shuffle # local imports import conte...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.clf", "pyamiimage.ami_util.AmiUtil.int2hex", "sklearn.datasets.load_sample_image", "pathlib.Path", "matplotlib.pyplot.figure", "matplotlib.pyplot.imshow", "sklearn.cluster.KMeans", "pyamiimage.octree.quantize", "sklearn.metrics.pairwise_distances_argmi...
[((610, 633), 'pathlib.Path', 'Path', (['PYAMI_DIR', '"""test"""'], {}), "(PYAMI_DIR, 'test')\n", (614, 633), False, 'from pathlib import Path\n'), ((645, 673), 'pathlib.Path', 'Path', (['TEST_DIR', '"""alex_pico/"""'], {}), "(TEST_DIR, 'alex_pico/')\n", (649, 673), False, 'from pathlib import Path\n'), ((690, 717), 'p...
#!/usr/bin/env python """Fetch vectors of :term:`counts` at each nucleotide position in one or more regions of interest (ROIs). Output files ------------ Vectors are saved as individual line-delimited files -- one position per line -- in a user-specified output folder. Each file is named for the ROI to which it corre...
[ "os.mkdir", "inspect.stack", "warnings.simplefilter", "os.path.isdir", "plastid.util.scriptlib.argparsers.AlignmentParser", "numpy.savetxt", "plastid.util.scriptlib.argparsers.MaskParser", "plastid.util.scriptlib.argparsers.BaseParser", "os.path.join", "plastid.util.scriptlib.help_formatters.forma...
[((855, 884), 'warnings.simplefilter', 'warnings.simplefilter', (['"""once"""'], {}), "('once')\n", (876, 884), False, 'import warnings\n'), ((1373, 1390), 'plastid.util.scriptlib.argparsers.AlignmentParser', 'AlignmentParser', ([], {}), '()\n', (1388, 1390), False, 'from plastid.util.scriptlib.argparsers import Alignm...
# Author: <NAME> (<EMAIL>) # License: MIT, see LICENSE.md import numpy as np import sys param = {} execfile(sys.argv[1]) def compute_averaged_mag(cat_mag, ind): return np.average([np.average(mag[:, ind]) for mag in cat_mag]) def apply_offset(cat_mag, offset): return [mag-offset for mag in cat_mag] def c...
[ "numpy.std", "numpy.average" ]
[((451, 470), 'numpy.std', 'np.std', (['mag[:, ind]'], {}), '(mag[:, ind])\n', (457, 470), True, 'import numpy as np\n'), ((1018, 1041), 'numpy.average', 'np.average', (['mag[:, ind]'], {}), '(mag[:, ind])\n', (1028, 1041), True, 'import numpy as np\n'), ((188, 211), 'numpy.average', 'np.average', (['mag[:, ind]'], {})...
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import paddle import numpy as np import os import sys from paddle.fluid.proto import framework_pb2 paddle.enable_static() inp_blob = np.random.randn(1, 3, 4, 4).astype(np.float32) print(sys.path) main_program = paddle.static.Program() ...
[ "paddle.fluid.proto.framework_pb2.ProgramDesc", "paddle.static.data", "paddle.static.nn.conv2d", "paddle.static.default_main_program", "paddle.static.cpu_places", "numpy.random.randn", "paddle.enable_static", "paddle.static.Program", "paddle.static.program_guard", "paddle.static.Executor", "os.p...
[((183, 205), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (203, 205), False, 'import paddle\n'), ((296, 319), 'paddle.static.Program', 'paddle.static.Program', ([], {}), '()\n', (317, 319), False, 'import paddle\n'), ((338, 361), 'paddle.static.Program', 'paddle.static.Program', ([], {}), '()\n', ...
#!/usr/bin/env python3 import sys import soundfile import numpy from scipy.signal import butter, lfilter import argparse import multiprocessing import itertools # bark frequency bands FREQ_BANDS = [ 20, 119, 224, 326, 438, 561, 698, 850, 1021, 1213, 1433, 1685, 1978...
[ "soundfile.read", "numpy.abs", "argparse.ArgumentParser", "scipy.signal.lfilter", "numpy.zeros", "soundfile.write", "numpy.max", "numpy.exp", "multiprocessing.Pool", "scipy.signal.butter", "itertools.repeat" ]
[((611, 656), 'numpy.exp', 'numpy.exp', (['(-1.0 / (fs * fast_attack / 1000.0))'], {}), '(-1.0 / (fs * fast_attack / 1000.0))\n', (620, 656), False, 'import numpy\n'), ((670, 715), 'numpy.exp', 'numpy.exp', (['(-1.0 / (fs * slow_attack / 1000.0))'], {}), '(-1.0 / (fs * slow_attack / 1000.0))\n', (679, 715), False, 'imp...
# -*- coding: utf-8 -*- """ Created on Fri Oct 1 18:51:33 2021 @author: kylei """ import numpy as np from keras import layers def unpackage_weights(model): model_weights = model.get_weights() ret_weights = np.empty((1,), float) for i in range(len(model_weights)): layer_weight = model_weights[i...
[ "numpy.empty", "keras.layers.MaxPooling2D", "keras.layers.Flatten", "numpy.append", "keras.layers.AveragePooling2D", "keras.layers.Dense", "numpy.array", "numpy.arange", "keras.layers.Conv2D", "keras.layers.Input", "numpy.delete" ]
[((219, 240), 'numpy.empty', 'np.empty', (['(1,)', 'float'], {}), '((1,), float)\n', (227, 240), True, 'import numpy as np\n'), ((416, 449), 'numpy.delete', 'np.delete', (['ret_weights', '(0)'], {'axis': '(0)'}), '(ret_weights, 0, axis=0)\n', (425, 449), True, 'import numpy as np\n'), ((1495, 1531), 'numpy.arange', 'np...
import os import sys import argparse import subprocess import torch import numpy as np import time import gym import pybullet import pybullet_envs import matplotlib.pyplot as plt from mpi4py import MPI comm = MPI.COMM_WORLD #from bevodevo.policies.rnns import GatedRNNPolicy from bevodevo.policies.cnns import Impal...
[ "numpy.load", "gym.make", "argparse.ArgumentParser", "numpy.std", "matplotlib.pyplot.imshow", "torch.load", "matplotlib.pyplot.close", "time.sleep", "numpy.max", "numpy.mean", "numpy.min", "matplotlib.pyplot.figure", "os.listdir" ]
[((2694, 2712), 'gym.make', 'gym.make', (['env_name'], {}), '(env_name)\n', (2702, 2712), False, 'import gym\n'), ((6118, 6166), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Experiment parameters"""'], {}), "('Experiment parameters')\n", (6141, 6166), False, 'import argparse\n'), ((921, 947), 'os.listdir...
import json import os import pickle import random import time from pathlib import Path import cv2 import numpy as np from PIL import Image from torch import autograd from yolo import dataset, model, utils COLOR_PALETTE = utils.get_palette(Path(os.path.abspath(__file__)).parents[1] / 'resource' / 'palette') def dat...
[ "json.dump", "os.path.abspath", "yolo.utils.transform_prediction", "yolo.model.load_model", "yolo.dataset.image_loader", "yolo.dataset.transform_image", "time.time", "yolo.dataset.resize_bbox", "pathlib.Path", "os.fspath", "pickle.load", "yolo.utils.parse_class_names", "cv2.rectangle", "PI...
[((451, 468), 'pathlib.Path', 'Path', (['img_dirname'], {}), '(img_dirname)\n', (455, 468), False, 'from pathlib import Path\n'), ((1391, 1431), 'cv2.rectangle', 'cv2.rectangle', (['img', 'pt_0', 'pt_1', 'color', '(2)'], {}), '(img, pt_0, pt_1, color, 2)\n', (1404, 1431), False, 'import cv2\n'), ((1643, 1686), 'numpy.a...
import numpy as np import pylab as pl import scipy.signal as signal fs = 1000 f1 = 45 f2 = 55 scale = 2**12 b = signal.firwin(999,[f1/fs*2,f2/fs*2]) b = b*scale b = b.astype(int) np.savetxt("coeff12bit.dat",b)
[ "scipy.signal.firwin", "numpy.savetxt" ]
[((114, 160), 'scipy.signal.firwin', 'signal.firwin', (['(999)', '[f1 / fs * 2, f2 / fs * 2]'], {}), '(999, [f1 / fs * 2, f2 / fs * 2])\n', (127, 160), True, 'import scipy.signal as signal\n'), ((181, 212), 'numpy.savetxt', 'np.savetxt', (['"""coeff12bit.dat"""', 'b'], {}), "('coeff12bit.dat', b)\n", (191, 212), True, ...
import json import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from net_utils import run_lstm, col_name_encode class OpPredictor(nn.Module): def __init__(self, N_word, N_h, N_depth, gpu, use_hs): super(OpPredictor, self).__init__() ...
[ "torch.nn.BCEWithLogitsLoss", "torch.stack", "numpy.argmax", "torch.nn.LogSoftmax", "torch.nn.Tanh", "torch.nn.CrossEntropyLoss", "net_utils.run_lstm", "numpy.zeros", "torch.nn.MultiLabelSoftMarginLoss", "numpy.argsort", "net_utils.col_name_encode", "torch.nn.Softmax", "numpy.array", "torc...
[((415, 537), 'torch.nn.LSTM', 'nn.LSTM', ([], {'input_size': 'N_word', 'hidden_size': '(N_h / 2)', 'num_layers': 'N_depth', 'batch_first': '(True)', 'dropout': '(0.3)', 'bidirectional': '(True)'}), '(input_size=N_word, hidden_size=N_h / 2, num_layers=N_depth,\n batch_first=True, dropout=0.3, bidirectional=True)\n',...
import datetime import numpy as np from icarus_backend.flight.FlightModel import Flight from users.models import IcarusUser as User from icarus_backend.department.DepartmentModel import Department from icarus_backend.department.tasks import DepartmentTasks from django.utils import timezone from django.contrib.gis.geos ...
[ "users.models.IcarusUser.objects.filter", "icarus_backend.department.DepartmentModel.Department.objects.filter", "django.utils.timezone.now", "numpy.asarray", "icarus_backend.department.DepartmentModel.Department", "django.db.models.Q", "icarus_backend.flight.FlightModel.Flight.objects.filter", "datet...
[((524, 540), 'numpy.asarray', 'np.asarray', (['area'], {}), '(area)\n', (534, 540), True, 'import numpy as np\n'), ((776, 789), 'django.contrib.gis.geos.Polygon', 'Polygon', (['area'], {}), '(area)\n', (783, 789), False, 'from django.contrib.gis.geos import Polygon\n'), ((1027, 1072), 'icarus_backend.department.Depart...
import feedparser import tensorflow as tf import numpy as np from transformers import * import re, string import pandas as pd import sys from keras.preprocessing.sequence import pad_sequences feed = feedparser.parse('http://feeds.bbci.co.uk/news/rss.xml') titles = [article.title for article in feed.entries] print...
[ "feedparser.parse", "numpy.argmax" ]
[((204, 260), 'feedparser.parse', 'feedparser.parse', (['"""http://feeds.bbci.co.uk/news/rss.xml"""'], {}), "('http://feeds.bbci.co.uk/news/rss.xml')\n", (220, 260), False, 'import feedparser\n'), ((1144, 1165), 'numpy.argmax', 'np.argmax', (['results[i]'], {}), '(results[i])\n', (1153, 1165), True, 'import numpy as np...
import argparse, os import h5py from scipy.misc import imresize import skvideo.io from PIL import Image import torch from torch import nn import torchvision import random import numpy as np from models import resnext from datautils import utils from datautils import tgif_qa from datautils import msrvtt_qa from dataut...
[ "numpy.random.seed", "argparse.ArgumentParser", "random.shuffle", "torch.no_grad", "torch.load", "os.path.exists", "torch.FloatTensor", "numpy.transpose", "numpy.linspace", "torch.cuda.set_device", "datautils.msrvtt_qa.load_video_paths", "datautils.utils.Timer", "datautils.msvd_qa.load_video...
[((790, 915), 'models.resnext.resnet101', 'resnext.resnet101', ([], {'num_classes': '(400)', 'shortcut_type': '"""B"""', 'cardinality': '(32)', 'sample_size': '(112)', 'sample_duration': '(16)', 'last_fc': '(False)'}), "(num_classes=400, shortcut_type='B', cardinality=32,\n sample_size=112, sample_duration=16, last_...
#!/usr/bin/env python3 """ @author: <NAME> @email: <EMAIL> * SETTINGS MODULE * Contains all the settings for a given simulation. At the first call of settings.init() all specified variables are initialized and available. Latest update: May 8th 2021 """ import system import force import printing import numpy ...
[ "system.distribute_position_cubic_lattice", "numpy.power", "numpy.zeros", "system.vel_rescale", "system.vel_shift", "system.vel_random", "force.LJ_potential_shift" ]
[((2035, 2083), 'numpy.zeros', 'np.zeros', (['(system.N, system.dim)'], {'dtype': 'np.float'}), '((system.N, system.dim), dtype=np.float)\n', (2043, 2083), True, 'import numpy as np\n'), ((2103, 2151), 'numpy.zeros', 'np.zeros', (['(system.N, system.dim)'], {'dtype': 'np.float'}), '((system.N, system.dim), dtype=np.flo...