code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python """ Multirunner example <NAME> Lawrence Berkeley National Lab March 2019 """ import sys, os, time import multiprocessing as mp import argparse import glob import astropy.io.fits as fits from astropy.table import Table, vstack import numpy as np import matplotlib.pyplot as plt from ci_reduce.com...
[ "numpy.sum", "argparse.ArgumentParser", "ci_reduce.common.expid_from_filename", "sys.stdout.flush", "multiprocessing.Queue", "glob.glob", "os.path.join", "numpy.unique", "matplotlib.pyplot.cla", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylim", "numpy.median", "ci_reduce.io.realtime_raw_...
[((404, 453), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': '"""{prog} [options]"""'}), "(usage='{prog} [options]')\n", (427, 453), False, 'import argparse\n'), ((809, 819), 'multiprocessing.Queue', 'mp.Queue', ([], {}), '()\n', (817, 819), True, 'import multiprocessing as mp\n'), ((2979, 3020), ...
import setuptools import setuptools.command.build_ext import ABXpy class build_ext(setuptools.command.build_ext.build_ext): def finalize_options(self): setuptools.command.build_ext.build_ext.finalize_options(self) # Prevent numpy from thinking it is still in its setup process: __builtins__...
[ "setuptools.Extension", "numpy.get_include", "setuptools.command.build_ext.build_ext.finalize_options", "setuptools.find_packages" ]
[((166, 227), 'setuptools.command.build_ext.build_ext.finalize_options', 'setuptools.command.build_ext.build_ext.finalize_options', (['self'], {}), '(self)\n', (221, 227), False, 'import setuptools\n'), ((683, 723), 'setuptools.find_packages', 'setuptools.find_packages', ([], {'exclude': '"""test"""'}), "(exclude='test...
import numpy as np import matplotlib.pyplot as plt import math class Network(object): def __init__(self, hidden_size, input_size = 256, output_size = 10, std = 1e-4): self.params = {} self.params['W1'] = std*np.random.randn(input_size,hidden_size) self.params['b1'] = ...
[ "numpy.sum", "numpy.eye", "numpy.random.randn", "numpy.argmax", "numpy.nditer", "numpy.zeros", "numpy.mean", "numpy.exp", "math.cos", "numpy.random.choice", "numpy.dot" ]
[((320, 341), 'numpy.zeros', 'np.zeros', (['hidden_size'], {}), '(hidden_size)\n', (328, 341), True, 'import numpy as np\n'), ((443, 464), 'numpy.zeros', 'np.zeros', (['output_size'], {}), '(output_size)\n', (451, 464), True, 'import numpy as np\n'), ((1958, 1999), 'numpy.mean', 'np.mean', (['(self.softmax_out - delta)...
import numpy as np """ This is a set of functions that calculate the EXIT chart for regular and irregular LDPC code in AWGN channel. """ def exit_reg_awgn(dv, dc, ebn0_db): """ This function calculates the EXIT chart for regular LDPC ensemble Ref. [1] Channel Codes classical and modern -- <NAME> and <NAM...
[ "numpy.log", "numpy.power", "numpy.zeros", "numpy.linspace", "numpy.sqrt" ]
[((417, 446), 'numpy.sqrt', 'np.sqrt', (['(8 * code_rate * ebn0)'], {}), '(8 * code_rate * ebn0)\n', (424, 446), True, 'import numpy as np\n'), ((457, 482), 'numpy.linspace', 'np.linspace', (['(0)', '(1)'], {'num': '(21)'}), '(0, 1, num=21)\n', (468, 482), True, 'import numpy as np\n'), ((970, 999), 'numpy.sqrt', 'np.s...
# import the necessary packages import random import shutil from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.callbacks import LearningRateScheduler from tensorflow.keras.optimizers import Adagrad from tensorflow.keras.utils import to_categorical from sklearn.metrics import class...
[ "matplotlib.pyplot.title", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "tensorflow.keras.layers.MaxPooling2D", "argparse.ArgumentParser", "numpy.argmax", "tensorflow.keras.layers.Dense", "random.shuffle", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "numpy.arange", "...
[((1365, 1406), 'os.path.sep.join', 'os.path.sep.join', (["[BASE_PATH, 'training']"], {}), "([BASE_PATH, 'training'])\n", (1381, 1406), False, 'import os\n'), ((1418, 1461), 'os.path.sep.join', 'os.path.sep.join', (["[BASE_PATH, 'validation']"], {}), "([BASE_PATH, 'validation'])\n", (1434, 1461), False, 'import os\n'),...
import numpy as np import cv2 deneme = np.zeros((200,200,3),dtype=np.uint8) cv2.imshow('deneme siyah',deneme) deneme[:]=(255,255,255) cv2.imshow('deneme beyaz',deneme) deneme[:]=(0,0,255) cv2.imshow('deneme kırmızı',deneme) cv2.waitKey(0) cv2.destroyAllWindows()
[ "cv2.waitKey", "cv2.destroyAllWindows", "cv2.imshow", "numpy.zeros" ]
[((39, 78), 'numpy.zeros', 'np.zeros', (['(200, 200, 3)'], {'dtype': 'np.uint8'}), '((200, 200, 3), dtype=np.uint8)\n', (47, 78), True, 'import numpy as np\n'), ((76, 110), 'cv2.imshow', 'cv2.imshow', (['"""deneme siyah"""', 'deneme'], {}), "('deneme siyah', deneme)\n", (86, 110), False, 'import cv2\n'), ((134, 168), '...
## interaction3 / abstract / manipulations.py # names to export __all__ = ['move_membrane', 'translate_membrane', 'rotate_membrane', 'move_element', 'translate_element', 'rotate_element', 'element_position_from_membranes', 'channel_position_from_elements', 'focus_channel', 'defocus_channel', 'bia...
[ "numpy.zeros", "numpy.mean", "numpy.array", "numpy.sin", "numpy.cos" ]
[((1505, 1521), 'numpy.zeros', 'np.zeros', (['(3, 3)'], {}), '((3, 3))\n', (1513, 1521), True, 'import numpy as np\n'), ((2370, 2386), 'numpy.array', 'np.array', (['origin'], {}), '(origin)\n', (2378, 2386), True, 'import numpy as np\n'), ((2397, 2420), 'numpy.array', 'np.array', (["m['position']"], {}), "(m['position'...
""" Wrapper class providing a minimal consistent interface to `AmberTools <http://ambermd.org/AmberTools.php>`_. """ __all__ = ("AmberToolsToolkitWrapper",) # ============================================================================================= # IMPORTS # =====================================================...
[ "tempfile.TemporaryDirectory", "openff.toolkit.utils.exceptions.ToolkitUnavailableException", "openff.toolkit.utils.exceptions.AntechamberNotFoundError", "subprocess.check_output", "numpy.zeros", "os.path.exists", "openff.toolkit.utils.rdkit_wrapper.RDKitToolkitWrapper", "collections.defaultdict", "...
[((1923, 1969), 'subprocess.check_output', 'subprocess.check_output', (["['antechamber', '-L']"], {}), "(['antechamber', '-L'])\n", (1946, 1969), False, 'import subprocess\n'), ((2293, 2328), 'openff.toolkit.utils.rdkit_wrapper.RDKitToolkitWrapper', 'rdkit_wrapper.RDKitToolkitWrapper', ([], {}), '()\n', (2326, 2328), F...
import time import shutil import unittest from os import cpu_count import numpy as np import pandas as pd from numba import set_num_threads from scipy.sparse import csr_matrix # from agtool.download.movielen import ml_10m from agtool.download.movielen import ml_100k from agtool.cm.sampling import negative_sampling fr...
[ "numba.set_num_threads", "numpy.ones_like", "pandas.read_csv", "time.time", "os.cpu_count", "agtool.cm.sampling.negative_sampling", "agtool.download.movielen.ml_100k", "shutil.rmtree", "numpy.intersect1d", "agtool.sampling.negative_sampling" ]
[((529, 538), 'agtool.download.movielen.ml_100k', 'ml_100k', ([], {}), '()\n', (536, 538), False, 'from agtool.download.movielen import ml_100k\n'), ((593, 615), 'shutil.rmtree', 'shutil.rmtree', (['cls.DIR'], {}), '(cls.DIR)\n', (606, 615), False, 'import shutil\n'), ((698, 754), 'pandas.read_csv', 'pd.read_csv', (['f...
""" Copyright (c) 2020, <NAME>. All rights reserved. """ import os import shutil import numpy as np from graphviz import Graph import matplotlib.pyplot as plt from typing import Optional, List import logging from tqdm import tqdm from joblib import Parallel, delayed from .lsmi import lsmi1D class MISSO: def __in...
[ "tqdm.tqdm", "numpy.random.seed", "matplotlib.pyplot.show", "os.makedirs", "os.path.join", "numpy.zeros", "matplotlib.pyplot.subplots", "matplotlib.pyplot.colorbar", "os.cpu_count", "graphviz.Graph", "numpy.array", "numpy.arange", "shutil.rmtree", "joblib.delayed", "numpy.memmap", "num...
[((1792, 1819), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (1806, 1819), True, 'import numpy as np\n'), ((4609, 4657), 'graphviz.Graph', 'Graph', (['"""G"""'], {'filename': "(title + '.gv')", 'engine': '"""dot"""'}), "('G', filename=title + '.gv', engine='dot')\n", (4614, 4657), Fa...
import sys, json, numpy as np from numba import jit def consume(): return json.loads(input()) @jit def main(inputs): weights = [ [0.5, -0.91, 0.26, -0.5], [0.2, 0.8, -0.5, 1.0], [-0.5, 0.91, -0.26, 0.5], [-0.26, -0.27, 0.17, 0.87] ] biases = [2.0, 3.0, 0.5, 0.2] o...
[ "numpy.dot" ]
[((328, 351), 'numpy.dot', 'np.dot', (['weights', 'inputs'], {}), '(weights, inputs)\n', (334, 351), True, 'import sys, json, numpy as np\n')]
import numpy as np import pytest from podium.experimental.models.impl.fc_model import ScikitMLPClassifier X = np.array([[1, 0, 1], [1, 1, 1], [0, 0, 1]]) Y = np.array([0, 1, 0]) def test_scikit_mlp_model_shape(): pytest.importorskip("sklearn") model = ScikitMLPClassifier(classes=np.unique(Y)) model.fit...
[ "pytest.importorskip", "numpy.array", "numpy.unique" ]
[((113, 156), 'numpy.array', 'np.array', (['[[1, 0, 1], [1, 1, 1], [0, 0, 1]]'], {}), '([[1, 0, 1], [1, 1, 1], [0, 0, 1]])\n', (121, 156), True, 'import numpy as np\n'), ((161, 180), 'numpy.array', 'np.array', (['[0, 1, 0]'], {}), '([0, 1, 0])\n', (169, 180), True, 'import numpy as np\n'), ((222, 252), 'pytest.importor...
import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import scipy.sparse as scs # sparse matrix construction import scipy.linalg as scl # linear algebra algorithms import scipy.optimize as sco # for minimization use import matplotlib.pylab as plt # for visualizatio...
[ "numpy.random.seed", "numpy.sum", "pandas.read_csv", "time.time", "multiprocessing.Pool" ]
[((619, 630), 'time.time', 'time.time', ([], {}), '()\n', (628, 630), False, 'import time\n'), ((672, 699), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (686, 699), True, 'import numpy as np\n'), ((836, 842), 'multiprocessing.Pool', 'Pool', ([], {}), '()\n', (840, 842), False, 'from ...
''' Tests for stoqcompiler.hamiltonian modules. ''' import pytest import numpy as np from stoqcompiler.hamiltonian import Hamiltonian, HamiltonianTerm from stoqcompiler.compiler import CompilerResult from stoqcompiler.unitary import Unitary, UnitarySequence qubit_dimension = 2 class TestHamiltonian: def test_no...
[ "numpy.isreal", "stoqcompiler.hamiltonian.Hamiltonian", "numpy.allclose", "numpy.identity", "pytest.raises", "numpy.linalg.svd", "numpy.array", "numpy.kron", "numpy.max", "stoqcompiler.hamiltonian.HamiltonianTerm" ]
[((1011, 1036), 'stoqcompiler.hamiltonian.Hamiltonian', 'Hamiltonian', (['[term, term]'], {}), '([term, term])\n', (1022, 1036), False, 'from stoqcompiler.hamiltonian import Hamiltonian, HamiltonianTerm\n'), ((1056, 1087), 'stoqcompiler.hamiltonian.Hamiltonian', 'Hamiltonian', (['[term, term, term]'], {}), '([term, ter...
import cPickle as pickle import numpy as np import os import argparse import torch import h5py from HICO_DET_utils import calc_ap, obj_range, rare, getSigmoid, hoi_no_inter_all from HICO_DET_utils import obj_range, getSigmoid, hoi_no_inter_all def parse_args(): parser = argparse.ArgumentParser(description='Generat...
[ "h5py.File", "argparse.ArgumentParser", "numpy.zeros", "numpy.where", "torch.from_numpy" ]
[((276, 338), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate detection file"""'}), "(description='Generate detection file')\n", (299, 338), False, 'import argparse\n'), ((836, 870), 'h5py.File', 'h5py.File', (['"""hico_caffe600.h5"""', '"""r"""'], {}), "('hico_caffe600.h5', 'r')...
#!/usr/bin/env python import pandas import numpy as np from sklearn import model_selection from sklearn.metrics import classification_report from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score, f1_score from sklearn.tree import DecisionTreeClassifier from sklearn.neighbors import KN...
[ "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.model_selection.cross_val_score", "sklearn.preprocessing.MinMaxScaler", "sklearn.cluster.KMeans", "sklearn.metrics.accuracy_score", "sklearn.model_selection.KFold", "sklearn.tree.DecisionTreeClassifier", "sklearn.metrics.classif...
[((544, 584), 'pandas.read_csv', 'pandas.read_csv', (['filename'], {'delimiter': '""","""'}), "(filename, delimiter=',')\n", (559, 584), False, 'import pandas\n'), ((834, 863), 'numpy.unique', 'np.unique', (['Y'], {'return_counts': '(1)'}), '(Y, return_counts=1)\n', (843, 863), True, 'import numpy as np\n'), ((1259, 13...
import numpy as np import random as rand class AbstractPolicy: def __call__(self, q_values: np.ndarray) -> np.array: """ Return number of action. """ raise NotImplementedError def update(self): pass def __str__(self): raise NotImplementedError class Greedy(AbstractPoli...
[ "random.random", "numpy.random.randint", "numpy.argmax" ]
[((399, 418), 'numpy.argmax', 'np.argmax', (['q_values'], {}), '(q_values)\n', (408, 418), True, 'import numpy as np\n'), ((830, 843), 'random.random', 'rand.random', ([], {}), '()\n', (841, 843), True, 'import random as rand\n'), ((864, 903), 'numpy.random.randint', 'np.random.randint', (['(0)', 'q_values.shape[0]'], ...
# Training params. from tensorflow.contrib.keras.python import keras from tensorflow.contrib.keras.python.keras.callbacks import ModelCheckpoint, ReduceLROnPlateau from tensorflow.contrib.keras.python.keras.datasets import cifar10 from tensorflow.contrib.keras.python.keras.engine import Input, Model from tensorflo...
[ "tensorflow.contrib.keras.python.keras.datasets.cifar10.load_data", "os.path.join", "tensorflow.contrib.keras.python.keras.layers.BatchNormalization", "tensorflow.contrib.keras.python.keras.layers.Flatten", "tensorflow.contrib.keras.python.keras.backend.image_data_format", "tensorflow.contrib.keras.python...
[((980, 999), 'tensorflow.contrib.keras.python.keras.datasets.cifar10.load_data', 'cifar10.load_data', ([], {}), '()\n', (997, 999), False, 'from tensorflow.contrib.keras.python.keras.datasets import cifar10\n'), ((1860, 1908), 'tensorflow.contrib.keras.python.keras.utils.to_categorical', 'keras.utils.to_categorical', ...
#!/usr/bin/env python3 """Data preprocessing of the Gas Sensor Array Drift Dataset Data Set: https://archive.ics.uci.edu/ml/datasets/gas+sensor+array+drift+dataset This file may be executed to preprocess the data and save the result to files. """ import numpy as np import os import re import pickle ODOR_DATA_DIR ...
[ "scipy.stats.zscore", "ipdb.set_trace", "numpy.array", "os.path.join", "os.scandir", "numpy.concatenate", "re.compile" ]
[((357, 412), 'os.path.join', 'os.path.join', (['ODOR_DATA_DIR', '"""dataset_preprocessed.pkl"""'], {}), "(ODOR_DATA_DIR, 'dataset_preprocessed.pkl')\n", (369, 412), False, 'import os\n'), ((443, 503), 'os.path.join', 'os.path.join', (['ODOR_DATA_DIR', '"""dataset_preprocessed_no_6.pkl"""'], {}), "(ODOR_DATA_DIR, 'data...
### Author: <NAME> ### Description: Traffic Coordinator for handling autonomous vehicle reservations ### as they entire an intersection. import numpy as np import queue as queue import copy as copy from shapely.geometry import Point, box from shapely.affinity import rotate import kinematics as kn impo...
[ "numpy.random.uniform", "shapely.geometry.Point", "copy.deepcopy", "kinematics.Pose", "shapely.affinity.rotate", "numpy.sin", "numpy.arange", "numpy.cos", "queue.Queue", "shapely.geometry.box" ]
[((873, 886), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (884, 886), True, 'import queue as queue\n'), ((15522, 15549), 'shapely.geometry.box', 'box', (['minx', 'miny', 'maxx', 'maxy'], {}), '(minx, miny, maxx, maxy)\n', (15525, 15549), False, 'from shapely.geometry import Point, box\n'), ((15573, 15584), 'shapely...
import matplotlib.pyplot as plt import numpy as np PI = np.pi class Arrow: def __init__(self, x, y, theta, L, c): angle = np.deg2rad(30) d = 0.5 * L w = 2 x_start = x y_start = y x_end = x + L * np.cos(theta) y_end = y + L * np.sin(theta) theta_hat...
[ "numpy.sin", "numpy.cos", "matplotlib.pyplot.plot", "numpy.deg2rad" ]
[((136, 150), 'numpy.deg2rad', 'np.deg2rad', (['(30)'], {}), '(30)\n', (146, 150), True, 'import numpy as np\n'), ((692, 758), 'matplotlib.pyplot.plot', 'plt.plot', (['[x_start, x_end]', '[y_start, y_end]'], {'color': 'c', 'linewidth': 'w'}), '([x_start, x_end], [y_start, y_end], color=c, linewidth=w)\n', (700, 758), T...
import asyncio from datetime import datetime from typing import Collection, Dict, Optional, Sequence, Tuple import aiomcache import morcilla import numpy as np import pandas as pd from sqlalchemy import and_, func, select from sqlalchemy.orm.attributes import InstrumentedAttribute from athenian.api.controllers.jira i...
[ "pandas.DataFrame", "athenian.api.models.metadata.jira.Issue.project_id.in_", "athenian.api.controllers.miners.jira.issue.fetch_jira_issues", "asyncio.sleep", "numpy.argsort", "numpy.cumsum", "athenian.api.controllers.miners.filters.LabelFilter.empty", "sqlalchemy.func.count", "athenian.api.models.m...
[((4139, 4168), 'numpy.argsort', 'np.argsort', (['children_epic_ids'], {}), '(children_epic_ids)\n', (4149, 4168), True, 'import numpy as np\n'), ((4257, 4305), 'numpy.unique', 'np.unique', (['children_epic_ids'], {'return_counts': '(True)'}), '(children_epic_ids, return_counts=True)\n', (4266, 4305), True, 'import num...
from cellprofiler_core.constants.measurement import COLTYPE_INTEGER from cellprofiler_core.constants.measurement import FF_CHILDREN_COUNT from cellprofiler_core.constants.measurement import FF_PARENT from cellprofiler_core.image import ObjectsImage from cellprofiler_core.module import Identify from cellprofiler_core.se...
[ "numpy.sum", "os.unlink", "cellprofiler_core.setting.text.LabelName", "wx.CheckBox", "numpy.ones", "numpy.arange", "wx.RadioBox", "numpy.prod", "wx.lib.filebrowsebutton.FileBrowseButton", "cellprofiler.gui.editobjectsdlg.EditObjectsDialog", "os.path.exists", "numpy.random.RandomState", "cell...
[((3479, 3746), 'cellprofiler_core.setting.subscriber.LabelSubscriber', 'LabelSubscriber', (['"""Select the objects to be edited"""', '"""None"""'], {'doc': '"""Choose a set of previously identified objects\nfor editing, such as those produced by one of the\n**Identify** modules (e.g., "*IdentifyPrimaryObjects*", "*Ide...
import subprocess import numpy as np import time __all__ = [ "all_gpus_currently_idle", "all_gpus_idle", "shutdown_when_all_gpus_idle", "shutdown_when_all_gpus_idle_call", "shutdown_timed", "shutdown_timed_call", ] def as_int(x, default=0): """Convert a thing to an integer. Args: ...
[ "subprocess.Popen", "time.sleep", "time.time", "subprocess.call", "numpy.all" ]
[((734, 858), 'subprocess.Popen', 'subprocess.Popen', (["['nvidia-smi', '--query-gpu=utilization.gpu', '--format=csv,noheader,nounits']"], {'stdout': 'subprocess.PIPE'}), "(['nvidia-smi', '--query-gpu=utilization.gpu',\n '--format=csv,noheader,nounits'], stdout=subprocess.PIPE)\n", (750, 858), False, 'import subproc...
# -*- coding: utf-8 -*- """ MuLES client example: data_two_intervals This example shows the utilization of MuLES to: - Start acquisition of data from one device - Get data from MuLES during two periods of 15 and 10 seconds - Send triggers that will be reflected in the saved data The scrip is divided as follows 1. Conn...
[ "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.arange", "mules.MulesClient" ]
[((1302, 1318), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (1311, 1318), True, 'import matplotlib.pyplot as plt\n'), ((1418, 1455), 'mules.MulesClient', 'mules.MulesClient', (['"""127.0.0.1"""', '(30000)'], {}), "('127.0.0.1', 30000)\n", (1435, 1455), False, 'import mules\n'), ((2436, 246...
import os import numpy as np from collections import namedtuple from pathlib import Path from typing import Tuple, List, Dict, Optional from algorithms.actor_critic import ActorCriticParams from algorithms.discriminator import DiscrimParams class Count: def __init__(self, name: str, datatype: type, sa...
[ "numpy.load", "numpy.save", "numpy.random.randint", "numpy.array", "os.listdir", "numpy.prod" ]
[((1316, 1362), 'numpy.save', 'np.save', (['f"""{self.count_save_path}"""', 'self.value'], {}), "(f'{self.count_save_path}', self.value)\n", (1323, 1362), True, 'import numpy as np\n'), ((5111, 5162), 'numpy.load', 'np.load', (['f"""{self.param_save}/param_names_array.npy"""'], {}), "(f'{self.param_save}/param_names_ar...
"""Data loader""" import random import numpy as np import os import sys from tqdm import tqdm import torch from bert import BertTokenizer import json # import sys # reload(sys) # sys.setdefaultencoding('utf-8') # torch.set_printoptions(threshold=sys.maxsize) # WHITESPACE_PLACEHOLDER = ' □ ' qmark_placeholder = '[unuse...
[ "unicodedata.normalize", "tqdm.tqdm", "bert.BertTokenizer.from_pretrained", "json.loads", "random.shuffle", "unicodedata.category", "numpy.zeros", "random.seed", "nltk.tokenize.treebank.TreebankWordTokenizer", "os.path.join", "torch.tensor" ]
[((1464, 1487), 'nltk.tokenize.treebank.TreebankWordTokenizer', 'TreebankWordTokenizer', ([], {}), '()\n', (1485, 1487), False, 'from nltk.tokenize.treebank import TreebankWordTokenizer\n'), ((2868, 2938), 'bert.BertTokenizer.from_pretrained', 'BertTokenizer.from_pretrained', (['args.bert_model_dir'], {'do_lower_case':...
from typing import Tuple import networkx as nx import numpy as np import torch from torch import LongTensor, Tensor import torch_sparse as tsparse import torch_scatter as tscatter import torch_geometric from torch_geometric.data.data import Data import tqdm from . import eigenpairs def check_data(pos:torch.Tensor=Non...
[ "knn_cuda.KNN", "torch_sparse.spmm", "torch.is_floating_point", "torch.nn.functional.mse_loss", "numpy.zeros", "torch.diag", "torch.exp", "networkx.Graph", "torch_scatter.scatter_add", "torch.zeros", "torch.cross", "torch.tensor", "networkx.all_pairs_shortest_path" ]
[((1915, 1925), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (1923, 1925), True, 'import networkx as nx\n'), ((2001, 2030), 'numpy.zeros', 'np.zeros', (['[n, k]'], {'dtype': 'float'}), '([n, k], dtype=float)\n', (2009, 2030), True, 'import numpy as np\n'), ((2041, 2089), 'networkx.all_pairs_shortest_path', 'nx.all_p...
# coding:utf-8 import os from numpy import * import numpy as np import cv2 import matplotlib.pyplot as plt from scipy.linalg import orth from pylab import mpl from dataloader import load_PIE, load_FRD mpl.rcParams['font.sans-serif'] = ['SimHei'] datasets = 'FRD' # PIE or FRD # 参数 feature_n = 101 # 需要的特征(最多) ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.yticks", "numpy.linalg.eig", "numpy.shape", "dataloader.load_PIE", "matplotlib.pyplot.figure", "numpy.mean", "numpy.array", "scipy.linalg.orth", "numpy.tile", "dataloader.load_FRD", "matplo...
[((598, 612), 'numpy.shape', 'np.shape', (['data'], {}), '(data)\n', (606, 612), True, 'import numpy as np\n'), ((629, 645), 'numpy.mean', 'np.mean', (['data', '(0)'], {}), '(data, 0)\n', (636, 645), True, 'import numpy as np\n'), ((896, 912), 'numpy.linalg.eig', 'np.linalg.eig', (['C'], {}), '(C)\n', (909, 912), True,...
from __future__ import print_function import numpy as np import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt from matplotlib import gridspec import os from sklearn.metrics import confusion_matrix import glob import sys from alsNet.dataset import Dataset class_names={ 0: 'Power', 1: 'Low Veg...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.subplot", "numpy.sum", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.gca", "numpy.zeros", "numpy.isnan", "alsNet.dataset.Dataset", "matplotlib.pyplot.text", "matplotlib.pyplot.figure", "matplotlib.use", "glob.glob", "mat...
[((75, 96), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (89, 96), False, 'import matplotlib\n'), ((1404, 1439), 'numpy.sum', 'np.sum', (['cm_buf[:, sum_idxs]'], {'axis': '(1)'}), '(cm_buf[:, sum_idxs], axis=1)\n', (1410, 1439), True, 'import numpy as np\n'), ((1466, 1501), 'numpy.sum', 'np.sum...
import numpy as np # input with open('input.txt') as f: lines = f.readlines() # part 1 code = {'F': 0, 'B': 1, 'L': 0, 'R': 1} vals = [64, 32, 16, 8, 4, 2, 1, 4, 2, 1] seats = [] for line in lines: seat = 0 for char, val in zip(line, vals): scale = 8 if char in 'FB' else 1 seat += scale * ...
[ "numpy.sort", "numpy.array" ]
[((368, 383), 'numpy.array', 'np.array', (['seats'], {}), '(seats)\n', (376, 383), True, 'import numpy as np\n'), ((421, 435), 'numpy.sort', 'np.sort', (['seats'], {}), '(seats)\n', (428, 435), True, 'import numpy as np\n')]
import torch import torch.nn as nn import bcolz import numpy as np import math import warnings from typing import Optional import torch.multiprocessing as mp """ ASR model parts """ class LayerNorm(nn.Module): def __init__(self, n_features): super(LayerNorm, self).__init__() self.layer_norm =...
[ "torch.nn.Dropout", "torch.nn.Embedding", "torch.empty", "torch.cos", "torch.nn.Softmax", "torch.arange", "torch.device", "torch.ones", "torch.nn.modules.transformer._get_activation_fn", "torch.nn.LayerNorm", "torch.nn.modules.transformer._get_clones", "torch.Tensor", "torch.nn.Linear", "t...
[((321, 345), 'torch.nn.LayerNorm', 'nn.LayerNorm', (['n_features'], {}), '(n_features)\n', (333, 345), True, 'import torch.nn as nn\n'), ((2013, 2130), 'torch.nn.GRU', 'nn.GRU', ([], {'input_size': 'input_size', 'hidden_size': 'hidden_size', 'num_layers': '(1)', 'batch_first': 'batch_first', 'bidirectional': '(True)'}...
import re import warnings import numpy as np import pandas as pd import scipy from pandas import DataFrame from sklearn.feature_extraction.text import TfidfTransformer from sklearn.neighbors import BallTree, KDTree, NearestNeighbors from sklearn.preprocessing import MultiLabelBinarizer, Normalizer from tqdm import tqd...
[ "pandas.DataFrame", "numpy.average", "pandas.DataFrame.sparse.from_spmatrix", "numpy.log2", "numpy.float32", "numpy.zeros", "numpy.ones", "sklearn.preprocessing.MultiLabelBinarizer", "scipy.sparse.csr_matrix", "sklearn.neighbors.NearestNeighbors", "pandas.read_parquet", "numpy.array", "numpy...
[((1151, 1162), 'pandas.DataFrame', 'DataFrame', ([], {}), '()\n', (1160, 1162), False, 'from pandas import DataFrame\n'), ((5028, 5055), 'pandas.read_parquet', 'pd.read_parquet', (['train_path'], {}), '(train_path)\n', (5043, 5055), True, 'import pandas as pd\n'), ((5076, 5102), 'pandas.read_parquet', 'pd.read_parquet...
import collections import copy import dataclasses import pathlib import madgrad import numpy as np import sklearn import sklearn.metrics import sklearn.utils import torch from fastprogress.fastprogress import progress_bar import mabe.data import mabe.loss import mabe.model @dataclasses.dataclass class TrainingConfi...
[ "numpy.zeros_like", "numpy.sum", "numpy.concatenate", "torch.argmax", "torch.any", "numpy.all", "torch.optim.lr_scheduler.CosineAnnealingLR", "collections.defaultdict", "sklearn.metrics.f1_score", "numpy.mean", "numpy.array", "numpy.argwhere", "torch.no_grad", "numpy.unique", "torch.from...
[((5868, 5897), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (5891, 5897), False, 'import collections\n'), ((5955, 5984), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (5978, 5984), False, 'import collections\n'), ((9423, 9440), 'torch.any', 'torc...
# Project Recognission two level classification import time from statistics import mean import numpy as np import pandas as pd import sklearn.metrics as skm from sklearn import preprocessing, svm from sklearn.decomposition import FastICA, PCA from sklearn.ensemble import BaggingClassifier, RandomForestClassif...
[ "sklearn.preprocessing.StandardScaler", "sklearn.metrics.accuracy_score", "sklearn.tree.DecisionTreeClassifier", "sklearn.manifold.LocallyLinearEmbedding", "sklearn.ensemble.VotingClassifier", "sklearn.neural_network.MLPClassifier", "sklearn.svm.SVC", "pandas.set_option", "sklearn.cluster.KMeans", ...
[((815, 857), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', 'None'], {}), "('display.max_columns', None)\n", (828, 857), True, 'import pandas as pd\n'), ((859, 898), 'pandas.set_option', 'pd.set_option', (['"""display.max_rows"""', 'None'], {}), "('display.max_rows', None)\n", (872, 898), True, '...
""" <NAME> Thu Dec 6 21:26:00 2018 """ import os from subprocess import call from importlib import util import numpy as np from numpy import cbrt import matplotlib as mpl # Allows matplotlib to run without being install as a framework on OSX mpl.use('TkAGG') import matplotlib.pyplot as plt from datetime import date f...
[ "numpy.sum", "numpy.argmax", "os.path.isfile", "numpy.arange", "numpy.linalg.norm", "os.chdir", "solar_system.load_constants", "fluxions.Vars", "matplotlib.rcParams.update", "solar_system.julian_day", "solar_system.U_ij", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.cbrt"...
[((244, 260), 'matplotlib.use', 'mpl.use', (['"""TkAGG"""'], {}), "('TkAGG')\n", (251, 260), True, 'import matplotlib as mpl\n'), ((1098, 1136), 'matplotlib.rcParams.update', 'mpl.rcParams.update', (["{'font.size': 20}"], {}), "({'font.size': 20})\n", (1117, 1136), True, 'import matplotlib as mpl\n'), ((10962, 10987), ...
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.envir...
[ "psutil.Process", "trimesh.load", "numpy.save", "trimesh.sample.sample_surface", "os.path.dirname", "util.misc.ensure_directory", "os.cpu_count", "numpy.arange", "mesh_to_sdf.get_surface_point_cloud", "numpy.concatenate" ]
[((67, 81), 'os.cpu_count', 'os.cpu_count', ([], {}), '()\n', (79, 81), False, 'import os\n'), ((2061, 2077), 'psutil.Process', 'psutil.Process', ([], {}), '()\n', (2075, 2077), False, 'import psutil\n'), ((4480, 4516), 'util.misc.ensure_directory', 'ensure_directory', (['self.DIRECTORY_SDF'], {}), '(self.DIRECTORY_SDF...
"""Geometry conversion utilities.""" import re from typing import NewType, Tuple import numpy as np import scipy.constants # type: ignore[import] # Vector of atomic species Species = NewType('Species', Tuple[str, ...]) # Crystal basis [3x3] Basis = NewType('Basis', np.ndarray) # Position matrix [n_atoms x 3] Tau = ...
[ "numpy.linalg.det", "numpy.linalg.norm", "numpy.linalg.inv", "numpy.dot", "typing.NewType", "numpy.arccos", "re.compile" ]
[((187, 222), 'typing.NewType', 'NewType', (['"""Species"""', 'Tuple[str, ...]'], {}), "('Species', Tuple[str, ...])\n", (194, 222), False, 'from typing import NewType, Tuple\n'), ((253, 281), 'typing.NewType', 'NewType', (['"""Basis"""', 'np.ndarray'], {}), "('Basis', np.ndarray)\n", (260, 281), False, 'from typing im...
#!/usr/bin/env python import sys import h5py import numpy as np from tronn.plot.visualization import plot_pwm from tronn.util.pwms import PWM def main(): """plot pwm weights """ # args tfmodisco_file = sys.argv[1] metacluster_name = sys.argv[2] pattern_name = sys.argv[3] plot_prefix =...
[ "tronn.util.pwms.PWM", "h5py.File", "numpy.array" ]
[((468, 498), 'h5py.File', 'h5py.File', (['tfmodisco_file', '"""r"""'], {}), "(tfmodisco_file, 'r')\n", (477, 498), False, 'import h5py\n'), ((1054, 1066), 'tronn.util.pwms.PWM', 'PWM', (['weights'], {}), '(weights)\n', (1057, 1066), False, 'from tronn.util.pwms import PWM\n'), ((972, 989), 'numpy.array', 'np.array', (...
import tensorflow as tf import numpy as np def mask3d(nx, ny, nz, center_r=[15, 15, 0], undersampling=0.5): # create undersampling mask mask_shape = np.array([nx, ny, nz]) Npts = mask_shape.prod() # total number of data points k = int(round(Npts * undersampling)) # undersampling ri = np.random.c...
[ "numpy.ones", "tensorflow.signal.fft", "numpy.linalg.norm", "numpy.arange", "tensorflow.signal.fftshift", "numpy.complex64", "tensorflow.sqrt", "tensorflow.signal.ifft", "tensorflow.abs", "tensorflow.nn.relu", "tensorflow.math.real", "tensorflow.cast", "numpy.random.choice", "tensorflow.ma...
[((159, 181), 'numpy.array', 'np.array', (['[nx, ny, nz]'], {}), '([nx, ny, nz])\n', (167, 181), True, 'import numpy as np\n'), ((309, 349), 'numpy.random.choice', 'np.random.choice', (['Npts', 'k'], {'replace': '(False)'}), '(Npts, k, replace=False)\n', (325, 349), True, 'import numpy as np\n'), ((386, 400), 'numpy.ze...
import tensorflow as tf import numpy as np x_data = np.random.rand(100).astype(np.float16) W=tf.Variable(tf.random_uniform([1],-1,1)) B=tf.Variable(tf.zeros([1])) k=3 b=1 y_data=x_data*k+b y=W*x_data+B loss=tf.reduce_mean(tf.square(y_data-y)) opt=tf.train.GradientDescentOptimizer(0.5) train=opt.minimize(loss) init=...
[ "tensorflow.random_uniform", "tensorflow.Session", "tensorflow.zeros", "tensorflow.initialize_all_variables", "tensorflow.square", "numpy.random.rand", "tensorflow.train.GradientDescentOptimizer" ]
[((250, 288), 'tensorflow.train.GradientDescentOptimizer', 'tf.train.GradientDescentOptimizer', (['(0.5)'], {}), '(0.5)\n', (283, 288), True, 'import tensorflow as tf\n'), ((320, 349), 'tensorflow.initialize_all_variables', 'tf.initialize_all_variables', ([], {}), '()\n', (347, 349), True, 'import tensorflow as tf\n'),...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import numpy as np import pandas as pd import re import string import sys import unidecode import yaml from collections import defaultdict from gensim import corpora, models from itertools import chain from joblib import Parallel, delayed from nltk import ...
[ "argparse.ArgumentParser", "pandas.read_csv", "re.finditer", "yaml.dump", "collections.defaultdict", "pandas.DataFrame", "gensim.corpora.Dictionary", "scipy.sparse.triu", "scipy.sparse.coo_matrix", "itertools.chain", "nltk.tokenize.TweetTokenizer", "nltk.ngrams", "nltk.corpus.stopwords.words...
[((1345, 1371), 'unidecode.unidecode', 'unidecode.unidecode', (['token'], {}), '(token)\n', (1364, 1371), False, 'import unidecode\n'), ((3809, 3840), 'pandas.read_csv', 'pd.read_csv', (['args.dataset_input'], {}), '(args.dataset_input)\n', (3820, 3840), True, 'import pandas as pd\n'), ((4842, 4895), 'nltk.tokenize.Twe...
import concurrent.futures as cf import operator import numpy as np # Required for fast concatenation of MDTraj trajectories. try: import mdtraj except ImportError: mdtraj = None from functools import partial, reduce from tqdm import tqdm from westpa.analysis.core import Walker, Trace from typing import Calla...
[ "functools.partial", "numpy.concatenate", "functools.reduce", "concurrent.futures.ThreadPoolExecutor", "concurrent.futures.as_completed" ]
[((9635, 9672), 'functools.reduce', 'reduce', (['operator.concat', 'trajectories'], {}), '(operator.concat, trajectories)\n', (9641, 9672), False, 'from functools import partial, reduce\n'), ((9453, 9481), 'numpy.concatenate', 'np.concatenate', (['trajectories'], {}), '(trajectories)\n', (9467, 9481), True, 'import num...
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" from typing import Generator, Any import click import os import string import random import numpy as np from read_vectors_files import fvecs_read, ivecs_read from jina.flow import Flow RANDOM_SEED = 14 os.environ['...
[ "read_vectors_files.ivecs_read", "read_vectors_files.fvecs_read", "numpy.frombuffer", "click.option", "os.path.exists", "random.choice", "click.command", "random.seed", "jina.flow.Flow", "numpy.array", "os.path.join" ]
[((2277, 2292), 'click.command', 'click.command', ([], {}), '()\n', (2290, 2292), False, 'import click\n'), ((2294, 2322), 'click.option', 'click.option', (['"""--task"""', '"""-t"""'], {}), "('--task', '-t')\n", (2306, 2322), False, 'import click\n'), ((2324, 2370), 'click.option', 'click.option', (['"""--batch_size""...
# -*- coding: utf-8 -*- """ @author: <NAME> """ from pathlib import Path import pandas as pd, numpy as np from itertools import combinations from scipy.spatial.distance import pdist, squareform from skbio import DistanceMatrix from skbio.stats.distance import permanova script_folder = Path.cwd() outputs_folder = scri...
[ "numpy.random.seed", "pandas.read_csv", "skbio.stats.distance.permanova", "scipy.spatial.distance.pdist", "pathlib.Path.cwd", "pandas.concat", "pandas.ExcelWriter", "skbio.DistanceMatrix" ]
[((288, 298), 'pathlib.Path.cwd', 'Path.cwd', ([], {}), '()\n', (296, 298), False, 'from pathlib import Path\n'), ((426, 495), 'pandas.read_csv', 'pd.read_csv', (['fname'], {'sep': '"""\t"""', 'header': '(0)', 'index_col': '(0)', 'encoding': '"""utf-8"""'}), "(fname, sep='\\t', header=0, index_col=0, encoding='utf-8')\...
""" ================================================================== Plot of accuracy and time as sample_size and num_features increase ================================================================== We show that the increase in computation time is linear when increasing the number of features or the sample size i...
[ "matplotlib.pyplot.show", "sklearn.linear_model.SGDClassifier", "sklearn.model_selection.cross_val_score", "sklearn.datasets.make_classification", "numpy.random.RandomState", "time.time", "numpy.linspace", "matplotlib.pyplot.subplots", "numpy.sqrt" ]
[((621, 646), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (642, 646), True, 'import numpy as np\n'), ((1432, 1450), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)', '(2)'], {}), '(2, 2)\n', (1444, 1450), True, 'import matplotlib.pyplot as plt\n'), ((2368, 2378), 'matplotlib.pypl...
import pickle import matplotlib.pyplot as plt import numpy as np import pandas as pd import plotly.express as px import seaborn as sns import streamlit as st from sklearn.metrics import confusion_matrix, matthews_corrcoef from sklearn.model_selection import StratifiedKFold, train_test_split from sklearn.preprocessing ...
[ "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.MinMaxScaler", "streamlit.title", "matplotlib.pyplot.figure", "sklearn.svm.SVC", "numpy.unique", "pandas.DataFrame", "streamlit.subheader", "streamlit.button", "streamlit.beta_columns", "streamlit.header", ...
[((436, 463), 'streamlit.title', 'st.title', (['"""Unoptimized SVM"""'], {}), "('Unoptimized SVM')\n", (444, 463), True, 'import streamlit as st\n'), ((469, 497), 'streamlit.header', 'st.header', (['"""Dataset Setting"""'], {}), "('Dataset Setting')\n", (478, 497), True, 'import streamlit as st\n'), ((515, 533), 'strea...
import random import numpy as np from Agents.pedestrian import pedestrian from Agents.vehicle import vehicle from TB_common_functions import log, calculateDistance # from Agents.traffic_light import traffic_light def interpolate_path(path_tuple, increments_resolution): path_tuple_interpolated = [] path_tuple_in...
[ "numpy.subtract", "numpy.ceil", "Agents.vehicle.vehicle", "TB_common_functions.log", "numpy.hypot", "numpy.linspace" ]
[((461, 487), 'numpy.hypot', 'np.hypot', (['diff[0]', 'diff[1]'], {}), '(diff[0], diff[1])\n', (469, 487), True, 'import numpy as np\n'), ((1777, 1809), 'TB_common_functions.log', 'log', (['self.logging_time_increment'], {}), '(self.logging_time_increment)\n', (1780, 1809), False, 'from TB_common_functions import log, ...
# coding: utf-8 # Copyright (c) <NAME>. # Distributed under the terms of the MIT License. """ This module implements functions to calculate the ionic conductivity. """ from typing import Union import numpy as np from tqdm.notebook import tqdm from scipy import stats from MDAnalysis import Universe, AtomGroup __autho...
[ "numpy.fft.ifft", "numpy.abs", "numpy.log", "numpy.fft.fft", "numpy.square", "numpy.zeros", "tqdm.notebook.tqdm", "numpy.ones", "numpy.append", "numpy.max", "numpy.min", "numpy.arange", "scipy.stats.linregress", "numpy.array", "numpy.log10" ]
[((939, 961), 'numpy.fft.fft', 'np.fft.fft', (['x'], {'n': '(2 * N)'}), '(x, n=2 * N)\n', (949, 961), True, 'import numpy as np\n'), ((1031, 1047), 'numpy.fft.ifft', 'np.fft.ifft', (['PSD'], {}), '(PSD)\n', (1042, 1047), True, 'import numpy as np\n'), ((1472, 1487), 'numpy.append', 'np.append', (['D', '(0)'], {}), '(D,...
# coding: utf-8 # # Digit Recognition # # ## 1. Introduction # # In this analysis, the handwritten digits are identified using support vector machines and radial basis functions. # # ### 1.1 Libraries # # The essential libraries used here are numpy, matplotlib, and scikit-learn. For convenience, pandas and IPyth...
[ "pandas.DataFrame", "tqdm.tqdm", "numpy.set_printoptions", "itertools.product", "timeit.default_timer", "sklearn.model_selection.KFold", "numpy.argmin", "pandas.read_table", "matplotlib.pyplot.figure", "tabulate.tabulate", "numpy.logical_or", "numpy.array", "sklearn.svm.SVC", "numpy.random...
[((749, 796), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(4)', 'threshold': '(200)'}), '(precision=4, threshold=200)\n', (768, 796), True, 'import numpy as np\n'), ((3777, 3791), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (3789, 3791), True, 'import pandas as pd\n'), ((5656, 5670), ...
#!/usr/bin/python # # Copyright 2020 The Authors of "Rate-Distortion Optimization Guided Autoencoder for Isometric Embedding in Euclidean Latent Space." # 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. # ...
[ "numpy.sum", "tensorflow.clip_by_value", "tensorflow.image.ssim", "numpy.ones", "numpy.argsort", "matplotlib.pyplot.figure", "numpy.arange", "numpy.exp", "numpy.max", "inputpipeline.get_dataset", "matplotlib.pyplot.subplots", "numpy.save", "tensorflow.round", "numpy.min", "tensorflow.squ...
[((5935, 5956), 'tensorflow.round', 'tf.round', (['(image * 255)'], {}), '(image * 255)\n', (5943, 5956), True, 'import tensorflow as tf\n'), ((5968, 6001), 'tensorflow.saturate_cast', 'tf.saturate_cast', (['image', 'tf.uint8'], {}), '(image, tf.uint8)\n', (5984, 6001), True, 'import tensorflow as tf\n'), ((6189, 6236)...
import collections import datetime import itertools import numpy as np import pandas as pd import pytz from .datum import Tag, Field from .exceptions import MissingFieldError, MissingTagError def is_tag(args): return isinstance(args[1], Tag) def is_field(args): return isinstance(args[1], Field) class Me...
[ "pandas.DataFrame.from_items", "numpy.array", "pandas.DataFrame.from_records" ]
[((5459, 5489), 'pandas.DataFrame.from_items', 'pd.DataFrame.from_items', (['items'], {}), '(items)\n', (5482, 5489), True, 'import pandas as pd\n'), ((4805, 4865), 'pandas.DataFrame.from_records', 'pd.DataFrame.from_records', (["s['values']"], {'columns': 'column_names'}), "(s['values'], columns=column_names)\n", (483...
import os import argparse import logging import nmrex import numpy as np import copy def transform(rcsb): structure = nmrex.entry.structure() # save separate models for model in structure.child_list: new = copy.deepcopy(structure) new.child_list = [model] nmrex.entry.save_structur...
[ "copy.deepcopy", "argparse.ArgumentParser", "logging.basicConfig", "nmrex.entry.save_structure", "numpy.median", "nmrex.entry.structure", "os.path.expanduser" ]
[((124, 147), 'nmrex.entry.structure', 'nmrex.entry.structure', ([], {}), '()\n', (145, 147), False, 'import nmrex\n'), ((630, 649), 'numpy.median', 'np.median', (['coord', '(0)'], {}), '(coord, 0)\n', (639, 649), True, 'import numpy as np\n'), ((661, 685), 'copy.deepcopy', 'copy.deepcopy', (['structure'], {}), '(struc...
import matplotlib.pyplot as plt import numpy as np import pickle import json from pylab import plot, show, savefig, xlim, figure, ylim, legend, boxplot, setp, axes from i3Deep import utils import pandas as pd import os import seaborn as sns import matplotlib def plot_dice_box_plots(): sns.set_theme(style="whitegr...
[ "seaborn.set_theme", "seaborn.axes_style", "matplotlib.pyplot.clf", "pandas.read_csv", "numpy.std", "numpy.isnan", "matplotlib.pyplot.figure", "seaborn.boxplot", "numpy.mean", "os.path.isfile", "pandas.concat", "matplotlib.pyplot.savefig" ]
[((292, 324), 'seaborn.set_theme', 'sns.set_theme', ([], {'style': '"""whitegrid"""'}), "(style='whitegrid')\n", (305, 324), True, 'import seaborn as sns\n'), ((337, 353), 'seaborn.axes_style', 'sns.axes_style', ([], {}), '()\n', (351, 353), True, 'import seaborn as sns\n'), ((364, 430), 'matplotlib.pyplot.figure', 'pl...
""" unemloyment_v1 Gym module implementing the Finnish social security including earnings-related components, e.g., the unemployment benefit korjauksia julkaistuun versioon: - kansaeläkkeen yhteensovitus huomioitu väärin, joten kansaneläke huomioitiin liian pienenä, ei kuitenkaan vaikuttanut...
[ "numpy.random.uniform", "numpy.random.seed", "numpy.maximum", "fin_benefits.BasicIncomeBenefits", "numpy.log", "gym.logger.warn", "numpy.floor", "gym.spaces.Discrete", "numpy.zeros", "numpy.ones", "numpy.array", "gym.spaces.Box", "fin_benefits.Benefits", "numpy.arange", "numpy.random.nor...
[((8933, 8959), 'numpy.zeros', 'np.zeros', (['(self.max_age + 1)'], {}), '(self.max_age + 1)\n', (8941, 8959), True, 'import numpy as np\n'), ((11745, 11763), 'gym.spaces.Discrete', 'spaces.Discrete', (['(4)'], {}), '(4)\n', (11760, 11763), False, 'from gym import spaces, logger, utils, error\n'), ((11797, 11846), 'gym...
"""Utility functions """ import math import os from functools import singledispatch import numpy as np import pandas as pd __all__ = ["load_dataset"] ANCHOR_DATETIME = np.datetime64("1970-01-01") # I remember the day well def load_dataset(name: str) -> pd.DataFrame: """Load dataset from shellplot library ...
[ "numpy.datetime64", "pandas.read_csv", "os.path.dirname", "numpy.isnan", "numpy.array", "os.path.join" ]
[((171, 198), 'numpy.datetime64', 'np.datetime64', (['"""1970-01-01"""'], {}), "('1970-01-01')\n", (184, 198), True, 'import numpy as np\n'), ((555, 580), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (570, 580), False, 'import os\n'), ((600, 652), 'os.path.join', 'os.path.join', (['module_p...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 4 19:55:24 2019 @author: avelinojaver """ import sys from pathlib import Path dname = Path(__file__).resolve().parents[1] sys.path.append(str(dname)) import torch import pandas as pd import cv2 import numpy as np import matplotlib.pylab as plt ...
[ "numpy.full", "tqdm.tqdm", "torch.from_numpy", "pathlib.Path.home", "skimage.feature.peak_local_max", "torch.load", "cell_localization.evaluation.localmaxima.evaluate_coordinates", "torch.nn.functional.softmax", "pathlib.Path", "torch.clamp", "numpy.array", "matplotlib.pylab.subplots", "torc...
[((672, 710), 'torch.nn.functional.softmax', 'torch.nn.functional.softmax', (['hh'], {'dim': '(2)'}), '(hh, dim=2)\n', (699, 710), False, 'import torch\n'), ((4332, 4374), 'torch.load', 'torch.load', (['model_path'], {'map_location': '"""cpu"""'}), "(model_path, map_location='cpu')\n", (4342, 4374), False, 'import torc...
#!/usr/bin/env python3 """ A custom gaussian harness for QCEngine which should be registered with qcengine. """ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple import numpy as np import cclib from qcelemental.models import AtomicInput, AtomicResult from qcelemental.util import which from qcengine....
[ "qcengine.util.execute", "qcengine.util.disk_files", "cclib.io.ccread", "numpy.ceil", "qcengine.util.get_template", "numpy.zeros", "qcengine.units.ureg.conversion_factor", "numpy.array", "qcelemental.models.AtomicResult", "qcelemental.util.which", "qcengine.exceptions.UnknownError" ]
[((1084, 1114), 'qcelemental.util.which', 'which', (['"""g09"""'], {'return_bool': '(True)'}), "('g09', return_bool=True)\n", (1089, 1114), False, 'from qcelemental.util import which\n'), ((1136, 1166), 'qcelemental.util.which', 'which', (['"""g16"""'], {'return_bool': '(True)'}), "('g16', return_bool=True)\n", (1141, ...
#coding:utf-8 from typing import Set from scipy.optimize.optimize import main from basic_config import * import seaborn as sns import pandas as pd import numpy as np import statsmodels.api as sm lowess = sm.nonparametric.lowess from patsy import dmatrices import statsmodels.formula.api as smf def hist_attrs(data, att...
[ "pandas.DataFrame", "seaborn.lineplot", "seaborn.histplot", "pandas.read_csv", "numpy.min", "numpy.max", "statsmodels.formula.api.ols", "seaborn.set_theme" ]
[((1285, 1373), 'seaborn.histplot', 'sns.histplot', (['data'], {'x': 'attr_name', 'ax': 'ax', 'log_scale': 'log', 'kde': '(True)', 'stat': '"""probability"""'}), "(data, x=attr_name, ax=ax, log_scale=log, kde=True, stat=\n 'probability')\n", (1297, 1373), True, 'import seaborn as sns\n'), ((2311, 2371), 'seaborn.lin...
"""Input/output functions (**work in progress**).""" import numpy as np import datetime as dt from .state import State from .grid import Grid def to_dataset(states): # TODO raise NotImplementedError("This feature has not been implemented yet") def from_dataset(dataset, names=None, grid_kwargs=None): ""...
[ "numpy.datetime64", "numpy.isclose", "numpy.diff", "numpy.timedelta64" ]
[((3053, 3076), 'numpy.isclose', 'np.isclose', (['(-dlat)', 'dlon'], {}), '(-dlat, dlon)\n', (3063, 3076), True, 'import numpy as np\n'), ((2884, 2905), 'numpy.diff', 'np.diff', (['lats'], {'axis': '(0)'}), '(lats, axis=0)\n', (2891, 2905), True, 'import numpy as np\n'), ((2929, 2951), 'numpy.diff', 'np.diff', (['lons'...
import os import logging from sklearn.model_selection import train_test_split # Compute ROC curve and ROC area from sklearn.metrics import roc_curve, auc import numpy as np def split_data(data, y_name, test_size, SEED): """ This function splits the data in train and test sets, but before, it performs one ho...
[ "os.mkdir", "numpy.sum", "logging.FileHandler", "sklearn.metrics.roc_curve", "logging.basicConfig", "sklearn.model_selection.train_test_split", "os.path.exists", "logging.Formatter", "sklearn.metrics.auc", "os.path.isfile", "os.path.join", "logging.getLogger" ]
[((1258, 1320), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': 'test_size', 'random_state': 'SEED'}), '(X, y, test_size=test_size, random_state=SEED)\n', (1274, 1320), False, 'from sklearn.model_selection import train_test_split\n'), ((2732, 2769), 'numpy.sum', 'np.sum', (['(...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Import modules import pytest import numpy as np # Import from package from pyswarms.single import GlobalBestPSO, LocalBestPSO from pyswarms.utils.functions.single_obj import rosenbrock_func def rosenbrock_with_args(x, a, b): f = (a - x[:, 0]) ** 2 + b * (x[:, 1] ...
[ "pyswarms.single.GlobalBestPSO", "numpy.ones", "numpy.isclose", "pytest.raises", "pytest.mark.parametrize", "pyswarms.single.LocalBestPSO" ]
[((357, 412), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""func"""', '[rosenbrock_with_args]'], {}), "('func', [rosenbrock_with_args])\n", (380, 412), False, 'import pytest\n'), ((1043, 1098), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""func"""', '[rosenbrock_with_args]'], {}), "('func', ...
import os import joblib import numpy as np from pathlib import Path from pyxit.estimator import COLORSPACE_RGB, COLORSPACE_TRGB, COLORSPACE_HSV, COLORSPACE_GRAY, _raw_to_trgb, _raw_to_hsv import shapely from shapely import wkt from shapely.affinity import affine_transform, translate from skimage.util.shape import view...
[ "pathlib.Path.home", "numpy.argmax", "cytomine.models.ImageInstanceCollection", "numpy.ones", "cytomine.models.Job", "pyxit.estimator._raw_to_hsv", "numpy.product", "numpy.mean", "numpy.arange", "os.path.join", "sldc.StandardOutputLogger", "numpy.prod", "numpy.full", "numpy.copy", "skima...
[((2626, 2665), 'skimage.util.shape.view_as_windows', 'view_as_windows', (['image', 'dims'], {'step': 'step'}), '(image, dims, step=step)\n', (2641, 2665), False, 'from skimage.util.shape import view_as_windows\n'), ((2884, 2932), 'skimage.util.shape.view_as_windows', 'view_as_windows', (['window_ids', 'dims[:2]'], {'s...
# -*- coding: utf-8 -*- from __future__ import print_function import argparse import json import os import six import numpy as np import h5py import codecs input_txt = '../../../datasets/SocialMedia/captions_1M_alltxt.txt' output_h5 = '../../../datasets/SocialMedia/captions_1M_alltxt.h5' output_json ='../../../datas...
[ "json.dump", "h5py.File", "codecs.open", "numpy.zeros", "six.iteritems" ]
[((1559, 1592), 'numpy.zeros', 'np.zeros', (['train_size'], {'dtype': 'dtype'}), '(train_size, dtype=dtype)\n', (1567, 1592), True, 'import numpy as np\n'), ((1601, 1632), 'numpy.zeros', 'np.zeros', (['val_size'], {'dtype': 'dtype'}), '(val_size, dtype=dtype)\n', (1609, 1632), True, 'import numpy as np\n'), ((1642, 167...
import os import numpy as np from src.modelTraining.base_model import BaseModel from src.modelTraining.model_factory import model_creator, mse from keras.callbacks import EarlyStopping from keras.regularizers import l2, l1 class InDelModel(BaseModel): def __init__(self) -> None: super().__init__() ...
[ "numpy.random.seed", "numpy.sum", "numpy.argmin", "src.modelTraining.model_factory.model_creator", "keras.callbacks.EarlyStopping", "src.modelTraining.model_factory.mse" ]
[((431, 459), 'numpy.sum', 'np.sum', (['y_t[:, -21:]'], {'axis': '(1)'}), '(y_t[:, -21:], axis=1)\n', (437, 459), True, 'import numpy as np\n'), ((476, 504), 'numpy.sum', 'np.sum', (['y_t[:, :-21]'], {'axis': '(1)'}), '(y_t[:, :-21], axis=1)\n', (482, 504), True, 'import numpy as np\n'), ((970, 987), 'numpy.random.seed...
#!/usr/bin/env python """ Differential evolution test program. Usage: de.py [options] Options: -h, --help Show this message and exit. -n N Number of generations in DE. [default: 20] --print-level LEVEL Print verbose level. [default: 1] """ from __future__ import print_function import os...
[ "copy.deepcopy", "docopt.docopt", "numpy.zeros", "copy.copy", "time.time", "random.random", "numpy.sin", "numpy.array", "numpy.exp", "numpy.cos", "multiprocessing.Pool" ]
[((1115, 1128), 'copy.copy', 'copy.copy', (['vs'], {}), '(vs)\n', (1124, 1128), False, 'import copy\n'), ((12272, 12287), 'docopt.docopt', 'docopt', (['__doc__'], {}), '(__doc__)\n', (12278, 12287), False, 'from docopt import docopt\n'), ((12393, 12414), 'numpy.array', 'np.array', (['[1.0, -0.5]'], {}), '([1.0, -0.5])\...
# -*- coding: utf-8 -*- """ Created on Sat Mar 5 20:24:50 2016 @author: alex """ from AlexRobotics.dynamic import Manipulator as M from AlexRobotics.control import ComputedTorque as CTC import matplotlib.pyplot as plt import numpy as np """ Define system """ # Define real dynamic system R = M.T...
[ "matplotlib.pyplot.show", "numpy.array", "AlexRobotics.control.ComputedTorque.ComputedTorqueController", "AlexRobotics.dynamic.Manipulator.TwoLinkManipulator" ]
[((317, 339), 'AlexRobotics.dynamic.Manipulator.TwoLinkManipulator', 'M.TwoLinkManipulator', ([], {}), '()\n', (337, 339), True, 'from AlexRobotics.dynamic import Manipulator as M\n'), ((358, 376), 'numpy.array', 'np.array', (['[10, 10]'], {}), '([10, 10])\n', (366, 376), True, 'import numpy as np\n'), ((453, 475), 'Al...
# -*- coding: utf-8 -*- """musawenkosi - Tensorflow Multivariate Practical3.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1i-6hu3MdyNlaO6CAkM23f5MtCHwyxHja ## Regression as Neural Networks Practical """ import numpy as np np.random.seed(1348) ...
[ "matplotlib.pyplot.title", "numpy.random.seed", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "tensorflow.keras.layers.Dense", "pandas.read_csv", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.figure", "tensorflow.keras.Sequential", "matplotlib.pyplot.ylabel", "matplotlib.p...
[((299, 319), 'numpy.random.seed', 'np.random.seed', (['(1348)'], {}), '(1348)\n', (313, 319), True, 'import numpy as np\n'), ((759, 894), 'pandas.read_csv', 'pandas.read_csv', (['"""https://raw.githubusercontent.com/eijaz1/Deep-Learning-in-Keras-Tutorial/master/data/hourly_wages_data.csv"""'], {}), "(\n 'https://ra...
import tkinter as tk from tkinter import * import cv2 import csv import os import numpy as np from PIL import Image,ImageTk import pandas as pd import datetime import time import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg ####GUI for manually fill attendance def manually_...
[ "csv.reader", "pandas.read_csv", "cv2.rectangle", "cv2.imshow", "os.path.join", "tkinter.Label", "pandas.DataFrame", "tkinter.Button", "cv2.cvtColor", "tkinter.Entry", "cv2.destroyAllWindows", "tkinter.Tk", "subprocess.Popen", "matplotlib.pyplot.show", "csv.writer", "cv2.waitKey", "t...
[((351, 358), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (356, 358), True, 'import tkinter as tk\n'), ((7886, 7999), 'tkinter.Label', 'tk.Label', (['sb'], {'text': '"""Enter Subject"""', 'width': '(15)', 'height': '(2)', 'fg': '"""white"""', 'bg': '"""blue2"""', 'font': "('times', 15, ' bold ')"}), "(sb, text='Enter Subj...
import fire import enum import numpy as np from collections import defaultdict from statistics import mean from utils import read_json class ArenaEvaluator: def _idcg(self, l): return sum((1.0 / np.log(i + 2) for i in range(l))) def __init__(self): self._idcgs = [self._idcg(i) for i in range(...
[ "fire.Fire", "numpy.log", "collections.defaultdict", "statistics.mean", "enum.auto", "utils.read_json" ]
[((3284, 3295), 'enum.auto', 'enum.auto', ([], {}), '()\n', (3293, 3295), False, 'import enum\n'), ((3311, 3322), 'enum.auto', 'enum.auto', ([], {}), '()\n', (3320, 3322), False, 'import enum\n'), ((3340, 3351), 'enum.auto', 'enum.auto', ([], {}), '()\n', (3349, 3351), False, 'import enum\n'), ((3368, 3379), 'enum.auto...
import unittest import numpy as np from malcolm.modules.pmac import VelocityProfile class TestPmacStatusPart(unittest.TestCase): def setUp(self): pass def tearDown(self): pass @staticmethod def do_test_distance_range(v1, v2): ds = np.arange(-100, 100, 0.5) for d in ...
[ "numpy.isclose", "malcolm.modules.pmac.VelocityProfile", "numpy.arange" ]
[((277, 302), 'numpy.arange', 'np.arange', (['(-100)', '(100)', '(0.5)'], {}), '(-100, 100, 0.5)\n', (286, 302), True, 'import numpy as np\n'), ((2449, 2469), 'numpy.arange', 'np.arange', (['(4)', '(100)', '(3)'], {}), '(4, 100, 3)\n', (2458, 2469), True, 'import numpy as np\n'), ((364, 405), 'malcolm.modules.pmac.Velo...
import numpy as np class Var: """Var class is the base class for a variable in this automatic differentiation library. Called with a val of type int or float, and optional kwargs, namely derivative. Defining derivative overwrites the default seed derivative value of 1 when calling a new Var type. ...
[ "numpy.shape", "numpy.abs", "numpy.array" ]
[((894, 907), 'numpy.array', 'np.array', (['val'], {}), '(val)\n', (902, 907), True, 'import numpy as np\n'), ((1205, 1223), 'numpy.shape', 'np.shape', (['self.val'], {}), '(self.val)\n', (1213, 1223), True, 'import numpy as np\n'), ((5823, 5839), 'numpy.abs', 'np.abs', (['self.val'], {}), '(self.val)\n', (5829, 5839),...
""" @authors: <NAME>, <NAME>, <NAME> @contact: <EMAIL> REFERENCES: [0] <NAME>, <NAME>, <NAME>, "Mitigation of readout noise in near-term quantum devices by classical post-processing based on detector tomography", Quantum 4, 257 (2020) [0.5] <NAME>, <NAME>, <NAME>, <NAME>, "Modeling and mitigation of cross-talk effect...
[ "numpy.zeros" ]
[((2055, 2126), 'numpy.zeros', 'np.zeros', (['(self._number_of_qubits, self._number_of_qubits)'], {'dtype': 'float'}), '((self._number_of_qubits, self._number_of_qubits), dtype=float)\n', (2063, 2126), True, 'import numpy as np\n'), ((5306, 5338), 'numpy.zeros', 'np.zeros', (['(dimension, dimension)'], {}), '((dimensio...
#!env bin import gevent.monkey gevent.monkey.patch_socket() import argparse import time import sched import gevent import gevent.lock from gevent import subprocess from io import BytesIO import numpy as np import requests import json import sys # Mine import os import common #logger = common.getLogger(f"{os.pat...
[ "gevent.lock.Semaphore", "sys.stdout.write", "logging.error", "json.loads", "json.dumps", "time.time", "common.getData", "sys.stdout.flush", "numpy.array", "gevent.monkey.patch_socket", "gevent.spawn_later", "common.getParser", "requests.post", "os.path.join", "gevent.joinall" ]
[((33, 61), 'gevent.monkey.patch_socket', 'gevent.monkey.patch_socket', ([], {}), '()\n', (59, 61), False, 'import gevent\n'), ((551, 581), 'gevent.lock.Semaphore', 'gevent.lock.Semaphore', ([], {'value': '(1)'}), '(value=1)\n', (572, 581), False, 'import gevent\n'), ((663, 674), 'time.time', 'time.time', ([], {}), '()...
# -*- coding: utf-8 -*- """ .. codeauthor:: <NAME> <<EMAIL>> .. codeauthor:: <NAME> <<EMAIL>> """ import argparse import os import numpy as np import torch from src.args import ArgumentParserRGBDSegmentation from src.build_model import build_model from src.prepare_data import prepare_data if __name__ == '__main__': ...
[ "os.makedirs", "src.args.ArgumentParserRGBDSegmentation", "src.build_model.build_model", "torch.onnx.export", "torch.load", "numpy.random.random", "os.path.join", "src.prepare_data.prepare_data", "torch.from_numpy" ]
[((349, 516), 'src.args.ArgumentParserRGBDSegmentation', 'ArgumentParserRGBDSegmentation', ([], {'description': '"""Efficient RGBD Indoor Sematic Segmentation (ONNX Export)"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description=\n 'Efficient RGBD Indoor Sematic Segmentation (ONNX Export)',...
"""test_checks.py This file is part of the test suite for keras2c Implements tests for the checks run on the model before conversion """ #!/usr/bin/env python3 import unittest import tensorflow.keras as keras from keras2c import keras2c_main import subprocess import time import numpy as np import tensorflow as tf tf....
[ "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv1D", "tensorflow.keras.layers.PReLU", "tensorflow.compat.v1.disable_eager_execution", "tensorflow.keras.models.Model", "numpy.arange", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.LSTM", "tensorflow.keras.layers.Add", "tens...
[((317, 355), 'tensorflow.compat.v1.disable_eager_execution', 'tf.compat.v1.disable_eager_execution', ([], {}), '()\n', (353, 355), True, 'import tensorflow as tf\n'), ((654, 667), 'numpy.arange', 'np.arange', (['(10)'], {}), '(10)\n', (663, 667), True, 'import numpy as np\n'), ((854, 892), 'tensorflow.keras.layers.Inp...
from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from matplotlib.ticker import LinearLocator, FormatStrFormatter from matplotlib import cm import matplotlib.pyplot as plt import numpy as np def plotFunction(x, y, z, title): fig = plt.figure() ax = fig.gca(pr...
[ "numpy.meshgrid", "sklearn.preprocessing.StandardScaler", "numpy.ravel", "numpy.ones", "matplotlib.pyplot.figure", "numpy.mean", "matplotlib.ticker.LinearLocator", "matplotlib.ticker.FormatStrFormatter", "numpy.linspace", "numpy.exp", "matplotlib.pyplot.savefig" ]
[((1869, 1889), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'N'], {}), '(0, 1, N)\n', (1880, 1889), True, 'import numpy as np\n'), ((1894, 1914), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'N'], {}), '(0, 1, N)\n', (1905, 1914), True, 'import numpy as np\n'), ((1932, 1949), 'numpy.meshgrid', 'np.meshgrid', (...
#!/usr/bin/env python from threading import Lock import cv_bridge import glob import message_filters import numpy as np import os.path as osp import rospy import skimage.draw import skimage.morphology import tf import yaml from geometry_msgs.msg import Pose from geometry_msgs.msg import PoseArray from jsk_recognitio...
[ "jsk_recognition_msgs.msg.BoundingBox", "yaml.load", "numpy.ones", "jsk_recognition_msgs.msg.BoundingBoxArray", "numpy.mean", "numpy.sin", "glob.glob", "numpy.round", "message_filters.TimeSynchronizer", "tf.transformations.quaternion_about_axis", "grasp_fusion_lib.image.label2rgb", "rospy.sign...
[((11267, 11304), 'rospy.init_node', 'rospy.init_node', (['"""primitive_matching"""'], {}), "('primitive_matching')\n", (11282, 11304), False, 'import rospy\n'), ((11340, 11352), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (11350, 11352), False, 'import rospy\n'), ((814, 834), 'cv_bridge.CvBridge', 'cv_bridge.CvBridg...
import copy import torch import datajoint as dj import numpy as np import matplotlib.pyplot as plt from orbit_transfer.configs.dataset.mnist_1d import MNIST1DDatasetConfig from nntransfer.tables import nnfabrik import pickle as pkl import tempfile import requests @nnfabrik.schema class DataStorage(dj.Manual): st...
[ "numpy.random.seed", "numpy.ones", "matplotlib.pyplot.figure", "pickle.load", "numpy.random.randint", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "tempfile.TemporaryDirectory", "matplotlib.pyplot.yticks", "requests.get", "matplotlib.pyplot.xticks", "copy.deepcopy", "matplotlib...
[((824, 884), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '[cols * 1.5, rows * 1.5 * ratio]', 'dpi': '(60)'}), '(figsize=[cols * 1.5, rows * 1.5 * ratio], dpi=60)\n', (834, 884), True, 'import matplotlib.pyplot as plt\n'), ((1779, 1818), 'matplotlib.pyplot.subplots_adjust', 'plt.subplots_adjust', ([], {'...
from rubin_sim.maf.stackers import BaseStacker import numpy as np import numpy.lib.recfunctions as rf __all__ = ['CoaddStacker'] class CoaddStacker(BaseStacker): """ Stacker to estimate m5 "coadded" per band and par night Parameters ---------- list : str, optional Name of the columns use...
[ "numpy.abs", "numpy.sum", "numpy.median", "numpy.array", "numpy.log10", "numpy.unique" ]
[((2089, 2150), 'numpy.unique', 'np.unique', (['simData[[self.RaCol, self.DecCol, self.filterCol]]'], {}), '(simData[[self.RaCol, self.DecCol, self.filterCol]])\n', (2098, 2150), True, 'import numpy as np\n'), ((2532, 2561), 'numpy.array', 'np.array', (['r'], {'dtype': 'self.dtype'}), '(r, dtype=self.dtype)\n', (2540, ...
import argparse import pandas as pd import logging as log import numpy as np import os import re import threading def sample_edgelist_job( dataset, df, n, k, sem ): """""" with sem: v_filt = np.array( [False]*n ) if log: log.info( 'Sampling edges ...' ) v_rand = ...
[ "os.mkdir", "logging.error", "argparse.ArgumentParser", "logging.basicConfig", "pandas.read_csv", "os.path.isdir", "os.path.dirname", "logging.info", "os.path.isfile", "numpy.array", "numpy.arange", "numpy.linspace", "threading.Semaphore" ]
[((2256, 2318), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""lodcc - sample edgelist"""'}), "(description='lodcc - sample edgelist')\n", (2279, 2318), False, 'import argparse\n'), ((2410, 2518), 'logging.basicConfig', 'log.basicConfig', ([], {'level': 'log.INFO', 'format': '"""[%(ascti...
""" Sintef ====== Evaluate initial bubble and droplet sizes from the SINTEF model This module is deprecated and has been replaced by the `particle_size_models` and `psf` modules. In order to retain compatibility with previous versions, we retain the original API of the `sintef` model, but replace all calculations w...
[ "tamoc.psf.sintef_d50", "numpy.log", "tamoc.psf.rosin_rammler", "tamoc.psf.sintef", "numpy.array", "tamoc.psf.de_max_oil" ]
[((2632, 2735), 'tamoc.psf.sintef', 'psf.sintef', (['D', 'm_gas', 'rho_gas', 'm_oil', 'rho_oil', 'mu_gas', 'sigma_gas', 'rho', 'mu'], {'fp_type': '(0)', 'use_d95': '(False)'}), '(D, m_gas, rho_gas, m_oil, rho_oil, mu_gas, sigma_gas, rho, mu,\n fp_type=0, use_d95=False)\n', (2642, 2735), False, 'from tamoc import psf...
import numpy as np class FillRaster(): def __init__(self): self.name = "Fill Raster Function" self.description = ("") self.fillValue = 0. def getParameterInfo(self): return [ { 'name': 'raster', 'dataType': 'raster', ...
[ "numpy.full" ]
[((1178, 1234), 'numpy.full', 'np.full', (['shape', 'self.fillValue'], {'dtype': "props['pixelType']"}), "(shape, self.fillValue, dtype=props['pixelType'])\n", (1185, 1234), True, 'import numpy as np\n')]
"""Test derivation of `sispeed`.""" import numpy as np from iris.cube import Cube, CubeList from esmvalcore.preprocessor._derive.sithick import DerivedVariable def test_sispeed_calculation(): """Test calculation of `sithick`.""" siconc = Cube(np.full((2, 2), 0.5), 'sea_ice_area_fraction', units='1.0') ...
[ "numpy.full", "iris.cube.CubeList", "esmvalcore.preprocessor._derive.sithick.DerivedVariable", "numpy.ones_like" ]
[((395, 412), 'esmvalcore.preprocessor._derive.sithick.DerivedVariable', 'DerivedVariable', ([], {}), '()\n', (410, 412), False, 'from esmvalcore.preprocessor._derive.sithick import DerivedVariable\n'), ((806, 823), 'esmvalcore.preprocessor._derive.sithick.DerivedVariable', 'DerivedVariable', ([], {}), '()\n', (821, 82...
import json from collections import Counter import pickle import numpy as np import pandas as pd from tqdm import tqdm def read_json(filename): with open(filename, 'r') as load_f: file_dict = json.load(load_f) return file_dict def trp(l, n): """ Truncate or pad a list """ r = l...
[ "pandas.read_csv", "collections.Counter", "json.load", "numpy.array" ]
[((4423, 4444), 'pandas.read_csv', 'pd.read_csv', (['data_dir'], {}), '(data_dir)\n', (4434, 4444), True, 'import pandas as pd\n'), ((214, 231), 'json.load', 'json.load', (['load_f'], {}), '(load_f)\n', (223, 231), False, 'import json\n'), ((1808, 1822), 'numpy.array', 'np.array', (['line'], {}), '(line)\n', (1816, 182...
import math import random import WilliamsDivergenceMaker as wdm import BioPythonMaker as bpm import GeometryMaker as dfm import HtmlReportMaker as hrm import seaborn as sns import matplotlib.pyplot as plt import numpy as np import pandas as pd ############### REAL data ####################### rep = hrm.HtmlReportMaker(...
[ "WilliamsDivergenceMaker.WilliamsDivergenceMaker", "HtmlReportMaker.HtmlReportMaker", "numpy.max", "BioPythonMaker.loadPdbStructures", "GeometryMaker.GeometryMaker" ]
[((300, 368), 'HtmlReportMaker.HtmlReportMaker', 'hrm.HtmlReportMaker', (['"""WCCC"""', '"""Results/kullback_leibler.html"""'], {'cols': '(6)'}), "('WCCC', 'Results/kullback_leibler.html', cols=6)\n", (319, 368), True, 'import HtmlReportMaker as hrm\n'), ((412, 480), 'BioPythonMaker.loadPdbStructures', 'bpm.loadPdbStru...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "unittest.main", "paddle.static.data", "paddle.static.default_main_program", "numpy.sum", "paddle.CPUPlace", "os.path.join", "paddle.nn.LayerList", "paddle.enable_static", "pgl.nn.GCNConv", "numpy.random.randn", "pgl.nn.GraphPool", "numpy.array", "paddle.disable_static", "pgl.Graph", "pa...
[((3168, 3183), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3181, 3183), False, 'import unittest\n'), ((942, 956), 'paddle.nn.LayerList', 'nn.LayerList', ([], {}), '()\n', (954, 956), True, 'import paddle.nn as nn\n'), ((1157, 1177), 'pgl.nn.GraphPool', 'gnn.GraphPool', (['"""sum"""'], {}), "('sum')\n", (1170,...
#!/usr/bin/python from astropy.io import fits import ccdproc import numpy as np def merge_fitsfd(hdulist): data1 = ccdproc.CCDData(hdulist[1].data, unit="adu") data1.header = hdulist[1].header data2 = ccdproc.CCDData(hdulist[2].data, unit="adu") merged = np.concatenate( (data1, np.fliplr(data2) ), axis=1) # as...
[ "numpy.fliplr", "astropy.io.fits.PrimaryHDU", "astropy.io.fits.HDUList", "ccdproc.CCDData" ]
[((120, 164), 'ccdproc.CCDData', 'ccdproc.CCDData', (['hdulist[1].data'], {'unit': '"""adu"""'}), "(hdulist[1].data, unit='adu')\n", (135, 164), False, 'import ccdproc\n'), ((208, 252), 'ccdproc.CCDData', 'ccdproc.CCDData', (['hdulist[2].data'], {'unit': '"""adu"""'}), "(hdulist[2].data, unit='adu')\n", (223, 252), Fal...
from __future__ import print_function import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten from keras.layers import Conv2D, MaxPooling2D from keras import backend as K import os import glob import cv2 import numpy as np batch_size = 400 num...
[ "keras.optimizers.Adadelta", "numpy.resize", "keras.backend.image_data_format", "numpy.empty", "numpy.asarray", "keras.layers.Dropout", "keras.layers.Flatten", "cv2.imread", "numpy.append", "keras.layers.Dense", "keras.layers.Conv2D", "glob.glob", "keras.models.Sequential", "keras.layers.M...
[((456, 524), 'glob.glob', 'glob.glob', (['"""/home/issd/AI/sources/user-space/Utku/PLATE_CHARS/*.jpg"""'], {}), "('/home/issd/AI/sources/user-space/Utku/PLATE_CHARS/*.jpg')\n", (465, 524), False, 'import glob\n'), ((780, 798), 'numpy.asarray', 'np.asarray', (['images'], {}), '(images)\n', (790, 798), True, 'import num...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 22 04:03:50 2021 @author: kavya """ import scipy.misc from skimage.transform import resize import matplotlib from keras.models import load_model import matplotlib.pyplot as plt import numpy as np import gradio as gr from sklearn import preproce...
[ "keras.models.load_model", "gradio.Interface", "gradio.outputs.Label", "numpy.zeros", "numpy.nonzero", "matplotlib.image.imsave", "skimage.transform.resize", "gradio.inputs.Sketchpad", "numpy.all" ]
[((335, 355), 'keras.models.load_model', 'load_model', (['"""PDP_NN"""'], {}), "('PDP_NN')\n", (345, 355), False, 'from keras.models import load_model\n'), ((1233, 1254), 'gradio.inputs.Sketchpad', 'gr.inputs.Sketchpad', ([], {}), '()\n', (1252, 1254), True, 'import gradio as gr\n'), ((1263, 1298), 'gradio.outputs.Labe...
#!/usr/bin/env python # -*- coding: utf-8 -*- ## File name : detector.py ## Created by: <NAME> ## Date : December 2020 ## Purpose : Script contains main functions used in FreeClimber package, as well as added functionality version = '0.4.0' publication = False import os import sys import time import ffmpeg ...
[ "matplotlib.pyplot.title", "trackpy.quiet", "os.path.isfile", "matplotlib.pyplot.figure", "numpy.histogram", "scipy.signal.peak_prominences", "scipy.signal.find_peaks", "matplotlib.pyplot.tight_layout", "os.path.join", "numpy.unique", "matplotlib.pyplot.xlabel", "pandas.DataFrame", "matplotl...
[((5762, 5788), 'os.path.isfile', 'os.path.isfile', (['video_file'], {}), '(video_file)\n', (5776, 5788), False, 'import os\n'), ((6423, 6448), 'os.path.split', 'os.path.split', (['video_file'], {}), '(video_file)\n', (6436, 6448), False, 'import os\n'), ((15495, 15531), 'numpy.subtract', 'np.subtract', (['video_array'...
# -*- coding: utf-8 -*- " In this pyfile we will give the solution of linear equation system in details. That is, not only the final result will be given, but also the L, U matrix and the determination of A will be listed here for your convinience. " import numpy as np """ Input: Ax=b A = np.array([[1,3,5], ...
[ "numpy.eye", "numpy.zeros_like", "numpy.linalg.solve", "numpy.linalg.det" ]
[((1526, 1547), 'numpy.linalg.solve', 'np.linalg.solve', (['L', 'b'], {}), '(L, b)\n', (1541, 1547), True, 'import numpy as np\n'), ((1556, 1577), 'numpy.linalg.solve', 'np.linalg.solve', (['U', 'y'], {}), '(U, y)\n', (1571, 1577), True, 'import numpy as np\n'), ((1090, 1101), 'numpy.eye', 'np.eye', (['dim'], {}), '(di...
import os import sys ROOT_DIR = os.path.dirname(os.path.abspath(os.path.dirname('__file__'))) sys.path.append(ROOT_DIR) import scipy.io import numpy as np import pandas as pd import imagesize import requests import tarfile local_file_path = os.path.join(ROOT_DIR, 'resources', 'wiki_crop.tar') # path where all the unpa...
[ "sys.path.append", "pandas.DataFrame", "numpy.datetime64", "os.path.dirname", "numpy.timedelta64", "pandas.to_datetime", "requests.get", "tarfile.open", "os.path.join" ]
[((94, 119), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (109, 119), False, 'import sys\n'), ((242, 294), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""resources"""', '"""wiki_crop.tar"""'], {}), "(ROOT_DIR, 'resources', 'wiki_crop.tar')\n", (254, 294), False, 'import os\n'), ((368, 41...
import argparse import os import fnet.data import fnet.fnet_model from fnet.functions import compute_dataset_min_max_ranges, pearsonr from fnet.transforms import Propper import json import logging import numpy as np import pdb import sys import time import torch import warnings import optuna import math import jobl...
[ "torch.mean", "json.dump", "fnet.functions.pearsonr", "fnet.transforms.Propper", "numpy.random.seed", "math.isnan", "torch.utils.data.DataLoader", "torch.manual_seed", "logging.StreamHandler", "os.path.exists", "fnet.functions.compute_dataset_min_max_ranges", "torch.cat", "optuna.exceptions....
[((4537, 4628), 'fnet.functions.compute_dataset_min_max_ranges', 'compute_dataset_min_max_ranges', (['self.path_dataset_train_csv', 'self.path_dataset_val_csv'], {}), '(self.path_dataset_train_csv, self.\n path_dataset_val_csv)\n', (4567, 4628), False, 'from fnet.functions import compute_dataset_min_max_ranges, pear...
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import gym from env_2 import Reacher_for2 as Reacher from copy import copy import argparse ITR=1000 # number of tasks EP_MAX = 20 # number of episodes for single task, generally 2000 steps for 2 joints and 5000 steps for 3 joints have a good p...
[ "numpy.random.seed", "argparse.ArgumentParser", "tensorflow.trainable_variables", "tensorflow.clip_by_value", "tensorflow.get_collection", "numpy.clip", "tensorflow.matmul", "tensorflow.truncated_normal", "tensorflow.variable_scope", "tensorflow.placeholder", "env_2.Reacher_for2", "tensorflow....
[((774, 860), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train or test neural net motor controller."""'}), "(description=\n 'Train or test neural net motor controller.')\n", (797, 860), False, 'import argparse\n'), ((18078, 18122), 'env_2.Reacher_for2', 'Reacher', ([], {'target_po...
#<NAME> #<EMAIL> import pandas as pd import numpy as np '''The code is divided by question, answering five questions: 1- Do you want to see rows of city data 2- What are the most popular hours, months, or days (after filtering according to the user's desire)? 3- What are most popular station and...
[ "pandas.read_csv", "pandas.to_datetime", "numpy.arange" ]
[((1647, 1675), 'pandas.read_csv', 'pd.read_csv', (['CITY_DATA[menu]'], {}), '(CITY_DATA[menu])\n', (1658, 1675), True, 'import pandas as pd\n'), ((3120, 3142), 'pandas.to_datetime', 'pd.to_datetime', (['column'], {}), '(column)\n', (3134, 3142), True, 'import pandas as pd\n'), ((4683, 4698), 'numpy.arange', 'np.arange...
from unittest import TestCase import numpy as np from mock import patch from btb.hyper_parameter import HyperParameter, ParamTypes from btb.tuning.uniform import Uniform class TestUniform(TestCase): # METHOD: predict(self): # VALIDATE: # * np.random.rand is called with the right values @patch(...
[ "numpy.testing.assert_array_equal", "mock.patch", "btb.tuning.uniform.Uniform", "numpy.array", "btb.hyper_parameter.HyperParameter" ]
[((314, 351), 'mock.patch', 'patch', (['"""btb.tuning.uniform.np.random"""'], {}), "('btb.tuning.uniform.np.random')\n", (319, 351), False, 'from mock import patch\n'), ((457, 482), 'numpy.array', 'np.array', (['[0.4, 0.6, 0.8]'], {}), '([0.4, 0.6, 0.8])\n', (465, 482), True, 'import numpy as np\n'), ((673, 690), 'btb....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2...
[ "numpy.ceil", "matplotlib.pyplot.legend", "numpy.genfromtxt", "matplotlib.pyplot.subplots", "numpy.unravel_index", "os.environ.get", "matplotlib.pyplot.style.use", "matplotlib.use", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.savefig", "numpy.sqrt" ]
[((6258, 6320), 'numpy.genfromtxt', 'np.genfromtxt', (['logfile'], {'dtype': 'float', 'delimiter': '""","""', 'names': '(True)'}), "(logfile, dtype=float, delimiter=',', names=True)\n", (6271, 6320), True, 'import numpy as np\n'), ((6562, 6582), 'matplotlib.pyplot.style.use', 'plt.style.use', (['style'], {}), '(style)\...
from __future__ import division import numpy as np # define target list mmol=653.19 # g/mol Th_length=341. # [Aa] # target masses in GeV and number of nucleons # Hydrogen m_H=0.9389 A_H=1. Z_H=1. n_H=7. # Boron m_B=10.07 A_B=(10.*20.+11.*80.)/100. Z_B=5. n_B=11. # Oxygen m_O=14.903 A_O=(99.76*16+.04*17+.2*18)/100 Z_O=...
[ "numpy.array" ]
[((553, 609), 'numpy.array', 'np.array', (['[m_H * n_H, m_B * n_B, m_O * n_O, m_Sr * n_Sr]'], {}), '([m_H * n_H, m_B * n_B, m_O * n_O, m_Sr * n_Sr])\n', (561, 609), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # # PROJECT : JAS1101 Final Project # # ---------------------------------------------------------------------------- # Docstring """Get the Proper Motion Scale Size of Each Globular Cluster. Warnings -------- SEE n...
[ "os.mkdir", "numpy.abs", "argparse.ArgumentParser", "numpy.isnan", "scipy.optimize.leastsq", "pathlib.Path", "numpy.arange", "numpy.exp", "matplotlib.pyplot.gca", "astropy.table.QTable.read", "matplotlib.pyplot.tight_layout", "numpy.round", "warnings.simplefilter", "matplotlib.pyplot.close...
[((1126, 1170), 'warnings.simplefilter', 'warnings.simplefilter', (['"""always"""', 'UserWarning'], {}), "('always', UserWarning)\n", (1147, 1170), False, 'import warnings\n'), ((1315, 1337), 'os.path.isdir', 'os.path.isdir', (['FIGURES'], {}), '(FIGURES)\n', (1328, 1337), False, 'import os\n'), ((1343, 1360), 'os.mkdi...