code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy.testing as npt from cvdm.score import hkdr_chd, HkdrCHD from cvdm.score import hkdr_hf, HkdrHF def test_hkdr_chd(): tmp = hkdr_chd(59, True, False, 5, 105, 2.3, 3.87) npt.assert_almost_equal(tmp, 0.082, decimal=3) def test_hkdr_chd_json(): chd = HkdrCHD() tmp = chd.score({"index_age": ...
[ "cvdm.score.hkdr_hf", "cvdm.score.hkdr_chd", "cvdm.score.HkdrHF", "numpy.testing.assert_almost_equal", "cvdm.score.HkdrCHD" ]
[((142, 186), 'cvdm.score.hkdr_chd', 'hkdr_chd', (['(59)', '(True)', '(False)', '(5)', '(105)', '(2.3)', '(3.87)'], {}), '(59, True, False, 5, 105, 2.3, 3.87)\n', (150, 186), False, 'from cvdm.score import hkdr_chd, HkdrCHD\n'), ((191, 237), 'numpy.testing.assert_almost_equal', 'npt.assert_almost_equal', (['tmp', '(0.0...
import numpy as np import pandas as pd from sklearn.decomposition import PCA from numpy.linalg import norm import matplotlib.pyplot as plt from sklearn import preprocessing import seaborn as sns; sns.set_theme() seed = 0 np.random.seed(seed) """We test without normalization""" def normalize(data, shift = 'z-score'):...
[ "seaborn.set", "sklearn.preprocessing.LabelEncoder", "matplotlib.pyplot.savefig", "numpy.median", "pandas.read_csv", "matplotlib.pyplot.xticks", "seaborn.set_theme", "sklearn.decomposition.PCA", "matplotlib.pyplot.style.use", "numpy.argsort", "matplotlib.pyplot.yticks", "numpy.random.seed", ...
[((196, 211), 'seaborn.set_theme', 'sns.set_theme', ([], {}), '()\n', (209, 211), True, 'import seaborn as sns\n'), ((221, 241), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (235, 241), True, 'import numpy as np\n'), ((1770, 1793), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'],...
from meta_policy_search.utils import logger import numpy as np import tensorflow as tf from collections import OrderedDict from meta_policy_search.optimizers.base import Optimizer class FiniteDifferenceHvp(Optimizer): def __init__(self, base_eps=1e-5, symmetric=True, grad_clip=None): self.base_eps = np.ca...
[ "meta_policy_search.utils.logger.log", "numpy.prod", "collections.OrderedDict", "numpy.reshape", "tensorflow.get_default_session", "numpy.linalg.norm", "tensorflow.gradients", "numpy.isnan", "tensorflow.reshape", "tensorflow.zeros_like", "numpy.zeros_like", "numpy.arange" ]
[((12987, 13013), 'collections.OrderedDict', 'OrderedDict', (['unflat_params'], {}), '(unflat_params)\n', (12998, 13013), False, 'from collections import OrderedDict\n'), ((13280, 13314), 'numpy.zeros_like', 'np.zeros_like', (['b'], {'dtype': 'np.float32'}), '(b, dtype=np.float32)\n', (13293, 13314), True, 'import nump...
""" Plotting convenience functions. """ from math import ceil import ipywidgets as widgets import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np from model_base import get_ext_input # define basics prop_cycle = plt.rcParams["axes.prop_cycle"] colors = prop_cycle.by_key()["color"]...
[ "model_base.get_ext_input", "ipywidgets.IntSlider", "math.ceil", "matplotlib.pyplot.style.use", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.gridspec.GridSpec", "ipywidgets.Layout", "ipywidgets.FloatSlider", "matplotlib.pyplot.suptitle" ]
[((321, 351), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-muted"""'], {}), "('seaborn-muted')\n", (334, 351), True, 'import matplotlib.pyplot as plt\n'), ((745, 823), 'ipywidgets.FloatSlider', 'widgets.FloatSlider', ([], {'min': '(-5)', 'max': '(20)', 'step': '(0.5)', 'value': '(10.0)', 'description':...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author : <NAME> # E-mail : <EMAIL> # Description: # Date : 21/10/2020 14:20 # File Name : generate-dataset-Dexterous_vacuum.py import numpy as np import sys import pickle import datetime from vstsim.grasping.quality import PointGraspMetrics3D from vstsim....
[ "os.path.exists", "pickle.dump", "vstsim.grasping.DexterousVacuumGrasp", "meshpy.obj_file.ObjFile", "multiprocessing.Process", "os.walk", "logging.warning", "multiprocessing.cpu_count", "vstsim.grasping.RobotGripper.load_dex_vacuum", "vstsim.grasping.VacuumGraspSampler", "datetime.datetime.now",...
[((1255, 1273), 'os.walk', 'os.walk', (['file_dir_'], {}), '(file_dir_)\n', (1262, 1273), False, 'import os\n'), ((1918, 1968), 'autolab_core.YamlConfig', 'YamlConfig', (["(work_dir + '/vst_sim/test/config.yaml')"], {}), "(work_dir + '/vst_sim/test/config.yaml')\n", (1928, 1968), False, 'from autolab_core import YamlCo...
# %% [markdown] # # import matplotlib as mpl from matplotlib.cm import ScalarMappable import networkx as nx import numpy as np from src.hierarchy import signal_flow from graspy.models import SBMEstimator node_signal_flow = signal_flow(adj) mean_sf = np.zeros(k) for i in np.unique(pred_labels): inds = np.where(pred...
[ "numpy.mean", "numpy.unique", "numpy.where", "networkx.get_edge_attributes", "networkx.draw_networkx", "numpy.zeros", "matplotlib.cm.ScalarMappable", "graspy.models.SBMEstimator", "matplotlib.colors.LogNorm", "src.hierarchy.signal_flow", "networkx.from_pandas_adjacency" ]
[((224, 240), 'src.hierarchy.signal_flow', 'signal_flow', (['adj'], {}), '(adj)\n', (235, 240), False, 'from src.hierarchy import signal_flow\n'), ((251, 262), 'numpy.zeros', 'np.zeros', (['k'], {}), '(k)\n', (259, 262), True, 'import numpy as np\n'), ((272, 294), 'numpy.unique', 'np.unique', (['pred_labels'], {}), '(p...
from __future__ import division import numpy as np from scipy.interpolate import Akima1DInterpolator def cubic_spline_3pts(x, y, T): """ Apperently scipy.interpolate.interp1d does not support cubic spline for less than 4 points. """ x0, x1, x2 = x y0, y1, y2 = y x1x0, x2x1 = ...
[ "numpy.append", "numpy.matrix", "scipy.interpolate.Akima1DInterpolator", "numpy.linalg.inv" ]
[((620, 682), 'numpy.matrix', 'np.matrix', (['[[m11, m12, m13], [m21, m22, m23], [m31, m32, m33]]'], {}), '([[m11, m12, m13], [m21, m22, m23], [m31, m32, m33]])\n', (629, 682), True, 'import numpy as np\n'), ((1142, 1159), 'numpy.append', 'np.append', (['q1', 'q2'], {}), '(q1, q2)\n', (1151, 1159), True, 'import numpy ...
import os import sys import json from pathlib import Path import warnings import pandas as pd import numpy as np from skimage.io import imsave from skimage import img_as_ubyte import torch from xarray.core.dataset import Dataset from xarray.core.dataarray import DataArray import xarray from typing import Tuple, List im...
[ "GIS_utils.bbox_from_point", "model.Model", "pandas.read_csv", "torch.from_numpy", "torch.cuda.is_available", "xcube_sh.cube.open_cube", "matplotlib.pyplot.imshow", "pathlib.Path", "numpy.stack", "matplotlib.pyplot.yticks", "warnings.simplefilter", "pandas.DataFrame", "skimage.img_as_ubyte",...
[((3085, 3104), 'torch.from_numpy', 'torch.from_numpy', (['x'], {}), '(x)\n', (3101, 3104), False, 'import torch\n'), ((3503, 3588), 'model.Model', 'Model', ([], {'input_dim': '(2)', 'hidden_dim': '(16)', 'kernel_size': '(3)', 'device': 'device', 'version': '"""0.1.1"""'}), "(input_dim=2, hidden_dim=16, kernel_size=3, ...
import os import sys import random import itertools import colorsys import numpy as np from skimage.measure import find_contours import matplotlib.pyplot as plt from matplotlib import patches, lines from matplotlib.patches import Polygon # import IPython.display def random_colors(N, bright=True): ''' Generat...
[ "matplotlib.patches.Rectangle", "random.randint", "random.shuffle", "numpy.any", "colorsys.hsv_to_rgb", "matplotlib.lines.Line2D", "matplotlib.pyplot.subplots" ]
[((594, 616), 'random.shuffle', 'random.shuffle', (['colors'], {}), '(colors)\n', (608, 616), False, 'import random\n'), ((1301, 1333), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)'], {'figsize': 'figsize'}), '(1, figsize=figsize)\n', (1313, 1333), True, 'import matplotlib.pyplot as plt\n'), ((1945, 2073), 'mat...
import numpy as np import matplotlib.pyplot as plt # numpy.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None) # # 在指定的间隔内返回均匀间隔的数字。 # # 返回num均匀分布的样本,在[start, stop]。 # # 这个区间的端点可以任意的被排除在外。 X = np.linspace(-np.pi, np.pi, 256, endpoint=True) print(X) C, S = np.cos(X), np.sin(X) plt.plot(X, C) plt.p...
[ "matplotlib.pyplot.plot", "numpy.linspace", "numpy.cos", "numpy.sin", "matplotlib.pyplot.show" ]
[((215, 261), 'numpy.linspace', 'np.linspace', (['(-np.pi)', 'np.pi', '(256)'], {'endpoint': '(True)'}), '(-np.pi, np.pi, 256, endpoint=True)\n', (226, 261), True, 'import numpy as np\n'), ((300, 314), 'matplotlib.pyplot.plot', 'plt.plot', (['X', 'C'], {}), '(X, C)\n', (308, 314), True, 'import matplotlib.pyplot as plt...
from utils.eom import * from sympy import symbols, factor from sympy import simplify from sympy.physics.mechanics import * from sympy import sin, cos, symbols, Matrix, solve from sympy.physics.vector import init_vprinting import pylab as pl import control import numpy as np from scipy.integrate import odeint from matp...
[ "sympy.sin", "sympy.cos", "control.ss2tf", "control.lqr", "sympy.simplify", "sympy.Matrix", "pickle.load", "sympy.symbols", "numpy.array", "numpy.linspace", "numpy.vstack", "pylab.linspace", "time.time" ]
[((600, 611), 'time.time', 'time.time', ([], {}), '()\n', (609, 611), False, 'import time\n'), ((757, 777), 'sympy.symbols', 'symbols', (['"""r,h_c,h_t"""'], {}), "('r,h_c,h_t')\n", (764, 777), False, 'from sympy import sin, cos, symbols, Matrix, solve\n'), ((792, 814), 'sympy.symbols', 'symbols', (['"""I_w,I_c,I_t"""'...
from numpy import interp from os import listdir from PIL import Image, ImageStat # Directory for block textures extracted from version jar textures = 'assets/minecraft/textures/block' # Special case: animated blocks like crimson_stem are # taller than 64px: crop when compositing later? # List of blocks to allow load...
[ "PIL.ImageStat.Stat", "os.listdir", "PIL.Image.open", "numpy.interp" ]
[((1346, 1386), 'PIL.Image.open', 'Image.open', (['f"""{textures}/{block_id}.png"""'], {}), "(f'{textures}/{block_id}.png')\n", (1356, 1386), False, 'from PIL import Image, ImageStat\n'), ((746, 763), 'os.listdir', 'listdir', (['textures'], {}), '(textures)\n', (753, 763), False, 'from os import listdir\n'), ((1674, 17...
import argparse import numpy as np from tqdm import tqdm from os.path import join, isfile from data import Labels from joblib import Parallel, delayed labels = Labels() def job(text_path, numpy_path): with open(text_path, 'r', encoding='utf8') as file: text = file.read() if not labels.is_accepted(t...
[ "argparse.ArgumentParser", "data.Labels", "joblib.Parallel", "os.path.isfile", "joblib.delayed", "numpy.load" ]
[((161, 169), 'data.Labels', 'Labels', ([], {}), '()\n', (167, 169), False, 'from data import Labels\n'), ((574, 631), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Collect utterances"""'}), "(description='Collect utterances')\n", (597, 631), False, 'import argparse\n'), ((1388, 1452), ...
# -*- coding: utf-8 -*- """ Created on Thu Apr 14 11:11:55 2022 @author: Hatlab-RRK Purpose: create a neat, almost-executable file that can quickly plot a 3-state pulse file, and have the option to do just histograms, or additionally try to fit using majority vote and give classification accuracy """ from data_proce...
[ "data_processing.AWG_and_Alazar.Pulse_Processing_utils.plot_custom_stats_from_filepath", "data_processing.AWG_and_Alazar.Pulse_Processing_utils.plot_stats_from_filepath", "matplotlib.pyplot.plot", "matplotlib.pyplot.style.use", "numpy.array", "data_processing.AWG_and_Alazar.Pulse_Processing_utils.extract_...
[((547, 570), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""hatlab"""'], {}), "('hatlab')\n", (560, 570), True, 'import matplotlib.pyplot as plt\n'), ((9008, 9395), 'data_processing.AWG_and_Alazar.Pulse_Processing_utils.extract_3pulse_histogram_from_filepath', 'extract_3pulse_histogram_from_filepath', (['datapa...
## test_attack.py -- sample code to test attack procedure ## ## Copyright (C) 2016, <NAME> <<EMAIL>>. ## ## This program is licenced under the BSD 2-Clause licence, ## contained in the LICENCE file in this directory. import tensorflow as tf import numpy as np import time import random import argparse from cv2 import i...
[ "cv2.imwrite", "numpy.eye", "argparse.ArgumentParser", "setup_mnets.NodeLookup", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.train.start_queue_runners", "numpy.argmax", "numpy.squeeze", "numpy.array", "numpy.sum", "tensorflow.convert_to_tensor", "time.time", "setup_mnets.Im...
[((2230, 2253), 'numpy.array', 'np.array', (['inputs_scaled'], {}), '(inputs_scaled)\n', (2238, 2253), True, 'import numpy as np\n'), ((2375, 2392), 'numpy.array', 'np.array', (['targets'], {}), '(targets)\n', (2383, 2392), True, 'import numpy as np\n'), ((2469, 2523), 'argparse.ArgumentParser', 'argparse.ArgumentParse...
import numpy as np import pylab as plt import pandas as pd data = pd.read_csv('data/data.csv') for feature in ['nikkei', 'nasdaq', 'currency']: dataset = data[feature] print("[{}] Mean: {}".format(feature, np.mean(dataset))) print("[{}] Standard deviation: {}".format(feature, np.std(dataset))) plt.xlab...
[ "numpy.mean", "pylab.hist", "pandas.read_csv", "pylab.xlabel", "numpy.std", "pylab.show" ]
[((67, 95), 'pandas.read_csv', 'pd.read_csv', (['"""data/data.csv"""'], {}), "('data/data.csv')\n", (78, 95), True, 'import pandas as pd\n'), ((312, 344), 'pylab.xlabel', 'plt.xlabel', (['feature'], {'fontsize': '(18)'}), '(feature, fontsize=18)\n', (322, 344), True, 'import pylab as plt\n'), ((349, 388), 'pylab.hist',...
from __future__ import print_function, division import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm n = 10 s = 1.0 x = np.linspace(0, n - 1, n + (n - 1) * 20) def rho(r, k): if k == 0: y = np.exp(-(r/s)**2) else: e = np.exp(1) y = (e/k**2)**(k**2) * (r/s)**...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.ylabel", "numpy.arange", "matplotlib.pyplot.xlabel", "numpy.exp", "numpy.linspace", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlim", "matplotlib.pyplot.legend" ]
[((148, 187), 'numpy.linspace', 'np.linspace', (['(0)', '(n - 1)', '(n + (n - 1) * 20)'], {}), '(0, n - 1, n + (n - 1) * 20)\n', (159, 187), True, 'import numpy as np\n'), ((364, 390), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 3)'}), '(figsize=(6, 3))\n', (374, 390), True, 'import matplotlib.pyplo...
""" Functionality for reading Capella SAR data into a SICD model. """ __classification__ = "UNCLASSIFIED" __author__ = ("<NAME>", "<NAME>") import logging import json from typing import Dict, Any, Tuple from datetime import datetime from collections import OrderedDict from scipy.constants import speed_of_light impo...
[ "logging.getLogger", "sarpy.io.complex.sicd_elements.CollectionInfo.RadarModeType", "sarpy.io.complex.sicd_elements.ImageFormation.RcvChanProcType", "sarpy.io.complex.sicd_elements.RadarCollection.WaveformParametersType", "numpy.linalg.norm", "sarpy.io.complex.sicd_elements.ImageData.ImageDataType", "sa...
[((1591, 1618), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1608, 1618), False, 'import logging\n'), ((2053, 2076), 'sarpy.io.general.utils.is_file_like', 'is_file_like', (['file_name'], {}), '(file_name)\n', (2065, 2076), False, 'from sarpy.io.general.utils import parse_timestring, g...
""" Common routines for models in Chainer. """ __all__ = ['round_channels', 'BreakBlock', 'ReLU6', 'HSwish', 'get_activation_layer', 'GlobalAvgPool2D', 'SelectableDense', 'DenseBlock', 'ConvBlock1d', 'conv1x1', 'conv3x3', 'depthwise_conv3x3', 'ConvBlock', 'conv1x1_block', 'conv3x3_block', 'co...
[ "chainer.functions.max", "chainer.functions.concat", "chainer.functions.argmax", "chainer.links.Convolution2D", "chainer.functions.clip", "chainer.functions.batch_matmul", "chainer.functions.average_pooling_2d", "chainer.links.Linear", "chainer.functions.resize_images", "chainer.initializers._get_...
[((3294, 3316), 'inspect.isfunction', 'isfunction', (['activation'], {}), '(activation)\n', (3304, 3316), False, 'from inspect import isfunction\n'), ((10640, 10771), 'chainer.links.Convolution2D', 'L.Convolution2D', ([], {'in_channels': 'in_channels', 'out_channels': 'out_channels', 'ksize': '(1)', 'stride': 'stride',...
# Lint as: python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
[ "numpy.where" ]
[((1284, 1315), 'numpy.where', 'np.where', (['(preds == -1)', '(0)', 'preds'], {}), '(preds == -1, 0, preds)\n', (1292, 1315), True, 'import numpy as np\n')]
import numpy from .eval_splines import eval_cubic ## the functions in this file provide backward compatibility calls ## ## they can optionnally allocate memory for the result ## they work for any dimension, except the functions which compute the gradient ####################### # Compatibility calls # ##############...
[ "numpy.array", "numpy.empty" ]
[((4810, 4837), 'numpy.array', 'numpy.array', (['a'], {'dtype': 'float'}), '(a, dtype=float)\n', (4821, 4837), False, 'import numpy\n'), ((4846, 4873), 'numpy.array', 'numpy.array', (['b'], {'dtype': 'float'}), '(b, dtype=float)\n', (4857, 4873), False, 'import numpy\n'), ((4887, 4917), 'numpy.array', 'numpy.array', ([...
import numpy as np # 2 x 3 arr = np.linspace(1.1, 6.6, 6).reshape(2, 3) print(arr) arr = arr.astype('int') print(arr)
[ "numpy.linspace" ]
[((35, 59), 'numpy.linspace', 'np.linspace', (['(1.1)', '(6.6)', '(6)'], {}), '(1.1, 6.6, 6)\n', (46, 59), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- """ Created on Fri Jul 15 10:07:53 2016 @author: <NAME> """ import numpy as np n_1 = 0.2 n_2 = 0.2 n_3 = 0.2 n_4 = 0.2 Ms_list = np.array([ 68.74, 75.71, 82.33, 84.77, 88.27]) Mf_list = np.array([ 57.74, 65.39, 71.29, 74.07, 77.88]) As_list = np.array([ 78.47, 83.82, 88.81, 91.38, 94.78]) Af...
[ "numpy.array" ]
[((157, 202), 'numpy.array', 'np.array', (['[68.74, 75.71, 82.33, 84.77, 88.27]'], {}), '([68.74, 75.71, 82.33, 84.77, 88.27])\n', (165, 202), True, 'import numpy as np\n'), ((214, 259), 'numpy.array', 'np.array', (['[57.74, 65.39, 71.29, 74.07, 77.88]'], {}), '([57.74, 65.39, 71.29, 74.07, 77.88])\n', (222, 259), True...
from typing import Any import numpy as np from matplotlib import pyplot as plt from time import perf_counter from scipy import integrate from .study_configuration import StudyConfiguration class FatigueIntegrator: def __init__(self, study_configuration: StudyConfiguration): self.study = study_configurat...
[ "numpy.sqrt", "matplotlib.pyplot.plot", "time.perf_counter", "numpy.sum", "matplotlib.pyplot.axes", "matplotlib.pyplot.show" ]
[((483, 493), 'matplotlib.pyplot.axes', 'plt.axes', ([], {}), '()\n', (491, 493), True, 'from matplotlib import pyplot as plt\n'), ((1356, 1366), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1364, 1366), True, 'from matplotlib import pyplot as plt\n'), ((2840, 2852), 'numpy.sqrt', 'np.sqrt', (['mse'], {}), ...
################################################################################ # The Neural Network (NN) based Speech Synthesis System # https://github.com/CSTR-Edinburgh/merlin # # Centre for Speech Technology Research # University of Edinburgh, UK # ...
[ "logging.getLogger", "numpy.fromfile", "numpy.log10", "numpy.sqrt", "numpy.log", "multiprocessing.cpu_count", "frontend.label_composer.LabelComposer", "numpy.array", "frontend.parameter_generation.ParameterGeneration", "frontend.min_max_norm.MinMaxNormalisation", "run_keras_with_merlin_io.KerasC...
[((4534, 4563), 'logging.getLogger', 'logging.getLogger', (['"""plotting"""'], {}), "('plotting')\n", (4551, 4563), False, 'import logging\n'), ((5721, 5741), 'io_funcs.binary_io.BinaryIOCollection', 'BinaryIOCollection', ([], {}), '()\n', (5739, 5741), False, 'from io_funcs.binary_io import BinaryIOCollection\n'), ((6...
# Imports import torch from itertools import count from torch.autograd import Variable from utils import * import random import numpy as np USE_CUDA = torch.cuda.is_available() dtype = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor device = torch.device("cuda" if torch.cuda.is_available()...
[ "numpy.abs", "random.randrange", "numpy.array", "torch.tensor", "torch.cuda.is_available", "itertools.count", "torch.save", "random.random", "torch.autograd.Variable", "torch.cat" ]
[((154, 179), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (177, 179), False, 'import torch\n'), ((214, 239), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (237, 239), False, 'import torch\n'), ((3088, 3095), 'itertools.count', 'count', ([], {}), '()\n', (3093, 3095)...
"""Testing utilities for the MNE BIDS converter.""" # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import os.path as op # This is here to handle mne-python <0.20 import warnings from datetime import datetime from pathlib import Path import pytest from nu...
[ "mne.io.read_raw_bti", "mne_bids.utils._get_ch_type_mapping", "mne.io.RawArray", "datetime.datetime", "mne_bids.BIDSPath", "numpy.random.random", "pathlib.Path", "mne_bids.path._path_to_str", "mne_bids.utils._age_on_date", "mne.io.read_raw_brainvision", "mne_bids.utils._check_types", "os.path....
[((943, 1032), 'mne_bids.BIDSPath', 'BIDSPath', ([], {'subject': 'subject_id', 'session': 'session_id', 'run': 'run', 'acquisition': 'acq', 'task': 'task'}), '(subject=subject_id, session=session_id, run=run, acquisition=acq,\n task=task)\n', (951, 1032), False, 'from mne_bids import BIDSPath\n'), ((351, 376), 'warn...
import os import json import numpy as np from experiment_handler.time_synchronisation import convert_timestamps from experiment_handler.finder import find_all_imu_files def load_imu_file(filepath): lines = [] with open(filepath, 'r') as file: try: lines = file.read().split("\n") ex...
[ "matplotlib.pyplot.imshow", "experiment_handler.finder.find_all_imu_files", "os.path.exists", "json.loads", "json.dump", "os.path.join", "experiment_handler.time_synchronisation.convert_timestamps", "os.path.realpath", "numpy.append", "numpy.isnan", "json.load", "numpy.load", "numpy.save", ...
[((4624, 4677), 'os.path.join', 'os.path.join', (['experiment_path', '"""imu"""', "(source + '.log')"], {}), "(experiment_path, 'imu', source + '.log')\n", (4636, 4677), False, 'import os\n'), ((8368, 8435), 'os.path.join', 'os.path.join', (['experiment_path', '"""imu"""', "(source + '_movement-data.npy')"], {}), "(exp...
import os import glob import pickle import re # Our numerical workhorses import numpy as np import pandas as pd # Import the project utils import sys sys.path.insert(0, '../') import NB_sortseq_utils as utils # Import matplotlib stuff for plotting import matplotlib.pyplot as plt import matplotlib.cm as cm from IPyth...
[ "pandas.isnull", "sys.path.insert", "seaborn.set_palette", "matplotlib.patches.Rectangle", "pandas.read_csv", "numpy.arange", "numpy.zeros", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout", "numpy.percentile", "NB_sortseq_utils.set_plotting_style1", "matplotlib.pyplot.legend" ]
[((152, 177), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../"""'], {}), "(0, '../')\n", (167, 177), False, 'import sys\n'), ((458, 499), 'seaborn.set_palette', 'sns.set_palette', (['"""deep"""'], {'color_codes': '(True)'}), "('deep', color_codes=True)\n", (473, 499), True, 'import seaborn as sns\n'), ((500, 527...
# -*- coding: utf-8 -*- import numpy as np import random import sys from collections import Counter import json from argparse import ArgumentParser from json_utils import load_json_file, load_json_stream def get_leaves(node, leaves): if node["left"] is not None: get_leaves(node["left"], leaves) g...
[ "numpy.copy", "json_utils.load_json_file", "numpy.sqrt", "numpy.ones", "argparse.ArgumentParser", "json.dumps", "numpy.array", "numpy.argmin" ]
[((644, 657), 'numpy.copy', 'np.copy', (['dmat'], {}), '(dmat)\n', (651, 657), True, 'import numpy as np\n'), ((4205, 4221), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (4219, 4221), False, 'from argparse import ArgumentParser\n'), ((4552, 4577), 'json_utils.load_json_file', 'load_json_file', (['args...
import keras from keras.models import Sequential from keras.layers import Dense, Dropout, Activation from keras.optimizers import SGD # 生成虚拟数据 import numpy as np # 1000行 20列 x_train = np.random.random((10000, 20)) # [0,10) 整数 y_train = keras.utils.to_categorical(np.random.randint(10, size=(10000, 1)), num_classes=10)...
[ "numpy.random.random", "keras.models.Sequential", "numpy.random.randint", "keras.optimizers.SGD", "keras.layers.Dense", "keras.layers.Dropout" ]
[((186, 215), 'numpy.random.random', 'np.random.random', (['(10000, 20)'], {}), '((10000, 20))\n', (202, 215), True, 'import numpy as np\n'), ((330, 358), 'numpy.random.random', 'np.random.random', (['(1000, 20)'], {}), '((1000, 20))\n', (346, 358), True, 'import numpy as np\n'), ((459, 471), 'keras.models.Sequential',...
from typing import Dict, Tuple from gym.envs.registration import register import numpy as np from highway_env import utils from highway_env.envs.common.abstract import AbstractEnv, MultiAgentWrapper from highway_env.road.lane import LineType, StraightLane, CircularLane, AbstractLane from highway_env.road.regulation i...
[ "highway_env.road.regulation.RegulatedRoad", "highway_env.road.road.RoadNetwork", "numpy.radians", "numpy.flip", "numpy.linalg.norm", "highway_env.utils.lmap", "highway_env.utils.class_from_path", "numpy.array", "highway_env.road.lane.StraightLane", "numpy.linspace", "numpy.cos", "highway_env....
[((12436, 12480), 'highway_env.envs.common.abstract.MultiAgentWrapper', 'MultiAgentWrapper', (['MultiAgentIntersectionEnv'], {}), '(MultiAgentIntersectionEnv)\n', (12453, 12480), False, 'from highway_env.envs.common.abstract import AbstractEnv, MultiAgentWrapper\n'), ((12483, 12561), 'gym.envs.registration.register', '...
""" Implements Genetic algorithms for black-box optimisation. --<EMAIL> """ # pylint: disable=invalid-name # pylint: disable=no-member from argparse import Namespace from numpy.random import choice # Local imports from .blackbox_optimiser import BlackboxOptimiser, blackbox_opt_args from ..utils.general_utils impo...
[ "numpy.random.choice", "argparse.Namespace" ]
[((6471, 6491), 'argparse.Namespace', 'Namespace', ([], {'point': 'ret'}), '(point=ret)\n', (6480, 6491), False, 'from argparse import Namespace\n'), ((7612, 7691), 'numpy.random.choice', 'choice', (['all_prev_eval_points', 'self.num_candidates_to_mutate_from'], {'replace': '(False)'}), '(all_prev_eval_points, self.num...
# Copyright (c) 2018 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 app...
[ "unique_name.generate", "numpy.dtype", "collections.OrderedDict", "re.compile" ]
[((1534, 1552), 'numpy.dtype', 'np.dtype', (['np_dtype'], {}), '(np_dtype)\n', (1542, 1552), True, 'import numpy as np\n'), ((21927, 21952), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (21950, 21952), False, 'import collections\n'), ((22075, 22100), 'collections.OrderedDict', 'collections.Or...
"""Tests for module `petibmpy.grid`.""" import copy import numpy import pathlib import unittest import petibmpy class GridIOTestCase(unittest.TestCase): """Tests related to the I/O grid.""" def setUp(self): """Setup.""" self.x = numpy.sort(numpy.random.rand(5)) self.y = numpy.sort(n...
[ "petibmpy.Segment", "petibmpy.read_grid_hdf5", "numpy.allclose", "numpy.random.rand", "pathlib.Path", "numpy.linspace", "petibmpy.GridLine", "petibmpy.write_grid_hdf5", "petibmpy.CartesianGrid", "copy.deepcopy" ]
[((504, 527), 'pathlib.Path', 'pathlib.Path', (['"""grid.h5"""'], {}), "('grid.h5')\n", (516, 527), False, 'import pathlib\n'), ((1307, 1338), 'petibmpy.Segment', 'petibmpy.Segment', ([], {'config': 'config'}), '(config=config)\n', (1323, 1338), False, 'import petibmpy\n'), ((1515, 1550), 'numpy.linspace', 'numpy.linsp...
# -*- coding: utf-8 -*-# ''' # Name: lDataNormalization # Description: # Author: super # Date: 2020/5/13 ''' import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from HelperClass.NeuralNet_1_1 import * file_name = "../data/ch05.npz" def ShowResult(net, r...
[ "numpy.array", "matplotlib.pyplot.figure", "numpy.linspace", "numpy.meshgrid", "mpl_toolkits.mplot3d.Axes3D", "matplotlib.pyplot.show" ]
[((404, 416), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (414, 416), True, 'import matplotlib.pyplot as plt\n'), ((426, 437), 'mpl_toolkits.mplot3d.Axes3D', 'Axes3D', (['fig'], {}), '(fig)\n', (432, 437), False, 'from mpl_toolkits.mplot3d import Axes3D\n'), ((1091, 1108), 'numpy.linspace', 'np.linspace...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np import gdspy import picwriter.toolkit as tk class Ring(tk.Component): """ Ring Resonator Cell class. Args: * **wgt** (WaveguideTemplate): WaveguideTemplate object ...
[ "numpy.sin", "picwriter.toolkit.add", "gdspy.write_gds", "numpy.cos", "gdspy.Cell", "gdspy.Path" ]
[((17612, 17629), 'gdspy.Cell', 'gdspy.Cell', (['"""top"""'], {}), "('top')\n", (17622, 17629), False, 'import gdspy\n'), ((17748, 17764), 'picwriter.toolkit.add', 'tk.add', (['top', 'wg1'], {}), '(top, wg1)\n', (17754, 17764), True, 'import picwriter.toolkit as tk\n'), ((17857, 17872), 'picwriter.toolkit.add', 'tk.add...
import logging import numpy as np from os.path import join from types import ModuleType from inspect import getmembers, isclass from pyquaternion import Quaternion from pyrep import PyRep from pyrep.backend.utils import suppress_std_out_and_err from pyrep.errors import IKError from pyrep.robots.arms.panda import Panda ...
[ "numpy.abs", "pyquaternion.Quaternion", "inspect.getmembers", "rlbench.backend.scene.Scene", "rlbench.observation_config.ObservationConfig", "pyrep.backend.utils.suppress_std_out_and_err", "pyrep.robots.arms.panda.Panda", "pyrep.robots.end_effectors.panda_gripper.PandaGripper", "os.path.join", "rl...
[((1405, 1447), 'rlbench.observation_config.ObservationConfig', 'ObservationConfig', ([], {'task_low_dim_state': '(True)'}), '(task_low_dim_state=True)\n', (1422, 1447), False, 'from rlbench.observation_config import ObservationConfig\n'), ((1492, 1504), 'rlbench.action_modes.ActionMode', 'ActionMode', ([], {}), '()\n'...
# -*- coding: utf-8 -*- # file: data_utils_for_inferring.py # time: 2021/4/22 0022 # author: yangheng <<EMAIL>> # github: https://github.com/yangheng95 # Copyright (C) 2021. All Rights Reserved. import numpy as np from pyabsa.utils.pyabsa_utils import check_and_fix_labels, validate_example from torch.utils.data import ...
[ "pyabsa.utils.pyabsa_utils.validate_example", "numpy.array", "tqdm.tqdm", "numpy.asarray" ]
[((2899, 2948), 'tqdm.tqdm', 'tqdm', (['samples'], {'postfix': '"""building word indices..."""'}), "(samples, postfix='building word indices...')\n", (2903, 2948), False, 'from tqdm import tqdm\n'), ((4669, 4713), 'pyabsa.utils.pyabsa_utils.validate_example', 'validate_example', (['text_raw', 'aspect', 'polarity'], {})...
#!/usr/bin/env python3 #encoding: utf-8 import os import time import numpy as np import LED import pandas as pd import fixedsizes as fx import pickle import lirc def blank_display(): for i in range(LED.DRIVER_COUNT*24): LED.tlc5947[i] = 0 LED.tlc5947.write() def apply_pattern(filename): global LED, pattern_selec...
[ "lirc.nextcode", "pickle.load", "time.sleep", "LED.tlc5947.write", "lirc.init", "LED.Init_Panel", "numpy.shape" ]
[((244, 263), 'LED.tlc5947.write', 'LED.tlc5947.write', ([], {}), '()\n', (261, 263), False, 'import LED\n'), ((457, 471), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (468, 471), False, 'import pickle\n'), ((489, 505), 'numpy.shape', 'np.shape', (['Render'], {}), '(Render)\n', (497, 505), True, 'import numpy as...
from ScopeFoundry.data_browser import DataBrowser, HyperSpectralBaseView import numpy as np class HyperSpecNPZView(HyperSpectralBaseView): name = 'hyperspec_npz' def is_file_supported(self, fname): return "_spec_scan.npz" in fname def load_data(self, fname): self.dat = np.loa...
[ "numpy.cumsum", "ScopeFoundry.data_browser.DataBrowser", "numpy.load", "numpy.apply_along_axis" ]
[((848, 863), 'numpy.cumsum', 'np.cumsum', (['spec'], {}), '(spec)\n', (857, 863), True, 'import numpy as np\n'), ((2054, 2075), 'ScopeFoundry.data_browser.DataBrowser', 'DataBrowser', (['sys.argv'], {}), '(sys.argv)\n', (2065, 2075), False, 'from ScopeFoundry.data_browser import DataBrowser, HyperSpectralBaseView\n'),...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "torchvision.datasets.CIFAR100", "torch.nn.CrossEntropyLoss", "third_party.WideResNet_pytorch.wideresnet.WideResNet", "models.cifar.allconv.AllConvNet", "numpy.mean", "os.path.exists", "argparse.ArgumentParser", "third_party.ResNeXt_DenseNet.models.densenet.densenet", "os.path.isdir", "numpy.rando...
[((1434, 1558), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Trains a CIFAR Classifier"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Trains a CIFAR Classifier',\n formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n", (1457, 1558), False, 'i...
from pandas_datareader import data start_date = '2014-01-01' end_date = '2018-01-01' goog_data = data.DataReader('GOOG', 'yahoo', start_date, end_date) import numpy as np import pandas as pd goog_data_signal = pd.DataFrame(index=goog_data.index) goog_data_signal['price'] = goog_data['Adj Close'] goog_data_signal['da...
[ "pandas_datareader.data.DataReader", "numpy.where", "matplotlib.pyplot.figure", "pandas.DataFrame", "matplotlib.pyplot.show" ]
[((97, 151), 'pandas_datareader.data.DataReader', 'data.DataReader', (['"""GOOG"""', '"""yahoo"""', 'start_date', 'end_date'], {}), "('GOOG', 'yahoo', start_date, end_date)\n", (112, 151), False, 'from pandas_datareader import data\n'), ((213, 248), 'pandas.DataFrame', 'pd.DataFrame', ([], {'index': 'goog_data.index'})...
#!/usr/bin/python3 from tools import * from sys import argv from os.path import join import h5py import matplotlib.pylab as plt from matplotlib.patches import Wedge import numpy as np if len(argv) > 1: pathToSimFolder = argv[1] else: pathToSimFolder = "../data/" parameters, electrodes = readParameters(pathT...
[ "matplotlib.pylab.subplots", "numpy.sqrt", "matplotlib.colors.to_rgba", "os.path.join", "numpy.max", "numpy.cos", "matplotlib.pylab.close", "numpy.sin", "numpy.bincount" ]
[((2761, 2773), 'numpy.max', 'np.max', (['data'], {}), '(data)\n', (2767, 2773), True, 'import numpy as np\n'), ((2839, 2857), 'numpy.bincount', 'np.bincount', (['added'], {}), '(added)\n', (2850, 2857), True, 'import numpy as np\n'), ((4035, 4087), 'matplotlib.pylab.subplots', 'plt.subplots', (['(1)', '(1)'], {'figsiz...
import sys import numpy as np from starfish import ImageStack from starfish.spots import FindSpots from starfish.types import Axes def test_lmpf_uniform_peak(): data_array = np.zeros(shape=(1, 1, 1, 100, 100), dtype=np.float32) data_array[0, 0, 0, 45:55, 45:55] = 1 imagestack = ImageStack.from_numpy(dat...
[ "starfish.ImageStack.from_numpy", "numpy.zeros", "starfish.spots.FindSpots.LocalMaxPeakFinder" ]
[((182, 235), 'numpy.zeros', 'np.zeros', ([], {'shape': '(1, 1, 1, 100, 100)', 'dtype': 'np.float32'}), '(shape=(1, 1, 1, 100, 100), dtype=np.float32)\n', (190, 235), True, 'import numpy as np\n'), ((295, 328), 'starfish.ImageStack.from_numpy', 'ImageStack.from_numpy', (['data_array'], {}), '(data_array)\n', (316, 328)...
import numpy as np import os import torch import torch.nn as nn import torch.optim as optim import torch.nn.init as init import torch.nn.functional as F from torch.utils.data import Dataset, DataLoader #from scipy import stats from shallow_model import Model class z24Dataset(Dataset): def __init__(self, damage_ca...
[ "torch.mean", "torch.load", "numpy.memmap", "torch.numel", "numpy.sum", "torch.nn.MSELoss", "numpy.array", "torch.cuda.is_available", "torch.sum", "torch.utils.data.DataLoader", "numpy.loadtxt", "numpy.load", "torch.std", "torch.zeros" ]
[((2117, 2202), 'numpy.loadtxt', 'np.loadtxt', (["('../data/z24_damage/damage_' + damage_case + '_index.txt')"], {'dtype': 'str'}), "('../data/z24_damage/damage_' + damage_case + '_index.txt', dtype=str\n )\n", (2127, 2202), True, 'import numpy as np\n'), ((2296, 2383), 'torch.load', 'torch.load', ([], {'f': '"""../...
#!/usr/bin/env python # # Copyright (c) 2015 10X Genomics, Inc. All rights reserved. # import collections import itertools import json import numpy as np import os import re import sys import tenkit.constants as tk_constants import tenkit.fasta as tk_fasta import tenkit.safe_json as tk_safe_json import tenkit.seq as tk...
[ "cellranger.io.mkdir", "numpy.array", "cellranger.io.open_maybe_gzip", "itertools.izip", "tenkit.seq.get_rev_comp", "cellranger.utils.load_barcode_whitelist", "tenkit.constants.SAMPLE_INDEX_MAP.get", "cellranger.utils.get_fastq_read1", "tenkit.fasta.find_input_fastq_files_10x_preprocess", "tenkit....
[((1268, 1297), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (1291, 1297), False, 'import collections\n'), ((2369, 2445), 'itertools.islice', 'itertools.islice', (['read_iter', 'cr_constants.NUM_CHECK_BARCODES_FOR_ORIENTATION'], {}), '(read_iter, cr_constants.NUM_CHECK_BARCODES_FOR_...
from __future__ import annotations import numpy as np from edutorch.typing import NPArray from .module import Module from .rnn_cell import RNNCell class RNN(Module): def __init__(self, input_size: int, hidden_size: int, batch_size: int) -> None: super().__init__() self.input_size = input_size ...
[ "numpy.random.normal", "numpy.zeros", "numpy.zeros_like" ]
[((431, 473), 'numpy.random.normal', 'np.random.normal', ([], {'scale': '(0.001)', 'size': '(N, H)'}), '(scale=0.001, size=(N, H))\n', (447, 473), True, 'import numpy as np\n'), ((491, 533), 'numpy.random.normal', 'np.random.normal', ([], {'scale': '(0.001)', 'size': '(D, H)'}), '(scale=0.001, size=(D, H))\n', (507, 53...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. # # 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 appl...
[ "logging.getLogger", "sys.setdefaultencoding", "logging.StreamHandler", "paddle.fluid.cuda_places", "models.language_model.lm_model.lm_model", "numpy.array", "paddle.fluid.cpu_places", "paddle.fluid.clip.GradientClipByGlobalNorm", "sys.path.append", "paddle.fluid.ExecutionStrategy", "paddle.flui...
[((1083, 1105), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (1098, 1105), False, 'import sys\n'), ((1051, 1082), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (1073, 1082), False, 'import sys\n'), ((2305, 2334), 'numpy.savez', 'np.savez', (['"""mod...
import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels.imputation.bayes_mi import BayesGaussMI, MI from numpy.testing import assert_allclose def test_pat(): x = np.asarray([[1, np.nan, 3], [np.nan, 2, np.nan], [3, np.nan, 0], [np.nan, 1, np.nan], [3, 2, 1]]) ...
[ "numpy.random.normal", "numpy.abs", "numpy.sqrt", "numpy.testing.assert_allclose", "numpy.asarray", "numpy.random.seed", "statsmodels.imputation.bayes_mi.MI", "pandas.DataFrame", "numpy.cov", "statsmodels.imputation.bayes_mi.BayesGaussMI" ]
[((198, 299), 'numpy.asarray', 'np.asarray', (['[[1, np.nan, 3], [np.nan, 2, np.nan], [3, np.nan, 0], [np.nan, 1, np.nan],\n [3, 2, 1]]'], {}), '([[1, np.nan, 3], [np.nan, 2, np.nan], [3, np.nan, 0], [np.nan, 1,\n np.nan], [3, 2, 1]])\n', (208, 299), True, 'import numpy as np\n'), ((325, 340), 'statsmodels.imputa...
import numpy as np import h5py import tensorflow as tf # import keras import os import sys import pickle # We are going to try to do some residual netowrks expr_name = sys.argv[0][:-3] expr_no = '1' save_dir = os.path.abspath(os.path.join(os.path.expanduser('~/fluoro/code/jupyt/vox_fluoro'), expr_name)) print(save_...
[ "tensorflow.keras.layers.Conv3D", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.AveragePooling2D", "tensorflow.keras.layers.SpatialDropout3D", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.backend.square", "os.path.expanduser", "tensorf...
[((325, 361), 'os.makedirs', 'os.makedirs', (['save_dir'], {'exist_ok': '(True)'}), '(save_dir, exist_ok=True)\n', (336, 361), False, 'import os\n'), ((8976, 9048), 'tensorflow.keras.Input', 'tf.keras.Input', ([], {'shape': 'vox_input_shape', 'name': '"""input_vox"""', 'dtype': '"""float32"""'}), "(shape=vox_input_shap...
# Copyright 2016 <NAME>, alexggmatthews # # 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 wr...
[ "tensorflow.eye", "tensorflow.shape", "tensorflow.transpose", "tensorflow.reduce_sum", "numpy.log", "tensorflow.sqrt", "tensorflow.constant", "tensorflow.matmul", "tensorflow.square", "tensorflow.expand_dims", "tensorflow.cholesky", "tensorflow.diag_part", "tensorflow.log", "tensorflow.mat...
[((2654, 2670), 'tensorflow.cholesky', 'tf.cholesky', (['Kuu'], {}), '(Kuu)\n', (2665, 2670), True, 'import tensorflow as tf\n'), ((2687, 2720), 'tensorflow.sqrt', 'tf.sqrt', (['self.likelihood.variance'], {}), '(self.likelihood.variance)\n', (2694, 2720), True, 'import tensorflow as tf\n'), ((2843, 2876), 'tensorflow....
from sklearn.svm import SVC from sklearn.model_selection import GridSearchCV import json import pickle import numpy as np import time def get_data(): data_file = 'data/train.json' with open(data_file, 'r') as f: data = json.load(f) print('Loaded Data') X = [] Y = [] for key, values i...
[ "pickle.dump", "numpy.argmax", "json.load", "time.time", "sklearn.svm.SVC" ]
[((703, 714), 'time.time', 'time.time', ([], {}), '()\n', (712, 714), False, 'import time\n'), ((814, 825), 'time.time', 'time.time', ([], {}), '()\n', (823, 825), False, 'import time\n'), ((926, 948), 'numpy.argmax', 'np.argmax', (['predictions'], {}), '(predictions)\n', (935, 948), True, 'import numpy as np\n'), ((23...
# PhonopyImporter/CASTEP.py # ---------------- # Module Docstring # ---------------- """ Contains routines for working with the CASTEP code. """ # ------- # Imports # ------- import numpy as np # --------- # Functions # --------- def ReadPhonon(file_path): """ Parse the CASTEP .phonon file at file_path...
[ "numpy.array" ]
[((4617, 4646), 'numpy.array', 'np.array', (['v'], {'dtype': 'np.float64'}), '(v, dtype=np.float64)\n', (4625, 4646), True, 'import numpy as np\n'), ((4700, 4731), 'numpy.array', 'np.array', (['pos'], {'dtype': 'np.float64'}), '(pos, dtype=np.float64)\n', (4708, 4731), True, 'import numpy as np\n'), ((5088, 5117), 'num...
#!/usr/bin/python """Plot occupancy curves of each staple type.""" import argparse import matplotlib.pyplot as plt from matplotlib import cm from matplotlib import gridspec import numpy as np from matplotlibstyles import styles from origamipy import plot from origamipy import utility def main(): args = parse_...
[ "origamipy.plot.read_expectations", "argparse.ArgumentParser", "numpy.max", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.figure", "matplotlibstyles.styles.set_thin_style", "numpy.min", "matplotlibstyles.styles.darken_color", "matplotlibstyles.styles.cm_to_inches", "matplotlibstyles.styles.cr...
[((359, 426), 'matplotlib.gridspec.GridSpec', 'gridspec.GridSpec', (['(1)', '(2)', 'f'], {'width_ratios': '[10, 1]', 'height_ratios': '[1]'}), '(1, 2, f, width_ratios=[10, 1], height_ratios=[1])\n', (376, 426), False, 'from matplotlib import gridspec\n'), ((697, 720), 'matplotlibstyles.styles.set_thin_style', 'styles.s...
#! /usr/bin/env python """Extract and plot channel long profiles. Plotting functions to extract and plot channel long profiles. Call all three functions in sequence from the main code. The functions will return the long profile nodes, return distances upstream of those nodes, and plot the long profiles, respectively....
[ "six.moves.range", "numpy.amin", "numpy.where", "matplotlib.pyplot.plot", "numpy.argmax", "numpy.argsort", "numpy.array", "warnings.warn" ]
[((4790, 4798), 'six.moves.range', 'range', (['(4)'], {}), '(4)\n', (4795, 4798), False, 'from six.moves import range\n'), ((977, 1029), 'warnings.warn', 'warnings.warn', (['"""matplotlib not found"""', 'ImportWarning'], {}), "('matplotlib not found', ImportWarning)\n", (990, 1029), False, 'import warnings\n'), ((2865,...
import re import time import torch from datetime import timedelta import numpy as np from numpy.core.arrayprint import printoptions import pandas as pd from config import logger, opt from transformers import BertTokenizer from torch.utils.data import Dataset from pprint import pprint pattern = re.compile(r'http[s]?://...
[ "numpy.ones", "re.compile", "torch.LongTensor", "transformers.BertTokenizer.from_pretrained", "numpy.asarray", "config.logger.info", "numpy.sum", "re.sub", "time.time" ]
[((296, 400), 're.compile', 're.compile', (['"""http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\\\(\\\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+"""'], {}), "(\n 'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\\\(\\\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+'\n )\n", (306, 400), False, 'import re\n'), ((454, 465), 'time.time', 'time.tim...
import pytest from keras.preprocessing import image from PIL import Image import numpy as np import os import shutil import tempfile class TestImage: def setup_class(cls): img_w = img_h = 20 rgb_images = [] gray_images = [] for n in range(8): bias = np....
[ "keras.preprocessing.image.img_to_array", "numpy.random.rand", "numpy.random.random", "os.path.join", "keras.preprocessing.image.ImageDataGenerator", "pytest.main", "tempfile.mkdtemp", "numpy.vstack", "pytest.raises", "shutil.rmtree", "keras.preprocessing.image.array_to_img", "numpy.arange" ]
[((7334, 7357), 'pytest.main', 'pytest.main', (['[__file__]'], {}), '([__file__])\n', (7345, 7357), False, 'import pytest\n'), ((2301, 2492), 'keras.preprocessing.image.ImageDataGenerator', 'image.ImageDataGenerator', ([], {'featurewise_center': '(True)', 'samplewise_center': '(True)', 'featurewise_std_normalization': ...
import cv2 import numpy as np #Example -2 (bright) -11(dark) exposure=-5 #Example -130 (dark) +130(bright) brightness=0 #Example -130 (dark) +130(bright) contrast=0 #Example 0 - 500 focus=0 #0 to N (camera index, 0 is the default OS main camera) camera_id=0 live_feed=False vid = cv2.VideoCapture(camera_id) if n...
[ "cv2.imshow", "numpy.zeros", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.waitKey" ]
[((288, 315), 'cv2.VideoCapture', 'cv2.VideoCapture', (['camera_id'], {}), '(camera_id)\n', (304, 315), False, 'import cv2\n'), ((402, 435), 'numpy.zeros', 'np.zeros', (['(200, 200, 3)', 'np.uint8'], {}), '((200, 200, 3), np.uint8)\n', (410, 435), True, 'import numpy as np\n'), ((2817, 2840), 'cv2.destroyAllWindows', '...
# coding: utf-8 import os, sys, time, concurrent.futures import pandas as pd import numpy as np import online_node2vec.evaluation.ndcg_computer as ndcgc import online_node2vec.data.tennis_handler as th import online_node2vec.data.n2v_embedding_handler as n2veh output_folder = "../results/" delta_time = 3600*6 # updat...
[ "os.path.exists", "numpy.mean", "os.makedirs", "numpy.std", "online_node2vec.evaluation.ndcg_computer.parallel_eval_ndcg", "numpy.min", "numpy.max", "online_node2vec.data.tennis_handler.get_data_info", "time.time", "pandas.concat", "online_node2vec.data.n2v_embedding_handler.load_n2v_features" ]
[((797, 899), 'online_node2vec.data.n2v_embedding_handler.load_n2v_features', 'n2veh.load_n2v_features', (['features_dir', 'delta_time', 'total_days', 'player_labels', 'eval_window'], {'sep': '""","""'}), "(features_dir, delta_time, total_days, player_labels,\n eval_window, sep=',')\n", (820, 899), True, 'import onl...
import pandas as pd import numpy as np from sklearn.model_selection import train_test_split import gensim.downloader as api import re from sklearn.neighbors import KNeighborsClassifier from sklearn import preprocessing class process_txt: def __init__(self): print("Loading pre-trained Word2Vec model...") ...
[ "numpy.mean", "sklearn.preprocessing.LabelEncoder", "numpy.unique", "sklearn.neighbors.KNeighborsClassifier", "gensim.downloader.load", "numpy.array", "numpy.zeros", "re.sub" ]
[((341, 377), 'gensim.downloader.load', 'api.load', (['"""word2vec-google-news-300"""'], {}), "('word2vec-google-news-300')\n", (349, 377), True, 'import gensim.downloader as api\n'), ((396, 424), 'sklearn.preprocessing.LabelEncoder', 'preprocessing.LabelEncoder', ([], {}), '()\n', (422, 424), False, 'from sklearn impo...
import torch import numpy as np def fit(train_loader, val_loader, model, loss_fn, optimizer, scheduler, n_epochs, cuda, log_interval, metrics=[], start_epoch=0): """ Loaders, model, loss function and metrics should work together for a given task, i.e. The model should be able to process data outpu...
[ "torch.no_grad", "numpy.mean" ]
[((3527, 3542), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3540, 3542), False, 'import torch\n'), ((3210, 3225), 'numpy.mean', 'np.mean', (['losses'], {}), '(losses)\n', (3217, 3225), True, 'import numpy as np\n')]
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- import numpy as np from asdf.versioning import AsdfVersion from astropy.modeling.bounding_box import ModelBoundingBox, CompoundBoundingBox from astropy.modeling import mappings from astropy.modeling import functional_models from a...
[ "astropy.modeling.functional_models.Const2D", "astropy.modeling.functional_models.Const1D", "numpy.isfinite", "astropy.modeling.bounding_box.CompoundBoundingBox.validate", "asdf.versioning.AsdfVersion", "astropy.modeling.mappings.UnitsMapping" ]
[((9308, 9348), 'astropy.modeling.mappings.UnitsMapping', 'mappings.UnitsMapping', (['mapping'], {}), '(mapping, **kwargs)\n', (9329, 9348), False, 'from astropy.modeling import mappings\n'), ((5651, 5671), 'asdf.versioning.AsdfVersion', 'AsdfVersion', (['"""1.4.0"""'], {}), "('1.4.0')\n", (5662, 5671), False, 'from as...
import numpy as np # import cupy as np # def softmax_cross_entropy(x, y): # ''' 对输入先进行 softmax 操作后再使用交叉熵求损失 ''' # # softmax forward # x = x - np.max(x) # out = np.exp(x) / np.reshape(np.sum(np.exp(x), 1), (x.shape[0], 1)) # loss, dout = cross_entropy(out, y) # diag = np.zeros((dout.shape[0],do...
[ "numpy.clip", "numpy.ones_like", "numpy.log", "numpy.sum", "numpy.maximum", "numpy.zeros_like", "numpy.arange" ]
[((1177, 1200), 'numpy.clip', 'np.clip', (['pred', '(1e-10)', '(1)'], {}), '(pred, 1e-10, 1)\n', (1184, 1200), True, 'import numpy as np\n'), ((1318, 1337), 'numpy.zeros_like', 'np.zeros_like', (['pred'], {}), '(pred)\n', (1331, 1337), True, 'import numpy as np\n'), ((1905, 1940), 'numpy.maximum', 'np.maximum', (['(0)'...
"""This file contains code used in "Think Bayes", by <NAME>, available from greenteapress.com Copyright 2012 <NAME> License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import matplotlib.pyplot as pyplot import thinkplot import numpy import csv import random import shelv...
[ "thinkbayes2.Suite.Update", "numpy.log", "thinkbayes2.PmfProbLess", "numpy.array", "shelve.open", "thinkbayes2.Beta", "thinkplot.Plot", "thinkplot.Clf", "numpy.mean", "thinkbayes2.MakeMixture", "thinkbayes2.Dirichlet", "thinkplot.Cdf", "thinkbayes2.BinomialCoef", "numpy.max", "numpy.exp"...
[((383, 429), 'warnings.simplefilter', 'warnings.simplefilter', (['"""error"""', 'RuntimeWarning'], {}), "('error', RuntimeWarning)\n", (404, 429), False, 'import warnings\n'), ((13979, 13998), 'thinkbayes2.Joint', 'thinkbayes2.Joint', ([], {}), '()\n', (13996, 13998), False, 'import thinkbayes2\n'), ((15402, 15416), '...
#!/usr/bin/env python import argparse import os from datetime import datetime import subprocess import numpy as np import atmodat_checklib.utils.output_directory_util as output_directory import atmodat_checklib.utils.summary_creation_util as summary_creation from atmodat_checklib.utils.env_util import set_env_variabl...
[ "os.listdir", "atmodat_checklib.utils.output_directory_util.create_directories", "argparse.ArgumentParser", "atmodat_checklib.utils.output_directory_util.return_files_in_directory", "subprocess.run", "os.path.join", "os.getcwd", "os.path.isfile", "datetime.datetime.now", "atmodat_checklib.utils.su...
[((407, 426), 'atmodat_checklib.utils.env_util.set_env_variables', 'set_env_variables', ([], {}), '()\n', (424, 426), False, 'from atmodat_checklib.utils.env_util import set_env_variables\n'), ((467, 510), 'os.path.join', 'os.path.join', (['atmodat_cvs', '"""pyessv-archive"""'], {}), "(atmodat_cvs, 'pyessv-archive')\n"...
import cma import logging as log import numpy as np import os.path import pickle import humblerl as hrl from humblerl import ChainInterpreter, Mind, Worker from memory import build_rnn_model, MDNInterpreter from vision import BasicInterpreter, build_vae_model from common_utils import ReturnTracker, create_directory, ...
[ "logging.debug", "memory.MDNInterpreter", "humblerl.ChainInterpreter", "numpy.array", "cma.CMAEvolutionStrategy", "logging.info", "vision.BasicInterpreter", "numpy.mean", "numpy.tanh", "numpy.concatenate", "common_utils.create_directory", "humblerl.create_gym", "pickle.load", "common_utils...
[((428, 454), 'numpy.array', 'np.array', (['model_param_list'], {}), '(model_param_list)\n', (436, 454), True, 'import numpy as np\n'), ((6852, 6904), 'logging.info', 'log.info', (['"""Loaded Mind weights from: %s"""', 'model_path'], {}), "('Loaded Mind weights from: %s', model_path)\n", (6860, 6904), True, 'import log...
import numpy as np from abc import ABC, abstractmethod class AbstractGOL(ABC): def __init__(self, config, seed=None): """ Abstract Conway Game of Life :param config: configuration for this GOL instance (cell survival and generation settings) """ self.config = conf...
[ "numpy.random.seed" ]
[((354, 374), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (368, 374), True, 'import numpy as np\n')]
# Copyright 2021 D-Wave Systems 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...
[ "dimod.variables.serialize_variable", "zipfile.ZipFile", "dimod.serialization.fileview.load.register", "numpy.iinfo", "dimod.utilities.new_label", "dimod.sym.Eq", "dimod.serialization.fileview._BytesIO", "dimod.binary.binary_quadratic_model.as_bqm", "dimod.serialization.fileview.write_header", "nu...
[((44947, 45015), 'dimod.serialization.fileview.load.register', 'load.register', (['CQM_MAGIC_PREFIX', 'ConstrainedQuadraticModel.from_file'], {}), '(CQM_MAGIC_PREFIX, ConstrainedQuadraticModel.from_file)\n', (44960, 45015), False, 'from dimod.serialization.fileview import load, read_header, write_header\n'), ((36894, ...
import numpy as np from unittest import SkipTest, expectedFailure from parameterized import parameterized from holoviews import NdOverlay, Store from holoviews.element import Curve, Area, Scatter, Points, Path, HeatMap from holoviews.element.comparison import ComparisonTestCase from ..util import is_dask class Tes...
[ "numpy.random.rand", "parameterized.parameterized.expand", "dask.dataframe.from_pandas", "holoviews.element.HeatMap", "numpy.linspace", "unittest.SkipTest", "pandas.DataFrame", "holoviews.element.Area", "holoviews.element.Curve", "holoviews.Store.lookup_options", "pandas.date_range", "holoview...
[((939, 998), 'parameterized.parameterized.expand', 'parameterized.expand', (["[('points', Points), ('paths', Path)]"], {}), "([('points', Points), ('paths', Path)])\n", (959, 998), False, 'from parameterized import parameterized\n'), ((1154, 1213), 'parameterized.parameterized.expand', 'parameterized.expand', (["[('po...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The Project U-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import numpy as np import sys from utils...
[ "numpy.random.choice", "numpy.random.randint", "utils.util.get_part", "numpy.random.seed", "utils.util.get_db_root", "numpy.random.shuffle" ]
[((406, 426), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (420, 426), True, 'import numpy as np\n'), ((2425, 2449), 'numpy.random.shuffle', 'np.random.shuffle', (['tiles'], {}), '(tiles)\n', (2442, 2449), True, 'import numpy as np\n'), ((446, 464), 'utils.util.get_db_root', 'util.get_db_root', ([...
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
[ "language.emql.util.compute_recall_at_k", "language.emql.util.get_nonzero_ids", "language.emql.util.compute_x_in_set", "language.emql.util.compute_average_precision_at_k", "language.emql.util.compute_hits_at_k", "language.emql.util.BertTokenizer", "numpy.array", "numpy.sum", "tensorflow.compat.v1.co...
[((3544, 3558), 'tensorflow.compat.v1.test.main', 'tf.test.main', ([], {}), '()\n', (3556, 3558), True, 'import tensorflow.compat.v1 as tf\n'), ((852, 864), 'tensorflow.compat.v1.Session', 'tf.Session', ([], {}), '()\n', (862, 864), True, 'import tensorflow.compat.v1 as tf\n'), ((883, 943), 'tensorflow.compat.v1.consta...
import numpy as np import torch from torch.nn.parameter import Parameter from HyperSphere.GP.modules.gp_modules import GPModule, log_lower_bnd, log_upper_bnd from HyperSphere.feature_map.functionals import id_transform class Kernel(GPModule): def __init__(self, input_map=None): super(Kernel, self).__ini...
[ "numpy.log", "torch.FloatTensor", "torch.cat" ]
[((1881, 1907), 'torch.cat', 'torch.cat', (['flat_param_list'], {}), '(flat_param_list)\n', (1890, 1907), False, 'import torch\n'), ((359, 379), 'torch.FloatTensor', 'torch.FloatTensor', (['(1)'], {}), '(1)\n', (376, 379), False, 'import torch\n'), ((743, 754), 'numpy.log', 'np.log', (['amp'], {}), '(amp)\n', (749, 754...
"""Jobs for performing electron phonon calculations in VASP.""" from __future__ import annotations import logging from dataclasses import dataclass, field from pathlib import Path from typing import Dict, List, Tuple import numpy as np from jobflow import Flow, Response, job from pymatgen.core import Structure from ...
[ "logging.getLogger", "jobflow.Response", "jobflow.job", "numpy.array", "atomate2.vasp.schemas.elph.ElectronPhononRenormalisationDoc.from_band_structures", "jobflow.Flow", "dataclasses.field" ]
[((978, 1005), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (995, 1005), False, 'import logging\n'), ((7140, 7191), 'jobflow.job', 'job', ([], {'output_schema': 'ElectronPhononRenormalisationDoc'}), '(output_schema=ElectronPhononRenormalisationDoc)\n', (7143, 7191), False, 'from jobflow...
from __future__ import division,print_function import numpy as np import tensorflow as tf import sys import os import glob import re from tensorflow.keras.applications.imagenet_utils import preprocess_input, decode_predictions from tensorflow.keras.models import load_model from tensorflow.keras.preprocessi...
[ "tensorflow.keras.preprocessing.image.load_img", "flask.render_template", "tensorflow.keras.applications.imagenet_utils.decode_predictions", "flask.Flask", "os.path.dirname", "tensorflow.keras.models.load_model", "werkzeug.utils.secure_filename", "numpy.expand_dims", "tensorflow.keras.preprocessing....
[((519, 534), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (524, 534), False, 'from flask import Flask, redirect, url_for, request, render_template\n'), ((602, 624), 'tensorflow.keras.models.load_model', 'load_model', (['model_path'], {}), '(model_path)\n', (612, 624), False, 'from tensorflow.keras.model...
from ..meshio import form_mesh import numpy as np import logging def merge_meshes(input_meshes): """ Merge multiple meshes into a single mesh. Args: input_meshes (``list``): a list of input :class:`Mesh` objects. Returns: A :py:class:`Mesh` consists of all vertices, faces and...
[ "logging.getLogger", "numpy.ones", "numpy.array", "numpy.zeros", "numpy.vstack", "numpy.concatenate" ]
[((759, 786), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (776, 786), False, 'import logging\n'), ((1475, 1494), 'numpy.vstack', 'np.vstack', (['vertices'], {}), '(vertices)\n', (1484, 1494), True, 'import numpy as np\n'), ((1521, 1551), 'numpy.concatenate', 'np.concatenate', (['vertex...
from collections.abc import MutableMapping import numpy as np _HIDDEN_ATTRS = frozenset( [ "REFERENCE_LIST", "CLASS", "DIMENSION_LIST", "NAME", "_Netcdf4Dimid", "_Netcdf4Coordinates", "_nc3_strict", "_NCProperties", ] ) class Attributes(Mutable...
[ "h5py.check_string_dtype", "numpy.asarray" ]
[((721, 770), 'h5py.check_string_dtype', 'h5py.check_string_dtype', (['self._h5attrs[key].dtype'], {}), '(self._h5attrs[key].dtype)\n', (744, 770), False, 'import h5py\n'), ((1150, 1167), 'numpy.asarray', 'np.asarray', (['value'], {}), '(value)\n', (1160, 1167), True, 'import numpy as np\n')]
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "jax.experimental.stax.Conv", "jax.random.PRNGKey", "jax.experimental.stax.FanOut", "jax.experimental.stax.BatchNorm", "jax.experimental.stax.Dense", "jax.numpy.arange", "jax.experimental.stax.shape_dependent", "jax.experimental.stax.parallel", "jax.experimental.stax.AvgPool", "jax.numpy.sum", "...
[((2055, 2086), 'jax.experimental.stax.shape_dependent', 'stax.shape_dependent', (['make_main'], {}), '(make_main)\n', (2075, 2086), False, 'from jax.experimental import stax\n'), ((3102, 3119), 'jax.random.PRNGKey', 'random.PRNGKey', (['(0)'], {}), '(0)\n', (3116, 3119), False, 'from jax import jit, grad, random\n'), ...
from __future__ import print_function from unittest import TestCase import numpy as np from nose import SkipTest from numpy.testing import assert_array_equal, assert_array_almost_equal from sklearn.datasets.samples_generator import make_spd_matrix from sklearn.mixture import GMM from sklearn.utils import check_random...
[ "numpy.array", "sklearn.mixture.GMM", "numpy.arange", "numpy.random.RandomState", "numpy.testing.assert_array_almost_equal", "numpy.diff", "numpy.exp", "numpy.empty", "numpy.maximum", "numpy.testing.assert_array_equal", "numpy.random.normal", "hmmlearn.hmm.GaussianHMM", "numpy.all", "sklea...
[((406, 427), 'numpy.seterr', 'np.seterr', ([], {'all': '"""warn"""'}), "(all='warn')\n", (415, 427), True, 'import numpy as np\n'), ((643, 672), 'numpy.empty', 'np.empty', (['n_iter'], {'dtype': 'float'}), '(n_iter, dtype=float)\n', (651, 672), True, 'import numpy as np\n'), ((15400, 15424), 'sklearn.utils.check_rando...
import numpy as np import biorbd_casadi as biorbd from casadi import MX, vertcat from bioptim import ( OptimalControlProgram, DynamicsFcn, DynamicsList, Bounds, QAndQDotBounds, InitialGuess, ObjectiveFcn, ObjectiveList, ConstraintList, ConstraintFcn, InterpolationType, No...
[ "bioptim.BoundsList", "bioptim.ObjectiveList", "bioptim.QAndQDotBounds", "bioptim.InitialGuess", "biorbd_casadi.to_casadi_func", "casadi.vertcat", "bioptim.DynamicsList", "bioptim.ConstraintList", "numpy.array", "bioptim.PhaseTransitionList", "bioptim.OdeSolver.RK4", "bioptim.OptimalControlPro...
[((1819, 1863), 'casadi.vertcat', 'vertcat', (['first_constraint', 'second_constraint'], {}), '(first_constraint, second_constraint)\n', (1826, 1863), False, 'from casadi import MX, vertcat\n'), ((1983, 1998), 'bioptim.OdeSolver.RK4', 'OdeSolver.RK4', ([], {}), '()\n', (1996, 1998), False, 'from bioptim import OptimalC...
import pandas as pd import numpy as np class GridMDP: def __init__(self, state_space, action_space, reward, gamma): self.state_space = state_space self.action_space = action_space self.reward = reward self.gamma =...
[ "pandas.Series", "numpy.array", "numpy.abs", "numpy.random.choice" ]
[((1030, 1045), 'numpy.array', 'np.array', (['state'], {}), '(state)\n', (1038, 1045), True, 'import numpy as np\n'), ((2256, 2267), 'pandas.Series', 'pd.Series', ([], {}), '()\n', (2265, 2267), True, 'import pandas as pd\n'), ((2701, 2724), 'numpy.random.choice', 'np.random.choice', (['max_v'], {}), '(max_v)\n', (2717...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Calculate the Severe to critical infections column of Table 1 Needs the filter_SRAG.py csv output to run The Comorbidities are written like the original database keywords: 'NENHUM': No Comorbidities 'PNEUMOPATI': Lung Disease 'IMUNODEPRE': Lung Disease 'OBESIDADE': Ob...
[ "pandas.read_csv", "numpy.array", "datetime.date", "pandas.isna", "pandas.to_datetime" ]
[((775, 820), 'pandas.read_csv', 'pd.read_csv', (['"""../Data/SRAG_filtered_morb.csv"""'], {}), "('../Data/SRAG_filtered_morb.csv')\n", (786, 820), True, 'import pandas as pd\n'), ((733, 760), 'datetime.date', 'datetime.date', (['(2019)', '(12)', '(31)'], {}), '(2019, 12, 31)\n', (746, 760), False, 'import datetime\n')...
""" Author: <NAME> Copyright (c) 2019, <NAME> All rights reserved. Max-Planck-Gesellschaft zur Foerderung der Wissenschaften e.V. (MPG) is holder of all proprietary rights on this computer program. You can only use this computer program if you have closed a license agreement with MPG or you get the right to use the c...
[ "numpy.array", "psbody.mesh.Mesh", "matplotlib.pyplot.imshow", "os.path.exists", "tensorflow.Session", "util.renderer.SMPLRenderer", "numpy.max", "os.mkdir", "matplotlib.pyplot.axis", "skimage.io.imread", "run_RingNet.RingNet_inference", "matplotlib.pyplot.title", "matplotlib.pyplot.draw", ...
[((2353, 2422), 'util.renderer.get_original', 'vis_util.get_original', (['proc_param', 'verts', 'cam'], {'img_size': 'img.shape[:2]'}), '(proc_param, verts, cam, img_size=img.shape[:2])\n', (2374, 2422), True, 'from util import renderer as vis_util\n'), ((2806, 2819), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'],...
""" Convert tabular data from Tabular Benchmarks for Joint Architecture and Hyperparameter Optimization <NAME> <NAME> https://arxiv.org/pdf/1905.04970.pdf. """ import urllib import tarfile from pathlib import Path from typing import Optional import pandas as pd import numpy as np import ast import h5py from syne_t...
[ "syne_tune.util.catchtime", "tarfile.open", "syne_tune.blackbox_repository.blackbox_tabular.BlackboxTabular", "syne_tune.config_space.randint", "syne_tune.config_space.finrange", "syne_tune.blackbox_repository.repository.load", "urllib.request.urlretrieve", "matplotlib.pyplot.plot", "syne_tune.confi...
[((867, 891), 'syne_tune.config_space.choice', 'choice', (["['tanh', 'relu']"], {}), "(['tanh', 'relu'])\n", (873, 891), False, 'from syne_tune.config_space import choice, logfinrange, finrange, randint\n'), ((919, 943), 'syne_tune.config_space.choice', 'choice', (["['tanh', 'relu']"], {}), "(['tanh', 'relu'])\n", (925...
# Copyright 2020 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...
[ "mindspore.context.get_context", "numpy.array", "pytest.raises", "mindspore.nn.probability.distribution.Gamma", "pytest.mark.skipif", "mindspore.Tensor" ]
[((2566, 2640), 'pytest.mark.skipif', 'pytest.mark.skipif', (['skip_flag'], {'reason': '"""not support running in CPU and GPU"""'}), "(skip_flag, reason='not support running in CPU and GPU')\n", (2584, 2640), False, 'import pytest\n'), ((3341, 3415), 'pytest.mark.skipif', 'pytest.mark.skipif', (['skip_flag'], {'reason'...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 3 17:14:53 2019 @author: liuhongbing """ import pandas as pd import numpy as np from scipy import stats from sklearn.metrics import precision_score, recall_score, f1_score, confusion_matrix, roc_curve, auc import tensorflow as tf # 加载数据集 def read...
[ "pandas.read_csv", "sklearn.metrics.recall_score", "tensorflow.cast", "tensorflow.log", "numpy.save", "numpy.mean", "tensorflow.nn.depthwise_conv2d", "tensorflow.placeholder", "tensorflow.Session", "numpy.empty", "tensorflow.matmul", "sklearn.metrics.confusion_matrix", "tensorflow.initialize...
[((3860, 3945), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, input_height, input_width, num_channels]'}), '(tf.float32, shape=[None, input_height, input_width,\n num_channels])\n', (3874, 3945), True, 'import tensorflow as tf\n'), ((3943, 3995), 'tensorflow.placeholder', 'tf.placeho...
import aiohttp import asyncio import time import argparse import numpy as np import pandas as pd import os parser = argparse.ArgumentParser() parser.add_argument('-t', '--dir', action="store") parser.add_argument('-s', '--service', action="store") args = parser.parse_args() result_dir = args.dir if not os.path.exist...
[ "os.path.exists", "aiohttp.ClientSession", "os.makedirs", "argparse.ArgumentParser", "time.monotonic", "numpy.empty", "asyncio.sleep", "pandas.DataFrame", "asyncio.get_event_loop" ]
[((117, 142), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (140, 142), False, 'import argparse\n'), ((307, 333), 'os.path.exists', 'os.path.exists', (['result_dir'], {}), '(result_dir)\n', (321, 333), False, 'import os\n'), ((339, 362), 'os.makedirs', 'os.makedirs', (['result_dir'], {}), '(re...
#!/usr/bin/env python from __future__ import print_function import numpy as np def autostring(num, prec=0, zero=False, set_printoptions=False, pp=False, join=False, joinall=False, sep=' '): """ Format number (array) with given decimal precision. Definition ---------- def autostrin...
[ "numpy.log10", "numpy.int32", "numpy.array", "numpy.isfinite", "numpy.ma.min", "numpy.reshape", "numpy.where", "numpy.ndim", "doctest.testmod", "numpy.empty", "numpy.ma.abs", "numpy.maximum", "numpy.isinf", "numpy.abs", "numpy.ma.where", "numpy.isnan", "numpy.around", "numpy.set_pr...
[((5953, 5965), 'numpy.ndim', 'np.ndim', (['num'], {}), '(num)\n', (5960, 5965), True, 'import numpy as np\n'), ((16341, 16398), 'doctest.testmod', 'doctest.testmod', ([], {'optionflags': 'doctest.NORMALIZE_WHITESPACE'}), '(optionflags=doctest.NORMALIZE_WHITESPACE)\n', (16356, 16398), False, 'import doctest\n'), ((5927...
# This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 <NAME> and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. from __future__ import absolute_import import sys import nu...
[ "h5py.h5ds.is_attached", "h5py.h5ds.get_scale_name", "numpy.ones", "h5py.h5ds.attach_scale", "h5py.h5ds.get_label", "h5py.h5ds.is_scale", "h5py.h5ds.detach_scale", "h5py.h5ds.iterate", "h5py.h5ds.get_num_scales", "h5py.h5ds.set_label", "h5py.h5ds.set_scale" ]
[((893, 916), 'numpy.ones', 'np.ones', (['(4, 3, 2)', '"""f"""'], {}), "((4, 3, 2), 'f')\n", (900, 916), True, 'import numpy as np\n'), ((943, 966), 'numpy.ones', 'np.ones', (['(4, 3, 2)', '"""f"""'], {}), "((4, 3, 2), 'f')\n", (950, 966), True, 'import numpy as np\n'), ((990, 1005), 'numpy.ones', 'np.ones', (['(2)', '...
"""Driver for gradient calculations.""" __authors__ = "<NAME>, <NAME>, <NAME>" __copyright__ = "(c) 2011, Universite de Montreal" __license__ = "3-clause BSD License" __contact__ = "theano-dev <<EMAIL>>" __docformat__ = "restructuredtext en" import __builtin__ import logging import warnings _logger = logging.getLogg...
[ "logging.getLogger", "numpy.array", "__builtin__.min", "numpy.isfinite", "theano.tensor.arange", "theano.tensor.as_tensor_variable", "warnings.warn", "theano.compile.function", "numpy.dtype", "theano.raise_op.Raise", "__builtin__.max", "theano.tensor.sum", "theano.gof.utils.uniq", "numpy.a...
[((305, 341), 'logging.getLogger', 'logging.getLogger', (['"""theano.gradient"""'], {}), "('theano.gradient')\n", (322, 341), False, 'import logging\n'), ((4439, 4478), 'theano.gof.utils.uniq', 'gof.utils.uniq', (['[r for r, g in sources]'], {}), '([r for r, g in sources])\n', (4453, 4478), False, 'from theano import g...
from taurex.log import Logger from taurex.util import get_molecular_weight from taurex.data.fittable import Fittable import numpy as np from taurex.output.writeable import Writeable from taurex.cache import OpacityCache class Chemistry(Fittable, Logger, Writeable): """ *Abstract Class* Skeleton for defin...
[ "taurex.data.fittable.Fittable.__init__", "taurex.cache.OpacityCache", "taurex.util.get_molecular_weight", "taurex.log.Logger.__init__", "numpy.zeros" ]
[((978, 1005), 'taurex.log.Logger.__init__', 'Logger.__init__', (['self', 'name'], {}), '(self, name)\n', (993, 1005), False, 'from taurex.log import Logger\n'), ((1014, 1037), 'taurex.data.fittable.Fittable.__init__', 'Fittable.__init__', (['self'], {}), '(self)\n', (1031, 1037), False, 'from taurex.data.fittable impo...
# -------------- # Importing header files import numpy as np # Path of the file has been stored in variable called 'path' #New record new_record=[[50, 9, 4, 1, 0, 0, 40, 0]] #Code starts here data = np.genfromtxt(path, delimiter=',' ,skip_header=1) census = np.concatenate((data,np.asarray(new_recor...
[ "numpy.mean", "numpy.asarray", "numpy.genfromtxt", "numpy.std" ]
[((217, 266), 'numpy.genfromtxt', 'np.genfromtxt', (['path'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(path, delimiter=',', skip_header=1)\n", (230, 266), True, 'import numpy as np\n'), ((540, 552), 'numpy.mean', 'np.mean', (['age'], {}), '(age)\n', (547, 552), True, 'import numpy as np\n'), ((564, 575), 'num...
import os, pickle, json from collections import deque import numpy as np import tensorflow as tf import torch import torch.nn.functional as F from guacamol.distribution_matching_generator import DistributionMatchingGenerator from rdkit import Chem from torch.utils.data import DataLoader, Dataset from tqdm import tqdm ...
[ "torch.distributions.Categorical", "data.gen_targets.get_symbol_list", "torch.nn.functional.softmax", "numpy.mean", "os.listdir", "tensorflow.__version__.split", "collections.deque", "src.utils.set_seed_if", "tensorflow.Session", "rdkit.Chem.MolToSmiles", "src.utils.filter_top_k", "tensorflow....
[((639, 655), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (653, 655), True, 'import tensorflow as tf\n'), ((710, 735), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (720, 735), True, 'import tensorflow as tf\n'), ((24563, 24586), 'os.listdir', 'os.listdir', (['cp...
# Copyright 1999-2018 Alibaba Group Holding 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 a...
[ "operator.attrgetter", "numpy.isscalar", "numpy.asarray", "itertools.count", "numpy.empty", "numpy.cumsum", "numpy.dtype" ]
[((7440, 7454), 'numpy.isscalar', 'np.isscalar', (['v'], {}), '(v)\n', (7451, 7454), True, 'import numpy as np\n'), ((7642, 7656), 'numpy.isscalar', 'np.isscalar', (['v'], {}), '(v)\n', (7653, 7656), True, 'import numpy as np\n'), ((8465, 8479), 'numpy.isscalar', 'np.isscalar', (['v'], {}), '(v)\n', (8476, 8479), True,...
import numpy as np import mixem def logsumexp(X,axis=None,keepdims=1,log=1): ''' log( sum( exp(X) ) ) ''' xmax = np.max(X,axis=axis,keepdims=keepdims) y = np.exp(X-xmax) S = y.sum(axis=axis,keepdims=keepdims) if log: S = np.log(S) + xmax e...
[ "numpy.mean", "numpy.ones", "numpy.log", "numpy.max", "numpy.exp", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.empty", "numpy.isnan" ]
[((168, 207), 'numpy.max', 'np.max', (['X'], {'axis': 'axis', 'keepdims': 'keepdims'}), '(X, axis=axis, keepdims=keepdims)\n', (174, 207), True, 'import numpy as np\n'), ((214, 230), 'numpy.exp', 'np.exp', (['(X - xmax)'], {}), '(X - xmax)\n', (220, 230), True, 'import numpy as np\n'), ((1851, 1873), 'numpy.zeros', 'np...
""" ========== ISOMAP neighbours parameter CV pipeline ========== Use a pipeline to find the best neighbourhood size parameter for ISOMAP. Adapted from: http://scikit-learn.org/stable/auto_examples/decomposition/plot_kernel_pca.html#example-decomposition-plot-kernel-pca-py http://scikit-learn.org/stable/auto...
[ "sklearn.cluster.KMeans", "pickle.dump", "numpy.hstack", "numpy.arange", "sklearn.manifold.Isomap", "optparse.OptionParser", "extract_datasets.extract_labeled_chunkrange", "sklearn.metrics.make_scorer", "numpy.vstack", "numpy.random.seed", "numpy.nonzero", "sklearn.pipeline.Pipeline", "sklea...
[((807, 824), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (821, 824), True, 'import numpy as np\n'), ((861, 875), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (873, 875), False, 'from optparse import OptionParser\n'), ((1752, 1799), 'extract_datasets.extract_labeled_chunkrange', 'extrac...
import numpy as np a = np.arange(24).reshape(3, 2, 4) + 10 for val in a: print('item:', val) # N维枚举 for i, val in np.ndenumerate(a): if sum(i) % 5 == 0: print(i, val)
[ "numpy.ndenumerate", "numpy.arange" ]
[((120, 137), 'numpy.ndenumerate', 'np.ndenumerate', (['a'], {}), '(a)\n', (134, 137), True, 'import numpy as np\n'), ((24, 37), 'numpy.arange', 'np.arange', (['(24)'], {}), '(24)\n', (33, 37), True, 'import numpy as np\n')]
"""MCTS module: where MuZero thinks inside the tree.""" import math import random import numpy as np from xt.agent.muzero.default_config import PB_C_BASE, PB_C_INIT from xt.agent.muzero.default_config import ROOT_DIRICHLET_ALPHA from xt.agent.muzero.default_config import ROOT_EXPLORATION_FRACTION from xt.agent.muzer...
[ "xt.agent.muzero.util.soft_max_sample", "math.sqrt", "numpy.argmax", "math.log", "numpy.random.dirichlet", "xt.agent.muzero.util.MinMaxStats", "xt.agent.muzero.util.Node" ]
[((733, 750), 'xt.agent.muzero.util.MinMaxStats', 'MinMaxStats', (['None'], {}), '(None)\n', (744, 750), False, 'from xt.agent.muzero.util import MinMaxStats, Node, soft_max_sample\n'), ((1042, 1049), 'xt.agent.muzero.util.Node', 'Node', (['(0)'], {}), '(0)\n', (1046, 1049), False, 'from xt.agent.muzero.util import Min...
''' AUTHORS: NORSTRÖM, ARVID 19940206-3193, HISELIUS, LEO 9402214192 ''' from collections import namedtuple import numpy as np import gym import torch import matplotlib.pyplot as plt from tqdm import trange from DDPG_agent import RandomAgent, Critic, Actor from DDPG_agent import ExperienceReplayBuffer import...
[ "numpy.random.rand", "DDPG_agent.ExperienceReplayBuffer", "torch.nn.MSELoss", "numpy.array", "gym.make", "DDPG_agent.Actor", "numpy.eye", "collections.namedtuple", "numpy.ones", "torch.save", "tqdm.trange", "torch.device", "DDPG_agent.Critic", "numpy.copy", "torch.tensor", "numpy.zeros...
[((397, 433), 'gym.make', 'gym.make', (['"""LunarLanderContinuous-v2"""'], {}), "('LunarLanderContinuous-v2')\n", (405, 433), False, 'import gym\n'), ((525, 543), 'torch.device', 'torch.device', (['ddev'], {}), '(ddev)\n', (537, 543), False, 'import torch\n'), ((970, 1023), 'tqdm.trange', 'trange', (['self.N_episodes']...
import cv2 print(cv2.__version__) rows = int(input('Enter Number of ROWS: ')) columns = int(input('Enter Number of COLUMNS: ')) width = 1000 height = 1000 import numpy as np while True: frame = np.zeros([width,height,3],dtype=np.uint8) WhiteW = width // columns WhiteH = height // rows for i in range(0,r...
[ "numpy.zeros", "cv2.waitKey", "cv2.imshow" ]
[((198, 242), 'numpy.zeros', 'np.zeros', (['[width, height, 3]'], {'dtype': 'np.uint8'}), '([width, height, 3], dtype=np.uint8)\n', (206, 242), True, 'import numpy as np\n'), ((614, 643), 'cv2.imshow', 'cv2.imshow', (['"""myWindow"""', 'frame'], {}), "('myWindow', frame)\n", (624, 643), False, 'import cv2\n'), ((652, 6...