code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
from _utils import * import json import numpy as np import matplotlib.pyplot as plt import pandas as pd import os import seaborn as sns datadir = "../PPO_Analysis/training_analysis/" figdir = "../PPO_Analysis/" fileList = os.listdir(datadir) paraSetting = ['0503', '0504', '0505', '0506', '0507'] for file in fileList...
[ "os.listdir", "matplotlib.pyplot.savefig", "seaborn.color_palette", "matplotlib.pyplot.ylabel", "pandas.read_csv", "matplotlib.pyplot.legend", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "pandas.DataFrame", "numpy.arange", ...
[((225, 244), 'os.listdir', 'os.listdir', (['datadir'], {}), '(datadir)\n', (235, 244), False, 'import os\n'), ((468, 483), 'numpy.arange', 'np.arange', (['(3)', '(8)'], {}), '(3, 8)\n', (477, 483), True, 'import numpy as np\n'), ((493, 512), 'seaborn.color_palette', 'sns.color_palette', ([], {}), '()\n', (510, 512), T...
"""Marmot Dataset Module.""" from pathlib import Path from typing import List import numpy as np import pytorch_lightning as pl from albumentations import Compose from PIL import Image from torch.utils.data import Dataset, DataLoader class MarmotDataset(Dataset): """Marmot Dataset.""" def __init__(self, da...
[ "PIL.Image.open", "pathlib.Path", "numpy.concatenate", "torch.utils.data.DataLoader" ]
[((3878, 3986), 'torch.utils.data.DataLoader', 'DataLoader', (['self.complaint_train'], {'batch_size': 'self.batch_size', 'shuffle': '(True)', 'num_workers': 'self.num_workers'}), '(self.complaint_train, batch_size=self.batch_size, shuffle=True,\n num_workers=self.num_workers)\n', (3888, 3986), False, 'from torch.ut...
import time, os from pynvml import * from subprocess import Popen import numpy as np nvmlInit() import pandas as pd def run_command(cmd, minmem=2,use_env_variable=True, admissible_gpus=[1],sleep=60): sufficient_memory = False gpu_idx=0 while not sufficient_memory: time.sleep(sleep) # Check...
[ "numpy.minimum", "numpy.argmax", "time.sleep", "pandas.DataFrame", "numpy.maximum", "sys.path.append" ]
[((1360, 1382), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (1375, 1382), False, 'import sys\n'), ((6385, 6438), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'rows_model', 'columns': "['model_path']"}), "(data=rows_model, columns=['model_path'])\n", (6397, 6438), True, 'import pandas as...
import tensorflow as tf import numpy as np import time from capslayer import layers from capslayer import losses from capslayer import ops class SquashTest(tf.test.TestCase): def testSquash(self): """Checks the value and shape of the squash output given an input.""" input_tensor = tf.ones((1, 1,...
[ "tensorflow.ones", "tensorflow.test.main", "capslayer.ops.squash", "numpy.array", "numpy.linalg.norm", "time.time", "capslayer.ops._squash" ]
[((3204, 3218), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (3216, 3218), True, 'import tensorflow as tf\n'), ((306, 333), 'tensorflow.ones', 'tf.ones', (['(1, 1, 1, 1, 1, 1)'], {}), '((1, 1, 1, 1, 1, 1))\n', (313, 333), True, 'import tensorflow as tf\n'), ((353, 377), 'capslayer.ops.squash', 'ops.squash'...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Provide the 'Efficient Lifelong Learning Algorithm' (ELLA). The ELLA algorithm is an online multi-task learning algorithm that maintains a shared knowledge database that can be trained and used to incorporate new knowledge to improve the performance on multiple tasks [1...
[ "torch.abs", "numpy.sum", "torch.zeros", "torch.inverse", "torch.randn" ]
[((8683, 8710), 'torch.zeros', 'torch.zeros', (['(d * k, d * k)'], {}), '((d * k, d * k))\n', (8694, 8710), False, 'import torch\n'), ((8781, 8804), 'torch.zeros', 'torch.zeros', (['(d * k, 1)'], {}), '((d * k, 1))\n', (8792, 8804), False, 'import torch\n'), ((8877, 8891), 'torch.zeros', 'torch.zeros', (['k'], {}), '(k...
from blenderneuron.section import Section import numpy as np import math import numpy as np class BlenderSection(Section): def __init__(self): super(BlenderSection, self).__init__() self.was_split = False self.split_sections = [] def from_full_NEURON_section_dict(sel...
[ "numpy.sqrt", "math.ceil", "numpy.reshape", "numpy.isclose", "numpy.square", "numpy.array", "numpy.sum", "numpy.min", "numpy.cumsum" ]
[((2166, 2186), 'numpy.array', 'np.array', (['self.radii'], {}), '(self.radii)\n', (2174, 2186), True, 'import numpy as np\n'), ((5768, 5783), 'numpy.square', 'np.square', (['diff'], {}), '(diff)\n', (5777, 5783), True, 'import numpy as np\n'), ((5799, 5817), 'numpy.sum', 'np.sum', (['sq'], {'axis': '(1)'}), '(sq, axis...
import pickle import time import numpy as np import torch import tqdm from liga.models import load_data_to_gpu from liga.utils import common_utils def statistics_info(cfg, ret_dict, metric, disp_dict): for cur_thresh in cfg.MODEL.POST_PROCESSING.RECALL_THRESH_LIST: metric['recall_roi_%s' % str(cur_thres...
[ "liga.models.load_data_to_gpu", "numpy.mean", "liga.utils.common_utils.merge_results_dist", "pickle.dump", "liga.utils.common_utils.get_dist_info", "torch.cuda.device_count", "torch.no_grad", "time.time", "torch.nn.parallel.DistributedDataParallel" ]
[((2656, 2667), 'time.time', 'time.time', ([], {}), '()\n', (2665, 2667), False, 'import time\n'), ((2258, 2283), 'torch.cuda.device_count', 'torch.cuda.device_count', ([], {}), '()\n', (2281, 2283), False, 'import torch\n'), ((2347, 2449), 'torch.nn.parallel.DistributedDataParallel', 'torch.nn.parallel.DistributedData...
import numpy as np import networkx as nx import matplotlib.pyplot as plt import threading from threading import Lock, Thread import random import time as timeee transactionCounter = 0 lock = Lock() succesfulAttacks = 0 failedAttacks = 0 class User(object): def __init__(self, id: int, malicious: bool): s...
[ "random.sample", "random.uniform", "threading.Lock", "matplotlib.pyplot.xlabel", "networkx.draw_networkx_nodes", "networkx.OrderedDiGraph", "networkx.draw_networkx_labels", "networkx.get_node_attributes", "matplotlib.pyplot.yticks", "numpy.random.uniform", "time.time" ]
[((193, 199), 'threading.Lock', 'Lock', ([], {}), '()\n', (197, 199), False, 'from threading import Lock, Thread\n'), ((3086, 3099), 'time.time', 'timeee.time', ([], {}), '()\n', (3097, 3099), True, 'import time as timeee\n'), ((3311, 3330), 'networkx.OrderedDiGraph', 'nx.OrderedDiGraph', ([], {}), '()\n', (3328, 3330)...
import scipy.io as sio from pathlib import Path import numpy as np import pyqtgraph as pg from pyqtgraph.Qt import QtGui mask = np.array([np.ones(32), np.ones(32), np.ones(32),np.concatenate((np.zeros(14), np.ones(18))), np.concatenate((np.zeros(14), np.ones(18))), np.concat...
[ "numpy.clip", "numpy.copy", "numpy.mean", "pyqtgraph.Qt.QtGui.QApplication.instance", "numpy.unique", "pyqtgraph.Qt.QtGui.QWidget", "pathlib.Path", "numpy.ones", "scipy.io.loadmat", "pyqtgraph.Qt.QtGui.QGridLayout", "numpy.max", "pyqtgraph.Qt.QtGui.QApplication", "numpy.linspace", "numpy.z...
[((2765, 2834), 'pathlib.Path', 'Path', (['"""../../Data_Collection/3kOhm_FB/data_MT_FabianGeiger_5sess.mat"""'], {}), "('../../Data_Collection/3kOhm_FB/data_MT_FabianGeiger_5sess.mat')\n", (2769, 2834), False, 'from pathlib import Path\n'), ((2845, 2883), 'scipy.io.loadmat', 'sio.loadmat', (['filename'], {'squeeze_me'...
import numpy as np import pandas as pd def classify_prices(discount): price_classification = [] # Change/remove this line for d in discount: if float(d) <= 0: category = 'no_discount' price_classification.append(category) elif 0 <= float(d) <= 0.1: category = 'discounted' price_classification.append(c...
[ "numpy.array", "numpy.loadtxt", "numpy.round" ]
[((1051, 1079), 'numpy.array', 'np.array', (['data'], {'dtype': 'np.int'}), '(data, dtype=np.int)\n', (1059, 1079), True, 'import numpy as np\n'), ((1119, 1148), 'numpy.array', 'np.array', (['data1'], {'dtype': 'np.int'}), '(data1, dtype=np.int)\n', (1127, 1148), True, 'import numpy as np\n'), ((911, 939), 'numpy.loadt...
import os from os.path import expanduser os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"]="0" import numpy as np import tensorflow as tf from copy import deepcopy from sklearn.utils import shuffle HOME_DIR = os.getcwd() seed = 1731 np.random.seed(seed) ...
[ "os.path.exists", "numpy.eye", "numpy.reshape", "os.makedirs", "tensorflow.keras.datasets.mnist.load_data", "sklearn.utils.shuffle", "tensorflow.random.set_random_seed", "numpy.argmax", "os.getcwd", "numpy.random.seed", "copy.deepcopy", "numpy.arange", "numpy.random.shuffle" ]
[((270, 281), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (279, 281), False, 'import os\n'), ((298, 318), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (312, 318), True, 'import numpy as np\n'), ((320, 351), 'tensorflow.random.set_random_seed', 'tf.random.set_random_seed', (['seed'], {}), '(seed)\n...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # etips # # Copyright (c) Siemens AG, 2020 # Authors: # <NAME> <<EMAIL>> # License-Identifier: MIT from pathlib import Path from joblib import dump import numpy as np from sklearn.model_selection import KFold from sklearn.dummy import DummyClassifier from utils import ...
[ "pathlib.Path", "numpy.argmax", "utils.fix_random_seed", "sklearn.dummy.DummyClassifier", "utils.load_counting_data", "sklearn.model_selection.KFold", "joblib.dump" ]
[((405, 423), 'utils.fix_random_seed', 'fix_random_seed', (['(0)'], {}), '(0)\n', (420, 423), False, 'from utils import fix_random_seed, load_counting_data, load_mnist_data\n'), ((439, 455), 'pathlib.Path', 'Path', (['"""../data/"""'], {}), "('../data/')\n", (443, 455), False, 'from pathlib import Path\n'), ((526, 566)...
#!/usr/bin/env python import numpy as np import tensorflow as tf train_X = np.linspace(-1, 1, 100) train_Y = 2 * train_X + np.random.randn(*train_X.shape) * 0.33 + 10 X = tf.placeholder("float") Y = tf.placeholder("float") w = tf.Variable(0.0, name="weight") b = tf.Variable(0.0, name="bias") cost_op = tf.square(Y -...
[ "tensorflow.initialize_all_variables", "tensorflow.Variable", "tensorflow.placeholder", "tensorflow.Session", "tensorflow.train.GradientDescentOptimizer", "numpy.linspace", "numpy.random.randn", "tensorflow.mul" ]
[((77, 100), 'numpy.linspace', 'np.linspace', (['(-1)', '(1)', '(100)'], {}), '(-1, 1, 100)\n', (88, 100), True, 'import numpy as np\n'), ((174, 197), 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""'], {}), "('float')\n", (188, 197), True, 'import tensorflow as tf\n'), ((202, 225), 'tensorflow.placeholder', ...
# Copyright (c) OpenMMLab. All rights reserved. import copy import pytest import torch from mmcv import Config from numpy.testing import assert_almost_equal from mmpose.datasets import DATASETS def test_NVGesture_dataset(): dataset = 'NVGestureDataset' dataset_info = Config.fromfile( 'configs/_base...
[ "mmpose.datasets.DATASETS.get", "numpy.testing.assert_almost_equal", "torch.tensor", "pytest.raises", "copy.deepcopy", "mmcv.Config.fromfile", "torch.zeros" ]
[((380, 401), 'mmpose.datasets.DATASETS.get', 'DATASETS.get', (['dataset'], {}), '(dataset)\n', (392, 401), False, 'from mmpose.datasets import DATASETS\n'), ((582, 605), 'copy.deepcopy', 'copy.deepcopy', (['data_cfg'], {}), '(data_cfg)\n', (595, 605), False, 'import copy\n'), ((1662, 1703), 'numpy.testing.assert_almos...
import operator import threading import functools import itertools import contextlib import collections import numpy as np from ..autoray import ( get_lib_fn, infer_backend, get_dtype_name, register_function, astype, ) _EMPTY_DICT = {} class LazyArray: """A lazy array representing a shaped...
[ "itertools.chain", "networkx.draw_networkx_nodes", "matplotlib.colors.to_rgb", "numpy.arange", "networkx.DiGraph", "functools.wraps", "numpy.max", "matplotlib.pyplot.close", "threading.get_ident", "opt_einsum.parser.parse_einsum_input", "functools.reduce", "numpy.log2", "matplotlib.pyplot.sh...
[((20196, 20365), 'collections.defaultdict', 'collections.defaultdict', (['(lambda : materialize_identity)', '{LazyArray: materialize_larray, tuple: materialize_tuple, list:\n materialize_list, dict: materialize_dict}'], {}), '(lambda : materialize_identity, {LazyArray:\n materialize_larray, tuple: materialize_tu...
import cv2 as cv import numpy as np img = cv.imread('/home/praveen/Desktop/Python/Deep Learning/Open CV/Resources/Photos/cats.jpg') cv.imshow('cats',img) blank=np.zeros(img.shape,dtype='uint8') cv.imshow('blank',blank) gray=cv.cvtColor(img,cv.COLOR_BGR2GRAY) cv.imshow('gray',gray) blur = cv.GaussianBlur(gray,(5,5),...
[ "cv2.drawContours", "cv2.threshold", "cv2.Canny", "cv2.imshow", "numpy.zeros", "cv2.waitKey", "cv2.cvtColor", "cv2.findContours", "cv2.GaussianBlur", "cv2.imread" ]
[((43, 142), 'cv2.imread', 'cv.imread', (['"""/home/praveen/Desktop/Python/Deep Learning/Open CV/Resources/Photos/cats.jpg"""'], {}), "(\n '/home/praveen/Desktop/Python/Deep Learning/Open CV/Resources/Photos/cats.jpg'\n )\n", (52, 142), True, 'import cv2 as cv\n'), ((133, 155), 'cv2.imshow', 'cv.imshow', (['"""ca...
# --- # jupyter: # jupytext: # cell_markers: region,endregion # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.1 # kernelspec: # display_name: Python 3 # language: python # name: pyt...
[ "sklearn.preprocessing.LabelEncoder", "pandas.read_csv", "sklearn.neighbors.KNeighborsClassifier", "matplotlib.pyplot.annotate", "numpy.array", "nltk.corpus.stopwords.words", "sklearn.feature_extraction.text.CountVectorizer", "gensim.models.Word2Vec.load", "IPython.display.Image", "numpy.asarray",...
[((1526, 1660), 'pandas.read_csv', 'pd.read_csv', (['"""../twitter_data/train2017.tsv"""'], {'sep': '"""\t+"""', 'escapechar': '"""\\\\"""', 'engine': '"""python"""', 'names': "['ID_1', 'ID_2', 'Label', 'Text']"}), "('../twitter_data/train2017.tsv', sep='\\t+', escapechar='\\\\',\n engine='python', names=['ID_1', 'I...
import numpy as np import scipy.fftpack as fftpack import audio_dspy as adsp def tf2minphase(h, normalize=True): """Converts a transfer function to minimum phase Parameters ---------- h : ndarray Numpy array containing the original transfer function Returns ------- h_min : ndarra...
[ "numpy.mean", "numpy.abs", "audio_dspy.normalize", "numpy.fft.fft", "numpy.log", "numpy.exp", "numpy.linspace", "numpy.fft.ifft" ]
[((964, 977), 'numpy.fft.fft', 'np.fft.fft', (['h'], {}), '(h)\n', (974, 977), True, 'import numpy as np\n'), ((986, 1014), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', 'N'], {}), '(0, 2 * np.pi, N)\n', (997, 1014), True, 'import numpy as np\n'), ((1033, 1060), 'numpy.exp', 'np.exp', (['(-1.0j * (N / 2) * w...
import sys sys.path.append("..") from .Mesure import * from Ordonnancement import * import numpy as np from scipy import stats class EvalIRModel: """Evaluation d'un modèle d'appariement avec une mesure d'evaluation. ----------------------------------------------------- Parameters: - model : modè...
[ "numpy.square", "numpy.array", "numpy.sum", "scipy.stats.ttest_ind", "sys.path.append" ]
[((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((2481, 2514), 'scipy.stats.ttest_ind', 'stats.ttest_ind', (['scores1', 'scores2'], {}), '(scores1, scores2)\n', (2496, 2514), False, 'from scipy import stats\n'), ((1952, 1967), 'numpy.array', 'np.array'...
import numpy as np from scipy.spatial.distance import squareform from random import randint # there are more efficient algorithms for this # https://people.csail.mit.edu/virgi/6.890/papers/APBP.pdf def max_min(A, B): '''max-min product of two square matrices params: A, B: NxN numpy arrays ''' asse...
[ "numpy.abs", "scipy.spatial.distance.squareform", "numpy.minimum", "numpy.random.choice", "numpy.max", "numpy.diag", "numpy.linalg.norm", "numpy.all", "random.randint" ]
[((1327, 1340), 'numpy.max', 'np.max', (['dists'], {}), '(dists)\n', (1333, 1340), True, 'import numpy as np\n'), ((360, 400), 'numpy.minimum', 'np.minimum', (['A[:, :, None]', 'B[None, :, :]'], {}), '(A[:, :, None], B[None, :, :])\n', (370, 400), True, 'import numpy as np\n'), ((1158, 1187), 'random.randint', 'randint...
import torch import torchvision.models as models import os,sys import numpy as np from matplotlib import pyplot as plt from tqdm import tqdm pwd = os.path.abspath('.') MP3D_build_path = os.path.join(pwd, 'MP3D_Sim', 'build') DASA_path = os.path.join(pwd, 'DASA') sys.path.append(MP3D_build_path) os.chdir(DA...
[ "numpy.radians", "MatterSim.Simulator", "torch.load", "tqdm.tqdm", "os.path.join", "torch.stack", "torch.cuda.set_device", "os.chdir", "numpy.array", "numpy.max", "torchvision.models.resnet152", "numpy.min", "os.path.abspath", "torch.no_grad", "numpy.load", "sys.path.append" ]
[((156, 176), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (171, 176), False, 'import os, sys\n'), ((196, 234), 'os.path.join', 'os.path.join', (['pwd', '"""MP3D_Sim"""', '"""build"""'], {}), "(pwd, 'MP3D_Sim', 'build')\n", (208, 234), False, 'import os, sys\n'), ((248, 273), 'os.path.join', 'os....
#!/usr/bin/python3 import pyaudio import os import numpy as np from scipy.interpolate import UnivariateSpline from scipy.signal import butter, lfilter, filtfilt, resample from scipy.optimize import curve_fit import scipy as sp import time import pygame from pygame.locals import * from pygame import gfxdraw from pygame ...
[ "numpy.log10", "numpy.sqrt", "pygame.init", "SC18IS602B.SC18IS602B", "numpy.column_stack", "time.sleep", "pygame.event.Event", "pygame.time.set_timer", "pygame.font.Font", "RPi.GPIO.setmode", "numpy.arange", "numpy.mean", "pygame.display.set_mode", "os.putenv", "numpy.fft.fft", "pygame...
[((8367, 8384), 'pyaudio.PyAudio', 'pyaudio.PyAudio', ([], {}), '()\n', (8382, 8384), False, 'import pyaudio\n'), ((8581, 8616), 'MCP230XX.MCP230XX', 'MCP230XX', (['"""MCP23008"""'], {'i2cAddress': '(32)'}), "('MCP23008', i2cAddress=32)\n", (8589, 8616), False, 'from MCP230XX import MCP230XX\n'), ((8625, 8647), 'LTC138...
from imgaug import augmenters as iaa import matplotlib.pyplot as plt from itertools import cycle from scipy import interp import tensorflow as tf import itertools import numpy as np import json import argparse import warnings import os from synth.utils import datagenerate from sklearn.metrics import roc_curve, auc, a...
[ "matplotlib.pyplot.ylabel", "sklearn.metrics.classification_report", "sklearn.metrics.auc", "sklearn.metrics.roc_curve", "tensorflow.cast", "synth.utils.datagenerate", "matplotlib.pyplot.imshow", "os.path.exists", "scipy.interp", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotli...
[((623, 637), 'synth.utils.datagenerate', 'datagenerate', ([], {}), '()\n', (635, 637), False, 'from synth.utils import datagenerate\n'), ((651, 676), 'tensorflow.cast', 'tf.cast', (['images', 'tf.uint8'], {}), '(images, tf.uint8)\n', (658, 676), True, 'import tensorflow as tf\n'), ((943, 982), 'os.path.join', 'os.path...
from concurrent import futures from functools import partial from itertools import product import os import numpy as np from pyx import color, deco, graph, path, text def mandelbrot_iteration(niter, *args): nx, ny, c = args[0] z = np.zeros_like(c) for n in range(niter): z = z**2+c return nx, ny...
[ "numpy.abs", "pyx.graph.axis.lin", "pyx.text.set", "pyx.text.preamble", "pyx.graph.data.points", "pyx.color.grey", "pyx.path.rect", "pyx.graph.style.density", "functools.partial", "concurrent.futures.ProcessPoolExecutor", "os.getpid", "pyx.color.transparency", "numpy.zeros_like" ]
[((691, 733), 'concurrent.futures.ProcessPoolExecutor', 'futures.ProcessPoolExecutor', ([], {'max_workers': '(4)'}), '(max_workers=4)\n', (718, 733), False, 'from concurrent import futures\n'), ((1224, 1250), 'pyx.text.set', 'text.set', (['text.LatexRunner'], {}), '(text.LatexRunner)\n', (1232, 1250), False, 'from pyx ...
from MLlib.models import Agglomerative_clustering import numpy as np X = np.genfromtxt('datasets/agglomerative_clustering.txt') model = Agglomerative_clustering() model.work(X, 4) model.plot(X)
[ "numpy.genfromtxt", "MLlib.models.Agglomerative_clustering" ]
[((74, 128), 'numpy.genfromtxt', 'np.genfromtxt', (['"""datasets/agglomerative_clustering.txt"""'], {}), "('datasets/agglomerative_clustering.txt')\n", (87, 128), True, 'import numpy as np\n'), ((139, 165), 'MLlib.models.Agglomerative_clustering', 'Agglomerative_clustering', ([], {}), '()\n', (163, 165), False, 'from M...
# convert the downscaled data archive def run( x ): ''' simple wrapper to open and return a 2-D array from a geotiff ''' import rasterio return rasterio.open(x).read(1) def sort_files( files, split_on='_', elem_month=-2, elem_year=-1 ): ''' sort a list of files properly using the month and year parsed from the...
[ "os.path.exists", "time.ctime", "argparse.ArgumentParser", "os.makedirs", "rasterio.open", "os.path.join", "numpy.swapaxes", "affine.Affine.translation", "multiprocessing.Pool", "pyproj.Proj", "numpy.min", "pandas.DataFrame", "time.time", "numpy.arange", "numpy.vectorize" ]
[((1410, 1469), 'pandas.DataFrame', 'pd.DataFrame', (["{'fn': files, 'month': months, 'year': years}"], {}), "({'fn': files, 'month': months, 'year': years})\n", (1422, 1469), True, 'import pandas as pd\n'), ((2349, 2391), 'pandas.DataFrame', 'pd.DataFrame', (["{'fn': files, 'year': years}"], {}), "({'fn': files, 'year...
import numpy as np class Node(): def __init__(self, params=[]): self.in_nodes = params self.value = 0 def forward(self): return NotImplementedError def backward(self): return NotImplementedError class Input_Node(Node): def __init__(self, value ...
[ "numpy.array", "numpy.sum" ]
[((631, 676), 'numpy.array', 'np.array', (['[x.value for x in self.in_nodes[0]]'], {}), '([x.value for x in self.in_nodes[0]])\n', (639, 676), True, 'import numpy as np\n'), ((695, 740), 'numpy.array', 'np.array', (['[w.value for w in self.in_nodes[1]]'], {}), '([w.value for w in self.in_nodes[1]])\n', (703, 740), True...
""" state, observation and action spaces """ from collections import namedtuple, OrderedDict from io import BytesIO from itertools import product from os.path import join import pkg_resources import numpy as np import pandas as pd import energypy as ep from energypy.common.spaces import DiscreteSpace, ContinuousSpac...
[ "collections.namedtuple", "itertools.product", "io.BytesIO", "os.path.join", "numpy.max", "numpy.array", "numpy.random.randint", "numpy.min" ]
[((358, 422), 'collections.namedtuple', 'namedtuple', (['"""primitive"""', "['name', 'low', 'high', 'type', 'data']"], {}), "('primitive', ['name', 'low', 'high', 'type', 'data'])\n", (368, 422), False, 'from collections import namedtuple, OrderedDict\n'), ((3128, 3142), 'numpy.array', 'np.array', (['data'], {}), '(dat...
import numpy as np, matplotlib.pyplot as plt, seaborn as sns from rdkit import Chem from dataclasses import dataclass from utils.exp import BaseArgs, BaseExpLog from utils.data import remove_processed_data import torch from torch_geometric.data import DataLoader from data.data_processors.ts_gen_processor import TSGenDa...
[ "rdkit.Chem.Get3DDistanceMatrix", "data.data_processors.ts_gen_processor.TSGenDataset", "matplotlib.pyplot.savefig", "seaborn.color_palette", "torch_geometric.data.DataLoader", "seaborn.distplot", "numpy.floor", "utils.data.remove_processed_data", "rdkit.Chem.SDMolSupplier", "numpy.concatenate", ...
[((1568, 1608), 'data.data_processors.ts_gen_processor.TSGenDataset', 'TSGenDataset', (['args.root_dir', 'args.n_rxns'], {}), '(args.root_dir, args.n_rxns)\n', (1580, 1608), False, 'from data.data_processors.ts_gen_processor import TSGenDataset\n'), ((1840, 1962), 'torch_geometric.data.DataLoader', 'DataLoader', (['dat...
#!/usr/bin/env python """Script used to generate a cuboid dataset with cubes and rectangles under various shapes, rotations, translations following the general format of ShapeNet. """ import argparse import random import os from string import ascii_letters, digits import sys import numpy as np from progress.bar import...
[ "os.path.exists", "os.listdir", "pyquaternion.Quaternion.random", "numpy.random.rand", "argparse.ArgumentParser", "os.makedirs", "numpy.random.random", "random.choice", "os.path.join", "learnable_primitives.mesh.MeshFromOBJ", "shapes.Shape.from_shapes", "numpy.array", "numpy.linspace", "sh...
[((615, 642), 'shapes.Cuboid', 'Cuboid', (['(-r)', 'r', '(-r)', 'r', '(-r)', 'r'], {}), '(-r, r, -r, r, -r, r)\n', (621, 642), False, 'from shapes import Shape, Cuboid, Ellipsoid\n'), ((703, 720), 'numpy.array', 'np.array', (['minimum'], {}), '(minimum)\n', (711, 720), True, 'import numpy as np\n'), ((735, 752), 'numpy...
import os # If server, need to use osmesa for pyopengl/pyrender if os.cpu_count() > 20: os.environ['PYOPENGL_PLATFORM'] = 'osmesa' # https://github.com/marian42/mesh_to_sdf/issues/13 # https://pyrender.readthedocs.io/en/latest/install/index.html?highlight=ssh#getting-pyrender-working-with-osmesa else: os.environ[...
[ "numpy.random.get_state", "torch.optim.lr_scheduler.MultiStepLR", "yaml.load", "src.dataset_grasp.TrainDataset", "torch.from_numpy", "torch.nn.MSELoss", "src.pointnet_encoder.PointNetEncoder", "numpy.array", "torch.get_rng_state", "os.cpu_count", "logging.info", "multiprocessing.set_start_meth...
[((67, 81), 'os.cpu_count', 'os.cpu_count', ([], {}), '()\n', (79, 81), False, 'import os\n'), ((17202, 17219), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (17213, 17219), False, 'import random\n'), ((17221, 17241), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (17235, 17241), True, '...
import numpy as np import pybullet as p import gym import numpy as np import roboverse.bullet as bullet import os from tqdm import tqdm import argparse import time import roboverse import datetime # ========================================================= # Index corresponds to POSITION, ORIENTATION, BUTTTON etc POSI...
[ "numpy.random.normal", "numpy.clip", "os.path.exists", "pybullet.getVREvents", "argparse.ArgumentParser", "roboverse.make", "os.makedirs", "os.path.join", "time.sleep", "numpy.append", "datetime.datetime.now", "numpy.array", "roboverse.bullet.deg_to_quat", "roboverse.bullet.get_link_state"...
[((2696, 2711), 'time.sleep', 'time.sleep', (['(1.5)'], {}), '(1.5)\n', (2706, 2711), False, 'import time\n'), ((3948, 3971), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (3969, 3971), False, 'import datetime\n'), ((4128, 4153), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Checking the mixing of trajectories - limits of number of trajectories and the limits on running the network for long time. Plus, the contribution of inserting the trajectories to the network. For each number of trajectories (5, 20, 50, 100, 200, 1000, inf) For eac...
[ "numpy.mean", "mnist.MNIST", "torch.nn.CrossEntropyLoss", "matplotlib.pyplot.plot", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.figure", "torch.cuda.is_available", "scipy.stats.sem", "pandas.DataFrame" ]
[((1620, 1634), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1632, 1634), True, 'import pandas as pd\n'), ((1650, 1664), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1662, 1664), True, 'import pandas as pd\n'), ((1688, 1702), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1700, 1702), True, ...
import numpy as np import random from collections import namedtuple, deque, defaultdict import matplotlib.pyplot as plt from mdp import * import pdb import util import json import pprint import logging import utils_nn as utils BUFFER_SIZE = int(1e4) BATCH_SIZE = 1 LR = 1e-3 class ReplayBuffer: def __init__(self, bu...
[ "numpy.mean", "random.sample", "collections.deque", "random.shuffle", "json.dumps", "random.seed", "collections.defaultdict", "utils_nn.set_logger", "random.random" ]
[((7767, 7800), 'utils_nn.set_logger', 'utils.set_logger', (['"""qlearning.log"""'], {}), "('qlearning.log')\n", (7783, 7800), True, 'import utils_nn as utils\n'), ((366, 391), 'collections.deque', 'deque', ([], {'maxlen': 'buffer_size'}), '(maxlen=buffer_size)\n', (371, 391), False, 'from collections import namedtuple...
import numpy as np from aleph.consts import * from reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD import svOsuMeasureLineMD, SvOsuMeasureLineEvent from reamber.osu.OsuMap import OsuMap LINES = 20 amps, curves = np.random.rand(LINES), np.random.rand(LINES) + 3 def f319(m: OsuMap): events = [*[SvOs...
[ "reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD.SvOsuMeasureLineEvent", "numpy.power", "numpy.random.rand", "reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD.svOsuMeasureLineMD" ]
[((228, 249), 'numpy.random.rand', 'np.random.rand', (['LINES'], {}), '(LINES)\n', (242, 249), True, 'import numpy as np\n'), ((1349, 1472), 'reamber.algorithms.generate.sv.generators.svOsuMeasureLineMD.svOsuMeasureLineMD', 'svOsuMeasureLineMD', (['events'], {'scalingFactor': 'SCALE', 'firstOffset': '(125993)', 'lastOf...
import os import six import numpy as np import pandas as pd from math import pi from copy import copy from abc import ABCMeta from functools import lru_cache from collections import defaultdict from scipy.spatial.qhull import ConvexHull from amlearn.featurize.base import BaseFeaturize from amlearn.featurize.nearest_nei...
[ "amlearn.utils.data.get_isometric_lists", "amlearn.utils.packing.tetra_volume", "amlearn.utils.data.read_imd", "numpy.array", "copy.copy", "os.path.exists", "amlearn.utils.packing.pbc_image_nn_coords", "six.with_metaclass", "amlearn.utils.data.read_lammps_dump", "amlearn.utils.data.list_like", "...
[((7291, 7312), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(10)'}), '(maxsize=10)\n', (7300, 7312), False, 'from functools import lru_cache\n'), ((8428, 8470), 'six.with_metaclass', 'six.with_metaclass', (['ABCMeta', 'BaseFeaturize'], {}), '(ABCMeta, BaseFeaturize)\n', (8446, 8470), False, 'import six\n'), (...
import quandl import pandas as pd import numpy as np import datetime from sklearn.linear_model import LinearRegression from sklearn import preprocessing, cross_validation df = quandl.get("WIKI/AMZN") df = df[['Adj. Close']] # print(df) # # exit() forecast_out = int(30) # predicting 30 days into future df['Predi...
[ "numpy.array", "quandl.get", "sklearn.cross_validation.train_test_split", "sklearn.linear_model.LinearRegression", "sklearn.preprocessing.scale" ]
[((178, 201), 'quandl.get', 'quandl.get', (['"""WIKI/AMZN"""'], {}), "('WIKI/AMZN')\n", (188, 201), False, 'import quandl\n'), ((462, 484), 'sklearn.preprocessing.scale', 'preprocessing.scale', (['X'], {}), '(X)\n', (481, 484), False, 'from sklearn import preprocessing, cross_validation\n'), ((602, 628), 'numpy.array',...
from glob import glob import os from typing import List from PIL import Image, ImageFilter import numpy as np import csv import random import shutil from joblib import Parallel, delayed import cv2 from preprocess.util import ( ImageInfo, cal_new_size, hex_to_rgb, noisy, printStats, random_blur, ...
[ "os.path.exists", "PIL.Image.open", "preprocess.util.random_phase", "preprocess.util.hex_to_rgb", "os.path.join", "joblib.delayed", "joblib.Parallel", "numpy.array", "preprocess.util.printStats", "preprocess.util.random_blur", "preprocess.util.cal_new_size", "numpy.empty", "numpy.random.rand...
[((670, 692), 'os.path.exists', 'os.path.exists', (['output'], {}), '(output)\n', (684, 692), False, 'import os\n'), ((1340, 1357), 'preprocess.util.printStats', 'printStats', (['infos'], {}), '(infos)\n', (1350, 1357), False, 'from preprocess.util import ImageInfo, cal_new_size, hex_to_rgb, noisy, printStats, random_b...
''' Author: <NAME> Date: 2021-07-08 10:50:22 LastEditTime: 2021-07-08 14:10:04 LastEditors: Please set LastEditors Description: In User Settings Edit FilePath: /genetic-drawing/mask.py ''' import cv2 import numpy as np def main(): # 1.导入图片 img_src = cv2.imread("03.jpg") # 2.灰度化,二值化 img_gray = cv2.cv...
[ "cv2.imwrite", "numpy.ones", "cv2.threshold", "numpy.array", "cv2.cvtColor", "cv2.findContours", "cv2.dilate", "cv2.Canny", "cv2.imread" ]
[((261, 281), 'cv2.imread', 'cv2.imread', (['"""03.jpg"""'], {}), "('03.jpg')\n", (271, 281), False, 'import cv2\n'), ((314, 355), 'cv2.cvtColor', 'cv2.cvtColor', (['img_src', 'cv2.COLOR_BGR2GRAY'], {}), '(img_src, cv2.COLOR_BGR2GRAY)\n', (326, 355), False, 'import cv2\n'), ((370, 398), 'cv2.Canny', 'cv2.Canny', (['img...
import pandas from lux.vis.VisList import VisList from lux.vis.Vis import Vis from lux.core.frame import LuxDataFrame from lux.executor.Executor import Executor from lux.utils import utils class PandasExecutor(Executor): ''' Given a Vis objects with complete specifications, fetch and process data using Pandas d...
[ "pandas.Series", "numpy.histogram", "numpy.array", "lux.utils.utils.get_filter_specs", "numpy.isnan", "numpy.vstack", "pandas.DataFrame" ]
[((9142, 9186), 'lux.utils.utils.get_filter_specs', 'utils.get_filter_specs', (['vis._inferred_intent'], {}), '(vis._inferred_intent)\n', (9164, 9186), False, 'from lux.utils import utils\n'), ((8511, 8560), 'numpy.histogram', 'np.histogram', (['series'], {'bins': 'bin_attribute.bin_size'}), '(series, bins=bin_attribut...
from io import BytesIO from urllib.request import urlopen from zipfile import ZipFile import numpy as np import pandas as pd from sklearn.utils.testing import assert_array_equal from sktime.classifiers.example_classifiers import TSExampleClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.lin...
[ "sklearn.utils.testing.assert_array_equal", "numpy.ones", "sklearn.metrics.make_scorer", "sklearn.ensemble.RandomForestClassifier", "sklearn.linear_model.LogisticRegression", "sktime.model_selection.GridSearchCV", "sktime.datasets.load_gunpoint", "pandas.DataFrame" ]
[((524, 554), 'sktime.datasets.load_gunpoint', 'load_gunpoint', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (537, 554), False, 'from sktime.datasets import load_gunpoint\n'), ((567, 620), 'pandas.DataFrame', 'pd.DataFrame', (["{'ts': Xsf_train, 'ts_copy': Xsf_train}"], {}), "({'ts': Xsf_train, 'ts_copy': Xsf...
import numpy as np from evtol import eVTOL import matplotlib.pyplot as plt # OTHER STUFF STORED HERE FOR NOW def unique(list1): # initialize a null list unique_list = [] unique_indices = [] # traverse for all elements i = 0 for x in list1: # check if exists in unique_list or not ...
[ "matplotlib.pyplot.ylabel", "evtol.eVTOL", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figure", "numpy.linspace", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((821, 889), 'evtol.eVTOL', 'eVTOL', (['m'], {'soc_init': '(100)', 'soc_limit': '(20)', 'mission': '[]', 'energy_density': '(260)'}), '(m, soc_init=100, soc_limit=20, mission=[], energy_density=260)\n', (826, 889), False, 'from evtol import eVTOL\n'), ((2241, 2255), 'matplotlib.pyplot.figure', 'plt.figure', (['(10)'],...
from joblib import Parallel, delayed import numpy as np from pyriemann.classification import MDM from pyriemann.utils.distance import distance from pyriemann.utils.geodesic import geodesic from pyriemann.utils.mean import mean_covariance class MDWM(MDM): def __init__(self, L=0, **kwargs): """Init.""" ...
[ "numpy.ones", "numpy.unique", "pyriemann.utils.distance.distance", "joblib.Parallel", "numpy.concatenate", "pyriemann.utils.mean.mean_covariance", "pyriemann.utils.geodesic.geodesic", "joblib.delayed" ]
[((1113, 1125), 'numpy.unique', 'np.unique', (['y'], {}), '(y)\n', (1122, 1125), True, 'import numpy as np\n'), ((3318, 3346), 'numpy.concatenate', 'np.concatenate', (['dist'], {'axis': '(1)'}), '(dist, axis=1)\n', (3332, 3346), True, 'import numpy as np\n'), ((1290, 1316), 'numpy.ones', 'np.ones', (['X_domain.shape[0]...
import inviwopy from inviwopy.glm import * import numpy as np import math # input variables # img - memory for the final image # p - the processor rAxis = np.linspace(p.realBounds.value[0],p.realBounds.value[1],img.data.shape[0]) iAxis = np.linspace(p.imaginaryBound.value[0],p.imaginaryBound.value[1],img.data.shape[...
[ "numpy.linspace", "numpy.power", "numpy.ndenumerate", "math.log" ]
[((158, 234), 'numpy.linspace', 'np.linspace', (['p.realBounds.value[0]', 'p.realBounds.value[1]', 'img.data.shape[0]'], {}), '(p.realBounds.value[0], p.realBounds.value[1], img.data.shape[0])\n', (169, 234), True, 'import numpy as np\n'), ((241, 330), 'numpy.linspace', 'np.linspace', (['p.imaginaryBound.value[0]', 'p....
from math import sqrt import numpy as np class KNearestNeighborsClassifier: """ A simple attempt at creating a K-Nearest Neighbors algorithm. n_neighbors: int, default=5 Number of neighbors to use by default in classification. """ def __init__(self, n_neighbors=5): """Initialize ...
[ "numpy.array", "math.sqrt" ]
[((1118, 1139), 'numpy.array', 'np.array', (['predictions'], {}), '(predictions)\n', (1126, 1139), True, 'import numpy as np\n'), ((1413, 1423), 'math.sqrt', 'sqrt', (['dist'], {}), '(dist)\n', (1417, 1423), False, 'from math import sqrt\n')]
import copy import numpy as np from collections import OrderedDict import torch from torch import optim import torch.nn.functional as F from torch.distributions import Categorical from torchmeta.utils.gradient_based import gradient_update_parameters import lio.model.meta_actor_net as meta_actor_net import lio.model.ac...
[ "torch.nn.functional.softmax", "torch.distributions.Categorical", "torch.stack", "torch.Tensor", "lio.utils.util.Adam_Optim", "torch.no_grad", "lio.model.actor_net.Reward_net", "torch.add", "lio.utils.util.gd", "torch.finfo", "torch.nn.functional.log_softmax", "numpy.zeros", "torch.zeros", ...
[((609, 635), 'torch.finfo', 'torch.finfo', (['torch.float32'], {}), '(torch.float32)\n', (620, 635), False, 'import torch\n'), ((1104, 1149), 'lio.model.meta_actor_net.MetaNet_PG', 'MetaNet_PG', (['self.l_obs', 'self.n_action', 'l1', 'l2'], {}), '(self.l_obs, self.n_action, l1, l2)\n', (1114, 1149), False, 'from lio.m...
""" Python script to train HRNet + shiftNet for multi frame super resolution (MFSR) Credits: This code is adapted from ElementAI's HighRes-Net: https://github.com/ElementAI/HighRes-net """ import os import gc import json import argparse import datetime from functools import partial from collections import defaultdic...
[ "wandb.log", "torch.cuda.is_available", "torch.sum", "hrnet.src.utils.normalize_plotting", "numpy.moveaxis", "numpy.arange", "torch.linalg.norm", "collections.deque", "tensorboardX.SummaryWriter", "argparse.ArgumentParser", "torch.mean", "numpy.random.random", "numpy.max", "numpy.random.se...
[((1456, 1478), 'torch.stack', 'torch.stack', (['thetas', '(1)'], {}), '(thetas, 1)\n', (1467, 1478), False, 'import torch\n'), ((5547, 5594), 'os.path.join', 'os.path.join', (['tb_logging_dir', 'subfolder_pattern'], {}), '(tb_logging_dir, subfolder_pattern)\n', (5559, 5594), False, 'import os\n'), ((5599, 5638), 'os.m...
import logging import numpy as np import pandas as pd import faiss def smart_kmeans_clustering(X, obj_Y, n_clusters, min_obj_per_cluster=5, search_in=20): logging.info( u"Params: initial number of clusters: %s, min objects per cluster: %s", n_clusters, min_obj_per_cluster ) kmeans = faiss...
[ "numpy.unique", "numpy.in1d", "logging.info", "numpy.array", "pandas.DataFrame", "faiss.Kmeans" ]
[((161, 287), 'logging.info', 'logging.info', (['u"""Params: initial number of clusters: %s, min objects per cluster: %s"""', 'n_clusters', 'min_obj_per_cluster'], {}), "(\n u'Params: initial number of clusters: %s, min objects per cluster: %s',\n n_clusters, min_obj_per_cluster)\n", (173, 287), False, 'import lo...
import numpy as np import matplotlib.pyplot as plt import time import math from numpy import linalg import scipy as sc import scipy.sparse as sparse import scipy.sparse.linalg plt.style.use('ggplot') def spectral(N,nplots): '''Algorithme de résolution par méthode spectrale de Fourier-Galerkin. N est la taille du ...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.ylabel", "numpy.array", "numpy.sin", "scipy.sparse.spdiags", "numpy.arange", "matplotlib.pyplot.imshow", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.fft.fft", "matplotlib.pyplot.style.use", "numpy.asarray", "matplotlib.pyplot.clos...
[((177, 200), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (190, 200), True, 'import matplotlib.pyplot as plt\n'), ((3673, 3682), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (3680, 3682), True, 'import matplotlib.pyplot as plt\n'), ((3683, 3748), 'matplotlib.pyplot.s...
""" The LaTex example was derived from: http://matplotlib.org/users/usetex.html """ from bokeh.models import Label from bokeh.palettes import Spectral4 from bokeh.plotting import output_file, figure, show import numpy as np from scipy.special import jv output_file('external_resources.html') class LatexLabel(Label):...
[ "bokeh.plotting.show", "bokeh.plotting.figure", "numpy.arange", "scipy.special.jv", "bokeh.plotting.output_file" ]
[((256, 294), 'bokeh.plotting.output_file', 'output_file', (['"""external_resources.html"""'], {}), "('external_resources.html')\n", (267, 294), False, 'from bokeh.plotting import output_file, figure, show\n'), ((1856, 1972), 'bokeh.plotting.figure', 'figure', ([], {'title': '"""LaTex Extension Demonstration"""', 'plot...
# -------------- #Importing header files import pandas as pd import numpy as np import matplotlib.pyplot as plt #Path of the file path #Code starts here data = pd.read_csv(path) data.rename(mapper={'Total':'Total_Medals'},axis=1,inplace=True) print(data.head(10)) # -------------- #Code starts here data['...
[ "matplotlib.pyplot.xticks", "pandas.read_csv", "matplotlib.pyplot.ylabel", "numpy.where", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.subplots" ]
[((171, 188), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (182, 188), True, 'import pandas as pd\n'), ((1485, 1521), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(3)', '(1)'], {'figsize': '(14, 21)'}), '(3, 1, figsize=(14, 21))\n', (1497, 1521), True, 'import matplotlib.pyplot as plt\n'), ((3522, ...
from bricks_modeling.connectivity_graph import ConnectivityGraph import numpy as np from numpy import linalg as LA import util.geometry_util as geo_util from solvers.rigidity_solver.algo_core import ( spring_energy_matrix, transform_matrix_fitting, solve_rigidity ) from solvers.rigidity_solver.internal_stru...
[ "util.geometry_util.subtract_orthobasis", "solvers.rigidity_solver.internal_structure.structure_sampling", "solvers.rigidity_solver.algo_core.spring_energy_matrix", "numpy.linalg.norm", "solvers.rigidity_solver.algo_core.transform_matrix_fitting", "numpy.array", "copy.deepcopy", "util.geometry_util.tr...
[((551, 586), 'solvers.rigidity_solver.internal_structure.structure_sampling', 'structure_sampling', (['structure_graph'], {}), '(structure_graph)\n', (569, 586), False, 'from solvers.rigidity_solver.internal_structure import structure_sampling\n'), ((596, 660), 'solvers.rigidity_solver.algo_core.spring_energy_matrix',...
# -*- coding: utf-8 -*- """ Created on Wed Oct 28 09:27:49 2020 @author: <NAME> """ import pickle import pandas as pd import numpy as np from country import country from scipy.integrate import solve_ivp from scipy.optimize import minimize from scipy.optimize import dual_annealing from scipy.optimize i...
[ "numpy.clip", "pandas.read_csv", "numpy.polyfit", "numpy.log", "scipy.interpolate.interp1d", "numpy.array", "country_converter.convert", "statsmodels.api.OLS", "pandas.ExcelWriter", "numpy.arange", "scipy.ndimage.filters.uniform_filter1d", "pandas.date_range", "numpy.mean", "pandas.to_date...
[((38757, 38775), 'pandas.DataFrame', 'pd.DataFrame', (['dict'], {}), '(dict)\n', (38769, 38775), True, 'import pandas as pd\n'), ((43864, 43893), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(10, 8)'}), '(figsize=(10, 8))\n', (43876, 43893), True, 'from matplotlib import pyplot as plt\n'), ((44258, ...
import numpy as np from sklearn.datasets import load_iris from sklearn.ensemble import RandomForestRegressor iris = load_iris() rf = RandomForestRegressor(random_state = 35) from sklearn.model_selection import RandomizedSearchCV X = iris.data y = iris.target n_estimators = [int(x) for x in np.linspace(start = 1, s...
[ "sklearn.datasets.load_iris", "numpy.linspace", "sklearn.ensemble.RandomForestRegressor", "sklearn.model_selection.RandomizedSearchCV" ]
[((116, 127), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (125, 127), False, 'from sklearn.datasets import load_iris\n'), ((133, 171), 'sklearn.ensemble.RandomForestRegressor', 'RandomForestRegressor', ([], {'random_state': '(35)'}), '(random_state=35)\n', (154, 171), False, 'from sklearn.ensemble impo...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. import itertools from typing import Optional import numpy as np import math import paddle.distributed as dist from paddle.io import Sampler, BatchSampler class DistributedBatchSampler(BatchSampler): def __init__(self,...
[ "paddle.distributed.get_rank", "paddle.fluid.dygraph.parallel.ParallelEnv", "paddle.distributed.get_world_size", "numpy.random.seed", "numpy.random.RandomState", "numpy.arange", "numpy.random.permutation" ]
[((3615, 3632), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (3629, 3632), True, 'import numpy as np\n'), ((6203, 6218), 'paddle.distributed.get_rank', 'dist.get_rank', ([], {}), '()\n', (6216, 6218), True, 'import paddle.distributed as dist\n'), ((6246, 6267), 'paddle.distributed.get_world_size', 'di...
import cv2 import time # Remove Later import numpy as np video = cv2.VideoCapture("./img/vert2.mp4") target_low = (0, 0, 0) target_high = (50, 50, 50) while True: ret, frame = video.read() if not ret: video = cv2.VideoCapture("./img/vert2.mp4") continue image = frame image = cv2.resiz...
[ "cv2.rectangle", "cv2.drawContours", "numpy.ones", "cv2.dilate", "cv2.inRange", "cv2.erode", "cv2.line", "time.sleep", "cv2.imshow", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.resize", "cv2.GaussianBlur", "cv2.waitKey", "cv2.boundingRect" ]
[((66, 101), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""./img/vert2.mp4"""'], {}), "('./img/vert2.mp4')\n", (82, 101), False, 'import cv2\n'), ((1154, 1168), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (1165, 1168), False, 'import cv2\n'), ((1169, 1192), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([...
# -*- coding: utf-8 -*- ########################################################################## # pySAP - Copyright (C) CEA, 2017 - 2018 # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-e...
[ "pysap.Image", "pysap.base.utils.flatten", "numpy.asarray", "pysap.base.utils.unflatten", "pysap.load_transform", "numpy.zeros", "numpy.linalg.norm" ]
[((1312, 1346), 'pysap.load_transform', 'pysap.load_transform', (['wavelet_name'], {}), '(wavelet_name)\n', (1332, 1346), False, 'import pysap\n'), ((2021, 2058), 'pysap.base.utils.flatten', 'flatten', (['self.transform.analysis_data'], {}), '(self.transform.analysis_data)\n', (2028, 2058), False, 'from pysap.base.util...
from copy import copy, deepcopy import numpy as np from unittest import TestCase from transition_system.arc_eager import ArcEager, ArcEagerDynamicOracle def generate_all_projective_parses(size): arc_eager = ArcEager(1) initial = arc_eager.state(size) stack = [] stack.append(initial) parses = set...
[ "numpy.zeros", "transition_system.arc_eager.ArcEagerDynamicOracle", "transition_system.arc_eager.ArcEager", "copy.deepcopy" ]
[((214, 225), 'transition_system.arc_eager.ArcEager', 'ArcEager', (['(1)'], {}), '(1)\n', (222, 225), False, 'from transition_system.arc_eager import ArcEager, ArcEagerDynamicOracle\n'), ((814, 860), 'numpy.zeros', 'np.zeros', (['(num_tokens, num_tokens)'], {'dtype': 'bool'}), '((num_tokens, num_tokens), dtype=bool)\n'...
""" DNN Modules The feed backward will be completed in the batch-wise operation """ import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch import Tensor from qtorch.quant import float_quantize from torch.nn import init from .function import * class Conv2d(nn.Modul...
[ "torch.nn.functional.linear", "torch.nn.functional.conv2d", "torch.nn.functional.mse_loss", "numpy.sqrt", "torch.nn.init.ones_", "torch.Tensor", "torch.sqrt", "torch.nn.init.zeros_", "qtorch.quant.float_quantize", "torch.matmul", "torch.flip", "torch.nn.functional.relu", "torch.zeros_like", ...
[((1376, 1397), 'numpy.sqrt', 'np.sqrt', (['(2.0 / fan_in)'], {}), '(2.0 / fan_in)\n', (1383, 1397), True, 'import numpy as np\n'), ((4549, 4580), 'torch.flip', 'torch.flip', (['self.weight', '[2, 3]'], {}), '(self.weight, [2, 3])\n', (4559, 4580), False, 'import torch\n'), ((4642, 4715), 'torch.nn.functional.conv2d', ...
from __future__ import division import numpy as np import scipy.stats as st from numpy.testing import assert_array_almost_equal from tensorprob import ( Exponential, MigradOptimizer, Mix2, Mix3, MixN, Model, Normal, Parameter, Poisson ) def test_mix2_fit(): with Model() as mo...
[ "scipy.stats.expon.pdf", "numpy.random.exponential", "scipy.stats.norm.cdf", "numpy.testing.assert_array_almost_equal", "tensorprob.Exponential", "tensorprob.Poisson", "tensorprob.Normal", "numpy.linspace", "numpy.random.seed", "numpy.concatenate", "numpy.random.normal", "tensorprob.Mix2", "...
[((809, 827), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (823, 827), True, 'import numpy as np\n'), ((844, 877), 'numpy.random.exponential', 'np.random.exponential', (['(10)', '(200000)'], {}), '(10, 200000)\n', (865, 877), True, 'import numpy as np\n'), ((1032, 1063), 'numpy.random.normal', 'np.r...
import os import numpy as np from sklearn.svm import SVC, LinearSVC from sklearn.metrics import classification_report from sklearn.ensemble import RandomForestClassifier from sklearn import preprocessing from sklearn import metrics from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTre...
[ "sklearn.metrics.precision_score", "sklearn.model_selection.StratifiedKFold", "sklearn.metrics.recall_score", "numpy.array", "numpy.random.RandomState", "os.path.exists", "argparse.ArgumentParser", "sklearn.tree.DecisionTreeClassifier", "numpy.concatenate", "sklearn.preprocessing.MinMaxScaler", ...
[((485, 546), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""ml_features_classifier"""'}), "(description='ml_features_classifier')\n", (508, 546), False, 'import argparse\n'), ((2414, 2462), 'sklearn.preprocessing.MinMaxScaler', 'preprocessing.MinMaxScaler', ([], {'feature_range': '(0, 1...
import numpy as np import sympy as sp from scipy.misc import derivative from prettytable import PrettyTable import math from math import * def nuevosValoresa(ecua, derivadas, Ecuaciones, variables,var): valor_ini = [] func_numerica = [] derv_numerica = [] funcs = vars(math) for i in range(0, Ecuac...
[ "prettytable.PrettyTable", "numpy.array", "sympy.Symbol", "sympy.Derivative" ]
[((1972, 1996), 'prettytable.PrettyTable', 'PrettyTable', (['encabezados'], {}), '(encabezados)\n', (1983, 1996), False, 'from prettytable import PrettyTable\n'), ((3236, 3249), 'prettytable.PrettyTable', 'PrettyTable', ([], {}), '()\n', (3247, 3249), False, 'from prettytable import PrettyTable\n'), ((1211, 1234), 'sym...
from __future__ import print_function, absolute_import import argparse import os.path as osp import random import numpy as np import sys import torch.nn.functional as F from hdbscan import HDBSCAN from sklearn.cluster import KMeans, DBSCAN from sklearn.metrics.pairwise import cosine_similarity from sklearn.preprocessin...
[ "abmt.datasets.names", "abmt.utils.data.sampler.RandomMultipleGallerySampler", "abmt.utils.serialization.copy_state_dict", "abmt.trainers.ABMTTrainer", "sklearn.cluster.DBSCAN", "numpy.mean", "abmt.models.create", "argparse.ArgumentParser", "abmt.utils.data.transforms.RandomHorizontalFlip", "numpy...
[((1086, 1110), 'os.path.join', 'osp.join', (['data_dir', 'name'], {}), '(data_dir, name)\n', (1094, 1110), True, 'import os.path as osp\n'), ((1125, 1152), 'abmt.datasets.create', 'datasets.create', (['name', 'root'], {}), '(name, root)\n', (1140, 1152), False, 'from abmt import datasets\n'), ((1314, 1380), 'abmt.util...
# Test results on all possible clustering methods using clustering results import seaborn as sns import pandas as pd import numpy as np import matplotlib.pyplot as plt import torch from sklearn.metrics import silhouette_samples, silhouette_score, adjusted_rand_score from sklearn.cluster import KMeans, SpectralClusteri...
[ "pandas.Series", "sklearn.cluster.KMeans", "sklearn.cluster.SpectralClustering", "sklearn.cluster.AgglomerativeClustering", "numpy.unique", "argparse.ArgumentParser", "pandas.read_csv", "sklearn.cluster.OPTICS", "sklearn.cluster.AffinityPropagation", "torch.from_numpy", "matplotlib.pyplot.close"...
[((574, 635), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Main entrance of scGNN"""'}), "(description='Main entrance of scGNN')\n", (597, 635), False, 'import argparse\n'), ((1427, 1458), 'torch.from_numpy', 'torch.from_numpy', (['spatialMatrix'], {}), '(spatialMatrix)\n', (1443, 1458...
import mediapipe as mp import pandas as pd import numpy as np import cv2 mp_pose = mp.solutions.pose # returns an angle value as a result of the given points def calculate_angle(a, b, c): a = np.array(a) # First b = np.array(b) # Mid c = np.array(c) # End radians = np.arctan2(c[1] - b[1], c[0] - ...
[ "numpy.abs", "cv2.imshow", "numpy.array", "numpy.arctan2", "pandas.DataFrame", "cv2.imread" ]
[((199, 210), 'numpy.array', 'np.array', (['a'], {}), '(a)\n', (207, 210), True, 'import numpy as np\n'), ((228, 239), 'numpy.array', 'np.array', (['b'], {}), '(b)\n', (236, 239), True, 'import numpy as np\n'), ((255, 266), 'numpy.array', 'np.array', (['c'], {}), '(c)\n', (263, 266), True, 'import numpy as np\n'), ((39...
import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA def get_transformed_spatial_coordinates(filename: str): df = pd.read_csv(filename, sep="\t") spatial_data = df.iloc[:, 0] spatial_xy = [] for spot in spatial_data: ...
[ "pandas.read_csv", "sklearn.decomposition.PCA", "numpy.log", "sklearn.preprocessing.StandardScaler", "pandas.DataFrame", "numpy.transpose" ]
[((200, 231), 'pandas.read_csv', 'pd.read_csv', (['filename'], {'sep': '"""\t"""'}), "(filename, sep='\\t')\n", (211, 231), True, 'import pandas as pd\n'), ((474, 518), 'pandas.DataFrame', 'pd.DataFrame', (['spatial_xy'], {'columns': "['x', 'y']"}), "(spatial_xy, columns=['x', 'y'])\n", (486, 518), True, 'import pandas...
import copy from typing import Callable, Tuple import numpy as np from odyssey.distribution import Distribution from iliad.integrators.fields import softabs from iliad.integrators.info import CoupledInfo from iliad.integrators.terminal import cond from iliad.integrators.states.coupled_state import CoupledState from ...
[ "numpy.abs", "numpy.eye", "iliad.integrators.info.CoupledInfo", "numpy.hstack", "iliad.integrators.terminal.cond", "numpy.split", "numpy.outer", "numpy.vstack", "numpy.cos", "numpy.sin", "copy.copy", "numpy.zeros_like" ]
[((1035, 1064), 'numpy.cos', 'np.cos', (['(2 * omega * step_size)'], {}), '(2 * omega * step_size)\n', (1041, 1064), True, 'import numpy as np\n'), ((1071, 1100), 'numpy.sin', 'np.sin', (['(2 * omega * step_size)'], {}), '(2 * omega * step_size)\n', (1077, 1100), True, 'import numpy as np\n'), ((1107, 1136), 'numpy.vst...
""" Author: Anonymous Description: Contains several features for analyzing and comparing the performance across multiple experiments: - perfloss : Performance w.r.t. test/train loss ratio and the used AE architecture ...
[ "logging.getLogger", "numpy.prod", "numpy.clip", "numpy.convolve", "pandas.read_csv", "multiprocessing.cpu_count", "numpy.array", "numpy.linalg.norm", "matplotlib.colors.LogNorm", "behaviour_representations.analysis.load_metadata", "numpy.mean", "os.path.exists", "numpy.repeat", "argparse....
[((794, 808), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (801, 808), True, 'import matplotlib as mpl\n'), ((1122, 1149), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1139, 1149), False, 'import logging\n'), ((1161, 1186), 'argparse.ArgumentParser', 'argparse.Argumen...
from unittest import TestCase, mock from unittest.mock import MagicMock import numpy as np from source.constants import Constants from source.preprocessing.epoch import Epoch from source.preprocessing.heart_rate.heart_rate_collection import HeartRateCollection from source.preprocessing.heart_rate.heart_rate_feature_ser...
[ "source.constants.Constants.FEATURE_FILE_PATH.joinpath", "source.preprocessing.heart_rate.heart_rate_feature_service.HeartRateFeatureService.write", "source.preprocessing.epoch.Epoch", "unittest.mock.MagicMock", "source.preprocessing.heart_rate.heart_rate_feature_service.HeartRateFeatureService.load", "nu...
[((409, 484), 'unittest.mock.patch', 'mock.patch', (['"""source.preprocessing.heart_rate.heart_rate_feature_service.pd"""'], {}), "('source.preprocessing.heart_rate.heart_rate_feature_service.pd')\n", (419, 484), False, 'from unittest import TestCase, mock\n'), ((1150, 1225), 'unittest.mock.patch', 'mock.patch', (['"""...
""" ## pyart radar object pyart.core.radar ================ A general central radial scanning (or dwelling) instrument class. .. autosummary:: :toctree: generated/ _rays_per_sweep_data_factory _gate_data_factory _gate_lon_lat_data_factory _gate_altitude_data_factory .. autosummary:: :toctree...
[ "numpy.mean", "numpy.any", "numpy.append", "numpy.array", "numpy.cumsum" ]
[((32840, 32871), 'numpy.array', 'np.array', (['sweeps'], {'dtype': '"""int32"""'}), "(sweeps, dtype='int32')\n", (32848, 32871), True, 'import numpy as np\n'), ((32883, 32916), 'numpy.any', 'np.any', (['(sweeps > self.nsweeps - 1)'], {}), '(sweeps > self.nsweeps - 1)\n', (32889, 32916), True, 'import numpy as np\n'), ...
import unittest from numpy.random import RandomState class TestRandomState(unittest.TestCase): def test_random_state(self): my_random = RandomState(42) random_list = [-4, 9, 4, 0, -3, -4, 8, 0, 0, -7] gen_random_list = [] for i in range(10): gen_random_list.append(my...
[ "numpy.random.RandomState" ]
[((152, 167), 'numpy.random.RandomState', 'RandomState', (['(42)'], {}), '(42)\n', (163, 167), False, 'from numpy.random import RandomState\n')]
# -*- coding: utf-8 -*- """Generating a cosmological summary of the H0 or D_dt H0_samples Example ------- To run this script, pass in the version ID and the sampling method as the argument:: $ python summarize.py 21 simple_mc_default The summary will be saved to the same directory level as the sample directo...
[ "pandas.read_csv", "h0rton.h0_inference.h0_utils.get_normal_stats_naive", "numpy.isfinite", "numpy.arange", "numpy.mean", "os.listdir", "h0rton.h0_inference.h0_utils.get_normal_stats", "argparse.ArgumentParser", "h0rton.tdlmc_utils.convert_to_dataframe", "numpy.exp", "h0rton.h0_inference.h0_util...
[((656, 681), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (679, 681), False, 'import argparse\n'), ((1413, 1448), 'h0rton.configs.TestConfig.from_file', 'TestConfig.from_file', (['test_cfg_path'], {}), '(test_cfg_path)\n', (1433, 1448), False, 'from h0rton.configs import TestConfig\n'), ((22...
import unittest import numpy as np from qubo_nn.problems import KnapsackIntegerWeights class TestKnapsackIntegerWeights(unittest.TestCase): def test_gen_qubo_matrix(self): """Test whether a correct QUBO is generated. Test case from: My brain. """ w = np.array([2, 5, 3]) c ...
[ "numpy.random.get_state", "numpy.random.set_state", "qubo_nn.problems.KnapsackIntegerWeights", "numpy.array", "qubo_nn.problems.KnapsackIntegerWeights.gen_problems", "numpy.random.seed" ]
[((290, 309), 'numpy.array', 'np.array', (['[2, 5, 3]'], {}), '([2, 5, 3])\n', (298, 309), True, 'import numpy as np\n'), ((322, 341), 'numpy.array', 'np.array', (['[5, 2, 4]'], {}), '([5, 2, 4])\n', (330, 341), True, 'import numpy as np\n'), ((375, 433), 'qubo_nn.problems.KnapsackIntegerWeights', 'KnapsackIntegerWeigh...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import random import numpy as np import torch from torch import nn from typing import Dict def mem2str(num_bytes): assert num_bytes >= 0 if num_bytes >= 2 ** 30: # GB val = float(num_bytes) / (2 ** 30) result = "%.3f GB"...
[ "torch.manual_seed", "torch.load", "psutil.virtual_memory", "random.seed", "torch.nn.init.orthogonal_", "numpy.random.seed", "torch.cuda.manual_seed", "torch.FloatTensor" ]
[((909, 932), 'psutil.virtual_memory', 'psutil.virtual_memory', ([], {}), '()\n', (930, 932), False, 'import psutil\n'), ((2846, 2868), 'random.seed', 'random.seed', (['rand_seed'], {}), '(rand_seed)\n', (2857, 2868), False, 'import random\n'), ((2873, 2902), 'numpy.random.seed', 'np.random.seed', (['(rand_seed + 1)'],...
import numpy as np import torch.nn as nn from torch.nn.modules.loss import _Loss from torch.optim.optimizer import Optimizer import torch.optim as optim class ProgressBar(object): def __init__(self, max_iter: int = 1, verbose: int = 1, bar_nums: int = 20, ...
[ "torch.nn.CrossEntropyLoss", "torch.nn.L1Loss", "torch.nn.KLDivLoss", "torch.nn.PoissonNLLLoss", "numpy.array", "torch.nn.NLLLoss2d", "torch.nn.MSELoss", "torch.nn.NLLLoss", "torch.nn.BCELoss", "torch.nn.CTCLoss", "torch.nn.SmoothL1Loss" ]
[((2249, 2265), 'numpy.array', 'np.array', (['arrays'], {}), '(arrays)\n', (2257, 2265), True, 'import numpy as np\n'), ((3148, 3159), 'torch.nn.L1Loss', 'nn.L1Loss', ([], {}), '()\n', (3157, 3159), True, 'import torch.nn as nn\n'), ((3225, 3237), 'torch.nn.NLLLoss', 'nn.NLLLoss', ([], {}), '()\n', (3235, 3237), True, ...
from event_model import DocumentRouter import matplotlib.pyplot as plt import numpy class Grid(DocumentRouter): """ Draw a matplotlib AxesImage Arist update it for each Event. The purposes of this callback is to create (on initialization) of a matplotlib grid image and then update it with new data fo...
[ "numpy.full", "matplotlib.pyplot.subplots" ]
[((1631, 1664), 'numpy.full', 'numpy.full', (['self.shape', 'numpy.nan'], {}), '(self.shape, numpy.nan)\n', (1641, 1664), False, 'import numpy\n'), ((1570, 1584), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1582, 1584), True, 'import matplotlib.pyplot as plt\n')]
# -*- coding: utf-8 -*- """ Created on Thu Nov 15 15:26:19 2018 @authors: <NAME> (verseve) & <NAME> (haag) """ # required modules import rasterio from rasterio.mask import mask from shapely.geometry import box from shapely.geometry import Point from shapely.geometry import Polygon from shapely.geometry import MultiPo...
[ "configparser.ConfigParser", "pandas.read_csv", "numpy.log", "shapely.geometry.box", "numpy.column_stack", "shapely.geometry.Polygon", "geopandas.overlay", "sys.exit", "numpy.sin", "merit.merit_model_data.upscale_merit_basin", "pandas.read_excel", "numpy.arange", "setup_logging.getStats", ...
[((1818, 1897), 'scipy.ndimage.distance_transform_edt', 'nd.distance_transform_edt', (['invalid'], {'return_distances': '(False)', 'return_indices': '(True)'}), '(invalid, return_distances=False, return_indices=True)\n', (1843, 1897), True, 'from scipy import ndimage as nd\n'), ((2578, 2602), 'numpy.radians', 'np.radia...
from hypergan.samplers.base_sampler import BaseSampler import numpy as np import tensorflow as tf class GridSampler(BaseSampler): def __init__(self, gan, samples_per_row=8): BaseSampler.__init__(self, gan, samples_per_row) self.x = gan.session.run(gan.inputs.x) batch = self.x.shape[0] ...
[ "numpy.tile", "numpy.reshape", "numpy.hstack", "hypergan.samplers.base_sampler.BaseSampler.__init__", "numpy.linspace", "numpy.concatenate", "numpy.expand_dims" ]
[((188, 236), 'hypergan.samplers.base_sampler.BaseSampler.__init__', 'BaseSampler.__init__', (['self', 'gan', 'samples_per_row'], {}), '(self, gan, samples_per_row)\n', (208, 236), False, 'from hypergan.samplers.base_sampler import BaseSampler\n'), ((333, 410), 'numpy.reshape', 'np.reshape', (['self.x[0]', '[1, self.x....
import numpy from chainer import functions from chainer import testing @testing.parameterize(*testing.product_dict( [ {'shape': (), 'pad_width': 1, 'mode': 'constant'}, {'shape': (2, 3), 'pad_width': 0, 'mode': 'constant'}, {'shape': (2, 3), 'pad_width': 1, 'mode': 'constant'}, {'...
[ "chainer.functions.pad", "chainer.testing.run_module", "chainer.testing.product_dict", "chainer.testing.product", "chainer.testing.with_requires", "numpy.random.uniform", "numpy.pad" ]
[((2712, 2750), 'chainer.testing.with_requires', 'testing.with_requires', (['"""numpy>=1.11.1"""'], {}), "('numpy>=1.11.1')\n", (2733, 2750), False, 'from chainer import testing\n'), ((3521, 3559), 'chainer.testing.run_module', 'testing.run_module', (['__name__', '__file__'], {}), '(__name__, __file__)\n', (3539, 3559)...
import param import matplotlib import matplotlib.pyplot as plt import numpy as np # from gym_film.utils.convert_reward import to_single_reward # from matplotlib.patches import Patch # Uses the following methods/attributes from env: # - O, R (observation and reward) # - jets_power # - system_state # - reward, ...
[ "matplotlib.rcParams.update", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.plot", "numpy.linspace", "matplotlib.pyplot.tight_layout", "numpy.arange", "matplotlib.pyplot.show" ]
[((322, 367), 'matplotlib.rcParams.update', 'matplotlib.rcParams.update', (["{'font.size': 15}"], {}), "({'font.size': 15})\n", (348, 367), False, 'import matplotlib\n'), ((5786, 5845), 'matplotlib.pyplot.plot', 'plt.plot', (['[]', '[]'], {'label': '"""observation domain"""', 'color': '"""green"""'}), "([], [], label='...
import numpy as np import matplotlib.pyplot as plt from time import time from numba import cuda N = 640000 def main(): x = np.linspace(0, 1, N, endpoint=True) from serial import sArray start = time() f = sArray(x) elapsed = time() - start print("--- Serial timing: %s seconds ---" % elapsed) from parallel impo...
[ "numpy.linspace", "parallel.sArray", "time.time" ]
[((126, 161), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'N'], {'endpoint': '(True)'}), '(0, 1, N, endpoint=True)\n', (137, 161), True, 'import numpy as np\n'), ((198, 204), 'time.time', 'time', ([], {}), '()\n', (202, 204), False, 'from time import time\n'), ((210, 219), 'parallel.sArray', 'sArray', (['x'], {}),...
import numpy as np import matplotlib.pyplot as plt from matplotlib import cm # Local imports from jetmontecarlo.tests.simple_tests.test_simpleSampler import * from jetmontecarlo.montecarlo.integrator import * from jetmontecarlo.utils.color_utils import * # Parameters NUM_SAMPLES = int(1e4) NUM_BINS = 10 EPSILON = 1e...
[ "numpy.log10", "matplotlib.pyplot.figaspect", "numpy.array", "matplotlib.pyplot.figure", "matplotlib.cm.coolwarm", "numpy.meshgrid" ]
[((1745, 1764), 'numpy.meshgrid', 'np.meshgrid', (['xs', 'ys'], {}), '(xs, ys)\n', (1756, 1764), True, 'import numpy as np\n'), ((2059, 2077), 'matplotlib.pyplot.figaspect', 'plt.figaspect', (['(0.5)'], {}), '(0.5)\n', (2072, 2077), True, 'import matplotlib.pyplot as plt\n'), ((2173, 2200), 'matplotlib.pyplot.figure', ...
import numpy as np import torch, functools import table_batched_embeddings, table_batched_embeddings_ops np.random.seed(42) def div_round_up(a, b): return int((a + b - 1) // b) * b def get_table_batched_offsets_from_dense(merged_indices): (T, B, L) = merged_indices.size() lengths = np.ones((T, B)) * L ...
[ "table_batched_embeddings_ops.TableBatchedEmbeddingBags", "torch.cuda.synchronize", "table_batched_embeddings.forward", "torch.nn.AvgPool2d", "table_batched_embeddings_ops.MixedDimTableBatchedEmbeddingBags", "torch.testing.assert_allclose", "torch.nn.BatchNorm2d", "torch.addmm", "torch.relu", "fun...
[((105, 123), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (119, 123), True, 'import numpy as np\n'), ((657, 681), 'torch.cuda.synchronize', 'torch.cuda.synchronize', ([], {}), '()\n', (679, 681), False, 'import torch, functools\n'), ((700, 736), 'torch.cuda.Event', 'torch.cuda.Event', ([], {'enable...
from tensor_operator import TensorOperator import re import numpy as np class MemorySurface: __format__ = {'FeatureMap','weight','image'} #__data_type__ = {'int8', 'int16', 'float16'} def __init__(self, name): self.name = name self.seed = 0 self.pattern = None sel...
[ "re.compile", "tensor_operator.TensorOperator.convert_weight_memory_surface_to_nchw", "tensor_operator.TensorOperator.append_c_compensation_to_nchw_tensor", "tensor_operator.TensorOperator.convert_nchw_to_weight_memory_surface", "tensor_operator.TensorOperator.merge_nchw_tensors_by_dimemsion", "tensor_ope...
[((455, 480), 'numpy.random.seed', 'np.random.seed', (['self.seed'], {}), '(self.seed)\n', (469, 480), True, 'import numpy as np\n'), ((4493, 4587), 'tensor_operator.TensorOperator.append_c_compensation_to_nchw_tensor', 'TensorOperator.append_c_compensation_to_nchw_tensor', (['self.tensor_nchw', 'self.atomic_memory'], ...
import numpy as np from Weno import * import Numfluxes as NF from RK3TVD import * import numba as nb import time import socket size=1000 L=1.0 dt=0.8/size T=1. def init(X): h=L/size for i in range(0,size): if i>size//8 and i<size//2+size//8: X[i]=1.-2*(i-size//8)*h/L; else: ...
[ "socket.gethostname", "numpy.empty", "numpy.savetxt", "time.time" ]
[((348, 362), 'numpy.empty', 'np.empty', (['size'], {}), '(size)\n', (356, 362), True, 'import numpy as np\n'), ((369, 383), 'numpy.empty', 'np.empty', (['size'], {}), '(size)\n', (377, 383), True, 'import numpy as np\n'), ((394, 415), 'numpy.savetxt', 'np.savetxt', (['"""gp0"""', 'In'], {}), "('gp0', In)\n", (404, 415...
import itertools from collections import defaultdict from functools import partial from math import ceil from multiprocessing import Pool from os import cpu_count import numpy as np from numba import njit from pandas import DataFrame def __set_matrix(x, phases=None, subset_genes=None, subset_samples=None, rm_zeros=T...
[ "numpy.unique", "numba.njit", "numpy.subtract", "functools.partial", "collections.defaultdict", "os.cpu_count", "multiprocessing.Pool", "pandas.DataFrame", "numpy.random.shuffle" ]
[((15823, 15829), 'numba.njit', 'njit', ([], {}), '()\n', (15827, 15829), False, 'from numba import njit\n'), ((16666, 16672), 'numba.njit', 'njit', ([], {}), '()\n', (16670, 16672), False, 'from numba import njit\n'), ((17108, 17114), 'numba.njit', 'njit', ([], {}), '()\n', (17112, 17114), False, 'from numba import nj...
import numpy as np import pandas as pd import streamlit as st import altair as alt from matplotlib import pyplot as plt import config, dataset, main, utils # Matplotlib params plt.style.use("seaborn") plt.rcParams["figure.dpi"] = 300 def get_altair_hist_plot(series, name, bin_min, bin_max, bin_step): """ P...
[ "altair.Chart", "main.main", "dataset.ProductDataset", "utils.get_l0_lb", "streamlit.header", "numpy.arange", "streamlit.sidebar.write", "matplotlib.pyplot.style.use", "streamlit.set_page_config", "pandas.DataFrame", "streamlit.altair_chart", "matplotlib.pyplot.gcf", "streamlit.write", "st...
[((179, 203), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn"""'], {}), "('seaborn')\n", (192, 203), True, 'from matplotlib import pyplot as plt\n'), ((784, 831), 'streamlit.set_page_config', 'st.set_page_config', ([], {'page_title': '"""3D Bin Packing"""'}), "(page_title='3D Bin Packing')\n", (802, 831)...
import numpy as np from itertools import compress from autodp.rl_core.env.sim_env import SimEnv class BatchSimEnv(object): """This class is a wrapper to create and control a list of environments for batch processing.""" def __init__(self, image_batch=[], label_batch=[]): self._envs = [SimEnv(i, l) fo...
[ "numpy.logical_not", "autodp.rl_core.env.sim_env.SimEnv" ]
[((305, 317), 'autodp.rl_core.env.sim_env.SimEnv', 'SimEnv', (['i', 'l'], {}), '(i, l)\n', (311, 317), False, 'from autodp.rl_core.env.sim_env import SimEnv\n'), ((813, 825), 'autodp.rl_core.env.sim_env.SimEnv', 'SimEnv', (['i', 'l'], {}), '(i, l)\n', (819, 825), False, 'from autodp.rl_core.env.sim_env import SimEnv\n'...
from pyica import fastica from pyica import sources import numpy as np class TestICA(): def setup(self): self.signals = np.vstack([np.sin([x/20.0 for x in range(1,1001)]),(1.0 + np.mod(range(1000),200) - 100.0)/100.0]) self.mixing = np.array([[0.291, 0.6557], [-0.5439, 0.5572]]) self.X = ...
[ "numpy.eye", "numpy.corrcoef", "numpy.array", "numpy.dot", "pyica.fastica.fastica", "pyica.sources.unitsources" ]
[((256, 302), 'numpy.array', 'np.array', (['[[0.291, 0.6557], [-0.5439, 0.5572]]'], {}), '([[0.291, 0.6557], [-0.5439, 0.5572]])\n', (264, 302), True, 'import numpy as np\n'), ((320, 353), 'numpy.dot', 'np.dot', (['self.mixing', 'self.signals'], {}), '(self.mixing, self.signals)\n', (326, 353), True, 'import numpy as n...
import pandas as pd import numpy as np import ffmpeg from joblib import Parallel, delayed import warnings import cv2 from tqdm import tqdm # UPSAMPLE DATA def upsample(df, frac=2): up_df = df.query("distance>=20").copy() up_df = up_df.sample(frac=frac, replace=True) up_df = pd.concat([df.query("distance<20...
[ "cv2.imwrite", "ffmpeg.input", "joblib.delayed", "joblib.Parallel", "ffmpeg.probe", "warnings.warn", "numpy.frombuffer" ]
[((962, 984), 'ffmpeg.input', 'ffmpeg.input', (['filepath'], {}), '(filepath)\n', (974, 984), False, 'import ffmpeg\n'), ((707, 725), 'ffmpeg.probe', 'ffmpeg.probe', (['path'], {}), '(path)\n', (719, 725), False, 'import ffmpeg\n'), ((1895, 1946), 'joblib.Parallel', 'Parallel', ([], {'n_jobs': '(-1)', 'backend': '"""th...
##################################################### Import system libraries ###################################################### import matplotlib as mpl mpl.rcdefaults() mpl.rcParams.update(mpl.rc_params_from_file('meine-matplotlibrc')) import matplotlib.pyplot as plt import numpy as np import scipy.constants as c...
[ "matplotlib.pyplot.grid", "numpy.sqrt", "sys.path.insert", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.annotate", "matplotlib.rc_params_from_file", "table.make_SI", "table.make_full_table", "numpy.genfromtxt", "curve_fit.ucurve_fit", "matplotlib.rcdefaults", "matplotlib.pyplot.xlabel", "m...
[((158, 174), 'matplotlib.rcdefaults', 'mpl.rcdefaults', ([], {}), '()\n', (172, 174), True, 'import matplotlib as mpl\n'), ((2307, 2366), 'numpy.genfromtxt', 'np.genfromtxt', (['"""messdaten/1_Messung_werte.txt"""'], {'unpack': '(True)'}), "('messdaten/1_Messung_werte.txt', unpack=True)\n", (2320, 2366), True, 'import...
import tensorflow as tf tf.enable_eager_execution() import numpy as np import pandas as pd import os # import argparse def read_tf(tfrecord_path): """ read in the tensors :param tfrecord_path: the path to the tensor :return: the image and the label """ raw_image_dataset = tf.data.TFRecordDatas...
[ "tensorflow.data.TFRecordDataset", "matplotlib.pyplot.imshow", "numpy.mean", "os.path.exists", "tensorflow.io.parse_single_example", "os.path.join", "tensorflow.enable_eager_execution", "tensorflow.decode_raw", "numpy.array", "tensorflow.io.FixedLenFeature", "os.mkdir", "numpy.std", "matplot...
[((24, 51), 'tensorflow.enable_eager_execution', 'tf.enable_eager_execution', ([], {}), '()\n', (49, 51), True, 'import tensorflow as tf\n'), ((299, 337), 'tensorflow.data.TFRecordDataset', 'tf.data.TFRecordDataset', (['tfrecord_path'], {}), '(tfrecord_path)\n', (322, 337), True, 'import tensorflow as tf\n'), ((3044, 3...
import numpy as np import matplotlib.pyplot as plt from custom_poling.core.target import Target from custom_poling.core.custom_crystal import CustomCrystal # Crystal properties domain_width = 10.0e-6 number_domains = 1000 L = number_domains * domain_width k0 = np.pi / domain_width # Numerical integration parameters ...
[ "numpy.abs", "matplotlib.pyplot.savefig", "numpy.arange", "numpy.exp", "custom_poling.core.target.Target", "custom_poling.core.custom_crystal.CustomCrystal", "matplotlib.pyplot.legend" ]
[((363, 412), 'numpy.arange', 'np.arange', (['(k0 - k_range / 2)', '(k0 + k_range / 2)', 'dk'], {}), '(k0 - k_range / 2, k0 + k_range / 2, dk)\n', (372, 412), True, 'import numpy as np\n'), ((460, 503), 'custom_poling.core.custom_crystal.CustomCrystal', 'CustomCrystal', (['domain_width', 'number_domains'], {}), '(domai...
# implementation based on DeepLTL https://github.com/reactive-systems/deepltl from argparse import ArgumentParser import subprocess import os.path as path import sys import json import random import tensorflow as tf import numpy as np from dlsgs.utils import ltl_parser def argparser(): parser = ArgumentParser...
[ "sys.exit", "tensorflow.io.gfile.remove", "tensorflow.io.gfile.GFile", "argparse.ArgumentParser", "subprocess.Popen", "json.dumps", "numpy.random.seed", "sys.stdout.flush", "random.randint", "tensorflow.keras.callbacks.TensorBoard", "tensorflow.expand_dims", "tensorflow.random.set_seed", "te...
[((306, 322), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (320, 322), False, 'from argparse import ArgumentParser\n'), ((3607, 3658), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (3651, 3658), True, 'import t...
import numpy as np from pyriemann.estimation import Covariances from pyriemann.spatialfilters import CSP from sklearn.feature_selection import SelectKBest, mutual_info_classif from sklearn.model_selection import GridSearchCV from sklearn.pipeline import make_pipeline from sklearn.svm import SVC from moabb.pipelines.ut...
[ "sklearn.feature_selection.SelectKBest", "pyriemann.estimation.Covariances", "numpy.logspace", "pyriemann.spatialfilters.CSP", "sklearn.svm.SVC" ]
[((363, 385), 'numpy.logspace', 'np.logspace', (['(-2)', '(2)', '(10)'], {}), '(-2, 2, 10)\n', (374, 385), True, 'import numpy as np\n'), ((406, 426), 'sklearn.svm.SVC', 'SVC', ([], {'kernel': '"""linear"""'}), "(kernel='linear')\n", (409, 426), False, 'from sklearn.svm import SVC\n'), ((542, 591), 'sklearn.feature_sel...
import numpy as np import pandas as pd import rpy2 import rpy2.robjects as ro # ro.r('library(devtools)') ## to use source_url # ro.r('library(tidyverse)') ############################## rpy2 functions ############################## # def pull(r): # return r2p(ro.globalenv[r]) # def push(py,rname=None): # im...
[ "numpy.hstack", "numpy.asmatrix", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.vstack", "numpy.full", "rpy2.robjects.r", "numpy.arange" ]
[((3685, 3699), 'numpy.asmatrix', 'np.asmatrix', (['A'], {}), '(A)\n', (3696, 3699), True, 'import numpy as np\n'), ((3706, 3720), 'numpy.asmatrix', 'np.asmatrix', (['B'], {}), '(B)\n', (3717, 3720), True, 'import numpy as np\n'), ((4804, 4821), 'numpy.hstack', 'np.hstack', (['[A, B]'], {}), '([A, B])\n', (4813, 4821),...
# Copyright (c) Microsoft Corporation and Fairlearn contributors. # Licensed under the MIT License. from typing import Any, Callable, Dict, Optional import logging import numpy as np logger = logging.getLogger(__name__) _DEFAULT_NAME = 'metric' _METRIC_FUNCTION_NONE = "Found 'None' instead of metric function" _METR...
[ "logging.getLogger", "numpy.asarray" ]
[((194, 221), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (211, 221), False, 'import logging\n'), ((2006, 2019), 'numpy.asarray', 'np.asarray', (['v'], {}), '(v)\n', (2016, 2019), True, 'import numpy as np\n')]
import logging import os from abc import ABC import numpy as np import pandas as pd import torch import torch.nn.functional as F from sklearn.metrics.pairwise import cosine_distances logger = logging.getLogger() class EvalDatasetMixin(ABC): def store_scores_batch(self, q_idx, scores): # fact idxs are a...
[ "logging.getLogger", "pandas.DataFrame", "sklearn.metrics.pairwise.cosine_distances", "numpy.where", "os.path.join", "warnings.catch_warnings", "numpy.argsort", "numpy.array", "numpy.nanmean", "numpy.isnan", "numpy.vstack", "numpy.concatenate", "torch.save", "warnings.simplefilter", "tor...
[((194, 213), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (211, 213), False, 'import logging\n'), ((1479, 1530), 'numpy.concatenate', 'np.concatenate', (['(row.partial_expl, [selected_fact])'], {}), '((row.partial_expl, [selected_fact]))\n', (1493, 1530), True, 'import numpy as np\n'), ((1615, 1640), 'n...
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright Holders: <NAME>, <NAME>, <NAME> # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function import numpy as np import pytest from pymor.operators.numpy impor...
[ "numpy.eye", "pymor.operators.constructions.Concatenation", "numpy.random.random", "pymor.operators.cg.InterpolationOperator", "pymor.operators.constructions.FixedParameterOperator", "pymor.discretizers.elliptic.discretize_elliptic_cg", "numpy.random.randint", "numpy.random.seed", "pytest.fixture", ...
[((9939, 10545), 'pytest.fixture', 'pytest.fixture', ([], {'params': '(thermalblock_operator_with_arrays_and_products_generators +\n thermalblock_assemble_operator_with_arrays_and_products_generators +\n thermalblock_concatenation_operator_with_arrays_and_products_generators +\n thermalblock_identity_operator_...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 11 23:41:29 2021 """ from PyOECP import References from PyOECP import Transform import matplotlib.pyplot as plt import numpy as np ''' Example 1 Methanol This script tries to convert the reflection coefficients from VNAs. The data files and VNAs ar...
[ "PyOECP.References.Methanol_Barthel", "matplotlib.pyplot.savefig", "PyOECP.Transform.Stuchly", "numpy.imag", "PyOECP.References.Parser", "PyOECP.Transform.Marsland", "numpy.real", "PyOECP.Transform.Komarov", "matplotlib.pyplot.subplots", "matplotlib.pyplot.rc" ]
[((527, 570), 'PyOECP.References.Parser', 'References.Parser', (["(address + 'S11Short.csv')"], {}), "(address + 'S11Short.csv')\n", (544, 570), False, 'from PyOECP import References\n'), ((579, 621), 'PyOECP.References.Parser', 'References.Parser', (["(address + 'S11Open.csv')"], {}), "(address + 'S11Open.csv')\n", (5...