code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import ClientSide2 #custom package import numpy as np import argparse import json import os import ClassifierFunctions2 as cf from matplotlib import pyplot as plt from builtins import input # Initialize essential global variables #URL = "" #you'll need me to send you the link FAMILIES = ["triclinic","monoclin...
[ "json.load", "argparse.ArgumentParser", "ClassifierFunctions2.check_for_chemistry", "os.makedirs", "os.path.isdir", "os.walk", "os.path.exists", "ClassifierFunctions2.choose_peaks", "ClientSide2.Load_Profile", "numpy.max", "ClientSide2.Send_For_Classification", "ClientSide2.Find_Peaks", "os....
[((412, 452), 'os.path.join', 'os.path.join', (['"""Sessions"""', '"""session.json"""'], {}), "('Sessions', 'session.json')\n", (424, 452), False, 'import os\n'), ((844, 869), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (867, 869), False, 'import argparse\n'), ((3159, 3190), 'ClassifierFunct...
""" generator.py Generator for batch training on keras models """ import pandas as pd import os import numpy as np import boto3 import tensorflow as tf # print(tf.__version__) import keras from keras.models import Sequential from keras.layers import Dense, Embedding, LSTM, SpatialDropout1D, Bidirectional from ker...
[ "pandas.read_csv", "os.environ.update", "boto3.resource", "os.path.join", "numpy.random.shuffle" ]
[((798, 823), 'os.environ.update', 'os.environ.update', (['config'], {}), '(config)\n', (815, 823), False, 'import os\n'), ((3566, 3616), 'os.path.join', 'os.path.join', (['"""s3://"""', 'BUCKET_NAME', 'self.label_key'], {}), "('s3://', BUCKET_NAME, self.label_key)\n", (3578, 3616), False, 'import os\n'), ((3795, 3871)...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import numpy as np import tensorflow as tf from niftynet.layer import layer_util from niftynet.layer.base_layer import TrainableLayer from niftynet.layer.deconvolution import DeconvLayer from niftynet.utilities.util_common import look_up_o...
[ "tensorflow.batch_to_space", "tensorflow.unstack", "tensorflow.concat", "numpy.hstack", "niftynet.layer.layer_util.infer_spatial_rank", "tensorflow.tile", "tensorflow.expand_dims", "niftynet.layer.layer_util.expand_spatial_params", "numpy.prod" ]
[((1714, 1757), 'niftynet.layer.layer_util.infer_spatial_rank', 'layer_util.infer_spatial_rank', (['input_tensor'], {}), '(input_tensor)\n', (1743, 1757), False, 'from niftynet.layer import layer_util\n'), ((2257, 2321), 'niftynet.layer.layer_util.expand_spatial_params', 'layer_util.expand_spatial_params', (['self.kern...
import torch import matplotlib.pyplot as plt import numpy as np import argparse import pickle import os from torch.autograd import Variable from torchvision import transforms from build_vocab import Vocabulary from model import EncoderCNN, DecoderRNN from PIL import Image def main(args): # Image preprocessing...
[ "argparse.ArgumentParser", "torchvision.transforms.Scale", "torch.load", "numpy.asarray", "PIL.Image.open", "torchvision.transforms.ToTensor", "pickle.load", "torch.cuda.is_available", "torch.zeros", "torchvision.transforms.CenterCrop", "torchvision.transforms.Normalize", "model.EncoderCNN" ]
[((690, 717), 'model.EncoderCNN', 'EncoderCNN', (['args.embed_size'], {}), '(args.embed_size)\n', (700, 717), False, 'from model import EncoderCNN, DecoderRNN\n'), ((1106, 1128), 'PIL.Image.open', 'Image.open', (['args.image'], {}), '(args.image)\n', (1116, 1128), False, 'from PIL import Image\n'), ((1395, 1420), 'torc...
from __future__ import print_function import os import numpy as np import lasagne import gdal import random import sys def build_cnn(input_var=None,bands=None): network = lasagne.layers.InputLayer(shape=(None,bands,None,None),input_var=input_var) #Patch sizes varying between train-val and test networ...
[ "lasagne.layers.InputLayer", "numpy.concatenate", "random.shuffle", "gdal.Open", "lasagne.init.Normal", "numpy.ndarray", "os.listdir", "numpy.random.shuffle" ]
[((180, 259), 'lasagne.layers.InputLayer', 'lasagne.layers.InputLayer', ([], {'shape': '(None, bands, None, None)', 'input_var': 'input_var'}), '(shape=(None, bands, None, None), input_var=input_var)\n', (205, 259), False, 'import lasagne\n'), ((1476, 1492), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1486...
import os import torch import shutil import numpy as np import matplotlib.pyplot as plt from PIL import Image import math cmap = plt.cm.viridis def parse_command(): data_names = ['nyudepthv2'] from dataloaders.dataloader import MyDataloader modality_names = MyDataloader.modality_names import argpar...
[ "argparse.ArgumentParser", "numpy.hstack", "numpy.min", "numpy.max", "numpy.vstack" ]
[((336, 384), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""FastDepth"""'}), "(description='FastDepth')\n", (359, 384), False, 'import argparse\n'), ((2158, 2208), 'numpy.hstack', 'np.hstack', (['[rgb, depth_target_col, depth_pred_col]'], {}), '([rgb, depth_target_col, depth_pred_col])\...
"""Functions for ISCE software. This module has functions that facilitate running `ISCE software` (v2.1.0). Currently extensively uses external calls to GDAL command line scripts. Some functions borrow from example applications distributed with ISCE. .. _`ISCE software`: https://winsar.unavco.org/software/isce """ ...
[ "yaml.load", "matplotlib.pyplot.get_cmap", "matplotlib.colors.Normalize", "numpy.remainder", "matplotlib.cm.ScalarMappable", "os.path.dirname", "matplotlib.colors.LogNorm", "numpy.linspace" ]
[((3719, 3740), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['mapname'], {}), '(mapname)\n', (3731, 3740), True, 'import matplotlib.pyplot as plt\n'), ((3847, 3883), 'matplotlib.colors.LogNorm', 'colors.LogNorm', ([], {'vmin': 'vmin', 'vmax': 'vmax'}), '(vmin=vmin, vmax=vmax)\n', (3861, 3883), True, 'import matplotl...
import os import torch import numpy as np import imageio as m import cv2 import pandas as pd from torch.utils import data import json def recursive_glob(rootdir=".", suffix=""): """Performs recursive glob with given suffix and rootdir :param rootdir is the root directory :param suffix is the suffi...
[ "augmentations.RandomRotate", "os.walk", "augmentations.RandomHorizontallyFlip", "augmentations.AdjustContrast", "os.path.join", "numpy.unique", "torch.utils.data.DataLoader", "numpy.transpose", "augmentations.AdjustBrightness", "augmentations.Scale", "matplotlib.pyplot.subplots", "cv2.resize"...
[((6369, 6404), 'torch.utils.data.DataLoader', 'data.DataLoader', (['dst'], {'batch_size': 'bs'}), '(dst, batch_size=bs)\n', (6384, 6404), False, 'from torch.utils import data\n'), ((366, 398), 'os.path.join', 'os.path.join', (['looproot', 'filename'], {}), '(looproot, filename)\n', (378, 398), False, 'import os\n'), (...
#!/usr/bin/env python3 import os import unittest import copy import logging import shutil import random import importlib import pandas as pd import json import pytest from unittest.mock import patch from nibabel import Nifti1Image import numpy as np import nilearn.image import ciftify.bin.ciftify_clean_img as ciftif...
[ "pandas.DataFrame", "copy.deepcopy", "ciftify.bin.ciftify_clean_img.UserSettings", "numpy.allclose", "numpy.ones", "unittest.mock.patch", "logging.disable", "pytest.raises", "numpy.array", "ciftify.bin.ciftify_clean_img.clean_image_with_nilearn", "numpy.eye", "ciftify.bin.ciftify_clean_img.ima...
[((333, 366), 'logging.disable', 'logging.disable', (['logging.CRITICAL'], {}), '(logging.CRITICAL)\n', (348, 366), False, 'import logging\n'), ((14741, 14773), 'unittest.mock.patch', 'patch', (['"""nilearn.image.clean_img"""'], {}), "('nilearn.image.clean_img')\n", (14746, 14773), False, 'from unittest.mock import pat...
import gym from gym import error, spaces, utils from gym.utils import seeding # import cityflow import pandas as pd import os import numpy as np import json import math from gym.spaces import Discrete, Box class CityflowGymEnv(gym.Env): # metadata = {'render.modes': ['human']} def __init__(se...
[ "math.exp", "gym.spaces.Discrete", "numpy.zeros", "numpy.ones", "numpy.isnan", "numpy.reshape", "cityflow.Engine" ]
[((383, 478), 'cityflow.Engine', 'cityflow.Engine', (["self.config['cityflow_config_file']"], {'thread_num': "self.config['thread_num']"}), "(self.config['cityflow_config_file'], thread_num=self.config\n ['thread_num'])\n", (398, 478), False, 'import cityflow\n'), ((1415, 1444), 'numpy.zeros', 'np.zeros', (['[8, sel...
#!/usr/bin/python import sys import numpy as np from .ComponentBase import Component def Calzetti_ext(spectrum=None, parameters=None): if spectrum is None: raise Exception("Need a data spectrum") ext= [1.]*len(spectrum.spectral_axis) Rv = 4.05 for j in range(len(spectrum.spectral_axis)): ...
[ "numpy.random.uniform", "numpy.array", "sys.exit" ]
[((3470, 3483), 'numpy.array', 'np.array', (['ext'], {}), '(ext)\n', (3478, 3483), True, 'import numpy as np\n'), ((4248, 4290), 'numpy.array', 'np.array', (['(spectrum.spectral_axis / 10000.0)'], {}), '(spectrum.spectral_axis / 10000.0)\n', (4256, 4290), True, 'import numpy as np\n'), ((5533, 5587), 'numpy.random.unif...
""" Plot the posterior of mu vs g1 with outliers -------------------------------------------- Figure 5.17 The marginal joint distribution between mu and g_i, as given by eq. 5.100. The left panel shows a point identified as bad (:math:`\hat{g_i|} = 0`), while the right panel shows a point identified as good(:math:`\ha...
[ "matplotlib.pyplot.NullLocator", "numpy.random.seed", "matplotlib.pyplot.show", "numpy.log", "numpy.zeros", "scipy.stats.norm.pdf", "numpy.max", "astroML.plotting.setup_text_plots", "matplotlib.pyplot.figure", "numpy.linspace", "numpy.random.normal" ]
[((1196, 1237), 'astroML.plotting.setup_text_plots', 'setup_text_plots', ([], {'fontsize': '(8)', 'usetex': '(True)'}), '(fontsize=8, usetex=True)\n', (1212, 1237), False, 'from astroML.plotting import setup_text_plots\n'), ((1701, 1720), 'numpy.random.seed', 'np.random.seed', (['(138)'], {}), '(138)\n', (1715, 1720), ...
__copyright__ = "Copyright (c) 2020-2021 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" import os from pathlib import Path from typing import Dict, Tuple import numpy as np import pytest from image_tf_encoder import ImageTFEncoder from jina import Document, DocumentArray, Executor from PIL import I...
[ "jina.DocumentArray", "image_tf_encoder.ImageTFEncoder", "pytest.fixture", "numpy.ones", "pytest.raises", "pathlib.Path", "numpy.linalg.norm", "jina.Document", "numpy.random.rand", "pytest.mark.parametrize", "os.path.join" ]
[((368, 398), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (382, 398), False, 'import pytest\n'), ((463, 495), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (477, 495), False, 'import pytest\n'), ((961, 993), 'pytest.fixture'...
# Theory: Intro to NumPy import numpy as np # NumPy (short for Numerical Python) is a Python library # fundamental for scientific computing. It supports a variety of # high-level mathematical functions and is broadly used in data # science, machine learning, and big data applications. With its # help. you will be able ...
[ "numpy.array" ]
[((1307, 1332), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (1315, 1332), True, 'import numpy as np\n'), ((1749, 1780), 'numpy.array', 'np.array', (["['1', 2, [3], 4, [5]]"], {}), "(['1', 2, [3], 4, [5]])\n", (1757, 1780), True, 'import numpy as np\n'), ((2001, 2033), 'numpy.array', 'np...
import unittest import numpy as np from numpy.testing import assert_array_equal from audiomentations import Normalize, Compose class TestNormalize(unittest.TestCase): def test_normalize_positive_peak(self): samples = np.array([0.5, 0.6, -0.2, 0.0], dtype=np.float32) sample_rate = 16000 a...
[ "numpy.amin", "numpy.testing.assert_array_equal", "numpy.amax", "numpy.array", "audiomentations.Normalize" ]
[((233, 282), 'numpy.array', 'np.array', (['[0.5, 0.6, -0.2, 0.0]'], {'dtype': 'np.float32'}), '([0.5, 0.6, -0.2, 0.0], dtype=np.float32)\n', (241, 282), True, 'import numpy as np\n'), ((635, 684), 'numpy.array', 'np.array', (['[0.5, 0.6, -0.8, 0.0]'], {'dtype': 'np.float32'}), '([0.5, 0.6, -0.8, 0.0], dtype=np.float32...
# Atlas measurements and statistics # Author: <NAME>, 2019 """Low-level measurement of atlases and statistics generation. Typically applied to specific types of atlases and less generalizable than measurements in :module:`vols`. """ import os import numpy as np import pandas as pd from magmap.plot import colormaps f...
[ "numpy.isin", "numpy.sum", "magmap.io.df_io.print_data_frame", "pandas.read_csv", "magmap.atlas.ontology.load_labels_ref", "numpy.floor", "numpy.argsort", "magmap.io.df_io.normalize_df", "magmap.io.df_io.zscore_df", "numpy.unique", "numpy.zeros_like", "numpy.multiply", "magmap.io.export_stac...
[((1236, 1268), 'pandas.read_csv', 'pd.read_csv', (['config.filenames[1]'], {}), '(config.filenames[1])\n', (1247, 1268), True, 'import pandas as pd\n'), ((3359, 3414), 'magmap.io.df_io.print_data_frame', 'df_io.print_data_frame', (['df_base.loc[:, cols_show]', '"""\t"""'], {}), "(df_base.loc[:, cols_show], '\\t')\n", ...
#!/usr/bin/env python from math import pi, cos, sin import numpy as np import diagnostic_msgs import diagnostic_updater import roboclaw_driver.roboclaw_driver_new as roboclaw import rospy import tf from geometry_msgs.msg import Quaternion, Twist from nav_msgs.msg import Odometry import sys __author__ = "<EMAIL> (<NA...
[ "rospy.logerr", "rospy.Subscriber", "roboclaw_driver.roboclaw_driver_new.Open", "roboclaw_driver.roboclaw_driver_new.ReadError", "rospy.logwarn", "roboclaw_driver.roboclaw_driver_new.ReadMainBatteryVoltage", "roboclaw_driver.roboclaw_driver_new.ReadTemp2", "rospy.Time.now", "rospy.Rate", "rospy.si...
[((487, 512), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (495, 512), True, 'import numpy as np\n'), ((533, 563), 'numpy.array', 'np.array', (['[[0], [0], [0], [0]]'], {}), '([[0], [0], [0], [0]])\n', (541, 563), True, 'import numpy as np\n'), ((21544, 21568), 'rospy.loginfo', 'rospy.lo...
import numpy as np from scipy.integrate import odeint from bokeh.plotting import figure, show, output_file sigma = 10 rho = 28 beta = 8.0/3 theta = 3 * np.pi / 4 def lorenz(xyz, t): x, y, z = xyz x_dot = sigma * (y - x) y_dot = x * rho - x * z - y z_dot = x * y - beta* z return [x_dot, y_dot, z_d...
[ "bokeh.plotting.figure", "scipy.integrate.odeint", "bokeh.plotting.output_file", "numpy.sin", "numpy.arange", "bokeh.plotting.show", "numpy.cos", "numpy.array_split" ]
[((353, 377), 'numpy.arange', 'np.arange', (['(0)', '(100)', '(0.006)'], {}), '(0, 100, 0.006)\n', (362, 377), True, 'import numpy as np\n'), ((390, 416), 'scipy.integrate.odeint', 'odeint', (['lorenz', 'initial', 't'], {}), '(lorenz, initial, t)\n', (396, 416), False, 'from scipy.integrate import odeint\n'), ((612, 66...
import numpy as np from active_reward_learning.util.helpers import ( argmax_over_index_set, get_deterministic_policy_matrix, jaccard_index, mean_jaccard_distance, ) def test_argmax_over_index_set(): l = [0, 1, 1.5, 2, 3, 3.5, 4] idx = [0, 1, 2] assert argmax_over_index_set(l, idx) == [2] ...
[ "active_reward_learning.util.helpers.get_deterministic_policy_matrix", "active_reward_learning.util.helpers.jaccard_index", "active_reward_learning.util.helpers.argmax_over_index_set", "active_reward_learning.util.helpers.mean_jaccard_distance", "numpy.array", "numpy.all" ]
[((556, 607), 'active_reward_learning.util.helpers.get_deterministic_policy_matrix', 'get_deterministic_policy_matrix', (['[0, 0, 3, 4, 2]', '(5)'], {}), '([0, 0, 3, 4, 2], 5)\n', (587, 607), False, 'from active_reward_learning.util.helpers import argmax_over_index_set, get_deterministic_policy_matrix, jaccard_index, m...
import numpy as np import random import copy # Adding Hardcoding of the Geometric Plotting Order, Identity, and Axis Location # Order to Plot (Probe Channel Name) all_chan_map = {'z007': [2, 1, 10, 9, 18, 17, 4, 3, 12, 11, 20, 19, 5, 6, 13, 14, 21, 22, 7, 8, 15, 16, 23, 24, 29, 30, 31, 32, 25,...
[ "copy.deepcopy", "numpy.zeros", "numpy.unique", "random.seed" ]
[((3612, 3635), 'numpy.zeros', 'np.zeros', (['(num_labels,)'], {}), '((num_labels,))\n', (3620, 3635), True, 'import numpy as np\n'), ((2812, 2838), 'copy.deepcopy', 'copy.deepcopy', (['neural_data'], {}), '(neural_data)\n', (2825, 2838), False, 'import copy\n'), ((3056, 3078), 'numpy.unique', 'np.unique', (['group_siz...
import os import time import random import numpy as np import os.path as osp import tensorflow as tf from baselines import logger from collections import deque from baselines.common import explained_variance from baselines.common.runners import AbstractEnvRunner from copy import deepcopy from ppo2ttifrutti_policies imp...
[ "tensorflow.get_default_session", "tensorflow.clip_by_value", "tensorflow.trainable_variables", "ppo2ttifrutti_policies.filmInit", "tensorflow.maximum", "random.sample", "numpy.mean", "numpy.arange", "numpy.tile", "numpy.ndarray", "tensorflow.clip_by_global_norm", "collections.deque", "os.pa...
[((757, 772), 'numpy.ndindex', 'np.ndindex', (['shp'], {}), '(shp)\n', (767, 772), True, 'import numpy as np\n'), ((10871, 10908), 'baselines.logger.configure', 'logger.configure', (["(log_path + 'model/')"], {}), "(log_path + 'model/')\n", (10887, 10908), False, 'from baselines import logger\n'), ((11716, 11733), 'col...
import numpy as np from scipy.signal import freqz import spectrum from koe_acoustic_features.extractor import Extractor from koe_acoustic_features.utils import get_sig, unroll_args, _cached_get_window, split_segments class LinearPredictionExtractor(Extractor): def lpc_spectrum(self): sig = get_sig(self....
[ "koe_acoustic_features.utils.split_segments", "numpy.zeros", "koe_acoustic_features.utils._cached_get_window", "numpy.array", "koe_acoustic_features.utils.get_sig", "koe_acoustic_features.utils.unroll_args", "spectrum.lpc" ]
[((2398, 2422), 'spectrum.lpc', 'spectrum.lpc', (['sig', 'order'], {}), '(sig, order)\n', (2410, 2422), False, 'import spectrum\n'), ((2637, 2661), 'spectrum.lpc', 'spectrum.lpc', (['sig', 'order'], {}), '(sig, order)\n', (2649, 2661), False, 'import spectrum\n'), ((2996, 3020), 'spectrum.lpc', 'spectrum.lpc', (['sig',...
# coding:utf-8 # This file is part of Alkemiems. # # Alkemiems is free software: you can redistribute it and/or modify # it under the terms of the MIT License. __author__ = '<NAME>' __version__ = 1.0 __maintainer__ = '<NAME>' __email__ = "<EMAIL>" __date__ = '2021/05/25 09:01:54' import numpy as n...
[ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "os.path.join", "matplotlib.pyplot.figure", "numpy.mean", "numpy.array", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((446, 458), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (456, 458), True, 'import matplotlib.pyplot as plt\n'), ((1119, 1141), 'numpy.mean', 'np.mean', (['ytrain[3000:]'], {}), '(ytrain[3000:])\n', (1126, 1141), True, 'import numpy as np\n'), ((1165, 1186), 'numpy.mean', 'np.mean', (['ytest[3000:]'], ...
# -*- coding: utf-8 -*- from scipy import signal import numpy as np import matplotlib.pyplot as plt fig_path = "/Users/gabriel/Documents/Research/USGS_Work/gmprocess/figs/spectra/" #%% def get_fft(series, fs, nfft): ft = np.fft.fft(series,fs) freq = np.fft.fftfreq(nfft) return freq, ft def get_ifft(se...
[ "matplotlib.pyplot.title", "numpy.fft.ifft", "numpy.random.seed", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.fft.fft", "matplotlib.pyplot.legend", "numpy.fft.fftfreq", "numpy.sin", "numpy.arange", "matplotlib.pyplot.gca", "matplotlib.pyplot.semilogy", "matplotlib.pyplot.semil...
[((746, 763), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (760, 763), True, 'import numpy as np\n'), ((801, 824), 'numpy.arange', 'np.arange', (['(0)', '(70)', 'delta'], {}), '(0, 70, delta)\n', (810, 824), True, 'import numpy as np\n'), ((871, 895), 'numpy.arange', 'np.arange', (['(0)', '(256)', 'de...
import os import numpy as np import torch import matplotlib.pyplot as plt from glob import glob from models.regressors import VGGToHist from utilities.images import load_images from tqdm import tqdm from models.latent_optimizer import VGGFaceProcessing from models.vgg_face2 import resnet50_scratch_dag def generate_vg...
[ "matplotlib.pyplot.title", "numpy.load", "models.regressors.VGGToHist", "os.path.isfile", "glob.glob", "torch.no_grad", "torch.nn.MSELoss", "torch.utils.data.DataLoader", "matplotlib.pyplot.close", "torch.zeros", "numpy.save", "models.latent_optimizer.VGGFaceProcessing", "os.path.basename", ...
[((3610, 3639), 'numpy.load', 'np.load', (["(directory + 'wp.npy')"], {}), "(directory + 'wp.npy')\n", (3617, 3639), True, 'import numpy as np\n'), ((3790, 3814), 'numpy.array', 'np.array', (['final_dlatents'], {}), '(final_dlatents)\n', (3798, 3814), True, 'import numpy as np\n'), ((4026, 4051), 'os.path.isfile', 'os....
#!/usr/bin/env python3 # # collect_accuracies_with_sdev.py: collects accuracies and standard # deviations of all graph kernels from a large CSV file, and stores # them in single files (one per data set). import os import argparse import numpy as np import pandas as pd if __name__ == '__main__': parser = argpars...
[ "argparse.ArgumentParser", "os.makedirs", "pandas.read_csv", "numpy.savetxt", "os.path.exists", "numpy.array" ]
[((313, 338), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (336, 338), False, 'import argparse\n'), ((442, 487), 'pandas.read_csv', 'pd.read_csv', (['args.FILE'], {'header': '(0)', 'index_col': '(0)'}), '(args.FILE, header=0, index_col=0)\n', (453, 487), True, 'import pandas as pd\n'), ((925,...
# Copyright 2021, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ "absl.testing.absltest.main", "tensorflow.ones", "tensorflow_federated.python.program.test_utils.TestMaterializableValueReference", "numpy.str_", "numpy.ones", "tensorflow.constant", "tensorflow_federated.python.program.memory_release_manager.MemoryReleaseManager", "tensorflow.data.Dataset.from_tensor...
[((3664, 3756), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["('none', None)", "('bool', True)", "('int', 1)", "('str', 'a')"], {}), "(('none', None), ('bool', True), ('int', 1),\n ('str', 'a'))\n", (3694, 3756), False, 'from absl.testing import parameterized\n'), ((4344, 4406),...
# # Copyright The NOMAD Authors. # # This file is part of NOMAD. See https://nomad-lab.eu for further info. # # 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/licen...
[ "nomad.datamodel.EntryArchive", "pytest.fixture", "numpy.shape", "pytest.approx", "atomisticparsers.lammps.LammpsParser" ]
[((872, 902), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (886, 902), False, 'import pytest\n'), ((830, 868), 'pytest.approx', 'pytest.approx', (['value'], {'abs': 'abs', 'rel': 'rel'}), '(value, abs=abs, rel=rel)\n', (843, 868), False, 'import pytest\n'), ((928, 942), 'at...
# Copyright 2019 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...
[ "mindarmour.utils._check_param.check_value_non_negative", "numpy.sum", "numpy.argmax", "numpy.logspace", "numpy.clip", "numpy.argmin", "numpy.shape", "numpy.mean", "numpy.arange", "mindarmour.utils._check_param.check_pair_numpy_param", "numpy.linalg.norm", "numpy.prod", "mindarmour.utils._ch...
[((952, 974), 'mindarmour.utils.logger.LogUtil.get_instance', 'LogUtil.get_instance', ([], {}), '()\n', (972, 974), False, 'from mindarmour.utils.logger import LogUtil\n'), ((1144, 1178), 'numpy.clip', 'np.clip', (['image', 'clip_min', 'clip_max'], {}), '(image, clip_min, clip_max)\n', (1151, 1178), True, 'import numpy...
""" EEE511 team assignment 01 - team 03 LMS prediction: Data from the Mackey-Glass delay differential equation source: https://github.com/manu-mannattil/nolitsa """ import numpy as np import matplotlib.pyplot as plt import os.path as osp import os def mackey_glass(length=5000, x0=None, a=0.2, b=0.1, c=10.0, tau=23...
[ "os.makedirs", "numpy.empty", "os.path.exists", "numpy.random.random", "os.path.join" ]
[((2038, 2053), 'numpy.empty', 'np.empty', (['grids'], {}), '(grids)\n', (2046, 2053), True, 'import numpy as np\n'), ((2544, 2564), 'os.path.exists', 'osp.exists', (['data_dir'], {}), '(data_dir)\n', (2554, 2564), True, 'import os.path as osp\n'), ((2574, 2595), 'os.makedirs', 'os.makedirs', (['data_dir'], {}), '(data...
#!/usr/bin/env python3 """ A collection of functions used by ciftifies report generation functions i.e. ciftify_peaktable and ciftify_dlabel_report """ import os from ciftify.utils import run import ciftify.config import numpy as np import pandas as pd import logging import logging.config def define_atlas_settings()...
[ "pandas.DataFrame.from_dict", "ciftify.utils.run", "numpy.where", "numpy.intersect1d", "logging.getLogger" ]
[((5426, 5464), 'numpy.intersect1d', 'np.intersect1d', (['label1_idx', 'label2_idx'], {}), '(label1_idx, label2_idx)\n', (5440, 5464), True, 'import numpy as np\n'), ((6407, 6464), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['clust_atlas2_dict'], {'orient': '"""index"""'}), "(clust_atlas2_dict, orient='in...
import numpy as np import cv2 import torchvision import torchvision.transforms as transforms from torch import autograd from torch.autograd import Variable from torch.utils.data import TensorDataset, DataLoader,Dataset from torchvision.datasets import ImageFolder import albumentations as albu from albumentations import...
[ "torch.autograd.grad", "torch.autograd.Variable", "numpy.ones", "torchvision.transforms.ToTensor", "torchvision.datasets.ImageFolder", "numpy.mean", "numpy.array", "numpy.random.random", "torchvision.transforms.CenterCrop", "albumentations.HorizontalFlip", "libs.custom_transforms.PadDifferentlyI...
[((3259, 3354), 'torchvision.datasets.ImageFolder', 'torchvision.datasets.ImageFolder', ([], {'root': '"""./images_LR/Expert-C/Testing/"""', 'transform': 'transform'}), "(root='./images_LR/Expert-C/Testing/',\n transform=transform)\n", (3291, 3354), False, 'import torchvision\n'), ((3371, 3468), 'torchvision.dataset...
import os import numpy as np import pytest import torch from skimage.metrics import structural_similarity as ski_ssim import ignite.distributed as idist from ignite.exceptions import NotComputableError from ignite.metrics import SSIM def test_zero_div(): ssim = SSIM(data_range=1.0) with pytest.raises(NotCom...
[ "ignite.distributed.get_rank", "ignite.distributed.device", "numpy.allclose", "torch.cat", "ignite.distributed.get_world_size", "torch.cuda.device_count", "ignite.engine.Engine", "pytest.raises", "skimage.metrics.structural_similarity", "pytest.mark.skipif", "ignite.metrics.SSIM", "torch.cuda....
[((2416, 2572), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""shape, kernel_size, gaussian, use_sample_covariance"""', '[[(8, 3, 224, 224), 7, False, True], [(12, 3, 28, 28), 11, True, False]]'], {}), "('shape, kernel_size, gaussian, use_sample_covariance',\n [[(8, 3, 224, 224), 7, False, True], [(12, ...
import os import warnings os.environ['CUDA_VISIBLE_DEVICES'] = '3' warnings.filterwarnings('ignore') import tensorflow as tf import malaya_speech.augmentation.waveform as augmentation from malaya_speech.train.model import super_res from malaya_speech.train.model import enhancement import malaya_speech import malaya_s...
[ "numpy.abs", "tensorflow.identity", "random.shuffle", "malaya_speech.augmentation.waveform.random_sampling", "tensorflow.train.LoggingTensorHook", "numpy.isnan", "malaya_speech.train.model.enhancement.loss.snr", "glob.glob", "itertools.cycle", "random.randint", "malaya_speech.train.model.enhance...
[((68, 101), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (91, 101), False, 'import warnings\n'), ((505, 527), 'numpy.seterr', 'np.seterr', ([], {'all': '"""raise"""'}), "(all='raise')\n", (514, 527), True, 'import numpy as np\n'), ((1003, 1037), 'glob.glob', 'glob', (['...
""" Train a neural network on the given dataset with given configuration """ import numpy as np np.random.seed(12345) import tensorflow as tf tf.random.set_seed(12345) import random random.seed(12345) import argparse import math import re import sys import traceback from tensorflow.keras import Input, Model from te...
[ "tensorflow.random.set_seed", "numpy.absolute", "numpy.random.seed", "argparse.ArgumentParser", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "numpy.argmax", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.models.Model", "re.findall", "random.seed", "tenso...
[((98, 119), 'numpy.random.seed', 'np.random.seed', (['(12345)'], {}), '(12345)\n', (112, 119), True, 'import numpy as np\n'), ((144, 169), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(12345)'], {}), '(12345)\n', (162, 169), True, 'import tensorflow as tf\n'), ((184, 202), 'random.seed', 'random.seed', (['(1...
# Copyright 2021-2022 NVIDIA Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
[ "numpy.array_equal", "itertools.permutations" ]
[((815, 838), 'itertools.permutations', 'permutations', (['(3, 4, 5)'], {}), '((3, 4, 5))\n', (827, 838), False, 'from itertools import permutations\n'), ((1036, 1066), 'numpy.array_equal', 'np.array_equal', (['np_res', 'cn_res'], {}), '(np_res, cn_res)\n', (1050, 1066), True, 'import numpy as np\n')]
import torch.nn as nn import torch from torch.optim import Adam, SGD import numpy as np import matplotlib.pyplot as plot class ODE_LSTM(nn.Module): def __init__(self, steps, input_size, hidden_size, num_layers): super().__init__() self.steps = steps self.en = nn.LSTM(input_size=input_siz...
[ "torch.nn.MSELoss", "matplotlib.pyplot.savefig", "torch.no_grad", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "numpy.zeros", "numpy.array", "torch.nn.SELU", "numpy.arange", "torch.nn.Linear", "torch.zeros", "torch.nn.LSTM", "torch.sum", "torch.tensor" ]
[((1213, 1247), 'torch.nn.MSELoss', 'torch.nn.MSELoss', ([], {'reduction': '"""none"""'}), "(reduction='none')\n", (1229, 1247), False, 'import torch\n'), ((1865, 1886), 'numpy.array', 'np.array', (['[series[0]]'], {}), '([series[0]])\n', (1873, 1886), True, 'import numpy as np\n'), ((1895, 1918), 'numpy.zeros', 'np.ze...
import numpy as np import math import cmath import scipy import scipy.linalg import scipy.integrate import sys import tqdm import warnings h = 1.0 hbar = h / (2.0 * np.pi) ZERO_TOLERANCE = 10**-4 MAX_VIBRATIONAL_STATES = 75 MAX_FREQ_TIME_SCALE_DT = 18 STARTING_NUMBER_VIBRATIONAL_STATES = 12 NUMBER_ELECTRONIC_STAT...
[ "numpy.abs", "numpy.sin", "numpy.exp", "numpy.fft.fft", "numpy.cumsum", "numpy.fft.fftfreq", "numpy.linalg.det", "numpy.conj", "numpy.fill_diagonal", "math.sqrt", "math.ceil", "numpy.cos", "numpy.dot", "scipy.linalg.expm", "numpy.zeros", "scipy.integrate.complex_ode", "numpy.array", ...
[((1344, 1418), 'numpy.zeros', 'np.zeros', (['(self.number_vibrational_states, self.number_vibrational_states)'], {}), '((self.number_vibrational_states, self.number_vibrational_states))\n', (1352, 1418), True, 'import numpy as np\n'), ((1541, 1570), 'numpy.fill_diagonal', 'np.fill_diagonal', (['output', '(1.0)'], {}),...
#!/usr/bin/env python import sys import argparse import scipy.cluster.vq as vq import numpy from traj import trajimport from traj import trajnorm from traj import trajfeat from traj import boof from traj import spatialpyramid NORM_ARGS = ["flip", "slope", "resample", "slant", "height", "origin"] FEAT_ARGS = ["dir",...
[ "traj.trajnorm.normalize_trajectory", "traj.boof.BoofGenerator", "argparse.ArgumentParser", "traj.trajimport.read_trajectory_from_file", "scipy.cluster.vq.vq", "numpy.savetxt", "traj.trajimport.read_traj_clusters", "traj.trajfeat.calculate_feature_vector_sequence", "traj.spatialpyramid.SpatialPyrami...
[((584, 630), 'traj.trajimport.read_trajectory_from_file', 'trajimport.read_trajectory_from_file', (['filename'], {}), '(filename)\n', (620, 630), False, 'from traj import trajimport\n'), ((898, 957), 'traj.trajfeat.calculate_feature_vector_sequence', 'trajfeat.calculate_feature_vector_sequence', (['traj', 'FEAT_ARGS']...
# -*- coding: utf-8 -*- # # JSON osu! map analysis (for osu!mania) # import numpy as np; def get_map_timing_array(map_json, length=-1, divisor=4): if length == -1: length = map_json["obj"][-1]["time"] + 1000; # it has an extra time interval after the last note if map_json["obj"][-1]["type"] & 8: ...
[ "numpy.sum", "numpy.floor", "numpy.zeros", "numpy.expand_dims", "numpy.array", "numpy.arange", "numpy.concatenate" ]
[((2277, 2346), 'numpy.arange', 'np.arange', (["uts['beginTime']", 'endtimes[i]', "(uts['tickLength'] / divisor)"], {}), "(uts['beginTime'], endtimes[i], uts['tickLength'] / divisor)\n", (2286, 2346), True, 'import numpy as np\n'), ((2891, 2921), 'numpy.concatenate', 'np.concatenate', (['ticks_from_uts'], {}), '(ticks_...
import os import torch import pickle as pkl import torch.nn as nn import numpy as np torch.manual_seed(2020) embeds = nn.Embedding(35, 300) print(embeds.weight) save_path = './' param_path = os.path.join(save_path, 'PETA_word2vec.pkl') with open(param_path, 'wb') as f: # npembeds = np.array(embeds.weight) npe...
[ "pickle.dump", "numpy.set_printoptions", "torch.manual_seed", "torch.nn.Embedding", "pickle.load", "os.path.join" ]
[((86, 109), 'torch.manual_seed', 'torch.manual_seed', (['(2020)'], {}), '(2020)\n', (103, 109), False, 'import torch\n'), ((119, 140), 'torch.nn.Embedding', 'nn.Embedding', (['(35)', '(300)'], {}), '(35, 300)\n', (131, 140), True, 'import torch.nn as nn\n'), ((193, 237), 'os.path.join', 'os.path.join', (['save_path', ...
#!/usr/bin/env python from unityagents import UnityEnvironment import numpy as np import os os.chdir(os.path.dirname(__file__)) env = UnityEnvironment(file_name='../../unity/Reacher_Linux_NoVis/Reacher.x86_64') # env = UnityEnvironment(file_name='./unity/Reacher_One_Linux_NoVis/Reacher_One_Linux_NoVis.x86_64') # env...
[ "numpy.random.randn", "os.path.dirname", "numpy.zeros", "numpy.clip", "numpy.any", "numpy.mean", "unityagents.UnityEnvironment" ]
[((137, 213), 'unityagents.UnityEnvironment', 'UnityEnvironment', ([], {'file_name': '"""../../unity/Reacher_Linux_NoVis/Reacher.x86_64"""'}), "(file_name='../../unity/Reacher_Linux_NoVis/Reacher.x86_64')\n", (153, 213), False, 'from unityagents import UnityEnvironment\n'), ((1215, 1235), 'numpy.zeros', 'np.zeros', (['...
from .setup_helpers.env import (IS_64BIT, IS_DARWIN, IS_WINDOWS, DEBUG, REL_WITH_DEB_INFO, USE_MKLDNN, check_env_flag, check_negative_env_flag) import os import sys import distutils import distutils.sysconfig from subprocess import check_call, check_outpu...
[ "os.remove", "os.environ.copy", "os.path.isfile", "pprint.pprint", "glob.glob", "distutils._msvccompiler._get_vc_env", "os.utime", "os.path.join", "subprocess.check_call", "multiprocessing.cpu_count", "os.path.abspath", "distutils.sysconfig.get_python_inc", "os.path.exists", "numpy.get_inc...
[((2872, 2892), 'distutils._msvccompiler._get_vc_env', '_get_vc_env', (['vc_arch'], {}), '(vc_arch)\n', (2883, 2892), False, 'from distutils._msvccompiler import _get_vc_env\n'), ((3352, 3369), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (3367, 3369), False, 'import os\n'), ((4720, 4744), 'os.getenv', 'os.g...
import matplotlib.pyplot as plt import matplotlib.lines as mlines import matplotlib.patches as mpatches import numpy as np from .graph_utils import vertex_by_token_position def show_relation_graph(g): """ Displays the relation graph using matplotlib. :param g: input graph. """ if "vertexSet" no...
[ "matplotlib.pyplot.show", "numpy.average", "matplotlib.lines.Line2D", "matplotlib.pyplot.axis", "matplotlib.patches.Circle", "matplotlib.pyplot.text", "numpy.sin", "numpy.cos", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplots" ]
[((622, 636), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (634, 636), True, 'import matplotlib.pyplot as plt\n'), ((2140, 2193), 'matplotlib.pyplot.subplots_adjust', 'plt.subplots_adjust', ([], {'left': '(0)', 'right': '(1)', 'bottom': '(0)', 'top': '(1)'}), '(left=0, right=1, bottom=0, top=1)\n', (...
from matplotlib import pyplot as plt import numpy as np import codecs import argparse parse = argparse.ArgumentParser() parse.add_argument('-same', nargs='+', help='translations') parse.add_argument('-b', type=int, default=5, help='#bins') parse.add_argument('-gap', type=int, default=10, help='bin width') parse.add_a...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "argparse.ArgumentParser", "codecs.open", "matplotlib.pyplot.legend", "numpy.asarray", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((96, 121), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (119, 121), False, 'import argparse\n'), ((1549, 1571), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Position"""'], {}), "('Position')\n", (1559, 1571), True, 'from matplotlib import pyplot as plt\n'), ((1572, 1594), 'matplotlib.pyp...
import argparse from tqdm import tqdm import numpy as np import torch import torch.nn as nn import torch.optim from torch.utils.data import DataLoader from prototree.prototree import ProtoTree from util.log import Log @torch.no_grad() def eval(tree: ProtoTree, test_loader: DataLoader, ...
[ "torch.mean", "torch.eq", "numpy.sum", "torch.stack", "torch.argmax", "numpy.zeros", "torch.no_grad" ]
[((236, 251), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (249, 251), False, 'import torch\n'), ((2290, 2305), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2303, 2305), False, 'import torch\n'), ((4479, 4494), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4492, 4494), False, 'import torch\n'), ((...
import unittest import numpy as np from numpy.testing import assert_array_equal from sklearn.metrics import pairwise_distances, pairwise_distances_argmin_min from okzm.okzm import OnlineKZMed, _trivial_k_median from utils import debug_print class TestOKZM(unittest.TestCase): def test_trivial_k_median(self): ...
[ "unittest.main", "sklearn.metrics.pairwise_distances_argmin_min", "numpy.abs", "numpy.random.randn", "sklearn.metrics.pairwise_distances", "numpy.testing.assert_array_equal", "numpy.logical_not", "okzm.okzm._trivial_k_median", "numpy.identity", "numpy.sort", "numpy.where", "numpy.array", "nu...
[((8205, 8220), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8218, 8220), False, 'import unittest\n'), ((328, 350), 'numpy.random.randn', 'np.random.randn', (['(10)', '(2)'], {}), '(10, 2)\n', (343, 350), True, 'import numpy as np\n'), ((364, 385), 'numpy.random.randn', 'np.random.randn', (['(5)', '(2)'], {}), ...
#!/usr/bin/env python u""" mar_extrap_mean.py Written by <NAME> (01/2021) Interpolates mean MAR products to times and coordinates Uses fast nearest-neighbor search algorithms https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.BallTree.html https://scikit-learn.org/stable/modules/generated/sklearn.neig...
[ "numpy.sum", "os.path.join", "numpy.ceil", "numpy.zeros", "pyproj.CRS.from_string", "numpy.ones", "numpy.ndim", "numpy.nonzero", "numpy.isnan", "sklearn.neighbors.BallTree", "numpy.array", "pyproj.Transformer.from_crs", "numpy.squeeze", "numpy.ma.zeros", "sklearn.neighbors.KDTree", "os...
[((3325, 3369), 'numpy.ma.zeros', 'np.ma.zeros', (['(ny, nx)'], {'fill_value': 'FILL_VALUE'}), '((ny, nx), fill_value=FILL_VALUE)\n', (3336, 3369), True, 'import numpy as np\n'), ((3392, 3422), 'numpy.zeros', 'np.zeros', (['(ny, nx)'], {'dtype': 'bool'}), '((ny, nx), dtype=bool)\n', (3400, 3422), True, 'import numpy as...
import numpy as np def clip(a, min_value, max_value): return min(max(a, min_value), max_value) def compute(array_1, array_2, a, b, c): """ This function must implement the formula np.clip(array_1, 2, 10) * a + array_2 * b + c array_1 and array_2 are 2D. """ x_max = array_1.shape[0] ...
[ "numpy.zeros" ]
[((402, 447), 'numpy.zeros', 'np.zeros', (['(x_max, y_max)'], {'dtype': 'array_1.dtype'}), '((x_max, y_max), dtype=array_1.dtype)\n', (410, 447), True, 'import numpy as np\n')]
import numpy as np import matplotlib.pyplot as plt import cv2 import os from keras import backend as K from tqdm.keras import TqdmCallback from scipy.stats import spearmanr from tensorflow.keras import Input from tensorflow.keras import optimizers from tensorflow.keras import models from tensorflow.keras imp...
[ "keras.models.load_model", "numpy.load", "numpy.abs", "argparse.ArgumentParser", "tensorflow.keras.layers.Dense", "numpy.mean", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.Flatten", "numpy.max", "tensorflow.keras.layers.Activation", "tensorflow.keras.optimizers.Adam", "numpy...
[((1390, 1422), 'tensorflow.keras.backend.clear_session', 'tf.keras.backend.clear_session', ([], {}), '()\n', (1420, 1422), True, 'import tensorflow as tf\n'), ((1437, 1448), 'time.time', 'time.time', ([], {}), '()\n', (1446, 1448), False, 'import time\n'), ((2961, 2980), 'tensorflow.keras.models.Sequential', 'models.S...
from __future__ import absolute_import import tensorflow as tf from tensorflow.python.keras import backend as K from tensorflow.keras.constraints import Constraint from tensorflow.keras.initializers import Initializer import tensorflow.keras as keras import numpy as np from .core import Ball, Box, Vertex, F_FORWARD, F_...
[ "tensorflow.python.keras.backend.abs", "tensorflow.python.keras.backend.maximum", "tensorflow.python.keras.backend.permute_dimensions", "tensorflow.python.keras.backend.sum", "tensorflow.split", "tensorflow.keras.activations.get", "tensorflow.python.keras.backend.log", "tensorflow.python.keras.backend...
[((2859, 2880), 'tensorflow.python.keras.backend.maximum', 'K.maximum', (['w', 'z_value'], {}), '(w, z_value)\n', (2868, 2880), True, 'from tensorflow.python.keras import backend as K\n'), ((2893, 2914), 'tensorflow.python.keras.backend.minimum', 'K.minimum', (['w', 'z_value'], {}), '(w, z_value)\n', (2902, 2914), True...
import os import logging import numpy as np from ..common.utils import ( logger, InstanceList, Timer, append_instance_lists, cbind, rbind, append, matrix, read_data_as_matrix, get_sample_feature_ranges, configure_logger ) from ..common.metrics import fn_auc from .aad_globals import ( STREAM_RETENTION_OVERWR...
[ "numpy.random.seed", "numpy.random.shuffle", "numpy.copy", "numpy.sum", "numpy.zeros", "numpy.random.RandomState", "numpy.cumsum", "os.path.isfile", "numpy.where", "numpy.append", "numpy.arange", "numpy.array", "numpy.mean", "logging.getLogger", "numpy.sqrt" ]
[((36136, 36211), 'numpy.random.RandomState', 'np.random.RandomState', (['(opts.randseed + opts.fid * opts.reruns + opts.runidx)'], {}), '(opts.randseed + opts.fid * opts.reruns + opts.runidx)\n', (36157, 36211), True, 'import numpy as np\n'), ((39299, 39326), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}...
# Time-stamp: <2017-08-10> '''Module for calculating the Wilcoxon-score and p value for each unique TF Copyright (c) 2017, 2018 <NAME>, <NAME> <<EMAIL>> This code is free software; you can redistribute it and/or modify it under the terms of the BSD License. @status: release candidate @version: $Id$ @author: <NAME>...
[ "pandas.DataFrame", "matplotlib.pyplot.xlim", "scipy.special.binom", "os.makedirs", "matplotlib.pyplot.plot", "scipy.stats.ranksums", "pandas.read_csv", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "numpy.floor", "matplotlib.pyplot.axes", "numpy.log", "matplotlib.pyplot.figure", ...
[((504, 525), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (518, 525), False, 'import matplotlib\n'), ((1400, 1430), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(2.6, 2.6)'}), '(figsize=(2.6, 2.6))\n', (1410, 1430), True, 'import matplotlib.pyplot as plt\n'), ((2753, 2866), 'mat...
# Copyright (c) 2016,2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Tests for the `wx_symbols` module.""" import numpy as np from metpy.plots import current_weather, wx_code_to_numeric from metpy.testing import assert_array_equal def test_...
[ "metpy.plots.current_weather.alt_char", "metpy.plots.wx_code_to_numeric", "numpy.array", "metpy.plots.current_weather", "metpy.testing.assert_array_equal" ]
[((1666, 1959), 'numpy.array', 'np.array', (['[73, 61, 85, 80, 53, 63, 86, 95, 66, 71, 95, 68, 75, 45, 83, 51, 81, 66, 95,\n 0, 79, 79, 95, 79, 65, 79, 36, 85, 97, 17, 79, 79, 80, 77, 95, 77, 78, \n 4, 79, 95, 95, 85, 81, 95, 67, 95, 56, 97, 95, 95, 69, 71, 79, 66, 79, \n 61, 95, 67, 97, 95, 0, 63, 17, 17, 0, ...
import os import cv2 import numpy as np import shutil import scipy.misc import glob import pickle5 as pickle from video_processing import EchoProcess import pickle import json from PIL import Image DIR_PATH = os.path.dirname(os.path.realpath(__file__)) class DataMaster: def __init__(self, conf): self.con...
[ "pickle.dump", "os.walk", "pickle.load", "glob.glob", "cv2.normalize", "shutil.rmtree", "os.path.join", "os.path.dirname", "os.path.exists", "numpy.reshape", "os.stat", "os.path.basename", "os.path.realpath", "os.makedirs", "os.path.isdir", "PIL.Image.open", "cv2.VideoCapture", "nu...
[((226, 252), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (242, 252), False, 'import os\n'), ((348, 413), 'os.path.join', 'os.path.join', (['DIR_PATH', "self.conf['Load_Save']['raw_data_folder']"], {}), "(DIR_PATH, self.conf['Load_Save']['raw_data_folder'])\n", (360, 413), False, 'import...
""" Copyright 2020 The OneFlow 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 applicable law or agr...
[ "numpy.array_equal", "numpy.allclose", "numpy.random.randint", "test_global_storage.Get", "oneflow.compatible.single_client.constant_initializer", "oneflow.compatible.single_client.math.unsorted_batch_segment_sum", "oneflow.compatible.single_client.scope.placement", "unittest.main", "oneflow.compati...
[((900, 921), 'oneflow.compatible.single_client.FunctionConfig', 'flow.FunctionConfig', ([], {}), '()\n', (919, 921), True, 'from oneflow.compatible import single_client as flow\n'), ((4044, 4076), 'oneflow.compatible.single_client.unittest.skip_unless_1n1d', 'flow.unittest.skip_unless_1n1d', ([], {}), '()\n', (4074, 4...
# Copyright 2021 United States Government as represented by the Administrator of the National Aeronautics and Space # Administration. No copyright is claimed in the United States under Title 17, U.S. Code. All Other Rights Reserved. """ UNDER CONSTRUCTION?!?!?!? The :mod:`.visualizer` module provides... Contents -...
[ "matplotlib.pyplot.close", "numpy.asarray", "numpy.zeros", "numpy.isfinite", "matplotlib.pyplot.figure", "numpy.sin", "numpy.array", "numpy.linalg.norm", "numpy.linspace", "numpy.cos", "matplotlib.animation.ImageMagickWriter", "numpy.round" ]
[((560, 590), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(500)'], {}), '(0, 2 * np.pi, 500)\n', (571, 590), True, 'import numpy as np\n'), ((1385, 1448), 'numpy.array', 'np.array', (['relnav.saved_templates[index][target_ind].shape[::-1]'], {}), '(relnav.saved_templates[index][target_ind].shape[::-1])\n'...
import glob import cv2 import numpy as np import matplotlib.image as mpimg from moviepy.editor import VideoFileClip from utils import plot_images, moving_avg import matplotlib.pyplot as plt CALIBRATION_IMAGES = './camera_cal/calibration*.jpg' CALIBRATION_MATR = None CALIBRATION_COEFF = None NUM_CHESSBRD_CORNERS_X = 9...
[ "numpy.absolute", "numpy.polyfit", "cv2.getPerspectiveTransform", "numpy.argmax", "numpy.mean", "glob.glob", "cv2.undistort", "cv2.warpPerspective", "numpy.zeros_like", "numpy.int_", "numpy.copy", "moviepy.editor.VideoFileClip", "cv2.cvtColor", "numpy.max", "numpy.int", "numpy.linspace...
[((400, 461), 'numpy.float32', 'np.float32', (['[[595, 450], [689, 450], [1104, 720], [215, 720]]'], {}), '([[595, 450], [689, 450], [1104, 720], [215, 720]])\n', (410, 461), True, 'import numpy as np\n'), ((478, 576), 'numpy.float32', 'np.float32', (['[[250, 0], [IMG_WIDTH - 250, 0], [IMG_WIDTH - 250, IMG_HEIGHT], [25...
import numpy as np class SVM: def __init__(self, learning_rate=0.001, lambda_param=0.01, n_iters=1000): self.lr = learning_rate self.lambda_param = lambda_param self.n_iters = n_iters self.w = None self.b = None def fit(self, X, y): _, n_features = X.shape ...
[ "numpy.dot", "numpy.where", "numpy.zeros", "numpy.sign" ]
[((330, 353), 'numpy.where', 'np.where', (['(y <= 0)', '(-1)', '(1)'], {}), '(y <= 0, -1, 1)\n', (338, 353), True, 'import numpy as np\n'), ((372, 392), 'numpy.zeros', 'np.zeros', (['n_features'], {}), '(n_features)\n', (380, 392), True, 'import numpy as np\n'), ((948, 963), 'numpy.sign', 'np.sign', (['approx'], {}), '...
#coding:utf-8 # coding:UTF-8 ''' Date:20160901 @author: zhaozhiyong ''' import numpy as np def load_data(file_name): '''导入训练数据 input: file_name(string)训练数据的位置 output: feature_data(mat)特征 label_data(mat)标签 ''' f = open(file_name) # 打开文件 feature_data = [] label_data = [] for...
[ "numpy.log", "numpy.ones", "numpy.shape", "numpy.exp", "numpy.mat" ]
[((721, 741), 'numpy.mat', 'np.mat', (['feature_data'], {}), '(feature_data)\n', (727, 741), True, 'import numpy as np\n'), ((743, 761), 'numpy.mat', 'np.mat', (['label_data'], {}), '(label_data)\n', (749, 761), True, 'import numpy as np\n'), ((1125, 1142), 'numpy.shape', 'np.shape', (['feature'], {}), '(feature)\n', (...
################################### ## LOAD AND PREPROCESS IMAGE DATA ################################### import os import torch from torch.utils.data import Dataset import glob import numpy as np from util import read_filepaths from PIL import Image from torchvision import transforms from sklearn.model_selection impo...
[ "torch.tensor", "util.read_filepaths", "torchvision.transforms.RandomHorizontalFlip", "sklearn.model_selection.train_test_split", "os.path.exists", "torchvision.transforms.RandomResizedCrop", "PIL.Image.open", "torchvision.transforms.CenterCrop", "torchvision.transforms.Normalize", "torchvision.tr...
[((402, 477), 'torchvision.transforms.Normalize', 'transforms.Normalize', ([], {'mean': '[0.485, 0.456, 0.406]', 'std': '[0.229, 0.224, 0.225]'}), '(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])\n', (422, 477), False, 'from torchvision import transforms\n'), ((523, 545), 'torchvision.transforms.Resize', 'trans...
import numpy as np import matplotlib.pyplot as plt import gym import time import copy from keras.models import Sequential, Model from keras.layers import Dense, Activation, Flatten, Lambda, Input, Reshape, concatenate, Merge from keras.optimizers import Adam, RMSprop from keras.callbacks import History from keras imp...
[ "rl.callbacks.TrainEpisodeLogger", "rl.memory.SequentialMemory", "rl.agents.dqn.DQNAgent", "keras.callbacks.History", "gym.make", "matplotlib.pyplot.plot", "keras.layers.Activation", "rl.policy.EpsGreedyQPolicy", "keras.layers.Flatten", "keras.optimizers.Adam", "keras.models.Model", "keras.lay...
[((751, 774), 'gym.make', 'gym.make', (['"""CartPole-v1"""'], {}), "('CartPole-v1')\n", (759, 774), False, 'import gym\n'), ((823, 864), 'keras.layers.Input', 'Input', (['((1,) + env.observation_space.shape)'], {}), '((1,) + env.observation_space.shape)\n', (828, 864), False, 'from keras.layers import Dense, Activation...
import random from argparse import ArgumentParser from collections import deque import gym from gym.wrappers import RescaleAction import numpy as np import torch from torch.utils.tensorboard import SummaryWriter from td3 import TD3 from utils import MeanStdevFilter, Transition, make_gif, make_checkpoint def train(a...
[ "utils.make_checkpoint", "numpy.random.seed", "argparse.ArgumentParser", "gym.make", "utils.Transition", "torch.manual_seed", "utils.make_gif", "gym.wrappers.RescaleAction", "random.seed", "td3.TD3", "torch.utils.tensorboard.SummaryWriter", "utils.MeanStdevFilter", "numpy.mean" ]
[((1088, 1105), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (1099, 1105), False, 'import random\n'), ((1110, 1133), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (1127, 1133), False, 'import torch\n'), ((1138, 1158), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n'...
import numpy as np import scipy.io import nibabel as nib from nilearn.input_data import NiftiMasker from nilearn.masking import compute_epi_mask from sklearn import preprocessing from sklearn.preprocessing import StandardScaler from sklearn.model_selection import PredefinedSplit from copy import deepcopy # data path ...
[ "copy.deepcopy", "sklearn.model_selection.PredefinedSplit", "sklearn.preprocessing.StandardScaler", "nibabel.load", "numpy.asarray", "nilearn.masking.compute_epi_mask", "numpy.zeros", "numpy.transpose", "numpy.hstack", "numpy.nonzero", "nilearn.input_data.NiftiMasker", "numpy.squeeze", "brai...
[((1307, 1340), 'numpy.asarray', 'np.asarray', (['[dim_x, dim_y, dim_z]'], {}), '([dim_x, dim_y, dim_z])\n', (1317, 1340), True, 'import numpy as np\n'), ((1367, 1393), 'brainiak.utils.fmrisim.mask_brain', 'sim.mask_brain', (['dimensions'], {}), '(dimensions)\n', (1381, 1393), True, 'import brainiak.utils.fmrisim as si...
from __future__ import division import numpy as np from scipy import stats import matplotlib.pyplot as plt from hpd import hpd_grid def plot_post(sample, alpha=0.05, show_mode=True, kde_plot=True, bins=50, ROPE=None, comp_val=None, roundto=2): """Plot posterior and HPD Parameters ---------- sam...
[ "numpy.sum", "hpd.hpd_grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.hist", "numpy.median", "matplotlib.pyplot.legend", "numpy.mean", "matplotlib.pyplot.gca" ]
[((1569, 1601), 'hpd.hpd_grid', 'hpd_grid', (['sample', 'alpha', 'roundto'], {}), '(sample, alpha, roundto)\n', (1577, 1601), False, 'from hpd import hpd_grid\n'), ((3447, 3478), 'matplotlib.pyplot.legend', 'plt.legend', ([], {'loc': '(0)', 'framealpha': '(1)'}), '(loc=0, framealpha=1)\n', (3457, 3478), True, 'import m...
import numpy as np import onnxruntime from dnnv.nn.converters.onnx import * from dnnv.nn.operations import * def test_Expand_dim_changed(): shape = np.array([3, 1]) data = np.reshape(np.arange(1, np.prod(shape) + 1, dtype=np.float32), shape) new_shape = np.array([2, 1, 6]) op = Expand(data, new_shap...
[ "onnxruntime.backend.run", "numpy.allclose", "numpy.dtype", "numpy.ones", "numpy.array", "numpy.tile", "numpy.prod" ]
[((155, 171), 'numpy.array', 'np.array', (['[3, 1]'], {}), '([3, 1])\n', (163, 171), True, 'import numpy as np\n'), ((269, 288), 'numpy.array', 'np.array', (['[2, 1, 6]'], {}), '([2, 1, 6])\n', (277, 288), True, 'import numpy as np\n'), ((385, 424), 'onnxruntime.backend.run', 'onnxruntime.backend.run', (['onnx_model', ...
# Copyright 2020 Forschungszentrum Jülich GmbH and Aix-Marseille Université # "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. " import logging logging.getLogger('numba').setLevel(logging.WARNING) logging.getLogger('t...
[ "numpy.load", "numpy.random.seed", "mpi4py.MPI.Status", "numpy.empty", "logging.Formatter", "numpy.mean", "sys.stdout.flush", "numpy.arange", "mpi4py.MPI.COMM_WORLD.Connect", "logging.FileHandler", "numpy.transpose", "tvb.simulator.lab.monitors.TemporalAverage", "mpi4py.MPI.Close_port", "n...
[((1453, 1500), 'numpy.random.seed', 'rgn.seed', (["(param_tvb_integrator['seed_init'] - 1)"], {}), "(param_tvb_integrator['seed_init'] - 1)\n", (1461, 1500), True, 'import numpy.random as rgn\n'), ((1890, 1922), 'numpy.array', 'np.array', (["param_tvb_model['g_L']"], {}), "(param_tvb_model['g_L'])\n", (1898, 1922), Tr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 2 14:17:34 2018 @author: jeremiasknoblauch Description: Create AR(1) processes moving independently with CPs, and one s contaminated series which is AR(1) + massive errors. """ import numpy as np import scipy from BVAR_NIG_DPD import...
[ "numpy.random.seed", "scipy.stats.t.rvs", "numpy.ones", "numpy.mean", "numpy.random.normal", "cp_probability_model.CpModel", "BVAR_NIG.BVARNIG", "Evaluation_tool.EvaluationTool", "detector.Detector", "numpy.linspace", "numpy.var", "matplotlib.pyplot.subplots", "BVAR_NIG_DPD.BVARNIGDPD", "s...
[((678, 697), 'numpy.zeros', 'np.zeros', (['(T, K, 1)'], {}), '((T, K, 1))\n', (686, 697), True, 'import numpy as np\n'), ((956, 966), 'numpy.sqrt', 'np.sqrt', (['(5)'], {}), '(5)\n', (963, 966), True, 'import numpy as np\n'), ((6971, 6995), 'numpy.array', 'np.array', (['model_universe'], {}), '(model_universe)\n', (69...
import sys from pathlib import Path import lightgbm as lgb import numpy as np import pandas as pd import xgboost as xgb from sklearn.base import BaseEstimator, RegressorMixin, TransformerMixin, clone from sklearn.ensemble import GradientBoostingRegressor from sklearn.kernel_ridge import KernelRidge from sklearn.linear...
[ "sys.path.append", "sklearn.kernel_ridge.KernelRidge", "pandas.read_csv", "sklearn.ensemble.GradientBoostingRegressor", "sklearn.preprocessing.RobustScaler", "sklearn.linear_model.ElasticNet", "sklearn.model_selection.cross_val_score", "sklearn.model_selection.KFold", "pathlib.Path", "numpy.mean",...
[((606, 633), 'sys.path.append', 'sys.path.append', (['parent_dir'], {}), '(parent_dir)\n', (621, 633), False, 'import sys\n'), ((3780, 3844), 'sklearn.kernel_ridge.KernelRidge', 'KernelRidge', ([], {'alpha': '(0.6)', 'kernel': '"""polynomial"""', 'degree': '(2)', 'coef0': '(2.5)'}), "(alpha=0.6, kernel='polynomial', d...
''' Module providing `DictImportExport` and `PandasImportExport` (requiring a working installation of pandas). ''' import numpy as np from .importexport import ImportExport class DictImportExport(ImportExport): ''' An importer/exporter for variables in format of dict of numpy arrays. ''' @property ...
[ "pandas.DataFrame", "numpy.squeeze" ]
[((1960, 1978), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (1972, 1978), True, 'import pandas as pd\n'), ((2900, 2928), 'numpy.squeeze', 'np.squeeze', (['array_data[:, e]'], {}), '(array_data[:, e])\n', (2910, 2928), True, 'import numpy as np\n')]
# parallelize_model # Script designed to parallelize trainamodel.py, especially for # purposes of grid search to optimize parameters. # This version has a couple of minor changes to make it work for page models import csv from multiprocessing import Pool import matplotlib.pyplot as plt import trainapagemodel as tmod...
[ "matplotlib.pyplot.show", "csv.writer", "trainapagemodel.get_vocabulary_and_counts_4pages", "matplotlib.pyplot.matshow", "numpy.zeros", "trainapagemodel.get_page_metadata", "numpy.linspace", "multiprocessing.Pool" ]
[((489, 521), 'trainapagemodel.get_page_metadata', 'tmod.get_page_metadata', (['metapath'], {}), '(metapath)\n', (511, 521), True, 'import trainapagemodel as tmod\n'), ((560, 639), 'trainapagemodel.get_vocabulary_and_counts_4pages', 'tmod.get_vocabulary_and_counts_4pages', (['metadata', 'docids', 'sourcedir', 'feature_...
# Copyright (c) OpenMMLab. All rights reserved. import os import os.path as osp import warnings from collections import OrderedDict, defaultdict import json_tricks as json import numpy as np from ....core.post_processing import oks_nms, soft_oks_nms from ...builder import DATASETS from ..base import Kpt2dSviewRgbVidT...
[ "numpy.ones", "numpy.clip", "poseval.eval_helpers.getCum", "collections.defaultdict", "numpy.random.randint", "os.path.join", "poseval.eval_helpers.printTable", "json_tricks.dump", "poseval.evaluateAP.evaluateAP", "os.path.dirname", "poseval.eval_helpers.load_data_dir", "os.path.exists", "js...
[((13494, 13523), 'os.path.join', 'osp.join', (['res_folder', '"""preds"""'], {}), "(res_folder, 'preds')\n", (13502, 13523), True, 'import os.path as osp\n'), ((13532, 13571), 'os.makedirs', 'os.makedirs', (['pred_folder'], {'exist_ok': '(True)'}), '(pred_folder, exist_ok=True)\n', (13543, 13571), False, 'import os\n'...
__author__ = 'cs540-testers' __credits__ = ['<NAME>', '<NAME>', '<NAME>', '<NAME>'] version = 'v0.2.2' import sys import unittest import numpy as np from pca import load_and_center_dataset, get_covariance, get_eig, \ get_eig_perc, project_image, display_image mnist_path = 'mnist.npy' class TestLoadAndCenterDatas...
[ "unittest.main", "pca.get_eig_perc", "numpy.sum", "pca.load_and_center_dataset", "pca.get_eig", "numpy.shape", "numpy.min", "pca.get_covariance", "numpy.max", "sys.argv.index", "pca.project_image", "numpy.isclose", "sys.exit", "numpy.diagonal" ]
[((4327, 4355), 'unittest.main', 'unittest.main', ([], {'argv': 'sys.argv'}), '(argv=sys.argv)\n', (4340, 4355), False, 'import unittest\n'), ((371, 406), 'pca.load_and_center_dataset', 'load_and_center_dataset', (['mnist_path'], {}), '(mnist_path)\n', (394, 406), False, 'from pca import load_and_center_dataset, get_co...
''' Pipeline Filters: price > 10 (price_filter) 5-day SMA > 10-day SMA (positive_movement) 30-day Parkinson Volatility is in bottom 1000 of stocks (pvol_filter) AverageDollarVolume 10-day SMA > 30-day SMA (positive_movement2) MACD Histogram Trading To-DO: manage leverage risk management (determine why algorithm fai...
[ "talib.MACD", "numpy.log", "quantopian.pipeline.factors.SimpleMovingAverage", "quantopian.algorithm.pipeline_output", "quantopian.algorithm.attach_pipeline", "quantopian.pipeline.Pipeline", "numpy.mean", "math.log" ]
[((1660, 1670), 'quantopian.pipeline.Pipeline', 'Pipeline', ([], {}), '()\n', (1668, 1670), False, 'from quantopian.pipeline import Pipeline\n'), ((1675, 1716), 'quantopian.algorithm.attach_pipeline', 'attach_pipeline', (['pipe'], {'name': '"""my_pipeline"""'}), "(pipe, name='my_pipeline')\n", (1690, 1716), False, 'fro...
import os import numpy as np import tensorflow as tf from models_vqa.model import Model from models_vqa.config import build_cfg_from_argparse from util.vqa_train.data_reader import DataReader # Load config cfg = build_cfg_from_argparse() # Start session os.environ["CUDA_VISIBLE_DEVICES"] = str(cfg.GPU_ID) sess = tf....
[ "numpy.argmax", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "numpy.mean", "tensorflow.nn.sparse_softmax_cross_entropy_with_logits", "tensorflow.get_default_graph", "tensorflow.summary.merge", "os.path.join", "models_vqa.config.build_cfg_from_argparse", "tensorflow.clip_by_global_norm", "ten...
[((214, 239), 'models_vqa.config.build_cfg_from_argparse', 'build_cfg_from_argparse', ([], {}), '()\n', (237, 239), False, 'from models_vqa.config import build_cfg_from_argparse\n'), ((492, 872), 'util.vqa_train.data_reader.DataReader', 'DataReader', (['imdb_file'], {'shuffle': '(True)', 'one_pass': '(False)', 'batch_s...
import argparse import datetime as dt import json import os import sys from typing import List import matplotlib import numpy as np from PyQt5 import QtWidgets from PyQt5.QtWidgets import QLabel, QComboBox from astropy import units from astropy.coordinates import concatenate from matplotlib import colors from matplotl...
[ "argparse.ArgumentParser", "PyQt5.QtWidgets.QPushButton", "PyQt5.QtWidgets.QVBoxLayout", "matplotlib.backends.backend_qt5agg.NavigationToolbar2QT", "PyQt5.QtWidgets.QApplication", "PyQt5.QtWidgets.QLabel", "PyQt5.QtWidgets.QWidget", "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", "matplotlib...
[((771, 795), 'matplotlib.use', 'matplotlib.use', (['"""Qt5Agg"""'], {}), "('Qt5Agg')\n", (785, 795), False, 'import matplotlib\n'), ((802, 826), 'gcs.utils.helioviewer.get_helioviewer_client', 'get_helioviewer_client', ([], {}), '()\n', (824, 826), False, 'from gcs.utils.helioviewer import get_helioviewer_client\n'), ...
"""Plot posterior distributions of microlensing events. Creates "pointilism" plots which show the discrete posterior, and heatmap plots which show the true posterior. """ from cProfile import label import MulensModel as mm import math from copy import deepcopy import sampling import numpy as np import matplotlib.pyp...
[ "corner.corner", "seaborn.kdeplot", "matplotlib.pyplot.plot", "matplotlib.pyplot.style.use", "matplotlib.ticker.AutoMinorLocator", "numpy.array", "matplotlib.pyplot.rc", "numpy.linspace", "matplotlib.pyplot.MaxNLocator", "numpy.concatenate" ]
[((1164, 1194), 'numpy.linspace', 'np.linspace', (['ts[0]', 'ts[1]', '(720)'], {}), '(ts[0], ts[1], 720)\n', (1175, 1194), True, 'import numpy as np\n'), ((2243, 2273), 'numpy.linspace', 'np.linspace', (['ts[0]', 'ts[1]', '(720)'], {}), '(ts[0], ts[1], 720)\n', (2254, 2273), True, 'import numpy as np\n'), ((2464, 2536)...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor def count_params(net): total_params = 0 for x in filter(lambda p: p.requires_grad, net.parameters()): total_params += np.prod(x.data.numpy().shape) print("Total number of params", total_...
[ "numpy.isnan" ]
[((574, 587), 'numpy.isnan', 'np.isnan', (['arr'], {}), '(arr)\n', (582, 587), True, 'import numpy as np\n')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Sep 3 00:53:21 2020 @author: guo.1648 """ # This code is for biggan. # my testing code: # Try the NN with the generated images as query, the original dataset as training set, # to see if the NN can find original images that we found similar to the ge...
[ "numpy.load", "cv2.imwrite", "numpy.zeros", "cv2.imread", "sklearn.neighbors.NearestNeighbors", "numpy.array", "cv2.hconcat", "cv2.resize" ]
[((3661, 3691), 'cv2.imread', 'cv2.imread', (['src_sampleSheetImg'], {}), '(src_sampleSheetImg)\n', (3671, 3691), False, 'import cv2\n'), ((5267, 5293), 'numpy.load', 'np.load', (['srcRootDir_imgNpz'], {}), '(srcRootDir_imgNpz)\n', (5274, 5293), True, 'import numpy as np\n'), ((6665, 6756), 'numpy.zeros', 'np.zeros', (...
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import sys import os sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) ROOT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) import time import json import numpy as np import cv2 import random i...
[ "lib.options.BaseOptions", "torch.cat", "torch.device", "torch.no_grad", "os.path.abspath", "lib.model.HGPIFuMRNet", "cv2.imwrite", "torch.load", "os.path.dirname", "os.path.exists", "lib.model.HGPIFuNetwNML", "lib.geometry.index", "lib.data.EvalWPoseDataset", "numpy.ones_like", "numpy.l...
[((790, 803), 'lib.options.BaseOptions', 'BaseOptions', ([], {}), '()\n', (801, 803), False, 'from lib.options import BaseOptions\n'), ((5452, 5471), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (5464, 5471), False, 'import torch\n'), ((6674, 6722), 'os.makedirs', 'os.makedirs', (['opt.checkpoints_...
# -*- coding: utf-8 -*- """ Created on Fri Apr 10 16:43:04 2020 @author: iurym """ from app import app, request, jsonify import pickle import pandas as pd import numpy as np # Load the pickle model model = pickle.load(open('machine-learning/training/data/model', 'rb')) @app.route('/') def home(): return "API HO...
[ "pandas.DataFrame", "app.app.route", "app.request.args.get", "numpy.array", "app.jsonify" ]
[((275, 289), 'app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (284, 289), False, 'from app import app, request, jsonify\n'), ((349, 370), 'app.app.route', 'app.route', (['"""/predict"""'], {}), "('/predict')\n", (358, 370), False, 'from app import app, request, jsonify\n'), ((700, 729), 'app.request.args.ge...
""" This file holds common audio functions for processing time-domain audio in the form of .wav files and frequency-domain audio in the form of log-mel spectrograms. """ import librosa import noisereduce as nr import numpy as np import au_constants as auc import spectrogram as sg def load_wav(wav_path): """ ...
[ "numpy.pad", "spectrogram.wave_to_melspecgram", "numpy.dtype", "spectrogram.scale_melspecgram", "noisereduce.reduce_noise" ]
[((1529, 1556), 'spectrogram.wave_to_melspecgram', 'sg.wave_to_melspecgram', (['wav'], {}), '(wav)\n', (1551, 1556), True, 'import spectrogram as sg\n'), ((1634, 1667), 'spectrogram.scale_melspecgram', 'sg.scale_melspecgram', (['melspecgram'], {}), '(melspecgram)\n', (1654, 1667), True, 'import spectrogram as sg\n'), (...
from collections import OrderedDict import hashlib import os from experiment_logger import get_logger import numpy as np from allennlp.commands.elmo import ElmoEmbedder from allennlp.data.token_indexers.elmo_indexer import ELMoCharacterMapper from tqdm import tqdm # With loaded embedding matrix, the padding vector ...
[ "numpy.load", "numpy.save", "experiment_logger.get_logger", "allennlp.commands.elmo.ElmoEmbedder", "numpy.zeros", "os.path.exists", "hashlib.sha256", "collections.OrderedDict", "numpy.fromstring", "numpy.concatenate" ]
[((730, 743), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (741, 743), False, 'from collections import OrderedDict\n'), ((3176, 3188), 'experiment_logger.get_logger', 'get_logger', ([], {}), '()\n', (3186, 3188), False, 'from experiment_logger import get_logger\n'), ((5309, 5325), 'hashlib.sha256', 'hash...
import json from typing import Tuple, Dict, List import numpy as np from bestiary.meta.dataset import MetaDataset from bestiary.utils.data import RandomDataset class Sinusoid(RandomDataset): def __init__(self, amplitude: float, frequency: float, phase: float, noise: float = 0., limits: Tuple[f...
[ "json.dump", "numpy.random.uniform", "json.load", "numpy.float32", "numpy.sin", "numpy.random.normal" ]
[((916, 948), 'numpy.random.uniform', 'np.random.uniform', (['*self.limits_'], {}), '(*self.limits_)\n', (933, 948), True, 'import numpy as np\n'), ((1082, 1113), 'numpy.random.normal', 'np.random.normal', (['(0)', 'self.noise'], {}), '(0, self.noise)\n', (1098, 1113), True, 'import numpy as np\n'), ((1130, 1145), 'num...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Dec 28 16:03:38 2018 @author: ahmed source: file:///media/ahmed/MYLINUXLIVE/PyEphem/New%20folder/Fun%20with%20the%20Sun%20and%20PyEphem%20-%20Chris%20Ramsay.html """ # Import some bits import ephem, math, datetime import matplotlib.pyplot as plt from ...
[ "pandas.DataFrame", "matplotlib.pyplot.axvline", "ephem.Observer", "matplotlib.pyplot.show", "ephem.Date", "matplotlib.pyplot.setp", "matplotlib.pyplot.axis", "datetime.date", "numpy.cumsum", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "ephem.Sun", "matplotlib.ticker.FuncForma...
[((398, 430), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""Solarize_Light2"""'], {}), "('Solarize_Light2')\n", (411, 430), True, 'import matplotlib.pyplot as plt\n'), ((438, 454), 'ephem.Observer', 'ephem.Observer', ([], {}), '()\n', (452, 454), False, 'import ephem, math, datetime\n'), ((546, 557), 'ephem.Sun...
import cv2 import torch import mmcv import numpy as np from .coco_transform import xywh2cs, get_affine_transform from mmskeleton.ops.nms.nms import oks_nms class VideoDemo(object): def __init__(self, ): super(VideoDemo, self).__init__() @staticmethod def bbox_filter(bbox_result, bbox...
[ "numpy.full", "numpy.prod", "numpy.array", "numpy.vstack", "numpy.concatenate" ]
[((557, 579), 'numpy.vstack', 'np.vstack', (['bbox_result'], {}), '(bbox_result)\n', (566, 579), True, 'import numpy as np\n'), ((740, 767), 'numpy.concatenate', 'np.concatenate', (['bbox_labels'], {}), '(bbox_labels)\n', (754, 767), True, 'import numpy as np\n'), ((3059, 3101), 'numpy.concatenate', 'np.concatenate', (...
# coding=utf-8 # Copyright 2022 The ML Fairness Gym Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[ "matplotlib.pyplot.show", "numpy.percentile", "matplotlib.pyplot.figure", "numpy.mean", "numpy.array", "seaborn.jointplot", "tensorflow.keras.backend.set_learning_phase", "matplotlib.pyplot.savefig" ]
[((4729, 4741), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (4739, 4741), True, 'import matplotlib.pyplot as plt\n'), ((5316, 5371), 'numpy.mean', 'np.mean', (['[risk for risk in health_risks if risk >= var]'], {}), '([risk for risk in health_risks if risk >= var])\n', (5323, 5371), True, 'import numpy ...
''' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COPYRIGHT NOTICE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Permission is granted for anyone to copy, use, modify, or distribute the accompanying programs and documents for any purpose, provided this copyright notice is retained and prominently displayed, along with a complete citation of t...
[ "numpy.random.uniform", "numpy.sum", "os.makedirs", "math.sqrt", "numpy.abs", "numpy.savetxt", "os.path.exists", "numpy.where", "numpy.random.randint", "numpy.random.random", "numpy.array", "numpy.squeeze" ]
[((2518, 2555), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': 'self.numSpins'}), '(size=self.numSpins)\n', (2535, 2555), True, 'import numpy as np\n'), ((2642, 2682), 'numpy.where', 'np.where', (['(self.currentState < 0.5)', '(-1)', '(1)'], {}), '(self.currentState < 0.5, -1, 1)\n', (2650, 2682), True, 'im...
import numpy as np import sys, os import time import cv2 sys.path.append(os.getcwd()) # crnn packages import torch from torch.autograd import Variable import torch.nn.functional as F import utils import temp.crnn_fc_model as crnn import Levenshtein import params_qi as params import alphabets str1 = alphabets.alphabet...
[ "argparse.ArgumentParser", "os.getcwd", "torch.autograd.Variable", "torch.load", "utils.strLabelConverter", "temp.crnn_fc_model.CRNN_FC", "cv2.imread", "torch.cuda.is_available", "numpy.reshape", "cv2.resize", "torch.from_numpy" ]
[((380, 405), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (403, 405), False, 'import argparse\n'), ((73, 84), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (82, 84), False, 'import sys, os\n'), ((960, 993), 'utils.strLabelConverter', 'utils.strLabelConverter', (['alphabet'], {}), '(alphabet)\n...
"""Derive Potential Evapotransporation (evspsblpot) using De Bruin (2016). <NAME>., <NAME>., <NAME>., <NAME>.: A Thermodynamically Based Model for Actual Evapotranspiration of an Extensive Grass Field Close to FAO Reference, Suitable for Remote Sensing Application, American Meteorological Society, 17, 1373-1382, DOI: ...
[ "numpy.float32", "iris.analysis.maths.exp" ]
[((1020, 1037), 'numpy.float32', 'np.float32', (['(17.67)'], {}), '(17.67)\n', (1030, 1037), True, 'import numpy as np\n'), ((1289, 1341), 'iris.analysis.maths.exp', 'iris.analysis.maths.exp', (['(emp_a * tas / (tas + emp_b))'], {}), '(emp_a * tas / (tas + emp_b))\n', (1312, 1341), False, 'import iris\n'), ((4085, 4105...
import os import warnings os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "0" warnings.filterwarnings("ignore", category=DeprecationWarning) warnings.simplefilter(action='ignore', category=FutureWarning) warnings.filterwarnings("ignore", category=UserWarning) import dgl import numpy...
[ "tqdm.tqdm", "warnings.simplefilter", "Datasets.FlickrDataset.FlickrMIRDataset", "warnings.filterwarnings", "torch.cuda.is_available", "Models.GCN.GCN", "numpy.array", "Trainer.Trainer.Trainer" ]
[((114, 176), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', category=DeprecationWarning)\n", (137, 176), False, 'import warnings\n'), ((177, 239), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'Fu...
import logging import numpy as np from astropy import units as u from astropy.nddata import NDDataRef from astropy.utils.decorators import lazyproperty from astropy.nddata import NDUncertainty from ..wcs import WCSWrapper, WCSAdapter from .spectrum_mixin import OneDSpectrumMixin __all__ = ['Spectrum1D'] __doctest_sk...
[ "logging.error", "astropy.units.Quantity", "logging.info", "numpy.mean", "astropy.units.spectral", "numpy.diff", "astropy.units.spectral_density", "astropy.units.UnitsError" ]
[((9445, 9459), 'numpy.mean', 'np.mean', (['array'], {}), '(array)\n', (9452, 9459), True, 'import numpy as np\n'), ((5318, 5330), 'astropy.units.spectral', 'u.spectral', ([], {}), '()\n', (5328, 5330), True, 'from astropy import units as u\n'), ((5516, 5528), 'astropy.units.spectral', 'u.spectral', ([], {}), '()\n', (...
import gym import numpy as np from gym import spaces class FourRoom(gym.Env): def __init__(self, seed=None, goal_type='fix_goal'): self.n = 11 self.map = np.array([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0...
[ "numpy.random.randn", "numpy.zeros", "numpy.where", "numpy.array", "gym.spaces.Box", "numpy.random.randint" ]
[((853, 922), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(0)', 'high': '(1)', 'shape': '(self.n * self.n,)', 'dtype': 'np.float32'}), '(low=0, high=1, shape=(self.n * self.n,), dtype=np.float32)\n', (863, 922), False, 'from gym import spaces\n'), ((1150, 1178), 'numpy.zeros', 'np.zeros', (['(self.n * self.n,)'], {})...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from ...c...
[ "numpy.array" ]
[((1491, 1521), 'numpy.array', 'np.array', (['coordinates_input[0]'], {}), '(coordinates_input[0])\n', (1499, 1521), True, 'import numpy as np\n'), ((1872, 1901), 'numpy.array', 'np.array', (['confidence_input[0]'], {}), '(confidence_input[0])\n', (1880, 1901), True, 'import numpy as np\n'), ((1998, 2030), 'numpy.array...
import inspect import json import os import shutil from importlib import import_module from pathlib import Path from datetime import timedelta import numpy as np import pandas as pd from .log import logger from .introspection import infer_args_from_method def check_directory_exists_and_if_not_mkdir(directory): ...
[ "os.remove", "os.path.isfile", "pathlib.Path", "pandas.DataFrame", "json.loads", "inspect.isclass", "os.path.dirname", "datetime.timedelta", "gzip.GzipFile", "inspect.isfunction", "json.JSONEncoder.default", "astropy.units.Quantity", "importlib.import_module", "numpy.asarray", "pandas.Se...
[((11413, 11449), 'shutil.move', 'shutil.move', (['temp_filename', 'filename'], {}), '(temp_filename, filename)\n', (11424, 11449), False, 'import shutil\n'), ((11759, 11783), 'os.path.isfile', 'os.path.isfile', (['filename'], {}), '(filename)\n', (11773, 11783), False, 'import os\n'), ((2356, 2379), 'inspect.isfunctio...
from dolfin import * comm = MPI.comm_world rank = MPI.rank(comm) rank_string = str(rank) size = MPI.size(comm) import numpy as np import multiprocessing import logging, logging.handlers import inspect import time, os, gc, sys import ctypes myeps = 1e-10 def human_time(tt): seconds = tt % 60 if seconds > 0....
[ "logging.Formatter.__init__", "multiprocessing.Lock", "numpy.floor", "matplotlib.pyplot.figure", "numpy.arange", "multiprocessing.Queue", "numpy.prod", "multiprocessing.cpu_count", "time.process_time", "os.path.dirname", "os.path.exists", "numpy.max", "numpy.ceil", "logging.StreamHandler",...
[((2953, 2972), 'time.process_time', 'time.process_time', ([], {}), '()\n', (2970, 2972), False, 'import time, os, gc, sys\n'), ((17209, 17231), 'numpy.arange', 'np.arange', (['(0.0001)', '(999)'], {}), '(0.0001, 999)\n', (17218, 17231), True, 'import numpy as np\n'), ((17243, 17255), 'matplotlib.pyplot.figure', 'plt.f...
import numpy as np import spartan from spartan import expr, util import parakeet from spartan.array import distarray, extent import time from scipy.spatial.distance import cdist @util.synchronized @parakeet.jit def _find_closest(pts, centers): idxs = np.zeros(pts.shape[0], np.int) for i in range(pts.shape[0]): ...
[ "spartan.array.extent.from_shape", "numpy.sum", "spartan.expr.sum", "spartan.expr.rand", "spartan.expr.outer", "numpy.prod", "numpy.zeros_like", "numpy.random.randn", "spartan.expr.from_numpy", "spartan.expr.zeros", "spartan.expr.ndarray", "scipy.spatial.distance.cdist", "spartan.expr.square...
[((255, 285), 'numpy.zeros', 'np.zeros', (['pts.shape[0]', 'np.int'], {}), '(pts.shape[0], np.int)\n', (263, 285), True, 'import numpy as np\n'), ((790, 835), 'numpy.zeros', 'np.zeros', (['(centers.shape[0], 1)'], {'dtype': 'np.int'}), '((centers.shape[0], 1), dtype=np.int)\n', (798, 835), True, 'import numpy as np\n')...
from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.models import Sequential from keras.models import Model from keras.layers import Dense from keras.layers import Flatten from keras.layers import Embedding from keras.layers import Dropout from keras.layers i...
[ "keras.preprocessing.sequence.pad_sequences", "keras.layers.Dropout", "numpy.random.rand", "nltk.data.find", "keras.layers.merge.concatenate", "numpy.zeros", "keras.models.Model", "keras.layers.Flatten", "keras.layers.Conv1D", "numpy.append", "keras.layers.MaxPooling1D", "keras.preprocessing.t...
[((807, 885), 'gensim.models.KeyedVectors.load_word2vec_format', 'gensim.models.KeyedVectors.load_word2vec_format', (['word2vec_sample'], {'binary': '(False)'}), '(word2vec_sample, binary=False)\n', (854, 885), False, 'import gensim\n'), ((1071, 1110), 'keras.preprocessing.text.Tokenizer', 'Tokenizer', ([], {'num_words...
""" Collection of tests for unified linear algebra functions """ # global import pytest import numpy as np # local import ivy import ivy.functional.backends.numpy import ivy_tests.test_ivy.helpers as helpers # svd @pytest.mark.parametrize( "x", [[[[1., 0.], [0., 1.]]], [[[[1., 0.], [0., 1.]]]]]) @pytest.mark.pa...
[ "ivy.array_mode", "ivy.cholesky", "ivy.pinv", "ivy_tests.test_ivy.helpers.assert_compilable", "ivy.vector_to_skew_symmetric_matrix", "ivy.svd", "numpy.allclose", "ivy.inv", "pytest.skip", "ivy.is_array", "numpy.array", "ivy.to_numpy", "pytest.mark.parametrize", "ivy.matrix_norm", "ivy.ve...
[((219, 312), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""x"""', '[[[[1.0, 0.0], [0.0, 1.0]]], [[[[1.0, 0.0], [0.0, 1.0]]]]]'], {}), "('x', [[[[1.0, 0.0], [0.0, 1.0]]], [[[[1.0, 0.0], [\n 0.0, 1.0]]]]])\n", (242, 312), False, 'import pytest\n'), ((306, 351), 'pytest.mark.parametrize', 'pytest.mark.pa...
# Copyright (c) 2021, NVIDIA CORPORATION. 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.abs", "warprnnt_numba.numba_utils.skip_numba_cuda_test_if_unsupported", "torch.device", "warprnnt_numba.rnnt_loss.rnnt_pytorch.certify_inputs", "numpy.random.RandomState", "numba.cuda.default_stream", "torch.zeros", "torch.log_softmax", "torch.zeros_like", "numpy.square", "warprnnt_numba....
[((1015, 1034), 'torch.from_numpy', 'torch.from_numpy', (['x'], {}), '(x)\n', (1031, 1034), False, 'import torch\n'), ((1056, 1086), 'torch.log_softmax', 'torch.log_softmax', (['x'], {'dim': 'axis'}), '(x, dim=axis)\n', (1073, 1086), False, 'import torch\n'), ((1311, 1385), 'warprnnt_numba.numba_utils.skip_numba_cuda_t...