code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ # SPDX-FileCopyrightText: 2021 <NAME> # SPDX-License-Identifier: MIT import numpy as np from simpa.utils import Tags from simpa.utils.libraries.molecule_library import MolecularComposition from simpa.utils.libraries.structure_library.Structur...
[ "numpy.tile", "numpy.asarray", "numpy.subtract", "numpy.stack", "numpy.zeros", "numpy.dot", "numpy.linalg.norm", "numpy.arange" ]
[((3772, 3809), 'numpy.subtract', 'np.subtract', (['end_voxels', 'start_voxels'], {}), '(end_voxels, start_voxels)\n', (3783, 3809), True, 'import numpy as np\n'), ((4076, 4115), 'numpy.zeros', 'np.zeros', (['self.volume_dimensions_voxels'], {}), '(self.volume_dimensions_voxels)\n', (4084, 4115), True, 'import numpy as...
import os import numpy as np import pandas as pd from scipy import sparse as sp from typing import Callable, List, Tuple, Dict from os.path import join from . import utils, process_dat from . import SETTINGS_POLIMI as SETTINGS os.environ['NUMEXPR_MAX_THREADS'] = str(SETTINGS.hyp['cores']) pd.options.mode.chained_ass...
[ "pandas.read_csv", "numpy.hstack", "numpy.array", "numpy.arange", "numpy.random.binomial", "numpy.repeat", "numpy.random.poisson", "numpy.where", "numpy.sort", "numpy.random.seed", "pandas.DataFrame", "numpy.maximum", "numpy.random.permutation", "numpy.ceil", "numpy.ones", "tensorflow....
[((2162, 2208), 'tensorflow.keras.backend.set_floatx', 'tensorflow.keras.backend.set_floatx', (['"""float64"""'], {}), "('float64')\n", (2197, 2208), False, 'import tensorflow\n'), ((2233, 2295), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', ca...
from . import DATA_DIR import pandas as pd import xarray as xr import numpy as np from pathlib import Path import csv REMIND_ELEC_MARKETS = (DATA_DIR / "remind_electricity_markets.csv") REMIND_ELEC_EFFICIENCIES = (DATA_DIR / "remind_electricity_efficiencies.csv") REMIND_ELEC_EMISSIONS = (DATA_DIR / "remind_electricity...
[ "csv.reader", "numpy.arange", "pandas.read_csv", "pathlib.Path" ]
[((4893, 5000), 'pandas.read_csv', 'pd.read_csv', (['filepath'], {'skiprows': '(4)', 'names': "['year', 'region', 'GAINS', 'pollutant', 'scenario', 'factor']"}), "(filepath, skiprows=4, names=['year', 'region', 'GAINS',\n 'pollutant', 'scenario', 'factor'])\n", (4904, 5000), True, 'import pandas as pd\n'), ((3419, 3...
import pickle import torch import numpy as np from attention import make_model SRC_STOI = None TARGET_ITOS = None TRG_EOS_TOKEN = None TRG_SOS_TOKEN = None def load_metadata(meta_path): global SRC_STOI, TARGET_ITOS, TRG_EOS_TOKEN, TRG_SOS_TOKEN with open(meta_path, 'rb') as f: metadata = pickle.lo...
[ "torch.ones_like", "numpy.where", "torch.LongTensor", "torch.max", "pickle.load", "numpy.array", "torch.no_grad", "torch.ones" ]
[((1476, 1492), 'numpy.array', 'np.array', (['output'], {}), '(output)\n', (1484, 1492), True, 'import numpy as np\n'), ((2095, 2122), 'torch.LongTensor', 'torch.LongTensor', (['src_index'], {}), '(src_index)\n', (2111, 2122), False, 'import torch\n'), ((2212, 2241), 'torch.LongTensor', 'torch.LongTensor', (['src_lengt...
import torch.utils.data as data import os import numpy as np import cv2 #/mnt/lustre/share/dingmingyu/new_list_lane.txt class MyDataset(data.Dataset): def __init__(self, file, dir_path, new_width, new_height, label_width, label_height): imgs = [] fw = open(file, 'r') lines = fw.readlines() ...
[ "numpy.unique", "os.path.join", "numpy.zeros", "cv2.resize", "cv2.imread" ]
[((725, 758), 'os.path.join', 'os.path.join', (['self.dir_path', 'path'], {}), '(self.dir_path, path)\n', (737, 758), False, 'import os\n'), ((849, 891), 'cv2.resize', 'cv2.resize', (['img', '(self.width, self.height)'], {}), '(img, (self.width, self.height))\n', (859, 891), False, 'import cv2\n'), ((973, 994), 'cv2.im...
import tensorflow as tf from tensorflow.keras.layers import Dense, LayerNormalization, Reshape, Permute, Dropout, GlobalAveragePooling1D, Embedding from tensorflow.keras.activations import softmax, linear import tensorflow.keras.backend as K import numpy as np def gelu(x): return 0.5*x*(1+tf.tanh(np.sqrt(2/np.pi)*...
[ "tensorflow.shape", "numpy.sqrt", "tensorflow.keras.layers.Dense", "tensorflow.keras.backend.shape", "tensorflow.keras.layers.Reshape", "tensorflow.pow", "tensorflow.keras.layers.Permute", "tensorflow.image.extract_patches", "tensorflow.keras.activations.softmax", "tensorflow.concat", "tensorflo...
[((6093, 6124), 'tensorflow.keras.Input', 'tf.keras.Input', ([], {'shape': 'input_dim'}), '(shape=input_dim)\n', (6107, 6124), True, 'import tensorflow as tf\n'), ((810, 828), 'tensorflow.keras.layers.Permute', 'Permute', (['(2, 1, 3)'], {}), '((2, 1, 3))\n', (817, 828), False, 'from tensorflow.keras.layers import Dens...
import numpy as np import multiprocessing import sys have_cext = False try: from .. import _cext have_cext = True except ImportError: pass except: print("the C extension is installed...but failed to load!") pass try: import xgboost except ImportError: pass except: print("xgboost is ins...
[ "numpy.zeros", "xgboost.DMatrix", "catboost.Pool", "multiprocessing.Pool" ]
[((6770, 6826), 'numpy.zeros', 'np.zeros', (['(self._current_X.shape[1] + 1, self.n_outputs)'], {}), '((self._current_X.shape[1] + 1, self.n_outputs))\n', (6778, 6826), True, 'import numpy as np\n'), ((5023, 5065), 'numpy.zeros', 'np.zeros', (['(X.shape[0] + 1, self.n_outputs)'], {}), '((X.shape[0] + 1, self.n_outputs)...
import numpy as np from unityagents import UnityEnvironment """UnityEnv is a wrapper around UnityEnvironment The main purpose for this Env is to establish a common interface which most environments expose """ class UnityEnv: def __init__(self, env_path, train_mode = True...
[ "numpy.clip", "numpy.prod", "unityagents.UnityEnvironment", "numpy.array" ]
[((1294, 1330), 'unityagents.UnityEnvironment', 'UnityEnvironment', ([], {'file_name': 'env_path'}), '(file_name=env_path)\n', (1310, 1330), False, 'from unityagents import UnityEnvironment\n'), ((1649, 1672), 'numpy.clip', 'np.clip', (['actions', '(-1)', '(1)'], {}), '(actions, -1, 1)\n', (1656, 1672), True, 'import n...
import torch from torch import nn import pdb, os from shapely.geometry import * from maskrcnn_benchmark.structures.boxlist_ops import cat_boxlist import time import matplotlib.pyplot as plt import numpy as np from scipy.signal import argrelextrema import random import string all_types = [[1,2,3,4],[1,2,4,3],[1,3,2,4...
[ "torch.nn.functional.grid_sample", "numpy.ceil", "torch.ones_like", "cv2.resize", "torch.full", "maskrcnn_benchmark.structures.ke.textKES", "torch.stack", "torch.from_numpy", "maskrcnn_benchmark.structures.bounding_box.BoxList", "numpy.exp", "numpy.zeros", "torch.linspace", "numpy.maximum", ...
[((3298, 3319), 'numpy.maximum', 'np.maximum', (['widths', '(1)'], {}), '(widths, 1)\n', (3308, 3319), True, 'import numpy as np\n'), ((3334, 3356), 'numpy.maximum', 'np.maximum', (['heights', '(1)'], {}), '(heights, 1)\n', (3344, 3356), True, 'import numpy as np\n'), ((3375, 3390), 'numpy.ceil', 'np.ceil', (['widths']...
import streamlit as st import numpy as np import matplotlib.pyplot as plt perc_heads = st.number_input(label='Chance of Coins Landing on Heads', min_value=0.0, max_value=1.0, value=.5) graph_title = st.text_input(label='Graph Title') binom_dist = np.random.binomial(1, perc_heads, 1000) list_of_means =...
[ "matplotlib.pyplot.hist", "streamlit.pyplot", "streamlit.number_input", "numpy.random.choice", "matplotlib.pyplot.title", "streamlit.text_input", "matplotlib.pyplot.subplots", "numpy.random.binomial" ]
[((98, 200), 'streamlit.number_input', 'st.number_input', ([], {'label': '"""Chance of Coins Landing on Heads"""', 'min_value': '(0.0)', 'max_value': '(1.0)', 'value': '(0.5)'}), "(label='Chance of Coins Landing on Heads', min_value=0.0,\n max_value=1.0, value=0.5)\n", (113, 200), True, 'import streamlit as st\n'), ...
import os import requests import time import json import io import numpy as np import pandas as pd import paavo_queries as paavo_queries from sklearn.linear_model import LinearRegression import statsmodels.api as sm ## NOTE: Table 9_koko access is forbidden from the API for some reasons. # url to the API...
[ "os.path.exists", "json.loads", "requests.post", "os.makedirs", "pandas.read_csv", "numpy.where", "os.path.join", "io.BytesIO", "time.sleep", "numpy.array", "statsmodels.api.add_constant", "numpy.isnan", "pandas.DataFrame", "statsmodels.api.OLS", "sklearn.linear_model.LinearRegression" ]
[((758, 823), 'requests.post', 'requests.post', (['url'], {'json': 'query', 'stream': '(True)', 'allow_redirects': '(True)'}), '(url, json=query, stream=True, allow_redirects=True)\n', (771, 823), False, 'import requests\n'), ((947, 993), 'os.path.join', 'os.path.join', (['destination_directory', 'file_name'], {}), '(d...
from sklearn.compose import ColumnTransformer from sklearn.pipeline import Pipeline from sklearn.impute import SimpleImputer from sklearn.preprocessing import OrdinalEncoder, StandardScaler, OneHotEncoder from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split, GridSearc...
[ "sklearn.preprocessing.OneHotEncoder", "sklearn.preprocessing.StandardScaler", "numpy.array", "pandas.to_numeric", "sklearn.impute.SimpleImputer", "pandas.DataFrame" ]
[((373, 431), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {'copy': '(False)', 'with_mean': '(False)', 'with_std': '(True)'}), '(copy=False, with_mean=False, with_std=True)\n', (387, 431), False, 'from sklearn.preprocessing import OrdinalEncoder, StandardScaler, OneHotEncoder\n'), ((2839, 2879), 'pand...
import torch import numpy as np from torch.utils.data import Dataset import torchvision.transforms.functional as TF import torchvision.transforms as transforms import random import glob import os from PIL import Image ''' require fix the random seeds ''' # PotsdamDataset rgb_means = [0.3366, 0.3599, 0.3333] rgb_stds =...
[ "torchvision.transforms.functional.to_tensor", "PIL.Image.open", "os.path.join", "torchvision.transforms.functional.hflip", "numpy.array", "torchvision.transforms.functional.rotate", "torchvision.transforms.functional.vflip", "torch.tensor", "random.random", "torchvision.transforms.functional.norm...
[((2291, 2310), 'torchvision.transforms.functional.to_tensor', 'TF.to_tensor', (['image'], {}), '(image)\n', (2303, 2310), True, 'import torchvision.transforms.functional as TF\n'), ((2327, 2376), 'torchvision.transforms.functional.normalize', 'TF.normalize', (['image'], {'mean': 'rgb_means', 'std': 'rgb_stds'}), '(ima...
import numpy as np def random_policy(env): counter = 0 total_rewards = 0 reward = None rewardTracker = [] while reward != 1: env.render() state, reward, done, info = env.step(env.action_space.sample()) total_rewards += reward if done: rewardTracker.appen...
[ "numpy.zeros", "numpy.random.randn", "numpy.random.rand", "numpy.max" ]
[((999, 1054), 'numpy.zeros', 'np.zeros', (['[env.observation_space.n, env.action_space.n]'], {}), '([env.observation_space.n, env.action_space.n])\n', (1007, 1054), True, 'import numpy as np\n'), ((600, 616), 'numpy.random.rand', 'np.random.rand', ([], {}), '()\n', (614, 616), True, 'import numpy as np\n'), ((720, 749...
"""Sliding windows for connectivity functions.""" from frites.io import set_log_level, logger import numpy as np def define_windows(times, windows=None, slwin_len=None, slwin_start=None, slwin_stop=None, slwin_step=None, verbose=None): """Define temporal windows. This function can be used...
[ "frites.io.set_log_level", "frites.io.logger.info", "numpy.atleast_2d", "numpy.abs", "matplotlib.patches.Rectangle", "matplotlib.pyplot.gca", "matplotlib.pyplot.plot", "matplotlib.collections.PatchCollection", "numpy.array", "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "numpy.zeros_lik...
[((1791, 1813), 'frites.io.set_log_level', 'set_log_level', (['verbose'], {}), '(verbose)\n', (1804, 1813), False, 'from frites.io import set_log_level, logger\n'), ((1859, 1899), 'frites.io.logger.info', 'logger.info', (['"""Defining temporal windows"""'], {}), "('Defining temporal windows')\n", (1870, 1899), False, '...
# =================================== # Import the libraries # =================================== import numpy as np from matplotlib import pylab as plt import imaging import utility import os,sys # =================================== # Which stages to run # =================================== do_add_noise = False d...
[ "numpy.fromfile", "imaging.bad_pixel_correction", "imaging.chromatic_aberration_correction", "imaging.tone_mapping", "imaging.sharpening", "imaging.distortion_correction", "imaging.memory_color_enhancement", "imaging.lens_shading_correction", "imaging.bayer_denoising", "numpy.empty", "imaging.Im...
[((827, 855), 'os.system', 'os.system', (['"""rm images/*.png"""'], {}), "('rm images/*.png')\n", (836, 855), False, 'import os, sys\n'), ((1654, 1722), 'numpy.fromfile', 'np.fromfile', (["('images/' + image_name + '.raw')"], {'dtype': '"""uint16"""', 'sep': '""""""'}), "('images/' + image_name + '.raw', dtype='uint16'...
import os import sys import imp import argparse import time import math import numpy as np from utils import utils from utils.imageprocessing import preprocess from utils.dataset import Dataset from network import Network from evaluation.lfw import LFWTest def main(args): paths = [ r'F:\data\face-recog...
[ "numpy.mean", "utils.utils.pair_MLS_score", "argparse.ArgumentParser", "numpy.log", "numpy.max", "network.Network", "utils.utils.pair_cosin_score", "numpy.concatenate", "numpy.min", "utils.imageprocessing.preprocess" ]
[((1241, 1250), 'network.Network', 'Network', ([], {}), '()\n', (1248, 1250), False, 'from network import Network\n'), ((1388, 1428), 'utils.imageprocessing.preprocess', 'preprocess', (['paths', 'network.config', '(False)'], {}), '(paths, network.config, False)\n', (1398, 1428), False, 'from utils.imageprocessing impor...
import AgentControl import Config import Memory import numpy as np import itertools class Agent: # Role of Agent class is to coordinate between AgentControll where we do all calculations # and Memory where we store all of the data def __init__(self, state_size, action_size, batch_size): s...
[ "numpy.mean", "AgentControl.AgentControl", "Memory.Memory", "numpy.max", "numpy.round" ]
[((340, 413), 'AgentControl.AgentControl', 'AgentControl.AgentControl', ([], {'state_size': 'state_size', 'action_size': 'action_size'}), '(state_size=state_size, action_size=action_size)\n', (365, 413), False, 'import AgentControl\n'), ((437, 487), 'Memory.Memory', 'Memory.Memory', (['state_size', 'action_size', 'batc...
# -*- coding: utf-8 -*- import numpy as np import speechpy from scipy.io import wavfile from python_speech_features import mfcc class PythonMFCCFeatureExtraction(): def __init__(self): pass def audio2features(self, input_path): (rate, sig) = wavfile.read(input_path) mfcc_feat = mfcc(...
[ "python_speech_features.mfcc", "speechpy.processing.cmvnw", "scipy.io.wavfile.read", "numpy.append" ]
[((270, 294), 'scipy.io.wavfile.read', 'wavfile.read', (['input_path'], {}), '(input_path)\n', (282, 294), False, 'from scipy.io import wavfile\n'), ((315, 393), 'python_speech_features.mfcc', 'mfcc', (['sig'], {'dither': '(0)', 'highfreq': '(7700)', 'useEnergy': '(True)', 'wintype': '"""povey"""', 'numcep': '(23)'}), ...
import torch from torch import nn import torch.nn.functional as nf from torch.nn import init from torch.autograd import Variable import numpy as np from chainer.links.loss.hierarchical_softmax import TreeParser #class HSM(nn.Module): # def __init__(self, input_size, vocab_size): class HSBad(nn.Module): def __ini...
[ "chainer.links.loss.hierarchical_softmax.TreeParser", "torch.Tensor", "torch.from_numpy", "torch.cat", "torch.nn.functional.cross_entropy", "torch.nn.Linear", "numpy.cumsum", "torch.autograd.Variable", "torch.nn.init.kaiming_normal", "torch.nn.Embedding" ]
[((463, 528), 'torch.nn.Linear', 'nn.Linear', ([], {'in_features': 'self.input_size', 'out_features': 'self.n_vocab'}), '(in_features=self.input_size, out_features=self.n_vocab)\n', (472, 528), False, 'from torch import nn\n'), ((648, 670), 'torch.nn.functional.cross_entropy', 'nf.cross_entropy', (['v', 't'], {}), '(v,...
# -*- coding: utf-8 -*- """Classifying Images with Pre-trained ImageNet CNNs. Let’s learn how to classify images with pre-trained Convolutional Neural Networks using the Keras library. Example: $ python imagenet_pretrained.py --image example_images/example_01.jpg --model vgg16 $ python imagenet_pretrained.py ...
[ "keras.preprocessing.image.img_to_array", "cv2.imread", "argparse.ArgumentParser", "cv2.imshow", "cv2.waitKey", "numpy.expand_dims", "keras.applications.imagenet_utils.decode_predictions", "keras.preprocessing.image.load_img" ]
[((1752, 1777), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1775, 1777), False, 'import argparse\n'), ((3554, 3602), 'keras.preprocessing.image.load_img', 'load_img', (["args['image']"], {'target_size': 'input_shape'}), "(args['image'], target_size=input_shape)\n", (3562, 3602), False, 'fro...
import numpy as np from matplotlib import pyplot as plt N = 30 y = np.random.rand(N) plt.plot(y,'bo')
[ "matplotlib.pyplot.plot", "numpy.random.rand" ]
[((68, 85), 'numpy.random.rand', 'np.random.rand', (['N'], {}), '(N)\n', (82, 85), True, 'import numpy as np\n'), ((87, 104), 'matplotlib.pyplot.plot', 'plt.plot', (['y', '"""bo"""'], {}), "(y, 'bo')\n", (95, 104), True, 'from matplotlib import pyplot as plt\n')]
import tensorflow as tf from robust_offline_contextual_bandits.named_results import NamedResults import numpy as np class NamedResultsTest(tf.test.TestCase): def setUp(self): np.random.seed(42) def test_creation(self): patient = NamedResults(np.random.normal(size=[10, 3])) assert pati...
[ "numpy.random.normal", "numpy.random.seed", "tensorflow.test.main" ]
[((663, 677), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (675, 677), True, 'import tensorflow as tf\n'), ((189, 207), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (203, 207), True, 'import numpy as np\n'), ((269, 299), 'numpy.random.normal', 'np.random.normal', ([], {'size': '[10, 3]'...
import matplotlib.pyplot as plt import numpy as np def plot_convolution(f, g): fig, (ax1, ax2, ax3) = plt.subplots(3, 1) ax1.set_yticklabels([]) ax1.set_xticklabels([]) ax1.plot(f, color='blue', label='f') ax1.legend() ax2.set_yticklabels([]) ax2.set_xticklabels([]) ax2.plot(g, color=...
[ "numpy.convolve", "numpy.roll", "numpy.zeros", "numpy.linspace", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((1427, 1442), 'numpy.zeros', 'np.zeros', (['(30000)'], {}), '(30000)\n', (1435, 1442), True, 'import numpy as np\n'), ((1477, 1492), 'numpy.zeros', 'np.zeros', (['(30000)'], {}), '(30000)\n', (1485, 1492), True, 'import numpy as np\n'), ((1515, 1539), 'numpy.linspace', 'np.linspace', (['(1)', '(0)', '(10000)'], {}), ...
from __future__ import print_function from amd.rali.plugin.tf import RALIIterator from amd.rali.pipeline import Pipeline import amd.rali.ops as ops import amd.rali.types as types import sys import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import numpy as np ############################### HYPER PARAMETERS F...
[ "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.compat.v1.FixedLenFeature", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.nn.relu", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.nn.softmax", "tensorflow.compat.v1.argmax", "tenso...
[((225, 249), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (247, 249), True, 'import tensorflow.compat.v1 as tf\n'), ((1547, 1566), 'tensorflow.compat.v1.nn.relu', 'tf.nn.relu', (['layer_1'], {}), '(layer_1)\n', (1557, 1566), True, 'import tensorflow.compat.v1 as tf\n'), ((164...
from constants import Constants import numpy as np # TODO finish implementing all regions of the atmosphere class ISA(Constants): def __init__(self, altitude=0): """ Calculates International Standard Atmosphere properties for the specified geo-potential altitude :param float altitude: Geo-potent...
[ "numpy.exp" ]
[((1141, 1189), 'numpy.exp', 'np.exp', (['(-1 * (self.g * (h - 11000.0) / (R * T0)))'], {}), '(-1 * (self.g * (h - 11000.0) / (R * T0)))\n', (1147, 1189), True, 'import numpy as np\n')]
import sys import soundcard import numpy import pytest skip_if_not_linux = pytest.mark.skipif(sys.platform != 'linux', reason='Only implemented for PulseAudio so far') ones = numpy.ones(1024) signal = numpy.concatenate([[ones], [-ones]]).T def test_speakers(): for speaker in soundcard.all_speakers(): ass...
[ "soundcard.get_microphone", "soundcard.all_speakers", "soundcard.get_name", "soundcard.all_microphones", "numpy.ones", "soundcard.default_microphone", "soundcard.default_speaker", "soundcard.set_name", "pytest.mark.parametrize", "soundcard.get_speaker", "numpy.concatenate", "pytest.mark.skipif...
[((76, 173), 'pytest.mark.skipif', 'pytest.mark.skipif', (["(sys.platform != 'linux')"], {'reason': '"""Only implemented for PulseAudio so far"""'}), "(sys.platform != 'linux', reason=\n 'Only implemented for PulseAudio so far')\n", (94, 173), False, 'import pytest\n'), ((177, 193), 'numpy.ones', 'numpy.ones', (['(1...
import os from sys import argv, stdout os.environ["CUDA_VISIBLE_DEVICES"]="-1" import tensorflow as tf import numpy as np import scipy import scipy.io from itertools import product as prod import time from tensorflow.python.client import timeline import cProfile from sys import argv, stdout from get_data import * impo...
[ "tensorflow.reset_default_graph", "numpy.reshape", "tensorflow.placeholder", "tensorflow.train.Saver", "tensorflow.Session", "numpy.array", "numpy.linalg.norm", "tensorflow.ConfigProto", "numpy.shape" ]
[((3720, 3787), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, params.n_ts, params.controls_nb]'], {}), '(tf.float32, [None, params.n_ts, params.controls_nb])\n', (3734, 3787), True, 'import tensorflow as tf\n'), ((3822, 3899), 'tensorflow.placeholder', 'tf.placeholder', (['tf.complex128', '[None, ...
from typing import Dict, List, Any import numpy from overrides import overrides from ..instance import TextInstance, IndexedInstance from ...data_indexer import DataIndexer class TaggingInstance(TextInstance): """ A ``TaggingInstance`` represents a passage of text and a tag sequence over that text. The...
[ "numpy.asarray" ]
[((3384, 3431), 'numpy.asarray', 'numpy.asarray', (['self.text_indices'], {'dtype': '"""int32"""'}), "(self.text_indices, dtype='int32')\n", (3397, 3431), False, 'import numpy\n'), ((3454, 3494), 'numpy.asarray', 'numpy.asarray', (['self.label'], {'dtype': '"""int32"""'}), "(self.label, dtype='int32')\n", (3467, 3494),...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun May 23 19:53:22 2021 @author: <NAME> (<EMAIL>) at USTC This script refers to some theories and codes of Obspy/MoPaD/Introduction to Seismology (Yongge Wan): 1) The MoPaD program (https://github.com/geophysics/MoPaD); 2) str_dip_rake to mt; 3...
[ "numpy.trace", "numpy.log10", "numpy.linalg.eig", "numpy.cross", "math.acos", "math.tan", "math.sqrt", "math.cos", "numpy.array", "numpy.linspace", "numpy.argsort", "numpy.outer", "math.atan2", "numpy.linalg.norm", "math.sin" ]
[((5395, 5409), 'numpy.cross', 'np.cross', (['P', 'T'], {}), '(P, T)\n', (5403, 5409), True, 'import numpy as np\n'), ((6191, 6207), 'numpy.linalg.eig', 'np.linalg.eig', (['M'], {}), '(M)\n', (6204, 6207), True, 'import numpy as np\n'), ((7085, 7106), 'math.sqrt', 'sqrt', (['(x ** 2 + y ** 2)'], {}), '(x ** 2 + y ** 2)...
import matplotlib import numpy as np import time # matplotlib.use('Agg') import matplotlib.pyplot as plt VOC_BBOX_LABEL_NAMES = ( 'fly', 'bike', 'bird', 'boat', 'pin', 'bus', 'c', 'cat', 'chair', 'cow', 'table', 'dog', 'horse', 'moto', 'p', 'plant', ...
[ "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.roll", "matplotlib.pyplot.Rectangle" ]
[((3262, 3285), 'numpy.roll', 'np.roll', (['buf', '(3)'], {'axis': '(2)'}), '(buf, 3, axis=2)\n', (3269, 3285), True, 'import numpy as np\n'), ((3462, 3473), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (3471, 3473), True, 'import matplotlib.pyplot as plt\n'), ((915, 927), 'matplotlib.pyplot.figure', 'plt....
import julia import numpy as np import os.path as osp import gym from brl_gym.envs.mujoco import box_pusher env = box_pusher.BoxPusher() rlopt = "/home/gilwoo/School_Workspace/rlopt" j = julia.Julia() j.include(osp.join(rlopt, "_init.jl")) j.include(osp.join(rlopt, "src/pg/Baseline.jl")) j.include(osp.join(rlopt, "sr...
[ "brl_gym.envs.mujoco.box_pusher.BoxPusher", "os.path.join", "julia.Julia", "IPython.embed", "numpy.squeeze" ]
[((114, 136), 'brl_gym.envs.mujoco.box_pusher.BoxPusher', 'box_pusher.BoxPusher', ([], {}), '()\n', (134, 136), False, 'from brl_gym.envs.mujoco import box_pusher\n'), ((188, 201), 'julia.Julia', 'julia.Julia', ([], {}), '()\n', (199, 201), False, 'import julia\n'), ((1570, 1585), 'IPython.embed', 'IPython.embed', ([],...
import numpy as np from scipy.optimize import fmin from scipy.stats import kurtosis from scipy.special import lambertw """ The algorithm is based on [1]. The implementation is based on [2]. [1]: <NAME>, 2013 (https://arxiv.org/pdf/1010.2265.pdf) [2]: <NAME>, 2015 (https://github.com/gregversteeg/gaussianize) """ d...
[ "numpy.mean", "numpy.median", "numpy.sqrt", "scipy.special.lambertw", "scipy.stats.kurtosis", "numpy.log", "numpy.exp", "numpy.errstate", "numpy.array", "numpy.isfinite", "numpy.sign", "numpy.std" ]
[((2216, 2253), 'scipy.stats.kurtosis', 'kurtosis', (['z'], {'fisher': '(False)', 'bias': '(False)'}), '(z, fisher=False, bias=False)\n', (2224, 2253), False, 'from scipy.stats import kurtosis\n'), ((779, 789), 'numpy.sign', 'np.sign', (['z'], {}), '(z)\n', (786, 789), True, 'import numpy as np\n'), ((1214, 1223), 'num...
import unittest import numpy as np import pandas as pd from sklearn import datasets from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from punk.feature_selection import PCAFeatures from punk.feature_selection import RFFeatures class TestPCA(unittest.TestCase):...
[ "sklearn.datasets.load_iris", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.datasets.load_boston", "punk.feature_selection.PCAFeatures", "sklearn.preprocessing.StandardScaler", "numpy.array", "numpy.array_equal", "numpy.isfinite", "unittest.main", "punk.feature_selectio...
[((2232, 2247), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2245, 2247), False, 'import unittest\n'), ((409, 429), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (427, 429), False, 'from sklearn import datasets\n'), ((444, 460), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', (...
from unittest import TestCase from tests.assertions import CustomAssertions import scipy.sparse import numpy as np import tests.rabi as rabi import floq class TestSetBlock(TestCase): def setUp(self): self.dim_block = 5 self.n_block = 3 self.a, self.b, self.c, self.d, self.e, self.f, self.g...
[ "numpy.identity", "numpy.ones", "numpy.arange", "floq.evolution._dense_to_sparse", "floq.evolution._add_block", "floq.evolution.assemble_k", "floq.evolution.assemble_dk", "numpy.array", "numpy.zeros", "floq.evolution._find_duplicates", "numpy.array_equal", "floq.evolution.assemble_k_sparse", ...
[((435, 527), 'numpy.bmat', 'np.bmat', (['[[self.a, self.b, self.c], [self.d, self.e, self.f], [self.g, self.h, self.i]]'], {}), '([[self.a, self.b, self.c], [self.d, self.e, self.f], [self.g, self.\n h, self.i]])\n', (442, 527), True, 'import numpy as np\n'), ((597, 613), 'numpy.array', 'np.array', (['matrix'], {})...
text = """ ala ma kota a kot ma ale """ # ------------------------------------------------------------------------------ # TODO as class chars = list(sorted(set(text))) # stabilne indeksy len_chars = len(chars)+1 c_to_i = {c:i+1 for i,c in enumerate(chars)} i_to_c = {i+1:c for i,c in enumerate(chars)} def text_to_i...
[ "keras.models.load_model", "numpy.log", "numpy.argmax", "numpy.random.multinomial", "numpy.exp", "keras.models.Sequential", "keras.layers.LSTM", "numpy.sum", "keras.layers.Dense", "keras.optimizers.RMSprop" ]
[((1137, 1149), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1147, 1149), False, 'from keras.models import Sequential, load_model\n'), ((1338, 1364), 'keras.optimizers.RMSprop', 'RMSprop', ([], {'learning_rate': '(0.1)'}), '(learning_rate=0.1)\n', (1345, 1364), False, 'from keras.optimizers import RMSpro...
import os import os.path as osp import sys import numpy as np from sklearn.svm import LinearSVC from tqdm import tqdm sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__)))) import torch.utils.data as data from dataset.modelnet40 import LatentCapsulesModelNet40, LatentVectorsModelNet40 from utils.utils impo...
[ "sklearn.svm.LinearSVC", "os.path.join", "dataset.modelnet40.LatentCapsulesModelNet40", "numpy.zeros", "dataset.modelnet40.LatentVectorsModelNet40", "torch.utils.data.DataLoader", "os.path.abspath", "utils.utils.initialize_main", "utils.utils.create_save_folder" ]
[((392, 409), 'utils.utils.initialize_main', 'initialize_main', ([], {}), '()\n', (407, 409), False, 'from utils.utils import create_save_folder, initialize_main\n'), ((559, 599), 'os.path.join', 'os.path.join', (['logdir', "args['train_root']"], {}), "(logdir, args['train_root'])\n", (571, 599), False, 'import os\n'),...
# -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod, abstractproperty from collections import Sequence import numpy as np class MatrixBase(object): __metaclass__ = ABCMeta _base_tags = set() @abstractmethod def __init__(self, backend, ioshape, iopacking, tags): self.backend = ...
[ "numpy.unique", "numpy.any" ]
[((3740, 3757), 'numpy.unique', 'np.unique', (['matmap'], {}), '(matmap)\n', (3749, 3757), True, 'import numpy as np\n'), ((3999, 4021), 'numpy.any', 'np.any', (['(stridemap == 0)'], {}), '(stridemap == 0)\n', (4005, 4021), True, 'import numpy as np\n')]
from __future__ import division import argparse, logging, os, math, tqdm import numpy as np import mxnet as mx from mxnet import gluon, nd, image from mxnet.gluon.data.vision import transforms import matplotlib.pyplot as plt import gluoncv as gcv from gluoncv import data from gluoncv.data import mscoco from gluoncv....
[ "gluoncv.data.transforms.presets.yolo.load_test", "mxnet.nd.sign", "gluoncv.data.transforms.pose.get_final_preds", "numpy.array", "mxnet.nd.zeros_like", "gluoncv.data.transforms.pose.get_max_pred", "argparse.ArgumentParser", "matplotlib.pyplot.scatter", "mxnet.nd.array", "matplotlib.pyplot.ylim", ...
[((415, 502), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Predict ImageNet classes from a given image"""'}), "(description=\n 'Predict ImageNet classes from a given image')\n", (438, 502), False, 'import argparse, logging, os, math, tqdm\n'), ((2061, 2083), 'mxnet.nd.stack', 'nd.st...
import cv2 import numpy as np import random as rd import os from tensorflow.keras.models import Sequential, Model from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten from tensorflow.keras.layers import Conv2D, MaxPooling2D, Input from tensorflow.keras.optimizers import Adadelta from tensorflow.keras...
[ "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "os.rename", "os.path.join", "numpy.asarray", "tensorflow.keras.optimizers.Adadelta", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.callbacks.EarlyStopping", "random.random", "tensorflow.keras.layers.Dense"...
[((1236, 1272), 'tensorflow.keras.models.Model', 'Model', (['img_input', 'x'], {'name': '"""calvonet"""'}), "(img_input, x, name='calvonet')\n", (1241, 1272), False, 'from tensorflow.keras.models import Sequential, Model\n'), ((4349, 4388), 'os.path.join', 'os.path.join', (["(output_model_path + '.h5')"], {}), "(output...
# -*- coding: utf-8 -*- import logging logger = logging.getLogger() logger.basicConfig = logging.basicConfig(level=logging.DEBUG) import numpy as np import matplotlib.pyplot as plt import logictensornetworks_wrapper as ltnw nr_samples=500 data=np.random.uniform([0,0],[1.,1.],(nr_samples,2)).astype(np.float32) data_A...
[ "logging.getLogger", "logging.basicConfig", "logictensornetworks_wrapper.constant", "logictensornetworks_wrapper.variable", "matplotlib.pyplot.colorbar", "logictensornetworks_wrapper.train", "numpy.square", "logictensornetworks_wrapper.predicate", "logictensornetworks_wrapper.axiom", "logictensorn...
[((48, 67), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (65, 67), False, 'import logging\n'), ((89, 129), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (108, 129), False, 'import logging\n'), ((448, 476), 'logictensornetworks_wrapper.variable'...
""" Module description: """ __version__ = '0.3.1' __author__ = '<NAME>, <NAME>' __email__ = '<EMAIL>, <EMAIL>' import tensorflow as tf import numpy as np import random class Sampler(): def __init__(self, indexed_ratings=None, m=None, num_users=None, num_items=None, transactions=None, batch_size=512, random_seed=...
[ "tensorflow.data.Dataset.from_generator", "numpy.random.seed", "random.seed" ]
[((333, 360), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (347, 360), True, 'import numpy as np\n'), ((369, 393), 'random.seed', 'random.seed', (['random_seed'], {}), '(random_seed)\n', (380, 393), False, 'import random\n'), ((2386, 2498), 'tensorflow.data.Dataset.from_generator', '...
import os import sys import requests import logging import time import json import pandas as pd import numpy as np from concurrent.futures import ProcessPoolExecutor from git import Git class FPL_Gameweek: """ Get the Gameweek state """ def __init__(self, logger, season_data): """ Args: ...
[ "logging.basicConfig", "logging.getLogger", "os.path.exists", "pandas.DataFrame", "os.makedirs", "git.Git", "os.path.join", "requests.get", "time.sleep", "numpy.random.randint", "concurrent.futures.ProcessPoolExecutor", "json.load" ]
[((8774, 8849), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s - %(message)s"""'}), "(level=logging.INFO, format='%(asctime)s - %(message)s')\n", (8793, 8849), False, 'import logging\n'), ((8879, 8906), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}),...
from ..function.node import * from ..function.tree import * import numpy as np def generate_tree(name='test'): p_branch = .2 p_infertile = .1 p_channel = 1 - p_branch - p_infertile decay = .25 branch_nodes = [Max, Sum, Mean, Min, Product, Median] infertile_nodes = [Constant, Input, Uniform, N...
[ "numpy.random.choice" ]
[((1244, 1338), 'numpy.random.choice', 'np.random.choice', (["['branch', 'infertile', 'channel']"], {'p': '[p_branch, p_infertile, p_channel]'}), "(['branch', 'infertile', 'channel'], p=[p_branch,\n p_infertile, p_channel])\n", (1260, 1338), True, 'import numpy as np\n'), ((1396, 1426), 'numpy.random.choice', 'np.ra...
import numpy as np import math class virtual_factory(object): def __init__(self, blade_specs , operation, gating_ct, non_gating_ct, options): self.options = options # Blade inputs self.n_webs = blade_specs['n_webs'] ...
[ "numpy.pmt" ]
[((26268, 26325), 'numpy.pmt', 'np.pmt', (['(self.crr / 100.0 / 12.0)', '(life * 12.0)', '(-investment)'], {}), '(self.crr / 100.0 / 12.0, life * 12.0, -investment)\n', (26274, 26325), True, 'import numpy as np\n'), ((24092, 24253), 'numpy.pmt', 'np.pmt', (['(self.crr / 100.0 / 12.0)', 'self.wcp', '(-(self.wcp / 12.0 *...
import numpy as np import pickle as pkl from envs.babyai.oracle.teacher import Teacher class XYCorrections(Teacher): def __init__(self, *args, **kwargs): super(XYCorrections, self).__init__(*args, **kwargs) self.next_state_coords = self.empty_feedback() def empty_feedback(self): """ ...
[ "pickle.dumps", "numpy.zeros", "numpy.concatenate", "numpy.random.uniform" ]
[((541, 572), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(1)'], {'size': '(8)'}), '(0, 1, size=8)\n', (558, 572), True, 'import numpy as np\n'), ((907, 947), 'numpy.concatenate', 'np.concatenate', (['[self.next_state_coords]'], {}), '([self.next_state_coords])\n', (921, 947), True, 'import numpy as np\n'), ...
import torch from torchvision import datasets import shutil import argparse import os import numpy as np from tqdm import tqdm ########### Help ########### ''' #size = (h,w) python split_train_val.py \ --data_dir /Users/aman.gupta/Documents/self/datasets/blank_page_detection/letterbox_training_data/ \ --val...
[ "os.makedirs", "argparse.ArgumentParser", "tqdm.tqdm", "numpy.floor", "os.path.join", "torchvision.datasets.ImageFolder", "os.path.basename", "shutil.copy", "numpy.random.shuffle" ]
[((524, 662), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""this script splits classification data into train and val based on ratio provided by user"""'}), "(description=\n 'this script splits classification data into train and val based on ratio provided by user'\n )\n", (547, 6...
# -*- coding: utf-8 -*- """ Created on Mon Apr 8 11:09:33 2019 @author: 10365 """ #CreateDataSet import numpy as np import sys sys.path.append('../subway_system') sys.path.append('../ato_agent') import TrainAndRoadCharacter as trc import trainRunningModel as trm import pandas as pds import matplotlib.pyplot as pl...
[ "numpy.mat", "TrainAndRoadCharacter.getRoadGradinet", "trainRunningModel.Train_model", "TrainAndRoadCharacter.TrainAndRoadData", "pandas.DataFrame", "atoController.PidController", "TrainAndRoadCharacter.getNextSpeedLimit", "TrainAndRoadCharacter.plotSpeedLimitRoadGrad", "matplotlib.pyplot.plot", "...
[((133, 168), 'sys.path.append', 'sys.path.append', (['"""../subway_system"""'], {}), "('../subway_system')\n", (148, 168), False, 'import sys\n'), ((169, 200), 'sys.path.append', 'sys.path.append', (['"""../ato_agent"""'], {}), "('../ato_agent')\n", (184, 200), False, 'import sys\n'), ((1810, 1843), 'TrainAndRoadChara...
import sys sys.path.insert(0, '../') from mocap.settings import get_amass_validation_files, get_amass_test_files from mocap.math.amass_fk import rotmat2euclidean, exp2euclidean from mocap.visualization.sequence import SequenceVisualizer from mocap.math.mirror_smpl import mirror_p3d from mocap.datasets.dataset import Li...
[ "mocap.datasets.combined.Combined", "sys.path.insert", "mocap.settings.get_amass_validation_files", "mocap.datasets.h36m.H36M_FixedSkeleton", "mocap.datasets.amass.AMASS_SMPL3d", "numpy.array", "mocap.settings.get_amass_test_files", "mocap.visualization.sequence.SequenceVisualizer" ]
[((11, 36), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../"""'], {}), "(0, '../')\n", (26, 36), False, 'import sys\n'), ((617, 645), 'mocap.settings.get_amass_validation_files', 'get_amass_validation_files', ([], {}), '()\n', (643, 645), False, 'from mocap.settings import get_amass_validation_files, get_amass_t...
import matplotlib import matplotlib.pyplot as plt import numpy as np from PySide2.QtWidgets import QVBoxLayout, QWidget from traitlets import HasTraits, Instance, Bool, directional_link from regexport.model import AppState from regexport.views.utils import HasWidget matplotlib.use('Qt5Agg') from matplotlib.backends...
[ "traitlets.directional_link", "matplotlib.backends.backend_qt5agg.NavigationToolbar2QT", "numpy.histogram", "regexport.views.utils.HasWidget.__init__", "matplotlib.use", "traitlets.Instance", "PySide2.QtWidgets.QWidget", "numpy.concatenate", "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", ...
[((269, 293), 'matplotlib.use', 'matplotlib.use', (['"""Qt5Agg"""'], {}), "('Qt5Agg')\n", (283, 293), False, 'import matplotlib\n'), ((470, 507), 'traitlets.Instance', 'Instance', (['np.ndarray'], {'allow_none': '(True)'}), '(np.ndarray, allow_none=True)\n', (478, 507), False, 'from traitlets import HasTraits, Instance...
import logging from typing import Any, Dict, List, NewType import mlflow import numpy as np import pandas as pd import torch import transformers from mlflow.models import ModelSignature from mlflow.pyfunc import PythonModel from mlflow.types import ColSpec, DataType, Schema, TensorSpec from mlflow.utils.environment im...
[ "logging.getLogger", "typing.NewType", "transformers.AutoModelForSequenceClassification.from_pretrained", "transformers.AutoTokenizer.from_pretrained", "numpy.dtype", "transformers.pipeline", "mlflow.types.ColSpec" ]
[((666, 687), 'typing.NewType', 'NewType', (['"""Model"""', 'Any'], {}), "('Model', Any)\n", (673, 687), False, 'from typing import Any, Dict, List, NewType\n'), ((700, 725), 'typing.NewType', 'NewType', (['"""Tokenizer"""', 'Any'], {}), "('Tokenizer', Any)\n", (707, 725), False, 'from typing import Any, Dict, List, Ne...
"Code used to generate data for experiments with synthetic data" import math import typing as ty import numba import numpy as np import torch import torch.nn as nn from numba.experimental import jitclass from tqdm.auto import tqdm class MLP(nn.Module): def __init__( self, *, d_in: int, ...
[ "numpy.ones", "numpy.flatnonzero", "torch.relu", "torch.nn.init.kaiming_normal_", "numba.experimental.jitclass", "math.sqrt", "torch.nn.init._calculate_fan_in_and_fan_out", "numpy.random.randint", "numpy.zeros", "torch.nn.init.uniform_", "torch.nn.Linear", "tqdm.auto.tqdm", "numpy.random.ran...
[((1341, 1556), 'numba.experimental.jitclass', 'jitclass', ([], {'spec': "[('left_children', numba.int64[:]), ('right_children', numba.int64[:]), (\n 'feature', numba.int64[:]), ('threshold', numba.float32[:]), ('value',\n numba.float32[:]), ('is_leaf', numba.int64[:])]"}), "(spec=[('left_children', numba.int64[:...
#!/usr/bin/env python import numpy import storm_analysis import storm_analysis.simulator.pupil_math as pupilMath def test_pupil_math_1(): """ Test GeometryC, intensity, no scaling. """ geo = pupilMath.Geometry(20, 0.1, 0.6, 1.5, 1.4) geo_c = pupilMath.GeometryC(20, 0.1, 0.6, 1.5, 1.4) pf = ...
[ "numpy.allclose", "storm_analysis.simulator.pupil_math.GeometryVectorial", "storm_analysis.simulator.pupil_math.GeometryC", "numpy.linspace", "storm_analysis.simulator.pupil_math.GeometryCVectorial", "storm_analysis.simulator.pupil_math.Geometry" ]
[((211, 253), 'storm_analysis.simulator.pupil_math.Geometry', 'pupilMath.Geometry', (['(20)', '(0.1)', '(0.6)', '(1.5)', '(1.4)'], {}), '(20, 0.1, 0.6, 1.5, 1.4)\n', (229, 253), True, 'import storm_analysis.simulator.pupil_math as pupilMath\n'), ((266, 309), 'storm_analysis.simulator.pupil_math.GeometryC', 'pupilMath.G...
import numpy as np import gdal from ..utils.indexing import _LocIndexer, _iLocIndexer from libpyhat.transform.continuum import continuum_correction from libpyhat.transform.continuum import polynomial, linear, regression class HCube(object): """ A Mixin class for use with the io_gdal.GeoDataset class to o...
[ "numpy.copy", "libpyhat.transform.continuum.continuum_correction", "numpy.array", "numpy.stack", "gdal.Info", "numpy.round" ]
[((2841, 2853), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (2849, 2853), True, 'import numpy as np\n'), ((3684, 3867), 'libpyhat.transform.continuum.continuum_correction', 'continuum_correction', (['self.data', 'self.wavelengths'], {'nodes': 'nodes', 'correction_nodes': 'correction_nodes', 'correction': 'correc...
#!/usr/bin/env python3 """ Tests of ktrain text classification flows """ import sys import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"; os.environ["CUDA_VISIBLE_DEVICES"]="0" sys.path.insert(0,'../..') from unittest import TestCase, main, skip import ktrain def synthetic_multilabel(): import numpy as np ...
[ "sys.path.insert", "keras.layers.GlobalAveragePooling1D", "keras.models.Sequential", "ktrain.get_learner", "numpy.array", "keras.layers.Dense", "unittest.main", "keras.layers.Embedding" ]
[((179, 206), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../.."""'], {}), "(0, '../..')\n", (194, 206), False, 'import sys\n'), ((1700, 1711), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (1708, 1711), True, 'import numpy as np\n'), ((1720, 1731), 'numpy.array', 'np.array', (['Y'], {}), '(Y)\n', (1728, 1731...
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed under the ...
[ "skimpy.analysis.ode.utils.make_flux_fun", "skimpy.io.generate_from_pytfa.FromPyTFA", "pytfa.io.import_matlab_model", "numpy.log", "skimpy.sampling.simple_parameter_sampler.SimpleParameterSampler.Parameters", "pytfa.io.load_thermoDB", "skimpy.sampling.simple_parameter_sampler.SimpleParameterSampler", ...
[((1890, 1948), 'pytfa.io.import_matlab_model', 'import_matlab_model', (['"""../../models/toy_model.mat"""', '"""model"""'], {}), "('../../models/toy_model.mat', 'model')\n", (1909, 1948), False, 'from pytfa.io import import_matlab_model, load_thermoDB\n'), ((2080, 2128), 'pytfa.io.load_thermoDB', 'load_thermoDB', (['"...
""" Usage Instructions: 10-shot sinusoid: python main.py --datasource=sinusoid --logdir=logs/sine/ --metatrain_iterations=70000 --norm=None --update_batch_size=10 10-shot sinusoid baselines: python main.py --datasource=sinusoid --logdir=logs/sine/ --pretrain_iterations=70000 --metatrain_iterati...
[ "numpy.sqrt", "matplotlib.pyplot.fill_between", "numpy.array", "numpy.nanmean", "numpy.sin", "numpy.mean", "tensorflow.slice", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.linspace", "numpy.random.seed", "tensorflow.summary.merge_all", "tensorflow.python.platform.flags.DEFINE_...
[((2210, 2299), 'tensorflow.python.platform.flags.DEFINE_string', 'flags.DEFINE_string', (['"""datasource"""', '"""sinusoid"""', '"""sinusoid or omniglot or miniimagenet"""'], {}), "('datasource', 'sinusoid',\n 'sinusoid or omniglot or miniimagenet')\n", (2229, 2299), False, 'from tensorflow.python.platform import f...
import numpy as np import torch from scipy.stats import norm from codes.worker import ByzantineWorker from codes.aggregator import DecentralizedAggregator class DecentralizedByzantineWorker(ByzantineWorker): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # The target of at...
[ "torch.mean", "torch.stack", "scipy.stats.norm.ppf", "numpy.floor", "torch.std" ]
[((4811, 4833), 'torch.stack', 'torch.stack', (['models', '(1)'], {}), '(models, 1)\n', (4822, 4833), False, 'import torch\n'), ((4847, 4876), 'torch.mean', 'torch.mean', (['stacked_models', '(1)'], {}), '(stacked_models, 1)\n', (4857, 4876), False, 'import torch\n'), ((4891, 4919), 'torch.std', 'torch.std', (['stacked...
import astropy.units as u from astropy.coordinates import Angle, SkyCoord from astropy import wcs from regions import CircleSkyRegion import numpy as np from scipy.stats import expon def estimate_exposure_time(timestamps): ''' Takes numpy datetime64[ns] timestamps and returns an estimates of the exposure time...
[ "numpy.unique", "astropy.coordinates.Angle", "numpy.diff", "numpy.array", "numpy.ma.masked_array", "scipy.stats.expon.ppf", "astropy.wcs.WCS", "astropy.units.quantity_input" ]
[((780, 834), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'ra': 'u.hourangle', 'dec': 'u.deg', 'fov': 'u.deg'}), '(ra=u.hourangle, dec=u.deg, fov=u.deg)\n', (796, 834), True, 'import astropy.units as u\n'), ((1966, 2032), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'event_ra': 'u.hourangle',...
import numpy as np a = np.zeros((10,6)) a[1,4:6] = [2,3] b = a[1,4] print(b) check = np.array([2,3]) for i in range(a.shape[0]): t = int(a[i,4]) idx = int(a[i,5]) if t == 2 and idx == 4: a = np.delete(a,i,0) break else: continue print(a.shape)
[ "numpy.array", "numpy.zeros", "numpy.delete" ]
[((24, 41), 'numpy.zeros', 'np.zeros', (['(10, 6)'], {}), '((10, 6))\n', (32, 41), True, 'import numpy as np\n'), ((88, 104), 'numpy.array', 'np.array', (['[2, 3]'], {}), '([2, 3])\n', (96, 104), True, 'import numpy as np\n'), ((216, 234), 'numpy.delete', 'np.delete', (['a', 'i', '(0)'], {}), '(a, i, 0)\n', (225, 234),...
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #Created by: <NAME> #BE department, University of Pennsylvania ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ import numpy as np import nibabel as nib import os from tqdm import tqdm from functools import partial i...
[ "nibabel.load", "numpy.array", "numpy.gradient", "os.path.exists", "numpy.mean", "os.listdir", "numpy.asarray", "numpy.eye", "numpy.std", "numpy.transpose", "numpy.median", "data_utils.surface_distance.compute_robust_hausdorff", "numpy.unique", "os.makedirs", "tqdm.tqdm", "os.path.join...
[((588, 609), 'numpy.zeros_like', 'np.zeros_like', (['labels'], {}), '(labels)\n', (601, 609), True, 'import numpy as np\n'), ((631, 668), 'numpy.unique', 'np.unique', (['labels'], {'return_counts': '(True)'}), '(labels, return_counts=True)\n', (640, 668), True, 'import numpy as np\n'), ((687, 704), 'numpy.median', 'np...
import tempfile import unittest from pathlib import Path from typing import Iterable import numpy as np from tests.fixtures.algorithms import SupervisedDeviatingFromMean from timeeval import ( TimeEval, Algorithm, Datasets, TrainingType, InputDimensionality, Status, Metric, ResourceCon...
[ "tempfile.TemporaryDirectory", "timeeval.utils.hash_dict.hash_dict", "numpy.testing.assert_array_almost_equal", "pathlib.Path", "timeeval.TimeEval", "timeeval.datasets.Dataset", "tests.fixtures.algorithms.SupervisedDeviatingFromMean", "timeeval.DatasetManager", "timeeval.ResourceConstraints", "tim...
[((615, 653), 'timeeval.DatasetManager', 'DatasetManager', (['"""./tests/example_data"""'], {}), "('./tests/example_data')\n", (629, 653), False, 'from timeeval import TimeEval, Algorithm, Datasets, TrainingType, InputDimensionality, Status, Metric, ResourceConstraints, DatasetManager\n'), ((1207, 1236), 'timeeval.Data...
#========================================================================================== # A very clumsy attemp to read and write data stored in csv files # because I have tried hard to write cutomized data file in .npz and .pt but both gave trouble # so I gave up and now use the old good csv--->but everything is a ...
[ "pandas.read_csv", "csv.writer", "numpy.asarray", "numpy.array", "csv.reader" ]
[((2653, 2686), 'pandas.read_csv', 'pd.read_csv', (['csvPath'], {'header': 'None'}), '(csvPath, header=None)\n', (2664, 2686), True, 'import pandas as pd\n'), ((2708, 2738), 'numpy.asarray', 'np.asarray', (['dataset.iloc[:, 0]'], {}), '(dataset.iloc[:, 0])\n', (2718, 2738), True, 'import numpy as np\n'), ((2762, 2792),...
import os import numpy as np # import jax.numpy as jnp from sklearn.decomposition import TruncatedSVD def Temporal_basis_POD(K, SAVE_T_POD=False, FOLDER_OUT='./',n_Modes=10): """ This method computes the POD basis. For some theoretical insights, you can find the theoretical background of the proper orth...
[ "os.makedirs", "numpy.savez", "numpy.sqrt", "sklearn.decomposition.TruncatedSVD" ]
[((1438, 1459), 'sklearn.decomposition.TruncatedSVD', 'TruncatedSVD', (['n_Modes'], {}), '(n_Modes)\n', (1450, 1459), False, 'from sklearn.decomposition import TruncatedSVD\n'), ((1561, 1578), 'numpy.sqrt', 'np.sqrt', (['Lambda_P'], {}), '(Lambda_P)\n', (1568, 1578), True, 'import numpy as np\n'), ((1611, 1659), 'os.ma...
import numpy as np import pandas as pd import torch import src.configuration as C import src.dataset as dataset import src.models as models import src.utils as utils from pathlib import Path from fastprogress import progress_bar if __name__ == "__main__": args = utils.get_sed_parser().parse_args() config =...
[ "src.utils.get_sed_parser", "src.configuration.get_metadata", "src.models.get_model_for_inference", "pathlib.Path", "fastprogress.progress_bar", "src.configuration.get_device", "src.configuration.get_split", "pandas.read_csv", "src.configuration.get_sed_inference_loader", "torch.cuda.is_available"...
[((321, 351), 'src.utils.load_config', 'utils.load_config', (['args.config'], {}), '(args.config)\n', (338, 351), True, 'import src.utils as utils\n'), ((409, 442), 'pathlib.Path', 'Path', (["global_params['output_dir']"], {}), "(global_params['output_dir'])\n", (413, 442), False, 'from pathlib import Path\n'), ((498, ...
import os import numpy as np from ._population import Population from pychemia import pcm_log from pychemia.utils.mathematics import spherical_to_cartesian, cartesian_to_spherical, rotate_towards_axis, \ angle_between_vectors from pychemia.code.vasp import read_incar, read_poscar, VaspJob, VaspOutput from pychemia....
[ "pychemia.code.vasp.VaspJob", "numpy.ones", "pychemia.code.vasp.read_poscar", "pychemia.utils.mathematics.angle_between_vectors", "pychemia.code.vasp.read_incar", "pychemia.utils.mathematics.spherical_to_cartesian", "pychemia.crystal.KPoints.optimized_grid", "numpy.random.rand", "os.path.isfile", ...
[((785, 826), 'pychemia.code.vasp.read_incar', 'read_incar', (["(source_dir + os.sep + 'INCAR')"], {}), "(source_dir + os.sep + 'INCAR')\n", (795, 826), False, 'from pychemia.code.vasp import read_incar, read_poscar, VaspJob, VaspOutput\n'), ((928, 971), 'pychemia.code.vasp.read_poscar', 'read_poscar', (["(source_dir +...
# -*- coding: utf-8 -*- """Generator reserve plots. This module creates plots of reserve provision and shortage at the generation and region level. @author: <NAME> """ import logging import numpy as np import pandas as pd import datetime as dt import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib...
[ "logging.getLogger", "marmot.plottingmodules.plotutils.plot_library.create_stackplot", "matplotlib.pyplot.ylabel", "numpy.array", "marmot.plottingmodules.plotutils.plot_data_helper.PlotDataHelper.get_sub_hour_interval_count", "datetime.timedelta", "marmot.plottingmodules.plotutils.plot_exceptions.Missin...
[((1826, 1870), 'logging.getLogger', 'logging.getLogger', (["('marmot_plot.' + __name__)"], {}), "('marmot_plot.' + __name__)\n", (1843, 1870), False, 'import logging\n'), ((1901, 1951), 'marmot.config.mconfig.parser', 'mconfig.parser', (['"""axes_options"""', '"""y_axes_decimalpt"""'], {}), "('axes_options', 'y_axes_d...
import numpy as np import pandas as p from datetime import datetime, timedelta class PreprocessData(): def __init__(self, file_name): self.file_name = file_name #get only used feature parameters def get_features(self, file_name): data = p.read_csv(file_name, skiprows=7, sep=';', header=Non...
[ "pandas.read_csv", "datetime.datetime.strptime", "numpy.append", "datetime.timedelta", "pandas.concat" ]
[((267, 322), 'pandas.read_csv', 'p.read_csv', (['file_name'], {'skiprows': '(7)', 'sep': '""";"""', 'header': 'None'}), "(file_name, skiprows=7, sep=';', header=None)\n", (277, 322), True, 'import pandas as p\n'), ((1485, 1564), 'pandas.concat', 'p.concat', (['[data_date, data_time, wind_direction, cloud_rate, temp_da...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Datasets ================== Classes for dataset handling Dataset - Base class ^^^^^^^^^^^^^^^^^^^^ This is the base class, and all the specialized datasets are inherited from it. One should never use base class itself. Usage examples: .. code-block:: python :lin...
[ "logging.getLogger", "tarfile.open", "zipfile.ZipFile", "numpy.array", "itertools.izip", "sys.exit", "socket.setdefaulttimeout", "os.walk", "os.remove", "os.listdir", "numpy.diff", "os.path.split", "os.path.isdir", "csv.reader", "os.path.relpath", "numpy.abs", "collections.OrderedDic...
[((7552, 7611), 'os.path.join', 'os.path.join', (['self.local_path', 'self.evaluation_setup_folder'], {}), '(self.local_path, self.evaluation_setup_folder)\n', (7564, 7611), False, 'import os\n'), ((8138, 8193), 'os.path.join', 'os.path.join', (['self.local_path', 'self.error_meta_filename'], {}), '(self.local_path, se...
#!/usr/bin/env python3 from astropy.modeling.models import Const1D, Const2D, Gaussian1D, Gaussian2D from astropy.modeling.fitting import LevMarLSQFitter from astropy.modeling import Fittable2DModel, Parameter import sys import logging import argparse import warnings from datetime import datetime from glob import glob ...
[ "numpy.ptp", "sep.kron_radius", "logging.StreamHandler", "astropy.table.Table", "numpy.array", "sep.Background", "numpy.isfinite", "astropy.io.fits.open", "astropy.modeling.models.Const2D", "numpy.mean", "argparse.ArgumentParser", "numpy.ma.count", "astropy.modeling.Parameter", "astropy.wc...
[((658, 683), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (681, 683), False, 'import argparse\n'), ((4104, 4137), 'logging.Logger', 'logging.Logger', (['"""LMI Add Catalog"""'], {}), "('LMI Add Catalog')\n", (4118, 4137), False, 'import logging\n'), ((4923, 4972), 'warnings.simplefilter', 'w...
# Some of the implementation inspired by: # REF: https://github.com/fchen365/epca import time from abc import abstractmethod import numpy as np from factor_analyzer import Rotator from sklearn.base import BaseEstimator from sklearn.preprocessing import StandardScaler from sklearn.utils import check_array from graspo...
[ "factor_analyzer.Rotator", "numpy.abs", "numpy.sqrt", "graspologic.embed.selectSVD", "numpy.argsort", "sklearn.preprocessing.StandardScaler", "numpy.linalg.norm", "time.time" ]
[((654, 709), 'graspologic.embed.selectSVD', 'selectSVD', (['X'], {'n_components': 'X.shape[1]', 'algorithm': '"""full"""'}), "(X, n_components=X.shape[1], algorithm='full')\n", (663, 709), False, 'from graspologic.embed import selectSVD\n'), ((817, 872), 'graspologic.embed.selectSVD', 'selectSVD', (['X'], {'n_componen...
""" Generate download locations within a country and download them. Written by <NAME>. 5/2020 """ import os import configparser import math import pandas as pd import numpy as np import random import geopandas as gpd from shapely.geometry import Point import requests import matplotlib.pyplot as plt from PIL import Ima...
[ "random.uniform", "os.listdir", "os.makedirs", "matplotlib.pyplot.imsave", "os.path.join", "math.sqrt", "random.seed", "shapely.geometry.Point", "time.sleep", "numpy.linspace", "utils.PlanetDownloader", "sys.path.append" ]
[((437, 462), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (452, 462), False, 'import sys\n'), ((602, 645), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""data"""', '"""countries"""'], {}), "(BASE_DIR, 'data', 'countries')\n", (614, 645), False, 'import os\n'), ((657, 707), 'os.path.join...
# -*- coding: utf-8 -*- """ The Neural Network classifier for IRIS. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import urllib import numpy as np import tensorflow as tf # Data sets IRIS_TRAINING = "IRIS_data/iris_training.csv" IRIS_TRAINI...
[ "os.path.exists", "tensorflow.estimator.DNNClassifier", "tensorflow.contrib.learn.datasets.base.load_csv_with_header", "tensorflow.estimator.inputs.numpy_input_fn", "tensorflow.feature_column.numeric_column", "numpy.array", "urllib.request.urlopen" ]
[((982, 1107), 'tensorflow.contrib.learn.datasets.base.load_csv_with_header', 'tf.contrib.learn.datasets.base.load_csv_with_header', ([], {'filename': 'IRIS_TRAINING', 'target_dtype': 'np.int', 'features_dtype': 'np.float'}), '(filename=IRIS_TRAINING,\n target_dtype=np.int, features_dtype=np.float)\n', (1033, 1107),...
#!/usr/bin/env python """ nearest_cloud.py - Version 1.0 2013-07-28 Compute the COG of the nearest object in x-y-z space and publish as a PoseStamped message. Relies on PCL ROS nodelets in the launch file to pre-filter the cloud on the x, y and z dimensions. Based on the follower app...
[ "rospy.init_node", "cv2.fitEllipse", "sensor_msgs.point_cloud2.read_points", "numpy.mean", "geometry_msgs.msg.Quaternion", "rospy.spin", "rospy.Subscriber", "rospy.get_param", "math.radians", "rospy.Time.now", "geometry_msgs.msg.Point", "rospy.Publisher", "rospy.loginfo", "rospy.wait_for_m...
[((1422, 1454), 'rospy.init_node', 'rospy.init_node', (['"""nearest_cloud"""'], {}), "('nearest_cloud')\n", (1437, 1454), False, 'import rospy\n'), ((1490, 1524), 'rospy.get_param', 'rospy.get_param', (['"""~min_points"""', '(25)'], {}), "('~min_points', 25)\n", (1505, 1524), False, 'import rospy\n'), ((1553, 1590), 'r...
import torch from data import get_diff import editdistance import re from data import chars from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence import matplotlib.pyplot as plt from matplotlib import pylab import numpy as np char_to_idx = {ch: i for i, ch in enumerate(chars)} device = torch.device...
[ "torch.manual_seed", "numpy.mean", "torch.device", "torch.topk", "torch.load", "matplotlib.pyplot.close", "torch.no_grad", "torch.cuda.is_available", "matplotlib.pyplot.subplots", "torch.save", "matplotlib.pyplot.scatter", "torch.nn.utils.rnn.pack_padded_sequence", "re.sub", "editdistance....
[((371, 391), 'torch.manual_seed', 'torch.manual_seed', (['(0)'], {}), '(0)\n', (388, 391), False, 'import torch\n'), ((4898, 4923), 'torch.zeros', 'torch.zeros', (['output.shape'], {}), '(output.shape)\n', (4909, 4923), False, 'import torch\n'), ((4939, 4967), 'torch.topk', 'torch.topk', (['output', '(3)'], {'dim': '(...
import numpy as np import pydicom as dicom def read_dicom(filename): """Read DICOM file and convert it to a decent quality uint8 image. Parameters ---------- filename: str Existing DICOM file filename. """ try: data = dicom.read_file(filename) img = np.frombuffer(data....
[ "numpy.frombuffer", "numpy.ones", "numpy.diff", "numpy.argsort", "pydicom.read_file", "numpy.percentile" ]
[((950, 988), 'numpy.percentile', 'np.percentile', (['img', '[cut_min, cut_max]'], {}), '(img, [cut_min, cut_max])\n', (963, 988), True, 'import numpy as np\n'), ((261, 286), 'pydicom.read_file', 'dicom.read_file', (['filename'], {}), '(filename)\n', (276, 286), True, 'import pydicom as dicom\n'), ((1719, 1740), 'numpy...
# AUTOGENERATED! DO NOT EDIT! File to edit: ttbarzp.ipynb (unless otherwise specified). __all__ = ['get_elijah_ttbarzp_cs', 'get_manuel_ttbarzp_cs', 'import47Ddata', 'get47Dfeatures'] # Cell import numpy as np import tensorflow as tf # Cell def get_elijah_ttbarzp_cs(): r""" Contains cross section information...
[ "numpy.load", "tensorflow.keras.utils.get_file" ]
[((2383, 2442), 'tensorflow.keras.utils.get_file', 'tf.keras.utils.get_file', (['f"""{name}.npy"""', "(url + name + '.npy')"], {}), "(f'{name}.npy', url + name + '.npy')\n", (2406, 2442), True, 'import tensorflow as tf\n'), ((2458, 2471), 'numpy.load', 'np.load', (['path'], {}), '(path)\n', (2465, 2471), True, 'import ...
# -*- coding: utf-8 -*- """ Created on Tue Aug 4 11:01:16 2015 @author: hehu """ import matplotlib.pyplot as plt import numpy as np from sklearn.neighbors import KNeighborsClassifier from sklearn.lda import LDA from sklearn.svm import SVC, LinearSVC from sklearn.linear_model import LogisticRegression from sklearn.na...
[ "numpy.array", "numpy.arange", "matplotlib.pyplot.close", "numpy.dot", "numpy.linspace", "numpy.random.seed", "numpy.concatenate", "numpy.argmin", "numpy.hypot", "matplotlib.pyplot.axis", "numpy.tile", "matplotlib.pyplot.savefig", "numpy.ones", "matplotlib.pyplot.title", "numpy.random.ra...
[((788, 816), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '[6, 6]'}), '(figsize=[6, 6])\n', (800, 816), True, 'import matplotlib.pyplot as plt\n'), ((820, 837), 'matplotlib.pyplot.axis', 'plt.axis', (['"""equal"""'], {}), "('equal')\n", (828, 837), True, 'import matplotlib.pyplot as plt\n'), ((5852, ...
import numpy as np import os import os.path as op import cv2 from tqdm import tqdm import multiprocessing from FeatureExtractor import get_gist_C_implementation from utils import ensure_dir, info input_dir = "./dataset/raw_image" catalog = {} paths = [] feats = [] for (root, dirs, files) in os.walk(input_dir): fo...
[ "utils.info", "numpy.savez", "FeatureExtractor.get_gist_C_implementation", "os.path.join", "multiprocessing.Pool", "cv2.imread", "os.walk" ]
[((294, 312), 'os.walk', 'os.walk', (['input_dir'], {}), '(input_dir)\n', (301, 312), False, 'import os\n'), ((547, 598), 'utils.info', 'info', (['"""Extracting GIST descriptor"""'], {'domain': '__file__'}), "('Extracting GIST descriptor', domain=__file__)\n", (551, 598), False, 'from utils import ensure_dir, info\n'),...
"""Spectrum module""" import numpy as np from scipy.stats import norm def pow2db(power: np.array) -> np.array: """ Convert power to decibels https://de.mathworks.com/help/signal/ref/pow2db.html """ return 10.0 * np.log10(power) def db2pow(decibel: np.array) -> np.array: """ Convert deci...
[ "numpy.log10", "numpy.power", "numpy.square", "numpy.apply_along_axis", "numpy.finfo" ]
[((409, 439), 'numpy.power', 'np.power', (['(10.0)', '(decibel / 10.0)'], {}), '(10.0, decibel / 10.0)\n', (417, 439), True, 'import numpy as np\n'), ((1374, 1429), 'numpy.apply_along_axis', 'np.apply_along_axis', (['norm.cdf', '(1)', 'spectrum'], {'scale': 'scale'}), '(norm.cdf, 1, spectrum, scale=scale)\n', (1393, 14...
import numpy as np from sklearn.decomposition import PCA import matplotlib.pyplot as plt def data_to_2d_heatmap(X): pca = PCA(n_components=2) pca.fit(X) X_simple = pca.transform(X) X_simple = np.array(X_simple) # print(X_simple) x_simple = X_simple[:,0] y_simple = X_simple[:,1] # fig, ax = pl...
[ "matplotlib.pyplot.imshow", "numpy.random.rand", "sklearn.decomposition.PCA", "matplotlib.pyplot.clf", "numpy.array", "numpy.histogram2d", "matplotlib.pyplot.show" ]
[((728, 771), 'numpy.random.rand', 'np.random.rand', (['num_samples', 'num_dimensions'], {}), '(num_samples, num_dimensions)\n', (742, 771), True, 'import numpy as np\n'), ((131, 150), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': '(2)'}), '(n_components=2)\n', (134, 150), False, 'from sklearn.decomposition...
from src import tours import numpy as np tolerance = 1e-4 def test_tour_traversal(): square = np.array([[0, 0], [0, 1], [1, 1], [1, 0.]]) tour = [0, 1, 2, 3] assert abs(tours.tour_traversal(tour, square) - 4.) < tolerance
[ "numpy.array", "src.tours.tour_traversal" ]
[((101, 145), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [1, 1], [1, 0.0]]'], {}), '([[0, 0], [0, 1], [1, 1], [1, 0.0]])\n', (109, 145), True, 'import numpy as np\n'), ((184, 218), 'src.tours.tour_traversal', 'tours.tour_traversal', (['tour', 'square'], {}), '(tour, square)\n', (204, 218), False, 'from src import t...
from netCDF4 import Dataset, num2date import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true' import argparse import ast import gc import logging import math import sys import time import numpy as np import pandas as pd import psutil import tensorflow as t...
[ "tensorflow.unstack", "tensorflow.train.Checkpoint", "custom_losses.extract_central_region", "tensorflow.boolean_mask", "custom_losses.cond_rain", "tensorflow.keras.backend.set_epsilon", "utility.load_params", "tensorflow_addons.optimizers.RectifiedAdam", "tensorflow.GradientTape", "models.model_l...
[((593, 631), 'tensorflow.keras.backend.set_floatx', 'tf.keras.backend.set_floatx', (['"""float16"""'], {}), "('float16')\n", (620, 631), True, 'import tensorflow as tf\n'), ((633, 668), 'tensorflow.keras.backend.set_epsilon', 'tf.keras.backend.set_epsilon', (['(0.001)'], {}), '(0.001)\n', (661, 668), True, 'import ten...
import numpy as np from numpy.random import seed seed(1) import pandas as pd from math import sqrt from sklearn.decomposition import PCA ###################################################################### # METRICS ###################################################################### def mse(y, y_hat): """ ...
[ "pandas.Series", "numpy.abs", "sklearn.decomposition.PCA", "pandas.DataFrame.from_dict", "numpy.square", "pandas.Index", "numpy.random.seed", "numpy.maximum", "pandas.concat" ]
[((49, 56), 'numpy.random.seed', 'seed', (['(1)'], {}), '(1)\n', (53, 56), False, 'from numpy.random import seed\n'), ((4958, 5004), 'numpy.maximum', 'np.maximum', (['(tau * delta_y)', '((tau - 1) * delta_y)'], {}), '(tau * delta_y, (tau - 1) * delta_y)\n', (4968, 5004), True, 'import numpy as np\n'), ((6497, 6529), 'p...
# Copyright 2015 Google Inc. 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 a...
[ "numpy.array", "src.exp.bboxes.read_images", "cv2.VideoCapture" ]
[((1432, 1454), 'cv2.VideoCapture', 'cv2.VideoCapture', (['path'], {}), '(path)\n', (1448, 1454), False, 'import cv2\n'), ((1520, 1535), 'src.exp.bboxes.read_images', 'read_images', (['vc'], {}), '(vc)\n', (1531, 1535), False, 'from src.exp.bboxes import read_images\n'), ((1180, 1195), 'numpy.array', 'np.array', (['cli...
""" This module is the computational part of the geometrical module of ToFu """ # Built-in import sys import warnings # Common import numpy as np import scipy.interpolate as scpinterp import scipy.integrate as scpintg if sys.version[0]=='3': from inspect import signature as insp elif sys.version[0]=='2': from...
[ "numpy.sqrt", "tofu.geom._GG.Poly_VolAngTor", "numpy.log", "tofu.geom._GG.discretize_segment2d", "numpy.ascontiguousarray", "numpy.array", "numpy.arctan2", "tofu.geom._GG._Ves_Smesh_Lin_SubFromD_cython", "numpy.nanmin", "numpy.sin", "numpy.arange", "numpy.repeat", "tofu.geom._GG._Ves_Vmesh_T...
[((1201, 1289), 'tofu.geom._GG.Poly_Order', '_GG.Poly_Order', (['Poly'], {'order': '"""C"""', 'Clock': '(False)', 'close': '(True)', 'layout': '"""(cc,N)"""', 'Test': '(True)'}), "(Poly, order='C', Clock=False, close=True, layout='(cc,N)',\n Test=True)\n", (1215, 1289), True, 'import tofu.geom._GG as _GG\n'), ((1768...
"""Random subset dataset. """ import random import numpy as np import torch from torch.utils.data import Dataset from PIL import Image class RandomSubset(Dataset): """Class allows to iterate every epoch through a different random subset of the original dataset. The intention behind this class is to spe...
[ "numpy.array", "PIL.Image.fromarray" ]
[((2511, 2541), 'PIL.Image.fromarray', 'Image.fromarray', (['img'], {'mode': '"""L"""'}), "(img, mode='L')\n", (2526, 2541), False, 'from PIL import Image\n'), ((1013, 1035), 'numpy.array', 'np.array', (['dataset.data'], {}), '(dataset.data)\n', (1021, 1035), True, 'import numpy as np\n'), ((1451, 1476), 'numpy.array',...
import numpy import matplotlib.pyplot as plt x = numpy.random.normal(1.9, 1.0, 109324) plt.hist(x, 100) plt.show()
[ "numpy.random.normal", "matplotlib.pyplot.hist", "matplotlib.pyplot.show" ]
[((50, 87), 'numpy.random.normal', 'numpy.random.normal', (['(1.9)', '(1.0)', '(109324)'], {}), '(1.9, 1.0, 109324)\n', (69, 87), False, 'import numpy\n'), ((89, 105), 'matplotlib.pyplot.hist', 'plt.hist', (['x', '(100)'], {}), '(x, 100)\n', (97, 105), True, 'import matplotlib.pyplot as plt\n'), ((106, 116), 'matplotli...
import numpy as np vector = np.array([5, 10, 15, 20]) equal_to_ten = (vector == 10) print(equal_to_ten) matrix = np.array([[10, 25, 30], [45, 50, 55], [60, 65, 70]]) equal_to_25 = (matrix[:, 1]) == 25 print(equal_to_25) ##Lire le dataset world_alcohol.csv dans la variable world_alcohol world_alcohol = np.genf...
[ "numpy.array", "numpy.genfromtxt" ]
[((29, 54), 'numpy.array', 'np.array', (['[5, 10, 15, 20]'], {}), '([5, 10, 15, 20])\n', (37, 54), True, 'import numpy as np\n'), ((118, 170), 'numpy.array', 'np.array', (['[[10, 25, 30], [45, 50, 55], [60, 65, 70]]'], {}), '([[10, 25, 30], [45, 50, 55], [60, 65, 70]])\n', (126, 170), True, 'import numpy as np\n'), ((3...
# Copyright 2021 Google # # 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, soft...
[ "cirq.equal_up_to_global_phase", "cirq.SWAP", "cirq.CNOT", "cirq.H", "cirq.LineQubit.range", "cirq.Circuit", "cirq.PhasedXZGate", "cirq.Y", "cirq_google.SycamoreGate", "cirq.X", "numpy.all" ]
[((676, 699), 'cirq.LineQubit.range', 'cirq.LineQubit.range', (['(2)'], {}), '(2)\n', (696, 699), False, 'import cirq\n'), ((1893, 1943), 'cirq.equal_up_to_global_phase', 'cirq.equal_up_to_global_phase', (['actual_u', 'desired_u'], {}), '(actual_u, desired_u)\n', (1922, 1943), False, 'import cirq\n'), ((2118, 2145), 'n...
from pyimagesearch.centroidtracker import CentroidTracker from pyimagesearch.trackableobject import TrackableObject from imutils.video import VideoStream from imutils.video import FPS import numpy as np import argparse import imutils import time import dlib import cv2 ap = argparse.ArgumentParser() ap.add_argument("-...
[ "time.sleep", "cv2.imshow", "numpy.array", "cv2.destroyAllWindows", "numpy.arange", "imutils.video.VideoStream", "argparse.ArgumentParser", "dlib.rectangle", "cv2.line", "cv2.dnn.readNetFromCaffe", "cv2.VideoWriter", "imutils.video.FPS", "cv2.VideoWriter_fourcc", "cv2.waitKey", "cv2.dnn....
[((276, 301), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (299, 301), False, 'import argparse\n'), ((1220, 1277), 'cv2.dnn.readNetFromCaffe', 'cv2.dnn.readNetFromCaffe', (["args['prototxt']", "args['model']"], {}), "(args['prototxt'], args['model'])\n", (1244, 1277), False, 'import cv2\n'), ...
from model.BBCluster import CustomSentenceTransformer, OptimCluster, euclid_dist from experiments.treccar_run import prepare_cluster_data_train_only, prepare_cluster_data2, get_trec_dat, \ get_paratext_dict from util.Data import InputTRECCARExample import numpy as np import torch import torch.nn as nn from torch im...
[ "torch.nn.Tanh", "sentence_transformers.models.Transformer", "transformers.get_constant_schedule_with_warmup", "sentence_transformers.util.batch_to_device", "torch.from_numpy", "numpy.array", "torch.cuda.is_available", "torch.utils.tensorboard.SummaryWriter", "torch.nn.Sigmoid", "numpy.mean", "t...
[((960, 975), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (971, 975), False, 'import random\n'), ((976, 997), 'torch.manual_seed', 'torch.manual_seed', (['(42)'], {}), '(42)\n', (993, 997), False, 'import torch\n'), ((998, 1016), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (1012, 1016),...
import solver.algorithms as alg import numpy as np def problem4(t0, tf, NA0, NB0, tauA, tauB, n, returnlist=False): """Uses Euler's method to model the solution to a radioactive decay problem where dNA/dt = -NA/tauA and dNB/dt = NA/tauA - NB/tauB. Args: t0 (float): Start time tf (float): End t...
[ "numpy.array", "solver.algorithms.euler" ]
[((985, 1005), 'numpy.array', 'np.array', (['[NA0, NB0]'], {}), '([NA0, NB0])\n', (993, 1005), True, 'import numpy as np\n'), ((1014, 1063), 'numpy.array', 'np.array', (['[[-1 / tauA, 0], [1 / tauA, -1 / tauB]]'], {}), '([[-1 / tauA, 0], [1 / tauA, -1 / tauB]])\n', (1022, 1063), True, 'import numpy as np\n'), ((1178, 1...
""" File name: extracted_features_gridsearch.py Author: <NAME> Date created: 29.04.2019 """ import numpy as np import sys import os import yaml import pickle import pandas as pd import pandas.core.indexes sys.modules['pandas.indexes'] = pandas.core.indexes import json import time import keras import tensorflow as t...
[ "helper.model.compile", "sklearn.metrics.roc_auc_score", "sklearn.model_selection.ParameterGrid", "os.path.exists", "tensorflow.Session", "yaml.add_constructor", "keras.layers.concatenate", "keras.models.Model", "keras.callbacks.EarlyStopping", "keras.backend.clear_session", "tensorflow.ConfigPr...
[((1166, 1182), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (1180, 1182), True, 'import tensorflow as tf\n'), ((1587, 1622), 'yaml.add_constructor', 'yaml.add_constructor', (['"""!join"""', 'join'], {}), "('!join', join)\n", (1607, 1622), False, 'import yaml\n'), ((2523, 2555), 'multimodal_prediction_...
import pandas as pd import json import numpy as np #DEFINITIONS NAMESPACE = "it.gov.daf.dataset.opendata" def getData(path): if (path.lower().endswith((".json", ".geojson"))): with open(path) as data_file: dataJson = json.load(data_file) return pd.io.json.json_normalize(dataJson, sep='...
[ "json.load", "numpy.dtype", "pandas.io.json.json_normalize", "pandas.read_csv" ]
[((279, 325), 'pandas.io.json.json_normalize', 'pd.io.json.json_normalize', (['dataJson'], {'sep': '""".|."""'}), "(dataJson, sep='.|.')\n", (304, 325), True, 'import pandas as pd\n'), ((991, 1004), 'numpy.dtype', 'np.dtype', (['"""O"""'], {}), "('O')\n", (999, 1004), True, 'import numpy as np\n'), ((1024, 1043), 'nump...
""" Reference: https://matheusfacure.github.io/python-causality-handbook/11-Propensity-Score.html# """ import numpy as np import pandas as pd from sklearn.linear_model import LogisticRegression from sklearn.neighbors import NearestNeighbors import seaborn as sns from matplotlib import pyplot as plt from causalinference...
[ "numpy.mean", "causalinference.CausalModel", "sklearn.linear_model.LogisticRegression", "seaborn.boxplot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((2070, 2116), 'seaborn.boxplot', 'sns.boxplot', ([], {'x': '"""age"""', 'y': '"""pscore"""', 'data': 'data_ps'}), "(x='age', y='pscore', data=data_ps)\n", (2081, 2116), True, 'import seaborn as sns\n'), ((2121, 2154), 'matplotlib.pyplot.title', 'plt.title', (['"""Confounding Evidence"""'], {}), "('Confounding Evidenc...
import numpy as np import theano import theano.tensor as tensor from utils import _p, numpy_floatX from utils import ortho_weight, uniform_weight, zero_bias """ Encoder using LSTM Recurrent Neural Network. """ def param_init_encoder(options, params, prefix='lstm_encoder'): n_x = options['n_x'] n_h = opt...
[ "utils.zero_bias", "utils.ortho_weight", "numpy.ones", "utils.uniform_weight", "utils._p", "theano.tensor.tanh", "utils.numpy_floatX", "theano.tensor.dot" ]
[((826, 844), 'utils.zero_bias', 'zero_bias', (['(4 * n_h)'], {}), '(4 * n_h)\n', (835, 844), False, 'from utils import ortho_weight, uniform_weight, zero_bias\n'), ((553, 568), 'utils._p', '_p', (['prefix', '"""W"""'], {}), "(prefix, 'W')\n", (555, 568), False, 'from utils import _p, numpy_floatX\n'), ((771, 786), 'ut...
import numpy as np import statistics as stat treshold = 3 def removeFalseData(input_data): while(1): try: input_data.remove(False) except ValueError: break return(input_data) def removeNegatives(input_data): processed_data = [] for val in input_d...
[ "statistics.median", "numpy.mean", "numpy.std" ]
[((528, 551), 'statistics.median', 'stat.median', (['input_data'], {}), '(input_data)\n', (539, 551), True, 'import statistics as stat\n'), ((563, 582), 'numpy.mean', 'np.mean', (['input_data'], {}), '(input_data)\n', (570, 582), True, 'import numpy as np\n'), ((596, 614), 'numpy.std', 'np.std', (['input_data'], {}), '...
""" This script contains several car-following control models for flow-controlled vehicles. Controllers can have their output delayed by some duration. Each controller includes functions get_accel(self, env) -> acc - using the current state of the world and existing parameters, uses the control mod...
[ "numpy.abs", "flow.controllers.base_controller.BaseController.__init__", "collections.deque", "numpy.sqrt", "math.cos" ]
[((1966, 2022), 'flow.controllers.base_controller.BaseController.__init__', 'BaseController.__init__', (['self', 'veh_id', 'controller_params'], {}), '(self, veh_id, controller_params)\n', (1989, 2022), False, 'from flow.controllers.base_controller import BaseController\n'), ((2237, 2256), 'collections.deque', 'collect...
""" Unchanged from https://github.com/hughsalimbeni/DGPs_with_IWVI/blob/master/tests/test_gp_layer.py """ import numpy as np import tensorflow as tf tf.logging.set_verbosity(tf.logging.FATAL) import gpflow from dgps_with_iwvi.layers import GPLayer from dgps_with_iwvi.models import DGP_VI def test_gp_layer(): ...
[ "gpflow.kernels.Matern52", "gpflow.settings.get_settings", "numpy.testing.assert_allclose", "tensorflow.logging.set_verbosity", "gpflow.settings.temp_settings", "numpy.linspace", "numpy.random.randn", "gpflow.models.SVGP", "numpy.random.seed", "numpy.cos", "gpflow.kernels.RBF", "numpy.sin", ...
[((152, 194), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.FATAL'], {}), '(tf.logging.FATAL)\n', (176, 194), True, 'import tensorflow as tf\n'), ((359, 376), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (373, 376), True, 'import numpy as np\n'), ((596, 640), 'gpflow.ke...