code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np import dp_penalty params = dp_penalty.PenaltyParams( tau = 0.2, prop_sigma = np.repeat(0.008 * 5, 2), r_clip_bound = 3.5, ocu = True, grw = True )
[ "numpy.repeat" ]
[((105, 128), 'numpy.repeat', 'np.repeat', (['(0.008 * 5)', '(2)'], {}), '(0.008 * 5, 2)\n', (114, 128), True, 'import numpy as np\n')]
import numpy as np from cleanlab.pruning import get_noise_indices class ProbaReason: """ Assign doubt based on low proba-confidence values from a scikit-learn model. Arguments: model: scikit-learn classifier max_proba: maximum probability threshold for doubt assignment Usage: ``...
[ "numpy.where", "numpy.sort", "numpy.array", "numpy.linspace", "numpy.random.seed", "cleanlab.pruning.get_noise_indices", "numpy.zeros_like" ]
[((1734, 1766), 'numpy.random.seed', 'np.random.seed', (['self.random_seed'], {}), '(self.random_seed)\n', (1748, 1766), True, 'import numpy as np\n'), ((1828, 1872), 'numpy.where', 'np.where', (['(rvals < self.probability)', 'rvals', '(0)'], {}), '(rvals < self.probability, rvals, 0)\n', (1836, 1872), True, 'import nu...
import numpy as np import tensorflow as tf class spectral_conv_layer(object): def __init__(self, input_x, in_channel, out_channel, kernel_size, random_seed, data_format='NHWC', index=0): """ A convolutional layer with spectrally-parameterized weights. :param input_x: Shou...
[ "tensorflow.nn.conv2d", "tensorflow.glorot_uniform_initializer", "numpy.sqrt", "tensorflow.variable_scope", "tensorflow.transpose", "tensorflow.imag", "tensorflow.ifft2d", "tensorflow.real", "tensorflow.name_scope", "tensorflow.fft2d", "numpy.random.uniform", "tensorflow.nn.bias_add" ]
[((1129, 1156), 'numpy.sqrt', 'np.sqrt', (['(6 / (n_in + n_out))'], {}), '(6 / (n_in + n_out))\n', (1136, 1156), True, 'import numpy as np\n'), ((1176, 1267), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(-limit)', 'high': 'limit', 'size': '(n_in, n_out, kernel_size, kernel_size)'}), '(low=-limit, high=li...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' GOAL Save Arctic ocean temperature - Pacific side (thetao) PROGRAMMER <NAME> LAST UPDATE 29/04/2020 ''' # Standard libraries import numpy as np from netCDF4 import Dataset # Options exp = 'D013' save_var = True start_year = 2130 end_year = 2179 # Time pa...
[ "numpy.arange", "netCDF4.Dataset", "numpy.nanmean", "numpy.zeros", "numpy.save" ]
[((825, 852), 'netCDF4.Dataset', 'Dataset', (['filename'], {'mode': '"""r"""'}), "(filename, mode='r')\n", (832, 852), False, 'from netCDF4 import Dataset\n'), ((1067, 1094), 'netCDF4.Dataset', 'Dataset', (['filename'], {'mode': '"""r"""'}), "(filename, mode='r')\n", (1074, 1094), False, 'from netCDF4 import Dataset\n'...
from scipy.integrate import odeint import matplotlib.pyplot as plt import numpy as np def radial(y, r, m, k, a, l, E): """ Radial ODE with an exponential well φ = dψ/dr dφ/dr = -2φ/r - (2m(E-ke^ar) - (l(l+1)/r^2))ψ :param y: (np.ndarray) First order ODEs --------------------- all in atomic...
[ "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.exp", "numpy.array", "numpy.linspace", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend" ]
[((1002, 1035), 'numpy.linspace', 'np.linspace', (['(0.01)', '(10.0)'], {'num': '(2000)'}), '(0.01, 10.0, num=2000)\n', (1013, 1035), True, 'import numpy as np\n'), ((1184, 1207), 'matplotlib.pyplot.plot', 'plt.plot', (['rs', 'sol[:, 0]'], {}), '(rs, sol[:, 0])\n', (1192, 1207), True, 'import matplotlib.pyplot as plt\n...
#!/usr/bin/env python3 # SPDX-License-Identifier: MIT import sys, pathlib import time sys.path.append(str(pathlib.Path(__file__).resolve().parents[1])) from m1n1.setup import * from m1n1.loadobjs import * import argparse import numpy as np argparser = argparse.ArgumentParser() argparser.add_argument("-d", "--domain",...
[ "argparse.ArgumentParser", "pathlib.Path", "time.sleep", "numpy.count_nonzero", "numpy.concatenate", "sys.exit", "numpy.frombuffer" ]
[((254, 279), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (277, 279), False, 'import argparse\n'), ((634, 645), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (642, 645), False, 'import sys, pathlib\n'), ((1558, 1593), 'numpy.frombuffer', 'np.frombuffer', (['mask'], {'dtype': 'np.uint8'}), ...
""" Demo code To run our method, you need a bounding box around the person. The person needs to be centered inside the bounding box and the bounding box should be relatively tight. You can either supply the bounding box directly or provide an [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab/openpose) detecti...
[ "utils.renderer.Renderer", "numpy.radians", "torch.from_numpy", "numpy.array", "torch.cuda.is_available", "models.hmr", "os.walk", "numpy.mean", "argparse.ArgumentParser", "torch.eye", "numpy.issubdtype", "numpy.dot", "models.SMPL", "numpy.round", "utils.imutils.crop", "os.path.splitex...
[((2034, 2059), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2057, 2059), False, 'import argparse\n'), ((4117, 4153), 'numpy.issubdtype', 'np.issubdtype', (['image.dtype', 'np.float'], {}), '(image.dtype, np.float)\n', (4130, 4153), True, 'import numpy as np\n'), ((7841, 7908), 'torchvision....
import os import re import shutil import configparser import pandas as pd import numpy as np from sklearn.preprocessing import LabelEncoder, LabelBinarizer from download_data import check_folder, remove_folder, read_config separators = {'comma': ',', ',': ',', ', ': ', ', '': ...
[ "pandas.Series", "pandas.isnull", "sklearn.preprocessing.LabelEncoder", "os.listdir", "download_data.remove_folder", "configparser.ConfigParser", "numpy.unique", "download_data.read_config", "sklearn.preprocessing.LabelBinarizer", "os.path.join", "numpy.min", "numpy.array", "os.path.isdir", ...
[((879, 910), 'os.path.isdir', 'os.path.isdir', (['processed_folder'], {}), '(processed_folder)\n', (892, 910), False, 'import os\n'), ((956, 982), 'os.mkdir', 'os.mkdir', (['processed_folder'], {}), '(processed_folder)\n', (964, 982), False, 'import os\n'), ((1031, 1056), 'os.listdir', 'os.listdir', (['config_folder']...
""" Tests for grdtrack. """ import os import numpy as np import numpy.testing as npt import pandas as pd import pytest from pygmt import grdtrack from pygmt.exceptions import GMTInvalidInput from pygmt.helpers import GMTTempFile, data_kind from pygmt.helpers.testing import load_static_earth_relief TEST_DATA_DIR = os....
[ "os.path.exists", "pygmt.helpers.GMTTempFile", "pygmt.helpers.data_kind", "pandas.read_csv", "pygmt.grdtrack", "os.path.join", "os.path.dirname", "numpy.array", "pytest.raises", "pytest.fixture", "numpy.loadtxt", "pygmt.helpers.testing.load_static_earth_relief" ]
[((379, 419), 'os.path.join', 'os.path.join', (['TEST_DATA_DIR', '"""track.txt"""'], {}), "(TEST_DATA_DIR, 'track.txt')\n", (391, 419), False, 'import os\n'), ((423, 471), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'name': '"""dataarray"""'}), "(scope='module', name='dataarray')\n", (437, 471), ...
#! /home/steve/anaconda3/bin/python3.7 import numpy as np train_images = np.load("train_images.npy") padded_train_images = [] print("padding train images") for i in train_images: entry=[] entry.append(np.zeros(32)) entry.append(np.zeros(32)) for j in i: entry.append([0,0]+list(j)+[0,0]) e...
[ "numpy.array", "numpy.zeros", "numpy.load" ]
[((74, 101), 'numpy.load', 'np.load', (['"""train_images.npy"""'], {}), "('train_images.npy')\n", (81, 101), True, 'import numpy as np\n'), ((535, 561), 'numpy.load', 'np.load', (['"""test_images.npy"""'], {}), "('test_images.npy')\n", (542, 561), True, 'import numpy as np\n'), ((486, 515), 'numpy.array', 'np.array', (...
import numpy as np import pandas as pd from scipy.spatial import distance_matrix from sklearn.preprocessing import scale from scipy.stats import linregress from matplotlib import pyplot as plt import os def normalize(a): return np.interp(a, (a.min(), a.max()), (-1, +1)) def plot_diff(x, node, path): x_norm = normal...
[ "pandas.read_csv", "matplotlib.pyplot.ylabel", "numpy.where", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title" ]
[((1418, 1492), 'pandas.read_csv', 'pd.read_csv', (['"""/home/hduser/iit_data/node_clusters/master_clusters_200.csv"""'], {}), "('/home/hduser/iit_data/node_clusters/master_clusters_200.csv')\n", (1429, 1492), True, 'import pandas as pd\n'), ((1505, 1578), 'pandas.read_csv', 'pd.read_csv', (['"""/home/hduser/iit_data/n...
import matplotlib.pyplot as plt import numpy as np from scipy import stats from scipy.stats import spearmanr import scipy import statistics ##################################### #多読図書の誤差 gosa_t = [2.5936085940242886, 0.3649609355211716, -1.5684807178864082, 0.08092297493428235, 0.22543171481307445, -1.3691957161909...
[ "statistics.mean", "scipy.stats.bartlett", "scipy.stats.t.interval", "numpy.array", "scipy.stats.ttest_ind", "scipy.stats.mannwhitneyu", "scipy.stats.shapiro" ]
[((897, 913), 'numpy.array', 'np.array', (['gosa_t'], {}), '(gosa_t)\n', (905, 913), True, 'import numpy as np\n'), ((925, 941), 'numpy.array', 'np.array', (['gosa_i'], {}), '(gosa_i)\n', (933, 941), True, 'import numpy as np\n'), ((1015, 1039), 'scipy.stats.shapiro', 'stats.shapiro', (['tadoku_np'], {}), '(tadoku_np)\...
import pickle import json import argparse import cv2 import os import numpy as np import torch import matplotlib.pyplot as plt import matplotlib.image as mpimg import matplotlib.patches as patches import matplotlib.lines as lines from tqdm import tqdm import _init_paths from core.config import cfg from datasets_rel.p...
[ "matplotlib.pyplot.imshow", "argparse.ArgumentParser", "numpy.where", "matplotlib.pyplot.gca", "pickle.load", "os.path.join", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "os.mkdir", "graphviz.Graph", "matplotlib.pyplot.Rectangle", "matplotlib.pyplot.axis" ]
[((567, 631), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Test a Fast R-CNN network"""'}), "(description='Test a Fast R-CNN network')\n", (590, 631), False, 'import argparse\n'), ((1142, 1154), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1152, 1154), True, 'import mat...
import matplotlib.pyplot as plt import numpy as np import pandas as pd import sklearn.linear_model oecd = pd.read_csv(r'/Users/pariszhang/Desktop/Data/oecd/OECDBLI2017cleanedcsv.csv') life_satisfaction = oecd['Life satisfaction as avg score'] personal_earnings = oecd['Personal earnings in usd'] d = {'Life Satisfacti...
[ "pandas.DataFrame", "numpy.array", "pandas.read_csv" ]
[((107, 183), 'pandas.read_csv', 'pd.read_csv', (['"""/Users/pariszhang/Desktop/Data/oecd/OECDBLI2017cleanedcsv.csv"""'], {}), "('/Users/pariszhang/Desktop/Data/oecd/OECDBLI2017cleanedcsv.csv')\n", (118, 183), True, 'import pandas as pd\n'), ((438, 458), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'd'}), '(data=d...
import math import numpy as np from ... import IntegerProgram, LinearProgram from unittest import TestCase, main class TestRelax(TestCase): def test_relax(self) -> None: A = np.array([ [1, 2, 3, 4], [3, 5, 7, 9] ]) b = np.array([-9, 7]) c = np.array([1, 7, 1...
[ "unittest.main", "numpy.array", "numpy.allclose", "math.isclose" ]
[((1302, 1308), 'unittest.main', 'main', ([], {}), '()\n', (1306, 1308), False, 'from unittest import TestCase, main\n'), ((188, 226), 'numpy.array', 'np.array', (['[[1, 2, 3, 4], [3, 5, 7, 9]]'], {}), '([[1, 2, 3, 4], [3, 5, 7, 9]])\n', (196, 226), True, 'import numpy as np\n'), ((273, 290), 'numpy.array', 'np.array',...
#!/usr/bin/env python """ The Monty Hall problem simulator parameterizable with soops. https://en.wikipedia.org/wiki/Monty_Hall_problem Examples -------- - Direct runs:: python examples/monty_hall.py -h python examples/monty_hall.py output python examples/monty_hall.py --switch output python examples/monty_...
[ "numpy.array", "soops.output", "soops.plot_selected.setup_plot_styles", "soops.parse_as_dict", "itertools.product", "numpy.linspace", "numpy.random.seed", "soops.output.set_output", "soops.ensure_path", "soops.scoop_outputs.get_uniques", "soops.Timer", "matplotlib.pyplot.show", "soops.plot_s...
[((4366, 4456), 'soops.scoop_outputs.get_uniques', 'sc.get_uniques', (['df', "[key for key in data.multi_par_keys if key not in ['output_dir']]"], {}), "(df, [key for key in data.multi_par_keys if key not in [\n 'output_dir']])\n", (4380, 4456), True, 'import soops.scoop_outputs as sc\n'), ((4490, 4517), 'soops.outp...
""" Created on 08 Okt. 2021 @author: <NAME> This example shows how you can use MiP-EGO in order to perform hyper-parameter optimization for machine learning tasks. """ #import packages from sklearn.datasets import load_iris from sklearn.svm import SVC from sklearn.model_selection import cross_val_score, KFold import...
[ "sklearn.datasets.load_iris", "mipego.ParallelBO", "sklearn.svm.SVC", "numpy.mean", "mipego.SearchSpace.NominalSpace", "sklearn.model_selection.cross_val_score", "mipego.SearchSpace.ContinuousSpace", "sklearn.model_selection.KFold", "mipego.Surrogate.RandomForest", "mipego.SearchSpace.OrdinalSpace...
[((578, 589), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (587, 589), False, 'from sklearn.datasets import load_iris\n'), ((811, 844), 'mipego.SearchSpace.ContinuousSpace', 'ContinuousSpace', (['[1.0, 20.0]', '"""C"""'], {}), "([1.0, 20.0], 'C')\n", (826, 844), False, 'from mipego.SearchSpace import Co...
""" ========= Plot Mesh ========= This example shows how to load an STL mesh. This example must be run from within the main folder because it uses a hard-coded path to the STL file. """ print(__doc__) import os import numpy as np import matplotlib.pyplot as plt from pytransform3d.transformations import plot_transfor...
[ "os.path.exists", "numpy.eye", "numpy.ones", "os.path.join", "os.path.dirname", "matplotlib.pyplot.show" ]
[((785, 795), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (793, 795), True, 'import matplotlib.pyplot as plt\n'), ((553, 584), 'os.path.join', 'os.path.join', (['search_path', '""".."""'], {}), "(search_path, '..')\n", (565, 584), False, 'import os\n'), ((600, 635), 'os.path.join', 'os.path.join', (['search...
""" Code based on random_transform in keras.processing.image from 2016. (https://github.com/fchollet/keras) Keras copyright: All contributions by <NAME>: Copyright (c) 2015, <NAME>. All contributions by Google: Copyright (c) 2015, Google, Inc. All contributions by Microsoft: Copyright (c) 2017, Microsoft, Inc. All oth...
[ "SimpleITK.BSplineTransformInitializer", "numpy.rollaxis", "numpy.array", "os.cpu_count", "numpy.moveaxis", "numpy.sin", "numpy.random.RandomState", "numpy.isscalar", "numpy.asarray", "SimpleITK.GetArrayFromImage", "numpy.max", "numpy.stack", "numpy.dot", "numpy.min", "numpy.abs", "num...
[((964, 975), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (972, 975), True, 'import numpy as np\n'), ((1970, 1998), 'numpy.ndindex', 'np.ndindex', (['x_arr.shape[:-3]'], {}), '(x_arr.shape[:-3])\n', (1980, 1998), True, 'import numpy as np\n'), ((8003, 8026), 'numpy.isscalar', 'np.isscalar', (['zoom_range'], {}), '...
import wx import matplotlib.cm import numpy as np from . import properties slider_width = 30 s_off = slider_width/2 class ColorBarPanel(wx.Panel): ''' A HORIZONTAL color bar and value axis drawn on a panel. ''' def __init__(self, parent, map, local_extents=[0.,1.], global_extents=None, ...
[ "wx.Button", "wx.PaintDC", "numpy.ones", "numpy.hstack", "numpy.array", "wx.MenuItem", "numpy.zeros", "wx.Pen", "wx.Menu", "wx.Panel.__init__", "numpy.arange" ]
[((775, 816), 'wx.Panel.__init__', 'wx.Panel.__init__', (['self', 'parent'], {}), '(self, parent, **kwargs)\n', (792, 816), False, 'import wx\n'), ((904, 966), 'wx.Button', 'wx.Button', (['self', '(-1)', '"""["""'], {'pos': '(0, -1)', 'size': '(slider_width, -1)'}), "(self, -1, '[', pos=(0, -1), size=(slider_width, -1)...
import cv2 import numpy as np import os import glob from random import shuffle #from tqdm import tqdm import os, fnmatch import torch from torch import autograd, nn, optim import torch.nn.functional as F from time import time #input = autograd.Variable(torch.rand(batch_size, input_size))-0.5 #target = autograd.Variab...
[ "cv2.imread", "random.shuffle", "torch.nn.functional.nll_loss", "os.walk", "os.path.join", "torch.nn.Conv2d", "torch.tensor", "numpy.array", "fnmatch.fnmatch", "torch.nn.Linear", "cv2.resize", "torch.autograd.Variable", "time.time", "numpy.save", "numpy.load" ]
[((760, 778), 'os.walk', 'os.walk', (['directory'], {}), '(directory)\n', (767, 778), False, 'import os, fnmatch\n'), ((1513, 1532), 'random.shuffle', 'shuffle', (['train_data'], {}), '(train_data)\n', (1520, 1532), False, 'from random import shuffle\n'), ((1537, 1574), 'numpy.save', 'np.save', (['"""train_data.npy"""'...
from csdl import Model import csdl import numpy as np class ExampleScalarRotX(Model): """ :param var: scalar :param var: scalar_Rot_x """ def define(self): angle_val3 = np.pi / 3 angle_scalar = self.declare_variable('scalar', val=angle_val3) # Rotation in the x-axis for s...
[ "numpy.prod", "csdl.rotmat", "numpy.repeat", "numpy.arange" ]
[((1112, 1126), 'numpy.prod', 'np.prod', (['shape'], {}), '(shape)\n', (1119, 1126), True, 'import numpy as np\n'), ((1744, 1758), 'numpy.prod', 'np.prod', (['shape'], {}), '(shape)\n', (1751, 1758), True, 'import numpy as np\n'), ((371, 406), 'csdl.rotmat', 'csdl.rotmat', (['angle_scalar'], {'axis': '"""x"""'}), "(ang...
"""Sets a consistent plotting settings across the project. Example: Usage with simple plots:: from src.plot_settings import ( ps_defaults, label_subplots, get_dim, set_dim, PALETTE, STD_CLR_LIST, CAM_BLUE, BRIC...
[ "itertools.cycle", "distutils.spawn.find_executable", "matplotlib.rcParams.update", "seaborn.color_palette", "matplotlib.use", "numpy.asarray", "matplotlib.style.use" ]
[((7616, 7647), 'seaborn.color_palette', 'sns.color_palette', (['STD_CLR_LIST'], {}), '(STD_CLR_LIST)\n', (7633, 7647), True, 'import seaborn as sns\n'), ((7719, 7749), 'itertools.cycle', 'itertools.cycle', (['_paper_colors'], {}), '(_paper_colors)\n', (7734, 7749), False, 'import itertools\n'), ((2677, 2714), 'matplot...
import numpy as np import cv2 from flask import Flask from flask import jsonify from flask import request from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker,relationship,scoped_session from flask_sqlalchemy_session import flask_scoped_session from sqlalchemy import create_e...
[ "dateutil.parser.parse", "sqlalchemy.orm.sessionmaker", "flask.Flask", "flask.jsonify", "sqlalchemy.create_engine", "cv2.imdecode", "sqlalchemy.ext.declarative.declarative_base", "numpy.fromstring", "sqlalchemy.Column", "ripeness_predictor.is_ripe" ]
[((457, 472), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (462, 472), False, 'from flask import Flask\n'), ((480, 498), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (496, 498), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((565, 598), 'sqla...
import contextlib import logging import rasterio.crs import rasterio.vrt import rasterio.windows import affine import numpy as np import xarray as xr logger = logging.getLogger(__name__) CRS_WGS = rasterio.crs.CRS({'init': 'epsg:4326'}) def _datasets_are_congruent(datasets): """Determine whether datasets are c...
[ "logging.getLogger", "numpy.where", "numpy.ma.zeros", "xarray.Dataset", "numpy.any", "numpy.sum", "contextlib.ExitStack", "affine.Affine", "xarray.DataArray", "numpy.full", "numpy.arange" ]
[((161, 188), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (178, 188), False, 'import logging\n'), ((5016, 5057), 'affine.Affine', 'affine.Affine', (["*ds.attrs['transform'][:6]"], {}), "(*ds.attrs['transform'][:6])\n", (5029, 5057), False, 'import affine\n'), ((5444, 5476), 'xarray.Dat...
from tpot import TPOTRegressor from tpot import TPOTClassifier from sklearn.model_selection import train_test_split import numpy as np from models.classes import prepare as prepare from models.classes import randomforest as randomforest from models.classes import randomforestc as randomforestc from sklearn.metrics.scor...
[ "pandas.DataFrame", "models.classes.prepare.cleanSMILES", "timeit.default_timer", "models.classes.prepare.partition", "models.classes.prepare.createdescriptors", "json.load", "numpy.max", "tpot.TPOTClassifier", "os.mkdir", "numpy.min", "sklearn.metrics.scorer.make_scorer", "sklearn.metrics.r2_...
[((1386, 1576), 'models.classes.prepare.isolate', 'prepare.isolate', ([], {'structname': "datastore['column_SMILES']['content']", 'activityname': "datastore['column_activity']['content']", 'filelocation': 'filename', 'chemID': "datastore['chemID']['content']"}), "(structname=datastore['column_SMILES']['content'],\n ...
import numpy as np import pandas as pd import matplotlib.pyplot as plt aux = { 'get_server': 'Get server delay', 'start_session': 'Start session delay', 'stop_session': 'Stop session delay', 'srv_request': 'Service request delay', } def plot_ue_service_delay(time, delay, ue_id=None, service_id=None,...
[ "numpy.mean", "pandas.read_csv", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.max", "numpy.sum", "numpy.zeros", "matplotlib.pyplot.title", "matplotlib.pyplot.step", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((385, 407), 'matplotlib.pyplot.plot', 'plt.plot', (['time', 'delay_'], {}), '(time, delay_)\n', (393, 407), True, 'import matplotlib.pyplot as plt\n'), ((412, 447), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""time [s]"""'], {'fontsize': '(12)'}), "('time [s]', fontsize=12)\n", (422, 447), True, 'import matplotlib...
''' Keep track of document and topic priors. Gradient updates performed by Theano. <NAME> ''' from functools import reduce from scipy.special import digamma import theano from theano import config import theano.tensor as T import numpy as np import mlp, opt from _sample import _loglikelihood_marginalizeTopics ...
[ "numpy.random.normal", "mlp.MLP", "theano.shared", "theano.tensor.psi", "theano.function", "numpy.ones", "theano.tensor.sum", "theano.tensor.matrix", "opt.AdadeltaOptimizer", "numpy.array", "numpy.zeros", "theano.tensor.cast", "theano.tensor.set_subtensor", "opt.SGDOptimizer", "theano.te...
[((17220, 17241), 'numpy.zeros', 'np.zeros', (['(Cin, Cout)'], {}), '((Cin, Cout))\n', (17228, 17241), True, 'import numpy as np\n'), ((17776, 17792), 'numpy.zeros', 'np.zeros', (['(Z, W)'], {}), '((Z, W))\n', (17784, 17792), True, 'import numpy as np\n'), ((18017, 18044), 'opt.AdadeltaOptimizer', 'opt.AdadeltaOptimize...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 <NAME> # # 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/L...
[ "os.path.exists", "numpy.fromstring" ]
[((754, 778), 'os.path.exists', 'os.path.exists', (['filename'], {}), '(filename)\n', (768, 778), False, 'import os\n'), ((893, 932), 'numpy.fromstring', 'np.fromstring', (['img_bytes'], {'dtype': '"""uint8"""'}), "(img_bytes, dtype='uint8')\n", (906, 932), True, 'import numpy as np\n')]
#Imports from scipy.stats import linregress import matplotlib.pyplot as plt import numpy as np import random import sys from math import * from PrimesArray import primes na = np.array #Collatz Function def c(n): if n % 2 == 0: return n / 2 else: return 3 * n + 1 #Collatz Seq...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.array", "random.random", "matplotlib.pyplot.title", "sys.stdout.flush", "sys.stdout.write" ]
[((1410, 1432), 'sys.stdout.write', 'sys.stdout.write', (['text'], {}), '(text)\n', (1426, 1432), False, 'import sys\n'), ((1438, 1456), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (1454, 1456), False, 'import sys\n'), ((2462, 2500), 'matplotlib.pyplot.title', 'plt.title', (['"""Collatz of 2*n +1 numbers"...
from torch.nn import Sequential, Linear, ReLU, GRU from torch_geometric.data import Dataset, Data, DataLoader # from torch_geometric.datasets import QM9 from torch_geometric.nn import NNConv, Set2Set from torch.nn import BCELoss, BCEWithLogitsLoss from torch_geometric.utils import remove_self_loops import numpy as np...
[ "sklearn.metrics.precision_score", "sklearn.metrics.recall_score", "torch.cuda.is_available", "torch.arange", "matrixFormation.oneHotEncoder", "torch.utils.tensorboard.SummaryWriter", "itertools.chain.from_iterable", "torch_geometric.utils.remove_self_loops", "baseLineModel.Net", "numpy.random.see...
[((1750, 1791), 'matrixFormation.oneHotEncoder', 'oneHotEncoder', (['astOfProgram', 'languageType'], {}), '(astOfProgram, languageType)\n', (1763, 1791), False, 'from matrixFormation import oneHotEncoder, adjacencyMatrixCreator\n'), ((1823, 1859), 'matrixFormation.adjacencyMatrixCreator', 'adjacencyMatrixCreator', (['a...
import context # Remove this import if running with pip installed version. from pypsqueak.api import qReg, qOp from pypsqueak.gates import X, Z, I, ROT_Y, CNOT from pypsqueak.noise import b_flip_map import numpy as np import sys if len(sys.argv) > 1 and int(sys.argv[1]) > 0: n_trials = int(sys.argv[1]) else: ...
[ "pypsqueak.api.qReg", "pypsqueak.gates.ROT_Y", "numpy.eye", "pypsqueak.gates.CNOT.on", "numpy.sqrt", "pypsqueak.gates.I.kron", "pypsqueak.gates.X.on", "pypsqueak.noise.b_flip_map", "pypsqueak.gates.Z.kron" ]
[((603, 612), 'numpy.eye', 'np.eye', (['(2)'], {}), '(2)\n', (609, 612), True, 'import numpy as np\n'), ((934, 940), 'pypsqueak.api.qReg', 'qReg', ([], {}), '()\n', (938, 940), False, 'from pypsqueak.api import qReg, qOp\n'), ((1808, 1815), 'pypsqueak.api.qReg', 'qReg', (['(1)'], {}), '(1)\n', (1812, 1815), False, 'fro...
# -*- coding: utf-8 -*- """ triangulate =========== Script : triangulate.py Author : <EMAIL> Modified : 2018-08-24 Purpose: triangulate poly* features Useage : References ---------- `<http://pro.arcgis.com/en/pro-app/arcpy/data-access/numpyarraytotable.htm>`_. `<http://pro.arcgis.com/en/pro...
[ "numpy.mean", "arcpy.CopyFeatures_management", "arcpy.management.SelectLayerByLocation", "numpy.unique", "arcpy.MakeFeatureLayer_management", "numpy.where", "arcpytools_plt.fc_info", "numpy.set_printoptions", "arcpy.Point", "arcpy.da.SearchCursor", "arcpy.Polygon", "numpy.array", "arcpy.Exis...
[((870, 978), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'edgeitems': '(10)', 'linewidth': '(80)', 'precision': '(2)', 'suppress': '(True)', 'threshold': '(100)', 'formatter': 'ft'}), '(edgeitems=10, linewidth=80, precision=2, suppress=True,\n threshold=100, formatter=ft)\n', (889, 978), True, 'import nu...
import pandas as pd import numpy as np from sklearn import tree from sklearn.externals.six import StringIO from IPython.display import Image, display from sklearn.tree import export_graphviz import pydotplus import matplotlib.pyplot as plt import matplotlib.image as mpimg def remap_data(data_row,values) : row_val...
[ "pandas.Series", "matplotlib.pyplot.imshow", "numpy.int64", "pandas.read_csv", "sklearn.tree.DecisionTreeClassifier", "matplotlib.image.imread", "sklearn.tree.export_graphviz", "sklearn.externals.six.StringIO", "matplotlib.pyplot.show" ]
[((942, 978), 'pandas.read_csv', 'pd.read_csv', (['"""../../input/train.csv"""'], {}), "('../../input/train.csv')\n", (953, 978), True, 'import pandas as pd\n'), ((1484, 1513), 'pandas.Series', 'pd.Series', (['embarked_row_value'], {}), '(embarked_row_value)\n', (1493, 1513), True, 'import pandas as pd\n'), ((1736, 176...
""" Random table generator module. """ from collections import OrderedDict import logging import numpy as np from ..utils.errors import ProgressiveError, ProgressiveStopIteration from ..table.module import TableModule from ..table.table import Table from ..table.constant import Constant from ..utils.psdict import Ps...
[ "logging.getLogger", "collections.OrderedDict", "numpy.random.rand", "numpy.min" ]
[((374, 401), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (391, 401), False, 'import logging\n'), ((2141, 2154), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2152, 2154), False, 'from collections import OrderedDict\n'), ((2730, 2753), 'numpy.random.rand', 'np.random.ran...
import contextlib import os import pickle import sys import time from collections import Counter from pathlib import Path from typing import Dict, List, Optional, Union import joblib import numpy as np import pandas as pd import rdkit.Chem as Chem import rdkit.Chem.AllChem as AllChem from joblib import Parallel, delay...
[ "numpy.argsort", "os.cpu_count", "pathlib.Path", "rdkit.Chem.MolToSmiles", "rdchiral.main.rdchiralRun", "pandas.DataFrame", "rdchiral.main.rdchiralReaction", "rdchiral.main.rdchiralReactants", "pickle.load", "rdkit.DataStructs.BulkTverskySimilarity", "rdkit.DataStructs.BulkDiceSimilarity", "rx...
[((1573, 1599), 'rdkit.Chem.MolFromSmiles', 'Chem.MolFromSmiles', (['smiles'], {}), '(smiles)\n', (1591, 1599), True, 'import rdkit.Chem as Chem\n'), ((1671, 1708), 'rdkit.Chem.MolToSmiles', 'Chem.MolToSmiles', (['mol', 'isomericSmiles'], {}), '(mol, isomericSmiles)\n', (1687, 1708), True, 'import rdkit.Chem as Chem\n'...
# Copyright 2018 Google LLC # # 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 writing, ...
[ "numpy.mean", "numpy.abs", "numpy.median", "numpy.asarray", "moonlight.structure.barlines.assign_barlines_to_staves" ]
[((2920, 3116), 'moonlight.structure.barlines.assign_barlines_to_staves', 'barlines.assign_barlines_to_staves', ([], {'barline_x': 'component_center_x', 'barline_y0': 'self.components[:, COLUMNS.Y0]', 'barline_y1': 'self.components[:, COLUMNS.Y1]', 'staff_detector': 'self.staff_detector'}), '(barline_x=component_center...
from gym import spaces import numpy as np from pettingzoo.utils.env import ParallelEnv from pettingzoo.utils.agent_selector import agent_selector from gym.utils import seeding from gym import spaces from pettingzoo.utils import wrappers def make_env(raw_env): def env(**kwargs): env = raw_env(**kwargs) ...
[ "pettingzoo.utils.wrappers.NanNoOpWrapper", "pettingzoo.utils.wrappers.OrderEnforcingWrapper", "pettingzoo.utils.wrappers.AssertOutOfBoundsWrapper", "gym.spaces.Discrete", "gym.spaces.Box", "numpy.array", "numpy.zeros", "numpy.concatenate" ]
[((331, 369), 'pettingzoo.utils.wrappers.AssertOutOfBoundsWrapper', 'wrappers.AssertOutOfBoundsWrapper', (['env'], {}), '(env)\n', (364, 369), False, 'from pettingzoo.utils import wrappers\n'), ((460, 506), 'pettingzoo.utils.wrappers.NanNoOpWrapper', 'wrappers.NanNoOpWrapper', (['env', '(4)', 'backup_policy'], {}), '(e...
import os import julian import datetime import math import pandas as pd import numpy as np from numpy import * import pickle from sklearn.model_selection import train_test_split from sklearn.decomposition import PCA import matplotlib.pyplot as plt import warnings from sklearn.cluster import KMeans import matplotlib.col...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.ylabel", "numpy.sin", "numpy.arange", "pandas.read_pickle", "numpy.where", "sklearn.decomposition.PCA", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.asarray", "numpy.linspace", "mpl_toolkits.axes_grid1.make_axes_locatable", "numpy....
[((813, 846), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (836, 846), False, 'import warnings\n'), ((2614, 2654), 'pandas.read_pickle', 'pd.read_pickle', (["(root + '\\\\data\\\\' + file)"], {}), "(root + '\\\\data\\\\' + file)\n", (2628, 2654), True, 'import pandas as ...
from abc import ABC, abstractmethod import numpy as np from .activations import NoActivation from .constants import EPSILON from .initializers import Constant from .optimizers import Momentum class Layer(ABC): @abstractmethod def init_weights(self, num_input, optimizer, initializer): pass @abstrac...
[ "numpy.mean", "numpy.sqrt", "numpy.square", "numpy.sum", "numpy.dot", "numpy.full" ]
[((1232, 1250), 'numpy.mean', 'np.mean', (['z'], {'axis': '(0)'}), '(z, axis=0)\n', (1239, 1250), True, 'import numpy as np\n'), ((1706, 1752), 'numpy.sum', 'np.sum', (['(self._z_norm * last_derivative)'], {'axis': '(0)'}), '(self._z_norm * last_derivative, axis=0)\n', (1712, 1752), True, 'import numpy as np\n'), ((176...
import tensorflow as tf import numpy as np class MultiHeadSelfAttention(tf.keras.layers.Layer): def __init__(self, emb_dim = 768, n_head = 12, out_dim = None, relative_window_size = None, dropout_rate = 0., kernel_initializer = tf.keras.initializers.RandomNormal(mean = 0, stddev = 0.01), **kwargs): #Scaled...
[ "tensorflow.equal", "tensorflow.shape", "tensorflow.keras.backend.epsilon", "tensorflow.transpose", "numpy.sqrt", "tensorflow.keras.layers.Dense", "tensorflow.nn.dropout", "tensorflow.nn.softmax", "tensorflow.cast", "numpy.arange", "tensorflow.keras.layers.Input", "numpy.reshape", "tensorflo...
[((12137, 12206), 'tensorflow.keras.layers.Input', 'tf.keras.layers.Input', ([], {'shape': '(None,)', 'name': '"""y_true"""', 'dtype': 'tf.float32'}), "(shape=(None,), name='y_true', dtype=tf.float32)\n", (12158, 12206), True, 'import tensorflow as tf\n'), ((12600, 12630), 'tensorflow.cast', 'tf.cast', (['_y_true', 'lo...
# -*- coding: utf-8 -*- import numpy as np import taft import shelve from network import Network from calcdata import CalcData import utils # Переменная для записи сообщений о ошибках logMessage = "" def getLastError(): global logMessage return logMessage # end of def getLastError() # Загружает веса сети и...
[ "utils.createScale", "taft.normalize", "numpy.max", "network.Network", "numpy.array", "numpy.zeros", "shelve.open", "taft.readFinam", "numpy.min", "numpy.shape" ]
[((4293, 4326), 'numpy.array', 'np.array', (['nnInputs'], {'dtype': '"""float"""'}), "(nnInputs, dtype='float')\n", (4301, 4326), True, 'import numpy as np\n'), ((4359, 4377), 'numpy.shape', 'np.shape', (['nnInputs'], {}), '(nnInputs)\n', (4367, 4377), True, 'import numpy as np\n'), ((4395, 4428), 'numpy.array', 'np.ar...
from typing import Protocol import numpy as np class EmissionFunction(Protocol): def __call__( self, distance_to_shell: np.ndarray, observer_position: np.ndarray, earth_position: np.ndarray, unit_vectors: np.ndarray, freq: float, ) -> np.ndarray: """Int...
[ "numpy.zeros", "numpy.diff" ]
[((1698, 1723), 'numpy.diff', 'np.diff', (['radial_distances'], {}), '(radial_distances)\n', (1705, 1723), True, 'import numpy as np\n'), ((1751, 1783), 'numpy.zeros', 'np.zeros', (['unit_vectors.shape[-1]'], {}), '(unit_vectors.shape[-1])\n', (1759, 1783), True, 'import numpy as np\n')]
""" Draw Figures - Chapter 4 This script generates all of the figures that appear in Chapter 4 of the textbook. Ported from MATLAB Code <NAME> 24 March 2021 """ import utils from utils.unit_conversions import lin_to_db, db_to_lin import matplotlib.pyplot as plt from matplotlib.patches import Ellipse import numpy as...
[ "matplotlib.pyplot.grid", "numpy.sqrt", "numpy.random.default_rng", "examples.chapter4.example2", "matplotlib.pyplot.ylabel", "numpy.array", "utils.unit_conversions.lin_to_db", "scipy.stats.chi2.ppf", "detector.xcorr.det_test", "numpy.arange", "seaborn.set", "detector.squareLaw.det_test", "s...
[((801, 822), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['"""tab10"""'], {}), "('tab10')\n", (813, 822), True, 'import matplotlib.pyplot as plt\n'), ((901, 925), 'numpy.random.default_rng', 'np.random.default_rng', (['(0)'], {}), '(0)\n', (922, 925), True, 'import numpy as np\n'), ((972, 1005), 'utils.init_output_...
### Code Adapted From <NAME> Kaggle Submission: https://www.kaggle.com/shayantaherian/nfl-training-fasterrcnn # Import Packages import pandas as pd import numpy as np from matplotlib import pyplot as plt from matplotlib import patches import imageio from tqdm import tqdm_notebook as tqdm from tqdm import tqdm from ...
[ "numpy.uint8", "torch.as_tensor", "pandas.read_csv", "matplotlib.pyplot.ylabel", "torch.cuda.is_available", "numpy.moveaxis", "torch.cuda.memory_summary", "numpy.mean", "os.listdir", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "albumentations.pytorch.transforms.ToTensorV2", "torch....
[((3411, 3480), 'torchvision.models.detection.fasterrcnn_resnet50_fpn', 'torchvision.models.detection.fasterrcnn_resnet50_fpn', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (3463, 3480), False, 'import torchvision\n'), ((3750, 3793), 'torchvision.models.detection.faster_rcnn.FastRCNNPredictor', 'FastRCNNPredi...
from __future__ import annotations from collections import namedtuple from copy import deepcopy from typing import Dict, List, Optional, Tuple, Union import numpy as np from numpy.typing import ArrayLike, NDArray from simweights.powerlaw import PowerLaw from simweights.spatial import SpatialDist from .pdgcode impor...
[ "collections.namedtuple", "numpy.unique", "numpy.asarray", "numpy.any", "numpy.isfinite", "copy.deepcopy", "numpy.zeros_like" ]
[((346, 425), 'collections.namedtuple', 'namedtuple', (['"""SurfaceTuple"""', "['pdgid', 'nevents', 'energy_dist', 'spatial_dist']"], {}), "('SurfaceTuple', ['pdgid', 'nevents', 'energy_dist', 'spatial_dist'])\n", (356, 425), False, 'from collections import namedtuple\n'), ((1557, 1571), 'copy.deepcopy', 'deepcopy', ([...
from calendar import timegm from datetime import datetime from ephem import Moon, Observer, constellation, next_full_moon, next_new_moon from numpy import rad2deg from app.business.astronomy.planets.models import Planet, PlanetType, SolarSystem class ObserverBuilder: def __init__(self, latitude: str, longitude:...
[ "ephem.Observer", "datetime.datetime.utcnow", "app.business.astronomy.planets.models.Planet", "ephem.next_new_moon", "ephem.constellation", "ephem.next_full_moon", "numpy.rad2deg", "app.business.astronomy.planets.models.SolarSystem" ]
[((496, 506), 'ephem.Observer', 'Observer', ([], {}), '()\n', (504, 506), False, 'from ephem import Moon, Observer, constellation, next_full_moon, next_new_moon\n'), ((1502, 1516), 'app.business.astronomy.planets.models.Planet', 'Planet', ([], {}), '(**data)\n', (1508, 1516), False, 'from app.business.astronomy.planets...
# Copyright 2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
[ "numpy.allclose", "pytest.mark.parametrize", "numpy.array", "math.cosh", "math.sinh" ]
[((688, 735), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""phi"""', '[0.1, 0.2, 0.3]'], {}), "('phi', [0.1, 0.2, 0.3])\n", (711, 735), False, 'import pytest\n'), ((1186, 1225), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n"""', '[1, 2, 3]'], {}), "('n', [1, 2, 3])\n", (1209, 1225), False,...
import numpy as np def computeCostMulti(X, y, theta): """ computes the cost of using theta as the parameter for linear regression to fit the data points in X and y """ m = y.size J = 0. # ====================== YOUR CODE HERE ====================== # Instructions: Compute the co...
[ "numpy.dot" ]
[((396, 418), 'numpy.dot', 'np.dot', (['X[i, :]', 'theta'], {}), '(X[i, :], theta)\n', (402, 418), True, 'import numpy as np\n')]
import torch import numpy as np from hparams import create_hparams as hps def mode(obj, model = False): if model and hps.is_cuda: obj = obj.cuda() elif hps.is_cuda: obj = obj.cuda(non_blocking = hps.pin_mem) return obj def to_arr(var): return var.cpu().detach().numpy().astype(np.float32) def get_mask_from_le...
[ "librosa.istft", "numpy.clip", "numpy.abs", "pydub.AudioSegment.empty", "numpy.linalg.pinv", "numpy.random.rand", "numpy.power", "torch.LongTensor", "torch.max", "numpy.max", "numpy.dot", "scipy.signal.lfilter", "scipy.io.wavfile.read", "librosa.filters.mel", "librosa.stft", "numpy.max...
[((849, 867), 'scipy.io.wavfile.read', 'wavfile.read', (['path'], {}), '(path)\n', (861, 867), False, 'from scipy.io import wavfile\n'), ((1239, 1290), 'scipy.signal.lfilter', 'scipy.signal.lfilter', (['[1, -hps.preemphasis]', '[1]', 'x'], {}), '([1, -hps.preemphasis], [1], x)\n', (1259, 1290), False, 'import scipy\n')...
import numpy as np import torch as torch import numpy as np import torch as torch from scipy.interpolate import griddata import torch.nn.functional as F import torch.nn as nn # import audtorch import piq def calculate_CC_metrics(pred, gt): """ Calculate CC Metrics :param pred: :param gt: :return: ...
[ "torch.nn.functional.grid_sample", "torch.nn.functional.l1_loss", "torch.nn.functional.mse_loss", "numpy.corrcoef", "torch.unsqueeze", "scipy.interpolate.griddata", "piq.multi_scale_ssim", "torch.from_numpy", "numpy.stack", "numpy.zeros", "numpy.argwhere", "numpy.isnan", "numpy.expand_dims",...
[((1740, 1757), 'numpy.argwhere', 'np.argwhere', (['mask'], {}), '(mask)\n', (1751, 1757), True, 'import numpy as np\n'), ((1810, 1824), 'numpy.arange', 'np.arange', (['(256)'], {}), '(256)\n', (1819, 1824), True, 'import numpy as np\n'), ((1833, 1847), 'numpy.arange', 'np.arange', (['(256)'], {}), '(256)\n', (1842, 18...
import argparse import os import numpy as np import sys import json from os import listdir import csv from os.path import isfile, join from face_network import create_face_network import cv2 import argparse from keras.optimizers import Adam, SGD from keras.models import load_model from emotion_model import * from u...
[ "cv2.rectangle", "tensorflow.local_variables_initializer", "numpy.array", "tensorflow.reverse_v2", "tensorflow.nn.softmax", "utils.preprocessor.preprocess_input", "imutils.face_utils.FaceAligner", "tensorflow.Graph", "os.listdir", "numpy.float64", "utils.inference.detect_faces", "tensorflow.Se...
[((12651, 12693), 'utils.inference.load_detection_model', 'load_detection_model', (['detection_model_path'], {}), '(detection_model_path)\n', (12671, 12693), False, 'from utils.inference import load_detection_model\n'), ((12719, 12764), 'keras.models.load_model', 'load_model', (['emotion_model_path'], {'compile': '(Fal...
# Copyright (c) 2019 Alibaba Inc. 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 applicable law...
[ "numpy.ones", "gym.spaces.Discrete", "easy_rl.utils.window_stat.WindowStat", "numpy.zeros", "numpy.random.seed", "numpy.random.uniform" ]
[((1330, 1347), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1344, 1347), True, 'import numpy as np\n'), ((2301, 2325), 'easy_rl.utils.window_stat.WindowStat', 'WindowStat', (['"""reward"""', '(50)'], {}), "('reward', 50)\n", (2311, 2325), False, 'from easy_rl.utils.window_stat import WindowStat\n'),...
import cv2 import numpy as np from PIL import ImageGrab from mss import mss import SendKeys import time from datetime import datetime cod = [] accel = 170 counta = 0 def findDino(): time.sleep(3) dinoimg = cv2.imread('dino.png', 0) w, h = dinoimg.shape[::-1] img = ImageGrab.grab() imgcv = cv2.cvt...
[ "cv2.countNonZero", "mss.mss", "cv2.threshold", "SendKeys.SendKeys", "PIL.ImageGrab.grab", "time.sleep", "cv2.minMaxLoc", "numpy.array", "datetime.datetime.now", "cv2.cvtColor", "cv2.matchTemplate", "cv2.imread" ]
[((188, 201), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (198, 201), False, 'import time\n'), ((216, 241), 'cv2.imread', 'cv2.imread', (['"""dino.png"""', '(0)'], {}), "('dino.png', 0)\n", (226, 241), False, 'import cv2\n'), ((284, 300), 'PIL.ImageGrab.grab', 'ImageGrab.grab', ([], {}), '()\n', (298, 300), Fal...
# <NAME> CPSC 479 SEC 1 # This is the main python file containing the K-nearest neighbor classifier # Import libraries import numpy as np import pandas as pd from mpi4py import MPI # MPI_Init() automatically called when you import MPI from library from math import sqrt, ceil # Distance function returns Euclidea...
[ "numpy.sort", "math.sqrt", "pandas.read_csv" ]
[((508, 522), 'math.sqrt', 'sqrt', (['distance'], {}), '(distance)\n', (512, 522), False, 'from math import sqrt, ceil\n'), ((872, 903), 'pandas.read_csv', 'pd.read_csv', (['"""training_set.csv"""'], {}), "('training_set.csv')\n", (883, 903), True, 'import pandas as pd\n'), ((1012, 1042), 'pandas.read_csv', 'pd.read_cs...
"""Simple example wrapper for basic usage of vis_cpu.""" import numpy as np from pyuvdata.uvbeam import UVBeam from . import conversions, vis_cpu def simulate_vis( ants, fluxes, ra, dec, freqs, lsts, beams, pixel_beams=False, beam_npix=63, polarized=False, precision=1, ...
[ "numpy.array", "numpy.zeros" ]
[((3839, 3857), 'numpy.array', 'np.array', (['beam_pix'], {}), '(beam_pix)\n', (3847, 3857), True, 'import numpy as np\n'), ((4077, 4165), 'numpy.zeros', 'np.zeros', (['(naxes, nfeeds, freqs.size, lsts.size, nants, nants)'], {'dtype': 'complex_dtype'}), '((naxes, nfeeds, freqs.size, lsts.size, nants, nants), dtype=\n ...
import Dataset_Generator as dg import Evaluation as eval import Plot_Graph as ploter hd_dataset = dg.get_hd_dataset(5000) reduced_hd = eval.pca_dim_reduction(hd_dataset, 3) ploter.plot3D(reduced_hd) broken_swiss_roll_dataset = dg.get_broken_swiss_roll_dataset(5000) ploter.plot3D(broken_swiss_roll_dataset) reduced_bro...
[ "Dataset_Generator.get_broken_swiss_roll_dataset", "Dataset_Generator.get_swiss_roll_dataset", "mnist.MNIST", "Plot_Graph.plot3D_color", "Dataset_Generator.get_helix_dataset", "Plot_Graph.plot1D_color", "Evaluation.get_continuity", "Plot_Graph.plot2D", "Plot_Graph.plot3D", "Dataset_Generator.get_h...
[((99, 122), 'Dataset_Generator.get_hd_dataset', 'dg.get_hd_dataset', (['(5000)'], {}), '(5000)\n', (116, 122), True, 'import Dataset_Generator as dg\n'), ((136, 173), 'Evaluation.pca_dim_reduction', 'eval.pca_dim_reduction', (['hd_dataset', '(3)'], {}), '(hd_dataset, 3)\n', (158, 173), True, 'import Evaluation as eval...
'''Body Composition is a Slicer module that allows to segment different parts of the lungs in a manual or semi-automatic basis with the help of a customized Slicer Editor. It also performs a set of operations to analyze the different structures of the volume based on its label map, like Area, Mean, Std.Dev., etc. First...
[ "numpy.clip", "slicer.modules.volumes.logic", "qt.QLineEdit", "CIP.logic.SlicerUtil.SlicerUtil.getNode", "qt.QFormLayout", "qt.QIntValidator", "slicer.qMRMLNodeComboBox", "numpy.mean", "ctk.ctkCollapsibleButton", "qt.QRadioButton", "numpy.max", "qt.QLabel", "slicer.app.applicationLogic", "...
[((2919, 2945), 'ctk.ctkCollapsibleButton', 'ctk.ctkCollapsibleButton', ([], {}), '()\n', (2943, 2945), False, 'import qt, vtk, ctk, slicer\n'), ((3266, 3312), 'qt.QFormLayout', 'qt.QFormLayout', (['self.mainAreaCollapsibleButton'], {}), '(self.mainAreaCollapsibleButton)\n', (3280, 3312), False, 'import qt, vtk, ctk, s...
"""Data loading for SVMRank-style data sets.""" from typing import Callable from typing import List from typing import Optional from typing import Union import numpy as _np import torch as _torch import logging from scipy.sparse import coo_matrix as _coo_matrix from sklearn.datasets import load_svmlight_file as _load...
[ "sklearn.datasets.load_svmlight_file", "torch.LongTensor", "pytorchltr.datasets.list_sampler.ListSampler", "torch.Size", "numpy.where", "numpy.max", "pytorchltr.datasets.svmrank.parser.parse_svmrank_file", "numpy.array", "numpy.sum", "scipy.sparse.coo_matrix", "numpy.vstack", "numpy.min", "l...
[((2101, 2154), 'logging.info', 'logging.info', (['"""loading svmrank dataset from %s"""', 'file'], {}), "('loading svmrank dataset from %s', file)\n", (2113, 2154), False, 'import logging\n'), ((8527, 8565), 'torch.LongTensor', '_torch.LongTensor', (['self._ys[start:end]'], {}), '(self._ys[start:end])\n', (8544, 8565)...
import numpy as np from simdkalman.primitives import predict, update # define model state_transition = np.array([[1,1],[0,1]]) process_noise = np.eye(2)*0.01 observation_model = np.array([[1,0]]) observation_noise = np.array([[1.0]]) # initial state m = np.array([0, 1]) P = np.eye(2) # predict next state m, P = pred...
[ "simdkalman.primitives.predict", "numpy.array", "numpy.eye", "simdkalman.primitives.update" ]
[((104, 130), 'numpy.array', 'np.array', (['[[1, 1], [0, 1]]'], {}), '([[1, 1], [0, 1]])\n', (112, 130), True, 'import numpy as np\n'), ((179, 197), 'numpy.array', 'np.array', (['[[1, 0]]'], {}), '([[1, 0]])\n', (187, 197), True, 'import numpy as np\n'), ((217, 234), 'numpy.array', 'np.array', (['[[1.0]]'], {}), '([[1....
from numba.pycc import CC from numpy import zeros cc = CC('UnsatStor_inner_compiled') @cc.export('UnsatStor_inner', '(int64,int64[:,::1],float64,float64,float64[:,:,::1],float64[:,:,::1])') def UnsatStor_inner(NYrs, DaysMonth, MaxWaterCap, UnsatStor_0, infiltration, DailyET): unsatstor = zeros((NYrs, 12, 31)) ...
[ "numba.pycc.CC", "numpy.zeros" ]
[((56, 86), 'numba.pycc.CC', 'CC', (['"""UnsatStor_inner_compiled"""'], {}), "('UnsatStor_inner_compiled')\n", (58, 86), False, 'from numba.pycc import CC\n'), ((296, 317), 'numpy.zeros', 'zeros', (['(NYrs, 12, 31)'], {}), '((NYrs, 12, 31))\n', (301, 317), False, 'from numpy import zeros\n'), ((365, 386), 'numpy.zeros'...
# -*- coding: utf-8 -*- import operator import sys import numpy as np import tensorflow as tf from jtr.nn.models import get_total_trainable_variables from jtr.util.tfutil import tfrun class Vocab(object): """ Vocab objects for use in jtr pipelines. Example: >>> #Test Vocab without pre-trained ...
[ "tensorflow.contrib.framework.is_tensor", "tensorflow.nn.embedding_lookup", "numpy.sqrt", "tensorflow.contrib.layers.fully_connected", "tensorflow.contrib.layers.xavier_initializer", "numpy.square", "tensorflow.concat", "doctest.testmod", "tensorflow.identity", "operator.itemgetter", "tensorflow...
[((21423, 21447), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(1337)'], {}), '(1337)\n', (21441, 21447), True, 'import tensorflow as tf\n'), ((20108, 20158), 'tensorflow.nn.embedding_lookup', 'tf.nn.embedding_lookup', (['self.embedding_matrix', 'ids'], {}), '(self.embedding_matrix, ids)\n', (20130, 20158), T...
# 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 writing, software # distributed under t...
[ "pathlib.Path", "subprocess.Popen", "os.path.join", "setuptools.setup", "os.path.isfile", "os.path.isdir", "numpy.get_include" ]
[((1454, 1499), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'stdout': 'subprocess.PIPE'}), '(cmd, stdout=subprocess.PIPE)\n', (1470, 1499), False, 'import subprocess\n'), ((3970, 4071), 'setuptools.setup', 'setuptools.setup', ([], {'name': 'name', 'packages': '[name]', 'install_requires': "['numpy']", 'ext_modul...
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F # if gpu is to be used device = torch.device("cuda" if torch.cuda.is_available() else "cpu") WEIGHTS_FINAL_INIT = 3e-3 BIAS_FINAL_INIT = 3e-4 def fan_in_uniform_init(tensor, fan_in=None): """Utility function for initializing ac...
[ "numpy.sqrt", "torch.nn.LayerNorm", "torch.cuda.is_available", "torch.nn.Linear", "torch.nn.functional.relu", "torch.nn.init.uniform_", "torch.cat" ]
[((428, 459), 'torch.nn.init.uniform_', 'nn.init.uniform_', (['tensor', '(-w)', 'w'], {}), '(tensor, -w, w)\n', (444, 459), True, 'import torch.nn as nn\n'), ((142, 167), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (165, 167), False, 'import torch\n'), ((408, 423), 'numpy.sqrt', 'np.sqrt', (...
""" Created on Tuesday 20 February 2018 Last update: Sunday 11 March 2018 @author: <NAME> <EMAIL> Solution for the lecture optimal transport """ from itertools import permutations import numpy as np from sklearn.metrics.pairwise import pairwise_distances from random import shuffle blue = '#264653' green = '#2a9d8f'...
[ "matplotlib.pyplot.imshow", "numpy.ones_like", "numpy.abs", "matplotlib.pyplot.savefig", "random.shuffle", "numpy.log", "numpy.exp", "numpy.sum", "numpy.zeros", "numpy.linspace", "numpy.array", "numpy.zeros_like", "matplotlib.pyplot.subplots", "numpy.arange" ]
[((528, 544), 'random.shuffle', 'shuffle', (['indices'], {}), '(indices)\n', (535, 544), False, 'from random import shuffle\n'), ((2186, 2202), 'numpy.exp', 'np.exp', (['(-lam * C)'], {}), '(-lam * C)\n', (2192, 2202), True, 'import numpy as np\n'), ((3410, 3426), 'numpy.exp', 'np.exp', (['(-lam * C)'], {}), '(-lam * C...
# Credits (inspired & adapted from) @ https://github.com/lcswillems/torch-rl import torch from typing import Tuple import numpy as np from utils.dictlist import DictList from .base import AgentBase class SimulateDict: def __init__(self, obj): self._obj = obj def __getitem__(self, item): ret...
[ "torch.ones", "torch.tensor", "torch.save", "utils.dictlist.DictList", "torch.no_grad", "torch.zeros", "numpy.arange", "numpy.random.permutation" ]
[((1657, 1693), 'torch.zeros', 'torch.zeros', (['shape[1]'], {'device': 'device'}), '(shape[1], device=device)\n', (1668, 1693), False, 'import torch\n'), ((1715, 1749), 'torch.zeros', 'torch.zeros', (['*shape'], {'device': 'device'}), '(*shape, device=device)\n', (1726, 1749), False, 'import torch\n'), ((1773, 1824), ...
from __future__ import annotations import numpy as np import pytest from .helpers import ( # noqa: F401 assert_eq, line_delim_records_file, load_records_eager, load_records_lazy, ) def test_ufunc_add(line_delim_records_file) -> None: # noqa: F811 daa = load_records_lazy(line_delim_records_file...
[ "numpy.sin", "pytest.mark.parametrize", "pytest.raises" ]
[((723, 787), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""f"""', '[np.add.accumulate, np.add.reduce]'], {}), "('f', [np.add.accumulate, np.add.reduce])\n", (746, 787), False, 'import pytest\n'), ((665, 676), 'numpy.sin', 'np.sin', (['daa'], {}), '(daa)\n', (671, 676), True, 'import numpy as np\n'), ((68...
#<NAME> from estrategias.jogadores import Jogador import numpy import numpy as np import os.path from numpy import round import pickle import random listaRep5=[] def n_melhores(a1,n): 'a=lista n=posições' a=list(a1) a.sort() return a[-n:] class MeuJogador(Jogador): def __init__(self): ...
[ "numpy.round", "pickle.load", "pickle.dump", "estrategias.jogadores.Jogador.__init__" ]
[((325, 347), 'estrategias.jogadores.Jogador.__init__', 'Jogador.__init__', (['self'], {}), '(self)\n', (341, 347), False, 'from estrategias.jogadores import Jogador\n'), ((675, 707), 'pickle.dump', 'pickle.dump', (['listaRep5', 'arquivo5'], {}), '(listaRep5, arquivo5)\n', (686, 707), False, 'import pickle\n'), ((640, ...
from gui.window import Form from gui.draw import * from PIL import Image, ImageQt import random, io, os import numpy as np import torch import cv2 import torchvision.transforms as transforms from util import util import os import torch import torch.nn.functional as F import torchvision.transforms.functional as TF from...
[ "PIL.Image.fromarray", "PIL.Image.open", "torchvision.transforms.ToTensor", "cv2.threshold", "torchvision.transforms.functional.to_pil_image", "util.util.tensor2im", "torch.load", "os.path.join", "pconv.model.PConvUNet", "numpy.array", "util.util.mkdir", "torch.no_grad", "util.util.save_imag...
[((811, 830), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (823, 830), False, 'import torch\n'), ((918, 957), 'pconv.model.PConvUNet', 'PConvUNet', ([], {'finetune': '(False)', 'layer_size': '(7)'}), '(finetune=False, layer_size=7)\n', (927, 957), False, 'from pconv.model import PConvUNet\n'), ((23...
# Write exponential sweep to csv for testing. # The sweep was manually inspected. # The time signal was inspected for smootheness and maximum amplitudes of +/-1. # The spectrum was inspected for the ripple at the edges of the frequency range # (typical for time domain sweep generation) and the 1/f slope. import numpy a...
[ "pyfar.signals.exponential_sweep_time", "numpy.savetxt" ]
[((431, 486), 'numpy.savetxt', 'np.savetxt', (['"""signals.exponential_sweep_time.csv"""', 'sweep'], {}), "('signals.exponential_sweep_time.csv', sweep)\n", (441, 486), True, 'import numpy as np\n'), ((383, 433), 'pyfar.signals.exponential_sweep_time', 'exponential_sweep_time', (['(2 ** 10)', '[1000.0, 20000.0]'], {}),...
import numpy as np import skimage.color import skimage.filters import skimage.io import skimage.viewer # read and display the original image image = skimage.io.imread('images/coins.png') viewer = skimage.viewer.ImageViewer(image) viewer.show() # blur and grayscale before thresholding blur = skimage.color.rgb2gray(im...
[ "numpy.zeros_like" ]
[((592, 612), 'numpy.zeros_like', 'np.zeros_like', (['image'], {}), '(image)\n', (605, 612), True, 'import numpy as np\n')]
# Import libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Import dataset dataset = pd.read_csv('Social_Network_Ads.csv') X = dataset.iloc[:, :-1].values Y = dataset.iloc[:, -1].values print(f"X = {X}") print(f"Y = {Y}") print() # Split Dataset: Training Set and Test Set from sklearn...
[ "matplotlib.pyplot.savefig", "numpy.unique", "pandas.read_csv", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.clf", "sklearn.neighbors.KNeighborsClassifier", "matplotlib.colors.ListedColormap", "sklearn.preprocessing.Standard...
[((118, 155), 'pandas.read_csv', 'pd.read_csv', (['"""Social_Network_Ads.csv"""'], {}), "('Social_Network_Ads.csv')\n", (129, 155), True, 'import pandas as pd\n'), ((396, 450), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'Y'], {'test_size': '(0.25)', 'random_state': '(0)'}), '(X, Y, test_size...
import sys sys.path.append('../') import numpy as np import matplotlib.pyplot as plt import matplotlib import matplotlib.gridspec as gridspec from mpl_toolkits.axes_grid1 import make_axes_locatable import seaborn as sns from network import Protocol, NetworkManager, BCPNNPerfect, TimedInput from connectivity_functions...
[ "connectivity_functions.create_orthogonal_canonical_representation", "seaborn.set_style", "analysis_functions.get_weights", "network.BCPNNPerfect", "connectivity_functions.build_network_representation", "sys.path.append", "numpy.arange", "seaborn.set", "seaborn.color_palette", "numpy.diff", "con...
[((11, 33), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (26, 33), False, 'import sys\n'), ((4212, 4235), 'seaborn.set', 'sns.set', ([], {'font_scale': '(2.8)'}), '(font_scale=2.8)\n', (4219, 4235), True, 'import seaborn as sns\n'), ((4236, 4264), 'seaborn.set_style', 'sns.set_style', ([], {'...
from __future__ import print_function, absolute_import from collections import OrderedDict from ._result_base import H5NastranResultBase from h5Nastran.post_process.result_readers.punch import PunchReader import numpy as np import tables from six import iteritems class H5NastranResultPunch(H5NastranResultBase): ...
[ "h5Nastran.post_process.result_readers.punch.PunchReader", "tables.descr_from_dtype", "numpy.dtype", "six.iteritems" ]
[((780, 801), 'h5Nastran.post_process.result_readers.punch.PunchReader', 'PunchReader', (['filename'], {}), '(filename)\n', (791, 801), False, 'from h5Nastran.post_process.result_readers.punch import PunchReader\n'), ((1122, 1201), 'numpy.dtype', 'np.dtype', (["[('SUBCASE_ID', '<i8'), ('LOAD_FACTOR', '<f8'), ('DOMAIN_I...
# -*- coding: utf-8 -*- """ @author: NysanAskar """ import numpy as np import tensorflow as tf from keras import backend as K import keras from tensorflow.keras.layers import ( Add, Input, ) from utils import xywh_to_x1y1x2y2, broadcast_iou, binary_cross_entropy anchors_wh = np.array([[10, 13...
[ "tensorflow.shape", "tensorflow.sort", "keras.backend.shape", "tensorflow.math.log", "tensorflow.reduce_sum", "tensorflow.split", "keras.backend.softplus", "tensorflow.keras.layers.BatchNormalization", "numpy.array", "tensorflow.cast", "tensorflow.keras.layers.Input", "tensorflow.keras.layers....
[((303, 425), 'numpy.array', 'np.array', (['[[10, 13], [16, 30], [33, 23], [30, 61], [62, 45], [59, 119], [116, 90], [\n 156, 198], [373, 326]]', 'np.float32'], {}), '([[10, 13], [16, 30], [33, 23], [30, 61], [62, 45], [59, 119], [116,\n 90], [156, 198], [373, 326]], np.float32)\n', (311, 425), True, 'import nump...
import numpy as np import tensorflow as tf import tensorflow.keras.backend as K from tf_keras_vis import ModelVisualization from tf_keras_vis.utils import check_steps, listify class Saliency(ModelVisualization): def __call__(self, loss, seed_input, smooth_sample...
[ "numpy.random.normal", "tf_keras_vis.utils.check_steps", "numpy.ones", "tf_keras_vis.utils.listify", "numpy.zeros_like", "numpy.max", "tensorflow.GradientTape", "tensorflow.math.reduce_max", "tensorflow.keras.backend.abs", "tensorflow.math.reduce_min" ]
[((443, 455), 'tensorflow.keras.backend.abs', 'K.abs', (['grads'], {}), '(grads)\n', (448, 455), True, 'import tensorflow.keras.backend as K\n'), ((2204, 2231), 'tf_keras_vis.utils.check_steps', 'check_steps', (['smooth_samples'], {}), '(smooth_samples)\n', (2215, 2231), False, 'from tf_keras_vis.utils import check_ste...
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.colors import LinearSegmentedColormap import matplotlib.gridspec as gridspec import matplotlib.patches as patches class ContagionSimulator: def __init__(self): pass def set_params(self, params...
[ "matplotlib.patches.Rectangle", "numpy.sqrt", "numpy.ones", "numpy.random.rand", "matplotlib.animation.FuncAnimation", "numpy.zeros", "numpy.random.randint", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.figure", "numpy.cos", "numpy.sin", "matplotlib.colors.LinearSegmentedColormap.from_li...
[((654, 677), 'numpy.random.rand', 'np.random.rand', (['nagents'], {}), '(nagents)\n', (668, 677), True, 'import numpy as np\n'), ((695, 718), 'numpy.random.rand', 'np.random.rand', (['nagents'], {}), '(nagents)\n', (709, 718), True, 'import numpy as np\n'), ((1113, 1141), 'numpy.ones', 'np.ones', (['nagents'], {'dtype...
import numpy as np from sbrfuzzy import * entrada = open("dados.txt","a") v = np.arange(0,300.5,0.5) v1 = variavellinguistica("População",np.arange(0,300.5,0.5)) v1.adicionar("muito-baixa","trapezoidal",[0,0,25,45]) v1.adicionar("baixa","triangular",[30,50,70]) v1.adicionar("media","triangular",[55,75,110]) v1.adicio...
[ "numpy.arange" ]
[((79, 103), 'numpy.arange', 'np.arange', (['(0)', '(300.5)', '(0.5)'], {}), '(0, 300.5, 0.5)\n', (88, 103), True, 'import numpy as np\n'), ((142, 166), 'numpy.arange', 'np.arange', (['(0)', '(300.5)', '(0.5)'], {}), '(0, 300.5, 0.5)\n', (151, 166), True, 'import numpy as np\n'), ((511, 535), 'numpy.arange', 'np.arange...
import codecs import os import random import pickle import sys import numpy as np import tensorflow as tf from tqdm import tqdm from transformers import BertTokenizer, TFBertModel from io_utils.io_utils import load_data from data_processing.feature_extraction import calc_features from data_processing.feature_extracti...
[ "pickle.dump", "tensorflow.random.set_seed", "transformers.TFBertModel.from_pretrained", "io_utils.io_utils.load_data", "data_processing.feature_extraction.calc_features", "transformers.BertTokenizer.from_pretrained", "random.seed", "os.path.normpath", "os.path.dirname", "os.path.isfile", "os.pa...
[((373, 388), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (384, 388), False, 'import random\n'), ((393, 411), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (407, 411), True, 'import numpy as np\n'), ((416, 438), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(42)'], {}), '(42)\n',...
import re import sys import numpy as np import pkg_resources import math from PyQt5 import uic, QtGui, QtCore from matplotlib.figure import Figure from isstools.widgets import (widget_general_info, widget_trajectory_manager, widget_processing, widget_batch_mode, widget_run, widget_beaml...
[ "re.compile", "PyQt5.QtGui.QColor", "PyQt5.uic.loadUiType", "isstools.widgets.widget_batch_mode.UIBatchMode", "isstools.widgets.widget_general_info.UIGeneralInfo", "isstools.elements.EmittingStream.EmittingStream", "isstools.widgets.widget_beamline_setup.UIBeamlineSetup", "numpy.round", "PyQt5.QtCor...
[((639, 697), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['"""isstools"""', '"""ui/XLive.ui"""'], {}), "('isstools', 'ui/XLive.ui')\n", (670, 697), False, 'import pkg_resources\n'), ((934, 957), 'PyQt5.uic.loadUiType', 'uic.loadUiType', (['ui_path'], {}), '(ui_path)\n', (948, 957), False, 'f...
#!/usr/bin/env python # coding: utf-8 import pandas as pd from sklearn.base import BaseEstimator import torch from torch import nn from torch import optim import numpy as np torch.autograd.set_detect_anomaly(True) class TorchCox(BaseEstimator): """Fit a Cox model """ def __init__(self, lr=1, random_sta...
[ "torch.autograd.set_detect_anomaly", "torch.unique", "torch.full", "numpy.asarray", "torch.from_numpy", "numpy.dot", "torch.sum", "torch.einsum", "torch.optim.LBFGS", "pandas.DataFrame", "torch.logsumexp" ]
[((176, 215), 'torch.autograd.set_detect_anomaly', 'torch.autograd.set_detect_anomaly', (['(True)'], {}), '(True)\n', (209, 215), False, 'import torch\n'), ((471, 514), 'torch.full', 'torch.full', (['targetshape'], {'fill_value': '(-1000.0)'}), '(targetshape, fill_value=-1000.0)\n', (481, 514), False, 'import torch\n')...
from __future__ import absolute_import import os,sys import numpy as np from Bio.PDB.Polypeptide import is_aa from computeFeatures.structStep.myPDBParser import myPDBParser as PDBParser from ..StructFeatComputer import StructFeatComputer from utils import myMakeDir, tryToRemove #utils is at the root of the package c...
[ "numpy.mean", "utils.tryToRemove", "os.path.join", "Bio.PDB.Polypeptide.is_aa", "os.path.isfile", "numpy.dot", "computeFeatures.structStep.myPDBParser.myPDBParser", "utils.myMakeDir", "numpy.linalg.norm" ]
[((987, 1047), 'utils.myMakeDir', 'myMakeDir', (['self.computedFeatsRootDir', '"""distanceMatricesData"""'], {}), "(self.computedFeatsRootDir, 'distanceMatricesData')\n", (996, 1047), False, 'from utils import myMakeDir, tryToRemove\n'), ((1065, 1086), 'computeFeatures.structStep.myPDBParser.myPDBParser', 'PDBParser', ...
from tkinter import * from tkinter import ttk from tkinter import simpledialog, messagebox from PIL import Image, ImageTk import AER_config as config from AER_utils import Plot_Types import os import numpy as np import time import matplotlib matplotlib.use("TkAgg") from matplotlib.backends.backend_tkagg import FigureC...
[ "tkinter.ttk.Button", "tkinter.ttk.Style", "matplotlib.use", "matplotlib.figure.Figure", "tkinter.ttk.Label", "matplotlib.image.imread", "tkinter.simpledialog.askstring", "numpy.round", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg" ]
[((243, 266), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (257, 266), False, 'import matplotlib\n'), ((2176, 2187), 'tkinter.ttk.Style', 'ttk.Style', ([], {}), '()\n', (2185, 2187), False, 'from tkinter import ttk\n'), ((2429, 2440), 'tkinter.ttk.Style', 'ttk.Style', ([], {}), '()\n', (243...
import argparse import joblib import numpy as np import pandas as pd from sklearn.metrics import (balanced_accuracy_score, classification_report, f1_score, precision_score, recall_score, roc_auc_score, roc_curve) from tqdm import tqdm from utils import _get_su...
[ "sklearn.metrics.balanced_accuracy_score", "pandas.read_csv", "sklearn.metrics.classification_report", "sklearn.metrics.precision_score", "sklearn.metrics.recall_score", "sklearn.metrics.roc_auc_score", "sklearn.metrics.roc_curve", "numpy.mean", "argparse.ArgumentParser", "numpy.delete", "numpy....
[((1211, 1229), 'pandas.DataFrame', 'pd.DataFrame', (['rows'], {}), '(rows)\n', (1223, 1229), True, 'import pandas as pd\n'), ((1355, 1403), 'utils.get_patient_prediction', 'get_patient_prediction', (['test_patient_df', 'dataset'], {}), '(test_patient_df, dataset)\n', (1377, 1403), False, 'from utils import _get_subjec...
import numpy as np from numba import njit, prange # consav from consav import linear_interp # for linear interpolation from consav import golden_section_search # for optimization in 1D # local modules import utility # a. define objective function @njit def obj_bellman(c,m,interp_w,par): """ evaluate bellman equ...
[ "consav.golden_section_search.optimizer", "numba.njit", "numpy.fmin", "numba.prange", "consav.linear_interp.interp_1d", "utility.func" ]
[((616, 635), 'numba.njit', 'njit', ([], {'parallel': '(True)'}), '(parallel=True)\n', (620, 635), False, 'from numba import njit, prange\n'), ((414, 462), 'consav.linear_interp.interp_1d', 'linear_interp.interp_1d', (['par.grid_a', 'interp_w', 'a'], {}), '(par.grid_a, interp_w, a)\n', (437, 462), False, 'from consav i...
import numpy as np import random def random_sys(size=1): if size > 1: rd = [] for i in range(size): rd.append(random.random()) rd = np.array(rd, dtype=np.float32) return rd else: return random.random() def rand(a=0., b=1.): """ ...
[ "numpy.array", "random.random", "random.shuffle", "numpy.arange" ]
[((578, 592), 'numpy.arange', 'np.arange', (['num'], {}), '(num)\n', (587, 592), True, 'import numpy as np\n'), ((598, 617), 'random.shuffle', 'random.shuffle', (['slt'], {}), '(slt)\n', (612, 617), False, 'import random\n'), ((187, 217), 'numpy.array', 'np.array', (['rd'], {'dtype': 'np.float32'}), '(rd, dtype=np.floa...
import numpy as np import scipy.signal import torch import torch.nn as nn from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence def combined_shape(length, shape=None): if shape is None: return (length,) return (length, shape) if np.isscalar(shape) else (length, *shape...
[ "numpy.prod", "torch.nn.ReLU", "numpy.isscalar", "torch.nn.Tanh", "torch.nn.Sequential", "torch.nn.LSTM", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.Linear", "torch.squeeze", "torch.no_grad", "torch.nn.Identity", "torch.nn.utils.rnn.pad_packed_sequence", "torch.cat" ]
[((570, 592), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (583, 592), True, 'import torch.nn as nn\n'), ((281, 299), 'numpy.isscalar', 'np.isscalar', (['shape'], {}), '(shape)\n', (292, 299), True, 'import numpy as np\n'), ((1417, 1437), 'torch.squeeze', 'torch.squeeze', (['q', '(-1)'], {}...
import torch.nn as nn import torch.nn.functional as F from torch.utils.data import TensorDataset, DataLoader from torch.utils.tensorboard import SummaryWriter import os import numpy as np import torch import sys from tqdm import tqdm from tqdm._utils import _term_move_up import time torch.manual_seed(0) np.random....
[ "torch.nn.ConvTranspose2d", "torch.manual_seed", "numpy.random.rand", "torch.nn.Tanh", "torch.nn.Sequential", "numpy.tanh", "torch.nn.Conv2d", "torch.tensor", "numpy.zeros", "torch.nn.MaxPool2d", "numpy.random.seed", "torch.nn.Upsample", "time.time" ]
[((285, 305), 'torch.manual_seed', 'torch.manual_seed', (['(0)'], {}), '(0)\n', (302, 305), False, 'import torch\n'), ((310, 327), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (324, 327), True, 'import numpy as np\n'), ((2881, 2910), 'numpy.random.rand', 'np.random.rand', (['(1)', 'N1', 'C1', 'C1'], {...
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse from collections import deque from unityagents import UnityEnvironment import matplotlib.pyplot as plt import numpy as np import torch from agent import ActorCriticAgent from env import ContinuousUnityAgentEnvironment def ddpg_train(n_episodes=2000, max_t=1...
[ "numpy.mean", "collections.deque", "argparse.ArgumentParser", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.any", "numpy.zeros", "env.ContinuousUnityAgentEnvironment", "agent.ActorCriticAgent", "matplotlib.pyplot.title", "matplotlib.pyplot.show" ]
[((505, 582), 'env.ContinuousUnityAgentEnvironment', 'ContinuousUnityAgentEnvironment', (['"""./Reacher_Windows_x86_64/Reacher.exe"""', '(True)'], {}), "('./Reacher_Windows_x86_64/Reacher.exe', True)\n", (536, 582), False, 'from env import ContinuousUnityAgentEnvironment\n'), ((655, 709), 'agent.ActorCriticAgent', 'Act...
# Copyright (c) 2021 PaddlePaddle 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 appli...
[ "numpy.prod", "paddle.nn.Pad1D", "paddle.tanh", "paddle.transpose", "paddle.nn.Sequential", "paddle.nn.functional.interpolate", "paddle.nn.Conv2D", "paddle.nn.functional.sigmoid", "paddle.nn.ReLU", "paddle.shape", "paddle.nn.LayerList", "math.sqrt", "paddle.nn.Conv1D", "paddle.chunk", "p...
[((1965, 2040), 'paddle.nn.functional.interpolate', 'F.interpolate', (['x'], {'scale_factor': '(self.h_scale, self.w_scale)', 'mode': 'self.mode'}), '(x, scale_factor=(self.h_scale, self.w_scale), mode=self.mode)\n', (1978, 2040), True, 'from paddle.nn import functional as F\n'), ((3541, 3555), 'paddle.nn.LayerList', '...
import errno import itertools import os from collections import Counter from typing import Any, Dict, List, Optional, Set, Tuple, Union, cast import numpy as np from loguru import logger from tqdm import tqdm import slp.util.system as system import slp.util.types as types from slp.config.nlp import SPECIAL_TOKENS fro...
[ "loguru.logger.warning", "slp.util.system.pickle_dump", "numpy.array", "os.strerror", "os.path.exists", "slp.data.transforms.HuggingFaceTokenizer", "slp.data.transforms.ToTokenIds", "numpy.asarray", "os.path.split", "itertools.chain.from_iterable", "slp.util.system.pickle_load", "slp.util.syst...
[((1924, 1939), 'collections.Counter', 'Counter', (['corpus'], {}), '(corpus)\n', (1931, 1939), False, 'from collections import Counter\n'), ((6681, 6709), 'slp.util.system.timethis', 'system.timethis', ([], {'method': '(True)'}), '(method=True)\n', (6696, 6709), True, 'import slp.util.system as system\n'), ((4549, 458...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import pickle import unittest from math import prod import numpy as np import torch from rlmeta.core.segment_tree import SumSegmentTree, ...
[ "torch.maximum", "rlmeta.core.segment_tree.SumSegmentTree", "torch.full", "pickle.dumps", "pickle.loads", "math.prod", "torch.randint", "numpy.random.randint", "torch.tensor", "unittest.main", "torch.minimum", "numpy.random.randn", "torch.randn", "torch.arange", "torch.ones" ]
[((3193, 3208), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3206, 3208), False, 'import unittest\n'), ((493, 515), 'torch.randn', 'torch.randn', (['self.size'], {}), '(self.size)\n', (504, 515), False, 'import torch\n'), ((544, 569), 'rlmeta.core.segment_tree.SumSegmentTree', 'SumSegmentTree', (['self.size'], ...
import numpy as np import pandas as pd import matplotlib.pyplot as plt def dist_comp(df, bins, filepath, cfg): # Define columns all_columns = list(df.index.names) columns_noname = [c for c in all_columns if c != "name"] columns_nobins = [c for c in all_columns if "bin" not in c] # Remove under and...
[ "matplotlib.pyplot.close", "numpy.isnan", "matplotlib.pyplot.tight_layout", "numpy.isinf", "matplotlib.pyplot.subplots" ]
[((1584, 1706), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': '(2)', 'ncols': '(1)', 'sharex': '"""col"""', 'sharey': '(False)', 'gridspec_kw': "{'height_ratios': [3, 1]}", 'figsize': '(4.8, 6.4)'}), "(nrows=2, ncols=1, sharex='col', sharey=False, gridspec_kw={\n 'height_ratios': [3, 1]}, figsize=(4.8...
#!/usr/bin/env python3 import cv2 import sys import numpy as np import imutils from skimage.filters import threshold_local def vid_to_frames(filename, write=False): vidcap = cv2.VideoCapture(filename) success, image = vidcap.read() count = 0 images = [] while success: if write: ...
[ "numpy.array", "cv2.warpPerspective", "cv2.approxPolyDP", "cv2.arcLength", "numpy.diff", "imutils.grab_contours", "cv2.VideoWriter_fourcc", "numpy.argmin", "cv2.getPerspectiveTransform", "numpy.argmax", "cv2.cvtColor", "cv2.Canny", "cv2.GaussianBlur", "cv2.imread", "cv2.imwrite", "cv2....
[((2619, 2647), 'cv2.imread', 'cv2.imread', (["args['template']"], {}), "(args['template'])\n", (2629, 2647), False, 'import cv2\n'), ((180, 206), 'cv2.VideoCapture', 'cv2.VideoCapture', (['filename'], {}), '(filename)\n', (196, 206), False, 'import cv2\n'), ((630, 663), 'numpy.zeros', 'np.zeros', (['(4, 2)'], {'dtype'...
# Authors: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD 3 clause """ Sphere element """ # pylint: disable=invalid-name import logging # from textwrap import dedent import numpy as np from .base import Element from .utils import distance_ellipsoid log = logging.getLogger(__name__) # pylint: disab...
[ "logging.getLogger", "numpy.array", "numpy.asarray", "numpy.ones" ]
[((276, 303), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (293, 303), False, 'import logging\n'), ((1591, 1609), 'numpy.asarray', 'np.asarray', (['center'], {}), '(center)\n', (1601, 1609), True, 'import numpy as np\n'), ((2497, 2569), 'numpy.asarray', 'np.asarray', (['[x - self.center...
import cv2 import os import re import numpy as np from multiprocessing import Pool import pickle root_folder = './NTURGBD' rgb_folder = os.path.join(root_folder, './nturgb+d_rgb') depth_folder = os.path.join(root_folder, './nturgb+d_depth_masked') skeleton_folder = os.path.join(root_folder, './nturgb+d_skeletons') ta...
[ "os.path.exists", "cv2.imwrite", "os.listdir", "numpy.random.rand", "os.makedirs", "cv2.findHomography", "re.compile", "os.path.join", "re.match", "numpy.array", "cv2.warpPerspective", "numpy.stack", "multiprocessing.Pool", "numpy.concatenate" ]
[((137, 180), 'os.path.join', 'os.path.join', (['root_folder', '"""./nturgb+d_rgb"""'], {}), "(root_folder, './nturgb+d_rgb')\n", (149, 180), False, 'import os\n'), ((196, 248), 'os.path.join', 'os.path.join', (['root_folder', '"""./nturgb+d_depth_masked"""'], {}), "(root_folder, './nturgb+d_depth_masked')\n", (208, 24...
import numpy as np import hetu as ht from hetu import gpu_links as gpu_op def test_adamw(): ctx = ht.gpu(0) shape = (500,400) param = np.random.uniform(-10, 10, size=shape).astype(np.float32) grad = np.random.uniform(-10, 10, size=shape).astype(np.float32) m = np.random.uniform(-10, 10, size=shape...
[ "hetu.IndexedSlices", "hetu.gpu", "numpy.sqrt", "numpy.power", "numpy.testing.assert_allclose", "hetu.array", "numpy.array", "numpy.random.randint", "hetu.gpu_links.adamw_update", "numpy.random.uniform", "hetu.gpu_links.lamb_update" ]
[((104, 113), 'hetu.gpu', 'ht.gpu', (['(0)'], {}), '(0)\n', (110, 113), True, 'import hetu as ht\n'), ((664, 684), 'hetu.array', 'ht.array', (['param', 'ctx'], {}), '(param, ctx)\n', (672, 684), True, 'import hetu as ht\n'), ((700, 719), 'hetu.array', 'ht.array', (['grad', 'ctx'], {}), '(grad, ctx)\n', (708, 719), True...
import datetime import glob import os import operator import pytest import numpy as np from functools import reduce from numpy import nan from osgeo import gdal from test import DATA_DIR, TEST_DIR, pushd from RAiDER.constants import Zenith, _ZMIN, _ZREF from RAiDER.processWM import prepareWeatherModel from RAiDER.mo...
[ "RAiDER.models.erai.ERAI", "RAiDER.models.hres.HRES", "numpy.array", "numpy.nanmean", "datetime.timedelta", "RAiDER.models.weatherModel.make_weather_model_filename", "numpy.arange", "datetime.datetime", "RAiDER.models.ncmr.NCMR", "RAiDER.models.gmao.GMAO", "numpy.empty", "numpy.random.normal",...
[((761, 833), 'os.path.join', 'os.path.join', (['DATA_DIR', '"""weather_files"""', '"""ERA-5_2018_07_01_T00_00_00.nc"""'], {}), "(DATA_DIR, 'weather_files', 'ERA-5_2018_07_01_T00_00_00.nc')\n", (773, 833), False, 'import os\n'), ((887, 893), 'RAiDER.models.erai.ERAI', 'ERAI', ([], {}), '()\n', (891, 893), False, 'from ...
# !/usr/bin/python3.6 # -*- coding: utf-8 -*- # @author breeze import threading import argparse import multiprocessing import time from multiprocessing import Queue, Pool import face_recognition import pandas as pd import win32com.client import cv2 import encoding_images from app_utils import * # This is a demo of ru...
[ "cv2.rectangle", "numpy.array", "cv2.destroyAllWindows", "multiprocessing.log_to_stderr", "argparse.ArgumentParser", "threading.Lock", "face_recognition.face_distance", "pandas.DataFrame", "time.localtime", "cv2.waitKey", "face_recognition.face_locations", "cv2.putText", "cv2.resize", "mul...
[((1795, 1806), 'time.time', 'time.time', ([], {}), '()\n', (1804, 1806), False, 'import time\n'), ((1896, 1928), 'encoding_images.load_encodings', 'encoding_images.load_encodings', ([], {}), '()\n', (1926, 1928), False, 'import encoding_images\n'), ((2162, 2210), 'pandas.DataFrame', 'pd.DataFrame', (['known_face_names...
import numpy as np from scipy.io import loadmat from tqdm import tqdm from cmfsapy.dimension.fsa import ml_dims load_path = "../benchmark_data/manifold_data/" save_path = "./" datasets = [1, 2, 3, 4, 5, 6, 7, 9, 101, 102, 103, 104, 11, 12, 13] D = [11, 5, 6, 8, 3, 36, 3, 20, 11, 18, 25, 71, 3, 20, 13] intdims = [10...
[ "numpy.mean", "cmfsapy.dimension.fsa.ml_dims", "scipy.io.loadmat", "numpy.zeros", "numpy.save" ]
[((473, 490), 'numpy.zeros', 'np.zeros', (['[15, N]'], {}), '([15, N])\n', (481, 490), True, 'import numpy as np\n'), ((1081, 1131), 'numpy.save', 'np.save', (["(save_path + 'ml_benchmark_res')", 'result_ml'], {}), "(save_path + 'ml_benchmark_res', result_ml)\n", (1088, 1131), True, 'import numpy as np\n'), ((529, 540)...