code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# The MIT License (MIT) # # Copyright (c) 2018 <NAME>, Data Centauri Ltd # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to us...
[ "fxcpy.utils.date_utils.to_ole", "numpy.dtype", "datetime.datetime.utcnow", "fxcpy.exception.RequestTimeOutError", "datetime.timedelta", "fxcpy.utils.date_utils.fm_ole", "numpy.unique" ]
[((2324, 2548), 'numpy.dtype', 'np.dtype', (["[('date', 'datetime64[s]'), ('askopen', '<f8'), ('askhigh', '<f8'), (\n 'asklow', '<f8'), ('askclose', '<f8'), ('bidopen', '<f8'), ('bidhigh',\n '<f8'), ('bidlow', '<f8'), ('bidclose', '<f8'), ('volume', '<i8')]"], {}), "([('date', 'datetime64[s]'), ('askopen', '<f8')...
import cv2 import numpy as np import util from util import nb as neighbour def find_white_components(mask, min_area = 0): mask = (mask == 0) * 1 return find_black_components(mask, min_area); def find_black_components(mask, min_area = 0): """ find components of zeros. mask is a 0-1 matri...
[ "numpy.shape", "util.nb.get_neighbours", "util.img.black" ]
[((413, 433), 'util.img.black', 'util.img.black', (['mask'], {}), '(mask)\n', (427, 433), False, 'import util\n'), ((872, 886), 'numpy.shape', 'np.shape', (['mask'], {}), '(mask)\n', (880, 886), True, 'import numpy as np\n'), ((1267, 1333), 'util.nb.get_neighbours', 'neighbour.get_neighbours', (['cp[0]', 'cp[1]', 'cols...
#StockCard import ticker_data as td import numpy as np class StockCard: ### ## All Cards will be (5x4) market days long (fuck weeks n months) ## ## at starting with dn(tick) then some stock specifics ## each dn(tick) will be ## ohlv ## [ [d0tick[0], d0tick[1], d0tick[2], d0t...
[ "os.mkdir", "os.path.isdir", "numpy.zeros", "datetime.datetime", "ticker_data.EXTRACT", "os.path.isfile", "numpy.array", "numpy.ndarray", "time.localtime" ]
[((11968, 11998), 'numpy.array', 'np.array', (['txt'], {'dtype': '"""float32"""'}), "(txt, dtype='float32')\n", (11976, 11998), True, 'import numpy as np\n'), ((855, 894), 'numpy.zeros', 'np.zeros', (['(1500, 6, 4)'], {'dtype': '"""float32"""'}), "((1500, 6, 4), dtype='float32')\n", (863, 894), True, 'import numpy as n...
# encoding=utf8 import numpy as np from metrics.unified.evaluator import eval_ex_match class EvaluateTool(object): def __init__(self, args): self.args = args def evaluate(self, preds, golds, section): summary = {} all_match = [] interaction_match = {} ...
[ "numpy.mean", "metrics.unified.evaluator.eval_ex_match" ]
[((503, 536), 'metrics.unified.evaluator.eval_ex_match', 'eval_ex_match', (['pred', 'gold_seq_out'], {}), '(pred, gold_seq_out)\n', (516, 536), False, 'from metrics.unified.evaluator import eval_ex_match\n'), ((1297, 1315), 'numpy.mean', 'np.mean', (['all_match'], {}), '(all_match)\n', (1304, 1315), True, 'import numpy...
import gym from gym import spaces import random import numpy as np import matplotlib.pyplot as plt class ContinuousEnv(gym.Env): metadata = {'render.modes': ['human']} def __init__(self, training_bool, min_action, max_action): super(ContinuousEnv, self).__init__() #self.f = func1 # come funz...
[ "numpy.random.uniform", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "random.uniform", "matplotlib.pyplot.ion", "numpy.array", "gym.spaces.Box", "numpy.linspace", "matplotlib.pyplot.pause" ]
[((359, 398), 'numpy.array', 'np.array', (['[0, -99999]'], {'dtype': 'np.float32'}), '([0, -99999], dtype=np.float32)\n', (367, 398), True, 'import numpy as np\n'), ((439, 479), 'numpy.array', 'np.array', (['[100, 99999]'], {'dtype': 'np.float32'}), '([100, 99999], dtype=np.float32)\n', (447, 479), True, 'import numpy ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 13 17:56:03 2019 @author: domenico """ # %% import packages import sys sys.path.append("./src/") from utils import splitVec, tens, putZeroDiag, optim_torch, gen_test_net, soft_lu_bound, soft_l_bound,\ degIO_from_mat, strIO_from_mat, tic, toc, r...
[ "sys.path.append", "utils.strIO_from_mat", "numpy.load", "torch.ones", "matplotlib.pyplot.plot", "dirBin1_dynNets.dirBin1_dynNet_SD", "matplotlib.pyplot.close", "torch.randn", "numpy.array", "torch.zeros", "utils.tens", "dirBin1_dynNets.dirBin1_staNet" ]
[((143, 168), 'sys.path.append', 'sys.path.append', (['"""./src/"""'], {}), "('./src/')\n", (158, 168), False, 'import sys\n'), ((561, 639), 'numpy.load', 'np.load', (['"""./data/world_trade_network/world_trade_net_T.npz"""'], {'allow_pickle': '(True)'}), "('./data/world_trade_network/world_trade_net_T.npz', allow_pick...
# BSD 2-CLAUSE LICENSE # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # Redistributions i...
[ "pandas.DataFrame", "numpy.nanmin", "pandas.concat", "numpy.nanmax" ]
[((3456, 3470), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (3468, 3470), True, 'import pandas as pd\n'), ((5705, 5744), 'numpy.nanmax', 'np.nanmax', (['(flatten_orders + [max_order])'], {}), '(flatten_orders + [max_order])\n', (5714, 5744), True, 'import numpy as np\n'), ((5765, 5804), 'numpy.nanmin', 'np.na...
""" Implements classes and methods related to sampling datasets. """ import numpy as np import random import math from typing import Any, Callable, Dict, List from collections import Iterator from deep500.lv2.dataset import Dataset from deep500.lv2.event import SamplerEvent Distribution = List[float] class Sampler(...
[ "math.ceil", "numpy.random.RandomState", "numpy.array", "numpy.arange", "numpy.ndarray" ]
[((1866, 1898), 'numpy.random.RandomState', 'np.random.RandomState', (['self.seed'], {}), '(self.seed)\n', (1887, 1898), True, 'import numpy as np\n'), ((7758, 7785), 'numpy.arange', 'np.arange', (['self.num_batches'], {}), '(self.num_batches)\n', (7767, 7785), True, 'import numpy as np\n'), ((7167, 7199), 'numpy.ndarr...
# Copyright 2018 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...
[ "strawberryfields.Engine", "tensorflow.clip_by_value", "numpy.isnan", "tensorflow.matmul", "tensorflow.abs", "strawberryfields.ops.BSgate", "numpy.savetxt", "os.path.exists", "numpy.append", "tensorflow.placeholder", "tensorflow.summary.FileWriter", "numpy.loadtxt", "tensorflow.name_scope", ...
[((2270, 2323), 'numpy.loadtxt', 'np.loadtxt', (['"""creditcard_genuine_1.csv"""'], {'delimiter': '""","""'}), "('creditcard_genuine_1.csv', delimiter=',')\n", (2280, 2323), True, 'import numpy as np\n'), ((2342, 2398), 'numpy.loadtxt', 'np.loadtxt', (['"""creditcard_fraudulent_1.csv"""'], {'delimiter': '""","""'}), "(...
"""Training and testing the Pairwise Differentiable Gradient Descent (PDGD) algorithm for unbiased learning to rank. See the following paper for more information on the Pairwise Differentiable Gradient Descent (PDGD) algorithm. * Oosterhuis, Harrie, and <NAME>. "Differentiable unbiased online learning to rank." I...
[ "numpy.zeros_like", "numpy.copy", "numpy.isnan", "torch.mul", "ultra.utils.hparams.HParams", "numpy.amax", "numpy.cumsum", "six.moves.zip", "torch.cuda.is_available", "numpy.exp", "torch.utils.tensorboard.SummaryWriter", "torch.device", "torch.exp", "torch.as_tensor", "ultra.utils.make_r...
[((1729, 1847), 'ultra.utils.hparams.HParams', 'ultra.utils.hparams.HParams', ([], {'learning_rate': '(0.05)', 'tau': '(1)', 'max_gradient_norm': '(1.0)', 'l2_loss': '(0.005)', 'grad_strategy': '"""ada"""'}), "(learning_rate=0.05, tau=1, max_gradient_norm=\n 1.0, l2_loss=0.005, grad_strategy='ada')\n", (1756, 1847),...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Oct 13 16:47:25 2018 @author: julius """ import flask from flask import request import tensorflow as tf import pandas as pd import numpy as np from tensorflow.python.data import Dataset import math import argparse import json import load_model def...
[ "pandas.DataFrame", "argparse.ArgumentParser", "load_model.load_DNNClassifier", "load_model.load_LinearClassifier", "flask.Flask", "tensorflow.logging.set_verbosity", "json.dumps", "tensorflow.python.data.Dataset.from_tensor_slices", "numpy.array", "pandas.Series", "math.log", "flask.request.g...
[((650, 664), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (662, 664), True, 'import pandas as pd\n'), ((1061, 1097), 'tensorflow.python.data.Dataset.from_tensor_slices', 'Dataset.from_tensor_slices', (['features'], {}), '(features)\n', (1087, 1097), False, 'from tensorflow.python.data import Dataset\n'), ((26...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ tests for calculation of RDMs """ import unittest from unittest.mock import Mock, patch import numpy as np from numpy.testing import assert_array_almost_equal from scipy.spatial.distance import pdist, squareform import pyrsa.rdm as rsr import pyrsa as rsa class Test...
[ "numpy.argmax", "numpy.einsum", "numpy.argmin", "pyrsa.rdm.calc_rdm_crossnobis", "numpy.mean", "scipy.spatial.distance.pdist", "pyrsa.rdm.calc_rdm", "numpy.random.randn", "pyrsa.data.Dataset", "numpy.reshape", "numpy.linspace", "numpy.corrcoef", "unittest.mock.patch", "pyrsa.rdm.calc._pars...
[((2772, 2808), 'unittest.mock.patch', 'patch', (['"""pyrsa.rdm.calc._parse_input"""'], {}), "('pyrsa.rdm.calc._parse_input')\n", (2777, 2808), False, 'from unittest.mock import Mock, patch\n'), ((3474, 3510), 'unittest.mock.patch', 'patch', (['"""pyrsa.rdm.calc._parse_input"""'], {}), "('pyrsa.rdm.calc._parse_input')\...
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import itertools def plot_reward_per_episode(reward_ep): episode_rewards = np.array(reward_ep) # se suaviza la curva de convergencia episode_number = np.linspace(1, len(episode_rewards) + 1, len(episode_rewards) + 1) acumulat...
[ "matplotlib.pyplot.title", "numpy.empty", "numpy.clip", "numpy.sin", "numpy.arange", "numpy.random.normal", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "numpy.transpose", "matplotlib.pyplot.colorbar", "numpy.cumsum", "numpy.linspace", "matplotl...
[((157, 176), 'numpy.array', 'np.array', (['reward_ep'], {}), '(reward_ep)\n', (165, 176), True, 'import numpy as np\n'), ((333, 359), 'numpy.cumsum', 'np.cumsum', (['episode_rewards'], {}), '(episode_rewards)\n', (342, 359), True, 'import numpy as np\n'), ((475, 503), 'matplotlib.pyplot.plot', 'plt.plot', (['reward_pe...
import time import gym import gym_chrome_dino import sys import numpy as np from tensorflow.keras import models from gym_chrome_dino.utils.wrappers import make_dino def flatten(data): # 10 * 5 = 50 # R^50 -> R^2 result = [] for i in range(50, 60): for j in range(30, 35): result.appe...
[ "numpy.array", "gym.make", "gym_chrome_dino.utils.wrappers.make_dino" ]
[((492, 517), 'gym.make', 'gym.make', (['"""ChromeDino-v0"""'], {}), "('ChromeDino-v0')\n", (500, 517), False, 'import gym\n'), ((528, 572), 'gym_chrome_dino.utils.wrappers.make_dino', 'make_dino', (['env'], {'timer': '(True)', 'frame_stack': '(True)'}), '(env, timer=True, frame_stack=True)\n', (537, 572), False, 'from...
import requests import numpy as np import time import re ### # this script saves api calls for each rule in a sketch grammar # rules are identified by line number (starting at 0) # grammar.txt is based on Sketch Engine's sketch grammar file # modifications may be needed to run a new file for first time ### # get l...
[ "numpy.load", "re.sub", "requests.get", "time.sleep" ]
[((1100, 1161), 're.sub', 're.sub', (['"""(?<!=)("[\\\\|\\\\.\\\\*A-Z]+")"""', '"""[tag=\\\\g<0>]"""', 'dt[x][1]'], {}), '(\'(?<!=)("[\\\\|\\\\.\\\\*A-Z]+")\', \'[tag=\\\\g<0>]\', dt[x][1])\n', (1106, 1161), False, 'import re\n'), ((1883, 1896), 'time.sleep', 'time.sleep', (['(4)'], {}), '(4)\n', (1893, 1896), False, '...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
[ "json.load", "numpy.allclose", "qiskit_nature.properties.second_quantization.electronic.integrals.TwoBodyElectronicIntegrals", "numpy.isclose", "numpy.arange", "numpy.random.rand", "numpy.eye" ]
[((1057, 1083), 'numpy.random.rand', 'np.random.rand', (['(2)', '(2)', '(2)', '(2)'], {}), '(2, 2, 2, 2)\n', (1071, 1083), True, 'import numpy as np\n'), ((1134, 1208), 'qiskit_nature.properties.second_quantization.electronic.integrals.TwoBodyElectronicIntegrals', 'TwoBodyElectronicIntegrals', (['ElectronicBasis.MO', '...
import argparse import os import shutil import open3d as o3d import time import csv import numpy as np import points import icp import triangulation import verify # CSV_FIELDNAMES = ["num_points", "num_two_percent_dist", "num_two_percent_dist_percent", # "num_five_percent_dist", "num_five_percent_...
[ "triangulation.run_alpha_shape", "os.makedirs", "argparse.ArgumentParser", "icp.run_icp", "csv.DictWriter", "numpy.median", "os.path.basename", "os.path.exists", "open3d.io.write_point_cloud", "time.time", "numpy.mean", "triangulation.run_triangulation", "verify.run_verify", "triangulation...
[((1149, 1173), 'os.path.exists', 'os.path.exists', (['TEMP_DIR'], {}), '(TEMP_DIR)\n', (1163, 1173), False, 'import os\n'), ((1211, 1232), 'os.makedirs', 'os.makedirs', (['TEMP_DIR'], {}), '(TEMP_DIR)\n', (1222, 1232), False, 'import os\n'), ((1358, 1369), 'time.time', 'time.time', ([], {}), '()\n', (1367, 1369), Fals...
import numpy as np import requests import json def parse_maze(grid): # This function is called to parse the maze retrieved from MazebotAPI # into numpy array format (class 'np.ndarray'). for array in grid: index = 0 for element in array: if element == "X": ...
[ "numpy.asarray", "requests.get", "json.dumps" ]
[((435, 451), 'numpy.asarray', 'np.asarray', (['grid'], {}), '(grid)\n', (445, 451), True, 'import numpy as np\n'), ((822, 912), 'requests.get', 'requests.get', (['"""https://api.noopschallenge.com/mazebot/random?min_size=10&max_size=10"""'], {}), "(\n 'https://api.noopschallenge.com/mazebot/random?min_size=10&max_s...
"""Time-series Generative Adversarial Networks (TimeGAN) Codebase. Reference: <NAME>, <NAME>, <NAME>, "Time-series Generative Adversarial Networks," Neural Information Processing Systems (NeurIPS), 2019. Paper link: https://papers.nips.cc/paper/8789-time-series-generative-adversarial-networks Last updated Date: Ap...
[ "metrics.discriminative_metrics.discriminative_score_metrics", "argparse.ArgumentParser", "warnings.filterwarnings", "timegan.timegan", "data_loading.sine_data_generation", "data_loading.real_data_loading", "numpy.mean", "metrics.predictive_metrics.predictive_score_metrics", "numpy.vstack", "metri...
[((1061, 1094), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (1084, 1094), False, 'import warnings\n'), ((2622, 2651), 'timegan.timegan', 'timegan', (['ori_data', 'parameters'], {}), '(ori_data, parameters)\n', (2629, 2651), False, 'from timegan import timegan\n'), ((335...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import astropy.units as u from astropy.time import Time __all__ = ['PeriodicEvent', 'EclipsingSystem'] class PeriodicEvent(ob...
[ "astropy.units.quantity_input", "astropy.time.Time", "numpy.arange", "numpy.cos", "numpy.vstack" ]
[((401, 447), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'period': 'u.day', 'duration': 'u.day'}), '(period=u.day, duration=u.day)\n', (417, 447), True, 'import astropy.units as u\n'), ((2235, 2281), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'period': 'u.day', 'duration': 'u.day'}), '(per...
""" Warping Invariant PCR Regression using SRSF moduleauthor:: <NAME> <<EMAIL>> """ import numpy as np import fdasrsf as fs import fdasrsf.utility_functions as uf import fdasrsf.curve_functions as cf import fdasrsf.regression as rg import fdasrsf.geometry as geo from scipy import dot from scipy.linalg import inv, no...
[ "fdasrsf.curve_functions.calculatecentroid", "fdasrsf.fdacurve", "numpy.sum", "fdasrsf.curve_functions.find_rotation_and_seed_unique", "fdasrsf.curve_functions.innerprod_q2", "fdasrsf.curve_functions.curve_to_q", "numpy.zeros", "numpy.ones", "scipy.linalg.inv", "fdasrsf.curve_functions.resamplecur...
[((1920, 1947), 'fdasrsf.fdacurve', 'fs.fdacurve', (['self.beta'], {'N': 'T'}), '(self.beta, N=T)\n', (1931, 1947), True, 'import fdasrsf as fs\n'), ((2212, 2233), 'numpy.ones', 'np.ones', (['(N1, no + 1)'], {}), '((N1, no + 1))\n', (2219, 2233), True, 'import numpy as np\n'), ((2293, 2308), 'scipy.dot', 'dot', (['Phi....
# Copyright 2022 DeepMind Technologies Limited. 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 ...
[ "jax.tree_flatten", "absl.testing.absltest.main", "jax.random.uniform", "jax.random.normal", "jax.numpy.concatenate", "absl.testing.parameterized.parameters", "jax.numpy.argmax", "jax.vjp", "jax.random.PRNGKey", "jax.tree_leaves", "jax.grad", "numpy.testing.assert_allclose", "jax.random.spli...
[((3691, 3741), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['models.NON_LINEAR_MODELS'], {}), '(models.NON_LINEAR_MODELS)\n', (3715, 3741), False, 'from absl.testing import parameterized\n'), ((4911, 4961), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['models.NON_LIN...
# -*- coding: utf-8 -*- """ Created on Thu Dec 9 12:18:18 2021 @author: <NAME> """ import numpy as np import pygemmes as pgm from pygemmes import _plots as plots import matplotlib.pyplot as plt _MODEL = 'GK' Basefields = { 'dt': 0.01, 'a': 1, 'N': 1, 'K': 2.9, 'w': .85*1.2, 'alpha': 0.02, ...
[ "pygemmes.Hub", "matplotlib.pyplot.show", "numpy.exp", "pygemmes.get_available_solvers" ]
[((589, 641), 'pygemmes.get_available_solvers', 'pgm.get_available_solvers', ([], {'returnas': 'dict', 'verb': '(False)'}), '(returnas=dict, verb=False)\n', (614, 641), True, 'import pygemmes as pgm\n'), ((395, 405), 'numpy.exp', 'np.exp', (['(-5)'], {}), '(-5)\n', (401, 405), True, 'import numpy as np\n'), ((2512, 252...
import numpy as np import imageio import colors # Convert category colors from hex triplets to RGB as 8-bit unsigned # integer arrays (required by imageio) category_colors = [] for hex_color in colors.categories: r, g, b = int(hex_color[1:3], 16), int(hex_color[3:5], 16), int(hex_color[5:7], 16) rgb_color = np.array...
[ "numpy.full", "numpy.ndenumerate", "numpy.array", "imageio.imsave", "imageio.mimsave" ]
[((312, 347), 'numpy.array', 'np.array', (['[r, g, b]'], {'dtype': 'np.uint8'}), '([r, g, b], dtype=np.uint8)\n', (320, 347), True, 'import numpy as np\n'), ((406, 447), 'numpy.array', 'np.array', (['[255, 255, 255]'], {'dtype': 'np.uint8'}), '([255, 255, 255], dtype=np.uint8)\n', (414, 447), True, 'import numpy as np\...
# # Nonlinear field generated in by a bowl-shaped HIFU transducer # ========================================================== # # This demo illustrates how to: # # * Compute the nonlinear time-harmonic field in a homogeneous medium # * Use incident field routines to generate the field from a HIFU transducer # * Make a...
[ "matplotlib.pyplot.loglog", "numpy.abs", "numpy.floor", "vines.operators.acoustic_operators.volume_potential_cylindrical", "vines.fields.transducers.normalise_power", "numpy.ones", "matplotlib.pyplot.figure", "numpy.arange", "numpy.linalg.norm", "scipy.interpolate.interp1d", "matplotlib.pyplot.c...
[((1608, 1655), 'numpy.array', 'np.array', (['[4, 6, 8, 10, 12, 14, 16, 18, 20, 35]'], {}), '([4, 6, 8, 10, 12, 14, 16, 18, 20, 35])\n', (1616, 1655), True, 'import numpy as np\n'), ((8458, 8485), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(14, 8)'}), '(figsize=(14, 8))\n', (8468, 8485), True, 'from ma...
import pdb import matplotlib.pyplot as plt import scipy.optimize as opt import numpy as np from abc import ABCMeta from netsquid import simutil from netsquid.components.instructions import INSTR_INIT, INSTR_H, INSTR_ROT_X, INSTR_ROT_Y, INSTR_ROT_Z, INSTR_CXDIR, INSTR_MEASURE from netsquid.protocols import TimedProtocol...
[ "netsquid.simutil.sim_reset", "netsquid_netconf.easynetwork.setup_physical_network", "matplotlib.pyplot.show", "netsquid.qubits.qubitapi.set_qstate_formalism", "matplotlib.pyplot.plot", "netsquid.qubits.qubitapi.create_qubits", "matplotlib.pyplot.legend", "netsquid.simutil.sim_run", "netsquid.qubits...
[((750, 785), 'netsquid.qubits.qubitapi.set_qstate_formalism', 'set_qstate_formalism', (['QFormalism.DM'], {}), '(QFormalism.DM)\n', (770, 785), False, 'from netsquid.qubits.qubitapi import create_qubits, measure, operate, set_qstate_formalism, QFormalism, fidelity, reduced_dm\n'), ((807, 822), 'numpy.kron', 'np.kron',...
import os import time import sys import re from subprocess import call import numpy as np import pickle import csv import gzip from sklearn.pipeline import Pipeline, make_pipeline from sklearn.base import BaseEstimator, TransformerMixin from sklearn.feature_extraction.text import CountVectorizer as skCountVectorizer f...
[ "os.path.abspath", "sklearn.feature_extraction.text.TfidfVectorizer", "networkx.degree_histogram", "csv.field_size_limit", "numpy.zeros", "time.time", "numpy.array", "subprocess.call", "networkx.DiGraph", "fastText.load_model" ]
[((573, 606), 'csv.field_size_limit', 'csv.field_size_limit', (['sys.maxsize'], {}), '(sys.maxsize)\n', (593, 606), False, 'import csv\n'), ((4854, 4898), 'fastText.load_model', 'load_model', (['"""/home/gustavo/data/wiki.en.bin"""'], {}), "('/home/gustavo/data/wiki.en.bin')\n", (4864, 4898), False, 'from fastText impo...
# # Copyright (C) 2021 The Delta Lake Project Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
[ "pandas.Timestamp", "decimal.Decimal", "numpy.float32", "datetime.date", "numpy.int16", "numpy.int32", "numpy.int64", "numpy.float64", "delta_sharing.converter.to_converter", "numpy.int8" ]
[((835, 858), 'delta_sharing.converter.to_converter', 'to_converter', (['"""boolean"""'], {}), "('boolean')\n", (847, 858), False, 'from delta_sharing.converter import to_converter\n'), ((1454, 1476), 'delta_sharing.converter.to_converter', 'to_converter', (['type_str'], {}), '(type_str)\n', (1466, 1476), False, 'from ...
from MAP.maze import Maze, ACTIONS from GUI.draw import draw_table_root_by_time from MAP.maze_map import Mazes import random import numpy as np import matplotlib.pyplot as plt NUM_ACTION = 4 # 动作数量 epoch_num = 30000 # 训练次数 # Q表类的实现,Q表类有Q值的存储,决策的进行,Q表的学习等功能函数,进行预测和学习时会与迷宫(“环境”)进行交互,对其输入动作,得到反馈 class QTableModel(o...
[ "numpy.load", "numpy.save", "matplotlib.pyplot.show", "random.choice", "MAP.maze.Maze", "GUI.draw.draw_table_root_by_time", "numpy.array", "numpy.random.rand" ]
[((5491, 5517), 'numpy.array', 'np.array', (['Mazes[maze_name]'], {}), '(Mazes[maze_name])\n', (5499, 5517), True, 'import numpy as np\n'), ((5533, 5562), 'MAP.maze.Maze', 'Maze', ([], {'maze_map': 'maze', 'period': '(2)'}), '(maze_map=maze, period=2)\n', (5537, 5562), False, 'from MAP.maze import Maze, ACTIONS\n'), ((...
# -*- coding: utf-8 -*- ''' This code generates Fig. S13 Comparison of climatological surface air temperature (in °C) at the country-level across different datasets. by <NAME> (<EMAIL>) ''' import _env import pandas as pd import numpy as np import matplotlib.pyplot as plt odir_plot = _env.odir_root + '/plot/' _...
[ "numpy.sum", "numpy.abs", "numpy.polyfit", "pandas.read_csv", "matplotlib.pyplot.figure", "numpy.mean", "matplotlib.pyplot.yticks", "numpy.linspace", "matplotlib.pyplot.xticks", "_env.mkdirs", "matplotlib.pyplot.ylim", "numpy.corrcoef", "matplotlib.pyplot.text", "matplotlib.pyplot.ylabel",...
[((319, 341), '_env.mkdirs', '_env.mkdirs', (['odir_plot'], {}), '(odir_plot)\n', (330, 341), False, 'import _env\n'), ((499, 532), 'pandas.read_csv', 'pd.read_csv', (['if_temp'], {'index_col': '(0)'}), '(if_temp, index_col=0)\n', (510, 532), True, 'import pandas as pd\n'), ((601, 628), 'matplotlib.pyplot.figure', 'plt...
import cv2 import numpy as np from vizh.ir import * import vizh.ocr from enum import Enum, auto import sys from collections import namedtuple import itertools def crop_by_bounding_box(image, box): x,y,w,h = box return image[y:y+h,x:x+w] InstructionData = namedtuple('InstructionData', 'bounding_box instruction...
[ "cv2.arcLength", "numpy.linalg.norm", "cv2.rectangle", "cv2.imshow", "cv2.dilate", "cv2.cvtColor", "cv2.drawContours", "cv2.boundingRect", "cv2.destroyAllWindows", "cv2.bitwise_not", "cv2.waitKey", "enum.auto", "numpy.dot", "cv2.putText", "cv2.getStructuringElement", "cv2.threshold", ...
[((265, 322), 'collections.namedtuple', 'namedtuple', (['"""InstructionData"""', '"""bounding_box instruction"""'], {}), "('InstructionData', 'bounding_box instruction')\n", (275, 322), False, 'from collections import namedtuple\n'), ((362, 434), 'cv2.putText', 'cv2.putText', (['img', 'text', '(x, y)', 'cv2.FONT_HERSHE...
# Let's try Anca's idea of having a test specifically designed for querying actions. #for now I'm going to just randomly sample to get policies and add the zero vector too. #I think there should be a way to sample vectors along each halfspace constraint too # Just need to make sure they are orthogonal to halfspace nor...
[ "src.mdp.find_optimal_policy", "numpy.random.seed", "numpy.ones", "numpy.mean", "numpy.linalg.norm", "src.utils.optimal_rollout_from_Qvals", "src.grid_worlds.create_aaai19_toy_world", "os.path.join", "os.path.abspath", "numpy.random.randn", "random.seed", "src.mdp.value_iteration", "copy.dee...
[((737, 769), 'sys.path.insert', 'sys.path.insert', (['(0)', 'project_path'], {}), '(0, project_path)\n', (752, 769), False, 'import sys\n'), ((633, 658), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (648, 658), False, 'import os\n'), ((707, 735), 'os.path.join', 'os.path.join', (['exp_path...
#!/usr/bin/env python3 import numpy as np from io import BytesIO from bsistructs import BSIFile from PIL import Image from PIL.ImagePalette import ImagePalette int32ul = np.dtype("<u4") int16ul = np.dtype("<u2") class BSI: __slots__ = "IFHD", "NAME", "BHDR", "HICL", "HTBL", "CMAP", "DATA" def __init__(self...
[ "io.BytesIO", "argparse.ArgumentParser", "numpy.frombuffer", "numpy.dtype", "numpy.zeros", "bsistructs.BSIFile.parse_stream", "PIL.Image.frombytes", "argparse.FileType" ]
[((173, 188), 'numpy.dtype', 'np.dtype', (['"""<u4"""'], {}), "('<u4')\n", (181, 188), True, 'import numpy as np\n'), ((199, 214), 'numpy.dtype', 'np.dtype', (['"""<u2"""'], {}), "('<u2')\n", (207, 214), True, 'import numpy as np\n'), ((2294, 2310), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (2308, ...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 import os import math import torch from src.models import RobertaMLM, RobertaAdaptor, BertMLM, BertAdaptor from src.data.loader import DataIterator import numpy as np from src.logger import init_logger from opt import ...
[ "apex.amp.initialize", "os.makedirs", "apex.amp.master_params", "math.ceil", "os.path.exists", "src.logger.init_logger", "time.time", "apex.amp.scale_loss", "numpy.random.choice", "torch.zeros", "opt.get_parser", "torch.no_grad", "os.path.join", "src.data.loader.DataIterator" ]
[((1395, 1430), 'math.ceil', 'math.ceil', (['(bsize * slen * word_pred)'], {}), '(bsize * slen * word_pred)\n', (1404, 1430), False, 'import math\n'), ((1538, 1590), 'numpy.random.choice', 'np.random.choice', (['(bsize * slen)', 'npred'], {'replace': '(False)'}), '(bsize * slen, npred, replace=False)\n', (1554, 1590), ...
############Test import argparse import os import tensorflow as tf from keras.backend import tensorflow_backend from utils import define_model, crop_prediction from keras.layers import ReLU from tqdm import tqdm import numpy as np from skimage.transform import resize import cv2 from PIL import Image def predict(ACT...
[ "os.makedirs", "argparse.ArgumentParser", "cv2.imwrite", "tensorflow.Session", "utils.crop_prediction.pred_to_patches", "PIL.Image.open", "numpy.max", "numpy.min", "skimage.transform.resize", "numpy.array", "keras.backend.tensorflow_backend.set_session", "utils.crop_prediction.recompone_overla...
[((779, 832), 'os.makedirs', 'os.makedirs', (['f"""{output_path}/out_seg/"""'], {'exist_ok': '(True)'}), "(f'{output_path}/out_seg/', exist_ok=True)\n", (790, 832), False, 'import os\n'), ((837, 890), 'os.makedirs', 'os.makedirs', (['f"""{output_path}/out_art/"""'], {'exist_ok': '(True)'}), "(f'{output_path}/out_art/',...
""" Functions required by the TOPKAPI model for the management of input and output of cells. .. note:: The subroutines solving the differential equation are not in this module (see :mod:`~TOPKAPI.ode` for more information) """ import numpy as np ## ROUTINES FOR SOIL STORE #``````````````````````````````...
[ "numpy.isclose", "numpy.zeros" ]
[((4996, 5012), 'numpy.isclose', 'np.isclose', (['a', 'b'], {}), '(a, b)\n', (5006, 5012), True, 'import numpy as np\n'), ((8721, 8738), 'numpy.zeros', 'np.zeros', (['nb_cell'], {}), '(nb_cell)\n', (8729, 8738), True, 'import numpy as np\n')]
import sys sys.path.append('../') from loaders import pvc4 import numpy as np import tempfile import time import unittest import torch from pprint import pprint class TestPvc4Loader(unittest.TestCase): def test_openimfile(self): framecount, iconsize, iconside, filetype = pvc4._openimfile( ...
[ "sys.path.append", "unittest.main", "loaders.pvc4._loadimfile", "loaders.pvc4.PVC4", "numpy.sum", "numpy.zeros", "numpy.isnan", "unittest.skip", "loaders.pvc4._openimfile" ]
[((12, 34), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (27, 34), False, 'import sys\n'), ((5316, 5337), 'unittest.skip', 'unittest.skip', (['"""Slow"""'], {}), "('Slow')\n", (5329, 5337), False, 'import unittest\n'), ((5879, 5894), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5892, ...
#coding:utf-8 from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import viz from common.log import Logger, savefig from torch.utils.data import DataLoader from common.utils import AverageMeter, lr_decay, save_ckpt import time from progress.bar import Bar from common.generators import PoseGenerator...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "scipy.io.loadmat", "numpy.array", "os.path.join" ]
[((806, 856), 'os.path.join', 'os.path.join', (['"""data"""', "('data_3d_' + 'h36m' + '.npz')"], {}), "('data', 'data_3d_' + 'h36m' + '.npz')\n", (818, 856), False, 'import os\n'), ((964, 986), 'scipy.io.loadmat', 'loadmat', (['MUCO3DHP_path'], {}), '(MUCO3DHP_path)\n', (971, 986), False, 'from scipy.io import loadmat\...
import numpy as np import pytransform3d.transformations as pt import pytransform3d.rotations as pr from movement_primitives.testing.simulation import ( KinematicsChain, UR5Simulation) from movement_primitives.kinematics import Kinematics from numpy.testing import assert_array_almost_equal def test_inverse_kinemat...
[ "pytransform3d.rotations.active_matrix_from_extrinsic_roll_pitch_yaw", "pytransform3d.transformations.pq_from_transform", "movement_primitives.testing.simulation.UR5Simulation", "numpy.random.RandomState", "movement_primitives.testing.simulation.KinematicsChain", "numpy.array", "numpy.testing.assert_arr...
[((767, 833), 'movement_primitives.testing.simulation.KinematicsChain', 'KinematicsChain', (['ee_frame', 'joint_names', 'urdf_path'], {'debug_gui': '(False)'}), '(ee_frame, joint_names, urdf_path, debug_gui=False)\n', (782, 833), False, 'from movement_primitives.testing.simulation import KinematicsChain, UR5Simulation\...
import numpy as np class GaussianKernel(object): def __init__(self, params): self.params_map = ['sigma_s', 'width'] self.set_params(params) def set_params(self, params): self.params = params self.sigma_s = params[0] self.width = params[1] def get_params_map(self, p...
[ "numpy.zeros" ]
[((598, 616), 'numpy.zeros', 'np.zeros', (['(Np, Nq)'], {}), '((Np, Nq))\n', (606, 616), True, 'import numpy as np\n'), ((820, 836), 'numpy.zeros', 'np.zeros', (['(N, N)'], {}), '((N, N))\n', (828, 836), True, 'import numpy as np\n'), ((1383, 1399), 'numpy.zeros', 'np.zeros', (['(N, N)'], {}), '((N, N))\n', (1391, 1399...
# -*- coding: utf-8 -*- """ Created on Sun Jan 23 10:56:19 2022 @author: <NAME> contact: <EMAIL>, <EMAIL> Reference: <NAME>, <NAME>, <NAME>, Granger causality test with nonlinear neural-network-based methods: Python package and simulation study., Computer Methods and Programs in Biomedicine, Volume 216, 2022 https:...
[ "statsmodels.tsa.tsatools.lagmat2ds", "numpy.abs", "matplotlib.pyplot.plot", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.GRU", "numpy.zeros", "tensorflow.keras.models.Model", "matplotlib.pyplot.figure", "tensorflow.keras.layers.LSTM", "tensorflow....
[((11364, 11401), 'tensorflow.keras.layers.Input', 'Input', (['(data_shape[1], data_shape[2])'], {}), '((data_shape[1], data_shape[2]))\n', (11369, 11401), False, 'from tensorflow.keras.layers import Dense, LSTM, Dropout, GRU, TimeDistributed, Flatten, Input\n'), ((13025, 13066), 'tensorflow.keras.models.Model', 'Model...
import numpy as np # other -------------------------------------- # ==================================================================== def get_p_init(name): if name == "x^2": return( np.array([-3.0]) ) elif name == "x^4": return( np.array([-3.0]) ) elif name == "ellipse": retu...
[ "numpy.dot", "numpy.array", "numpy.exp" ]
[((2789, 2801), 'numpy.dot', 'np.dot', (['p', 'p'], {}), '(p, p)\n', (2795, 2801), True, 'import numpy as np\n'), ((3579, 3621), 'numpy.array', 'np.array', (['[2 * x / a ** 2, 2 * y / b ** 2]'], {}), '([2 * x / a ** 2, 2 * y / b ** 2])\n', (3587, 3621), True, 'import numpy as np\n'), ((5911, 5964), 'numpy.array', 'np.a...
import os import pathlib import tempfile import h5py import mlflow import numpy as np import pytest from deepinterpolation.generic import JsonSaver, ClassLoader def _get_generator_params(): train_path = os.path.join( pathlib.Path(__file__).parent.absolute(), "..", "sample_data", ...
[ "mlflow.start_run", "h5py.File", "tempfile.TemporaryDirectory", "mlflow.set_tracking_uri", "numpy.allclose", "mlflow.create_experiment", "pathlib.Path", "deepinterpolation.generic.JsonSaver", "deepinterpolation.generic.ClassLoader", "mlflow.keras.log_model", "pytest.mark.parametrize", "os.path...
[((2308, 2371), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""use_legacy_model_path"""', '[True, False]'], {}), "('use_legacy_model_path', [True, False])\n", (2331, 2371), False, 'import pytest\n'), ((912, 984), 'os.path.join', 'os.path.join', (['output_path', '"""ephys_tiny_continuous_deep_interpolation....
""" Copyright (c) <2018> YoongiKim See the file license.txt for copying permission. """ import numpy as np import cv2 import time import pyautogui from RiderEnvironment.grabscreen import grab_screen from RiderEnvironment import show_window import threading from RiderEnvironment import read_score import gym ## PRESS...
[ "RiderEnvironment.show_window.ShowWindow", "gym.spaces.Discrete", "pyautogui.mouseDown", "cv2.imshow", "RiderEnvironment.grabscreen.grab_screen", "RiderEnvironment.read_score.read", "cv2.cvtColor", "cv2.destroyAllWindows", "cv2.resize", "threading.Thread", "cv2.Canny", "cv2.waitKey", "time.s...
[((973, 1030), 'numpy.zeros', 'np.zeros', ([], {'shape': '(self.height, self.width)', 'dtype': 'np.uint8'}), '(shape=(self.height, self.width), dtype=np.uint8)\n', (981, 1030), True, 'import numpy as np\n'), ((1202, 1222), 'numpy.array', 'np.array', (['result_img'], {}), '(result_img)\n', (1210, 1222), True, 'import nu...
#!C:/ProgramData/Anaconda3/python.exe import io def is_raspberry_pi(raise_on_errors=False): """Checks if Raspberry PI. :return: """ try: with io.open('/proc/cpuinfo', 'r') as cpuinfo: found = False for line in cpuinfo: if line.startswith('Hardware'): ...
[ "cv2.waitKey", "cv2.destroyAllWindows", "cv2.imdecode", "base64.b64decode", "base64.b64encode", "io.open", "cv2.imencode", "cv2.imshow", "numpy.fromstring" ]
[((1480, 1503), 'cv2.imshow', 'cv2.imshow', (['name', 'image'], {}), '(name, image)\n', (1490, 1503), False, 'import cv2\n'), ((1511, 1528), 'cv2.waitKey', 'cv2.waitKey', (['time'], {}), '(time)\n', (1522, 1528), False, 'import cv2\n'), ((1647, 1674), 'cv2.imencode', 'cv2.imencode', (['""".jpg"""', 'image'], {}), "('.j...
import numpy as np import tensorflow as tf from rllab.core.serializable import Serializable from rllab.envs.base import Step from rllab.envs.mujoco.mujoco_env import MujocoEnv from rllab.misc import logger from rllab.misc.overrides import overrides def smooth_abs(x, param): return np.sqrt(np.square(x) + np.square...
[ "rllab.core.serializable.Serializable.__init__", "numpy.abs", "numpy.std", "numpy.square", "numpy.clip", "rllab.envs.base.Step", "numpy.max", "numpy.mean", "numpy.min", "tensorflow.square" ]
[((529, 573), 'rllab.core.serializable.Serializable.__init__', 'Serializable.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (550, 573), False, 'from rllab.core.serializable import Serializable\n'), ((1295, 1331), 'numpy.clip', 'np.clip', (['action', '*self.action_bounds'], {}), '(action, *self.action_...
class Predict: '''Class for making predictions on the models that are stored in the Scan() object''' def __init__(self, scan_object): '''Takes in as input a Scan() object and returns and object with properties for `predict` and `predict_classes`''' self.scan_object = scan_object ...
[ "numpy.argmax" ]
[((1955, 1979), 'numpy.argmax', 'np.argmax', (['preds'], {'axis': '(1)'}), '(preds, axis=1)\n', (1964, 1979), True, 'import numpy as np\n')]
import numpy as np from scipy.special import softmax import seaborn as sns import matplotlib.pyplot as plt if __name__ == '__main__': data_size = 100 true_mu = 3 true_sig = 1 y_obs = np.random.normal(loc=true_mu, scale=true_sig, size=data_size) M = 2000000 m = M//20 # M/m is usually around 2...
[ "numpy.random.uniform", "scipy.special.softmax", "matplotlib.pyplot.show", "numpy.std", "numpy.mean", "seaborn.distplot", "numpy.random.normal", "numpy.random.choice", "matplotlib.pyplot.subplots", "numpy.sqrt" ]
[((201, 262), 'numpy.random.normal', 'np.random.normal', ([], {'loc': 'true_mu', 'scale': 'true_sig', 'size': 'data_size'}), '(loc=true_mu, scale=true_sig, size=data_size)\n', (217, 262), True, 'import numpy as np\n'), ((444, 473), 'numpy.random.uniform', 'np.random.uniform', (['(-10)', '(10)', 'M'], {}), '(-10, 10, M)...
import pandas as pd import numpy as np import seaborn as sns from sklearn.linear_model import LinearRegression, Lasso, LogisticRegression from sklearn.ensemble import GradientBoostingRegressor, RandomForestClassifier from sklearn.neural_network import MLPRegressor, MLPClassifier from sklearn.preprocessing import LabelE...
[ "matplotlib.pyplot.title", "seaborn.heatmap", "sklearn.model_selection.train_test_split", "sklearn.ensemble.GradientBoostingRegressor", "matplotlib.pyplot.figure", "numpy.mean", "sklearn.neural_network.MLPClassifier", "sklearn.svm.SVC", "matplotlib.pyplot.fill_between", "numpy.std", "matplotlib....
[((646, 679), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (669, 679), False, 'import warnings\n'), ((680, 690), 'matplotlib.pyplot.ioff', 'plt.ioff', ([], {}), '()\n', (688, 690), True, 'from matplotlib import pyplot as plt\n'), ((13407, 13431), 'numpy.linspace', 'np.li...
from tensorflow.keras.utils import Sequence from tensorflow.keras.applications.imagenet_utils import preprocess_input from tensorflow.keras.preprocessing import image import tensorflow as tf import cv2 import os import numpy as np def draw_bounding(img , bboxes, img_size): # resizing 작업 img_box = np.copy(img)...
[ "cv2.circle", "numpy.copy", "tensorflow.keras.applications.imagenet_utils.preprocess_input", "cv2.waitKey", "tensorflow.random.uniform", "tensorflow.image.random_contrast", "cv2.addWeighted", "tensorflow.stack", "tensorflow.image.random_hue", "numpy.array", "tensorflow.image.resize", "tensorfl...
[((308, 320), 'numpy.copy', 'np.copy', (['img'], {}), '(img)\n', (315, 320), True, 'import numpy as np\n'), ((538, 595), 'cv2.addWeighted', 'cv2.addWeighted', (['img_box', 'alpha', 'img', '(1.0 - alpha)', '(0)', 'img'], {}), '(img_box, alpha, img, 1.0 - alpha, 0, img)\n', (553, 595), False, 'import cv2\n'), ((599, 626)...
from __future__ import print_function from __future__ import absolute_import from builtins import zip import cv2 import numpy as np from .tesisfunctions import padVH,Plotim,graphpolygontest,polygontest import time import itertools as it from multiprocessing.pool import ThreadPool pool=ThreadPool(processes = cv2.getNum...
[ "numpy.zeros", "time.time", "cv2.fillPoly", "numpy.where", "numpy.array", "itertools.imap", "cv2.pointPolygonTest", "cv2.getNumberOfCPUs", "cv2.distanceTransform", "cv2.findContours" ]
[((736, 770), 'numpy.zeros', 'np.zeros', (['(4 * r, 4 * r)', 'np.uint8'], {}), '((4 * r, 4 * r), np.uint8)\n', (744, 770), True, 'import numpy as np\n'), ((901, 926), 'numpy.array', 'np.array', (['points', 'np.int0'], {}), '(points, np.int0)\n', (909, 926), True, 'import numpy as np\n'), ((966, 998), 'cv2.fillPoly', 'c...
import numpy as np import matplotlib.pyplot as plt import h5py import scipy.io import sklearn import sklearn.datasets import math def sigmoid(x): """ Compute the sigmoid of x Arguments: x -- A scalar or numpy array of any size. Return: s -- sigmoid(x) """ s = 1/(1+np.exp(-x)) retu...
[ "numpy.random.seed", "numpy.maximum", "numpy.sum", "sklearn.datasets.make_moons", "numpy.mean", "matplotlib.pyplot.contourf", "numpy.arange", "numpy.exp", "numpy.random.randn", "numpy.int64", "matplotlib.pyplot.show", "numpy.random.permutation", "matplotlib.pyplot.ylabel", "numpy.dot", "...
[((481, 497), 'numpy.maximum', 'np.maximum', (['(0)', 'x'], {}), '(0, x)\n', (491, 497), True, 'import numpy as np\n'), ((555, 575), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (569, 575), True, 'import numpy as np\n'), ((585, 606), 'numpy.random.randn', 'np.random.randn', (['(2)', '(3)'], {}), '...
# coding: utf8 import cv2 import numpy as np import os, datetime, time import threading from cam_functions import * from sender import Sender from csv_work import read_as_dict from config import * if __name__ == '__main__': send_email = Sender(receivers = read_as_dict(FILE_RECEIVERS)) # for allow to sa...
[ "cv2.GaussianBlur", "numpy.ones", "cv2.rectangle", "cv2.imshow", "os.path.join", "os.chdir", "cv2.contourArea", "cv2.imwrite", "cv2.boundingRect", "cv2.destroyAllWindows", "datetime.datetime.now", "threading.Thread", "cv2.waitKey", "cv2.morphologyEx", "cv2.createBackgroundSubtractorMOG2"...
[((454, 465), 'time.time', 'time.time', ([], {}), '()\n', (463, 465), False, 'import os, datetime, time\n'), ((512, 523), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (521, 523), False, 'import os, datetime, time\n'), ((588, 616), 'os.path.join', 'os.path.join', (['path', '"""images"""'], {}), "(path, 'images')\n", (600...
import pandas as pd import numpy as np import wfdb from wfdb import processing import matplotlib.pyplot as plt import seaborn as sns import os from wfdb.processing.hr import calc_rr import json # import pyhrv.time_domain as td # import pyhrv.frequency_domain as fd # import pyhrv.nonlinear as nl from IPython.display imp...
[ "pandas.DataFrame", "numpy.average", "numpy.concatenate", "matplotlib.pyplot.ioff", "warnings.filterwarnings", "numpy.std", "numpy.empty", "matplotlib.pyplot.close", "numpy.sum", "numpy.diff", "numpy.array", "seaborn.set", "numpy.unique" ]
[((380, 390), 'matplotlib.pyplot.ioff', 'plt.ioff', ([], {}), '()\n', (388, 390), True, 'import matplotlib.pyplot as plt\n'), ((392, 425), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (415, 425), False, 'import warnings\n'), ((426, 435), 'seaborn.set', 'sns.set', ([], {}...
import argparse, math, os import numpy as np import random import yaml from easydict import EasyDict from src.enviroment import DashCamEnv from RLlib.REINFORCE.reinforce import REINFORCE import torch from torch.utils.data import DataLoader from torchvision import transforms from torch.autograd import Variable from sr...
[ "numpy.load", "yaml.load", "numpy.random.seed", "argparse.ArgumentParser", "src.data_transform.ProcessImages", "yaml.dump", "metrics.eval_tools.evaluation_auc_scores", "torch.cat", "torch.device", "torch.no_grad", "os.path.join", "src.enviroment.DashCamEnv", "metrics.eval_tools.evaluate_earl...
[((653, 724), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch REINFORCE implementation"""'}), "(description='PyTorch REINFORCE implementation')\n", (676, 724), False, 'import argparse, math, os\n'), ((2331, 2354), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n...
from numpy import pi as PI import scipy import numpy as np def get_lambda(theta, parameter_type): if parameter_type.lower() == 'rate': return theta elif parameter_type.lower() == 'shape': return 1/theta elif parameter_type.lower() == 'delay': return np.cos(PI*theta/2) / np.sin(PI...
[ "numpy.clip", "numpy.where", "numpy.sin", "numpy.exp", "numpy.cos", "numpy.cosh", "numpy.sinh" ]
[((829, 874), 'numpy.where', 'np.where', (['((0 < t) & (t < 2 * np.pi))', '(1.0)', '(0.0)'], {}), '((0 < t) & (t < 2 * np.pi), 1.0, 0.0)\n', (837, 874), True, 'import numpy as np\n'), ((1261, 1303), 'numpy.where', 'np.where', (['((0 < t) & (t < 2 * PI))', '(1.0)', '(0.0)'], {}), '((0 < t) & (t < 2 * PI), 1.0, 0.0)\n', ...
import numpy as np import pandas as pd def save_complete_df(matches_df, team_df, player_df, filename): # create a complete team df which includes all player stats complete_team_df = get_complete_team_df(team_df, player_df) # create a copy of complete team df with renamed columns complete_team_df_team...
[ "pandas.read_csv", "numpy.where", "pandas.to_datetime" ]
[((1871, 1931), 'pandas.read_csv', 'pd.read_csv', (['"""./Data/Matches.csv"""'], {'index_col': '(False)', 'header': '(0)'}), "('./Data/Matches.csv', index_col=False, header=0)\n", (1882, 1931), True, 'import pandas as pd\n'), ((1957, 1991), 'pandas.to_datetime', 'pd.to_datetime', (["matches_df['Date']"], {}), "(matches...
import math from collections import defaultdict import csv from statistics import mean from matplotlib import pyplot as plt import matplotlib from random import uniform import seaborn as sns import matplotlib.patches as mpatches import numpy as np import get_sizes import logging logger= logging.getLogger(__name__) l...
[ "get_sizes.get_psdd_sizes", "csv.reader", "logging.getLogger", "collections.defaultdict", "matplotlib.pyplot.tight_layout", "matplotlib.patches.Rectangle", "matplotlib.pyplot.rc", "numpy.log10", "matplotlib.pyplot.xticks", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyp...
[((291, 318), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (308, 318), False, 'import logging\n'), ((1792, 1810), 'numpy.array', 'np.array', (['iterable'], {}), '(iterable)\n', (1800, 1810), True, 'import numpy as np\n'), ((1915, 1931), 'numpy.log', 'np.log', (['iterable'], {}), '(itera...
from typing import List import torch import torch.optim as optim import torch.nn as nn import torch.nn.functional as F class RewriteDecider(nn.Module): def __init__(self, hps, device=torch.device("cpu")): super(RewriteDecider, self).__init__() self._input_size = hps["encoder"]["output_size"] ...
[ "numpy.random.uniform", "torch.cat", "torch.nn.Linear", "torch.device", "torch.nn.Sigmoid" ]
[((189, 208), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (201, 208), False, 'import torch\n'), ((955, 980), 'torch.cat', 'torch.cat', (['outputs'], {'dim': '(1)'}), '(outputs, dim=1)\n', (964, 980), False, 'import torch\n'), ((364, 420), 'torch.nn.Linear', 'nn.Linear', (['self._input_size', "hps[...
from graph import * from numpy.testing import Tester test = Tester().test bench = Tester().bench
[ "numpy.testing.Tester" ]
[((62, 70), 'numpy.testing.Tester', 'Tester', ([], {}), '()\n', (68, 70), False, 'from numpy.testing import Tester\n'), ((84, 92), 'numpy.testing.Tester', 'Tester', ([], {}), '()\n', (90, 92), False, 'from numpy.testing import Tester\n')]
""" Test for mcsim package - monte carlo NumPy module. """ import math import mcsim.monte_carlo_np as mc import numpy as np def test_calculate_distance_np_1(): """ Test calculate distance function """ point1=np.array([0,0,0]) point2=np.array([0,1,0]) expected = np.array([1.0]) observed = ...
[ "mcsim.monte_carlo_np.calculate_lj_np", "math.pow", "mcsim.monte_carlo_np.calculate_total_energy_np", "numpy.allclose", "numpy.array", "mcsim.monte_carlo_np.calculate_pair_energy_np", "numpy.array_equal", "mcsim.monte_carlo_np.calculate_distance_np" ]
[((226, 245), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (234, 245), True, 'import numpy as np\n'), ((255, 274), 'numpy.array', 'np.array', (['[0, 1, 0]'], {}), '([0, 1, 0])\n', (263, 274), True, 'import numpy as np\n'), ((289, 304), 'numpy.array', 'np.array', (['[1.0]'], {}), '([1.0])\n', (297, 3...
# Authors: CommPy contributors # License: BSD 3-Clause """ Algorithms for Convolutional Codes """ from __future__ import division import math from warnings import warn import matplotlib.colors as mcolors import matplotlib.patches as mpatches import matplotlib.path as mpath import matplotlib.pyplot as plt import num...
[ "matplotlib.pyplot.axes", "numpy.empty", "numpy.einsum", "numpy.ones", "matplotlib.pyplot.figure", "numpy.arange", "numpy.exp", "numpy.full", "commpy.utilities.bitarray2dec", "matplotlib.patches.FancyArrowPatch", "numpy.identity", "math.cos", "commpy.utilities.euclid_dist", "numpy.size", ...
[((22393, 22414), 'numpy.size', 'np.size', (['message_bits'], {}), '(message_bits)\n', (22400, 22414), True, 'import numpy as np\n'), ((23202, 23233), 'numpy.zeros', 'np.zeros', (['number_outbits', '"""int"""'], {}), "(number_outbits, 'int')\n", (23210, 23233), True, 'import numpy as np\n'), ((25521, 25544), 'numpy.emp...
# -*- coding: utf-8 -*- """ Created on Tue Dec 4 23:41:30 2018 @author: laljarus """ #import csv import cv2 import numpy as np import matplotlib.pyplot as plt from PIL import Image from keras.preprocessing import image from keras.models import load_model import h5py from keras import __version__ as ke...
[ "keras.models.load_model", "h5py.File", "cv2.cvtColor", "matplotlib.pyplot.imshow", "numpy.asarray", "numpy.expand_dims", "PIL.Image.open", "time.time", "keras.preprocessing.image.img_to_array", "cv2.imread", "keras.preprocessing.image.load_img", "matplotlib.pyplot.figure", "numpy.vstack" ]
[((810, 829), 'cv2.imread', 'cv2.imread', (['imgpath'], {}), '(imgpath)\n', (820, 829), False, 'import cv2\n'), ((837, 864), 'numpy.expand_dims', 'np.expand_dims', (['img'], {'axis': '(0)'}), '(img, axis=0)\n', (851, 864), True, 'import numpy as np\n'), ((877, 893), 'numpy.vstack', 'np.vstack', (['[img]'], {}), '([img]...
""" ZooBP: Belief Propagation for Heterogeneous Networks. A method to perform fast BP on undirected heterogeneous graphs with provable convergence guarantees. Article: http://www.vldb.org/pvldb/vol10/p625-eswaran.pdf """ from UGFraud.Utils.helper import timer from scipy.special import logsumexp from scipy ...
[ "numpy.random.uniform", "scipy.sparse.kron", "scipy.sparse.vstack", "scipy.sparse.eye", "networkx.get_edge_attributes", "numpy.ones", "numpy.hstack", "collections.defaultdict", "scipy.sparse.coo_matrix", "numpy.array", "scipy.special.logsumexp", "networkx.get_node_attributes", "scipy.sparse....
[((971, 1004), 'numpy.concatenate', 'np.concatenate', (['(r1, -r1)'], {'axis': '(1)'}), '((r1, -r1), axis=1)\n', (985, 1004), True, 'import numpy as np\n'), ((1014, 1047), 'numpy.concatenate', 'np.concatenate', (['(r2, -r2)'], {'axis': '(1)'}), '((r2, -r2), axis=1)\n', (1028, 1047), True, 'import numpy as np\n'), ((117...
import pandas as pd from tqdm import tqdm import numpy as np import time import os def print_stories_as_txt(dataframe, fname): a = time.time() file = open(fname, "w") print("Reading stories to memory ...") for index, row in dataframe.iterrows(): for col in dataframe.columns: file.write(row[col] + ' ') file....
[ "pandas.read_csv", "numpy.savetxt", "time.time" ]
[((435, 472), 'pandas.read_csv', 'pd.read_csv', (['"""data/train_stories.csv"""'], {}), "('data/train_stories.csv')\n", (446, 472), True, 'import pandas as pd\n'), ((479, 550), 'pandas.read_csv', 'pd.read_csv', (['"""data/cloze_test_val__spring2016 - cloze_test_ALL_val.csv"""'], {}), "('data/cloze_test_val__spring2016 ...
""" Double Fourier transform to validate the predicted P(r) functions. Not applicable to scalar models (legacy code). """ import math import os import sys import matplotlib.pyplot as plt import numpy as np from gnnom.mysaxsdocument import saxsdocument pi = math.pi def dir_ff(s, Is, Err, name): smin = np.min(s...
[ "os.path.basename", "numpy.zeros", "numpy.transpose", "numpy.hstack", "gnnom.mysaxsdocument.saxsdocument.read", "numpy.min", "numpy.max", "numpy.arange", "numpy.array", "numpy.sinc", "numpy.diff", "numpy.vstack", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((312, 321), 'numpy.min', 'np.min', (['s'], {}), '(s)\n', (318, 321), True, 'import numpy as np\n'), ((333, 342), 'numpy.max', 'np.max', (['s'], {}), '(s)\n', (339, 342), True, 'import numpy as np\n'), ((408, 426), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)', '(1)'], {}), '(2, 1)\n', (420, 426), True, 'impor...
import os import hashlib from collections import OrderedDict from diora.logging.configuration import get_logger import numpy as np import torch from diora.external.standalone_elmo import batch_to_ids, ElmoCharacterEncoder, remove_sentence_boundaries from tqdm import tqdm # With loaded embedding matrix, the padding ...
[ "numpy.load", "numpy.save", "diora.external.standalone_elmo.batch_to_ids", "os.path.basename", "diora.logging.configuration.get_logger", "os.path.exists", "os.system", "numpy.zeros", "hashlib.sha256", "collections.OrderedDict", "diora.external.standalone_elmo.remove_sentence_boundaries", "os.p...
[((6081, 6093), 'diora.logging.configuration.get_logger', 'get_logger', ([], {}), '()\n', (6091, 6093), False, 'from diora.logging.configuration import get_logger\n'), ((8415, 8431), 'hashlib.sha256', 'hashlib.sha256', ([], {}), '()\n', (8429, 8431), False, 'import hashlib\n'), ((619, 647), 'os.path.basename', 'os.path...
import numpy as np import pandas as pd import torch import torch.nn.functional as F import importlib from sklearn.metrics import roc_auc_score, log_loss from keras.callbacks import EarlyStopping, ModelCheckpoint from iwillwin.config import model_config class ModelTrainer(object): def __init__(self, model_stamp,...
[ "keras.callbacks.ModelCheckpoint", "keras.callbacks.EarlyStopping", "numpy.sum", "numpy.concatenate" ]
[((6792, 6844), 'keras.callbacks.EarlyStopping', 'EarlyStopping', ([], {'monitor': '"""val_loss"""', 'patience': 'patience'}), "(monitor='val_loss', patience=patience)\n", (6805, 6844), False, 'from keras.callbacks import EarlyStopping, ModelCheckpoint\n'), ((7029, 7105), 'keras.callbacks.ModelCheckpoint', 'ModelCheckp...
from astropy import units as u import numpy as np from astropy.wcs import WCS def spec_pix_to_world(pixel, wcs, axisnumber, unit=None): """ Given a WCS, an axis ID, and a pixel ID, return the WCS spectral value at a pixel location .. TODO:: refactor to use wcs.sub """ coords = list(wcs.wcs...
[ "numpy.broadcast", "numpy.isnan", "astropy.wcs.WCS", "numpy.argsort", "numpy.arange", "numpy.interp" ]
[((1167, 1179), 'astropy.wcs.WCS', 'WCS', (['header1'], {}), '(header1)\n', (1170, 1179), False, 'from astropy.wcs import WCS\n'), ((1191, 1203), 'astropy.wcs.WCS', 'WCS', (['header2'], {}), '(header2)\n', (1194, 1203), False, 'from astropy.wcs import WCS\n'), ((1690, 1709), 'numpy.arange', 'np.arange', (['outshape'], ...
""" This is a hacked version of nipy.labs.statistical_mapping to address some bugs in that code """ import nibabel import numpy as np from nipy.algorithms.graph.graph import wgraph_from_3d_grid from nipy.algorithms.graph.field import field_from_graph_and_data from nipy.io.nibcompat import get_affine def get_3d_peak...
[ "nibabel.load", "nipy.algorithms.graph.graph.wgraph_from_3d_grid", "numpy.ones", "numpy.argsort", "nipy.io.nibcompat.get_affine", "numpy.indices", "numpy.where", "numpy.prod" ]
[((1516, 1533), 'nipy.io.nibcompat.get_affine', 'get_affine', (['image'], {}), '(image)\n', (1526, 1533), False, 'from nipy.io.nibcompat import get_affine\n'), ((2188, 2205), 'numpy.argsort', 'np.argsort', (['(-vals)'], {}), '(-vals)\n', (2198, 2205), True, 'import numpy as np\n'), ((2628, 2713), 'nibabel.load', 'nibab...
import mmcv import numpy as np import random from collections import OrderedDict from os import path as osp from pyquaternion import Quaternion from shapely.geometry import MultiPoint, box from typing import List, Tuple, Union import pathlib import math import json from dataset_3d.data_loaders.dataset_loader import ...
[ "numpy.ones", "pathlib.Path", "mmcv.dump", "mmcv.imread", "shapely.geometry.box", "shapely.geometry.MultiPoint", "numpy.finfo", "random.seed", "dataset_3d.utils.loading_utils.load_sensor_data", "dataset_3d.utils.loading_utils.load_sensors_with_calibs", "numpy.asarray", "dataset_3d.utils.loadin...
[((1378, 1401), 'pathlib.Path', 'pathlib.Path', (['root_path'], {}), '(root_path)\n', (1390, 1401), False, 'import pathlib\n'), ((2702, 2728), 'mmcv.dump', 'mmcv.dump', (['data', 'info_path'], {}), '(data, info_path)\n', (2711, 2728), False, 'import mmcv\n'), ((2923, 2949), 'mmcv.dump', 'mmcv.dump', (['data', 'info_pat...
import numpy as np from numpy.testing import assert_allclose from scipy.optimize import basinhopping from scipy.version import version as scipy_version import lmfit def test_basinhopping(): """Test basinhopping in lmfit versus scipy.""" # SciPy def func(x): return np.cos(14.5*x - 0.3) + (x+0.2)...
[ "lmfit.Parameters", "numpy.sin", "numpy.array", "numpy.cos", "scipy.version.version.split", "numpy.testing.assert_allclose", "numpy.sqrt", "scipy.optimize.basinhopping", "lmfit.Minimizer" ]
[((844, 862), 'lmfit.Parameters', 'lmfit.Parameters', ([], {}), '()\n', (860, 862), False, 'import lmfit\n'), ((969, 1000), 'lmfit.Minimizer', 'lmfit.Minimizer', (['residual', 'pars'], {}), '(residual, pars)\n', (984, 1000), False, 'import lmfit\n'), ((1060, 1098), 'numpy.testing.assert_allclose', 'assert_allclose', ([...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import re import sys import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from models.networks.sync_batchnorm import SynchronizedBatchNorm2d import torch.nn.utils.spectral_norm as spectral_norm try: import ape...
[ "torch.nn.Parameter", "torch.nn.ReLU", "torch.nn.Sequential", "torch.nn.ReflectionPad2d", "torch.nn.utils.spectral_norm", "torch.nn.Conv2d", "apex.parallel.SyncBatchNorm", "torch.nn.InstanceNorm2d", "torch.nn.BatchNorm2d", "models.networks.sync_batchnorm.SynchronizedBatchNorm2d", "re.search", ...
[((2077, 2109), 'torch.nn.Sequential', 'nn.Sequential', (['layer', 'norm_layer'], {}), '(layer, norm_layer)\n', (2090, 2109), True, 'import torch.nn as nn\n'), ((3379, 3425), 're.search', 're.search', (['"""spade(\\\\D+)(\\\\d)x\\\\d"""', 'config_text'], {}), "('spade(\\\\D+)(\\\\d)x\\\\d', config_text)\n", (3388, 3425...
""" Copyright (c) 2022 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
[ "argparse.ArgumentParser", "onnx.save", "numpy.concatenate", "nncf.experimental.post_training.algorithms.quantization.PostTrainingQuantization", "nncf.experimental.post_training.algorithms.quantization.PostTrainingQuantizationParameters", "nncf.experimental.post_training.api.metric.Accuracy", "nncf.expe...
[((1471, 1529), 'nncf.common.utils.logger.logger.info', 'nncf_logger.info', (['"""Post-Training Quantization Parameters:"""'], {}), "('Post-Training Quantization Parameters:')\n", (1487, 1529), True, 'from nncf.common.utils.logger import logger as nncf_logger\n'), ((1675, 1716), 'onnx.checker.check_model', 'onnx.checke...
import qctests.AOML_constant import util.testingProfile import numpy def test_AOML_constant(): ''' Test basic behavior of AOML_constant ''' p = util.testingProfile.fakeProfile([0,0,0], [0, 1, 2]) qc = qctests.AOML_constant.test(p, None) truth = numpy.ones(3, dtype=bool) assert numpy.array...
[ "numpy.array_equal", "numpy.ma.MaskedArray", "numpy.zeros", "numpy.ones" ]
[((272, 297), 'numpy.ones', 'numpy.ones', (['(3)'], {'dtype': 'bool'}), '(3, dtype=bool)\n', (282, 297), False, 'import numpy\n'), ((309, 337), 'numpy.array_equal', 'numpy.array_equal', (['qc', 'truth'], {}), '(qc, truth)\n', (326, 337), False, 'import numpy\n'), ((386, 428), 'numpy.ma.MaskedArray', 'numpy.ma.MaskedArr...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Former version of Debian/Ubuntu #from enthought.mayavi import mlab # Latest version of Debian/Ubuntu from mayavi import mlab import numpy as np # Build datas ############### x = np.arange(-5, 5, 0.25) y = np.arange(-5, 5, 0.25) x,y = np.meshgrid(x, y) #x,y = np.mgrid[...
[ "mayavi.mlab.mesh", "numpy.meshgrid", "mayavi.mlab.show", "numpy.sin", "numpy.arange", "numpy.sqrt" ]
[((230, 252), 'numpy.arange', 'np.arange', (['(-5)', '(5)', '(0.25)'], {}), '(-5, 5, 0.25)\n', (239, 252), True, 'import numpy as np\n'), ((257, 279), 'numpy.arange', 'np.arange', (['(-5)', '(5)', '(0.25)'], {}), '(-5, 5, 0.25)\n', (266, 279), True, 'import numpy as np\n'), ((286, 303), 'numpy.meshgrid', 'np.meshgrid',...
import spheremesh as sh import igl import numpy as np filename = "data/cell.obj" # max degree l_max = 16 # read the example .obj triangle mesh # this gives us an array of vertex positions and list of faces (triangles), which are triples of vertex indices orig_v, faces = igl.read_triangle_mesh(filename) # run the co...
[ "spheremesh.IRF", "numpy.set_printoptions", "igl.read_triangle_mesh", "spheremesh.canonical_rotation", "spheremesh.mobius_center", "spheremesh.conformal_flow" ]
[((274, 306), 'igl.read_triangle_mesh', 'igl.read_triangle_mesh', (['filename'], {}), '(filename)\n', (296, 306), False, 'import igl\n'), ((366, 398), 'spheremesh.conformal_flow', 'sh.conformal_flow', (['orig_v', 'faces'], {}), '(orig_v, faces)\n', (383, 398), True, 'import spheremesh as sh\n'), ((471, 516), 'spheremes...
# -*- coding: utf-8 -*- import numpy as np class cluster_node: def __init__( self, vec, left=None, right=None, distance=0.0, id=None, count=1): self.left = left self.right = right self.vec = vec self.id = id self.distance = distance self.count = count ...
[ "numpy.array", "numpy.abs", "numpy.sum" ]
[((359, 381), 'numpy.sum', 'np.sum', (['((v1 - v2) ** 2)'], {}), '((v1 - v2) ** 2)\n', (365, 381), True, 'import numpy as np\n'), ((423, 438), 'numpy.abs', 'np.abs', (['(v1 - v2)'], {}), '(v1 - v2)\n', (429, 438), True, 'import numpy as np\n'), ((623, 644), 'numpy.array', 'np.array', (['features[i]'], {}), '(features[i...
import sys import os from optparse import OptionParser import numpy as np import torch import torch.backends.cudnn as cudnn import torch.nn as nn from torch import optim from eval import eval_net from Network import UNet #from Network_v2 import UNet from utils import get_ids, split_ids, split_train_val, ...
[ "eval.eval_net", "torch.nn.BCELoss", "optparse.OptionParser", "Network.UNet", "utils.get_ids", "torch.load", "utils.batch", "utils.split_train_val", "numpy.array", "os._exit", "sys.exit", "utils.get_imgs_and_masks", "utils.split_ids", "torch.from_numpy" ]
[((735, 751), 'utils.get_ids', 'get_ids', (['dir_img'], {}), '(dir_img)\n', (742, 751), False, 'from utils import get_ids, split_ids, split_train_val, get_imgs_and_masks, get_imgs_and_masks_both, batch\n'), ((763, 777), 'utils.split_ids', 'split_ids', (['ids'], {}), '(ids)\n', (772, 777), False, 'from utils import get_...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
[ "tensorflow.trainable_variables", "tensorflow.identity", "tensorflow.reshape", "collections.defaultdict", "tensorflow.matmul", "tensorflow.Variable", "tensorflow.nn.rnn_cell.LSTMCell", "numpy.prod", "tensorflow.get_variable", "tensorflow.nn.softmax", "tensorflow.random_uniform_initializer", "t...
[((1080, 1107), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1097, 1107), False, 'import logging\n'), ((2731, 2747), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (2742, 2747), False, 'from collections import defaultdict\n'), ((8352, 8362), 'tensorflow.Graph', 'tf...
# import the necessary packages import os import itertools import sys import argparse import random import pandas as pd import numpy as np import pickle import matplotlib.pyplot as plt import matplotlib from scipy import interp from itertools import cycle from scipy import interp from sklearn.metrics import roc_curve, ...
[ "sklearn.model_selection.train_test_split", "sklearn.metrics.classification_report", "matplotlib.pyplot.figure", "pickle.load", "itertools.cycle", "matplotlib.pyplot.tight_layout", "pandas.DataFrame", "numpy.zeros_like", "random.randint", "wandb.keras.WandbCallback", "sklearn.metrics.multilabel_...
[((1632, 1718), 'wandb.init', 'wandb.init', ([], {'project': '"""master_thesis"""', 'config': 'defaults', 'name': '"""small_vgg_network_2k"""'}), "(project='master_thesis', config=defaults, name=\n 'small_vgg_network_2k')\n", (1642, 1718), False, 'import wandb\n'), ((1825, 1858), 'pickle.load', 'pickle.load', (['f']...
import numpy import pytest from matchms.filtering import remove_peaks_around_precursor_mz from .builder_Spectrum import SpectrumBuilder @pytest.fixture def spectrum_in(): mz = numpy.array([10, 20, 30, 40], dtype="float") intensities = numpy.array([0, 1, 10, 100], dtype="float") metadata = {"precursor_mz":...
[ "pytest.raises", "matchms.filtering.remove_peaks_around_precursor_mz", "numpy.array" ]
[((182, 226), 'numpy.array', 'numpy.array', (['[10, 20, 30, 40]'], {'dtype': '"""float"""'}), "([10, 20, 30, 40], dtype='float')\n", (193, 226), False, 'import numpy\n'), ((245, 288), 'numpy.array', 'numpy.array', (['[0, 1, 10, 100]'], {'dtype': '"""float"""'}), "([0, 1, 10, 100], dtype='float')\n", (256, 288), False, ...
import numpy as np np.AxisError(1) np.AxisError(1, ndim=2) np.AxisError(1, ndim=None) np.AxisError(1, ndim=2, msg_prefix="error") np.AxisError(1, ndim=2, msg_prefix=None)
[ "numpy.AxisError" ]
[((20, 35), 'numpy.AxisError', 'np.AxisError', (['(1)'], {}), '(1)\n', (32, 35), True, 'import numpy as np\n'), ((36, 59), 'numpy.AxisError', 'np.AxisError', (['(1)'], {'ndim': '(2)'}), '(1, ndim=2)\n', (48, 59), True, 'import numpy as np\n'), ((60, 86), 'numpy.AxisError', 'np.AxisError', (['(1)'], {'ndim': 'None'}), '...
# -*- coding: utf-8 -*- """ Created on Tue Jul 17 17:46:20 2018 @author: RahulJY_Wang """ #%% import os os.chdir("D:\\RahulJY_Wang\\Qualification\\WiFi_interference_project\\wifi_predictor\\src") #local machine #os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import sys sys.path.append("../") import matplotlib.pyplot as pl...
[ "matplotlib.pyplot.title", "statsmodels.api.OLS", "sklearn.metrics.accuracy_score", "feature_extraction.feature_engineering.binding", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "tensorflow.python.framework.ops.reset_default_graph", "pickle.load", "os.chdir", "sys.path.append", "s...
[((105, 206), 'os.chdir', 'os.chdir', (['"""D:\\\\RahulJY_Wang\\\\Qualification\\\\WiFi_interference_project\\\\wifi_predictor\\\\src"""'], {}), "(\n 'D:\\\\RahulJY_Wang\\\\Qualification\\\\WiFi_interference_project\\\\wifi_predictor\\\\src'\n )\n", (113, 206), False, 'import os\n'), ((267, 289), 'sys.path.append...
OIMI_PQ8_R1_txt = ''' 0.1602 0.1747 0.1944 0.2064 0.2224 0.2294 0.2345 0.2370 ''' OIMI_PQ8_R10_txt = ''' 0.2790 0.3233 0.3838 0.4227 0.4701 0.4844 0.4984 0.5040 ''' OIMI_PQ8_T_txt = ''' 1.10 1.12 1.35 1.65 2.65 3.73 6.79 10.8 ''' IVF2M_PQ8_R1_txt = ''' 0.1829 0.2063 0.2336 0.2436 0.2552 0.2582 0.2611 0.2623 ''' IVF2M_...
[ "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.plot", "matplotlib.pyplot.axis", "seaborn.despine", "matplotlib.pyplot.figure", "re.findall", "numpy.arange", "matplotlib.pyplot.ylabel", "seaborn.set" ]
[((1294, 1332), 'seaborn.set', 'sns.set', ([], {'style': '"""ticks"""', 'palette': '"""Set2"""'}), "(style='ticks', palette='Set2')\n", (1301, 1332), True, 'import seaborn as sns\n'), ((1333, 1346), 'seaborn.despine', 'sns.despine', ([], {}), '()\n', (1344, 1346), True, 'import seaborn as sns\n'), ((1405, 1443), 're.fi...
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import pandas as pd import numpy as np import os from sklearn.model_selection import train_test_split as tts from matplotlib import pyplot as plt from zipfile import ZipFile import gensim from gensim.models import FastText, ...
[ "torch.nn.Dropout", "numpy.load", "torch.relu", "sklearn.model_selection.train_test_split", "torch.std", "numpy.arange", "torch.no_grad", "os.chdir", "torch.utils.data.DataLoader", "torch.Tensor", "torch.nn.Linear", "sklearn.svm.LinearSVC", "torch.nn.LSTM", "numpy.stack", "torch.mean", ...
[((399, 420), 'os.chdir', 'os.chdir', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (407, 420), False, 'import os\n'), ((429, 441), 'os.listdir', 'os.listdir', ([], {}), '()\n', (439, 441), False, 'import os\n'), ((1096, 1160), 'sklearn.model_selection.train_test_split', 'tts', (['vectorArray', 'labelArray'], {'test_size':...
import numpy as np import math from lognormpdf import lognormpdf def ComputeLogLikelihood(P, G, dataset): #print(G.shape) #print(dataset.shape) N = dataset.shape[0] K = len(P['c']) B = dataset.shape[1] loglikelihood = 0 if len(G.shape) == 2: G = np.tile(G.reshape([G.shape[0], G...
[ "math.exp", "numpy.array", "lognormpdf.lognormpdf", "numpy.dot", "math.log" ]
[((2009, 2039), 'math.log', 'math.log', (['single_loglikelihood'], {}), '(single_loglikelihood)\n', (2017, 2039), False, 'import math\n'), ((1572, 1602), 'lognormpdf.lognormpdf', 'lognormpdf', (['y_i', 'y_mu', 'y_sigma'], {}), '(y_i, y_mu, y_sigma)\n', (1582, 1602), False, 'from lognormpdf import lognormpdf\n'), ((1632...
import sys sys.path.append('../player_model/') import pandas as pd import numpy as np from environment import * from centroid_manager import * import copy import config TELEPORT_TO = 0 FORCE_EXPLOIT = 1 # TODO: assumes 5 player fixed model def simulate(close_second, models, environment_model, second_environment...
[ "sys.path.append", "pandas.DataFrame", "copy.deepcopy", "copy.copy", "numpy.array", "numpy.linalg.norm" ]
[((12, 47), 'sys.path.append', 'sys.path.append', (['"""../player_model/"""'], {}), "('../player_model/')\n", (27, 47), False, 'import sys\n'), ((7446, 7513), 'numpy.array', 'np.array', (['[([np.nan, np.nan] if x is None else x) for x in centers]'], {}), '([([np.nan, np.nan] if x is None else x) for x in centers])\n', ...
#!/usr/bin/python import os import pandas as pd import numpy as np np.random.seed(42) from sklearn.linear_model import LogisticRegression from sklearn.multiclass import OneVsRestClassifier from sklearn.metrics import roc_auc_score from sklearn.model_selection import ParameterSampler def doc_mean_thres(df): doc_me...
[ "pandas.DataFrame", "numpy.random.seed", "pandas.read_csv", "sklearn.metrics.roc_auc_score", "sklearn.linear_model.LogisticRegression", "sklearn.model_selection.ParameterSampler" ]
[((68, 86), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (82, 86), True, 'import numpy as np\n'), ((393, 449), 'pandas.DataFrame', 'pd.DataFrame', (['df_bin'], {'columns': 'df.columns', 'index': 'df.index'}), '(df_bin, columns=df.columns, index=df.index)\n', (405, 449), True, 'import pandas as pd\n'...
# coding=utf-8 # @Time : 2020/9/24 10:07 # @Auto : zzf-jeff import base64 from io import BytesIO import cv2 import numpy as np import requests as req from PIL import Image from io import BytesIO def url2img(img_url): ''' url图片转cv2 ''' response = req.get(img_url) image = Image.open(BytesIO(r...
[ "io.BytesIO", "cv2.cvtColor", "cv2.imdecode", "numpy.asanyarray", "base64.b64decode", "base64.b64encode", "requests.get", "numpy.fromstring" ]
[((271, 287), 'requests.get', 'req.get', (['img_url'], {}), '(img_url)\n', (278, 287), True, 'import requests as req\n'), ((988, 1016), 'base64.b64decode', 'base64.b64decode', (['str_base64'], {}), '(str_base64)\n', (1004, 1016), False, 'import base64\n'), ((1046, 1084), 'numpy.fromstring', 'np.fromstring', (['img_b64d...
import numpy as np np_array = np.array([1,3,5,7,9]) np_array2 = np.arange(2,10,2) np_zero = np.zeros(10)#ones np_l = np.linspace(0,100,5) np_r = np.random.randint(0,11, 10) np_ar = np.arange(40) np_ar_rs = np_ar.reshape(4, 10) #print(np_ar_rs.sum(axis=1)) #print(np_ar_rs.sum(axis=0)) rnm = np.random.randint(1,100,10) p...
[ "numpy.zeros", "numpy.random.randint", "numpy.array", "numpy.arange", "numpy.linspace" ]
[((30, 55), 'numpy.array', 'np.array', (['[1, 3, 5, 7, 9]'], {}), '([1, 3, 5, 7, 9])\n', (38, 55), True, 'import numpy as np\n'), ((64, 83), 'numpy.arange', 'np.arange', (['(2)', '(10)', '(2)'], {}), '(2, 10, 2)\n', (73, 83), True, 'import numpy as np\n'), ((92, 104), 'numpy.zeros', 'np.zeros', (['(10)'], {}), '(10)\n'...
import pandas as pd import numpy as np import sys import os.path import argparse import time import json import multiprocessing as mp import ray from ms_deisotope import deconvolute_peaks, averagine, scoring from ms_deisotope.deconvolution import peak_retention_strategy import pickle import configparser from configpars...
[ "pickle.dump", "numpy.abs", "argparse.ArgumentParser", "numpy.argmax", "numpy.empty", "time.ctime", "json.dumps", "multiprocessing.cpu_count", "pandas.DataFrame", "sklearn.metrics.pairwise.cosine_similarity", "pandas.merge", "ms_deisotope.scoring.PenalizedMSDeconVFitter", "configparser.Exten...
[((31045, 31138), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Detect the features in a run\'s precursor cuboids."""'}), '(description=\n "Detect the features in a run\'s precursor cuboids.")\n', (31068, 31138), False, 'import argparse\n'), ((32841, 32852), 'time.time', 'time.time',...
import asyncio import json import os from pathlib import Path import uuid import numpy as np import time import pickle import aiohttp import click from PIL import Image from tqdm import tqdm from datetime import timedelta import clip_inference import resnet_inference from utils import make_identifier, parse_gcs_path,...
[ "tqdm.tqdm", "uuid.uuid4", "pickle.dump", "click.argument", "utils.make_identifier", "resnet_inference.run", "numpy.argmax", "os.path.basename", "click.option", "time.time", "PIL.Image.open", "click.command", "aiohttp.ClientSession", "pathlib.Path", "datetime.timedelta", "utils.parse_g...
[((1025, 1040), 'click.command', 'click.command', ([], {}), '()\n', (1038, 1040), False, 'import click\n'), ((1042, 1064), 'click.argument', 'click.argument', (['"""name"""'], {}), "('name')\n", (1056, 1064), False, 'import click\n'), ((1066, 1098), 'click.argument', 'click.argument', (['"""train_gcs_path"""'], {}), "(...
"""Multiply arguments element-wise.""" import numpy import numpoly from .common import implements @implements(numpy.multiply) def multiply(x1, x2, out=None, where=True, **kwargs): """ Multiply arguments element-wise. Args: x1, x2 (numpoly.ndpoly): Input arrays to be multiplied. If ``...
[ "numpoly.align_polynomials", "numpy.multiply", "numpoly.clean_attributes", "numpy.unique" ]
[((1805, 1838), 'numpoly.align_polynomials', 'numpoly.align_polynomials', (['x1', 'x2'], {}), '(x1, x2)\n', (1830, 1838), False, 'import numpoly\n'), ((2786, 2815), 'numpoly.clean_attributes', 'numpoly.clean_attributes', (['out'], {}), '(out)\n', (2810, 2815), False, 'import numpoly\n'), ((2079, 2110), 'numpy.unique', ...
import numpy as np import tacoma as tc import networkx as nx # static structure parameters N = 100 mean_degree = 1.5 p = mean_degree / (N-1.0) # temporal parameters edge_lists = [] mean_tau = 1.0 t0 = 0.0 tmax = 100.0 t = [] this_time = t0 # Generate a new random network while this_time < tmax: G = nx.fast_gnp_...
[ "tacoma.edge_lists", "tacoma.drawing.edge_activity_plot", "numpy.random.exponential", "networkx.fast_gnp_random_graph", "bfmplot.pl.show", "tacoma.verify" ]
[((521, 536), 'tacoma.edge_lists', 'tc.edge_lists', ([], {}), '()\n', (534, 536), True, 'import tacoma as tc\n'), ((709, 741), 'tacoma.drawing.edge_activity_plot', 'edge_activity_plot', (['el'], {'fit': '(True)'}), '(el, fit=True)\n', (727, 741), False, 'from tacoma.drawing import edge_activity_plot\n'), ((742, 751), '...
#!/usr/bin/python # -*- coding:utf-8 -*- # @author : East # @time : 2019/7/21 16:38 # @file : mesh1d.py # @project : fempy # software : PyCharm import numpy as np class Mesh1D(object): def __init__(self, method='linspace', opt=None): if method == 'linspace': self.__points = np.linspace...
[ "numpy.linspace" ]
[((309, 326), 'numpy.linspace', 'np.linspace', (['*opt'], {}), '(*opt)\n', (320, 326), True, 'import numpy as np\n')]
#!/usr/bin/env python3 import os import sys import argparse import torch import numpy as np from fairseq import checkpoint_utils, options, tasks, utils from fairseq.models.transformer_modular import TransformerModularModel from fairseq.data import encoders from fairseq_cli.interactive import buffered_read, make_batche...
[ "fairseq.tasks.setup_task", "numpy.stack", "argparse.ArgumentParser", "torch.load", "fairseq_cli.interactive.buffered_read", "fairseq.data.encoders.build_tokenizer", "fairseq.data.encoders.build_bpe", "fairseq_cli.interactive.make_batches", "numpy.savez", "torch.no_grad" ]
[((351, 378), 'torch.load', 'torch.load', (['args.checkpoint'], {}), '(args.checkpoint)\n', (361, 378), False, 'import torch\n'), ((430, 460), 'fairseq.tasks.setup_task', 'tasks.setup_task', (["ckpt['args']"], {}), "(ckpt['args'])\n", (446, 460), False, 'from fairseq import checkpoint_utils, options, tasks, utils\n'), ...
""" A script that gathers important functions for processing and managing the data Interesting links which were considered for implementation and might be relevant for other users: getting images from imagenet: https://medium.com/coinmonks/how-to-get-images-from-imagenet-with-python-in-google-colaboratory...
[ "cv2.GaussianBlur", "numpy.load", "numpy.abs", "numpy.random.seed", "cv2.medianBlur", "random.shuffle", "numpy.floor", "os.walk", "cv2.warpAffine", "numpy.random.randint", "numpy.round", "os.path.join", "pandas.DataFrame", "json.loads", "cv2.cvtColor", "numpy.insert", "numpy.max", ...
[((1849, 1870), 'numpy.array', 'np.array', (['image_array'], {}), '(image_array)\n', (1857, 1870), True, 'import numpy as np\n'), ((1892, 1943), 'pandas.DataFrame', 'pd.DataFrame', (['file_name_list'], {'columns': "['file_name']"}), "(file_name_list, columns=['file_name'])\n", (1904, 1943), True, 'import pandas as pd\n...
import numpy as np import networkx as nx from plotly.offline import plot import pandas as pd from queue import Queue, PriorityQueue import operator ## A B C D E F G H I L M N O P R S T U V Z array = np.array( [ (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,118,0,0,75), # Arad (0,0,0,0...
[ "queue.PriorityQueue", "operator.itemgetter", "numpy.array", "queue.Queue" ]
[((221, 1616), 'numpy.array', 'np.array', (['[(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 118, 0, 0, 75), (0, 0, \n 0, 0, 0, 211, 90, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 85, 0, 0), (0, 0, 0, \n 120, 0, 0, 0, 0, 0, 0, 0, 0, 146, 138, 0, 0, 0, 0, 0, 0), (0, 0, 120, 0,\n 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0,...
"""Test XCOM data queries.""" import numpy as np from becquerel.tools import xcom import pytest XCOM_URL_ORIG = xcom._URL # energies to query using energies keyword ENERGIES_3 = [60.0, 662.0, 1460.0] # standard grid energies for Germanium from 1 keV to 10 MeV GE_GRID_ENERGIES = [ 1, 1.103, 1.217, ...
[ "pytest.raises", "becquerel.tools.xcom.fetch_xcom_data", "numpy.allclose" ]
[((1556, 1605), 'becquerel.tools.xcom.fetch_xcom_data', 'xcom.fetch_xcom_data', (['"""Ge"""'], {'energies_kev': 'energies'}), "('Ge', energies_kev=energies)\n", (1576, 1605), False, 'from becquerel.tools import xcom\n'), ((1661, 1693), 'numpy.allclose', 'np.allclose', (['xd.energy', 'energies'], {}), '(xd.energy, energ...