code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python3 import argparse import sys import math from typing import List import random import numpy import soundfile import samplerate as libsamplerate import progressbar def divide_sound_file(data: numpy.ndarray, samples_per_chunk: int): return [ data[i * samples_per_chunk:(i + 1) * sample...
[ "samplerate.Resampler", "soundfile.read", "numpy.average", "argparse.ArgumentParser", "math.fabs", "random.choices", "numpy.append", "random.seed", "math.log2", "numpy.concatenate", "progressbar.ProgressBarThread" ]
[((892, 945), 'random.choices', 'random.choices', (['chunks'], {'weights': 'weights', 'k': 'num_chunks'}), '(chunks, weights=weights, k=num_chunks)\n', (906, 945), False, 'import random\n'), ((973, 1039), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Rearrange a sound file to match another"""'], {}), "('R...
import glob import time import cv2 import math import numpy as np from Modules.foregroundExtraction import readyFrame, frameDifferencing, morphologicalOperations, natural_sort from Modules.ballDetection import findContours, sizeDetection, playerProximityDetection, regionDetection, courtBoundaryDetection startTimeReadi...
[ "cv2.medianBlur", "Modules.foregroundExtraction.morphologicalOperations", "Modules.foregroundExtraction.readyFrame", "Modules.ballDetection.findContours", "Modules.ballDetection.regionDetection", "glob.glob", "cv2.imshow", "Modules.foregroundExtraction.natural_sort", "math.pow", "cv2.drawContours"...
[((331, 342), 'time.time', 'time.time', ([], {}), '()\n', (340, 342), False, 'import time\n'), ((401, 434), 'glob.glob', 'glob.glob', (["(datasetName + '/*.jpg')"], {}), "(datasetName + '/*.jpg')\n", (410, 434), False, 'import glob\n'), ((572, 583), 'time.time', 'time.time', ([], {}), '()\n', (581, 583), False, 'import...
from mushroom_rl.core import Serializable import torch import numpy as np from mushroom_rl.utils.parameters import Parameter class TestClass(Serializable): def __init__(self, value): # Create some different types of variables self._primitive_variable = value # Primitive python variable ...
[ "torch.nn.Parameter", "mushroom_rl.utils.parameters.Parameter", "numpy.zeros", "numpy.ones", "numpy.array", "torch.from_numpy" ]
[((341, 368), 'numpy.array', 'np.array', (['([1, 2, 3] * value)'], {}), '([1, 2, 3] * value)\n', (349, 368), True, 'import numpy as np\n'), ((575, 603), 'torch.from_numpy', 'torch.from_numpy', (['data_array'], {}), '(data_array)\n', (591, 603), False, 'import torch\n'), ((633, 664), 'torch.nn.Parameter', 'torch.nn.Para...
from __future__ import division, print_function from unittest import TestCase import numpy as np from scipy.signal import fftconvolve import pyroomacoustics as pra ''' We create a signal, a simple filter and compute their convolution. Then we test STFT block procesing with and without overlap, and with and without f...
[ "numpy.random.seed", "pyroomacoustics.realtime.STFT", "numpy.abs", "numpy.random.randn", "numpy.zeros", "numpy.ones", "numpy.linalg.norm", "scipy.signal.fftconvolve", "pyroomacoustics.hann" ]
[((364, 381), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (378, 381), True, 'import numpy as np\n'), ((474, 493), 'numpy.ones', 'np.ones', (['(h_len, D)'], {}), '((h_len, D))\n', (481, 493), True, 'import numpy as np\n'), ((499, 524), 'numpy.linalg.norm', 'np.linalg.norm', (['h'], {'axis': '(0)'}), '...
import sys from matplotlib import path import numpy as np #======================================================================================================= class RTStructFile: def __init__(self,RTS): self.Status = True self.DCM = RTS self.ROINameList = list() self.ROIIDList = list() for ROI i...
[ "matplotlib.path.Path", "numpy.min", "numpy.max", "numpy.rint" ]
[((3162, 3181), 'numpy.min', 'np.min', (['self.i_list'], {}), '(self.i_list)\n', (3168, 3181), True, 'import numpy as np\n'), ((3191, 3210), 'numpy.min', 'np.min', (['self.j_list'], {}), '(self.j_list)\n', (3197, 3210), True, 'import numpy as np\n'), ((3220, 3239), 'numpy.min', 'np.min', (['self.k_list'], {}), '(self.k...
import wave import pylab as pl import numpy as np import speech_features_kit.Volume.Volume as vp # ============ test the algorithm ============= # read wave file and get parameters. fw = wave.open('../data/english.wav','rb') params = fw.getparams() print(params) nchannels, sampwidth, framerate, nframes = params[:4] st...
[ "wave.open", "speech_features_kit.Volume.Volume.calVolumeDB", "pylab.show", "pylab.ylabel", "speech_features_kit.Volume.Volume.calVolume", "pylab.plot", "pylab.subplot", "numpy.arange", "pylab.xlabel", "numpy.fromstring" ]
[((188, 226), 'wave.open', 'wave.open', (['"""../data/english.wav"""', '"""rb"""'], {}), "('../data/english.wav', 'rb')\n", (197, 226), False, 'import wave\n'), ((362, 400), 'numpy.fromstring', 'np.fromstring', (['strData'], {'dtype': 'np.int16'}), '(strData, dtype=np.int16)\n', (375, 400), True, 'import numpy as np\n'...
import numpy as np import datetime as dt import struct from dateutil.relativedelta import relativedelta from netCDF4 import Dataset from os.path import exists from scipy.interpolate import griddata from scipy.interpolate.interpnd import _ndim_coords_from_arrays from scipy.spatial import cKDTree class Pathfinder(): ...
[ "numpy.maximum", "numpy.empty", "numpy.shape", "scipy.spatial.cKDTree", "numpy.nanmean", "netCDF4.Dataset", "os.path.exists", "dateutil.relativedelta.relativedelta", "numpy.genfromtxt", "datetime.timedelta", "scipy.interpolate.griddata", "numpy.asarray", "numpy.flipud", "datetime.datetime"...
[((897, 920), 'datetime.datetime', 'dt.datetime', (['(1970)', '(1)', '(1)'], {}), '(1970, 1, 1)\n', (908, 920), True, 'import datetime as dt\n'), ((1649, 1672), 'datetime.datetime', 'dt.datetime', (['(1970)', '(1)', '(1)'], {}), '(1970, 1, 1)\n', (1660, 1672), True, 'import datetime as dt\n'), ((10474, 10502), 'numpy.e...
import numpy as np from anomaly import adm naive_filter = adm.NaiveFilter() def _test_fit(filter): ts = np.random.random(100) ts_predicted = np.random.random(100) anomalies = np.random.random(100) > 0.9 anomalies_predicted = anomalies & (np.random.random(100) > 0.9) filter.fit(ts, ts_predicted, a...
[ "anomaly.adm.NaiveFilter", "numpy.random.random" ]
[((59, 76), 'anomaly.adm.NaiveFilter', 'adm.NaiveFilter', ([], {}), '()\n', (74, 76), False, 'from anomaly import adm\n'), ((111, 132), 'numpy.random.random', 'np.random.random', (['(100)'], {}), '(100)\n', (127, 132), True, 'import numpy as np\n'), ((152, 173), 'numpy.random.random', 'np.random.random', (['(100)'], {}...
import torch from torch import tensor import numpy as np from torch.utils.data import TensorDataset, DataLoader, ConcatDataset import os def mnist(): path = '/Users/davidipsen/Documents/DTU/3. Semester (MSc)/MLOps/dtu_mlops/data/corruptmnist/' # exchange with the corrupted mnist dataset #train = torch.rand...
[ "torch.utils.data.DataLoader", "numpy.load", "numpy.concatenate", "torch.tensor" ]
[((2006, 2051), 'numpy.load', 'np.load', (['f"""{path}test.npz"""'], {'allow_pickle': '(True)'}), "(f'{path}test.npz', allow_pickle=True)\n", (2013, 2051), True, 'import numpy as np\n'), ((2144, 2179), 'torch.tensor', 'torch.tensor', (["testcontent['labels']"], {}), "(testcontent['labels'])\n", (2156, 2179), False, 'im...
################################################################################################################################ # General setup ################################################################################################################################ # Import libraries import sys import nu...
[ "psutil.virtual_memory", "numpy.floor", "numpy.ones", "numpy.isnan", "numpy.arange", "numpy.exp", "scipy.interpolate.interp1d", "numpy.unique", "numpy.meshgrid", "scipy.integrate.romb", "numpy.append", "numpy.max", "numpy.linspace", "numpy.tensordot", "numpy.isinf", "scipy.interpolate....
[((625, 651), 'numpy.log', 'np.log', (['sys.float_info.min'], {}), '(sys.float_info.min)\n', (631, 651), True, 'import numpy as np\n'), ((652, 662), 'numpy.log', 'np.log', (['(10)'], {}), '(10)\n', (658, 662), True, 'import numpy as np\n'), ((6187, 6294), 'numpy.array', 'np.array', (['[1 / self.max_F_dot, 1 / self.K_ha...
# coding: utf-8 import numpy as np import re import copy import sys import networkx as nx #import matplotlib.pyplot as plt #import operator #from collections import defaultdict #from collections import Counter #from collections import deque import time #from itertools import combinations # number of combinations for n...
[ "numpy.sort", "numpy.asarray", "time.time", "numpy.insert" ]
[((816, 851), 'numpy.asarray', 'np.asarray', (['input_val'], {'dtype': 'np.int'}), '(input_val, dtype=np.int)\n', (826, 851), True, 'import numpy as np\n'), ((866, 882), 'numpy.sort', 'np.sort', (['numbers'], {}), '(numbers)\n', (873, 882), True, 'import numpy as np\n'), ((950, 974), 'numpy.insert', 'np.insert', (['num...
import os import glob import scipy import numpy as np import nibabel as nib import tensorflow as tf from tqdm import tqdm from scipy.ndimage import zoom from args import TestArgParser from util import DiceCoefficient from model import Model class Interpolator(object): def __init__(self, modalities, order=3, mode...
[ "numpy.mean", "tensorflow.sqrt", "os.path.join", "args.TestArgParser", "tensorflow.random.uniform", "tensorflow.nn.moments", "tensorflow.pad", "tensorflow.concat", "scipy.ndimage.zoom", "numpy.place", "numpy.max", "tensorflow.squeeze", "numpy.stack", "nibabel.Nifti1Image", "tensorflow.re...
[((5779, 5806), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['[res]'], {}), '([res])\n', (5799, 5806), True, 'import tensorflow as tf\n'), ((5819, 5869), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['x.shape[:-1]'], {'dtype': 'tf.int32'}), '(x.shape[:-1], dtype=tf.int32)\n', (5839, 5869), True...
""" Created on Apr 14, 2017 @author: sgoldsmith Copyright (c) <NAME> All rights reserved. """ import os, cv2, numpy, detectbase class motiondet(detectbase.detectbase): """Motion detection image processor. Uses moving average to determine change percent. """ def __init__(self, appCon...
[ "cv2.resize", "cv2.dilate", "cv2.cvtColor", "cv2.accumulateWeighted", "cv2.threshold", "numpy.float32", "cv2.countNonZero", "cv2.blur", "cv2.convertScaleAbs", "numpy.bitwise_and", "cv2.erode", "cv2.boundingRect", "os.path.expanduser", "cv2.findContours" ]
[((1149, 1222), 'cv2.dilate', 'cv2.dilate', (['image', 'None'], {'iterations': "self.appConfig.motion['dilateAmount']"}), "(image, None, iterations=self.appConfig.motion['dilateAmount'])\n", (1159, 1222), False, 'import os, cv2, numpy, detectbase\n'), ((1352, 1423), 'cv2.erode', 'cv2.erode', (['image', 'None'], {'itera...
import numpy as np from sklearn.cluster import KMeans from tqdm import tqdm import matplotlib.pyplot as plt from preliminaries.embedding import aggregateApiSequences from utils.file import loadJson, dumpIterable, dumpJson from utils.manager import PathManager from baselines.alignment import apiCluster from utils.timer...
[ "numpy.stack", "numpy.load", "utils.stat.calBeliefeInterval", "matplotlib.pyplot.show", "utils.timer.StepTimer", "matplotlib.pyplot.plot", "utils.manager.PathManager", "utils.magic.nRandom", "numpy.argmax", "sklearn.cluster.KMeans", "numpy.zeros", "utils.magic.magicSeed", "numpy.arange", "...
[((513, 531), 'numpy.load', 'np.load', (['dict_path'], {}), '(dict_path)\n', (520, 531), True, 'import numpy as np\n'), ((695, 732), 'numpy.arange', 'np.arange', (['k_range[0]', '(k_range[1] + 1)'], {}), '(k_range[0], k_range[1] + 1)\n', (704, 732), True, 'import numpy as np\n'), ((735, 755), 'matplotlib.pyplot.plot', ...
# -*- coding: utf-8 -*- """ This script works for foam phantom. """ import numpy as np import glob import dxchange import matplotlib.pyplot as plt import scipy.interpolate import tomopy from scipy.interpolate import Rbf from mpl_toolkits.mplot3d.axes3d import Axes3D from matplotlib import cm import matplotlib from pr...
[ "numpy.set_printoptions", "numpy.meshgrid", "matplotlib.pyplot.show", "tomopy.recon", "numpy.log", "dxchange.write_tiff", "tomopy.angles", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "numpy.array", "numpy.linspace", "matplotlib.pyplot.rc", "numpy.squeeze", "numpy.sqrt" ]
[((429, 470), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': '"""infinite"""'}), "(threshold='infinite')\n", (448, 470), True, 'import numpy as np\n'), ((648, 672), 'numpy.arange', 'np.arange', (['(0.1)', '(1.1)', '(0.1)'], {}), '(0.1, 1.1, 0.1)\n', (657, 672), True, 'import numpy as np\n'), ((1463...
# (c) <NAME> 2021 # see embedded licence file # imelt V1.1 import numpy as np import torch, time import h5py import torch.nn.functional as F from sklearn.metrics import mean_squared_error class data_loader(): """custom data loader for batch training """ def __init__(self,path_viscosity,path_raman,path_de...
[ "torch.nn.Dropout", "numpy.sum", "numpy.mean", "numpy.sin", "numpy.std", "torch.load", "torch.FloatTensor", "torch.Tensor", "torch.nn.Linear", "torch.log", "sklearn.metrics.mean_squared_error", "numpy.trapz", "h5py.File", "numpy.cos", "torch.set_grad_enabled", "torch.reshape", "numpy...
[((43013, 43054), 'numpy.trapz', 'np.trapz', (['y[:, x < lb]', 'x[x < lb]'], {'axis': '(1)'}), '(y[:, x < lb], x[x < lb], axis=1)\n', (43021, 43054), True, 'import numpy as np\n'), ((43060, 43101), 'numpy.trapz', 'np.trapz', (['y[:, x > hb]', 'x[x > hb]'], {'axis': '(1)'}), '(y[:, x > hb], x[x > hb], axis=1)\n', (43068...
#!/usr/bin/env python """ This file uses Theano dense layers for estimating Q values, but uses pre-trained Keras features before the dense layers. """ # -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function from vizdoom import * import itertools as it from random import sample, r...
[ "layers.FCLayer", "lasagne.objectives.squared_error", "numpy.max", "itertools.product", "theano.tensor.arange", "numpy.stack", "keras.backend.learning_phase", "tqdm.trange", "time.sleep", "random.random", "theano.tensor.matrix", "lasagne.updates.rmsprop", "theano.tensor.vector", "theano.fu...
[((8092, 8098), 'time.time', 'time', ([], {}), '()\n', (8096, 8098), False, 'from time import time, sleep\n'), ((2530, 2547), 'theano.tensor.matrix', 'T.matrix', (['"""State"""'], {}), "('State')\n", (2538, 2547), True, 'import theano.tensor as T\n'), ((2556, 2589), 'theano.tensor.vector', 'T.vector', (['"""Action"""']...
"""GUI for rejecting epochs""" # Author: <NAME> <<EMAIL>> # Document: represents data # ChangeAction: modifies Document # Model: creates ChangeActions and applies them to the History # Frame: # - visualizaes Document # - listens to Document changes # - issues commands to Model from logging import getLogger impo...
[ "wx.Dialog.__init__", "numpy.abs", "numpy.invert", "wx.CheckBox", "numpy.ones", "numpy.arange", "wx.RadioBox", "wx.Choice", "numpy.logical_not", "os.path.exists", "wx.TextCtrl", "wx.GetApp", "scipy.spatial.distance.cdist", "wx.TextEntryDialog", "wx.BoxSizer", "math.sqrt", "math.ceil"...
[((11436, 11458), 'os.path.splitext', 'os.path.splitext', (['path'], {}), '(path)\n', (11452, 11458), False, 'import os\n'), ((11660, 11682), 'os.path.splitext', 'os.path.splitext', (['path'], {}), '(path)\n', (11676, 11682), False, 'import os\n'), ((14903, 14930), 'os.path.splitext', 'os.path.splitext', (['self.path']...
import numpy as np import argparse import os from PIL import Image class BackofficeIconConverter: """ Icon creator to convert an input file into the correct format needed by the SAP Commerce Backoffice framework to be used as icon in the explorer-tree. """ #: Side length of a single image (he...
[ "argparse.ArgumentParser", "numpy.zeros", "PIL.Image.open", "PIL.Image.fromarray", "os.path.split", "os.path.join" ]
[((3290, 3517), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Convert simple icons to the SAP Commerce Backoffice explorer tree icon format. The icon must be a sprite consist of 5 different color shades of the icon itself."""'}), "(description=\n 'Convert simple ico...
# These are control plot used in the NN pipeline import h5py import matplotlib as mpl import numpy as np import pandas as pd from modules.BAR_BC_method import calc_BAR_BC, calc_composition, filter_data_mask from modules.collect_data import resave_Tomas_OL_OPX_mixtures import matplotlib.pyplot as plt import matplotlib...
[ "matplotlib.pyplot.title", "numpy.sum", "seaborn.heatmap", "modules.NN_losses_metrics_activations.my_rmse", "pandas.read_csv", "modules.NN_losses_metrics_activations.my_quantile", "modules.NN_losses_metrics_activations.my_sam", "numpy.ones", "numpy.shape", "numpy.argsort", "matplotlib.pyplot.fig...
[((766, 782), 'matplotlib.use', 'mpl.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (773, 782), True, 'import matplotlib as mpl\n'), ((858, 888), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'size': 'TEXT_SIZE'}), "('font', size=TEXT_SIZE)\n", (864, 888), True, 'import matplotlib.pyplot as plt\n'), ((920, 957), 'ma...
import numpy as np import tensorflow as tf tf.reset_default_graph() sess = tf.InteractiveSession() def exp(): s_len = 3 N, T = 2, 2 l = np.arange(1, N*T*s_len+1).reshape((N, T, s_len) ) x = tf.convert_to_tensor(l, dtype=tf.float32) print("x= {}".format(x.eval() ) ) # l = np.arange(1, N*T+1).reshape((N,...
[ "tensorflow.reset_default_graph", "tensorflow.convert_to_tensor", "tensorflow.reshape", "tensorflow.reduce_mean", "tensorflow.constant", "tensorflow.shape", "numpy.random.randint", "numpy.arange", "tensorflow.InteractiveSession" ]
[((44, 68), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (66, 68), True, 'import tensorflow as tf\n'), ((76, 99), 'tensorflow.InteractiveSession', 'tf.InteractiveSession', ([], {}), '()\n', (97, 99), True, 'import tensorflow as tf\n'), ((200, 241), 'tensorflow.convert_to_tensor', 'tf.co...
# Copyright 2017 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ "tensorflow.test.main", "tensorflow.placeholder", "numpy.array" ]
[((1812, 1826), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (1824, 1826), True, 'import tensorflow as tf\n'), ((1272, 1319), 'numpy.array', 'np.array', (['[[1.0, 2.0, 3.0], [-1.0, -2.0, -3.0]]'], {}), '([[1.0, 2.0, 3.0], [-1.0, -2.0, -3.0]])\n', (1280, 1319), True, 'import numpy as np\n'), ((1369, 1414), ...
import numpy as np from matplotlib import pyplot as plt from matplotlib import animation, rc, patches import matplotlib.collections as clt import environment import scenarios import trajectory_gen # Set jshtml default mode for notebook use rc('animation', html='jshtml') def plot_one_step(env, x_ref, x_bar, x_opt, x...
[ "matplotlib.rc", "matplotlib.pyplot.show", "numpy.arctan2", "matplotlib.patches.Rectangle", "matplotlib.pyplot.close", "trajectory_gen.sample_trajectory", "numpy.zeros", "numpy.ones", "numpy.rad2deg", "numpy.sin", "environment.plot_environment", "environment.Environment", "numpy.cos", "mat...
[((242, 272), 'matplotlib.rc', 'rc', (['"""animation"""'], {'html': '"""jshtml"""'}), "('animation', html='jshtml')\n", (244, 272), False, 'from matplotlib import animation, rc, patches\n'), ((436, 487), 'environment.plot_environment', 'environment.plot_environment', (['env'], {'figsize': '(16, 10)'}), '(env, figsize=(...
# /* Copyright (C) 2016 Ion Torrent Systems, Inc. All Rights Reserved */ import pandas as pd import datetime import dateutil import matplotlib.dates as dates from matplotlib import pyplot as plt import numpy as np from time import strptime import os # put the date on the same line with the cpu data os.system("awk 'NR%...
[ "matplotlib.pyplot.subplot", "os.remove", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "pandas.read_csv", "numpy.datetime64", "matplotlib.pyplot.legend", "os.system", "matplotlib.pyplot.figure", "time.strptime", "matplotlib.pyplot.savefig" ]
[((301, 378), 'os.system', 'os.system', (['"""awk \'NR%2{printf "%s ",$0;next;}1\' cpu_util.log > cpu_data.log"""'], {}), '(\'awk \\\'NR%2{printf "%s ",$0;next;}1\\\' cpu_util.log > cpu_data.log\')\n', (310, 378), False, 'import os\n'), ((385, 624), 'pandas.read_csv', 'pd.read_csv', (['"""cpu_data.log"""'], {'names': "...
import os import h5py import numpy as np import pickle as pkl import tensorflow as tf from tqdm import tqdm from gcn.train import train_model from gcn.utils import load_data_pkl, load_data_h5 # Set random seed seed = 123 np.random.seed(seed) tf.set_random_seed(seed) # Settings flags = tf.app.flags FLAGS = flags.FLAG...
[ "os.mkdir", "pickle.dump", "numpy.random.seed", "gcn.utils.load_data_h5", "gcn.train.train_model", "gcn.utils.load_data_pkl", "os.path.exists", "tensorflow.set_random_seed", "os.path.join", "os.listdir" ]
[((223, 243), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (237, 243), True, 'import numpy as np\n'), ((244, 268), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['seed'], {}), '(seed)\n', (262, 268), True, 'import tensorflow as tf\n'), ((1179, 1209), 'os.path.exists', 'os.path.exists', (['F...
##################################################### # # Train and test a restricted Boltzmann machine # # Copyright (c) 2018 christianb93 # 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 Softwar...
[ "pickle.dump", "argparse.ArgumentParser", "numpy.ones", "matplotlib.pyplot.figure", "pickle.load", "numpy.random.randint", "os.path.join", "numpy.copy", "numpy.transpose", "os.path.exists", "socket.gethostname", "tempfile.mktemp", "time.localtime", "matplotlib.pyplot.show", "numpy.concat...
[((10345, 10356), 'time.time', 'time.time', ([], {}), '()\n', (10354, 10356), False, 'import time\n'), ((11189, 11200), 'time.time', 'time.time', ([], {}), '()\n', (11198, 11200), False, 'import time\n'), ((15172, 15182), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (15180, 15182), True, 'import matplotlib.p...
# -*- coding: UTF-8 -*- """ Created on Sat Jan 20 10:20:33 2018 @author: <NAME> """ import os, re, csv, time, warnings, threading from pymongo import MongoClient import pandas as pd import numpy as np from scipy.sparse import csr_matrix from bson.objectid import ObjectId import Text_Analysis.text_proces...
[ "pymongo.MongoClient", "pandas.DataFrame", "sklearn.externals.joblib.dump", "sklearn.ensemble.RandomForestClassifier", "os.makedirs", "bson.objectid.ObjectId", "warnings.filterwarnings", "os.getcwd", "sklearn.svm.SVC", "os.path.exists", "sklearn.metrics.classification_report", "sklearn.externa...
[((665, 755), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'sklearn.exceptions.UndefinedMetricWarning'}), "('ignore', category=sklearn.exceptions.\n UndefinedMetricWarning)\n", (688, 755), False, 'import os, re, csv, time, warnings, threading\n'), ((752, 821), 'warnings.filte...
from dash import dcc, html, Input, Output, callback, dash_table import dash_bootstrap_components as dbc import plotly.express as px import pandas as pd import numpy as np from pages.sas_key import get_df_description from pages.style import PADDING_STYLE TEXT_STYLE = { 'textAlign':'center', 'width': '70%', ...
[ "pandas.DataFrame", "dash.Output", "numpy.median", "dash.html.Div", "dash.dash_table.DataTable", "dash.dcc.Graph", "dash.html.P", "dash.html.H1", "pages.sas_key.get_df_description", "dash.Input", "plotly.express.histogram", "dash.html.Hr", "dash.html.H5", "dash.html.H3" ]
[((8370, 8413), 'dash.Output', 'Output', (['"""factssubredditprinter"""', '"""children"""'], {}), "('factssubredditprinter', 'children')\n", (8376, 8413), False, 'from dash import dcc, html, Input, Output, callback, dash_table\n'), ((8419, 8461), 'dash.Output', 'Output', (['"""subredditdescription"""', '"""children"""'...
import numpy as np f8 = np.float64() i8 = np.int64() u8 = np.uint64() f4 = np.float32() i4 = np.int32() u4 = np.uint32() td = np.timedelta64(0, "D") b_ = np.bool_() b = bool() f = float() i = int() AR = np.array([1], dtype=np.bool_) AR.setflags(write=False) AR2 = np.array([1], dtype=np.timedelta64) AR2.setflags(w...
[ "numpy.uint32", "numpy.bool_", "numpy.uint64", "numpy.float32", "numpy.timedelta64", "numpy.array", "numpy.int32", "numpy.int64", "numpy.float64" ]
[((25, 37), 'numpy.float64', 'np.float64', ([], {}), '()\n', (35, 37), True, 'import numpy as np\n'), ((43, 53), 'numpy.int64', 'np.int64', ([], {}), '()\n', (51, 53), True, 'import numpy as np\n'), ((59, 70), 'numpy.uint64', 'np.uint64', ([], {}), '()\n', (68, 70), True, 'import numpy as np\n'), ((77, 89), 'numpy.floa...
import numpy as np import pandas as pd import matplotlib.pyplot as plt from keras.preprocessing import text, sequence from keras.preprocessing.text import Tokenizer from keras.utils import to_categorical from keras.models import * from keras.layers import * from keras.optimizers import * from sklearn.model_selection i...
[ "os.mkdir", "pickle.dump", "os.path.basename", "keras.preprocessing.sequence.pad_sequences", "matplotlib.pyplot.close", "datetime.datetime.now", "numpy.split", "keras.preprocessing.text.Tokenizer", "numpy.arange", "keras.callbacks.TensorBoard", "keras.callbacks.LearningRateScheduler", "os.path...
[((702, 717), 'numpy.arange', 'np.arange', (['(5600)'], {}), '(5600)\n', (711, 717), True, 'import numpy as np\n'), ((729, 750), 'numpy.arange', 'np.arange', (['(5605)', '(5877)'], {}), '(5605, 5877)\n', (738, 750), True, 'import numpy as np\n'), ((767, 788), 'numpy.arange', 'np.arange', (['(5877)', '(6133)'], {}), '(5...
from io import StringIO import unittest import os import numpy as np from gimmemotifs.motif import Motif, read_motifs from gimmemotifs.shutils import which class TestMotif(unittest.TestCase): """ A test class for Motif """ def setUp(self): self.data_dir = "test/data/motif" self.pwm = os.path....
[ "unittest.main", "gimmemotifs.motif.Motif", "io.StringIO", "os.unlink", "os.path.exists", "numpy.array", "gimmemotifs.motif.read_motifs", "gimmemotifs.shutils.which", "os.path.join" ]
[((6224, 6239), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6237, 6239), False, 'import unittest\n'), ((312, 351), 'os.path.join', 'os.path.join', (['self.data_dir', '"""test.pwm"""'], {}), "(self.data_dir, 'test.pwm')\n", (324, 351), False, 'import os\n'), ((834, 841), 'gimmemotifs.motif.Motif', 'Motif', ([],...
'Test the arnet module.' import sys sys.path.insert(0, './') sys.path.insert(0, './tests') import numpy as np import torch import beer from basetest import BaseTest class TestUtils(BaseTest): def test_create_mask(self): ordering = [2, 0, 1] max_connections = [1, 0, 1, 1] device = torch....
[ "torch.ones", "torch.randint", "sys.path.insert", "beer.nnet.arnet.create_final_mask", "torch.randn", "beer.nnet.arnet.MaskedLinear", "beer.nnet.arnet.create_mask", "numpy.array", "beer.nnet.arnet.create_arnetwork", "torch.nn.Linear", "torch.device" ]
[((37, 61), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./"""'], {}), "(0, './')\n", (52, 61), False, 'import sys\n'), ((62, 91), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./tests"""'], {}), "(0, './tests')\n", (77, 91), False, 'import sys\n'), ((314, 333), 'torch.device', 'torch.device', (['"""cpu"""']...
""" Testing for AUC ROC metric. """ from . import helpers import itertools import numpy as np import pyltr import sklearn.metrics class TestAUCROC(helpers.TestMetric): def get_metric(self): return pyltr.metrics.AUCROC() def get_queries_with_values(self): for i in range(0, 7): f...
[ "pyltr.metrics.AUCROC", "numpy.array", "itertools.product" ]
[((214, 236), 'pyltr.metrics.AUCROC', 'pyltr.metrics.AUCROC', ([], {}), '()\n', (234, 236), False, 'import pyltr\n'), ((330, 364), 'itertools.product', 'itertools.product', (['*([(0, 1)] * i)'], {}), '(*([(0, 1)] * i))\n', (347, 364), False, 'import itertools\n'), ((686, 720), 'itertools.product', 'itertools.product', ...
# external libraries import unittest import numpy as np # class to be tested from rss.src.RSSvectors import Mom4 class Mom4TestCase(unittest.TestCase): def test_boosted_to_rest_frame_of(self): """ Test that the boosting function works as advertised """ p4 = Mom4(10,0,0,9.9) # ...
[ "rss.src.RSSvectors.Mom4", "numpy.sqrt" ]
[((300, 319), 'rss.src.RSSvectors.Mom4', 'Mom4', (['(10)', '(0)', '(0)', '(9.9)'], {}), '(10, 0, 0, 9.9)\n', (304, 319), False, 'from rss.src.RSSvectors import Mom4\n'), ((667, 684), 'rss.src.RSSvectors.Mom4', 'Mom4', (['(10)', '(3)', '(3)', '(3)'], {}), '(10, 3, 3, 3)\n', (671, 684), False, 'from rss.src.RSSvectors im...
import numpy as np from keras import backend as K from keras.applications.imagenet_utils import preprocess_input from keras.preprocessing import image from heatmap import synset_to_dfs_ids from heatmap import to_heatmap def helper_test(model): img_path = "../examples/dog.jpg" new_model = to_heatmap(model) ...
[ "heatmap.synset_to_dfs_ids", "numpy.sum", "keras.backend.image_data_format", "heatmap.to_heatmap", "numpy.expand_dims", "keras.preprocessing.image.img_to_array", "keras.preprocessing.image.load_img", "keras.applications.imagenet_utils.preprocess_input", "keras.backend.clear_session" ]
[((300, 317), 'heatmap.to_heatmap', 'to_heatmap', (['model'], {}), '(model)\n', (310, 317), False, 'from heatmap import to_heatmap\n'), ((353, 401), 'keras.preprocessing.image.load_img', 'image.load_img', (['img_path'], {'target_size': '(800, 800)'}), '(img_path, target_size=(800, 800))\n', (367, 401), False, 'from ker...
from __future__ import print_function, division import sys from datetime import datetime from collections import OrderedDict import numpy as np import h5py from .data import Dataset, SyncRecording, PatchClampRecording, TSeries from .test_pulse import PatchClampTestPulse from . import stimuli class MiesNwb(Dataset): ...
[ "h5py.File", "numpy.isfinite", "numpy.isnan", "datetime.datetime", "datetime.datetime.utcfromtimestamp", "numpy.array", "sys.exc_info", "collections.OrderedDict" ]
[((23002, 23015), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (23013, 23015), False, 'from collections import OrderedDict\n'), ((1266, 1279), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1277, 1279), False, 'from collections import OrderedDict\n'), ((1735, 1806), 'numpy.array', 'np.array...
#!/usr/bin/env python3 # Copyright 2019 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
[ "numpy.array" ]
[((1227, 1244), 'numpy.array', 'np.array', (['outputs'], {}), '(outputs)\n', (1235, 1244), True, 'import numpy as np\n'), ((1268, 1285), 'numpy.array', 'np.array', (['targets'], {}), '(targets)\n', (1276, 1285), True, 'import numpy as np\n'), ((2462, 2486), 'numpy.array', 'np.array', (['self.filenames'], {}), '(self.fi...
#!/usr/bin/env python import os import time import numpy as np from astropy.io import fits from aoide import voronoi import argparse def main(): print("\n======================= Aoide | Step 3 ====================\n") print("AoideVoronoi.py: Voronoi Tesselation based on Stellar Continuum Signal\n") ...
[ "astropy.io.fits.ImageHDU", "os.path.abspath", "argparse.ArgumentParser", "os.makedirs", "numpy.std", "astropy.io.fits.PrimaryHDU", "aoide.voronoi.binning_fits", "os.path.exists", "numpy.isnan", "time.time", "numpy.zeros", "numpy.mean", "numpy.arange", "astropy.io.fits.open", "os.chdir",...
[((362, 394), 'os.path.abspath', 'os.path.abspath', (['args.input_cube'], {}), '(args.input_cube)\n', (377, 394), False, 'import os\n'), ((968, 995), 'os.chdir', 'os.chdir', (['voronoi_directory'], {}), '(voronoi_directory)\n', (976, 995), False, 'import os\n'), ((1099, 1120), 'astropy.io.fits.open', 'fits.open', (['in...
# -*- coding: utf-8 -*- import gensim import numpy as np from numpy import linalg as LA import logging logger = logging.getLogger(__name__) def embedding_matrix(nb_tokens, embedding_size, token_to_index, glove_path=None, unit_norm=True, rs=None, ...
[ "numpy.random.RandomState", "numpy.array", "numpy.linalg.norm", "gensim.models.KeyedVectors.load_word2vec_format", "logging.getLogger" ]
[((116, 143), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (133, 143), False, 'import logging\n'), ((1772, 1840), 'gensim.models.KeyedVectors.load_word2vec_format', 'gensim.models.KeyedVectors.load_word2vec_format', (['path'], {'binary': 'binary'}), '(path, binary=binary)\n', (1819, 184...
"""Debiasing using reweighing""" """ This data recipe performs reweighing debiasing using the AIF360 package. https://github.com/Trusted-AI/AIF360 <NAME>., <NAME>. Data preprocessing techniques for classification without discrimination. Knowl Inf Syst 33, 1–33 (2012). https://doi.org/10.1007/s10115-011-0463-8 The...
[ "pandas.DataFrame", "aif360.datasets.BinaryLabelDataset", "pandas.read_csv", "h2oaicore.models_utils.import_tensorflow", "aif360.algorithms.preprocessing.reweighing.Reweighing", "os.path.isfile", "numpy.array" ]
[((2001, 2020), 'h2oaicore.models_utils.import_tensorflow', 'import_tensorflow', ([], {}), '()\n', (2018, 2020), False, 'from h2oaicore.models_utils import import_tensorflow\n'), ((2748, 2775), 'pandas.read_csv', 'pd.read_csv', (['full_data_file'], {}), '(full_data_file)\n', (2759, 2775), True, 'import pandas as pd\n')...
import numpy as np import pytest import rlberry.seeding as seeding from rlberry.envs import gym_make from copy import deepcopy gym_envs = [ 'Acrobot-v1', 'CartPole-v1', 'MountainCar-v0', ] def get_env_trajectory(env, horizon): states = [] ss = env.reset() for ii in range(horizon): ...
[ "copy.deepcopy", "numpy.array_equal", "pytest.mark.parametrize", "rlberry.seeding.set_global_seed", "rlberry.envs.gym_make" ]
[((629, 674), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""env_name"""', 'gym_envs'], {}), "('env_name', gym_envs)\n", (652, 674), False, 'import pytest\n'), ((1181, 1226), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""env_name"""', 'gym_envs'], {}), "('env_name', gym_envs)\n", (1204, 1226)...
import glob import numpy as np import xlrd import csv def parse_xlsx_file(file_path): """Parse contents of xlsx file into numpy array. Author: <NAME> (<EMAIL>) Args: file_path (str): path for the xlsx file. Returns: numpy.ndarray: parsed contents of the xlsx file. """ # Op...
[ "numpy.empty", "xlrd.open_workbook", "numpy.hstack", "numpy.array", "numpy.arange", "glob.glob", "numpy.vstack" ]
[((443, 505), 'numpy.empty', 'np.empty', (['(worksheet.nrows - 1, worksheet.ncols)'], {'dtype': 'object'}), '((worksheet.nrows - 1, worksheet.ncols), dtype=object)\n', (451, 505), True, 'import numpy as np\n'), ((519, 548), 'numpy.arange', 'np.arange', (['(1)', 'worksheet.nrows'], {}), '(1, worksheet.nrows)\n', (528, 5...
import random import numpy as np import matplotlib.pyplot as plt import logging from qlazy import QState from qlazy.tools.Register import CreateRegister, InitRegister EPS = 1.e-8 QS_Y = QState(qubit_num=1).h(0).s(0) def init_qs_list(N, prob): return [QState(qubit_num=1).h(0).s(0).z(0) if random.uniform(0, 1) <= ...
[ "qlazy.tools.Register.CreateRegister", "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "logging.FileHandler", "random.uniform", "logging.StreamHandler", "qlazy.QState", "qlazy.tools.Register.InitRegister", "numpy.array", "numpy.linspace", "matplotlib.pyplot.subplots", "logging.getLogger...
[((875, 892), 'qlazy.tools.Register.CreateRegister', 'CreateRegister', (['(1)'], {}), '(1)\n', (889, 892), False, 'from qlazy.tools.Register import CreateRegister, InitRegister\n'), ((918, 935), 'qlazy.tools.Register.CreateRegister', 'CreateRegister', (['(7)'], {}), '(7)\n', (932, 935), False, 'from qlazy.tools.Registe...
# Copyright 2018 The Cirq Developers # # 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 in ...
[ "cirq.SimulatesSamples", "cirq.testing.EqualsTester", "cirq.X", "cirq.LineQubit", "cirq.NamedQubit", "cirq.MeasurementGate", "cirq.H.on_each", "cirq.Simulator", "cirq.ParamResolver", "pytest.raises", "numpy.array", "cirq.testing.random_circuit", "cirq.SimulatesIntermediateWaveFunction", "n...
[((836, 859), 'cirq.SimulatesSamples', 'cirq.SimulatesSamples', ([], {}), '()\n', (857, 859), False, 'import cirq\n'), ((981, 1004), 'cirq.testing.mock.mock.Mock', 'mock.Mock', (['cirq.Circuit'], {}), '(cirq.Circuit)\n', (990, 1004), False, 'from cirq.testing.mock import mock\n'), ((1026, 1055), 'cirq.testing.mock.mock...
# Copyright (c) Facebook, Inc. and its affiliates. import copy import itertools import logging import numpy as np import pickle import random import torch import torch.utils.data as data from torch.utils.data.sampler import Sampler from detectron2.utils.serialize import PicklableWrapper __all__ = ["MapDataset", "Data...
[ "pickle.loads", "numpy.stack", "torch.utils.data.get_worker_info", "copy.deepcopy", "numpy.concatenate", "random.Random", "numpy.frombuffer", "numpy.cumsum", "numpy.array", "itertools.islice", "numpy.vstack", "detectron2.utils.serialize.PicklableWrapper", "logging.getLogger", "pickle.dumps...
[((1177, 1203), 'detectron2.utils.serialize.PicklableWrapper', 'PicklableWrapper', (['map_func'], {}), '(map_func)\n', (1193, 1203), False, 'from detectron2.utils.serialize import PicklableWrapper\n'), ((1260, 1277), 'random.Random', 'random.Random', (['(42)'], {}), '(42)\n', (1273, 1277), False, 'import random\n'), ((...
""" Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
[ "numpy.frombuffer" ]
[((2963, 2999), 'numpy.frombuffer', 'np.frombuffer', (['image_bytes', 'np.uint8'], {}), '(image_bytes, np.uint8)\n', (2976, 2999), True, 'import numpy as np\n')]
#!/usr/bin/env python3 # Copyright (c) the JPEG XL Project # # 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 applicabl...
[ "numpy.load", "json.load", "tempfile.TemporaryDirectory", "argparse.ArgumentParser", "os.path.isdir", "os.path.dirname", "os.path.exists", "subprocess.call", "os.path.join", "sys.exit" ]
[((1010, 1029), 'numpy.load', 'numpy.load', (['ref_npy'], {}), '(ref_npy)\n', (1020, 1029), False, 'import numpy\n'), ((1038, 1057), 'numpy.load', 'numpy.load', (['dec_npy'], {}), '(dec_npy)\n', (1048, 1057), False, 'import numpy\n'), ((1846, 1872), 'os.path.isdir', 'os.path.isdir', (['args.corpus'], {}), '(args.corpus...
import json import logging from itertools import cycle import matplotlib.pyplot as plt import numpy as np from sklearn.cluster import MeanShift, estimate_bandwidth from sklearn.datasets.samples_generator import make_blobs log = logging.getLogger(__name__) def analyze(data): # Convert this to python data for us ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "json.loads", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "sklearn.cluster.MeanShift", "numpy.unique", "sklearn.cluster.estimate_bandwidth", "matplotlib.pyplot.figure", "numpy.vstack", "numpy.array", "sklearn.datasets.samples_gener...
[((230, 257), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (247, 257), False, 'import logging\n'), ((373, 389), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (383, 389), False, 'import json\n'), ((973, 995), 'numpy.array', 'np.array', (['[[0.0, 0.0]]'], {}), '([[0.0, 0.0]])\n'...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import inspect import sys import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import math from itertools import product as product import cv2 from trident.backend.op...
[ "trident.data.bbox_common.bbox_giou", "numpy.maximum", "trident.layers.pytorch_activations.softmax", "numpy.argmax", "trident.misc.visualization_utils.generate_palette", "torch.cat", "numpy.clip", "numpy.argsort", "torch.device", "torch.no_grad", "trident.data.bbox_common.xyxy2xywh", "numpy.ro...
[((2429, 2464), 'torch.clamp', 'torch.clamp', (['(max_xy - min_xy)'], {'min': '(0)'}), '(max_xy - min_xy, min=0)\n', (2440, 2464), False, 'import torch\n'), ((7013, 7041), 'torch.cat', 'torch.cat', (['[g_cxcy, g_wh]', '(1)'], {}), '([g_cxcy, g_wh], 1)\n', (7022, 7041), False, 'import torch\n'), ((6502, 6517), 'torch.lo...
import unittest import numpy as np import tensorflow as tf import dlf.core from dlf.evaluators.coco_object_detection import CocoObjectDectectionEvaluator class TestCocoObjectDetectionEvaluator(unittest.TestCase): image_shape = (1024, 1024, 3) def setUp(self): self.evaluator = CocoObjectDectectionEval...
[ "numpy.array", "dlf.evaluators.coco_object_detection.CocoObjectDectectionEvaluator" ]
[((296, 341), 'dlf.evaluators.coco_object_detection.CocoObjectDectectionEvaluator', 'CocoObjectDectectionEvaluator', ([], {'per_class': '(True)'}), '(per_class=True)\n', (325, 341), False, 'from dlf.evaluators.coco_object_detection import CocoObjectDectectionEvaluator\n'), ((391, 482), 'numpy.array', 'np.array', (['[[[...
import numpy as np def create_results_values(proxy_evaluation, drift_labels_known, drift_decisions, acc_vector, drift_labels): """ Parameters ---------- proxy_evaluation: Boolean whether proxy evaluation was used drift_labels_known: Boolean whether change detection evaluation is used drift_de...
[ "numpy.transpose" ]
[((755, 812), 'numpy.transpose', 'np.transpose', (['[drift_decisions, acc_vector, drift_labels]'], {}), '([drift_decisions, acc_vector, drift_labels])\n', (767, 812), True, 'import numpy as np\n'), ((970, 1013), 'numpy.transpose', 'np.transpose', (['[drift_decisions, acc_vector]'], {}), '([drift_decisions, acc_vector])...
import operator import numpy as np import pytest import pytz from pandas._libs.tslibs import IncompatibleFrequency import pandas as pd from pandas import Series, date_range import pandas._testing as tm def _permute(obj): return obj.take(np.random.permutation(len(obj))) class TestSeriesFlexArithmetic: @py...
[ "pandas.offsets.DateOffset", "pandas.period_range", "pandas.interval_range", "pandas._testing.assert_almost_equal", "pandas.date_range", "numpy.random.randn", "numpy.dtype", "pandas._testing.assert_series_equal", "pytest.raises", "pandas.to_datetime", "pandas.Series", "pandas._testing.makeFloa...
[((622, 712), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""opname"""', "['add', 'sub', 'mul', 'floordiv', 'truediv', 'pow']"], {}), "('opname', ['add', 'sub', 'mul', 'floordiv',\n 'truediv', 'pow'])\n", (645, 712), False, 'import pytest\n'), ((2550, 2724), 'pytest.mark.parametrize', 'pytest.mark.param...
import numpy as np import pandas as pd import gzip from PCA import IPCA #DEVICE = "cpu" CHUNK_SIZE = 5 BATCH_SIZE = 5 NUM_COMPONENTS = 2 files = ["tweet_tokens/embeddings/training_embeddings.csv.gz", "tweet_tokens/embeddings/training_embeddings_2.csv.gz"] #PATH = "tweet_tokens/embeddings/day_1/embeddings_day_...
[ "pandas.read_csv", "PCA.IPCA", "gzip.open", "numpy.array" ]
[((724, 752), 'gzip.open', 'gzip.open', (['OUTPUT_PATH', '"""wt"""'], {}), "(OUTPUT_PATH, 'wt')\n", (733, 752), False, 'import gzip\n'), ((1005, 1033), 'gzip.open', 'gzip.open', (['OUTPUT_PATH', '"""at"""'], {}), "(OUTPUT_PATH, 'at')\n", (1014, 1033), False, 'import gzip\n'), ((1351, 1386), 'PCA.IPCA', 'IPCA', ([], {'n...
from typing import List, Tuple, NoReturn, Optional, Union import numpy as np from auto_editor.utils.log import Log from auto_editor.utils.types import split_num_str def combine_audio_motion( audio_list: np.ndarray, motion_list: np.ndarray, based: str, log: Log ) -> Optional[np.ndarray]: no_place_where =...
[ "numpy.bitwise_xor", "numpy.where", "auto_editor.utils.types.split_num_str", "numpy.invert" ]
[((1005, 1026), 'numpy.invert', 'np.invert', (['audio_list'], {}), '(audio_list)\n', (1014, 1026), True, 'import numpy as np\n'), ((1073, 1095), 'numpy.invert', 'np.invert', (['motion_list'], {}), '(motion_list)\n', (1082, 1095), True, 'import numpy as np\n'), ((1301, 1340), 'numpy.bitwise_xor', 'np.bitwise_xor', (['au...
"""End to end testing on simple linear models""" # pylint: disable=C0103 # pylint: disable=C0325 # pylint: disable=E1101 import numpy as np from scipy.stats import zscore from sklearn.linear_model import LogisticRegression as sk_LogisticRegression from sklearn.linear_model import LinearRegression as sk_LinearRegres...
[ "scipy.stats.zscore", "numpy.random.randn", "model_wrangler.dataset_managers.DatasetManager", "sklearn.linear_model.LinearRegression", "sklearn.linear_model.LogisticRegression", "model_wrangler.model_wrangler.ModelWrangler" ]
[((1212, 1229), 'scipy.stats.zscore', 'zscore', (['X'], {'axis': '(0)'}), '(X, axis=0)\n', (1218, 1229), False, 'from scipy.stats import zscore\n'), ((1515, 1532), 'scipy.stats.zscore', 'zscore', (['X'], {'axis': '(0)'}), '(X, axis=0)\n', (1521, 1532), False, 'from scipy.stats import zscore\n'), ((1848, 1872), 'model_w...
from functools import wraps from random import random, seed, sample import numpy as np import pandas as pd import datetime import time import Code.method_collector as mc import Code.create_collector as cc import cv2 def to_categorical_unit(target, nb_class): categorical = np.zeros([1, int(nb_class)]) categori...
[ "Code.method_collector.method_fa_leaveone", "Code.method_collector.method_sleaveone", "pandas.read_csv", "Code.method_collector.method_mdpi", "Code.method_collector.method_dhalf", "Code.method_collector.method_half", "Code.method_collector.method_CV", "Code.create_collector.get_unit_step", "numpy.hs...
[((1168, 1191), 'Code.create_collector.get_unit_step', 'cc.get_unit_step', (['data1'], {}), '(data1)\n', (1184, 1191), True, 'import Code.create_collector as cc\n'), ((1196, 1253), 'Code.create_collector.get_index_sampling', 'cc.get_index_sampling', (['param', 'data1'], {'step_index': 'unit_step'}), '(param, data1, ste...
""" Test benches for the computational efficiency of toolbox routines. """ import time import unittest import numpy as np import pyinduct as pi from pyinduct.tests.test_core import CalculateScalarProductMatrixTestCase def simulation_benchmark(spat_domain, settings): """ This benchmark covers a typical simul...
[ "pyinduct.create_state_space", "pyinduct.get_sim_result", "pyinduct.FieldVariable", "numpy.mean", "numpy.sin", "numpy.exp", "time.clock", "pyinduct.calculate_scalar_product_matrix", "pyinduct.Input", "pyinduct.simulate_state_space", "pyinduct.get_base", "pyinduct.parse_weak_formulation", "py...
[((577, 610), 'pyinduct.Domain', 'pi.Domain', ([], {'bounds': '(0, 5)', 'num': '(100)'}), '(bounds=(0, 5), num=100)\n', (586, 610), True, 'import pyinduct as pi\n'), ((625, 649), 'pyinduct.Function', 'pi.Function', (['(lambda z: 0)'], {}), '(lambda z: 0)\n', (636, 649), True, 'import pyinduct as pi\n'), ((660, 672), 't...
from geometry.TwoDimension import SE2Pose from factors.Factors import SE2RelativeGaussianLikelihoodFactor, \ R2RelativeGaussianLikelihoodFactor, R2RangeGaussianLikelihoodFactor, \ LikelihoodFactor, SE2R2RangeGaussianLikelihoodFactor import numpy as np import TransportMaps.Distributions as dist from slam.V...
[ "factors.Factors.R2RangeGaussianLikelihoodFactor", "matplotlib.pyplot.show", "slam.Variables.Variable.construct_from_text", "matplotlib.pyplot.plot", "factors.Factors.SE2R2RangeGaussianLikelihoodFactor", "numpy.sum", "slam.Variables.SE2Variable", "numpy.zeros", "numpy.identity", "slam.Variables.R2...
[((1017, 1051), 'slam.Variables.Variable.construct_from_text', 'Variable.construct_from_text', (['line'], {}), '(line)\n', (1045, 1051), False, 'from slam.Variables import VariableType, Variable, R2Variable, SE2Variable\n'), ((3828, 3928), 'factors.Factors.R2RelativeGaussianLikelihoodFactor', 'R2RelativeGaussianLikelih...
#!/usr/local/bin/python3 # SimSRE, a tool to investigate how different work structures for SRE # might affect outcomes for an SRE team or teams. # The basic idea is that we model an SRE team as a state machine (via # discrete event simulation) which has work assigned, processes work, # and different types of work hav...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "random.randint", "matplotlib.pyplot.bar", "matplotlib.pyplot.legend", "collections.Counter", "collections.defaultdict", "numpy.arange", "simpy.Environment", "matplotlib.pyplot.ylabel", "collections.deque" ]
[((12429, 12448), 'simpy.Environment', 'simpy.Environment', ([], {}), '()\n', (12446, 12448), False, 'import simpy\n'), ((11861, 11889), 'numpy.arange', 'numpy.arange', (['sre_team.ticks'], {}), '(sre_team.ticks)\n', (11873, 11889), False, 'import numpy\n'), ((11984, 12022), 'matplotlib.pyplot.bar', 'plt.bar', (['ind',...
from jesse.helpers import get_candle_source, slice_candles, np_shift, same_length import numpy as np from numba import njit,jit import talib from typing import Union from jesse.helpers import get_config from collections import namedtuple import tulipy as ti import math """ https://www.tradingview.com/script/umIHbltg...
[ "jesse.helpers.slice_candles", "numpy.power", "numpy.full_like", "jesse.helpers.get_candle_source" ]
[((526, 560), 'jesse.helpers.slice_candles', 'slice_candles', (['candles', 'sequential'], {}), '(candles, sequential)\n', (539, 560), False, 'from jesse.helpers import get_candle_source, slice_candles, np_shift, same_length\n'), ((575, 626), 'jesse.helpers.get_candle_source', 'get_candle_source', (['candles'], {'source...
#! -*- coding: utf-8 -*- import json import os import numpy as np import tensorflow as tf import random as rn np.random.seed(42) rn.seed(12345) tf.set_random_seed(1234) os.environ['PYTHONHASHSEED'] = '0' from keras_bert import load_trained_model_from_checkpoint, Tokenizer import codecs from keras.layers import * fr...
[ "numpy.random.seed", "argparse.ArgumentParser", "keras.backend.set_value", "keras.backend.sparse_categorical_crossentropy", "keras.models.Model", "keras.backend.batch_dot", "json.dumps", "os.path.join", "keras.backend.cast", "keras_bert.load_trained_model_from_checkpoint", "codecs.open", "json...
[((112, 130), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (126, 130), True, 'import numpy as np\n'), ((131, 145), 'random.seed', 'rn.seed', (['(12345)'], {}), '(12345)\n', (138, 145), True, 'import random as rn\n'), ((146, 170), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(1234)'], {}), ...
from src.envs.color_generation import sample_color, infer_color from src.envs.env_params import get_env_params import numpy as np import pybullet as p import os import pickle ENV_PARAMS = get_env_params() # path = "./src/envs/shapenet_objects/" # If the relative path doesn't work, we can use the absolute (complete...
[ "numpy.random.uniform", "pybullet.loadURDF", "pickle.dump", "numpy.deg2rad", "numpy.random.rand", "numpy.zeros", "os.path.exists", "pybullet.removeBody", "src.envs.color_generation.sample_color", "pickle.load", "numpy.array", "numpy.linalg.norm", "src.envs.env_params.get_env_params", "src....
[((189, 205), 'src.envs.env_params.get_env_params', 'get_env_params', ([], {}), '()\n', (203, 205), False, 'from src.envs.env_params import get_env_params\n'), ((634, 648), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (645, 648), False, 'import pickle\n'), ((514, 530), 'os.listdir', 'os.listdir', (['path'], {}),...
#!/usr/bin/env python # wujian@2018 import argparse from distutils.util import strtobool import numpy as np from libs.data_handler import NumpyReader, NumpyWriter, parse_scps from libs.utils import get_logger logger = get_logger(__name__) def run(args): numpy_reader = NumpyReader(args.npy_scp) spk2utt = ...
[ "numpy.stack", "libs.utils.get_logger", "argparse.ArgumentParser", "libs.data_handler.NumpyReader", "libs.data_handler.NumpyWriter", "numpy.mean", "numpy.linalg.norm", "libs.data_handler.parse_scps" ]
[((222, 242), 'libs.utils.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (232, 242), False, 'from libs.utils import get_logger\n'), ((279, 304), 'libs.data_handler.NumpyReader', 'NumpyReader', (['args.npy_scp'], {}), '(args.npy_scp)\n', (290, 304), False, 'from libs.data_handler import NumpyReader, Nump...
# the version without filter # !/usr/bin/python3 import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from scipy import signal import time import webcam2rgb import cv2 class RealtimePlotWindow: def __init__(self, channel: str): # create a plot window self....
[ "matplotlib.pyplot.axhline", "matplotlib.pyplot.show", "numpy.zeros", "time.time", "matplotlib.animation.FuncAnimation", "numpy.append", "numpy.mean", "webcam2rgb.Webcam2rgb", "matplotlib.pyplot.subplots_adjust", "cv2.destroyAllWindows", "matplotlib.pyplot.subplots", "scipy.signal.butter" ]
[((5529, 5552), 'webcam2rgb.Webcam2rgb', 'webcam2rgb.Webcam2rgb', ([], {}), '()\n', (5550, 5552), False, 'import webcam2rgb\n'), ((5617, 5651), 'matplotlib.pyplot.axhline', 'plt.axhline', ([], {'y': '(10)', 'ls': '""":"""', 'c': '"""red"""'}), "(y=10, ls=':', c='red')\n", (5628, 5651), True, 'import matplotlib.pyplot a...
import numpy as np import random import matplotlib.pyplot as plt hours = np.arange(0, 100) + 1 def r_exp(n): return 100 * (((1 + 0.01) * 0.9) + ((1 + 0.06) * 0.1)) ** n def r(x): if random.random() < 0.9: return 0.01 else: return 0.06 def f(x): return (1 + r(x))*x x_cache = {} def x...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "random.random", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.sqrt" ]
[((1058, 1124), 'matplotlib.pyplot.scatter', 'plt.scatter', (['hours', 'sample_mean_pop'], {'c': '"""Orange"""', 's': '(10.0)', 'alpha': '(0.5)'}), "(hours, sample_mean_pop, c='Orange', s=10.0, alpha=0.5)\n", (1069, 1124), True, 'import matplotlib.pyplot as plt\n'), ((1170, 1227), 'matplotlib.pyplot.scatter', 'plt.scat...
# -*- coding: utf-8 -*- """ This framework is based on SSD_tensorlow(https://github.com/balancap/SSD-Tensorflow) Add descriptions """ import math from collections import namedtuple import copy import numpy as np import tensorflow as tf import tf_extended as tfe from nets import custom_layers from nets i...
[ "tensorflow.contrib.layers.xavier_initializer", "tensorflow.reduce_sum", "nets.custom_layers.abs_smooth", "tensorflow.reshape", "tensorflow.contrib.slim.softmax", "tensorflow.contrib.slim.l2_regularizer", "tensorflow.contrib.slim.conv2d", "tensorflow.add_n", "tensorflow.losses.add_loss", "tensorfl...
[((590, 806), 'collections.namedtuple', 'namedtuple', (['"""TextboxParameters"""', "['img_shape', 'num_classes', 'feat_layers', 'feat_shapes', 'scale_range',\n 'anchor_ratios', 'anchor_sizes', 'anchor_steps', 'normalizations',\n 'prior_scaling', 'step', 'scales']"], {}), "('TextboxParameters', ['img_shape', 'num_...
# -*- coding:utf-8 -*- """Strassen算法求矩阵乘法 """ import numpy as np def strassen(A, B): """Strassen算法求矩阵乘法 Args: A(np.array): 矩阵1 B(np.array): 矩阵2 Return: C(np.array): 矩阵乘法结果 """ n, _ = A.shape if n == 1: C = np.array(A[0, 0] * B[0, 0]) return C el...
[ "numpy.array", "numpy.hstack" ]
[((1254, 1320), 'numpy.array', 'np.array', (['[[1, 2, 3, 4], [4, 3, 2, 1], [1, 3, 5, 7], [7, 5, 3, 1]]'], {}), '([[1, 2, 3, 4], [4, 3, 2, 1], [1, 3, 5, 7], [7, 5, 3, 1]])\n', (1262, 1320), True, 'import numpy as np\n'), ((1368, 1434), 'numpy.array', 'np.array', (['[[2, 4, 6, 8], [8, 6, 4, 2], [1, 2, 3, 4], [4, 3, 2, 1]...
# Copyright 2018 The TensorFlow Probability 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ "hypothesis.strategies.data", "tensorflow_probability.python.internal.test_util.main", "absl.testing.parameterized.parameters", "time.sleep", "tensorflow_probability.python.internal.hypothesis_testlib.tensors_in_support", "numpy.isfinite", "tensorflow_probability.python.internal.hypothesis_testlib.tfp_h...
[((1260, 1332), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['((support,) for support in tfp_hps.ALL_SUPPORTS)'], {}), '((support,) for support in tfp_hps.ALL_SUPPORTS)\n', (1284, 1332), False, 'from absl.testing import parameterized\n'), ((1360, 1385), 'tensorflow_probability.python.internal....
import pandas as pd import numpy as np def append(target_df, df): """Append df to the end of target_df. Intended to be used in a loop where you are appending multiple dataframes together. Parameters ---------- target_df : GeoDataFrame or DataFrame May be none for the first append ope...
[ "numpy.concatenate" ]
[((1103, 1132), 'numpy.concatenate', 'np.concatenate', (['series.values'], {}), '(series.values)\n', (1117, 1132), True, 'import numpy as np\n')]
import numpy as np import tensorflow as tf from collections import deque import random from . import env np.random.seed(1) tf.set_random_seed(1) def weight_variable(shape, name): initial = tf.truncated_normal(shape, stddev=0.01) return tf.Variable(initial, name=name) def bias_variable(shape, name): ini...
[ "numpy.random.seed", "numpy.argmax", "random.sample", "tensorflow.reshape", "tensorflow.train.AdamOptimizer", "tensorflow.matmul", "tensorflow.multiply", "tensorflow.Variable", "numpy.random.randint", "tensorflow.nn.conv2d", "tensorflow.truncated_normal", "collections.deque", "tensorflow.var...
[((106, 123), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (120, 123), True, 'import numpy as np\n'), ((124, 145), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(1)'], {}), '(1)\n', (142, 145), True, 'import tensorflow as tf\n'), ((196, 235), 'tensorflow.truncated_normal', 'tf.truncated_norma...
import pandas as pd import numpy as np import glob import os import warnings from joblib import wrap_non_picklable_objects from ..util import get_unique_str_markers def proc_fop(fop): # If provided as just % number, divide by 100 if not isinstance(fop, tuple): fop /= 100 return (fop, 1-fop) ...
[ "numpy.stack", "numpy.save", "numpy.argmax", "joblib.wrap_non_picklable_objects", "pandas.unique", "pandas.Series", "glob.glob", "warnings.warn", "numpy.unique" ]
[((6788, 6816), 'numpy.stack', 'np.stack', (['subj_data'], {'axis': '(-1)'}), '(subj_data, axis=-1)\n', (6796, 6816), True, 'import numpy as np\n'), ((7024, 7052), 'numpy.save', 'np.save', (['save_loc', 'subj_data'], {}), '(save_loc, subj_data)\n', (7031, 7052), True, 'import numpy as np\n'), ((1555, 1595), 'numpy.uniq...
''' AUTHOR : <NAME>. CAPSTONE 2: BUILDING A SMART QUEUE SYSTEM. INTEL(R) EDGE AI FOR IOT DEVELOPERS NANODEGREE. QUEUE SYSTEM AND INFERENCE MODULE. ''' import numpy as np import time from openvino.inference_engine import IECore import os import cv2 import argparse import sys, traceback class Queue: ''' Class f...
[ "numpy.load", "cv2.putText", "argparse.ArgumentParser", "numpy.copy", "openvino.inference_engine.IECore", "cv2.VideoWriter_fourcc", "traceback.print_tb", "time.time", "cv2.VideoCapture", "cv2.rectangle", "sys.exc_info", "traceback.print_exception", "cv2.destroyAllWindows", "os.path.join", ...
[((3695, 3706), 'time.time', 'time.time', ([], {}), '()\n', (3704, 3706), False, 'import time\n'), ((4673, 4684), 'time.time', 'time.time', ([], {}), '()\n', (4682, 4684), False, 'import time\n'), ((6406, 6431), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (6429, 6431), False, 'import argpars...
from typing import List from functools import lru_cache import numpy as np import matplotlib.pyplot as plt from metaflow import Flow, Run def _tokenize_full_text(texts, tokenizer): """Tokenize texts without truncation.""" return tokenizer(texts, padding=True, truncation=False, return_tensors="np") def token...
[ "metaflow.Flow", "numpy.random.RandomState", "numpy.max", "numpy.array", "matplotlib.pyplot.subplots" ]
[((1044, 1059), 'numpy.max', 'np.max', (['lengths'], {}), '(lengths)\n', (1050, 1059), True, 'import numpy as np\n'), ((1125, 1139), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1137, 1139), True, 'import matplotlib.pyplot as plt\n'), ((1629, 1656), 'numpy.random.RandomState', 'np.random.RandomState...
import numpy as np import pylab as pl import matplotlib as mpl mpl.rcParams['text.usetex'] = True # Optionally, you can import packages mpl.rcParams['text.latex.preamble'] = r'\usepackage{{amsmath}}\usepackage{{amsfonts}}' mainpath = '/data/pt_02015/human_test_data_deconvolution_08088.b3/tp0/mrtrix/' prob_int...
[ "pylab.close", "numpy.load", "pylab.title", "pylab.imshow", "pylab.xticks", "pylab.savefig", "pylab.yticks", "pylab.colorbar", "pylab.figure", "numpy.eye", "numpy.log10" ]
[((326, 396), 'numpy.load', 'np.load', (["(mainpath + 'tc_step_0p5_theta_90_th_0p20_npv_50_seed_int.npy')"], {}), "(mainpath + 'tc_step_0p5_theta_90_th_0p20_npv_50_seed_int.npy')\n", (333, 396), True, 'import numpy as np\n'), ((409, 464), 'numpy.load', 'np.load', (["(mainpath + 'graph_mat_cone60_com2com_prob.npy')"], {...
# -*- coding: utf-8 -*- __author__ = "Yuchen" __aim__ = 'rank top sentences in one topic' __testCase__ = "../test/test_sentenceRanking.py" import argparse import numpy as np # from Processing import process,synonyms import Processing from sentSimilarity import Rouge import operator from tfidf_contentWords import loadD...
[ "Processing.synonyms", "argparse.ArgumentParser", "numpy.array", "Processing.process", "numpy.row_stack", "numpy.column_stack", "operator.itemgetter", "numpy.delete" ]
[((1526, 1551), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1549, 1551), False, 'import argparse\n'), ((1893, 1907), 'numpy.array', 'np.array', (['list'], {}), '(list)\n', (1901, 1907), True, 'import numpy as np\n'), ((1919, 1950), 'numpy.column_stack', 'np.column_stack', (['(data, column)'...
import os import shutil import pickle from torch import nn import torch import pandas as pd import random import numpy as np from torch.utils.data import Dataset from torch.utils.data import DataLoader from torch.cuda.amp import autocast,GradScaler from sklearn.model_selection import KFold from sklearn.preprocessing i...
[ "torch.nn.Dropout", "sklearn.preprocessing.StandardScaler", "numpy.random.random_sample", "numpy.argmax", "pandas.read_csv", "torch.argmax", "random.sample", "numpy.mean", "pickle.load", "shutil.rmtree", "torch.no_grad", "os.path.join", "pandas.DataFrame", "torch.cuda.amp.autocast", "tor...
[((580, 601), 'torch.nn.ReLU', 'nn.ReLU', ([], {'inplace': '(True)'}), '(inplace=True)\n', (587, 601), False, 'from torch import nn\n'), ((613, 633), 'torch.nn.ELU', 'nn.ELU', ([], {'inplace': '(True)'}), '(inplace=True)\n', (619, 633), False, 'from torch import nn\n'), ((651, 677), 'torch.nn.LeakyReLU', 'nn.LeakyReLU'...
import numpy as np import capytaine as cpt vert = np.array([0.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 1.0, -1.0, 0.0, 1.0, -1.0, 1.0, 0.0, -1.0, 2.0, 0.0, -1.0, 2.0, 1.0, -1.0, 1.0, 1.0, -1.0]).reshape((8,...
[ "capytaine.Mesh", "capytaine.Delhommeau", "numpy.array", "numpy.arange" ]
[((370, 391), 'capytaine.Mesh', 'cpt.Mesh', (['vert', 'faces'], {}), '(vert, faces)\n', (378, 391), True, 'import capytaine as cpt\n'), ((51, 194), 'numpy.array', 'np.array', (['[0.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 1.0, -1.0, 0.0, 1.0, -1.0, 1.0, 0.0, \n -1.0, 2.0, 0.0, -1.0, 2.0, 1.0, -1.0, 1.0, 1.0, -1.0]'], {}),...
# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2022 Scipp contributors (https://github.com/scipp) # @author <NAME> import numpy as np import scipp as sc def make_variables(): data = np.arange(1, 4, dtype=float) a = sc.Variable(dims=['x'], values=data) b = sc.Variable(dims=['x'], values=data) ...
[ "scipp.Dataset", "scipp.ones_like", "scipp.scalar", "scipp.Variable", "scipp.identical", "scipp.zeros_like", "numpy.arange", "numpy.array_equal", "scipp.arange" ]
[((198, 226), 'numpy.arange', 'np.arange', (['(1)', '(4)'], {'dtype': 'float'}), '(1, 4, dtype=float)\n', (207, 226), True, 'import numpy as np\n'), ((235, 271), 'scipp.Variable', 'sc.Variable', ([], {'dims': "['x']", 'values': 'data'}), "(dims=['x'], values=data)\n", (246, 271), True, 'import scipp as sc\n'), ((280, 3...
from numpy import zeros, swapaxes, sign from ....Methods.Machine.Winding import WindingError from swat_em import datamodel def comp_connection_mat(self, Zs=None, p=None): """Compute the Winding Matrix for Parameters ---------- self : Winding A: Winding object Zs : int Number of ...
[ "numpy.zeros", "numpy.swapaxes", "swat_em.datamodel", "numpy.sign" ]
[((1676, 1687), 'swat_em.datamodel', 'datamodel', ([], {}), '()\n', (1685, 1687), False, 'from swat_em import datamodel\n'), ((1852, 1878), 'numpy.zeros', 'zeros', (['(Nlayer, 1, Zs, qs)'], {}), '((Nlayer, 1, Zs, qs))\n', (1857, 1878), False, 'from numpy import zeros, swapaxes, sign\n'), ((2855, 2879), 'numpy.swapaxes'...
""" Kernel orthogonal matching pursuit for changepoint detection. Fast but approximate. """ from itertools import product import numpy as np from ruptures.utils import pairwise class OmpK: """Contient l'algorithme de parcours des partitions.""" def __init__(self, min_size=2, jump=5): """One lin...
[ "numpy.zeros", "numpy.diag", "numpy.arange", "numpy.argmax" ]
[((1204, 1236), 'numpy.arange', 'np.arange', (['(1)', '(self.n_samples + 1)'], {}), '(1, self.n_samples + 1)\n', (1213, 1236), True, 'import numpy as np\n'), ((2255, 2280), 'numpy.zeros', 'np.zeros', (['self.gram.shape'], {}), '(self.gram.shape)\n', (2263, 2280), True, 'import numpy as np\n'), ((1630, 1652), 'numpy.arg...
import numpy as np # --------------------------- line-search --------------------------- def wolfe(func, grad, xk, alpha, pk): c1 = 1e-4 return func(xk + alpha * pk) <= func(xk) + c1 * alpha * np.dot(grad(xk), pk) def strong_wolfe(func, grad, xk, alpha, pk, c2): return wolfe(func, grad, xk, alpha, pk) ...
[ "numpy.outer", "numpy.zeros_like", "numpy.zeros", "numpy.identity", "numpy.ones", "numpy.mean", "numpy.array", "numpy.linalg.norm", "numpy.inner", "numpy.random.rand", "numpy.eye", "numpy.linalg.solve" ]
[((4042, 4055), 'numpy.zeros', 'np.zeros', (['m_t'], {}), '(m_t)\n', (4050, 4055), True, 'import numpy as np\n'), ((4064, 4077), 'numpy.zeros', 'np.zeros', (['m_t'], {}), '(m_t)\n', (4072, 4077), True, 'import numpy as np\n'), ((4591, 4611), 'numpy.identity', 'np.identity', (['xk.size'], {}), '(xk.size)\n', (4602, 4611...
import os import pickle import matplotlib.pyplot as plt import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from scipy.io import loadmat from torch import optim from torch.autograd import Variable from torch.optim.lr_scheduler import StepLR from torchvision import models from dataset...
[ "pickle.dump", "torch.optim.lr_scheduler.StepLR", "numpy.random.seed", "torch.sqrt", "torch.cat", "torch.nn.init.constant_", "torch.device", "torch.no_grad", "torch.nn.MSELoss", "torchvision.models.vgg16", "torch.manual_seed", "torch.nn.Conv2d", "torch.cuda.manual_seed", "torch.nn.function...
[((694, 719), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (717, 719), False, 'import torch\n'), ((729, 772), 'torch.device', 'torch.device', (["('cuda' if use_cuda else 'cpu')"], {}), "('cuda' if use_cuda else 'cpu')\n", (741, 772), False, 'import torch\n'), ((833, 848), 'datasets.load_datas...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # signals.py - <NAME> (<EMAIL>) - Jan 2017 ''' Contains functions to deal with masking and removing periodic signals in light curves. ''' ############# ## LOGGING ## ############# import logging from astrobase import log_sub, log_fmt, log_date_fmt DEBUG = False if DEB...
[ "matplotlib.pyplot.title", "numpy.abs", "numpy.floor", "logging.getLogger", "numpy.argsort", "matplotlib.pyplot.figure", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "os.path.abspath", "matplotlib.pyplot.close", "numpy.median", "numpy.min", "matplotlib.use", "matplotlib.pyplo...
[((390, 417), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (407, 417), False, 'import logging\n'), ((418, 508), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'level', 'style': 'log_sub', 'format': 'log_fmt', 'datefmt': 'log_date_fmt'}), '(level=level, style=log_sub, forma...
import numpy as np import signal_processing as sp import numpy.ma as ma import datetime as dt """ mel 2018-04-20 Translates RMS results for all files to minimum / mean / maximum and filters out zeros in the minimum. Filters out only weekday results between 6:00 and 18:00 hours. """ # dir_path = "C:\\Users\...
[ "numpy.savetxt", "datetime.date", "datetime.datetime", "numpy.ma.array", "signal_processing.OneThird_octave", "datetime.timedelta", "numpy.loadtxt", "datetime.time", "numpy.ma.masked_less", "signal_processing.obtain_files" ]
[((513, 538), 'signal_processing.obtain_files', 'sp.obtain_files', (['dir_path'], {}), '(dir_path)\n', (528, 538), True, 'import signal_processing as sp\n'), ((2149, 2208), 'signal_processing.OneThird_octave', 'sp.OneThird_octave', (['(0.625 / 2 ** (1 / 3))', '(80 * 2 ** (1 / 3))'], {}), '(0.625 / 2 ** (1 / 3), 80 * 2 ...
import torch import numpy as np from torch.autograd import Variable import halp.utils.utils from halp.utils.utils import single_to_half_det, single_to_half_stoc from halp.models.logistic_regression import LogisticRegression from unittest import TestCase class LeNetTest(TestCase): def test_logistic_regression_gra...
[ "halp.models.logistic_regression.LogisticRegression", "torch.sum", "numpy.array", "numpy.random.normal" ]
[((560, 646), 'halp.models.logistic_regression.LogisticRegression', 'LogisticRegression', ([], {'input_dim': 'n_dim', 'n_class': 'n_class', 'reg_lambda': '(100.0)', 'dtype': '"""fp"""'}), "(input_dim=n_dim, n_class=n_class, reg_lambda=100.0,\n dtype='fp')\n", (578, 646), False, 'from halp.models.logistic_regression ...
import numpy as np import matplotlib.pyplot as plt plt.style.use('fivethirtyeight') def plot_images(images, targets, n_plot=30): n_rows = n_plot // 10 + ((n_plot % 10) > 0) fig, axes = plt.subplots(n_rows, 10, figsize=(15, 1.5 * n_rows)) axes = np.atleast_2d(axes) for i, (image, target) in enumerate(z...
[ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.style.use", "matplotlib.pyplot.subplots", "numpy.atleast_2d" ]
[((51, 83), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (64, 83), True, 'import matplotlib.pyplot as plt\n'), ((194, 246), 'matplotlib.pyplot.subplots', 'plt.subplots', (['n_rows', '(10)'], {'figsize': '(15, 1.5 * n_rows)'}), '(n_rows, 10, figsize=(15, 1.5 *...
import os import sys import h5py import numpy as np import pandas as pd import networkx as nx from convert import make_adjacency, make_sparse_adjacency, save_problem, spadj2edgelist np.random.seed(123) def load_ages(path): ages = pd.read_csv(path, header=None, sep='\t') ages.columns = ('id', 'age') a...
[ "numpy.random.seed", "convert.make_adjacency", "convert.save_problem", "pandas.read_csv", "pandas.merge", "numpy.zeros", "numpy.hstack", "numpy.arange", "numpy.array", "numpy.random.choice", "os.path.join", "convert.spadj2edgelist", "convert.make_sparse_adjacency" ]
[((183, 202), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (197, 202), True, 'import numpy as np\n'), ((848, 872), 'numpy.arange', 'np.arange', (['ages.shape[0]'], {}), '(ages.shape[0])\n', (857, 872), True, 'import numpy as np\n'), ((882, 933), 'pandas.merge', 'pd.merge', (['edges', 'ages'], {'le...
# -*- coding: utf-8 -*- """ Created on Sun Jan 19 21:43:37 2020 @author: acer """ import numpy as np import sys import csv import argparse def step1(dec_matrix): sqrtSum=np.sqrt(np.sum(np.square(dec_matrix),axis=0)) dec_matrix=dec_matrix/sqrtSum return (dec_matrix) def step2(dec_matrix,weights): retu...
[ "numpy.size", "csv.reader", "argparse.ArgumentParser", "numpy.square", "numpy.zeros", "numpy.min", "numpy.max", "numpy.array", "sys.exit" ]
[((439, 465), 'numpy.min', 'np.min', (['dec_matrix'], {'axis': '(0)'}), '(dec_matrix, axis=0)\n', (445, 465), True, 'import numpy as np\n'), ((481, 507), 'numpy.max', 'np.max', (['dec_matrix'], {'axis': '(0)'}), '(dec_matrix, axis=0)\n', (487, 507), True, 'import numpy as np\n'), ((526, 544), 'numpy.zeros', 'np.zeros',...
from __future__ import print_function import cv2 import numpy as np import os import tkFileDialog, tkMessageBox def lin_regress(x, y): A = np.vstack([x]).T return np.linalg.lstsq(A, y)[0] def get_track(filename): with open(filename, 'r') as f: lines = f.readlines() print(lines[0]) lines =...
[ "os.remove", "numpy.abs", "numpy.linalg.lstsq", "cv2.waitKey", "os.path.exists", "numpy.zeros", "tkMessageBox.showinfo", "cv2.VideoCapture", "cv2.namedWindow", "numpy.mean", "cv2.setMouseCallback", "numpy.cos", "cv2.destroyWindow", "cv2.imshow", "tkFileDialog.askopenfilename", "numpy.v...
[((2243, 2274), 'os.path.exists', 'os.path.exists', (['config_filename'], {}), '(config_filename)\n', (2257, 2274), False, 'import os\n'), ((3728, 3759), 'os.path.exists', 'os.path.exists', (['config_filename'], {}), '(config_filename)\n', (3742, 3759), False, 'import os\n'), ((4397, 4420), 'os.path.exists', 'os.path.e...
import os from PIL import Image import numpy as np import tensorflow as tf import matplotlib.pyplot as plt def read_ct_scan(folder_name): """Read the CT scan image files from directory""" images = [] # Construct path for two image file folders filepaths = [os.path.join(folder_name,file) for file ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "numpy.nan_to_num", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "tensorflow.data.Dataset.from_tensor_slices", "PIL.Image.open", "matplotlib.pyplot.figure", "numpy.array", "tensorflow.image.resize", "os....
[((1033, 1067), 'numpy.array', 'np.array', (['history.history[keys[2]]'], {}), '(history.history[keys[2]])\n', (1041, 1067), True, 'import numpy as np\n'), ((1083, 1117), 'numpy.array', 'np.array', (['history.history[keys[3]]'], {}), '(history.history[keys[3]])\n', (1091, 1117), True, 'import numpy as np\n'), ((1135, 1...
import numpy as np from torchnlp.datasets import imdb_dataset # run pip install pytorch-nlp if you dont have this from tamnun.bert import BertClassifier, BertVectorizer from sklearn.pipeline import make_pipeline from sklearn.metrics import classification_report # Getting data train_data, test_data = imdb_dataset(train...
[ "torchnlp.datasets.imdb_dataset", "tamnun.bert.BertVectorizer", "sklearn.metrics.classification_report", "tamnun.bert.BertClassifier", "numpy.array" ]
[((302, 337), 'torchnlp.datasets.imdb_dataset', 'imdb_dataset', ([], {'train': '(True)', 'test': '(True)'}), '(train=True, test=True)\n', (314, 337), False, 'from torchnlp.datasets import imdb_dataset\n'), ((683, 705), 'numpy.array', 'np.array', (['train_labels'], {}), '(train_labels)\n', (691, 705), True, 'import nump...
import numpy as np import time import sys from ServoMotor import * from fns import * # Initialize motor control library & USB Port filename = "/dev/ttyUSB0" motor = ServoMotor(filename) IO = motor.IO_Init() if IO < 0: print('IO exit') sys.exit() # Call corresponding function to convert sim2real/real2sim def convFns...
[ "numpy.zeros", "time.sleep", "numpy.sin", "numpy.array", "numpy.linspace", "sys.exit" ]
[((2243, 2256), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (2253, 2256), False, 'import time\n'), ((2511, 2524), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (2521, 2524), False, 'import time\n'), ((238, 248), 'sys.exit', 'sys.exit', ([], {}), '()\n', (246, 248), False, 'import sys\n'), ((524, 536), 'nu...
import numpy # ############################################################### # # ############################################################### THRESHOLD = 0.00001 AREA_THRESHOLD = 0.01 def fequal(x1, x2, threshold=THRESHOLD): d = x1 - x2 if d < 0.0: d *= -1.0 if threshold >= d: return...
[ "numpy.sqrt" ]
[((11063, 11116), 'numpy.sqrt', 'numpy.sqrt', (['((x1 - h) * (x1 - h) + (y1 - k) * (y1 - k))'], {}), '((x1 - h) * (x1 - h) + (y1 - k) * (y1 - k))\n', (11073, 11116), False, 'import numpy\n'), ((11289, 11326), 'numpy.sqrt', 'numpy.sqrt', (['(x_diff ** 2 + y_diff ** 2)'], {}), '(x_diff ** 2 + y_diff ** 2)\n', (11299, 113...
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.3.3 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # Materials # # This te...
[ "lmscene.bunny_with_area_light", "lightmetrica.load_renderer", "matplotlib.pyplot.show", "lightmetrica.load_scene", "lightmetrica.load_film", "lightmetrica.progress.init", "numpy.power", "lightmetrica.init", "lightmetrica.load_accel", "lmenv.load", "lightmetrica.info", "matplotlib.pyplot.figur...
[((497, 517), 'lmenv.load', 'lmenv.load', (['""".lmenv"""'], {}), "('.lmenv')\n", (507, 517), False, 'import lmenv\n'), ((681, 690), 'lightmetrica.init', 'lm.init', ([], {}), '()\n', (688, 690), True, 'import lightmetrica as lm\n'), ((691, 713), 'lightmetrica.log.init', 'lm.log.init', (['"""jupyter"""'], {}), "('jupyte...
import face_recognition import cv2 import numpy as np from PIL import Image,ImageDraw import pickle all_face_encodings = {} shah_image = face_recognition.load_image_file("alexa.jpg") np.save("shah",shah_image) shah_encoding = face_recognition.face_encodings(shah_image)[0] np.save("shah-en",shah_encoding) all_fac...
[ "pickle.dump", "numpy.save", "face_recognition.compare_faces", "cv2.cvtColor", "cv2.waitKey", "face_recognition.face_encodings", "cv2.destroyAllWindows", "cv2.imshow", "PIL.ImageDraw.Draw", "numpy.array", "PIL.Image.fromarray", "face_recognition.face_locations", "face_recognition.load_image_...
[((139, 184), 'face_recognition.load_image_file', 'face_recognition.load_image_file', (['"""alexa.jpg"""'], {}), "('alexa.jpg')\n", (171, 184), False, 'import face_recognition\n'), ((185, 212), 'numpy.save', 'np.save', (['"""shah"""', 'shah_image'], {}), "('shah', shah_image)\n", (192, 212), True, 'import numpy as np\n...
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CON...
[ "os.makedirs", "cv2.cvtColor", "os.path.realpath", "numpy.ones", "cv2.transpose", "cv2.flip", "cv2.imread", "numpy.array", "numpy.loadtxt", "cv2.drawContours", "os.path.join" ]
[((944, 957), 'numpy.loadtxt', 'np.loadtxt', (['f'], {}), '(f)\n', (954, 957), True, 'import numpy as np\n'), ((1126, 1139), 'numpy.loadtxt', 'np.loadtxt', (['f'], {}), '(f)\n', (1136, 1139), True, 'import numpy as np\n'), ((1288, 1301), 'numpy.loadtxt', 'np.loadtxt', (['f'], {}), '(f)\n', (1298, 1301), True, 'import n...
import pygame as pg import math import numpy as np _BLACK = (0, 0, 0) _DARK_GRAY = (40, 40, 40) _GRAY = (100, 100, 100) _WHITE = (255, 255, 255) draw_speed = 60 clock = pg.time.Clock() class Cube: def __init__(self, surface, color, position, rotation, scale): self.surface = surface self.color =...
[ "pygame.quit", "math.hypot", "math.atan2", "pygame.event.get", "pygame.display.set_mode", "math.radians", "pygame.init", "pygame.display.flip", "math.sin", "pygame.display.update", "numpy.mean", "numpy.array", "math.cos", "numpy.interp", "pygame.display.set_caption", "pygame.time.Clock...
[((171, 186), 'pygame.time.Clock', 'pg.time.Clock', ([], {}), '()\n', (184, 186), True, 'import pygame as pg\n'), ((3981, 3990), 'pygame.init', 'pg.init', ([], {}), '()\n', (3988, 3990), True, 'import pygame as pg\n'), ((4001, 4053), 'pygame.display.set_mode', 'pg.display.set_mode', (['(display_width, display_height)']...
import torch import torch.autograd from torch.autograd import Variable import torch.optim as optim import torch.nn as nn import numpy as np import scipy as sp import scipy.linalg from qpsolvers import solve_qp from core.DDPG import DDPGagent from core.ConstraintNetwork import ConstraintNetwork class SafeDDPGagent(...
[ "core.ConstraintNetwork.ConstraintNetwork", "scipy.linalg.block_diag", "numpy.zeros", "numpy.ones", "numpy.split", "numpy.linalg.norm", "numpy.eye", "torch.no_grad", "numpy.concatenate", "torch.from_numpy" ]
[((2130, 2145), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2143, 2145), False, 'import torch\n'), ((2551, 2566), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2564, 2566), False, 'import torch\n'), ((3784, 3799), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3797, 3799), False, 'import torch\n')...
import pandas as pd import numpy as np from gamechangerml.src.utilities.text_utils import normalize_answer, normalize_query, get_tokens from gamechangerml.src.utilities.test_utils import * from gamechangerml.configs.config import ValidationConfig, TrainingConfig from gamechangerml.api.utils.logger import logger from ga...
[ "pandas.DataFrame", "gamechangerml.api.utils.logger.logger.info", "gamechangerml.src.utilities.text_utils.normalize_query", "numpy.min", "gamechangerml.src.utilities.test_utils.filter_date_range", "gamechangerml.api.utils.logger.logger.warning", "gamechangerml.src.utilities.text_utils.normalize_answer",...
[((9324, 9350), 'pandas.DataFrame', 'pd.DataFrame', (['self.matched'], {}), '(self.matched)\n', (9336, 9350), True, 'import pandas as pd\n'), ((9375, 9404), 'pandas.DataFrame', 'pd.DataFrame', (['self.mismatched'], {}), '(self.mismatched)\n', (9387, 9404), True, 'import pandas as pd\n'), ((9500, 9536), 'pandas.concat',...
from queue import * from Segmentation import CombinedHist import numpy as np #Thia class is a queuse of histograms class HistQueue: size = 0 added_elements = 0 hist_queue = Queue() total_blue_histr = np.zeros((256,1),dtype = np.float32) total_green_histr = np.zeros((256,1),dtype = np.float32) ...
[ "Segmentation.CombinedHist.CombinedHist", "numpy.zeros" ]
[((219, 255), 'numpy.zeros', 'np.zeros', (['(256, 1)'], {'dtype': 'np.float32'}), '((256, 1), dtype=np.float32)\n', (227, 255), True, 'import numpy as np\n'), ((280, 316), 'numpy.zeros', 'np.zeros', (['(256, 1)'], {'dtype': 'np.float32'}), '((256, 1), dtype=np.float32)\n', (288, 316), True, 'import numpy as np\n'), ((3...