code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
from os.path import exists, join from os import makedirs from sklearn.metrics import confusion_matrix import tensorflow as tf import numpy as np import time import random from tqdm import tqdm from sklearn.neighbors import KDTree # use relative import for being compatible with Open3d main repo from .base_model import ...
[ "tensorflow.reduce_sum", "tensorflow.keras.layers.Dense", "numpy.argmax", "tensorflow.reshape", "numpy.argmin", "tensorflow.keras.layers.LeakyReLU", "tensorflow.numpy_function", "tensorflow.reduce_max", "tensorflow.nn.leaky_relu", "tensorflow.nn.softmax", "tensorflow.keras.layers.BatchNormalizat...
[((1831, 1882), 'tensorflow.keras.layers.Dense', 'tf.keras.layers.Dense', (['dim_feature'], {'activation': 'None'}), '(dim_feature, activation=None)\n', (1852, 1882), True, 'import tensorflow as tf\n'), ((1918, 1986), 'tensorflow.keras.layers.BatchNormalization', 'tf.keras.layers.BatchNormalization', (['(-1)'], {'momen...
# https://github.com/qq456cvb/doudizhu-C import sys from utils.card import Card, action_space, CardGroup, augment_action_space_onehot60, \ augment_action_space, clamp_action_idx from utils.utils import get_mask_onehot60 import numpy as np from config import ENV_DIR sys.path.insert(0, ENV_DIR) from env import get_c...
[ "env.get_combinations_recursive", "utils.card.clamp_action_idx", "utils.card.CardGroup.to_cardgroup", "numpy.expand_dims", "sys.path.insert", "utils.card.Card.char2onehot60", "numpy.where", "utils.utils.get_mask_onehot60", "env.get_combinations_nosplit" ]
[((271, 298), 'sys.path.insert', 'sys.path.insert', (['(0)', 'ENV_DIR'], {}), '(0, ENV_DIR)\n', (286, 298), False, 'import sys\n'), ((1245, 1286), 'env.get_combinations_nosplit', 'get_combinations_nosplit', (['mask', 'card_mask'], {}), '(mask, card_mask)\n', (1269, 1286), False, 'from env import get_combinations_nospli...
# Python Standard Libraries import warnings import time import os import sys from pathlib import Path # Third party imports # fancy prints import numpy as np from tqdm import tqdm # grAdapt package import grAdapt.utils.math import grAdapt.utils.misc import grAdapt.utils.sampling from grAdapt import surrogate as sur, ...
[ "os.remove", "numpy.load", "numpy.random.seed", "time.strftime", "numpy.argmin", "numpy.linalg.norm", "grAdapt.escape.NormalDistributionDecay", "os.path.exists", "grAdapt.sampling.equidistributed.MaximalMinDistance", "grAdapt.surrogate.GPRSlidingWindow", "tqdm.tqdm", "numpy.save", "grAdapt.s...
[((1670, 1703), 'numpy.random.seed', 'np.random.seed', (['self.random_state'], {}), '(self.random_state)\n', (1684, 1703), True, 'import numpy as np\n'), ((7791, 7816), 'grAdapt.space.transformer.Transformer', 'Transformer', (['func', 'bounds'], {}), '(func, bounds)\n', (7802, 7816), False, 'from grAdapt.space.transfor...
# coding: utf-8 from __future__ import unicode_literals import numpy import tempfile import shutil import contextlib import srsly from pathlib import Path from spacy.tokens import Doc, Span from spacy.attrs import POS, HEAD, DEP from spacy.compat import path2str @contextlib.contextmanager def make_tempfile(mode="r")...
[ "spacy.tokens.Doc", "spacy.compat.path2str", "spacy.tokens.Span", "tempfile.TemporaryFile", "tempfile.mkdtemp", "numpy.linalg.norm", "numpy.dot", "srsly.msgpack_loads" ]
[((330, 363), 'tempfile.TemporaryFile', 'tempfile.TemporaryFile', ([], {'mode': 'mode'}), '(mode=mode)\n', (352, 363), False, 'import tempfile\n'), ((898, 921), 'spacy.tokens.Doc', 'Doc', (['vocab'], {'words': 'words'}), '(vocab, words=words)\n', (901, 921), False, 'from spacy.tokens import Doc, Span\n'), ((3368, 3391)...
# 多项式拟合 import numpy as np import matplotlib.pyplot as plt # 定义x,y的散点坐标 # lat=[23.0262148,22.90151,22.786518,22.763319,22.707455,22.643107,23.43427,23.29968,23.185855,22.4337616,19.4386,18.7329,13.9486,11.9237,12.8544,20.2995, # 25.1499,16.0203,19.5012,22.5281,28.3964,21.0806,26.2406, # 25.8036,23.1643,16.2186,17.8153...
[ "numpy.poly1d", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.polyfit", "numpy.array", "matplotlib.pyplot.savefig" ]
[((900, 913), 'numpy.array', 'np.array', (['lon'], {}), '(lon)\n', (908, 913), True, 'import numpy as np\n'), ((916, 929), 'numpy.array', 'np.array', (['lat'], {}), '(lat)\n', (924, 929), True, 'import numpy as np\n'), ((948, 967), 'numpy.polyfit', 'np.polyfit', (['x', 'y', '(3)'], {}), '(x, y, 3)\n', (958, 967), True,...
""" Warping Invariant GML Regression using SRSF moduleauthor:: <NAME> <<EMAIL>> """ import numpy as np import fdasrsf as fs import fdasrsf.utility_functions as uf from patsy import bs from scipy.optimize import minimize from numpy.random import rand from joblib import Parallel, delayed class elastic_glm_regression:...
[ "fdasrsf.utility_functions.warp_f_gamma", "scipy.optimize.minimize", "numpy.sum", "numpy.polyfit", "numpy.polyval", "fdasrsf.utility_functions.f_to_srsf", "numpy.zeros", "numpy.diff", "patsy.bs", "joblib.Parallel", "numpy.random.rand", "numpy.dot", "joblib.delayed", "fdasrsf.utility_functi...
[((6049, 6065), 'numpy.polyval', 'np.polyval', (['h', 'y'], {}), '(h, y)\n', (6059, 6065), True, 'import numpy as np\n'), ((6347, 6357), 'numpy.diff', 'np.diff', (['t'], {}), '(t)\n', (6354, 6357), True, 'import numpy as np\n'), ((6386, 6397), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (6394, 6397), True, 'import...
if __name__ == "__main__": from movement import Movement from typing import List, Tuple import numpy as np def cmToInches(cm: float) -> float: return cm / 2.54 def euclidianDistance(x1: float, y1: float, x2: float, y2: float) -> float: # return np.linalg.norm([x1 - x2, y1 - y2]) # v1 return (x1 - x2)**2...
[ "numpy.rad2deg", "numpy.sin", "numpy.cos" ]
[((560, 580), 'numpy.rad2deg', 'np.rad2deg', (['yawInRad'], {}), '(yawInRad)\n', (570, 580), True, 'import numpy as np\n'), ((466, 479), 'numpy.cos', 'np.cos', (['angle'], {}), '(angle)\n', (472, 479), True, 'import numpy as np\n'), ((490, 503), 'numpy.sin', 'np.sin', (['angle'], {}), '(angle)\n', (496, 503), True, 'im...
import ellipse_lib as el import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse data = el.make_test_ellipse() lsqe = el.LSqEllipse() lsqe.fit(data) center, width, height, phi = lsqe.parameters() plt.close('all') fig = plt.figure(figsize=(6,6)) ax = fig.add_subplot(111) ax.axis('equ...
[ "matplotlib.pyplot.show", "ellipse_lib.LSqEllipse", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "numpy.rad2deg", "matplotlib.pyplot.figure", "ellipse_lib.make_test_ellipse" ]
[((123, 145), 'ellipse_lib.make_test_ellipse', 'el.make_test_ellipse', ([], {}), '()\n', (143, 145), True, 'import ellipse_lib as el\n'), ((154, 169), 'ellipse_lib.LSqEllipse', 'el.LSqEllipse', ([], {}), '()\n', (167, 169), True, 'import ellipse_lib as el\n'), ((233, 249), 'matplotlib.pyplot.close', 'plt.close', (['"""...
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Step class which lets you build your Step charts just passing the arguments to the Chart class and calling the proper functions. """ #-----------------------------------------------------------------...
[ "numpy.array" ]
[((6529, 6541), 'numpy.array', 'np.array', (['xs'], {}), '(xs)\n', (6537, 6541), True, 'import numpy as np\n'), ((6583, 6595), 'numpy.array', 'np.array', (['xs'], {}), '(xs)\n', (6591, 6595), True, 'import numpy as np\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- """ mm.tinker.py ============ Garleek - Tinker bridge """ from __future__ import print_function, absolute_import, division import os import sys import shutil from distutils.spawn import find_executable from subprocess import check_output from tempfile import NamedTempora...
[ "tempfile.NamedTemporaryFile", "os.remove", "os.path.abspath", "subprocess.check_output", "numpy.zeros", "numpy.ones", "os.environ.get", "numpy.array", "os.path.splitext", "distutils.spawn.find_executable", "shutil.copyfile" ]
[((462, 495), 'os.environ.get', 'os.environ.get', (['"""TINKER_TESTHESS"""'], {}), "('TINKER_TESTHESS')\n", (476, 495), False, 'import os\n'), ((499, 526), 'distutils.spawn.find_executable', 'find_executable', (['"""testhess"""'], {}), "('testhess')\n", (514, 526), False, 'from distutils.spawn import find_executable\n'...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
[ "numpy.expand_dims", "PIL.ImageOps.invert", "numpy.array", "numpy.ascontiguousarray", "numpy.concatenate" ]
[((5693, 5718), 'numpy.array', 'np.array', (['pic', 'np.float32'], {}), '(pic, np.float32)\n', (5701, 5718), True, 'import numpy as np\n'), ((5737, 5762), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['pic'], {}), '(pic)\n', (5757, 5762), True, 'import numpy as np\n'), ((5869, 5894), 'numpy.array', 'np.array', (...
from planer import tile, mapcoord import planer as rt import numpy as np import scipy.ndimage as ndimg root = '/'.join(__file__.split('\\')[:-1])+'/models' def load(lang='ch'): with open(root+('/ch', '/en')[lang=='en']+'_dict.txt', encoding='utf-8') as f: globals()['lab_dic'] = np.array(f.read().split('\...
[ "numpy.argmax", "scipy.ndimage.find_objects", "numpy.arange", "scipy.ndimage.mean", "numpy.pad", "planer.mapcoord", "matplotlib.pyplot.imshow", "numpy.cumsum", "numpy.max", "planer.tile", "numpy.cov", "matplotlib.pyplot.show", "imageio.imread", "numpy.cross", "numpy.hstack", "planer.lo...
[((606, 619), 'planer.tile', 'tile', ([], {'glob': '(32)'}), '(glob=32)\n', (610, 619), False, 'from planer import tile, mapcoord\n'), ((360, 424), 'planer.InferenceSession', 'rt.InferenceSession', (["(root + '/ppocr_mobilev2_det_%s.onnx' % lang)"], {}), "(root + '/ppocr_mobilev2_det_%s.onnx' % lang)\n", (379, 424), Tr...
import led_panel import numpy import time x = 0 y = 0 while True: frame = numpy.zeros((led_panel.height, led_panel.width), dtype=numpy.uint8) frame[y, x] = 255 led_panel.send(brightness=50, packed_frame=led_panel.pack(frame)) if x < led_panel.width - 1: x += 1 else: x = 0 if...
[ "led_panel.pack", "numpy.zeros" ]
[((79, 146), 'numpy.zeros', 'numpy.zeros', (['(led_panel.height, led_panel.width)'], {'dtype': 'numpy.uint8'}), '((led_panel.height, led_panel.width), dtype=numpy.uint8)\n', (90, 146), False, 'import numpy\n'), ((216, 237), 'led_panel.pack', 'led_panel.pack', (['frame'], {}), '(frame)\n', (230, 237), False, 'import led...
import time import numpy as np import tkinter as tk from PIL import ImageTk, Image np.random.seed(1) PhotoImage = ImageTk.PhotoImage unit = 50 height = 15 width = 15 class Env(tk.Tk): def __init__(self): super(Env, self).__init__() self.action_space = ['w', 's', 'a', 'd'] # wsad 키보드 자판을 기준으로 상하좌우 self.a...
[ "numpy.random.seed", "tkinter.Canvas", "PIL.Image.open", "time.sleep", "numpy.array" ]
[((84, 101), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (98, 101), True, 'import numpy as np\n'), ((619, 684), 'tkinter.Canvas', 'tk.Canvas', (['self'], {'bg': '"""white"""', 'height': 'self.height', 'width': 'self.width'}), "(self, bg='white', height=self.height, width=self.width)\n", (628, 684), T...
import logging import re import shutil import subprocess from collections import OrderedDict import traceback from pathlib import Path import numpy as np import pandas as pd import one.alf.io as alfio from ibllib.misc import check_nvidia_driver from ibllib.ephys import ephysqc, spikes, sync_probes from ibllib.io impo...
[ "numpy.load", "numpy.sum", "ibllib.io.extractors.camera.extract_all", "pathlib.Path.home", "pandas.read_csv", "one.alf.io.load_object", "ibllib.qc.task_extractors.TaskQCExtractor", "ibllib.io.spikeglx.glob_ephys_files", "numpy.linalg.cond", "pathlib.Path", "numpy.arange", "ibllib.misc.check_nv...
[((864, 891), 'logging.getLogger', 'logging.getLogger', (['"""ibllib"""'], {}), "('ibllib')\n", (881, 891), False, 'import logging\n'), ((1354, 1417), 'ibllib.io.extractors.ephys_fpga.extract_sync', 'ephys_fpga.extract_sync', (['self.session_path'], {'overwrite': 'overwrite'}), '(self.session_path, overwrite=overwrite)...
""" Module wraps some legacy code to construct a series of vtu files with 2D CFD data on unstructured mesh from structured mesh in numpy format. Code is not very general and likely only works for exact flow past cylinder dataset used in this project. Note this code is meant to be a wrapper for legacy code that is inte...
[ "os.mkdir", "numpy.load", "utils.get_grid_end_points", "u2r.interpolate_from_grid_to_mesh", "os.path.isdir", "numpy.transpose", "numpy.zeros", "vtktools.vtu", "numpy.max", "numpy.array", "numpy.squeeze", "u2r.simple_interpolate_from_mesh_to_grid" ]
[((974, 996), 'vtktools.vtu', 'vtktools.vtu', (['filename'], {}), '(filename)\n', (986, 996), False, 'import vtktools\n'), ((1013, 1027), 'vtktools.vtu', 'vtktools.vtu', ([], {}), '()\n', (1025, 1027), False, 'import vtktools\n'), ((1648, 1669), 'numpy.zeros', 'np.zeros', (['(nNodes, 3)'], {}), '((nNodes, 3))\n', (1656...
""" Tests for IRSA implementation. Since it is hard to find a real benchmark, the tests are basically just visual inspections, reproducing some plots from the original IRSA article. """ __author__ = "<NAME>" __email__ = "<EMAIL>" import unittest import os import itertools import json import matplotlib matplotlib.use(...
[ "os.mkdir", "matplotlib.pyplot.yscale", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "numpy.mean", "itertools.cycle", "src.irsa.mean_confidence_interval", "unittest.makeSuite", "matplotlib.pyplot.errorbar", "json.dump", "unittest.TestSuite", "matplotlib.pyplot.ylim", "matplotli...
[((305, 328), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (319, 328), False, 'import matplotlib\n'), ((460, 502), 'itertools.cycle', 'itertools.cycle', (["['r', 'b', 'g', 'm', 'k']"], {}), "(['r', 'b', 'g', 'm', 'k'])\n", (475, 502), False, 'import itertools\n'), ((517, 559), 'itertools.cy...
""" Example of using Automatic Mixed Precision (AMP) with PyTorch This example shows the change needed to incorporate AMP in a PyTorch model. In general the benefits are 1. Faster computations due to the introduction of half-precision floats and tensor core operations with e.g. V100 GPUs 2. Larger batch size as loss, ...
[ "torch.cuda.amp.autocast", "torch.nn.MSELoss", "apex.amp.initialize", "numpy.polyfit", "numpy.sin", "torch.cuda.is_available", "apex.amp.scale_loss", "numpy.linspace", "torch.nn.Linear", "torch.cuda.amp.GradScaler", "torch.linspace", "torch.sin", "torch.tensor", "torch.nn.Flatten" ]
[((1402, 1435), 'torch.nn.MSELoss', 'torch.nn.MSELoss', ([], {'reduction': '"""sum"""'}), "(reduction='sum')\n", (1418, 1435), False, 'import torch\n'), ((3012, 3044), 'numpy.linspace', 'np.linspace', (['(-np.pi)', 'np.pi', '(2000)'], {}), '(-np.pi, np.pi, 2000)\n', (3023, 3044), True, 'import numpy as np\n'), ((3053, ...
#!/usr/bin/env python # pylint: disable=invalid-name """rts_smooth.py: Smooth raster time series.""" from __future__ import absolute_import, division, print_function import argparse from array import array import os from os.path import basename try: from pathlib2 import Path except ImportError: from pathlib imp...
[ "modape.whittaker.ws2doptv", "numpy.sum", "argparse.ArgumentParser", "os.path.basename", "os.getcwd", "numpy.logical_not", "numpy.zeros", "modape.whittaker.ws2doptvp", "modape.utils.dtype_GDNP", "pathlib.Path", "numpy.where", "time.localtime", "array.array", "modape.whittaker.ws2d", "num...
[((905, 917), 'osgeo.gdal.Open', 'gdal.Open', (['x'], {}), '(x)\n', (914, 917), False, 'from osgeo import gdal\n'), ((10837, 10912), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Extract a window from MODIS products"""'}), "(description='Extract a window from MODIS products')\n", (10860...
# -*- coding:Utf-8 -*- """ .. currentmodule:: pylayers.antprop.channelc VectChannel Class ================= .. autosummary:: :toctree: generated/ VectChannel.__init__ VectChannel.show3_old VectChannel.show3 ScalChannel Class ================= .. autosummary:: :toctree: generated/ ScalChannel.__...
[ "pylayers.signal.bsignal.FUsignal", "pylayers.util.pyutil.getlong", "pylab.show", "pylab.title", "pylab.ylabel", "numpy.shape", "pylab.subplot", "pylab.scatter", "numpy.array", "pylab.xlabel", "numpy.linspace", "pylayers.signal.bsignal.FUDsignal", "numpy.log10", "pylayers.antprop.raysc.GrR...
[((2122, 2163), 'pylayers.util.pyutil.getlong', 'pyu.getlong', (['_filefield', "pstruc['DIRTUD']"], {}), "(_filefield, pstruc['DIRTUD'])\n", (2133, 2163), True, 'import pylayers.util.pyutil as pyu\n'), ((2220, 2260), 'pylayers.util.pyutil.getlong', 'pyu.getlong', (['_filetauk', "pstruc['DIRTUD']"], {}), "(_filetauk, ps...
import torch import numpy as np import torchvision.transforms.functional as F from PIL import Image class Resize(object): def __init__(self, size): self.size = size def __call__(self, sample): image, label = sample['image'], sample['label'] image = F.to_pil_image(image) # i...
[ "torch.from_numpy", "numpy.true_divide", "torchvision.transforms.functional.resize", "torchvision.transforms.functional.to_pil_image", "numpy.array", "numpy.repeat" ]
[((287, 308), 'torchvision.transforms.functional.to_pil_image', 'F.to_pil_image', (['image'], {}), '(image)\n', (301, 308), True, 'import torchvision.transforms.functional as F\n'), ((446, 472), 'torchvision.transforms.functional.resize', 'F.resize', (['image', 'self.size'], {}), '(image, self.size)\n', (454, 472), Tru...
import h5py import numpy as np import scipy as sp import pandas as pd import scipy.interpolate as intp import scipy.signal as sg import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from tqdm import tqdm from sklearn import manifold from scipy.optimize import least_squares from dechorate import co...
[ "matplotlib.pyplot.title", "numpy.abs", "pandas.read_csv", "numpy.allclose", "numpy.isnan", "numpy.shape", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.tight_layout", "numpy.unique", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.axvline", "matplotlib.pyplot.imshow", "dec...
[((1242, 1277), 'h5py.File', 'h5py.File', (['path_to_dataset_rir', '"""r"""'], {}), "(path_to_dataset_rir, 'r')\n", (1251, 1277), False, 'import h5py\n'), ((1297, 1325), 'numpy.unique', 'np.unique', (["dataset['src_id']"], {}), "(dataset['src_id'])\n", (1306, 1325), True, 'import numpy as np\n'), ((1398, 1426), 'numpy....
import numpy as np def transform_data(m, theta): """Transforms 2D power spectrum to polar coordinate system""" thetadelta = np.pi / theta im_center = int(m.shape[0] // 2) angles = np.arange(0, np.pi, thetadelta+1e-5) radiuses = np.arange(0, im_center+1e-5) A, R = np.meshgrid(angles, radiuses...
[ "numpy.meshgrid", "numpy.abs", "numpy.ceil", "numpy.fix", "numpy.floor", "numpy.expand_dims", "numpy.ones", "numpy.fft.fftshift", "numpy.arange", "numpy.fft.fft2", "numpy.cos", "numpy.sin", "numpy.blackman" ]
[((199, 238), 'numpy.arange', 'np.arange', (['(0)', 'np.pi', '(thetadelta + 1e-05)'], {}), '(0, np.pi, thetadelta + 1e-05)\n', (208, 238), True, 'import numpy as np\n'), ((251, 282), 'numpy.arange', 'np.arange', (['(0)', '(im_center + 1e-05)'], {}), '(0, im_center + 1e-05)\n', (260, 282), True, 'import numpy as np\n'),...
import sys import os sys.path.insert(0, os.path.abspath('..')) import pandas as pd from utility.sklearnbasemodel import BaseModel import numpy as np from utility.datafilepath import g_singletonDataFilePath from preprocess.preparedata import HoldoutSplitMethod from sklearn.metrics import mean_squared_error from evalu...
[ "os.path.abspath", "numpy.arange", "xgboost.XGBRegressor", "numpy.linspace", "utility.sklearnbasemodel.BaseModel.__init__" ]
[((40, 61), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (55, 61), False, 'import os\n'), ((520, 544), 'utility.sklearnbasemodel.BaseModel.__init__', 'BaseModel.__init__', (['self'], {}), '(self)\n', (538, 544), False, 'from utility.sklearnbasemodel import BaseModel\n'), ((676, 739), 'xgboost.X...
# This is the fastest python implementation of the ForceAtlas2 plugin from Gephi # intended to be used with networkx, but is in theory independent of # it since it only relies on the adjacency matrix. This # implementation is based directly on the Gephi plugin: # # https://github.com/gephi/gephi/blob/master/modules/La...
[ "networkx.to_scipy_sparse_matrix", "tqdm.tqdm", "numpy.count_nonzero", "scipy.sparse.issparse", "time.time", "random.random", "numpy.mean", "numpy.array", "igraph.layout.Layout", "numpy.all" ]
[((1140, 1151), 'time.time', 'time.time', ([], {}), '()\n', (1149, 1151), False, 'import time\n'), ((9989, 10048), 'networkx.to_scipy_sparse_matrix', 'networkx.to_scipy_sparse_matrix', (['G'], {'dtype': '"""f"""', 'format': '"""lil"""'}), "(G, dtype='f', format='lil')\n", (10020, 10048), False, 'import networkx\n'), ((...
from .core import IPStructure from .core import Subnet from .core import Interface from .core import IPAddress from .core import bin_add import numpy as np class Encoder: """ Encoder class """ def __init__(self, ip_structure, subnet): """ constructor :param ip_structure: ip s...
[ "numpy.binary_repr" ]
[((1191, 1208), 'numpy.binary_repr', 'np.binary_repr', (['v'], {}), '(v)\n', (1205, 1208), True, 'import numpy as np\n')]
import numpy as np import pandas as pd from sklearn.utils import Bunch def gen_random_spikes(N, T, firerate, framerate, seed=None): if seed is not None: np.random.seed(seed) true_spikes = np.random.rand(N, T) < firerate / float(framerate) return true_spikes def gen_sinusoidal_spikes(N, T, fir...
[ "pandas.DataFrame", "numpy.random.seed", "numpy.random.randn", "sklearn.utils.Bunch", "numpy.arange", "numpy.random.rand" ]
[((4203, 4267), 'numpy.arange', 'np.arange', (['(0)', '(traces.shape[1] / sampling_rate)', '(1 / sampling_rate)'], {}), '(0, traces.shape[1] / sampling_rate, 1 / sampling_rate)\n', (4212, 4267), True, 'import numpy as np\n'), ((4278, 4332), 'pandas.DataFrame', 'pd.DataFrame', (['traces.T'], {'index': 'time', 'columns':...
import numpy as np import torch from collections import namedtuple from torch.nn.parallel import DistributedDataParallel as DDP # from torch.nn.parallel import DistributedDataParallelCPU as DDPC # Deprecated from rlpyt.agents.base import BaseAgent, AgentStep from rlpyt.models.qpg.mlp import QofMuMlpModel, PiMlpModel ...
[ "numpy.abs", "numpy.logical_not", "rlpyt.utils.buffer.numpify_buffer", "numpy.expand_dims", "numpy.clip", "numpy.array", "collections.namedtuple", "rlpyt.distributions.gaussian.DistInfoStd", "numpy.squeeze", "torch.tensor", "torch.no_grad", "rlpyt.utils.collections.namedarraytuple" ]
[((676, 719), 'rlpyt.utils.collections.namedarraytuple', 'namedarraytuple', (['"""AgentInfo"""', "['dist_info']"], {}), "('AgentInfo', ['dist_info'])\n", (691, 719), False, 'from rlpyt.utils.collections import namedarraytuple\n'), ((729, 774), 'collections.namedtuple', 'namedtuple', (['"""Models"""', "['pi', 'q1', 'q2'...
import hashlib import os import warnings from multiprocessing import cpu_count, get_context from typing import ( Iterator, Iterable, List, Mapping, Optional, Tuple, Union) import lmdb import numpy as np from .backends import BACKEND_ACCESSOR_MAP from .backends import backend_decoder, backend_from_heuristics from ...
[ "numpy.zeros", "multiprocessing.get_context", "numpy.array", "warnings.warn", "multiprocessing.cpu_count" ]
[((47092, 47179), 'numpy.array', 'np.array', (['(*prototype.shape, prototype.size, prototype.dtype.num)'], {'dtype': 'np.uint64'}), '((*prototype.shape, prototype.size, prototype.dtype.num), dtype=np.\n uint64)\n', (47100, 47179), True, 'import numpy as np\n'), ((4465, 4672), 'warnings.warn', 'warnings.warn', (['f""...
# # imgAnalyserTest.py # # MIT License - CCD_CAPTURE # # Copyright (c) 2019 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rig...
[ "unittest.main", "imgAnalyser.ImgAnalyser", "cv2.waitKey", "numpy.allclose", "numpy.array", "sys.stdout.flush", "cv2.imshow" ]
[((5941, 5956), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5954, 5956), False, 'import unittest\n'), ((1383, 1408), 'imgAnalyser.ImgAnalyser', 'imgAnalyser.ImgAnalyser', ([], {}), '()\n', (1406, 1408), False, 'import imgAnalyser\n'), ((1432, 1488), 'numpy.array', 'np.array', (['[[0, 1, 2], [3, 4, 5], [6, 7, 8...
from numpy import random from numpy import sqrt from pandas import read_csv from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from tensorflow.keras import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.models import load_model if __name__ ==...
[ "tensorflow.keras.models.load_model", "tensorflow.keras.layers.Dense", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.LabelEncoder", "tensorflow.keras.Sequential", "numpy.sqrt" ]
[((392, 1047), 'pandas.read_csv', 'read_csv', (['"""/Volumes/G-DRIVE mobile/Data/FannieMae/2019Q1/Acquisition_2019Q1.txt"""'], {'delimiter': '"""|"""', 'index_col': '(False)', 'names': "['loan_identifier', 'channel', 'seller_name', 'original_interest_rate',\n 'original_upb', 'original_loan_term', 'origination_date',...
import numpy as np import re import os import matplotlib.pyplot as plt au_to_ev = 27.21139 def get_high_symm_points(kpt_file): #high symmetry points have a descriptive character in their 5th column # these characters are read here #get the labels of each k-point kpt_label = [] with open(kpt_file,'r',) as origin...
[ "matplotlib.pyplot.plot", "os.path.isdir", "matplotlib.pyplot.legend", "numpy.genfromtxt", "matplotlib.pyplot.subplots", "os.path.isfile", "numpy.linalg.norm", "numpy.array", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.savef...
[((1970, 1994), 'os.path.isfile', 'os.path.isfile', (['kpt_file'], {}), '(kpt_file)\n', (1984, 1994), False, 'import os\n'), ((2582, 2605), 'os.path.isfile', 'os.path.isfile', (['en_file'], {}), '(en_file)\n', (2596, 2605), False, 'import os\n'), ((3902, 3920), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1...
# OK. So we've gathered our sample. We've run the MCMC to measure SLFV. # We've also done simple prewhitening to give us a prior on frequency. # Now let's jointly model the SLFV and pulsations with a GP import numpy as np import pandas as pd from TESStools import * import os import warnings from multiprocessing imp...
[ "pandas.DataFrame", "h5py.File", "celerite2.theano.terms.SHOTerm", "pymc3.Model", "numpy.log", "pymc3_ext.optimize", "pandas.read_csv", "pymc3.Deterministic", "numpy.power", "numpy.std", "aesara_theano_fallback.tensor.exp", "numpy.max", "numpy.diff", "pymc3.Uniform", "pymc3_ext.Angle", ...
[((659, 697), 'pandas.read_csv', 'pd.read_csv', (['"""sample.csv"""'], {'index_col': '(0)'}), "('sample.csv', index_col=0)\n", (670, 697), True, 'import pandas as pd\n'), ((711, 741), 'pandas.read_csv', 'pd.read_csv', (['"""slfv_params.csv"""'], {}), "('slfv_params.csv')\n", (722, 741), True, 'import pandas as pd\n'), ...
import numpy as np from pandas import DataFrame, Index, PeriodIndex, period_range import pandas._testing as tm class TestPeriodIndex: def test_as_frame_columns(self): rng = period_range("1/1/2000", periods=5) df = DataFrame(np.random.randn(10, 5), columns=rng) ts = df[rng[0]] tm....
[ "pandas.period_range", "numpy.random.randn", "pandas.Index", "pandas._testing.assert_series_equal", "pandas._testing.assert_index_equal", "pandas.PeriodIndex" ]
[((188, 223), 'pandas.period_range', 'period_range', (['"""1/1/2000"""'], {'periods': '(5)'}), "('1/1/2000', periods=5)\n", (200, 223), False, 'from pandas import DataFrame, Index, PeriodIndex, period_range\n'), ((317, 358), 'pandas._testing.assert_series_equal', 'tm.assert_series_equal', (['ts', 'df.iloc[:, 0]'], {}),...
""" This module contains the :class:`Scene` class which is used to setup a scene for a robot simulation using PyBullet. """ import numpy as np import pybullet as p from pybullet_utils.bullet_client import BulletClient from classic_framework import Scene from classic_framework.pybullet.PyBullet_Camera import InHandCame...
[ "numpy.arange", "pybullet.getQuaternionFromEuler", "pybullet.setRealTimeSimulation", "pybullet.setGravity", "pybullet.resetBasePositionAndOrientation", "classic_framework.utils.sim_path.sim_framework_path", "pybullet.multiplyTransforms", "pybullet.getJointInfo", "pybullet.loadSDF", "pybullet.reset...
[((1449, 1463), 'classic_framework.pybullet.PyBullet_Camera.InHandCamera', 'InHandCamera', ([], {}), '()\n', (1461, 1463), False, 'from classic_framework.pybullet.PyBullet_Camera import InHandCamera, CageCamera\n'), ((1488, 1500), 'classic_framework.pybullet.PyBullet_Camera.CageCamera', 'CageCamera', ([], {}), '()\n', ...
from time import time from modules.logging import logger import matplotlib.pyplot as plt import numpy as np import h5py import shutil import os import collections def show_slices(pixels, name, nr_slices=12, cols=4, output_dir=None, size=7): print(name) fig = plt.figure() slice_depth = round(np.shape(pixels...
[ "h5py.File", "matplotlib.pyplot.show", "os.makedirs", "matplotlib.pyplot.close", "os.path.exists", "numpy.all", "time.time", "numpy.shape", "numpy.any", "matplotlib.pyplot.figure", "numpy.mean", "numpy.array", "modules.logging.logger.info", "modules.logging.logger.warning", "shutil.rmtre...
[((268, 280), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (278, 280), True, 'import matplotlib.pyplot as plt\n'), ((907, 922), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)'], {}), '(1)\n', (919, 922), True, 'import matplotlib.pyplot as plt\n'), ((1448, 1497), 'modules.logging.logger.info', 'logg...
import numpy as np import torch import random import logging import time import pickle import os from retro_star.common import args, prepare_starting_molecules, prepare_mlp, \ prepare_molstar_planner, smiles_to_fp from retro_star.model import ValueMLP from retro_star.utils import setup_logger def retro_plan(): ...
[ "os.mkdir", "pickle.dump", "retro_star.common.smiles_to_fp", "numpy.random.seed", "retro_star.model.ValueMLP", "torch.manual_seed", "torch.load", "os.path.exists", "torch.FloatTensor", "time.time", "retro_star.common.prepare_mlp", "logging.info", "random.seed", "numpy.array", "torch.devi...
[((331, 379), 'torch.device', 'torch.device', (["('cuda' if args.gpu >= 0 else 'cpu')"], {}), "('cuda' if args.gpu >= 0 else 'cpu')\n", (343, 379), False, 'import torch\n'), ((401, 452), 'retro_star.common.prepare_starting_molecules', 'prepare_starting_molecules', (['args.starting_molecules'], {}), '(args.starting_mole...
import os import sys import json import numpy as np from collections import deque, namedtuple from argparse import ArgumentParser os.environ['TF_KERAS'] = '1' from tensorflow import keras import bert_tokenization as tokenization from keras_bert import load_trained_model_from_checkpoint, AdamWarmup from keras_bert i...
[ "numpy.stack", "json.load", "argparse.ArgumentParser", "keras_bert.load_trained_model_from_checkpoint", "numpy.argmax", "bert_tokenization.FullTokenizer", "numpy.unique", "numpy.array", "collections.namedtuple", "keras_bert.get_custom_objects", "os.path.join", "collections.deque" ]
[((457, 607), 'collections.namedtuple', 'namedtuple', (['"""Sentences"""', "['words', 'tokens', 'labels', 'lengths', 'combined_tokens',\n 'combined_labels', 'sentence_numbers', 'sentence_starts']"], {}), "('Sentences', ['words', 'tokens', 'labels', 'lengths',\n 'combined_tokens', 'combined_labels', 'sentence_numb...
import os import shutil import matplotlib.pyplot as plt import numpy as np import pandas as pd import h5py import time from EdgeConv.DataGeneratorMulti import DataGeneratorMulti from torch import nn from torch.utils.data import DataLoader, Dataset import torch import torch.optim as optim import tqdm impo...
[ "torch.nn.Dropout", "numpy.load", "pytorch_lightning.Trainer", "gMLPhase.gMLP_torch.conv_block", "torch.cat", "logging.Formatter", "shutil.rmtree", "os.path.join", "logging.FileHandler", "torch.utils.data.DataLoader", "torch.nn.Conv1d", "torch.optim.lr_scheduler.ReduceLROnPlateau", "pytorch_...
[((896, 915), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (913, 915), False, 'import logging\n'), ((978, 1025), 'logging.FileHandler', 'logging.FileHandler', (['"""debug5.log"""', '"""w"""', '"""utf-8"""'], {}), "('debug5.log', 'w', 'utf-8')\n", (997, 1025), False, 'import logging\n'), ((1062, 1103), 'l...
from torch.utils.data import Dataset import torchvision.transforms as transforms import torch import numpy as np device = torch.device('cpu') if(torch.cuda.is_available()): device = torch.device('cuda:0') class BirdDataset(Dataset): def __init__(self,data,label,logprob,reward): self.data = data ...
[ "numpy.std", "numpy.array", "torch.cuda.is_available", "torch.device", "torchvision.transforms.ToTensor" ]
[((122, 141), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (134, 141), False, 'import torch\n'), ((145, 170), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (168, 170), False, 'import torch\n'), ((187, 209), 'torch.device', 'torch.device', (['"""cuda:0"""'], {}), "('cuda:0'...
from gs_orth import * import numpy as np def qr_decomposition_solver(A,B): """ function that takes arrays A,B of A.x = B and returns list x (top to bottom) this function does this using QR decomposition with Gram-Schmidt orthogonalization followed by back substitution Inputs: Lists A,B (converted...
[ "numpy.zeros", "numpy.dot", "numpy.array" ]
[((440, 451), 'numpy.array', 'np.array', (['A'], {}), '(A)\n', (448, 451), True, 'import numpy as np\n'), ((898, 911), 'numpy.array', 'np.array', (['Q_t'], {}), '(Q_t)\n', (906, 911), True, 'import numpy as np\n'), ((1269, 1295), 'numpy.zeros', 'np.zeros', (['(n_cols, n_cols)'], {}), '((n_cols, n_cols))\n', (1277, 1295...
import cv2 import numpy as np import pyautogui as gui from time import time loop_time = time() while(True): screenshot = gui.screenshot() # re-shape into format opencv understands screenshot = np.array(screenshot) # remember opencv uses BGR so we have to convert screenshot = cv2.cvtColor(screens...
[ "cv2.cvtColor", "cv2.waitKey", "cv2.destroyAllWindows", "pyautogui.screenshot", "time.time", "numpy.array", "cv2.imshow" ]
[((89, 95), 'time.time', 'time', ([], {}), '()\n', (93, 95), False, 'from time import time\n'), ((128, 144), 'pyautogui.screenshot', 'gui.screenshot', ([], {}), '()\n', (142, 144), True, 'import pyautogui as gui\n'), ((208, 228), 'numpy.array', 'np.array', (['screenshot'], {}), '(screenshot)\n', (216, 228), True, 'impo...
import unittest import numpy as np from ShutTUM import Interpolation class TestInterpolation(unittest.TestCase): def setUp(self): self.linear = Interpolation.linear self.slerp = Interpolation.slerp self.cubic = Interpolation.cubic self.lower = np.array((0,2,10)) self.up...
[ "unittest.main", "numpy.array", "numpy.linspace" ]
[((1816, 1831), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1829, 1831), False, 'import unittest\n'), ((286, 306), 'numpy.array', 'np.array', (['(0, 2, 10)'], {}), '((0, 2, 10))\n', (294, 306), True, 'import numpy as np\n'), ((327, 348), 'numpy.array', 'np.array', (['(1, 4, 110)'], {}), '((1, 4, 110))\n', (335...
import logging import numpy as np import satmeta.s2.meta as s2meta import satmeta.s2.angles_2d as s2angles logger = logging.getLogger(__name__) def toa_reflectance_to_radiance(dndata, mtdFile, mtdFile_tile, band_ids, dst_transform=None): """Method taken from the bottom of http://s2tbx.telespazio-vega.de/sen2th...
[ "numpy.radians", "satmeta.s2.meta.parse_metadata", "logging.getLogger", "numpy.array", "satmeta.s2.angles_2d.parse_resample_angles", "satmeta.s2.meta.parse_granule_metadata" ]
[((119, 146), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (136, 146), False, 'import logging\n'), ((891, 921), 'satmeta.s2.meta.parse_metadata', 's2meta.parse_metadata', (['mtdFile'], {}), '(mtdFile)\n', (912, 921), True, 'import satmeta.s2.meta as s2meta\n'), ((1017, 1052), 'numpy.arr...
""" In this implementation, we use the architecture of Reptile as the same as MAML. """ import torch import visdom import numpy as np import learn2learn as l2l import copy import time import os from Models.MAML.maml_model import Net4CNN from Datasets.cwru_data import MAML_Dataset from my_utils.train_utils import accu...
[ "visdom.Visdom", "learn2learn.data.transforms.FusedNWaysKShots", "numpy.arange", "Datasets.cwru_data.MAML_Dataset", "torch.load", "os.path.exists", "my_utils.train_utils.accuracy", "Models.MAML.maml_model.Net4CNN", "learn2learn.data.transforms.ConsecutiveLabels", "copy.deepcopy", "torch.randint"...
[((332, 363), 'visdom.Visdom', 'visdom.Visdom', ([], {'env': '"""yancy_meta"""'}), "(env='yancy_meta')\n", (345, 363), False, 'import visdom\n'), ((10769, 10785), 'my_utils.init_utils.seed_torch', 'seed_torch', (['(2021)'], {}), '(2021)\n', (10779, 10785), False, 'from my_utils.init_utils import seed_torch\n'), ((396, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- r"""Provide the Cartesian CoM acceleration task. The CoM task tries to impose a desired position of the CoM with respect to the world frame. .. math:: ||J_{CoM} \dot{q} - (K_p (x_d - x) + \dot{x}_d)||^2 where :math:`J_{CoM}` is the CoM Jacobian, :math:`\dot{q}` are the j...
[ "numpy.dot", "numpy.asarray", "numpy.zeros" ]
[((9151, 9171), 'numpy.asarray', 'np.asarray', (['velocity'], {}), '(velocity)\n', (9161, 9171), True, 'import numpy as np\n'), ((10021, 10045), 'numpy.asarray', 'np.asarray', (['acceleration'], {}), '(acceleration)\n', (10031, 10045), True, 'import numpy as np\n'), ((8324, 8344), 'numpy.asarray', 'np.asarray', (['posi...
# Copyright (c) 2019 <NAME>. All rights reserved. import numpy as np from sdf import Group, Dataset import scipy.io # extract strings from the matrix strMatNormal = lambda a: [''.join(s).rstrip() for s in a] strMatTrans = lambda a: [''.join(s).rstrip() for s in zip(*a)] def _split_description(comment): ...
[ "numpy.abs", "numpy.asarray", "numpy.sign", "sdf.Dataset", "sdf.Group" ]
[((3193, 3203), 'sdf.Group', 'Group', (['"""/"""'], {}), "('/')\n", (3198, 3203), False, 'from sdf import Group, Dataset\n'), ((2591, 2601), 'numpy.sign', 'np.sign', (['x'], {}), '(x)\n', (2598, 2601), True, 'import numpy as np\n'), ((2554, 2563), 'numpy.abs', 'np.abs', (['x'], {}), '(x)\n', (2560, 2563), True, 'import...
""" Utilies to uniform marker names """ import logging import numpy as np import pandas as pd import pathlib from ..model.mapping import OTHER_FEATHERS log = logging.getLogger(__name__) module = pathlib.Path(__file__).absolute().parent PATH_TO_MARKERS = str(pathlib.Path.joinpath(module, 'markers.tsv')) class Mark...
[ "pandas.read_csv", "numpy.logical_and.reduce", "pathlib.Path", "pathlib.Path.joinpath", "logging.getLogger" ]
[((161, 188), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (178, 188), False, 'import logging\n'), ((262, 306), 'pathlib.Path.joinpath', 'pathlib.Path.joinpath', (['module', '"""markers.tsv"""'], {}), "(module, 'markers.tsv')\n", (283, 306), False, 'import pathlib\n'), ((199, 221), 'pat...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ This code uses a user-defined database, image directory, image file extension, and darkframe to loop through the Tetra database and generate inputs for the opencv camera calibration routine """ ################################ #LOAD LIBRARIES ############################...
[ "pathlib.Path", "numpy.sin", "os.path.join", "tetra3_Cal.Tetra3", "cv2.subtract", "os.path.exists", "numpy.append", "cv2.calibrationMatrixValues", "json.dump", "numpy.cos", "cv2.calibrateCamera", "numpy.dot", "numpy.delete", "sys.exit", "numpy.deg2rad", "os.getcwd", "time.time", "c...
[((1360, 1375), 'tetra3_Cal.Tetra3', 'Tetra3', (['db_name'], {}), '(db_name)\n', (1366, 1375), False, 'from tetra3_Cal import Tetra3\n'), ((1918, 1946), 'pathlib.Path', 'pathlib.Path', (['path_to_images'], {}), '(path_to_images)\n', (1930, 1946), False, 'import pathlib\n'), ((1977, 1998), 'numpy.array', 'np.array', (['...
import os import numpy as np from setuptools import find_packages, setup from setuptools.extension import Extension from Cython.Build import cythonize extensions = [ Extension('pulse2percept.fast_retina', ['pulse2percept/fast_retina.pyx'], include_dirs=[np.get_include()], extra_compile_...
[ "Cython.Build.cythonize", "setuptools.setup", "numpy.get_include", "os.path.join", "setuptools.find_packages" ]
[((428, 471), 'os.path.join', 'os.path.join', (['"""pulse2percept"""', '"""version.py"""'], {}), "('pulse2percept', 'version.py')\n", (440, 471), False, 'import os\n'), ((1118, 1131), 'setuptools.setup', 'setup', ([], {}), '(**opts)\n', (1123, 1131), False, 'from setuptools import find_packages, setup\n'), ((982, 997),...
#!/usr/bin/env python # encoding: utf-8 """ my_test2.py Created by <NAME> on 2011-06-06. Copyright (c) 2011 University of Strathclyde. All rights reserved. """ from __future__ import division import sys import os import numpy as np import scipy.integrate as integral def test(N, w): # Parameters pmin = 0 pmax = 1 ...
[ "numpy.random.uniform", "scipy.integrate.quad" ]
[((340, 369), 'numpy.random.uniform', 'np.random.uniform', (['pmin', 'pmax'], {}), '(pmin, pmax)\n', (357, 369), True, 'import numpy as np\n'), ((413, 442), 'numpy.random.uniform', 'np.random.uniform', (['pmin', 'pmax'], {}), '(pmin, pmax)\n', (430, 442), True, 'import numpy as np\n'), ((519, 587), 'scipy.integrate.qua...
from collections import Counter from shutil import copyfile from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.decomposition import TruncatedSVD import _pickle as pickle import re import path import os import numpy as np import sys from ...
[ "numpy.linalg.svd", "numpy.mean", "numpy.linalg.norm", "numpy.asscalar", "os.path.join", "_pickle.load", "re.findall", "sklearn.feature_extraction.text.TfidfTransformer", "matplotlib.pyplot.show", "_pickle.dump", "matplotlib.pyplot.legend", "nltk.corpus.stopwords.words", "numpy.squeeze", "...
[((5324, 5349), 'numpy.array', 'np.array', (['doc_term_matrix'], {}), '(doc_term_matrix)\n', (5332, 5349), True, 'import numpy as np\n'), ((5360, 5387), 'sklearn.feature_extraction.text.TfidfTransformer', 'TfidfTransformer', ([], {'norm': '"""l2"""'}), "(norm='l2')\n", (5376, 5387), False, 'from sklearn.feature_extract...
#!/usr/bin/env python3 import os import time import h5py import sys import numpy as np import pandas as pd from pprint import pprint import matplotlib.pyplot as plt from pygama import DataSet, read_lh5, get_lh5_header import pygama.analysis.histograms as pgh # new viewer for waveforms for llama / scarf tests. # Large...
[ "h5py.File", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "pygama.get_lh5_header", "matplotlib.pyplot.ion", "numpy.arange", "matplotlib.pyplot.pause", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.tight_layout", "numpy.vstack" ]
[((1093, 1117), 'h5py.File', 'h5py.File', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (1102, 1117), False, 'import h5py\n'), ((1414, 1434), 'numpy.arange', 'np.arange', (['chunksize'], {}), '(chunksize)\n', (1423, 1434), True, 'import numpy as np\n'), ((1584, 1598), 'numpy.vstack', 'np.vstack', (['wfs'], {}), '...
import math import os import pathlib import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import garch as g import garch_const_lambda as gc import pricing as p def compare(theta_hat, risk_free_rate, asset_price_t, t=0, T=90, ...
[ "seaborn.lineplot", "pandas.read_csv", "pricing.compute_GARCH_delta", "garch_const_lambda.estimate_GARCH_11_theta", "numpy.mean", "numpy.arange", "pricing.compute_GARCH_call_price", "os.path.join", "pandas.DataFrame", "numpy.std", "numpy.max", "pricing.compute_BS_call_price", "matplotlib.pyp...
[((981, 1169), 'pricing.compute_GARCH_price', 'p.compute_GARCH_price', ([], {'theta': 'theta_hat', 'num_periods': 'num_periods', 'init_price': 'asset_price_t', 'init_sigma': 'GARCH_sigma_t', 'risk_free_rate': 'risk_free_rate', 'num_simulations': 'num_simulations'}), '(theta=theta_hat, num_periods=num_periods, init_pric...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "numpy.random.uniform", "paddlespeech.t2s.modules.stft_loss.STFT", "scipy.signal.get_window", "paddlespeech.t2s.modules.stft_loss.MultiResolutionSTFTLoss", "parallel_wavegan.losses.stft_loss.MultiResolutionSTFTLoss", "torch.as_tensor", "paddle.uniform", "librosa.stft" ]
[((902, 951), 'paddlespeech.t2s.modules.stft_loss.STFT', 'STFT', ([], {'n_fft': '(1024)', 'hop_length': '(256)', 'win_length': '(1024)'}), '(n_fft=1024, hop_length=256, win_length=1024)\n', (906, 951), False, 'from paddlespeech.t2s.modules.stft_loss import STFT\n'), ((960, 986), 'paddle.uniform', 'paddle.uniform', (['[...
#!/usr/bin/env python """ Copyright 2020, University Corporation for Atmospheric Research See LICENSE.txt for details """ import numpy as np from pyreshaper import iobackend from . import config def generate_data(backend='netCDF4'): """ Generate dataset for testing purposes """ iobackend.set_backen...
[ "pyreshaper.iobackend.NCFile", "numpy.ma.MaskedArray", "numpy.ones", "numpy.arange", "numpy.linspace", "numpy.random.choice", "numpy.float64", "pyreshaper.iobackend.set_backend" ]
[((300, 330), 'pyreshaper.iobackend.set_backend', 'iobackend.set_backend', (['backend'], {}), '(backend)\n', (321, 330), False, 'from pyreshaper import iobackend\n'), ((533, 566), 'pyreshaper.iobackend.NCFile', 'iobackend.NCFile', (['fname'], {'mode': '"""w"""'}), "(fname, mode='w')\n", (549, 566), False, 'from pyresha...
import numpy as np import torchvision as thv import torch import cv2 #np.random.seed(20) #torch.manual_seed(20) def check_data_balance(X, Y): n_classes = len(np.unique(Y)) label_ct = np.zeros(n_classes) for i in range(len(Y)): label = Y[i] label_ct[label] += 1 return label_ct def resample_data(X, Y, n...
[ "torch.utils.data.DataLoader", "numpy.asarray", "numpy.zeros", "torch.tensor", "numpy.unique" ]
[((188, 207), 'numpy.zeros', 'np.zeros', (['n_classes'], {}), '(n_classes)\n', (196, 207), True, 'import numpy as np\n'), ((410, 429), 'numpy.zeros', 'np.zeros', (['n_classes'], {}), '(n_classes)\n', (418, 429), True, 'import numpy as np\n'), ((675, 692), 'numpy.asarray', 'np.asarray', (['new_X'], {}), '(new_X)\n', (68...
import numpy as np # Function to get the idle time Xi on machine B for all jobs def get_idle_time(data, optimal_seq): # Store the Ai's & Bi's from the given data a = [data[0][i-1] for i in optimal_seq] b = [data[1][i-1] for i in optimal_seq] # This array will store the idle times on machine B ...
[ "numpy.zeros", "numpy.genfromtxt", "numpy.unravel_index" ]
[((687, 718), 'numpy.zeros', 'np.zeros', (['x.shape[1]'], {'dtype': 'int'}), '(x.shape[1], dtype=int)\n', (695, 718), True, 'import numpy as np\n'), ((2111, 2154), 'numpy.genfromtxt', 'np.genfromtxt', (['schedule_file'], {'delimiter': '""","""'}), "(schedule_file, delimiter=',')\n", (2124, 2154), True, 'import numpy as...
# Copyright 2017 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
[ "numpy.stack", "numpy.asarray" ]
[((6420, 6452), 'numpy.stack', 'np.stack', (['featureValues'], {'axis': '(-1)'}), '(featureValues, axis=-1)\n', (6428, 6452), True, 'import numpy as np\n'), ((5881, 5897), 'numpy.asarray', 'np.asarray', (['fval'], {}), '(fval)\n', (5891, 5897), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- """ Functions to analyze the relevance of features selected with smaller networks when classifying larger networks. """ from joblib import Parallel, delayed import matplotlib.pyplot as plt import numpy as np import pandas as pd import random import seaborn as sns from sklearn.model_selection im...
[ "numpy.sum", "sklearn.model_selection.train_test_split", "sklearn.model_selection.cross_val_score", "numpy.mean", "cost_based_selection.cost_based_methods.JMI", "pandas.DataFrame", "numpy.std", "cost_based_selection.cost_based_methods.reliefF", "cost_based_selection.cost_based_methods.mRMR", "cost...
[((3653, 3682), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(13, 8)'}), '(figsize=(13, 8))\n', (3665, 3682), True, 'import matplotlib.pyplot as plt\n'), ((4230, 4271), 'matplotlib.pyplot.subplots_adjust', 'plt.subplots_adjust', ([], {'top': '(0.95)', 'right': '(0.95)'}), '(top=0.95, right=0.95)\n', ...
"""Test derivation of `et`.""" import iris import numpy as np import pytest from cf_units import Unit import esmvalcore.preprocessor._derive.et as et @pytest.fixture def cubes(): hfls_cube = iris.cube.Cube([[1.0, 2.0], [0.0, -2.0]], standard_name='surface_upward_latent_heat_flux') ...
[ "iris.cube.CubeList", "esmvalcore.preprocessor._derive.et.DerivedVariable", "numpy.array", "iris.cube.Cube", "cf_units.Unit" ]
[((198, 293), 'iris.cube.Cube', 'iris.cube.Cube', (['[[1.0, 2.0], [0.0, -2.0]]'], {'standard_name': '"""surface_upward_latent_heat_flux"""'}), "([[1.0, 2.0], [0.0, -2.0]], standard_name=\n 'surface_upward_latent_heat_flux')\n", (212, 293), False, 'import iris\n'), ((334, 388), 'iris.cube.Cube', 'iris.cube.Cube', (['...
import tkinter as tk import tkinter.font as tkfont from tkinter import ttk from tkinter import filedialog from PIL import Image, ImageTk # need to import extra module "pip install pillow" import numpy as np import os, csv, json, threading from enum import IntEnum import pypuclib from pypuclib import CameraFactory, Ca...
[ "tkinter.StringVar", "tkinter.Text", "numpy.load", "tkinter.ttk.Label", "tkinter.ttk.Spinbox", "pypuclib.Resolution", "tkinter.font.Font", "os.path.isfile", "tkinter.BooleanVar", "tkinter.Label", "tkinter.ttk.LabelFrame", "os.path.dirname", "tkinter.filedialog.askopenfilename", "tkinter.tt...
[((4170, 4191), 'os.path.isfile', 'os.path.isfile', (['fname'], {}), '(fname)\n', (4184, 4191), False, 'import os, csv, json, threading\n'), ((4371, 4394), 'os.path.basename', 'os.path.basename', (['fname'], {}), '(fname)\n', (4387, 4394), False, 'import os, csv, json, threading\n'), ((21349, 21356), 'tkinter.Tk', 'tk....
import torch import numpy as np from training.training import Trainer from common.replay_buffer import PrioritizedReplayBuffer # Use GPU, if available USE_CUDA = torch.cuda.is_available() def Variable(x): return x.cuda() if USE_CUDA else x class PriorDQN(Trainer): def __init__(self, parameters): super(...
[ "torch.LongTensor", "numpy.float32", "torch.FloatTensor", "torch.cuda.is_available", "torch.max", "common.replay_buffer.PrioritizedReplayBuffer" ]
[((164, 189), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (187, 189), False, 'import torch\n'), ((387, 448), 'common.replay_buffer.PrioritizedReplayBuffer', 'PrioritizedReplayBuffer', (['self.buffersize', "parameters['alpha']"], {}), "(self.buffersize, parameters['alpha'])\n", (410, 448), Fa...
# -*- coding: utf-8 -*- """ Linear solve / likelihood tests. """ import starry import numpy as np from scipy.linalg import cho_solve from scipy.stats import multivariate_normal import pytest import itertools @pytest.fixture(autouse=True) def data(): # Instantiate a dipole map map = starry.Map(ydeg=1, reflec...
[ "starry.Map", "numpy.zeros_like", "numpy.random.seed", "numpy.eye", "numpy.argmax", "pytest.fixture", "numpy.ones", "numpy.sin", "numpy.array", "numpy.linspace", "itertools.product", "numpy.cos", "pytest.mark.parametrize", "scipy.stats.multivariate_normal.logpdf" ]
[((212, 240), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (226, 240), False, 'import pytest\n'), ((1089, 1118), 'itertools.product', 'itertools.product', (['vals', 'vals'], {}), '(vals, vals)\n', (1106, 1118), False, 'import itertools\n'), ((1135, 1174), 'itertools.product', 'it...
import numpy as np import copy import logging from .varform import VarForm from .utils import validate_objective, contains_and_raised, state_to_ampl_counts, obj_from_statevector logger = logging.getLogger(__name__) class ObjectiveWrapper: """Objective Function Wrapper Wraps variational form object and an...
[ "copy.deepcopy", "numpy.mean", "logging.getLogger" ]
[((188, 215), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (205, 215), False, 'import logging\n'), ((3623, 3643), 'copy.deepcopy', 'copy.deepcopy', (['theta'], {}), '(theta)\n', (3636, 3643), False, 'import copy\n'), ((4486, 4499), 'numpy.mean', 'np.mean', (['vals'], {}), '(vals)\n', (4...
# pylint: disable=C0103 """ defines: - model = delete_bad_shells(model, max_theta=175., max_skew=70., max_aspect_ratio=100., max_taper_ratio=4.0) - eids_to_delete = get_bad_shells(model, xyz_cid0, nid_map, max_theta=175., max_skew=70., max_aspect_ratio=...
[ "numpy.radians", "numpy.degrees", "numpy.cross", "numpy.zeros", "numpy.clip", "numpy.searchsorted", "numpy.where", "numpy.array", "numpy.linalg.norm", "numpy.arccos" ]
[((3754, 3780), 'numpy.radians', 'np.radians', (['min_theta_quad'], {}), '(min_theta_quad)\n', (3764, 3780), True, 'import numpy as np\n'), ((3801, 3826), 'numpy.radians', 'np.radians', (['min_theta_tri'], {}), '(min_theta_tri)\n', (3811, 3826), True, 'import numpy as np\n'), ((3843, 3864), 'numpy.radians', 'np.radians...
#!/usr/bin/env python '''Generates mesh files and point clouds for randomly generated rectangular blocks.''' # python import time # scipy from scipy.io import savemat from numpy import array, mean # self import point_cloud from rl_agent import RlAgent from rl_environment import RlEnvironment def main(): '''Entrypoi...
[ "rl_environment.RlEnvironment", "rl_agent.RlAgent", "numpy.array", "point_cloud.Plot" ]
[((588, 604), 'numpy.array', 'array', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (593, 604), False, 'from numpy import array, mean\n'), ((878, 921), 'rl_environment.RlEnvironment', 'RlEnvironment', (['showViewer'], {'removeTable': '(True)'}), '(showViewer, removeTable=True)\n', (891, 921), False, 'from rl_environment import...
""" Driver Script - Medical Decisions Diabetes Treatment """ import pandas as pd from collections import Counter import numpy as np import matplotlib.pyplot as plt from copy import copy import math import time from MedicalDecisionDiabetesModel import MedicalDecisionDiabetesModel as MDDM from MedicalDecisionDia...
[ "pandas.DataFrame", "matplotlib.pyplot.show", "MedicalDecisionDiabetesPolicy.MDDMPolicy", "copy.copy", "numpy.random.RandomState", "time.time", "pandas.read_excel", "numpy.arange", "numpy.array", "pandas.DataFrame.from_records", "collections.Counter", "MedicalDecisionDiabetesModel.MedicalDecis...
[((1306, 1351), 'pandas.read_excel', 'pd.read_excel', (['file'], {'sheet_name': '"""parameters1"""'}), "(file, sheet_name='parameters1')\n", (1319, 1351), True, 'import pandas as pd\n'), ((1378, 1423), 'pandas.read_excel', 'pd.read_excel', (['file'], {'sheet_name': '"""parameters2"""'}), "(file, sheet_name='parameters2...
# Author: <NAME> <<EMAIL>> # License: MIT from collections import defaultdict import numpy as np from wittgenstein.base_functions import truncstr from wittgenstein.utils import rnd class BinTransformer: def __init__(self, n_discretize_bins=10, names_precision=2, verbosity=0): self.n_discretize_bins = n_...
[ "collections.defaultdict", "numpy.mean", "numpy.var" ]
[((10898, 10915), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (10909, 10915), False, 'from collections import defaultdict\n'), ((6560, 6576), 'numpy.var', 'np.var', (['df[feat]'], {}), '(df[feat])\n', (6566, 6576), True, 'import numpy as np\n'), ((6577, 6594), 'numpy.mean', 'np.mean', (['df[fe...
# Python 3 # Model stacking import time import copy import warnings import pickle import numpy as np import pandas as pd from joblib import dump, load from collections import defaultdict from sklearn.model_selection import ParameterGrid """ Package Description: -------------------------------------------------------...
[ "copy.deepcopy", "numpy.argmax", "joblib.dump", "warnings.warn", "time.time", "collections.defaultdict", "numpy.hstack", "numpy.max", "numpy.mean", "sklearn.model_selection.ParameterGrid", "numpy.vstack", "joblib.load", "numpy.delete", "numpy.concatenate" ]
[((20466, 20489), 'joblib.dump', 'dump', (['stacker', 'savePath'], {}), '(stacker, savePath)\n', (20470, 20489), False, 'from joblib import dump, load\n'), ((20559, 20573), 'joblib.load', 'load', (['loadPath'], {}), '(loadPath)\n', (20563, 20573), False, 'from joblib import dump, load\n'), ((10908, 10925), 'collections...
import folium import matplotlib import numpy as np from .config import config from .analysis import (is_outlier, check_coords, filtered_heartrates, elevation_summary, filter_median_average, appropriate_partition, compute_distances_for_valid_trackpoints) from .ui_text impor...
[ "numpy.zeros_like", "numpy.nanmedian", "slither.core.unit_conversions.convert_m_to_km", "numpy.searchsorted", "numpy.isfinite", "slither.core.unit_conversions.convert_mps_to_kmph", "numpy.nonzero", "numpy.min", "numpy.mean", "numpy.max", "slither.core.unit_conversions.minutes_from_start", "fol...
[((2818, 2856), 'numpy.searchsorted', 'np.searchsorted', (['distances', 'thresholds'], {}), '(distances, thresholds)\n', (2833, 2856), True, 'import numpy as np\n'), ((3295, 3318), 'numpy.isfinite', 'np.isfinite', (['velocities'], {}), '(velocities)\n', (3306, 3318), True, 'import numpy as np\n'), ((5972, 6010), 'slith...
import numpy as np def pair_metric(rates, natural_rates): metric = -np.sum(rates.rates*(natural_rates.rates+1e-8)) return metric
[ "numpy.sum" ]
[((73, 124), 'numpy.sum', 'np.sum', (['(rates.rates * (natural_rates.rates + 1e-08))'], {}), '(rates.rates * (natural_rates.rates + 1e-08))\n', (79, 124), True, 'import numpy as np\n')]
import matplotlib.pyplot as plt import networkx as nx from networkx.drawing.nx_pydot import graphviz_layout import bitarray as ba import numpy as np from src.tangles import Tangle, core_algorithm from src.utils import matching_items, Orientation MAX_CLUSTERS = 50 class TangleNode(object): def __init__(self, ...
[ "src.tangles.core_algorithm", "matplotlib.pyplot.savefig", "src.tangles.Tangle", "matplotlib.pyplot.show", "src.utils.matching_items", "numpy.ones", "networkx.draw_networkx", "networkx.drawing.nx_pydot.graphviz_layout", "numpy.all", "numpy.where", "networkx.Graph", "numpy.array", "src.utils....
[((14865, 14932), 'src.utils.matching_items', 'matching_items', (['characterizing_cuts_left', 'characterizing_cuts_right'], {}), '(characterizing_cuts_left, characterizing_cuts_right)\n', (14879, 14932), False, 'from src.utils import matching_items, Orientation\n'), ((18259, 18280), 'numpy.unique', 'np.unique', (['cuts...
# -*- coding: utf-8 -*- import numpy as np import scipy as sp from datetime import datetime from datetime import timezone import maria atmosphere_config = {'n_layers' : 32, # how many layers to simulate, based on the integrated atmospheric model 'min_depth' : 100, # the h...
[ "numpy.abs", "matplotlib.cm.get_cmap", "numpy.angle", "numpy.ones", "numpy.isnan", "numpy.imag", "numpy.mean", "numpy.sin", "numpy.exp", "numpy.interp", "numpy.round", "numpy.degrees", "numpy.fft.fftfreq", "maria.get_pair_lags", "numpy.linspace", "numpy.random.choice", "numpy.real", ...
[((1919, 1945), 'numpy.linspace', 'np.linspace', (['(0)', '(10000)', '(100)'], {}), '(0, 10000, 100)\n', (1930, 1945), True, 'import numpy as np\n'), ((2296, 2479), 'maria.model', 'maria.model', ([], {'atmosphere_config': 'atmosphere_config', 'pointing_config': 'pointing_config', 'beams_config': 'beams_config', 'array_...
################################################################################################################################ # This function implements the image search/retrieval . # inputs: Input location of uploaded image, extracted vectors # ######################################################################...
[ "os.mkdir", "tensorflow.python.platform.gfile.FastGFile", "scipy.spatial.distance.cosine", "tensorflow.compat.v1.Session", "pickle.load", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.reset_default_graph", "numpy.squeeze", "tensorflow.compat.v1.GraphDef", "os.path.join", "tensorflow....
[((1474, 1499), 'os.mkdir', 'os.mkdir', (['"""static/result"""'], {}), "('static/result')\n", (1482, 1499), False, 'import os\n'), ((3237, 3266), 'numpy.squeeze', 'np.squeeze', (['bottleneck_values'], {}), '(bottleneck_values)\n', (3247, 3266), True, 'import numpy as np\n'), ((3351, 3375), 'tensorflow.compat.v1.reset_d...
import json import numpy as np import os import argparse def f1(p, r): if r == 0.: return 0. return 2 * p * r / float(p + r) def merge_dict(dict1, dict2): res = {**dict1, **dict2} return res def macro(dataset, threshold, if_generate=False): p = 0. pred_example_count = 0 r = 0. ...
[ "argparse.ArgumentParser", "json.loads", "os.path.isdir", "json.dumps", "os.path.isfile", "numpy.arange", "os.path.join", "os.listdir" ]
[((1483, 1506), 'os.path.isdir', 'os.path.isdir', (['res_path'], {}), '(res_path)\n', (1496, 1506), False, 'import os\n'), ((2105, 2130), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2128, 2130), False, 'import argparse\n'), ((3442, 3521), 'numpy.arange', 'np.arange', (['args.threshold_start...
import random, os import argparse import numpy as np import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from tqdm import tqdm from torch.autograd import Variable from transformers import BertTokenizer, BertForSequenceEncoder, RobertaTokenizer, RobertaForSequenceEncoder from m...
[ "os.mkdir", "numpy.random.seed", "argparse.ArgumentParser", "transformers.RobertaTokenizer.from_pretrained", "transformers.BertForSequenceEncoder.from_pretrained", "torch.cuda.device_count", "torch.no_grad", "transformers.RobertaForSequenceEncoder.from_pretrained", "os.path.abspath", "os.path.exis...
[((502, 529), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (519, 529), False, 'import logging\n'), ((1884, 1976), 'transformers.AdamW', 'AdamW', (['optimizer_grouped_parameters'], {'lr': 'args.learning_rate', 'eps': '(1e-08)', 'correct_bias': '(True)'}), '(optimizer_grouped_parameters, ...
import gym import time import random import numpy as np env = gym.make('Navigation2D-v0') state = env.reset() goals = np.random.uniform(-0.5, 0.5, size=(2,)) task = {'goal': goals} env.reset_task(task) score = 0 # Without any policy while True: time.sleep(1) env.render() action = np.random.uniform(-0....
[ "numpy.random.uniform", "gym.make", "time.sleep" ]
[((63, 90), 'gym.make', 'gym.make', (['"""Navigation2D-v0"""'], {}), "('Navigation2D-v0')\n", (71, 90), False, 'import gym\n'), ((121, 160), 'numpy.random.uniform', 'np.random.uniform', (['(-0.5)', '(0.5)'], {'size': '(2,)'}), '(-0.5, 0.5, size=(2,))\n', (138, 160), True, 'import numpy as np\n'), ((255, 268), 'time.sle...
from ast import Bytes from collections import OrderedDict from io import BytesIO import struct from typing import Callable, Dict, List, Tuple import numpy as np from flwr.server.strategy import FedAvg from flwr.common import ( EvaluateRes, FitRes, Parameters, Scalar, Weights, ) from typing import ...
[ "numpy.asarray", "struct.unpack", "flwr.server.strategy.aggregate.weighted_loss_avg", "flwr.common.Parameters", "flwr.server.strategy.aggregate.aggregate" ]
[((3412, 3465), 'flwr.common.Parameters', 'Parameters', ([], {'tensors': 'tensors', 'tensor_type': '"""cpp_double"""'}), "(tensors=tensors, tensor_type='cpp_double')\n", (3422, 3465), False, 'from flwr.common import EvaluateRes, FitRes, Parameters, Scalar, Weights\n'), ((3936, 3960), 'numpy.asarray', 'np.asarray', (['l...
from typing import NoReturn import numpy as np import pandas as pd import plotly.graph_objects as go import plotly.express as px import plotly.io as pio from IMLearn.utils import split_train_test from IMLearn.learners.regressors.linear_regression import LinearRegression import os pio.templates.default = "simple_white...
[ "plotly.graph_objects.Scatter", "IMLearn.learners.regressors.linear_regression.LinearRegression", "numpy.random.seed", "pandas.read_csv", "numpy.std", "numpy.zeros", "IMLearn.utils.split_train_test", "numpy.mean", "numpy.arange" ]
[((654, 675), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (665, 675), True, 'import pandas as pd\n'), ((3185, 3210), 'numpy.zeros', 'np.zeros', (['(n_features, 1)'], {}), '((n_features, 1))\n', (3193, 3210), True, 'import numpy as np\n'), ((3861, 3878), 'numpy.random.seed', 'np.random.seed', (...
# Copyright (C) 2022, <NAME> AG # 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 discl...
[ "cv2.aruco.CharucoBoard_create", "cv2.aruco.DetectorParameters_create", "numpy.ceil", "numpy.floor", "cv2.cornerSubPix", "cv2.aruco.Dictionary_get", "cv2.aruco.detectMarkers", "numpy.array", "cv2.aruco.interpolateCornersCharuco", "numpy.matmul", "ast.literal_eval", "numpy.round", "cv2.norm",...
[((2774, 2817), 'ast.literal_eval', 'literal_eval', (["cam_dict['IntrinsicMatrix.0']"], {}), "(cam_dict['IntrinsicMatrix.0'])\n", (2786, 2817), False, 'from ast import literal_eval\n'), ((2836, 2879), 'ast.literal_eval', 'literal_eval', (["cam_dict['IntrinsicMatrix.1']"], {}), "(cam_dict['IntrinsicMatrix.1'])\n", (2848...
#!/usr/bin/env python # coding=utf-8 from __future__ import division, print_function, unicode_literals import math import signal import sys from collections import OrderedDict import h5py import numpy as np from six import string_types from brainstorm.describable import Describable from brainstorm import optional fr...
[ "h5py.File", "brainstorm.structure.network.Network.from_hdf5", "numpy.sum", "numpy.argmax", "warnings.filterwarnings", "brainstorm.utils.get_brainstorm_info", "warnings.resetwarnings", "math.ceil", "brainstorm.tools.evaluate", "numpy.argmin", "numpy.isfinite", "sys.stdout.flush", "numpy.arra...
[((5021, 5053), 'brainstorm.utils.get_by_path', 'get_by_path', (['logs', 'self.log_name'], {}), '(logs, self.log_name)\n', (5032, 5053), False, 'from brainstorm.utils import get_by_path, progress_bar, get_brainstorm_info\n'), ((7693, 7725), 'brainstorm.structure.network.Network.from_hdf5', 'Network.from_hdf5', (['self....
import torch import math import torch.nn as nn import torch.nn.functional as F import scipy.spatial as sp import numpy as np from torch_connectomics.model.utils import * from torch_connectomics.model.blocks import * class ClassificationNet(nn.Module): def __init__(self, in_channel=1, filters=(16, 16, 32, 32, 64...
[ "numpy.meshgrid", "numpy.arange", "torch.nn.Linear", "torch.nn.modules.Dropout", "torch.nn.AvgPool3d", "numpy.sqrt" ]
[((3307, 3341), 'numpy.arange', 'np.arange', (['size[0]'], {'dtype': 'np.int16'}), '(size[0], dtype=np.int16)\n', (3316, 3341), True, 'import numpy as np\n'), ((3350, 3384), 'numpy.arange', 'np.arange', (['size[1]'], {'dtype': 'np.int16'}), '(size[1], dtype=np.int16)\n', (3359, 3384), True, 'import numpy as np\n'), ((3...
import numpy as np import numba from scipy import ndimage as scnd from ..util import image_utils as iu from ..beam import gen_probe as gp from ..pty import pty_utils as pu def single_side_band(processed_data4D, aperture_mrad, voltage, image_size, ...
[ "numpy.conj", "numpy.zeros_like", "numpy.abs", "numpy.sum", "numpy.deg2rad", "numpy.zeros", "numpy.sqrt" ]
[((557, 619), 'numpy.deg2rad', 'np.deg2rad', (["dc.metadata.calibration['R_to_K_rotation_degrees']"], {}), "(dc.metadata.calibration['R_to_K_rotation_degrees'])\n", (567, 619), True, 'import numpy as np\n'), ((798, 874), 'numpy.sqrt', 'np.sqrt', (['((Kx + Qx[:, :, None, None]) ** 2 + (Ky + Qy[:, :, None, None]) ** 2)']...
import os import torch import numpy as np import matplotlib.pyplot as plt from Agent import Agent from Env import Env from arm import Viewer os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" env_tst = Env() agent_tst = Agent() agent_tst.actor.load_state_dict(torch.load("./model_test1/modela1750_.pth")) d...
[ "numpy.asarray", "torch.load", "Env.Env", "arm.Viewer", "torch.FloatTensor", "Agent.Agent", "torch.no_grad" ]
[((213, 218), 'Env.Env', 'Env', ([], {}), '()\n', (216, 218), False, 'from Env import Env\n'), ((232, 239), 'Agent.Agent', 'Agent', ([], {}), '()\n', (237, 239), False, 'from Agent import Agent\n'), ((273, 316), 'torch.load', 'torch.load', (['"""./model_test1/modela1750_.pth"""'], {}), "('./model_test1/modela1750_.pth'...
#!/usr/bin/env python3 # vim: set filetype=python sts=2 ts=2 sw=2 expandtab: """ Command line interface module """ # pylint: disable=unused-variable # pylint: disable=fixme # pylint: disable=too-many-locals # pylint: disable=too-many-instance-attributes # pylint: disable=pointless-string-statement import logging import...
[ "os.path.abspath", "json.load", "os.makedirs", "logging.basicConfig", "os.path.basename", "os.path.dirname", "numpy.zeros", "os.path.join", "os.listdir", "logging.getLogger" ]
[((492, 519), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (509, 519), False, 'import logging\n'), ((538, 563), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (553, 563), False, 'import os\n'), ((582, 613), 'os.path.abspath', 'os.path.abspath', (['script_dirna...
# -*- coding: utf-8 -*- from math import sqrt from functools import reduce import pytest import numpy as np from renormalizer.model.phonon import Phonon from renormalizer.utils import Quantity def test_property(): ph = Phonon.simple_phonon( omega=Quantity(1), displacement=Quantity(1), n_phys_dim=10 ...
[ "math.sqrt", "numpy.allclose", "numpy.exp", "pytest.approx", "renormalizer.utils.Quantity" ]
[((598, 632), 'numpy.allclose', 'np.allclose', (['res', '(evecs[:, 0] ** 2)'], {}), '(res, evecs[:, 0] ** 2)\n', (609, 632), True, 'import numpy as np\n'), ((370, 388), 'pytest.approx', 'pytest.approx', (['(0.5)'], {}), '(0.5)\n', (383, 388), False, 'import pytest\n'), ((512, 522), 'numpy.exp', 'np.exp', (['(-s)'], {})...
from dataclasses import dataclass from pathlib import Path import numpy as np import matplotlib.pyplot as plt from cw.simulation import Simulation, StatesBase, AB3Integrator, ModuleBase, Logging, Plotter from cw.simulation.modules import EOM6DOF from cw.context import time_it nan = float('nan') def main(): si...
[ "cw.simulation.Logging", "cw.simulation.AB3Integrator", "numpy.zeros", "pathlib.Path", "numpy.array", "cw.context.time_it", "cw.simulation.Plotter", "numpy.vstack" ]
[((746, 755), 'cw.simulation.Plotter', 'Plotter', ([], {}), '()\n', (753, 755), False, 'from cw.simulation import Simulation, StatesBase, AB3Integrator, ModuleBase, Logging, Plotter\n'), ((930, 941), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (938, 941), True, 'import numpy as np\n'), ((962, 973), 'numpy.zeros'...
#!/usr/bin/env python # coding: utf-8 # In[1]: #things to do #1 comment and review #imports import numpy as np import matplotlib.pyplot as plt import lightkurve as lk import tqdm as tq from scipy.interpolate import interp1d # In[ ]: # In[2]: #downloading the lightcurve file for our example star KIC 106851...
[ "lightkurve.search_lightcurvefile", "numpy.abs", "numpy.ceil", "numpy.sum", "numpy.floor", "numpy.zeros", "numpy.sin", "numpy.array", "numpy.linspace", "lightkurve.LightCurve", "numpy.random.rand" ]
[((741, 777), 'numpy.sin', 'np.sin', (['(2 * np.pi * frequency * time)'], {}), '(2 * np.pi * frequency * time)\n', (747, 777), True, 'import numpy as np\n'), ((781, 806), 'lightkurve.LightCurve', 'lk.LightCurve', (['time', 'flux'], {}), '(time, flux)\n', (794, 806), True, 'import lightkurve as lk\n'), ((1384, 1414), 'n...
from datetime import timedelta from datetime import datetime import pandas as pd import numpy as np from optimization.performance import * now = datetime.now().date() # -------------------------------------------------------------------------- # # Helper Functions ...
[ "datetime.datetime.today", "numpy.polyfit", "numpy.zeros", "pandas.DatetimeIndex", "numpy.append", "numpy.mean", "numpy.array", "pandas.Grouper", "datetime.timedelta", "numpy.log10", "numpy.digitize", "datetime.datetime.now" ]
[((2374, 2396), 'numpy.array', 'np.array', (['fico_medians'], {}), '(fico_medians)\n', (2382, 2396), True, 'import numpy as np\n'), ((2427, 2446), 'numpy.array', 'np.array', (['[3, 4, 5]'], {}), '([3, 4, 5])\n', (2435, 2446), True, 'import numpy as np\n'), ((2522, 2561), 'numpy.array', 'np.array', (['[90, 120, 150, 180...
""" <NAME> University of Manitoba August 06th, 2020 """ import os import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import roc_auc_score from tensorflow.keras.backend import clear_session from tensorflow.keras.utils import to_categorical from umbms import get_proj_path, get_scri...
[ "numpy.shape", "matplotlib.pyplot.figure", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.tight_layout", "os.path.join", "umbms.ai.metrics.report_metrics", "umbms.ai.metrics.get_spec", "numpy.zeros_like", "umbms.ai.augment.full_aug", "matplotlib.pyplot.close", "umbms.verify_path", "matplo...
[((883, 898), 'umbms.get_proj_path', 'get_proj_path', ([], {}), '()\n', (896, 898), False, 'from umbms import get_proj_path, get_script_logger, verify_path\n'), ((1717, 1740), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(1000)'], {}), '(0, 1, 1000)\n', (1728, 1740), True, 'import numpy as np\n'), ((1798, 1823), '...
#################################################################### # Interfaces with the GENESIS version of the auditory cortex model of Beeman, # BMC Neuroscience (Suppl. 1), 2013 (i.e. a slightly modified version # as used in Metzner et al., Front Comp Neu, 2016) # # @author: <NAME>, 02/11/2017 ####################...
[ "numpy.sum", "numpy.zeros", "subprocess.call", "matplotlib.mlab.psd", "os.path.join", "os.chdir", "sys.exit" ]
[((2515, 2540), 'os.chdir', 'os.chdir', (['"""../notebooks/"""'], {}), "('../notebooks/')\n", (2523, 2540), False, 'import os\n'), ((2806, 2824), 'numpy.sum', 'np.sum', (['pxx[lb:ub]'], {}), '(pxx[lb:ub])\n', (2812, 2824), True, 'import numpy as np\n'), ((3103, 3142), 'subprocess.call', 'subprocess.call', (['execstring...
""" General helper functions """ import logging import math import os from collections import Counter from queue import Full, Queue from typing import TYPE_CHECKING, Any, Callable, Dict, Hashable, List, Tuple import cv2 import numpy as np import slugify as unicode_slug import tornado.queues as tq import voluptuous as ...
[ "numpy.divide", "cv2.putText", "cv2.polylines", "slugify.slugify", "os.makedirs", "os.path.isdir", "numpy.multiply", "collections.Counter", "math.floor", "cv2.getTextSize", "cv2.moments", "cv2.fillPoly", "cv2.addWeighted", "voluptuous.Invalid", "cv2.rectangle", "cv2.drawContours", "l...
[((641, 668), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (658, 668), False, 'import logging\n'), ((2828, 2888), 'cv2.rectangle', 'cv2.rectangle', (['frame', 'topleft', 'bottomright', 'color', 'thickness'], {}), '(frame, topleft, bottomright, color, thickness)\n', (2841, 2888), False, ...
# ~~~ # This file is part of the paper: # # "An adaptive projected Newton non-conforming dual approach # for trust-region reduced basis approximation of PDE-constrained # parameter optimization" # # https://github.com/TiKeil/Proj-Newton-NCD-corrected-TR-RB-for-pde-opt # # C...
[ "numpy.meshgrid", "csv.reader", "csv.writer", "numpy.abs", "numpy.zeros", "scipy.sparse.linalg.eigsh", "matplotlib.pyplot.figure", "matplotlib.pyplot.contour", "numpy.linalg.norm", "numpy.linspace", "numpy.dot", "pdeopt.TR.projection_onto_range" ]
[((796, 858), 'numpy.linspace', 'np.linspace', (['ranges[0][0]', 'ranges[0][1]', 'first_component_steps'], {}), '(ranges[0][0], ranges[0][1], first_component_steps)\n', (807, 858), True, 'import numpy as np\n'), ((883, 946), 'numpy.linspace', 'np.linspace', (['ranges[1][0]', 'ranges[1][1]', 'second_component_steps'], {...
# -*- coding: utf-8 -*- """ Created on Tue Oct 1 12:34:54 2019 @author: Warmachine """ from __future__ import print_function, division import os,sys pwd = os.getcwd() sys.path.insert(0,pwd) #%% print('-'*30) print(os.getcwd()) print('-'*30) #%% import scipy.io as sio import os import torch from to...
[ "numpy.mean", "core.helper.aggregated_keysteps", "torch.no_grad", "numpy.unique", "core.helper.evaluation_align", "torch.utils.data.DataLoader", "core.helper.Logger", "core.attention_based_summarization.AttentionSummarization", "matplotlib.pyplot.ion", "core.FeatureVGGDataset_CrossTask.FeatureVGGD...
[((167, 178), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (176, 178), False, 'import os\n'), ((180, 203), 'sys.path.insert', 'sys.path.insert', (['(0)', 'pwd'], {}), '(0, pwd)\n', (195, 203), False, 'import os, sys\n'), ((1383, 1392), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (1390, 1392), True, 'import mat...
import numpy as np import matplotlib.pyplot as plt class MLP: def __init__(self, classes_count, inputs, architecture, learning_rate, min_error, max_ephocs): self.classes_count = classes_count self.inputs = inputs self.inputs.insert(0,np.random.rand()) self.architecture = architectur...
[ "numpy.random.rand" ]
[((263, 279), 'numpy.random.rand', 'np.random.rand', ([], {}), '()\n', (277, 279), True, 'import numpy as np\n'), ((1530, 1561), 'numpy.random.rand', 'np.random.rand', (['self.max_ephocs'], {}), '(self.max_ephocs)\n', (1544, 1561), True, 'import numpy as np\n'), ((870, 886), 'numpy.random.rand', 'np.random.rand', ([], ...
# File: diffusion.py # Author: <NAME> # Creation Date: 5/Nov/2018 # Description: Modeling of diffusion in 2D and 3D import numpy as np from random import randint import matplotlib.pyplot as plt class Substance: def __init__(self, i_size): """ :param i_size: size of diffusion volume ...
[ "numpy.zeros", "random.randint", "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot.show" ]
[((617, 647), 'numpy.zeros', 'np.zeros', (['(self.dim, self.dim)'], {}), '((self.dim, self.dim))\n', (625, 647), True, 'import numpy as np\n'), ((996, 1036), 'numpy.zeros', 'np.zeros', (['(self.dim, self.dim, self.dim)'], {}), '((self.dim, self.dim, self.dim))\n', (1004, 1036), True, 'import numpy as np\n'), ((6417, 64...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jul 10 20:14:09 2020 @author: <EMAIL> """ import time from pathlib import Path import numpy as np import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.optim as optim import torchvision import torchvision.transforms as transf...
[ "pandas.DataFrame", "models.tiramisu.FCDenseNet67", "os.getpid", "argparse.ArgumentParser", "torch.utils.data.DataLoader", "utils.training_crack.test1", "torch.nn.NLLLoss", "pathlib.Path", "torchvision.transforms.Compose", "numpy.array", "torchvision.transforms.Normalize", "os.path.join", "t...
[((605, 616), 'os.getpid', 'os.getpid', ([], {}), '()\n', (614, 616), False, 'import os\n'), ((1082, 1107), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1105, 1107), False, 'import argparse\n'), ((2785, 2806), 'pathlib.Path', 'Path', (['opt.path_folder'], {}), '(opt.path_folder)\n', (2789, 2...
from typing import Callable, Union import matplotlib.pyplot as plt import numpy as np from sympy import Rational def P(adapts: int, num_uniques: int) -> Union[Callable[int, int], float]: # type: ignore """Calculates the probability of getting a number of unique adapts, given a number of total adapts. Args:...
[ "sympy.Rational", "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.subplots", "matplotlib.pyplot.rc", "numpy.linspace", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.savefig" ]
[((2397, 2409), 'numpy.zeros', 'np.zeros', (['(16)'], {}), '(16)\n', (2405, 2409), True, 'import numpy as np\n'), ((2419, 2431), 'numpy.zeros', 'np.zeros', (['(16)'], {}), '(16)\n', (2427, 2431), True, 'import numpy as np\n'), ((2441, 2453), 'numpy.zeros', 'np.zeros', (['(16)'], {}), '(16)\n', (2449, 2453), True, 'impo...
# coding: utf-8 from __future__ import division, unicode_literals """ Created on March 25, 2013 @author: geoffroy """ import numpy as np from math import ceil from math import cos from math import sin from math import tan from math import pi from warnings import warn from pymatgen.symmetry.analyzer import Spacegro...
[ "matplotlib.pyplot.show", "math.ceil", "math.tan", "math.sin", "itertools.combinations", "matplotlib.pyplot.figure", "numpy.array", "pymatgen.symmetry.analyzer.SpacegroupAnalyzer", "math.cos", "warnings.warn", "mpl_toolkits.mplot3d.axes3d.Axes3D" ]
[((1074, 1153), 'pymatgen.symmetry.analyzer.SpacegroupAnalyzer', 'SpacegroupAnalyzer', (['structure'], {'symprec': 'symprec', 'angle_tolerance': 'angle_tolerance'}), '(structure, symprec=symprec, angle_tolerance=angle_tolerance)\n', (1092, 1153), False, 'from pymatgen.symmetry.analyzer import SpacegroupAnalyzer\n'), ((...