code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np import pickle import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset, DataLoader import torch.optim as optim import sys from data_utils import * from AIWAE_models import * from sys import exit import argparse import time import bisect ## parameter par...
[ "torch.optim.lr_scheduler.LambdaLR", "argparse.ArgumentParser", "torch.utils.data.DataLoader", "torch.mean", "pickle.load", "bisect.bisect", "sys.exit", "numpy.cumsum" ]
[((333, 418), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Annealed Importance Weighted Auto-Encoder"""'}), "(description='Annealed Importance Weighted Auto-Encoder'\n )\n", (356, 418), False, 'import argparse\n'), ((1763, 1822), 'torch.utils.data.DataLoader', 'DataLoader', (['train...
import pandas as pd import numpy as np import datetime as dt import math #输入H 文件名 def cal_riskrt(H,source): source=source.iloc[:,0:6] source=source.drop(columns=["Unnamed: 0"]) source=source.set_index('date').dropna(subset=['long_rt','short_rt','long_short_rt'],how='all') #新建一个数据框记录各种指标 df=pd.Dat...
[ "pandas.read_csv", "pandas.to_datetime", "math.sqrt", "pandas.DataFrame", "numpy.cumprod" ]
[((3751, 3791), 'pandas.read_csv', 'pd.read_csv', (['"""../draw/inv_level_H30.csv"""'], {}), "('../draw/inv_level_H30.csv')\n", (3762, 3791), True, 'import pandas as pd\n'), ((3860, 3901), 'pandas.read_csv', 'pd.read_csv', (['"""../draw/warehouseR90H5.csv"""'], {}), "('../draw/warehouseR90H5.csv')\n", (3871, 3901), Tru...
import numpy as np from configparser import SafeConfigParser from pyfisher.lensInterface import lensNoise import orphics.theory.gaussianCov as gcov from orphics.theory.cosmology import Cosmology import orphics.tools.io as io cc = Cosmology(lmax=6000,pickling=True) theory = cc.theory # Read config iniFile = "../pyfi...
[ "orphics.theory.gaussianCov.LensForecast", "orphics.theory.cosmology.Cosmology", "pyfisher.lensInterface.lensNoise", "orphics.tools.io.Plotter", "numpy.arange", "configparser.SafeConfigParser" ]
[((232, 267), 'orphics.theory.cosmology.Cosmology', 'Cosmology', ([], {'lmax': '(6000)', 'pickling': '(True)'}), '(lmax=6000, pickling=True)\n', (241, 267), False, 'from orphics.theory.cosmology import Cosmology\n'), ((352, 370), 'configparser.SafeConfigParser', 'SafeConfigParser', ([], {}), '()\n', (368, 370), False, ...
import glob import os from os.path import join import numpy as np DIR_DATA = join(".", "datasets") DIR_SAVE = os.path.join(os.environ["HOME"], "Soroosh/results_full") DATASETS = glob.glob(DIR_DATA + "/*.txt") DATASETS = [f_name for f_name in DATASETS if "_test.txt" not in f_name] DATASETS.sort() rho = np.hstack([np.r...
[ "os.path.exists", "numpy.linspace", "os.path.join", "glob.glob" ]
[((78, 99), 'os.path.join', 'join', (['"""."""', '"""datasets"""'], {}), "('.', 'datasets')\n", (82, 99), False, 'from os.path import join\n'), ((111, 167), 'os.path.join', 'os.path.join', (["os.environ['HOME']", '"""Soroosh/results_full"""'], {}), "(os.environ['HOME'], 'Soroosh/results_full')\n", (123, 167), False, 'i...
from functions import * import glob import sys import os import numpy as np from validation_ids import validation_ids def save_data(file_name, data): res_out = open(file_name, "w+", encoding='utf-8') res_out.write("\n".join(data)) res_out.close() if __name__ == "__main__": num_validation = 10000 ...
[ "os.path.exists", "os.makedirs", "os.path.join", "numpy.random.seed", "os.path.basename", "glob.glob" ]
[((373, 393), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (387, 393), True, 'import numpy as np\n'), ((709, 750), 'os.path.join', 'os.path.join', (['target_dir', '"""train.src.txt"""'], {}), "(target_dir, 'train.src.txt')\n", (721, 750), False, 'import os\n'), ((772, 813), 'os.path.join', 'os.p...
#!/usr/bin/env python from pathlib import Path import subprocess import numpy as np import pytest R = Path(__file__).resolve().parents[1] def test_bsr(): pytest.importorskip('oct2py') subprocess.check_call(['octave-cli', '-q', 'Test.m'], cwd=R / 'tests') def test_wideangle_scatter(): oct2py = pytest.im...
[ "pathlib.Path", "subprocess.check_call", "pytest.main", "pytest.importorskip", "numpy.arange" ]
[((161, 190), 'pytest.importorskip', 'pytest.importorskip', (['"""oct2py"""'], {}), "('oct2py')\n", (180, 190), False, 'import pytest\n'), ((195, 265), 'subprocess.check_call', 'subprocess.check_call', (["['octave-cli', '-q', 'Test.m']"], {'cwd': "(R / 'tests')"}), "(['octave-cli', '-q', 'Test.m'], cwd=R / 'tests')\n",...
# Author: <NAME> # Date: 5/21/2019 # Reference Formula: https://anomaly.io/understand-auto-cross-correlation-normalized-shift/ # Referrence Video: https://www.youtube.com/watch?v=ngEC3sXeUb4 import math from scipy.signal import fftconvolve import numpy as np # It implements the normalized, and standard correlation a...
[ "numpy.array", "scipy.signal.fftconvolve" ]
[((640, 652), 'numpy.array', 'np.array', (['x1'], {}), '(x1)\n', (648, 652), True, 'import numpy as np\n'), ((677, 689), 'numpy.array', 'np.array', (['x2'], {}), '(x2)\n', (685, 689), True, 'import numpy as np\n'), ((1367, 1397), 'scipy.signal.fftconvolve', 'fftconvolve', (['f', 'g'], {'mode': '"""same"""'}), "(f, g, m...
## ## Copyright (c) 2019 ## ## @author: <NAME> ## @company: Technische Universität Berlin ## ## This file is part of the python package analyticcenter ## (see https://gitlab.tu-berlin.de/PassivityRadius/analyticcenter/) ## ## License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause ## import control i...
[ "numpy.asmatrix", "analyticcenter.WeightedSystem", "control.tf2ss", "numpy.array", "numpy.zeros", "control.tf", "control.series" ]
[((574, 597), 'numpy.array', 'np.array', (['[1 / (L * C)]'], {}), '([1 / (L * C)])\n', (582, 597), True, 'import numpy as np\n'), ((604, 638), 'numpy.array', 'np.array', (['[1, RR / L, 1 / (L * C)]'], {}), '([1, RR / L, 1 / (L * C)])\n', (612, 638), True, 'import numpy as np\n'), ((733, 753), 'control.tf', 'control.tf'...
import numpy as np import tensorflow as tf import gzip import cPickle import sys sys.path.extend(['alg/']) import vcl import coreset import utils class SplitMnistGenerator(): def __init__(self): # Open data file f = gzip.open('data/mnist.pkl.gz', 'rb') train_set, valid_set, test_set = cPic...
[ "vcl.run_vcl_shared", "numpy.savez", "gzip.open", "numpy.hstack", "numpy.where", "numpy.size", "utils.plot", "sys.path.extend", "numpy.random.seed", "tensorflow.compat.v1.set_random_seed", "numpy.vstack", "tensorflow.compat.v1.reset_default_graph", "cPickle.load" ]
[((81, 106), 'sys.path.extend', 'sys.path.extend', (["['alg/']"], {}), "(['alg/'])\n", (96, 106), False, 'import sys\n'), ((4431, 4465), 'tensorflow.compat.v1.reset_default_graph', 'tf.compat.v1.reset_default_graph', ([], {}), '()\n', (4463, 4465), True, 'import tensorflow as tf\n'), ((4482, 4527), 'tensorflow.compat.v...
import os import sys from pbstools import PythonJob from shutil import copyfile import datetime import numpy as np python_file = r"/home/jeromel/Documents/Projects/Deep2P/repos/deepinterpolation/examples/cluster_lib/generic_ephys_process_sync.py" output_folder = "/allen/programs/braintv/workgroups/neuralcoding/Neurop...
[ "numpy.memmap", "os.path.join", "os.path.realpath", "datetime.datetime.now", "os.mkdir", "os.path.basename", "pbstools.PythonJob" ]
[((867, 901), 'numpy.memmap', 'np.memmap', (['dat_file'], {'dtype': '"""int16"""'}), "(dat_file, dtype='int16')\n", (876, 901), True, 'import numpy as np\n'), ((1080, 1103), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1101, 1103), False, 'import datetime\n'), ((1307, 1362), 'os.path.join', 'os....
import numpy as np from soco_openqa.soco_mrc.mrc_model import MrcModel from collections import defaultdict class Reader: def __init__(self, model): self.model_id = model self.reader = MrcModel('us', n_gpu=1) self.thresh = 0.8 def predict(self, query, top_passages): batch ...
[ "soco_openqa.soco_mrc.mrc_model.MrcModel", "collections.defaultdict", "numpy.argmax" ]
[((207, 230), 'soco_openqa.soco_mrc.mrc_model.MrcModel', 'MrcModel', (['"""us"""'], {'n_gpu': '(1)'}), "('us', n_gpu=1)\n", (215, 230), False, 'from soco_openqa.soco_mrc.mrc_model import MrcModel\n'), ((628, 645), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (639, 645), False, 'from collections...
import numpy as np import pandas as pd from munch import Munch from plaster.run.priors import ParamsAndPriors, Prior, Priors from plaster.tools.aaseq.aaseq import aa_str_to_list from plaster.tools.schema import check from plaster.tools.schema.schema import Schema as s from plaster.tools.utils import utils from plaster....
[ "plaster.tools.schema.schema.Schema.is_bool", "plaster.tools.schema.schema.Schema.is_str", "plaster.tools.utils.utils.listi", "numpy.ascontiguousarray", "plaster.tools.schema.check.list_or_tuple_t", "plaster.tools.utils.utils.easy_join", "numpy.zeros", "plaster.tools.aaseq.aaseq.aa_str_to_list", "pl...
[((957, 1161), 'munch.Munch', 'Munch', ([], {'n_pres': '(1)', 'n_mocks': '(0)', 'n_edmans': '(1)', 'dyes': '[]', 'labels': '[]', 'allow_edman_cterm': '(False)', 'enable_ptm_labels': '(False)', 'use_lognormal_model': '(False)', 'is_survey': '(False)', 'n_samples_train': '(5000)', 'n_samples_test': '(1000)'}), '(n_pres=1...
import itertools as itt import numpy as np from pytriqs.gf import BlockGf, GfImFreq, inverse, GfImTime, make_zero_tail, replace_by_tail, fit_tail_on_window, fit_hermitian_tail_on_window class MatsubaraGreensFunction(BlockGf): """ Greens functions interface to TRIQS. Provides convenient initialization. gf...
[ "numpy.identity", "numpy.eye", "matplotlib.pyplot.savefig", "itertools.product", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.array", "pytriqs.gf.BlockGf.__lshift__", "pytriqs.gf.make_zero_tail", "pytriqs.gf.replace_by_tail" ]
[((9404, 9441), 'numpy.array', 'np.array', (['[w.imag for w in self.mesh]'], {}), '([w.imag for w in self.mesh])\n', (9412, 9441), True, 'import numpy as np\n'), ((9772, 9794), 'matplotlib.pyplot.savefig', 'plt.savefig', (['file_name'], {}), '(file_name)\n', (9783, 9794), True, 'from matplotlib import pyplot as plt\n')...
try: from api.users import credentials from api.trusted_curator import TrustedCurator from api.policy import Policy from api.models import DNN_CV, OurDataset, methodology2 except: from project2.api.users import credentials from project2.api.trusted_curator import TrustedCurator from project2...
[ "numpy.mean", "project2.api.policy.Policy", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "project2.api.trusted_curator.TrustedCurator", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((539, 603), 'project2.api.trusted_curator.TrustedCurator', 'TrustedCurator', ([], {'user': '"""master"""', 'password': '"""<PASSWORD>"""', 'mode': '"""off"""'}), "(user='master', password='<PASSWORD>', mode='off')\n", (553, 603), False, 'from project2.api.trusted_curator import TrustedCurator\n'), ((640, 708), 'proje...
# Standard library import atexit import os import socket import sys import time # Third-party # Third-party import theano theano.config.optimizer = 'None' theano.config.mode = 'FAST_COMPILE' theano.config.reoptimize_unpickled_function = False theano.config.cxx = "" from astropy.table import QTable import h5py import n...
[ "hq.log.logger.warning", "numpy.isin", "sys.exit", "numpy.random.RandomState", "os.path.exists", "hq.samples_analysis.extract_MAP_sample", "hq.config.Config.from_run_name", "socket.gethostname", "atexit.register", "hq.log.logger.log", "run_apogee.tmpdir_combine", "h5py.File", "hq.log.logger....
[((810, 858), 'os.path.join', 'os.path.join', (['tmpdir', 'f"""worker-{worker_id}.hdf5"""'], {}), "(tmpdir, f'worker-{worker_id}.hdf5')\n", (822, 858), False, 'import os\n'), ((874, 902), 'astropy.table.QTable.read', 'QTable.read', (['c.metadata_file'], {}), '(c.metadata_file)\n', (885, 902), False, 'from astropy.table...
import unittest import numpy as np import torch from torch.autograd import Variable import torch.nn from pyoptmat import ode, models, flowrules, hardening, utility, damage from pyoptmat.temperature import ConstantParameter as CP torch.set_default_tensor_type(torch.DoubleTensor) torch.autograd.set_detect_anomaly(Tru...
[ "numpy.copy", "torch.autograd.set_detect_anomaly", "numpy.abs", "numpy.allclose", "pyoptmat.hardening.NoKinematicHardeningModel", "numpy.ndenumerate", "torch.set_default_tensor_type", "torch.tensor", "numpy.zeros", "numpy.linspace", "torch.zeros_like", "torch.autograd.Variable", "pyoptmat.te...
[((233, 282), 'torch.set_default_tensor_type', 'torch.set_default_tensor_type', (['torch.DoubleTensor'], {}), '(torch.DoubleTensor)\n', (262, 282), False, 'import torch\n'), ((283, 322), 'torch.autograd.set_detect_anomaly', 'torch.autograd.set_detect_anomaly', (['(True)'], {}), '(True)\n', (316, 322), False, 'import to...
import typing import numpy as np def find_divisors( n: int, ) -> np.array: i = np.arange(int(n ** .5)) i += 1 i = i[n % i == 0] i = np.hstack((i, n // i)) return np.unique(i) def gpf( n: int = 1 << 20, ) -> np.array: s = np.arange(n) s[:2] = -1 i = 0 while i * i < n - 1: i += 1 if s...
[ "numpy.unique", "numpy.hstack", "numpy.flatnonzero", "numba.njit", "numba.pycc.CC", "my_module.solve", "numpy.arange" ]
[((146, 168), 'numpy.hstack', 'np.hstack', (['(i, n // i)'], {}), '((i, n // i))\n', (155, 168), True, 'import numpy as np\n'), ((178, 190), 'numpy.unique', 'np.unique', (['i'], {}), '(i)\n', (187, 190), True, 'import numpy as np\n'), ((244, 256), 'numpy.arange', 'np.arange', (['n'], {}), '(n)\n', (253, 256), True, 'im...
#!/usr/bin/env python3 import sys, os, re, math, copy import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Circle, PathPatch # import the Python wrapper from dubinswrapper import DubinsWrapper as dubins ################################################ # Scenarios ########################...
[ "dubinswrapper.DubinsWrapper.shortest_path_GDIP", "dubinswrapper.DubinsWrapper.shortest_path", "os.makedirs", "matplotlib.pyplot.gca", "matplotlib.pyplot.plot", "math.sqrt", "matplotlib.pyplot.clf", "matplotlib.pyplot.axis", "math.cos", "numpy.array", "numpy.zeros", "numpy.argmin", "numpy.mi...
[((971, 1007), 'os.makedirs', 'os.makedirs', (['"""images"""'], {'exist_ok': '(True)'}), "('images', exist_ok=True)\n", (982, 1007), False, 'import sys, os, re, math, copy\n'), ((1477, 1506), 'matplotlib.pyplot.plot', 'plt.plot', (['x_val', 'y_val', 'specs'], {}), '(x_val, y_val, specs)\n', (1485, 1506), True, 'import ...
from __future__ import print_function from __future__ import division from __future__ import unicode_literals from __future__ import absolute_import import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib import gridspec from kcsd import csd_profile as CSD from kcsd import Validat...
[ "numpy.mean", "numpy.abs", "matplotlib.pyplot.savefig", "matplotlib.pyplot.colorbar", "kCSD_with_reliability_map_2D.make_reconstruction", "kCSD_with_reliability_map_2D.matrix_symmetrization", "numpy.linspace", "matplotlib.pyplot.figure", "matplotlib.gridspec.GridSpec", "numpy.zeros", "matplotlib...
[((2030, 2067), 'numpy.linspace', 'np.linspace', (['(0)', '(0.2)', '(3)'], {'endpoint': '(True)'}), '(0, 0.2, 3, endpoint=True)\n', (2041, 2067), True, 'import numpy as np\n'), ((2072, 2151), 'matplotlib.pyplot.colorbar', 'plt.colorbar', (['im'], {'cax': 'cax', 'orientation': '"""horizontal"""', 'format': '"""%.2f"""',...
import requests from typing import List from bs4 import BeautifulSoup import http.cookiejar as cookielib import numpy as np import re crawl_header = {"user-agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11"} # 根据工资获取中间段 def get_midfix(sala...
[ "bs4.BeautifulSoup", "numpy.sum", "re.findall", "requests.get" ]
[((2753, 2784), 'requests.get', 'requests.get', (['url', 'crawl_header'], {}), '(url, crawl_header)\n', (2765, 2784), False, 'import requests\n'), ((2796, 2830), 'bs4.BeautifulSoup', 'BeautifulSoup', (['web.content', '"""lxml"""'], {}), "(web.content, 'lxml')\n", (2809, 2830), False, 'from bs4 import BeautifulSoup\n'),...
import numpy as np from pymoo.model.survival import Survival from pymoo.util.misc import calc_constraint_violation class FitnessSurvival(Survival): """ This survival method is just for single-objective algorithm. Simply sort by first constraint violation and then fitness value and truncate the worst ind...
[ "pymoo.util.misc.calc_constraint_violation", "numpy.zeros" ]
[((565, 589), 'numpy.zeros', 'np.zeros', (['pop.F.shape[0]'], {}), '(pop.F.shape[0])\n', (573, 589), True, 'import numpy as np\n'), ((621, 653), 'pymoo.util.misc.calc_constraint_violation', 'calc_constraint_violation', (['pop.G'], {}), '(pop.G)\n', (646, 653), False, 'from pymoo.util.misc import calc_constraint_violati...
""" Author: <NAME> Last change: 7pm 8/12/2020 linkedin: https://www.linkedin.com/in/abraham-lemus-ruiz/ """ import requests import pandas as pd import numpy as np from sklearn.metrics import accuracy_score,mean_squared_error, r2_score from sklearn.model_selection import train_test_split from sklearn.linear_model imp...
[ "requests.post", "sklearn.preprocessing.PolynomialFeatures", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.OneHotEncoder", "sklearn.linear_model.Ridge", "sklearn.impute.KNNImputer", "sklearn.metrics.mean_squared_error", "sklearn.preprocessing.StandardScaler", ...
[((1859, 1904), 'pandas.read_csv', 'pd.read_csv', (['"""train_dataset_digitalhouse.csv"""'], {}), "('train_dataset_digitalhouse.csv')\n", (1870, 1904), True, 'import pandas as pd\n'), ((2693, 2914), 'sklearn.compose.ColumnTransformer', 'ColumnTransformer', (["[('ed_exp', numeric_transformer1, numeric_for_knnimputer1), ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019-04-17 15:58 # @Author : erwin import numpy as np from common.util_function import * np.set_printoptions(precision=3) arr = np.linspace(0, 100, 10).reshape((2, 5)) print_line("原始数据") print_br(arr) print_line("单个array操作") print_br(np.add(arr, 2)) print_b...
[ "numpy.abs", "numpy.multiply", "numpy.ceil", "numpy.sqrt", "numpy.add", "numpy.power", "numpy.round", "numpy.floor", "numpy.subtract", "numpy.linspace", "numpy.cos", "numpy.sin", "numpy.divide", "numpy.set_printoptions" ]
[((150, 182), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(3)'}), '(precision=3)\n', (169, 182), True, 'import numpy as np\n'), ((297, 311), 'numpy.add', 'np.add', (['arr', '(2)'], {}), '(arr, 2)\n', (303, 311), True, 'import numpy as np\n'), ((322, 341), 'numpy.subtract', 'np.subtract', (['arr...
import networkx import numpy import chainer from chainer_chemistry.dataset.graph_dataset.base_graph_dataset import PaddingGraphDataset, SparseGraphDataset # NOQA from chainer_chemistry.dataset.graph_dataset.base_graph_data import PaddingGraphData, SparseGraphData # NOQA from chainer_chemistry.dataset.graph_dataset.f...
[ "chainer_chemistry.dataset.graph_dataset.base_graph_dataset.SparseGraphDataset", "numpy.ones", "networkx.to_numpy_array", "numpy.argsort", "numpy.array", "numpy.empty", "chainer_chemistry.dataset.graph_dataset.base_graph_dataset.PaddingGraphDataset", "numpy.all" ]
[((2023, 2060), 'numpy.empty', 'numpy.empty', (['n_edges'], {'dtype': 'numpy.int'}), '(n_edges, dtype=numpy.int)\n', (2034, 2060), False, 'import numpy\n'), ((2077, 2114), 'numpy.empty', 'numpy.empty', (['n_edges'], {'dtype': 'numpy.int'}), '(n_edges, dtype=numpy.int)\n', (2088, 2114), False, 'import numpy\n'), ((2132,...
import tensorflow as tf from datetime import datetime from packaging import version from tensorflow import keras import numpy as np def celsius_to_fahrenheit(c): return (c * (9/5)) + 32 model = keras.models.Sequential([ keras.layers.Dense(16, input_dim=1, activation='relu'), keras.layers.Dense(6, activat...
[ "numpy.random.normal", "tensorflow.keras.layers.Dense", "tensorflow.keras.callbacks.TensorBoard" ]
[((410, 453), 'tensorflow.keras.callbacks.TensorBoard', 'keras.callbacks.TensorBoard', ([], {'log_dir': 'logdir'}), '(log_dir=logdir)\n', (437, 453), False, 'from tensorflow import keras\n'), ((589, 630), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(500, 224, 224, 3)'}), '(size=(500, 224, 224, 3))\n', (60...
# Copyright (c) 2020, salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause import sys import torch import transformers import numpy as np from contexttimer import Timer from typ...
[ "transformers.TrainingArguments", "experiments.misc_utils.is_prediction_correct", "experiments.misc_utils.create_datasets", "experiments.remote_utils.save_and_mirror_scp_to_remote", "numpy.argmax", "numpy.squeeze", "experiments.misc_utils.get_dataloader", "experiments.misc_utils.create_tokenizer_and_m...
[((1520, 1610), 'experiments.misc_utils.get_dataloader', 'misc_utils.get_dataloader', ([], {'dataset': 'train_dataset', 'batch_size': 'batch_size', 'random': 'random'}), '(dataset=train_dataset, batch_size=batch_size,\n random=random)\n', (1545, 1610), False, 'from experiments import misc_utils\n'), ((1646, 1947), '...
import numpy as np # PyTorch stuff import torch # ------ MINE-F LOSS FUNCTION ------ # def minef_loss(x_sample, y_sample, model, device): # Shuffle y-data for the second expectation idxs = np.random.choice( range(len(y_sample)), size=len(y_sample), replace=False) # We need y_shuffle attached to ...
[ "torch.log", "torch.mean", "torch.exp", "numpy.exp", "torch.tensor" ]
[((1190, 1266), 'torch.tensor', 'torch.tensor', (['x_sample'], {'dtype': 'torch.float', 'device': 'device', 'requires_grad': '(True)'}), '(x_sample, dtype=torch.float, device=device, requires_grad=True)\n', (1202, 1266), False, 'import torch\n'), ((1291, 1367), 'torch.tensor', 'torch.tensor', (['y_sample'], {'dtype': '...
import numpy as np import matplotlib.pyplot as plot import cPickle import mscentipede import argparse import gzip def plot_profile(footprint_model, background_model, mlen, protocol): foreground = np.array([1]) for j in xrange(footprint_model.J): foreground = np.array([p for val in foreground for p in ...
[ "argparse.ArgumentParser", "gzip.open", "numpy.array", "matplotlib.pyplot.figure", "cPickle.load", "numpy.arange" ]
[((202, 215), 'numpy.array', 'np.array', (['[1]'], {}), '([1])\n', (210, 215), True, 'import numpy as np\n'), ((467, 480), 'numpy.array', 'np.array', (['[1]'], {}), '([1])\n', (475, 480), True, 'import numpy as np\n'), ((730, 743), 'matplotlib.pyplot.figure', 'plot.figure', ([], {}), '()\n', (741, 743), True, 'import m...
""" !git clone https: // bitbucket.org / jadslim / german - traffic - signs !ls german - traffic - sign """ import numpy as np import matplotlib.pyplot as plt import keras from keras.models import Sequential from keras.optimizers import Adam from keras.layers import Dense from keras.layers import Flatten, Dropout from...
[ "pandas.read_csv", "matplotlib.pyplot.ylabel", "keras.preprocessing.image.ImageDataGenerator", "keras.layers.Dense", "matplotlib.pyplot.imshow", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.asarray", "numpy.random.seed", "matplotlib.pyplot.axis", "keras.optimizers.Adam", "keras...
[((574, 591), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (588, 591), True, 'import numpy as np\n'), ((1900, 1949), 'pandas.read_csv', 'pd.read_csv', (['"""german-traffic-signs/signnames.csv"""'], {}), "('german-traffic-signs/signnames.csv')\n", (1911, 1949), True, 'import pandas as pd\n'), ((2010, 2...
import unittest import numpy as np from scipy.spatial.distance import cdist from hmc import mmd class TestMMD(unittest.TestCase): def test_mmd(self): n = int(1000*np.random.uniform()) m = int(1000*np.random.uniform()) k = int(10*np.random.uniform()) x = np.random.normal(size=(m, k...
[ "numpy.random.normal", "numpy.allclose", "numpy.triu_indices", "scipy.spatial.distance.cdist", "numpy.random.exponential", "numpy.sum", "numpy.random.uniform", "hmc.mmd" ]
[((293, 322), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(m, k)'}), '(size=(m, k))\n', (309, 322), True, 'import numpy as np\n'), ((335, 364), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(n, k)'}), '(size=(n, k))\n', (351, 364), True, 'import numpy as np\n'), ((378, 401), 'numpy.random.expo...
#!/usr/bin/env python3 import numpy as np import os import shutil from PIL import Image import cv2 from scipy.misc import imread pascal_colormap = [ 0, 0, 0, 0.5020, 0, 0, 0, 0.5020, 0, 0.5020, 0.5020, 0, 0, 0, 0.5020, 0.5020, 0, 0.5020, 0, 0.5020, 0.5020, 0.5020, 0.5020, 0.5020, 0...
[ "os.path.exists", "numpy.repeat", "os.makedirs", "numpy.where", "PIL.Image.new", "numpy.array", "scipy.misc.imread", "numpy.zeros", "cv2.cvtColor", "shutil.rmtree", "numpy.zeros_like" ]
[((9388, 9405), 'scipy.misc.imread', 'imread', (['image_dir'], {}), '(image_dir)\n', (9394, 9405), False, 'from scipy.misc import imread\n'), ((9769, 9793), 'PIL.Image.new', 'Image.new', (['"""P"""', '(16, 16)'], {}), "('P', (16, 16))\n", (9778, 9793), False, 'from PIL import Image\n'), ((10120, 10152), 'os.path.exists...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Module that contains DCC functionality for 3ds Max """ from __future__ import print_function, division, absolute_import from collections import OrderedDict from Qt.QtWidgets import QApplication, QMainWindow import numpy as np from pymxs import runtime as rt from...
[ "pymxs.runtime.isValidNode", "pymxs.runtime.actionMan.executeAction", "pymxs.runtime.select", "tpDcc.dccs.max.core.scene.get_selected_nodes", "pymxs.runtime.getCurrentSelection", "tpDcc.dccs.max.core.scene.new_scene", "pymxs.runtime.getTransformLockFlags", "tpDcc.dccs.max.core.helpers.get_max_version"...
[((1682, 1735), 'pymxs.runtime.pathConfig.setCurrentProjectFolder', 'rt.pathConfig.setCurrentProjectFolder', (['workspace_path'], {}), '(workspace_path)\n', (1719, 1735), True, 'from pymxs import runtime as rt\n'), ((1925, 1961), 'pymxs.runtime.actionMan.executeAction', 'rt.actionMan.executeAction', (['(0)', '"""310"""...
# -*- coding: utf-8 -*- import tensorflow as tf from tensorflow.core.protobuf import saver_pb2 import numpy as np import cv2 import matplotlib.pyplot as plt import os from os.path import join as pjoin import sys import copy import detect_face import nn4 as network import random import sklearn from sklearn.externals...
[ "cv2.rectangle", "tensorflow.Graph", "detect_face.create_mtcnn", "tensorflow.ConfigProto", "cv2.imshow", "detect_face.detect_face", "cv2.waitKey", "numpy.empty", "cv2.circle", "cv2.cvtColor", "tensorflow.GPUOptions", "cv2.resize", "cv2.imread" ]
[((1019, 1054), 'numpy.empty', 'np.empty', (['(w, h, 3)'], {'dtype': 'np.uint8'}), '((w, h, 3), dtype=np.uint8)\n', (1027, 1054), True, 'import numpy as np\n'), ((1613, 1636), 'cv2.imread', 'cv2.imread', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (1623, 1636), False, 'import cv2\n'), ((1669, 1708), 'cv2.cvtColor', 'cv2....
from __future__ import print_function import tensorflow as tf import keras from tensorflow.keras.models import load_model from keras import backend as K from keras.layers import Input import numpy as np import subprocess from tensorloader import TensorLoader as tl import matplotlib.pyplot as plt from matplotlib.backend...
[ "argparse.ArgumentParser", "tensorloader.TensorLoader.readTensors", "tensorloader.TensorLoader.getSeqSigTensor", "tensorflow.keras.models.load_model", "numpy.expand_dims", "numpy.concatenate", "numpy.moveaxis", "time.time", "tensorloader.TensorLoader.getPEASFeatures" ]
[((632, 696), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""CoRE-ATAC Prediction Tool"""'}), "(description='CoRE-ATAC Prediction Tool')\n", (655, 696), False, 'import argparse\n'), ((1478, 1495), 'tensorflow.keras.models.load_model', 'load_model', (['model'], {}), '(model)\n', (1488, 14...
import time import cv2 import numpy as np from numba import njit from scipy.ndimage import correlate from sklearn.linear_model import Ridge def compute_image_grads(image): kernel_hor = np.array([-1, 0, 1], dtype=np.float32).reshape(1, 3) kernel_ver = kernel_hor.T grad_hor = correlate(image.astype(...
[ "numpy.reshape", "numpy.sqrt", "numpy.argpartition", "sklearn.linear_model.Ridge", "numpy.square", "numpy.exp", "numpy.array", "numpy.maximum", "time.time" ]
[((425, 455), 'numpy.maximum', 'np.maximum', (['grad_hor', 'grad_ver'], {}), '(grad_hor, grad_ver)\n', (435, 455), True, 'import numpy as np\n'), ((568, 633), 'numpy.array', 'np.array', (['[[1, -2, 1], [-2, 4, -2], [1, -2, 1]]'], {'dtype': 'np.float32'}), '([[1, -2, 1], [-2, 4, -2], [1, -2, 1]], dtype=np.float32)\n', (...
""" Met Grid -------- Grids for meterological stuff """ import os import numpy as np from multigrids import TemporalGrid, common # try: from atm.tools import stack_rasters # except ImportError: # from ..tools import stack_rasters class MetGridShapeError(Exception): """Raised if data shape is not corr...
[ "numpy.memmap", "os.path.join" ]
[((608, 646), 'numpy.memmap', 'np.memmap', (['args[3]'], {'dtype': 'dt', 'mode': '"""r"""'}), "(args[3], dtype=dt, mode='r')\n", (617, 646), True, 'import numpy as np\n'), ((2028, 2076), 'os.path.join', 'os.path.join', (['path', "(filename_start + '_fdd.yaml')"], {}), "(path, filename_start + '_fdd.yaml')\n", (2040, 20...
"""A plot of the deltas for erosion between scenarios.""" import os import sys from pyiem.dep import read_env from pyiem.util import logger, get_dbconn from tqdm import tqdm import numpy as np LOG = logger() def readfile(fn, lengths): """Our env reader.""" try: df = read_env(fn) except Exception...
[ "os.listdir", "numpy.average", "tqdm.tqdm", "os.path.join", "pyiem.util.get_dbconn", "pyiem.util.logger", "sys.exit", "pyiem.dep.read_env" ]
[((201, 209), 'pyiem.util.logger', 'logger', ([], {}), '()\n', (207, 209), False, 'from pyiem.util import logger, get_dbconn\n'), ((698, 716), 'pyiem.util.get_dbconn', 'get_dbconn', (['"""idep"""'], {}), "('idep')\n", (708, 716), False, 'from pyiem.util import logger, get_dbconn\n'), ((1266, 1281), 'tqdm.tqdm', 'tqdm',...
#%% import pandas as pd import numpy as np #%% # Load the File df21 = pd.read_csv('data/Smashwords21/smashwords_april_2021.csv') # %% # check total rows vs. total UNIQUE links (expect some duplicates) len(df21), len(df21.Link.unique()) #%% # drop duplicates df21 = df21.drop_duplicates('Link') #%% # Glance at high and...
[ "numpy.isinf", "pandas.read_csv" ]
[((71, 129), 'pandas.read_csv', 'pd.read_csv', (['"""data/Smashwords21/smashwords_april_2021.csv"""'], {}), "('data/Smashwords21/smashwords_april_2021.csv')\n", (82, 129), True, 'import pandas as pd\n'), ((1554, 1569), 'numpy.isinf', 'np.isinf', (['words'], {}), '(words)\n', (1562, 1569), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- """ Created on Fri Sep 27 15:04:09 2019 @author: EMG EPMA Microsegregation Analysis """ from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn import metrics import seaborn as sns import matplotlib.pyplot as plt import ...
[ "matplotlib.pyplot.ylabel", "numpy.log", "pandas.read_excel", "statsmodels.api.OLS", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.axhline", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylim", "prettytable.PrettyTable", "statsmodels.api.add_constant", "matplotlib....
[((1001, 1024), 'pandas.read_excel', 'pd.read_excel', (['filename'], {}), '(filename)\n', (1014, 1024), True, 'import pandas as pd\n'), ((1902, 1933), 'matplotlib.pyplot.scatter', 'plt.scatter', (['Fe', 'Si'], {'label': '"""Si"""'}), "(Fe, Si, label='Si')\n", (1913, 1933), True, 'import matplotlib.pyplot as plt\n'), ((...
import numpy as np def flux(x): return 0.5 * np.square(x) def minf(a,b): # if b<=0: # return flux(b) # elif a>=0: # return flux(a) # else: # return 0.0 return (b <= 0) * flux(b) + (a >= 0) * flux(a) def maxf(a,b): return np.maximum(flux(a),flux(b))
[ "numpy.square" ]
[((50, 62), 'numpy.square', 'np.square', (['x'], {}), '(x)\n', (59, 62), True, 'import numpy as np\n')]
import numpy as np import zmq from meta_mb.logger import logger import gym from gym import spaces from meta_mb.meta_envs.base import MetaEnv import time class PR2Env(MetaEnv, gym.utils.EzPickle): PR2_GAINS = np.array([3.09, 1.08, 0.393, 0.674, 0.111, 0.152, 0.098]) def __init__(self): # self.goal = n...
[ "numpy.clip", "numpy.mean", "numpy.ones", "gym.spaces.Box", "numpy.array", "gym.utils.EzPickle.__init__", "numpy.concatenate", "numpy.linalg.norm", "numpy.frombuffer", "zmq.Context" ]
[((214, 271), 'numpy.array', 'np.array', (['[3.09, 1.08, 0.393, 0.674, 0.111, 0.152, 0.098]'], {}), '([3.09, 1.08, 0.393, 0.674, 0.111, 0.152, 0.098])\n', (222, 271), True, 'import numpy as np\n'), ((1011, 1024), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (1022, 1024), False, 'import zmq\n'), ((1190, 1207), 'numpy...
# -*- coding: utf-8 -*- """ 损失函数 Authors: dongrenguang(<EMAIL>) Date: 2021/10/17 """ import numpy as np from ..core import Node from ..operator import SoftMax class LossFunction(Node): """损失函数抽象类 """ pass class PerceptionLoss(LossFunction): """感知机损失 """ def compute(self): # 输入为正时为0,...
[ "numpy.where", "numpy.log" ]
[((575, 613), 'numpy.where', 'np.where', (['(parent.value >= 0.0)', '(0.0)', '(-1)'], {}), '(parent.value >= 0.0, 0.0, -1)\n', (583, 613), True, 'import numpy as np\n'), ((361, 428), 'numpy.where', 'np.where', (['(self.parents[0].value >= 0.0)', '(0.0)', '(-self.parents[0].value)'], {}), '(self.parents[0].value >= 0.0,...
import numpy as np X = np.array([ [1,0,0], [-1,10,0], [-1,-1,0], ]) y = np.array([-1,1,1]) def perceptron_sgd(X, Y): w = np.zeros(len(X[0])) eta = 1 epochs = 20 for t in range(epochs): for i, x in enumerate(X): if (np.dot(X[i], w)*Y[i]) <= 0: prin...
[ "numpy.array", "numpy.dot" ]
[((24, 71), 'numpy.array', 'np.array', (['[[1, 0, 0], [-1, 10, 0], [-1, -1, 0]]'], {}), '([[1, 0, 0], [-1, 10, 0], [-1, -1, 0]])\n', (32, 71), True, 'import numpy as np\n'), ((91, 111), 'numpy.array', 'np.array', (['[-1, 1, 1]'], {}), '([-1, 1, 1])\n', (99, 111), True, 'import numpy as np\n'), ((272, 287), 'numpy.dot',...
import argparse import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Normal from torch.autograd import grad from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler from tensorboardX import SummaryWriter...
[ "torch.tanh", "torch.distributions.Normal", "tensorboardX.SummaryWriter", "argparse.ArgumentParser", "torch.FloatTensor", "torch.exp", "torch.nn.MSELoss", "numpy.array", "torch.cuda.is_available", "torch.tensor", "torch.nn.Linear", "torch.zeros", "torch.clamp", "torch.cat" ]
[((418, 443), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (441, 443), False, 'import argparse\n'), ((354, 379), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (377, 379), False, 'import torch\n'), ((3324, 3349), 'torch.nn.Linear', 'nn.Linear', (['state_dim', '(512)']...
""" Alternative implementations of segmented regression routines. """ # Author: <NAME> # License: BSD 3 clause import numpy as np from segreg.model.alt import regression_alt, one_bkpt_segreg_alt,\ likelihood_util try: from numba import jit except ImportError as e: from segreg.mockjit import jit # cache...
[ "numpy.copy", "segreg.model.alt.regression_alt.ols_terms", "numpy.isscalar", "numpy.logical_and", "numpy.searchsorted", "segreg.model.alt.likelihood_util.loglikelihood", "segreg.model.alt.likelihood_util.rss_line_segment", "numpy.append", "numpy.array", "segreg.model.alt.regression_alt.mat_by_hand...
[((6142, 6160), 'segreg.mockjit.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (6145, 6160), False, 'from segreg.mockjit import jit\n'), ((7457, 7475), 'segreg.mockjit.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (7460, 7475), False, 'from segreg.mockjit import jit\n'), ((8069, 8100)...
#DataFormatFunctions import numpy as np from PIL import Image from HelperClasses import * from ValueDefinitions import * def createMNISTVector(filename): image = Image.open(filename).convert("L") #Convert to greyscale width, height = image.size assert (width==IMG_WIDTH and height==IMG_HEIGHT) imgDa...
[ "numpy.zeros", "PIL.Image.open" ]
[((359, 384), 'numpy.zeros', 'np.zeros', (['(IMG_PIXELS, 1)'], {}), '((IMG_PIXELS, 1))\n', (367, 384), True, 'import numpy as np\n'), ((623, 648), 'numpy.zeros', 'np.zeros', (['(IMG_PIXELS, 1)'], {}), '((IMG_PIXELS, 1))\n', (631, 648), True, 'import numpy as np\n'), ((838, 871), 'numpy.zeros', 'np.zeros', (['(IMG_HEIGH...
import chess import numpy as np class State: def __init__(self, board=None): if board is None: self.board = chess.Board() else: self.board = board def serialize(self) -> np.ndarray: """ Convert board into matrix representation for use with numpy. ...
[ "chess.scan_reversed", "numpy.zeros", "chess.Board" ]
[((699, 718), 'numpy.zeros', 'np.zeros', (['(8 * 8 + 5)'], {}), '(8 * 8 + 5)\n', (707, 718), True, 'import numpy as np\n'), ((862, 878), 'numpy.zeros', 'np.zeros', (['(64 + 5)'], {}), '(64 + 5)\n', (870, 878), True, 'import numpy as np\n'), ((897, 953), 'chess.scan_reversed', 'chess.scan_reversed', (['self.board.occupi...
import logging import unittest import numpy as np import torch from reagent.core import types as rlt from reagent.evaluation.evaluation_data_page import EvaluationDataPage from reagent.evaluation.ope_adapter import OPEstimatorAdapter from reagent.ope.estimators.contextual_bandits_estimators import ( DMEstimator, ...
[ "logging.getLogger", "reagent.evaluation.evaluation_data_page.EvaluationDataPage.create_from_tensors_seq2slate", "torch.LongTensor", "torch.eye", "reagent.test.evaluation.test_evaluation_data_page.FakeSeq2SlateTransformerNet", "reagent.ope.estimators.contextual_bandits_estimators.IPSEstimator", "reagent...
[((552, 579), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (569, 579), False, 'import logging\n'), ((2703, 2731), 'reagent.test.evaluation.test_evaluation_data_page.FakeSeq2SlateRewardNetwork', 'FakeSeq2SlateRewardNetwork', ([], {}), '()\n', (2729, 2731), False, 'from reagent.test.evalu...
#from frm_generate_data_np import * import numpy as np from numpy import pi,sqrt model_folder="models/freq_2019_07_02_2/" from frm_modulations import mod_list,cont_phase_mod_list,linear_mod_const # import tensorflow as tf import datetime import pickle import sys import copy from frm_dataset_creator import * from num...
[ "frm_modulations_fast.modulate_symbols_fast", "frm_modulations_fast.modulate_symbols", "numpy.array", "copy.deepcopy", "numpy.imag", "numpy.arange", "numpy.repeat", "numpy.diff", "numpy.real", "numpy.random.seed", "sys.stdout.flush", "numpy.random.choice", "numba.jit", "pickle.dump", "nu...
[((9567, 9585), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (9570, 9585), False, 'from numba import jit\n'), ((2796, 2830), 'numpy.zeros', 'np.zeros', (['(n_samples, pkt_size, 2)'], {}), '((n_samples, pkt_size, 2))\n', (2804, 2830), True, 'import numpy as np\n'), ((2845, 2879), 'numpy.zeros',...
import tensorflow as tf import os import numpy as np import logging logger = logging.getLogger("detect") class Step1CNN: def __init__(self, step1_model_dir): self.model_dir = step1_model_dir self.model_path = os.path.join(self.model_dir, 'frozen_inference_graph.pb') self._graph = None ...
[ "logging.getLogger", "tensorflow.Graph", "tensorflow.Session", "os.path.join", "tensorflow.GraphDef", "numpy.expand_dims", "tensorflow.import_graph_def", "tensorflow.gfile.GFile" ]
[((78, 105), 'logging.getLogger', 'logging.getLogger', (['"""detect"""'], {}), "('detect')\n", (95, 105), False, 'import logging\n'), ((232, 289), 'os.path.join', 'os.path.join', (['self.model_dir', '"""frozen_inference_graph.pb"""'], {}), "(self.model_dir, 'frozen_inference_graph.pb')\n", (244, 289), False, 'import os...
# Visualize Reults with MatPlotlib etc... import matplotlib.pyplot as plt import numpy as np class Visualization(object): def __init__(self, dataset): super().__init__() self.dataset = dataset self.estimated_state = None self.estimated_varf = None def getEstimatedValu...
[ "matplotlib.pyplot.title", "numpy.sqrt", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((1034, 1068), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {'figsize': '(8, 6)'}), '(1, 1, figsize=(8, 6))\n', (1046, 1068), True, 'import matplotlib.pyplot as plt\n'), ((1105, 1132), 'matplotlib.pyplot.title', 'plt.title', (['"""GPS trajactory"""'], {}), "('GPS trajactory')\n", (1114, 1132), True, ...
import pymc3 as pm import matplotlib.pyplot as pl from matplotlib import dates import numpy as np import pandas as pd from . import ephem, MPLSTYLE, PACKAGEDIR from .cobs import read_cobs class CometModel(): def __init__(self, comet="2019 Y4", cobs_id=None, horizons_id=None, start="2020-01-01",...
[ "numpy.log10", "numpy.nanpercentile", "pandas.read_csv", "matplotlib.pyplot.ylabel", "numpy.nanmean", "numpy.array", "pymc3.sample", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.max", "matplotlib.pyplot.close", "matplotlib.pyplot.scatter", "numpy.datetime64", "pandas.DataFr...
[((8380, 8423), 'pandas.read_csv', 'pd.read_csv', (["(PACKAGEDIR / 'data/comets.csv')"], {}), "(PACKAGEDIR / 'data/comets.csv')\n", (8391, 8423), True, 'import pandas as pd\n'), ((9033, 9053), 'pandas.DataFrame', 'pd.DataFrame', (['result'], {}), '(result)\n', (9045, 9053), True, 'import pandas as pd\n'), ((10161, 1018...
""" Serve as a convenient wrapper for validate.py. """ import gc import os import timeit import IPython import torch import numpy as np import scipy.misc as misc import yaml from torch.utils import data from ptsemseg.loader import get_loader from ptsemseg.utils import get_logger from utils import test_parser from ...
[ "numpy.log", "torch.from_numpy", "numpy.ascontiguousarray", "numpy.array", "scipy.misc.imresize", "ptsemseg.loader.get_loader", "pydensecrf.densecrf.DenseCRF2D", "os.path.exists", "utils.test_parser", "numpy.where", "ptsemseg.utils.get_logger", "scipy.misc.imsave", "validate_from_file.final_...
[((679, 693), 'os.chdir', 'os.chdir', (['ROOT'], {}), '(ROOT)\n', (687, 693), False, 'import os\n'), ((2340, 2377), 'scipy.misc.imsave', 'misc.imsave', (['img_path_target', 'decoded'], {}), '(img_path_target, decoded)\n', (2351, 2377), True, 'import scipy.misc as misc\n'), ((10122, 10155), 'ptsemseg.utils.get_logger', ...
# -*- coding: utf-8 -*- """ @author: <NAME> <<EMAIL>> Date: Oct 2017 """ import numba as nb from numba import jit, njit, float64, int32 import numpy as np nb.NUMBA_DISABLE_JIT = 0 GLOB_NOGIL = True GLOB_PARALLEL = True # %% Simulation environment processing # f.i. port and part flow processing, material properties ...
[ "numpy.log10", "numpy.log", "numpy.roots", "numpy.equal", "numpy.array", "numba.prange", "numpy.greater", "numpy.less", "numpy.where", "numpy.max", "numpy.exp", "numpy.dot", "numpy.empty", "numpy.maximum", "numpy.abs", "numpy.ones", "numpy.full", "numba.njit", "numpy.any", "num...
[((363, 411), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'nogil': 'GLOB_NOGIL', 'cache': '(True)'}), '(nopython=True, nogil=GLOB_NOGIL, cache=True)\n', (366, 411), False, 'from numba import jit, njit, float64, int32\n'), ((931, 965), 'numba.njit', 'njit', ([], {'nogil': 'GLOB_NOGIL', 'cache': '(True)'}), '(nogil=G...
from activfuncs import plot, x import numpy as np def softplus(x): return np.log(1+np.exp(x)) plot(softplus, yaxis=(-0.4, 1.4))
[ "numpy.exp", "activfuncs.plot" ]
[((100, 133), 'activfuncs.plot', 'plot', (['softplus'], {'yaxis': '(-0.4, 1.4)'}), '(softplus, yaxis=(-0.4, 1.4))\n', (104, 133), False, 'from activfuncs import plot, x\n'), ((88, 97), 'numpy.exp', 'np.exp', (['x'], {}), '(x)\n', (94, 97), True, 'import numpy as np\n')]
import gym import numpy as np import os import random import time import pandas from tqdm import tqdm import matplotlib.pyplot as plt from sklearn.model_selection import ParameterGrid np.random.seed(42) random.seed(42) def print_state_values_tabular(Q, size=8): # Get the max value for state V = [max(q_s) fo...
[ "sklearn.model_selection.ParameterGrid", "random.choice", "matplotlib.pyplot.ylabel", "numpy.random.random", "numpy.random.choice", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "random.seed", "time.sleep", "numpy.random.seed", "pandas.DataFrame", "os.system", "time.time", "gym.mak...
[((184, 202), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (198, 202), True, 'import numpy as np\n'), ((203, 218), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (214, 218), False, 'import random\n'), ((1651, 1672), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Episode"""'], {}), "('Episo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 22 15:58:57 2021 @author: javier """ import numpy as np def abs_v(x, y): return np.abs(x - y) def quadratic(x, y): return (x-y) * (x-y) def square(x, y): return np.sqrt(abs_v(x, y)) def squarewise(x, y): return np.abs(np.sqrt(x) ...
[ "numpy.abs", "numpy.sqrt" ]
[((156, 169), 'numpy.abs', 'np.abs', (['(x - y)'], {}), '(x - y)\n', (162, 169), True, 'import numpy as np\n'), ((368, 389), 'numpy.abs', 'np.abs', (['(x * x - y * y)'], {}), '(x * x - y * y)\n', (374, 389), True, 'import numpy as np\n'), ((309, 319), 'numpy.sqrt', 'np.sqrt', (['x'], {}), '(x)\n', (316, 319), True, 'im...
import numpy as np from scipy.spatial import Voronoi from scipy.spatial import Delaunay from ..graph import Graph from ...core.utils import as_id_array class VoronoiGraph(Graph): """Graph of a voronoi grid. Examples -------- >>> from landlab.graph import VoronoiGraph """ def __init__(self,...
[ "numpy.ptp", "numpy.where", "numpy.asarray", "numpy.count_nonzero", "numpy.array", "numpy.empty" ]
[((2043, 2082), 'numpy.array', 'np.array', (['delaunay.simplices'], {'dtype': 'int'}), '(delaunay.simplices, dtype=int)\n', (2051, 2082), True, 'import numpy as np\n'), ((2112, 2151), 'numpy.array', 'np.array', (['delaunay.neighbors'], {'dtype': 'int'}), '(delaunay.neighbors, dtype=int)\n', (2120, 2151), True, 'import ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Nov 25 13:53:40 2017 @author: ratnadeepb @License: MIT """ # System Imports import numpy as np import sys # Local imports from InnerProductSpaces.dot import dot from InnerProductSpaces.norm import norm def angle(u, v, op="radians"): n_u = norm(u)...
[ "InnerProductSpaces.dot.dot", "InnerProductSpaces.norm.norm", "numpy.isnan", "sys.exit", "numpy.round" ]
[((313, 320), 'InnerProductSpaces.norm.norm', 'norm', (['u'], {}), '(u)\n', (317, 320), False, 'from InnerProductSpaces.norm import norm\n'), ((331, 338), 'InnerProductSpaces.norm.norm', 'norm', (['v'], {}), '(v)\n', (335, 338), False, 'from InnerProductSpaces.norm import norm\n'), ((839, 852), 'numpy.isnan', 'np.isnan...
from functools import lru_cache import numpy as np from .geometry import Circle, Point, Rectangle def bbox_center(region): """Return the center of the bounding box of an scikit-image region. Parameters ---------- region A scikit-image region as calculated by skimage.measure.regionprops(). ...
[ "numpy.copy", "numpy.nanstd", "numpy.nanmedian", "numpy.deg2rad", "numpy.nanmax", "numpy.nanmin", "functools.lru_cache" ]
[((2158, 2178), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(1)'}), '(maxsize=1)\n', (2167, 2178), False, 'from functools import lru_cache\n'), ((1958, 1982), 'numpy.nanmedian', 'np.nanmedian', (['masked_img'], {}), '(masked_img)\n', (1970, 1982), True, 'import numpy as np\n'), ((2130, 2151), 'numpy.nanstd', ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys ###AWG sys.path.append('/home/pulseepr/Sources/AWG/Examples/python') ###sys.path.append('/home/anatoly/AWG/spcm_examples/python') ##sys.path.append('/home/anatoly/awg_files/python') #sys.path.append('C:/Users/User/Desktop/Examples/python') import nump...
[ "numpy.average", "os.path.join", "os.getcwd", "os.path.dirname", "numpy.zeros", "numpy.sum", "atomize.general_modules.general_functions.message", "sys.exit", "sys.path.append", "atomize.device_modules.config.config_utils.read_specific_parameters" ]
[((76, 137), 'sys.path.append', 'sys.path.append', (['"""/home/pulseepr/Sources/AWG/Examples/python"""'], {}), "('/home/pulseepr/Sources/AWG/Examples/python')\n", (91, 137), False, 'import sys\n'), ((651, 676), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (666, 676), False, 'import os\n'), ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.5 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # s_ga...
[ "scipy.stats.gamma.cdf", "matplotlib.pyplot.grid", "scipy.stats.gamma.rvs", "matplotlib.pyplot.title", "matplotlib.pyplot.xticks", "numpy.ones", "arpym.tools.add_logo", "numpy.log", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "matplotlib.pyplot.bar", "matplotlib.pyplot.yticks", ...
[((1087, 1121), 'scipy.stats.gamma.rvs', 'stats.gamma.rvs', (['k', 'theta'], {'size': 'j_'}), '(k, theta, size=j_)\n', (1102, 1121), True, 'import scipy.stats as stats\n'), ((1266, 1294), 'scipy.stats.gamma.cdf', 'stats.gamma.cdf', (['x', 'k', 'theta'], {}), '(x, k, theta)\n', (1281, 1294), True, 'import scipy.stats as...
#!/bin/env python # -*- coding: utf-8 -*- ## # test_solvers.py: Checks correctness of azure.quantum.optimization module. ## # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. ## import pytest from asyncmock import AsyncMock, patch, Mock from azure.quantum.aio.optimization imp...
[ "numpy.savez", "common.expected_terms", "asyncmock.Mock", "os.path.isfile", "azure.quantum.aio.optimization.Problem", "numpy.array", "azure.quantum.optimization.Term", "asyncmock.AsyncMock", "asyncmock.patch", "pytest.raises", "pytest.fixture", "numpy.load", "os.remove" ]
[((685, 701), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (699, 701), False, 'import pytest\n'), ((564, 575), 'asyncmock.AsyncMock', 'AsyncMock', ([], {}), '()\n', (573, 575), False, 'from asyncmock import AsyncMock, patch, Mock\n'), ((608, 660), 'asyncmock.AsyncMock', 'AsyncMock', ([], {'return_value': '"""m...
import io import logging import sqlite3 from os.path import abspath, dirname, join, exists import numpy as np from speaker_verification.utils.logger import SpeakerVerificationLogger DATABASE_PATH = join(abspath(dirname(__file__)), "SQL", "sqlite.db") logger = SpeakerVerificationLogger(name=__file__) logger.setLevel(...
[ "os.path.exists", "sqlite3.register_converter", "sqlite3.register_adapter", "speaker_verification.utils.logger.SpeakerVerificationLogger", "sqlite3.connect", "io.BytesIO", "os.path.dirname", "numpy.load", "numpy.save" ]
[((263, 303), 'speaker_verification.utils.logger.SpeakerVerificationLogger', 'SpeakerVerificationLogger', ([], {'name': '__file__'}), '(name=__file__)\n', (288, 303), False, 'from speaker_verification.utils.logger import SpeakerVerificationLogger\n'), ((673, 722), 'sqlite3.register_adapter', 'sqlite3.register_adapter',...
# The functions defined here were copied based on the source code # defined in xarray import datetime from typing import Any, Iterable import numpy as np import pandas as pd try: import cftime except ImportError: cftime = None try: import dask.array dask_array_type = dask.array.Array except Impor...
[ "pandas.isnull", "pandas.to_timedelta", "dask.is_dask_collection", "xarray.core.duck_array_ops._datetime_nanmin", "numpy.asarray", "numpy.array", "numpy.issubdtype", "numpy.isnan", "numpy.timedelta64", "numpy.isnat", "numpy.dtype", "numpy.zeros_like" ]
[((2217, 2233), 'numpy.asarray', 'np.asarray', (['data'], {}), '(data)\n', (2227, 2233), True, 'import numpy as np\n'), ((875, 901), 'dask.is_dask_collection', 'dask.is_dask_collection', (['x'], {}), '(x)\n', (898, 901), False, 'import dask\n'), ((2511, 2525), 'numpy.isnat', 'np.isnat', (['data'], {}), '(data)\n', (251...
import numpy as np def run_optimizer(opt, cost_f, iterations, *args, **kwargs): errors = [cost_f.eval(cost_f.x_start, cost_f.y_start)] xs,ys= [cost_f.x_start],[cost_f.y_start] for epochs in range(iterations): x, y= opt.step(*args, **kwargs) xs.append(x) ys.append(y) errors....
[ "numpy.array" ]
[((369, 381), 'numpy.array', 'np.array', (['xs'], {}), '(xs)\n', (377, 381), True, 'import numpy as np\n'), ((406, 418), 'numpy.array', 'np.array', (['ys'], {}), '(ys)\n', (414, 418), True, 'import numpy as np\n')]
# Filename: preprocessing.py # Authors: apadin, mgkallit # Start Date: 3/7/2017 # Last Update: 3/7/2017 """Helper functions for preprocessing data scale_features - Scale X matrix to put values in range of about -0.5 to 0.5 auto_regression - Adds n auto-regressive features to the X matrix """ #==========...
[ "numpy.concatenate", "numpy.roll", "numpy.nan_to_num" ]
[((616, 639), 'numpy.nan_to_num', 'np.nan_to_num', (['X_scaled'], {}), '(X_scaled)\n', (629, 639), True, 'import numpy as np\n'), ((783, 796), 'numpy.roll', 'np.roll', (['y', '(1)'], {}), '(y, 1)\n', (790, 796), True, 'import numpy as np\n'), ((826, 851), 'numpy.concatenate', 'np.concatenate', (['(X, y)', '(1)'], {}), ...
''' <NAME> Python version: 3.6 Conway's Game of life ''' import numpy import math def get_generation(cells, generations): #_ the direction of adjacent cells adj = ((-2, -2), (-2, -1), (-2, 0), (-1, -2), (-1, 0), (0, -2), (0, -1), (0, 0)) def status(cells, cur): print("\n...
[ "numpy.full", "numpy.random.randint" ]
[((2251, 2287), 'numpy.random.randint', 'numpy.random.randint', (['(2)'], {'size': '(3, 5)'}), '(2, size=(3, 5))\n', (2271, 2287), False, 'import numpy\n'), ((616, 664), 'numpy.full', 'numpy.full', (['(h + 2, w + 2)', '(-1)'], {'dtype': 'numpy.int8'}), '((h + 2, w + 2), -1, dtype=numpy.int8)\n', (626, 664), False, 'imp...
import zmq import sys import math import numpy class Broker: context = zmq.Context() router = context.socket(zmq.ROUTER) #poller = zmq.Poller() p = 0 def __init__(self, n): self.op = {"WorkDone":self.serverResponse, "serverFREE":self.serverFree} self.router.bind("tcp://*:5000") ...
[ "math.ceil", "math.floor", "math.acos", "math.sqrt", "numpy.random.randint", "zmq.Context" ]
[((77, 90), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (88, 90), False, 'import zmq\n'), ((3913, 3937), 'math.sqrt', 'math.sqrt', (['(x * x + y * y)'], {}), '(x * x + y * y)\n', (3922, 3937), False, 'import math\n'), ((4196, 4210), 'math.acos', 'math.acos', (['var'], {}), '(var)\n', (4205, 4210), False, 'import ma...
from cv2 import cv2 import time import pyautogui import numpy as np import mss from os import listdir # from run import getBackgroundText import torch from random import randint # example_captcha_img = cv2.imread('images/example.png') model = torch.hub.load('./captcha', 'custom', "captcha/bomb_captcha.pt", source='lo...
[ "os.listdir", "torch.hub.load", "mss.mss", "random.randint", "numpy.where", "cv2.cv2.imread", "pyautogui.moveTo", "pyautogui.mouseUp", "pyautogui.mouseDown", "time.sleep", "cv2.cv2.cvtColor", "cv2.cv2.matchTemplate", "cv2.cv2.groupRectangles" ]
[((245, 330), 'torch.hub.load', 'torch.hub.load', (['"""./captcha"""', '"""custom"""', '"""captcha/bomb_captcha.pt"""'], {'source': '"""local"""'}), "('./captcha', 'custom', 'captcha/bomb_captcha.pt', source='local'\n )\n", (259, 330), False, 'import torch\n'), ((1264, 1281), 'os.listdir', 'listdir', (['dir_name'], ...
import numpy as np import cv2 from enum import Enum class Models(Enum): ssd_lite = 'ssd_lite' tiny_yolo = 'tiny_yolo' tf_lite = 'tf_lite' def __str__(self): return self.value @staticmethod def from_string(s): try: return Models[s] except KeyError: ...
[ "numpy.radians", "cv2.warpAffine", "numpy.minimum", "numpy.where", "numpy.sin", "numpy.append", "numpy.array", "numpy.argsort", "numpy.zeros", "numpy.cos", "cv2.cvtColor", "numpy.maximum", "cv2.getRotationMatrix2D", "cv2.resize", "cv2.imread" ]
[((483, 505), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (493, 505), False, 'import cv2\n'), ((517, 555), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2RGB'], {}), '(image, cv2.COLOR_BGR2RGB)\n', (529, 555), False, 'import cv2\n'), ((1412, 1429), 'numpy.radians', 'np.radians', (['th...
from datetime import datetime import numpy as np import pandas as pd from sklearn.utils import shuffle from data_process import data_process_utils from data_process.census_process.census_data_creation_config import census_data_creation from data_process.census_process.census_degree_process_utils import consistentize_...
[ "data_process.data_process_utils.save_df_data", "pandas.read_csv", "datetime.datetime.utcnow", "data_process.census_process.census_degree_process_utils.consistentize_census9495_columns", "sklearn.utils.shuffle", "data_process.data_process_utils.combine_src_tgt_data", "numpy.concatenate", "data_process...
[((2656, 2723), 'pandas.read_csv', 'pd.read_csv', (['data_path'], {'names': 'CENSUS_COLUMNS', 'skipinitialspace': '(True)'}), '(data_path, names=CENSUS_COLUMNS, skipinitialspace=True)\n', (2667, 2723), True, 'import pandas as pd\n'), ((3020, 3060), 'data_process.census_process.census_degree_process_utils.consistentize_...
import math from typing import Optional, Union, Tuple, List import numpy as np import torch import torch.nn.functional as F from torch import Tensor from torch_geometric.utils.num_nodes import maybe_num_nodes from torch_scatter import scatter, segment_csr, gather_csr from torch_scatter.utils import broadcast import ...
[ "torch.tanh", "torch_geometric.utils.num_nodes.maybe_num_nodes", "torch_scatter.utils.broadcast", "torch.sigmoid", "math.sqrt", "torch.nn.functional.dropout", "numpy.max", "torch_scatter.scatter", "torch_scatter.segment_csr", "torch.cat", "torch.tensor_split" ]
[((946, 973), 'torch.cat', 'torch.cat', (['tensors'], {'dim': 'dim'}), '(tensors, dim=dim)\n', (955, 973), False, 'import torch\n'), ((1591, 1628), 'torch.tensor_split', 'torch.tensor_split', (['input', '(2)'], {'dim': 'dim'}), '(input, 2, dim=dim)\n', (1609, 1628), False, 'import torch\n'), ((5872, 5904), 'torch_geome...
"""Utility Functions about Instruments """ import numpy as np from exojax.utils.constants import c def R2STD(R): """ compute Standard deveiation of Gaussian velocity distribution from spectral resolution Args: R: spectral resolution R Returns: beta (km/s) standard deviation of Gaussian v...
[ "numpy.linspace", "numpy.log" ]
[((898, 927), 'numpy.linspace', 'np.linspace', (['(1000)', '(2000)', '(1000)'], {}), '(1000, 2000, 1000)\n', (909, 927), True, 'import numpy as np\n'), ((562, 584), 'numpy.log', 'np.log', (['(nu[-1] / nu[0])'], {}), '(nu[-1] / nu[0])\n', (568, 584), True, 'import numpy as np\n'), ((381, 392), 'numpy.log', 'np.log', (['...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
[ "numpy.log", "ast.literal_eval", "gin.configurable", "tensorflow.compat.v1.constant", "tensorflow.compat.v1.concat", "tensorflow.compat.v1.Session" ]
[((1099, 1135), 'gin.configurable', 'gin.configurable', (['"""DistributionSpec"""'], {}), "('DistributionSpec')\n", (1115, 1135), False, 'import gin\n'), ((2695, 2730), 'ast.literal_eval', 'ast.literal_eval', (['distribution_spec'], {}), '(distribution_spec)\n', (2711, 2730), False, 'import ast\n'), ((5961, 5991), 'ten...
# coding=utf-8 # Copyright 2019 The Google Research 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 applicab...
[ "numpy.eye", "collections.namedtuple", "numpy.allclose", "math.sqrt", "math.cos", "numpy.stack", "numpy.array", "numpy.zeros", "numpy.einsum", "math.atan2", "collections.Counter", "collections.defaultdict", "numpy.linalg.eigh", "numpy.concatenate", "numpy.dot", "math.sin", "numpy.zer...
[((1503, 1603), 'collections.namedtuple', 'collections.namedtuple', (['"""CanonicalizedSymmetry"""', "['u1s', 'semisimple_part', 'spin3_cartan_gens']"], {}), "('CanonicalizedSymmetry', ['u1s', 'semisimple_part',\n 'spin3_cartan_gens'])\n", (1525, 1603), False, 'import collections\n'), ((1982, 2041), 'collections.nam...
#!/usr/bin/env python3 import argparse import png import numpy as np import csv from matplotlib import pyplot as plt # map a scalar value to a color from a colormap def map_to_color(scalar, colormap): if scalar is None: return None # search in list to find scalar lo = int(0) hi = int(colormap....
[ "numpy.flip", "numpy.reshape", "png.Reader", "argparse.ArgumentParser", "numpy.double", "numpy.linalg.norm", "numpy.floor", "numpy.max", "numpy.dot", "csv.Sniffer", "numpy.min", "csv.reader" ]
[((2140, 2158), 'numpy.min', 'np.min', (['cmap[:, 0]'], {}), '(cmap[:, 0])\n', (2146, 2158), True, 'import numpy as np\n'), ((2174, 2192), 'numpy.max', 'np.max', (['cmap[:, 0]'], {}), '(cmap[:, 0])\n', (2180, 2192), True, 'import numpy as np\n'), ((3308, 3328), 'png.Reader', 'png.Reader', (['filename'], {}), '(filename...
import numpy as np from sdia_python.lab2.utils import get_random_number_generator class BallWindow: """Represents a ball in any dimension, defined by a center and a radius""" def __init__(self, center, radius): """Initializes a ball with a center and a radius. The radius must be positive. A...
[ "numpy.product", "sdia_python.lab2.utils.get_random_number_generator", "numpy.array", "numpy.linalg.norm", "numpy.all", "numpy.math.factorial" ]
[((478, 494), 'numpy.array', 'np.array', (['center'], {}), '(center)\n', (486, 494), True, 'import numpy as np\n'), ((1139, 1154), 'numpy.array', 'np.array', (['point'], {}), '(point)\n', (1147, 1154), True, 'import numpy as np\n'), ((2342, 2387), 'numpy.all', 'np.all', (['[(point in self) for point in points]'], {}), ...
from soccerdepth.data.dataset_loader import get_set import numpy as np import utils.files as file_utils from os.path import join import argparse from soccerdepth.models.hourglass import hg8 from soccerdepth.models.utils import weights_init from soccerdepth.data.data_utils import image_logger_converter_visdom import to...
[ "torch.from_numpy", "utils.files.get_platform_datadir", "torch.cuda.is_available", "soccerdepth.data.data_utils.image_logger_converter_visdom", "soccerdepth.models.hourglass.hg8", "visdom.Visdom", "argparse.ArgumentParser", "torch.autograd.Variable", "numpy.ones", "torch.Tensor", "torch.nn.NLLLo...
[((607, 640), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (630, 640), False, 'import warnings\n'), ((652, 708), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Depth AutoEncoder"""'}), "(description='Depth AutoEncoder')\n", (675, 708), Fal...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for novice submodule. :license: modified BSD """ import os, tempfile import numpy as np from image_novice import novice from numpy.testing import TestCase, assert_equal, assert_raises, assert_allclose def _array_2d_to_RGB(array): return np.tile(array[:, :, n...
[ "numpy.tile", "numpy.testing.assert_equal", "numpy.testing.assert_allclose", "numpy.testing.assert_raises", "os.path.abspath", "numpy.zeros", "image_novice.novice.new", "numpy.linspace", "tempfile.NamedTemporaryFile", "image_novice.novice.open", "image_novice.novice.Picture", "image_novice.nov...
[((299, 342), 'numpy.tile', 'np.tile', (['array[:, :, np.newaxis]', '(1, 1, 3)'], {}), '(array[:, :, np.newaxis], (1, 1, 3))\n', (306, 342), True, 'import numpy as np\n'), ((483, 512), 'image_novice.novice.open', 'novice.open', (['self.sample_path'], {}), '(self.sample_path)\n', (494, 512), False, 'from image_novice im...
import sys import os import argparse import unittest import warnings import contextlib import numpy as np import numpy.testing as nptest import unittest import ants import superiq def run_tests(): unittest.main() class TestModule_super_resolution_segmentation_per_label(unittest.TestCase): def test_super_reso...
[ "ants.threshold_image", "superiq.super_resolution_segmentation_per_label", "superiq.sort_library_by_similarity", "ants.kmeans_segmentation", "ants.get_ants_data", "ants.get_data", "ants.add_noise_to_image", "ants.iMath", "ants.registration", "numpy.floor", "numpy.zeros", "unittest.main", "an...
[((203, 218), 'unittest.main', 'unittest.main', ([], {}), '()\n', (216, 218), False, 'import unittest\n'), ((399, 427), 'numpy.zeros', 'np.zeros', (['(size, size, size)'], {}), '((size, size, size))\n', (407, 427), True, 'import numpy as np\n'), ((858, 877), 'ants.from_numpy', 'ants.from_numpy', (['AA'], {}), '(AA)\n',...
import numpy as np import threading import queue import time from common import gtec import matplotlib.pyplot as plt from common.config import * class Recorder: def __init__( self, sample_duration=SAMPLE_DURATION, num_channels=2, channel_offset=0, signal_type="emg", ): ...
[ "common.gtec.GUSBamp", "matplotlib.pyplot.figure", "numpy.zeros", "matplotlib.pyplot.tight_layout", "threading.Thread", "queue.Queue", "time.time", "matplotlib.pyplot.show" ]
[((3165, 3193), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 10)'}), '(figsize=(12, 10))\n', (3175, 3193), True, 'import matplotlib.pyplot as plt\n'), ((3619, 3637), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (3635, 3637), True, 'import matplotlib.pyplot as plt\n'), ((36...
""" Licensed Materials - Property of IBM Restricted Materials of IBM 20190891 © Copyright IBM Corp. 2021 All Rights Reserved. """ import logging import joblib import numpy as np from sklearn.cluster import KMeans from sklearn.exceptions import NotFittedError from ibmfl.util import config from ibmfl.model.sklearn_fl_mo...
[ "logging.getLogger", "ibmfl.util.config.get_absolute_path", "ibmfl.exceptions.ModelException", "ibmfl.exceptions.LocalTrainingException", "numpy.array", "joblib.load", "ibmfl.model.model_update.ModelUpdate" ]
[((509, 536), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (526, 536), False, 'import logging\n'), ((5209, 5246), 'ibmfl.model.model_update.ModelUpdate', 'ModelUpdate', ([], {'weights': 'cluster_centers_'}), '(weights=cluster_centers_)\n', (5220, 5246), False, 'from ibmfl.model.model_up...
import csv import sys import pandas as pd import os import glob import time import numpy as np from datetime import datetime import statistics import error from elaboratedata import * from sklearn.metrics import confusion_matrix, matthews_corrcoef from math import ceil SLEEP=10 #check if attack file exists def attack...
[ "numpy.tile", "math.ceil", "numpy.argmax", "time.sleep", "os.path.isfile", "numpy.sum", "numpy.array", "numpy.empty", "os.system", "numpy.save", "sklearn.metrics.matthews_corrcoef", "numpy.load" ]
[((1515, 1545), 'numpy.argmax', 'np.argmax', (['pred_normal'], {'axis': '(1)'}), '(pred_normal, axis=1)\n', (1524, 1545), True, 'import numpy as np\n'), ((1583, 1613), 'numpy.argmax', 'np.argmax', (['predictions'], {'axis': '(1)'}), '(predictions, axis=1)\n', (1592, 1613), True, 'import numpy as np\n'), ((1649, 1674), ...
import numpy as np from sklearn.pipeline import Pipeline from sklearn import clone from sklearn.metrics import accuracy_score from sklearn.preprocessing import StandardScaler from boxcox.optimization import Optimizer from scipy.stats import boxcox class Gridsearch2D(Optimizer): """ Optimization of the lambda ...
[ "numpy.copy", "scipy.stats.boxcox", "sklearn.preprocessing.StandardScaler", "numpy.linspace", "sklearn.clone", "sklearn.metrics.accuracy_score" ]
[((1136, 1214), 'numpy.linspace', 'np.linspace', ([], {'start': 'self.lower_bound', 'stop': 'self.upper_bound', 'num': 'self.nr_points'}), '(start=self.lower_bound, stop=self.upper_bound, num=self.nr_points)\n', (1147, 1214), True, 'import numpy as np\n'), ((1233, 1311), 'numpy.linspace', 'np.linspace', ([], {'start': ...
import numpy as np import utils as ut import detector as det from sklearn.preprocessing import PolynomialFeatures from sklearn.linear_model import LinearRegression class GazeModel: """Linear regression model for gaze estimation. """ def __init__(self, calibration_images, calibration_positions): "...
[ "sklearn.preprocessing.PolynomialFeatures", "detector.find_pupil", "numpy.ones", "numpy.asarray", "numpy.asscalar", "numpy.linalg.lstsq", "utils.pupil_to_int", "sklearn.linear_model.LinearRegression", "numpy.round" ]
[((1090, 1131), 'numpy.linalg.lstsq', 'np.linalg.lstsq', (['D', 'targets_X'], {'rcond': 'None'}), '(D, targets_X, rcond=None)\n', (1105, 1131), True, 'import numpy as np\n'), ((1154, 1195), 'numpy.linalg.lstsq', 'np.linalg.lstsq', (['D', 'targets_Y'], {'rcond': 'None'}), '(D, targets_Y, rcond=None)\n', (1169, 1195), Tr...
import math from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union import moderngl as mgl import numpy as np import vpype as vp from ._utils import ColorType, load_program, load_texture_array if TYPE_CHECKING: # pragma: no cover from .engine import Engine ResourceType = Union[mgl.Buffer, mgl.Text...
[ "vpype.as_vector", "math.ceil", "math.floor", "numpy.array", "numpy.empty", "numpy.concatenate", "numpy.arange" ]
[((1260, 1586), 'numpy.array', 'np.array', (['[(0, 0), (paper_size[0], 0), (paper_size[0], paper_size[1]), (0, paper_size\n [1]), (paper_size[0], shadow_size), (paper_size[0] + shadow_size,\n shadow_size), (paper_size[0] + shadow_size, paper_size[1] + shadow_size\n ), (shadow_size, paper_size[1] + shadow_size)...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
[ "tensorflow.tile", "tensorflow.equal", "tensorflow.shape", "tf_agents.networks.actor_distribution_rnn_network.ActorDistributionRnnNetwork", "tensorflow.reduce_sum", "numpy.log", "tf_agents.utils.nest_utils.flatten_up_to", "tf_agents.networks.network.tf_inspect.getargspec", "tf_agents.specs.tensor_sp...
[((3503, 3540), 'numpy.zeros', 'np.zeros', (['(h, w, d)'], {'dtype': 'np.float32'}), '((h, w, d), dtype=np.float32)\n', (3511, 3540), True, 'import numpy as np\n'), ((9877, 9936), 'tensorflow.nest.map_structure', 'tf.nest.map_structure', (['(lambda l: None)', 'preprocessing_layers'], {}), '(lambda l: None, preprocessin...
import numpy as np __all__ = [ 'Task' ] class Task(object): def __init__(self, ndim=None, seed=None): self._ndim = ndim self.rng = np.random.RandomState(seed) def set_seed(self, seed=None): self.rng = np.random.RandomState(seed) def name(self): return self.__class__.__name__ def ndim(self...
[ "numpy.random.get_state", "numpy.random.set_state", "skopt.learning.gaussian_process.kernels.Matern", "numpy.random.seed", "numpy.random.RandomState" ]
[((145, 172), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (166, 172), True, 'import numpy as np\n'), ((222, 249), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (243, 249), True, 'import numpy as np\n'), ((713, 734), 'numpy.random.get_state', 'np.ra...
import pandas as pd import gensim import multiprocessing import numpy as np from utils import pickle_obj, semantic_search_author, semantic_search_word, get_related_authors, get_related_words, translate_dict from sklearn.manifold import TSNE from bokeh.plotting import figure, show, output_notebook, output_file, save fro...
[ "pandas.read_csv", "gensim.test.utils.get_tmpfile", "multiprocessing.cpu_count", "numpy.concatenate", "gensim.models.doc2vec.Doc2Vec", "time.time", "gensim.utils.simple_preprocess" ]
[((479, 531), 'pandas.read_csv', 'pd.read_csv', (['"""assets/dataframes/all_authors_df_2004"""'], {}), "('assets/dataframes/all_authors_df_2004')\n", (490, 531), True, 'import pandas as pd\n'), ((540, 577), 'pandas.read_csv', 'pd.read_csv', (['"""assets/dataframes/suDf"""'], {}), "('assets/dataframes/suDf')\n", (551, 5...
from unittest import TestCase from numpy import array, ndarray from numpy.testing import assert_array_equal from trigger import accel_value, trigger_time class TriggerTimeTest(TestCase): def test_estimates_when_function_exceeds(self): function = 10 t = array([1599574034]) trig_level = 100 ...
[ "numpy.array", "numpy.ndarray", "trigger.trigger_time", "trigger.accel_value", "numpy.testing.assert_array_equal" ]
[((275, 294), 'numpy.array', 'array', (['[1599574034]'], {}), '([1599574034])\n', (280, 294), False, 'from numpy import array, ndarray\n'), ((339, 350), 'numpy.ndarray', 'ndarray', (['[]'], {}), '([])\n', (346, 350), False, 'from numpy import array, ndarray\n'), ((368, 405), 'trigger.trigger_time', 'trigger_time', (['f...
import json import maya import pandas as pd import numpy as np import matplotlib.pyplot as plt days = { 0:'monday', 1:'tuesday', 2:'wednesday', 3:'thursday', 4:'friday', 5:'saturday', 6:'sunday' } NEWLINE = '\n' SPACE = ' ' COLON = ':' def day(t): # where t means unformatted time ...
[ "matplotlib.pyplot.ylabel", "numpy.arange", "matplotlib.pyplot.gca", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.close", "maya.parse", "matplotlib.pyplot.scatter", "pandas.DataFrame", "matplotlib.pyplot.title", "json.dump", "matplotlib.pyplot.show" ]
[((3456, 3465), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (3463, 3465), True, 'import matplotlib.pyplot as plt\n'), ((3893, 3959), 'pandas.DataFrame', 'pd.DataFrame', (["{'day': arj_day, 'hour': arj_hour, 'date': arj_date}"], {}), "({'day': arj_day, 'hour': arj_hour, 'date': arj_date})\n", (3905, 3959), Tru...
import numpy as np import sys from flare import gp, env, struc, kernels from flare.modules import analyze_gp, qe_parsers from mc_kernels import mc_simple from scipy.optimize import minimize import time import datetime def sweep(txt_name, data_file, cell, training_snaps, cutoffs, kernel, kernel_grad, initial...
[ "numpy.abs", "numpy.sqrt", "datetime.datetime.now", "flare.modules.analyze_gp.MDAnalysis", "flare.modules.analyze_gp.get_gp_from_snaps", "flare.modules.analyze_gp.predict_forces_on_test_set", "time.time" ]
[((466, 504), 'flare.modules.analyze_gp.MDAnalysis', 'analyze_gp.MDAnalysis', (['data_file', 'cell'], {}), '(data_file, cell)\n', (487, 504), False, 'from flare.modules import analyze_gp, qe_parsers\n'), ((1611, 1649), 'flare.modules.analyze_gp.MDAnalysis', 'analyze_gp.MDAnalysis', (['data_file', 'cell'], {}), '(data_f...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 29 16:10:21 2018 @author: michelcassard """ import seaborn as sns import numpy as np import matplotlib.pyplot as plt import matplotlib.pyplot as plt2 import pandas as pd from pandas import datetime import math, time import itertools from sklearn im...
[ "keras.layers.core.Flatten", "matplotlib.pyplot.ylabel", "numpy.hstack", "numpy.log", "math.sqrt", "numpy.array", "numpy.cov", "numpy.mean", "numpy.reshape", "numpy.repeat", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "pandas.concat", "keras.layers.convolutional.MaxPooling1D", ...
[((1014, 1090), 'os.chdir', 'os.chdir', (['"""/Users/michelcassard/Dropbox (MIT)/15.960 Independant Study/Data"""'], {}), "('/Users/michelcassard/Dropbox (MIT)/15.960 Independant Study/Data')\n", (1022, 1090), False, 'import os\n'), ((1134, 1152), 'pandas.ExcelFile', 'pd.ExcelFile', (['file'], {}), '(file)\n', (1146, 1...
import csv import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import make_interp_spline x1 = [] y1 = [] x2 = [] y2 = [] with open("barrier_width.csv", "r", encoding='utf8') as csvfile: plots = csv.reader(csvfile, delimiter=",") for row in plots: x1.append(float(row...
[ "numpy.polyfit", "numpy.array", "matplotlib.pyplot.subplots", "scipy.interpolate.make_interp_spline", "csv.reader", "numpy.poly1d", "matplotlib.pyplot.show" ]
[((586, 626), 'numpy.array', 'np.array', (['[x for x in x1]'], {'dtype': '"""float"""'}), "([x for x in x1], dtype='float')\n", (594, 626), True, 'import numpy as np\n'), ((633, 673), 'numpy.array', 'np.array', (['[y for y in y1]'], {'dtype': '"""float"""'}), "([y for y in y1], dtype='float')\n", (641, 673), True, 'imp...
import os import time import yaml import pickle import numpy as np from random import shuffle from sklearn.neighbors import KDTree ALL_LAYERS = np.array([[8,2], [8,4], [8,6], [8,8], [13,2], [13,4], ...
[ "numpy.mean", "os.listdir", "pickle.dump", "random.shuffle", "os.makedirs", "yaml.dump", "numpy.where", "numpy.random.choice", "os.path.join", "pickle.load", "numpy.array", "os.path.isdir", "numpy.concatenate", "numpy.std", "time.time", "numpy.random.shuffle" ]
[((146, 247), 'numpy.array', 'np.array', (['[[8, 2], [8, 4], [8, 6], [8, 8], [13, 2], [13, 4], [13, 6], [13, 8], [17, 2\n ], [17, 4]]'], {}), '([[8, 2], [8, 4], [8, 6], [8, 8], [13, 2], [13, 4], [13, 6], [13, 8\n ], [17, 2], [17, 4]])\n', (154, 247), True, 'import numpy as np\n'), ((507, 518), 'time.time', 'time....
import os import unittest import numpy as np import pandas as pd from lusidtools import logger from lusidtools.cocoon.dateorcutlabel import DateOrCutLabel from parameterized import parameterized from datetime import datetime import pytz class CocoonDateOrCutLabelTests(unittest.TestCase): @classmethod def se...
[ "datetime.datetime", "pytz.timezone", "os.getenv", "parameterized.parameterized.expand", "lusidtools.cocoon.dateorcutlabel.DateOrCutLabel", "numpy.array", "numpy.datetime64", "pandas.Timestamp" ]
[((3750, 4420), 'parameterized.parameterized.expand', 'parameterized.expand', (["[['YYYY-mm-dd_dashes', '2019-09-01', '%Y-%m-%d',\n '2019-09-01T00:00:00+00:00'], ['dd/mm/YYYY_ forwardslashes',\n '01/09/2019', '%d/%m/%Y', '2019-09-01T00:00:00+00:00'], [\n 'YYYY-mm-dd HH:MM:SS_dashes_and_colons', '2019-09-01 6:3...
# -*- coding: utf-8 -*- """ Unit tests for the statistics module. :copyright: Copyright 2014-2016 by the Elephant team, see `doc/authors.rst`. :license: Modified BSD, see LICENSE.txt for details. """ from __future__ import division import itertools import math import sys import unittest import neo import numpy as np...
[ "numpy.random.rand", "elephant.kernels.GaussianKernel", "elephant.statistics.fanofactor", "elephant.statistics.lvr", "elephant.kernels.__dict__.values", "quantities.Quantity", "elephant.kernels.TriangularKernel", "numpy.array", "elephant.statistics.isi", "neo.core.SpikeTrain", "numpy.arange", ...
[((42616, 42631), 'unittest2.main', 'unittest.main', ([], {}), '()\n', (42629, 42631), True, 'import unittest2 as unittest\n'), ((771, 863), 'numpy.array', 'np.array', (['[[0.3, 0.56, 0.87, 1.23], [0.02, 0.71, 1.82, 8.46], [0.03, 0.14, 0.15, 0.92]]'], {}), '([[0.3, 0.56, 0.87, 1.23], [0.02, 0.71, 1.82, 8.46], [0.03, 0....
import time import numpy as np from utils.misc_utils import create_testfiles with open('parameters.txt', 'r') as inf: parameters = eval(inf.read()) # Parameter initialization features_per_node = 9 tree_depth = 3 nodes = 0 for i in range(tree_depth + 1): nodes += np.power(4, i) state_size = features_per_node...
[ "utils.misc_utils.create_testfiles", "numpy.power" ]
[((275, 289), 'numpy.power', 'np.power', (['(4)', 'i'], {}), '(4, i)\n', (283, 289), True, 'import numpy as np\n'), ((485, 554), 'utils.misc_utils.create_testfiles', 'create_testfiles', (['current_parameters', 'test_nr'], {'nr_trials_per_test': '(100)'}), '(current_parameters, test_nr, nr_trials_per_test=100)\n', (501,...
#%% import os import pandas as pd import numpy as np import copy from tqdm import tqdm from plot import plot from utils.evaluator import evaluate, set_thresholds from utils.evaluator_seg import compute_anomaly_scores, compute_metrics # Univariate from utils.data_loader import load_kpi, load_IoT_fridge # Multivariate ...
[ "numpy.mean", "numpy.flip", "numpy.average", "numpy.where", "utils.evaluator.evaluate", "os.path.join", "numpy.max", "plot.plot", "os.path.isdir", "copy.deepcopy", "pandas.DataFrame", "utils.evaluator_seg.compute_anomaly_scores", "utils.evaluator.set_thresholds", "utils.evaluator_seg.compu...
[((6713, 6737), 'copy.deepcopy', 'copy.deepcopy', (['ts_scores'], {}), '(ts_scores)\n', (6726, 6737), False, 'import copy\n'), ((6793, 6816), 'pandas.DataFrame', 'pd.DataFrame', (['ts_scores'], {}), '(ts_scores)\n', (6805, 6816), True, 'import pandas as pd\n'), ((7380, 7482), 'plot.plot', 'plot', (['model_name', 'ts_sc...