code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import warnings warnings.filterwarnings('ignore') # noqa from typing import Union, Iterable, Optional import logging import numpy as np import matplotlib from matplotlib import pyplot as plt import matplotlib.patches as mpatches matplotlib.use('Agg') # noqa import albumentations as A import torch from torch impor...
[ "torch.cat", "logging.getLogger", "torch.full", "rastervision.pytorch_learner.utils.compute_conf_mat_metrics", "matplotlib.patches.Patch", "torch.no_grad", "matplotlib.colors.ListedColormap", "albumentations.from_dict", "rastervision.pytorch_learner.utils.Parallel", "rastervision.pytorch_learner.u...
[((16, 49), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (39, 49), False, 'import warnings\n'), ((233, 254), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (247, 254), False, 'import matplotlib\n'), ((719, 746), 'logging.getLogger', 'logging.getLog...
""" mfmodel module. Contains the MFModel class """ import os, sys, inspect, warnings import numpy as np from .mfbase import PackageContainer, ExtFileAction, PackageContainerType, \ MFDataException, ReadAsArraysException, FlopyException, \ VerbosityLevel from .mfpackage...
[ "flopy.plot.plotutil.PlotUtilities._plot_model_helper", "inspect.stack", "numpy.ones", "numpy.hstack", "numpy.array", "os.path.splitext", "sys.exc_info", "warnings.warn", "os.path.split", "os.path.join", "flopy.discretization.modeltime.ModelTime" ]
[((9850, 9904), 'flopy.discretization.modeltime.ModelTime', 'ModelTime', (['data_frame', 'itmuni', 'start_date_time', 'steady'], {}), '(data_frame, itmuni, start_date_time, steady)\n', (9859, 9904), False, 'from flopy.discretization.modeltime import ModelTime\n'), ((48929, 49002), 'flopy.plot.plotutil.PlotUtilities._pl...
import numpy as np from loguru import logger from pymilvus import ( connections, utility, FieldSchema, CollectionSchema, DataType, Collection, ) class MilvusClient(object): def __init__(self, milvus_host="localhost", milvus_port=19530, vector_dim=1000): self.connections = connectio...
[ "loguru.logger.info", "pymilvus.Collection", "pymilvus.CollectionSchema", "pymilvus.FieldSchema", "numpy.random.rand", "pymilvus.connections.connect" ]
[((311, 377), 'pymilvus.connections.connect', 'connections.connect', (['"""default"""'], {'host': 'milvus_host', 'port': 'milvus_port'}), "('default', host=milvus_host, port=milvus_port)\n", (330, 377), False, 'from pymilvus import connections, utility, FieldSchema, CollectionSchema, DataType, Collection\n'), ((386, 43...
# TRANSFORMER CODEMASTER # CODE BY <NAME> import nltk from nltk.stem import WordNetLemmatizer from nltk.stem.lancaster import LancasterStemmer from nltk.corpus import gutenberg from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from players.codemaster import codemaster import random import ...
[ "torch.mean", "transformers.AutoModelForCausalLM.from_pretrained", "torch.set_grad_enabled", "nltk.wordpunct_tokenize", "numpy.zeros", "re.match", "torch.nn.CosineSimilarity", "numpy.where", "sklearn.neighbors.NearestNeighbors", "nltk.corpus.stopwords.words", "transformers.GPT2Tokenizer.from_pre...
[((814, 843), 'torch.set_grad_enabled', 'torch.set_grad_enabled', (['(False)'], {}), '(False)\n', (836, 843), False, 'import torch\n'), ((863, 900), 'transformers.GPT2Tokenizer.from_pretrained', 'GPT2Tokenizer.from_pretrained', (['"""gpt2"""'], {}), "('gpt2')\n", (892, 900), False, 'from transformers import AutoModel, ...
import numpy as np import torch from mmcv.utils import print_log from terminaltables import AsciiTable def average_precision(recalls, precisions, mode='area'): """Calculate average precision (for single or multiple scales). Args: recalls (np.ndarray): Recalls with shape of (num_scales, num_dets) \ ...
[ "numpy.maximum", "numpy.sum", "terminaltables.AsciiTable", "numpy.zeros", "numpy.ones", "numpy.hstack", "numpy.argsort", "numpy.cumsum", "numpy.finfo", "numpy.mean", "numpy.array", "numpy.where", "numpy.arange", "torch.zeros", "mmcv.utils.print_log" ]
[((985, 1023), 'numpy.zeros', 'np.zeros', (['num_scales'], {'dtype': 'np.float32'}), '(num_scales, dtype=np.float32)\n', (993, 1023), True, 'import numpy as np\n'), ((4028, 4048), 'numpy.array', 'np.array', (['confidence'], {}), '(confidence)\n', (4036, 4048), True, 'import numpy as np\n'), ((4092, 4115), 'numpy.argsor...
import uf import numpy as np def get_best_f1(probs, labels, label_index=1): assert len(probs) == len(labels) probs = np.array(probs) labels = np.array(labels) num = np.sum(labels == label_index) tp = num fp = len(labels) - num fn = 0 tn = 0 accuracy = (tp + tn) / (...
[ "uf.set_log", "numpy.array", "numpy.sum", "uf.BERTClassifier" ]
[((133, 148), 'numpy.array', 'np.array', (['probs'], {}), '(probs)\n', (141, 148), True, 'import numpy as np\n'), ((163, 179), 'numpy.array', 'np.array', (['labels'], {}), '(labels)\n', (171, 179), True, 'import numpy as np\n'), ((191, 220), 'numpy.sum', 'np.sum', (['(labels == label_index)'], {}), '(labels == label_in...
""" Reproduction of LIO in the Escape Room version 0.1: Fixed the gradient graph. Used PyTorchViz to trace BP route. Used Torchmeta to allow net parameters to be backward. """ import numpy as np import random import torch from torch.nn import functional as F from matplotlib import pyplot as plt from lio.agent.lio_ag...
[ "matplotlib.pyplot.subplot", "numpy.random.seed", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "lio.agent.lio_agent.Actor", "torch.manual_seed", "lio.env.room_symmetric.Env", "lio.model.actor_net.Trajectory", "lio.alg.config_room_lio.get_config", "matplotlib.pyplot.figure", "random.seed",...
[((595, 615), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (609, 615), True, 'import numpy as np\n'), ((620, 637), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (631, 637), False, 'import random\n'), ((642, 665), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (65...
import numpy as np def get_transit_mask(time, period, t0, duration, dur_mult=1): msk = np.zeros_like(time, dtype=bool) tt = t0 while tt < time[-1]: msk[(time >= tt - (dur_mult*duration/2.)) & (time <= tt + (dur_mult*duration/2.))] = True tt += period return msk
[ "numpy.zeros_like" ]
[((95, 126), 'numpy.zeros_like', 'np.zeros_like', (['time'], {'dtype': 'bool'}), '(time, dtype=bool)\n', (108, 126), True, 'import numpy as np\n')]
# coding: utf-8 # MIT License # # Copyright (c) 2018 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mod...
[ "numpy.random.uniform", "numpy.load", "PIL.ImageEnhance.Brightness", "os.makedirs", "numpy.copy", "os.getcwd", "sklearn.model_selection.train_test_split", "PIL.ImageEnhance.Contrast", "PIL.Image.open", "numpy.append", "os.path.isfile", "numpy.random.randint", "numpy.array", "os.path.splite...
[((1682, 1693), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1691, 1693), False, 'import os\n'), ((2096, 2126), 'os.listdir', 'os.listdir', (['self.__target_path'], {}), '(self.__target_path)\n', (2106, 2126), False, 'import os\n'), ((2520, 2535), 'numpy.array', 'np.array', (['image'], {}), '(image)\n', (2528, 2535), T...
import matplotlib.pyplot as plt import numpy as np def plot_global_map(globalmapfile): data = np.load(globalmapfile) x, y = data['poleparams'][:, :2].T plt.clf() plt.scatter(x, y, s=1, c='b', marker='.') plt.xlabel('x [m]') plt.ylabel('y [m]') plt.savefig(globalmapfile[:-4] + '.svg') plot_...
[ "numpy.load", "matplotlib.pyplot.clf", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig" ]
[((99, 121), 'numpy.load', 'np.load', (['globalmapfile'], {}), '(globalmapfile)\n', (106, 121), True, 'import numpy as np\n'), ((165, 174), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (172, 174), True, 'import matplotlib.pyplot as plt\n'), ((179, 220), 'matplotlib.pyplot.scatter', 'plt.scatter', (['x', 'y'], ...
from pyrep.backend import sim, utils from pyrep.objects import Object from pyrep.objects.dummy import Dummy from pyrep.robots.configuration_paths.arm_configuration_path import ( ArmConfigurationPath) from pyrep.robots.robot_component import RobotComponent from pyrep.objects.cartesian_path import CartesianPath from ...
[ "pyrep.errors.ConfigurationPathError", "pyrep.backend.sim.simSetIkGroupProperties", "pyrep.backend.utils.suppress_std_out_and_err", "pyrep.backend.sim.simGetIkGroupMatrix", "pyrep.objects.dummy.Dummy", "pyrep.backend.sim.simGetCollectionHandle", "pyrep.errors.ConfigurationError", "pyrep.robots.configu...
[((1318, 1355), 'pyrep.objects.dummy.Dummy', 'Dummy', (["('%s_target%s' % (name, suffix))"], {}), "('%s_target%s' % (name, suffix))\n", (1323, 1355), False, 'from pyrep.objects.dummy import Dummy\n'), ((1379, 1413), 'pyrep.objects.dummy.Dummy', 'Dummy', (["('%s_tip%s' % (name, suffix))"], {}), "('%s_tip%s' % (name, suf...
from keras import backend as K import imutils from keras.models import load_model import numpy as np import keras import requests from scipy.spatial import distance as dist from imutils import face_utils import time import dlib import cv2,os,sys import collections import random import face_recognition import pickle imp...
[ "keras.models.load_model", "tensorflow.ConfigProto", "imutils.face_utils.shape_to_np", "cv2.rectangle", "dlib.rectangle", "cv2.imshow", "dlib.shape_predictor", "cv2.cvtColor", "cv2.split", "numpy.reshape", "cv2.destroyAllWindows", "cv2.resize", "cv2.waitKey", "keras.backend.set_session", ...
[((420, 596), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'intra_op_parallelism_threads': 'num_cores', 'inter_op_parallelism_threads': 'num_cores', 'allow_soft_placement': '(True)', 'device_count': "{'CPU': num_CPU, 'GPU': num_GPU}"}), "(intra_op_parallelism_threads=num_cores,\n inter_op_parallelism_threads=nu...
# yellowbrick.text.freqdist # Implementations of frequency distributions for text visualization. # # Author: <NAME> # Created: Mon Feb 20 12:38:20 2017 -0500 # # Copyright (C) 2017 The scikit-yb developers # For license information, see LICENSE.txt # # ID: freqdist.py [67b2740] <EMAIL> $ """ Implementations of freq...
[ "operator.itemgetter", "numpy.arange", "yellowbrick.exceptions.YellowbrickValueError" ]
[((7314, 7331), 'numpy.arange', 'np.arange', (['self.N'], {}), '(self.N)\n', (7323, 7331), True, 'import numpy as np\n'), ((4317, 4372), 'yellowbrick.exceptions.YellowbrickValueError', 'YellowbrickValueError', (['"""Orientation must be \'h\' or \'v\'"""'], {}), '("Orientation must be \'h\' or \'v\'")\n', (4338, 4372), ...
# --- # jupyter: # jupytext: # formats: ipynb,py # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.9.1+dev # kernelspec: # display_name: Python [conda env:annorxiver] # language: python # name: conda-env-annorxiver-...
[ "sklearn.dummy.DummyClassifier", "numpy.sum", "pandas.read_csv", "sklearn.neighbors.KNeighborsClassifier", "pathlib.Path", "numpy.mean", "annorxiver_modules.journal_rec_helper.cross_validation" ]
[((2643, 2749), 'pandas.read_csv', 'pd.read_csv', (['"""../word_vector_experiment/output/pmc_document_vectors_300_replace.tsv.xz"""'], {'sep': '"""\t"""'}), "(\n '../word_vector_experiment/output/pmc_document_vectors_300_replace.tsv.xz',\n sep='\\t')\n", (2654, 2749), True, 'import pandas as pd\n'), ((3429, 3465)...
""" Visualize Q-values and gradients of a good Ant policy. """ import joblib import argparse import numpy as np import matplotlib.pyplot as plt import rlkit.torch.pytorch_util as ptu PATH = '/home/vitchyr/git/railrl/data/doodads3/01-26-ddpg-sweep-harder-tasks/01-26-ddpg-sweep-harder-tasks-id10-s68123/params.pkl' BAD_P...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "argparse.ArgumentParser", "matplotlib.pyplot.plot", "rlkit.torch.pytorch_util.get_numpy", "matplotlib.pyplot.legend", "rlkit.torch.pytorch_util.np_to_var", "numpy.array", "numpy.linspace", "matplotlib.pyplot.ylabel", "joblib.load", "matpl...
[((802, 847), 'numpy.linspace', 'np.linspace', (['low[0]', 'high[0]', 'N'], {'retstep': '(True)'}), '(low[0], high[0], N, retstep=True)\n', (813, 847), True, 'import numpy as np\n'), ((2032, 2042), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2040, 2042), True, 'import matplotlib.pyplot as plt\n'), ((2085, ...
from __future__ import print_function, absolute_import import time from collections import OrderedDict import torch import numpy as np from .utils import to_torch from .evaluation_metrics import cmc, mean_ap from reid.loss.qaconv import QAConv from .tlift import TLift from .rerank import re_ranking def pre_tlift(ga...
[ "torch.zeros", "time.time", "numpy.array", "collections.OrderedDict", "torch.no_grad" ]
[((352, 395), 'numpy.array', 'np.array', (['[cam for _, _, cam, _ in gallery]'], {}), '([cam for _, _, cam, _ in gallery])\n', (360, 395), True, 'import numpy as np\n'), ((411, 468), 'numpy.array', 'np.array', (['[frame_time for _, _, _, frame_time in gallery]'], {}), '([frame_time for _, _, _, frame_time in gallery])\...
import numpy as np import pyamg import scipy.sparse def get_gradients(I): """Get the vertical (derivative-row) and horizontal (derivative-column) gradients of an image.""" I_y = np.zeros(I.shape) I_y[1:, :, ...] = I[1:, :, ...] - I[:-1, :, ...] I_x = np.zeros(I.shape) I_x[:, 1:, ...] = I[:, 1:...
[ "numpy.abs", "numpy.zeros", "numpy.ones", "pyamg.ruge_stuben_solver", "numpy.clip", "numpy.max", "numpy.concatenate" ]
[((192, 209), 'numpy.zeros', 'np.zeros', (['I.shape'], {}), '(I.shape)\n', (200, 209), True, 'import numpy as np\n'), ((273, 290), 'numpy.zeros', 'np.zeros', (['I.shape'], {}), '(I.shape)\n', (281, 290), True, 'import numpy as np\n'), ((1316, 1343), 'pyamg.ruge_stuben_solver', 'pyamg.ruge_stuben_solver', (['A'], {}), '...
import numpy as np import glob import sys from matplotlib import pyplot as plt import stat_tools as st from datetime import datetime,timedelta import pysolar.solar as ps from scipy.ndimage.morphology import binary_opening from scipy import ndimage import ephem deg2rad=np.pi/180 camera='HD815_1' # camera='HD17' inpath...
[ "ephem.Moon", "ephem.Observer", "datetime.datetime.strptime", "numpy.sin", "matplotlib.pyplot.Circle", "numpy.linspace", "glob.glob", "numpy.cos", "matplotlib.pyplot.imread", "matplotlib.pyplot.subplots", "numpy.sqrt" ]
[((910, 936), 'numpy.sqrt', 'np.sqrt', (['(x0 ** 2 + y0 ** 2)'], {}), '(x0 ** 2 + y0 ** 2)\n', (917, 936), True, 'import numpy as np\n'), ((1072, 1088), 'ephem.Observer', 'ephem.Observer', ([], {}), '()\n', (1086, 1088), False, 'import ephem\n'), ((1138, 1150), 'ephem.Moon', 'ephem.Moon', ([], {}), '()\n', (1148, 1150)...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """sbpy Spectroscopy Sources Module Spectrophotometric classes that encapsulate synphot.SpectralSource and synphot.Observation in order to generate sbpy spectra and photometry. Requires synphot. """ __all__ = [ 'BlackbodySource', 'Reddening' ] imp...
[ "synphot.SpectralElement", "copy.deepcopy", "astropy.units.Quantity", "numpy.size", "astropy.units.quantity_input", "numpy.ndim", "numpy.isfinite", "numpy.zeros", "astropy.utils.data._is_url", "synphot.Observation", "astropy.units.spectral", "astropy.utils.data.download_file", "astropy.units...
[((15408, 15444), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'S': '(u.percent / u.um)'}), '(S=u.percent / u.um)\n', (15424, 15444), True, 'import astropy.units as u\n'), ((2295, 2386), 'synphot.SourceSpectrum', 'synphot.SourceSpectrum', (['synphot.Empirical1D'], {'points': 'wave', 'lookup_table': 'fluxd'...
from collections import defaultdict from distutils.version import LooseVersion import numpy as np import pytest from opensfm import multiview, types, geo from opensfm.synthetic_data import synthetic_examples from opensfm.synthetic_data import synthetic_scene def pytest_configure(config): use_legacy_numpy_printop...
[ "numpy.set_printoptions", "numpy.random.seed", "opensfm.synthetic_data.synthetic_examples.synthetic_circle_scene", "distutils.version.LooseVersion", "pytest.fixture", "opensfm.geo.TopocentricConverter", "collections.defaultdict", "opensfm.synthetic_data.synthetic_examples.synthetic_cube_scene", "num...
[((521, 551), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (535, 551), False, 'import pytest\n'), ((667, 697), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (681, 697), False, 'import pytest\n'), ((1340, 1371), 'pytest.fixture', ...
__copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" import io from typing import Any, Dict, List import numpy as np from jina.executors.decorators import batching, single from jina.executors.encoders.frameworks import BaseTFEncoder from jina.executors.segmenters impor...
[ "io.BytesIO", "soundfile.read", "numpy.float32", "tensorflow.compat.v1.disable_eager_execution", "jina.executors.decorators.single", "tensorflow.compat.v1.Session", "numpy.mean" ]
[((2007, 2050), 'jina.executors.decorators.single', 'single', ([], {'slice_nargs': '(2)', 'flatten_output': '(False)'}), '(slice_nargs=2, flatten_output=False)\n', (2013, 2050), False, 'from jina.executors.decorators import batching, single\n'), ((796, 834), 'tensorflow.compat.v1.disable_eager_execution', 'tf.compat.v1...
# # SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # try: import sionna except ImportError as e: import sys sys.path.append("../") import tensorflow as tf gpus = tf.config.list_physical_devices('GPU') print('Number ...
[ "tensorflow.random.set_seed", "numpy.abs", "sionna.channel.tr38901.Topology", "numpy.sum", "sionna.channel.tr38901.RaysGenerator", "numpy.angle", "numpy.clip", "numpy.argsort", "numpy.shape", "numpy.sin", "numpy.exp", "numpy.tile", "sys.path.append", "sionna.channel.tr38901.PanelArray", ...
[((267, 305), 'tensorflow.config.list_physical_devices', 'tf.config.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (298, 305), True, 'import tensorflow as tf\n'), ((213, 235), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (228, 235), False, 'import sys\n'), ((426, 477), 'tensorflow....
from pymatch.util import ApproximateStringMatching, deBrujin32Bit, bit_not import numpy as np class LEAP(ApproximateStringMatching): def __init__(self, dna1, dna2, k, E, penalty=None, forward=None, originLanes=None, destinationLanes=None, hurdleCost=1): if len(dna1) > len(dna2): ...
[ "pymatch.util.deBrujin32Bit", "numpy.zeros" ]
[((803, 831), 'numpy.zeros', 'np.zeros', (['(2 * k + 1, E + 1)'], {}), '((2 * k + 1, E + 1))\n', (811, 831), True, 'import numpy as np\n'), ((888, 916), 'numpy.zeros', 'np.zeros', (['(2 * k + 1, E + 1)'], {}), '((2 * k + 1, E + 1))\n', (896, 916), True, 'import numpy as np\n'), ((1039, 1054), 'pymatch.util.deBrujin32Bi...
import os import numpy as np import tensorflow as tf import cv2 import download import input import model flags = tf.app.flags FLAGS = flags.FLAGS flags.DEFINE_boolean('download_data', False, 'whether to download, extract image data') flags.DEFINE_string('download_dir', './downloads/', 'directory path to download dat...
[ "cv2.line", "os.path.join", "numpy.concatenate", "download.maybe_extract", "cv2.cvtColor", "cv2.waitKey", "model.Model", "numpy.zeros", "cv2.imshow", "cv2.setMouseCallback", "numpy.array", "input.inputs", "download.maybe_download_from_google_drive", "cv2.destroyAllWindows", "tensorflow.a...
[((1401, 1504), 'model.Model', 'model.Model', (['FLAGS.log_dir', 'FLAGS.ckpt_dir', 'FLAGS.load_ckpt', 'FLAGS.input_height', 'FLAGS.input_width'], {}), '(FLAGS.log_dir, FLAGS.ckpt_dir, FLAGS.load_ckpt, FLAGS.\n input_height, FLAGS.input_width)\n', (1412, 1504), False, 'import model\n'), ((2087, 2203), 'input.inputs',...
from matplotlib import pyplot import numpy import sys import os def plot_nx(length_frequencies, total_length, output_dir): figure = pyplot.figure() axes = pyplot.axes() legend_names = list() x1 = 0 y_prev = None x_coords = list() y_coords = list() for length,frequency in length_fr...
[ "matplotlib.pyplot.axes", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.array", "sys.stderr.write", "os.path.join" ]
[((139, 154), 'matplotlib.pyplot.figure', 'pyplot.figure', ([], {}), '()\n', (152, 154), False, 'from matplotlib import pyplot\n'), ((166, 179), 'matplotlib.pyplot.axes', 'pyplot.axes', ([], {}), '()\n', (177, 179), False, 'from matplotlib import pyplot\n'), ((1089, 1123), 'os.path.join', 'os.path.join', (['output_dir'...
# Copyright 2019 The TensorFlow 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 applica...
[ "tensorflow.compat.v1.space_to_batch_nd", "tensorflow.lite.testing.zip_test_utils.make_zip_of_tests", "numpy.array", "tensorflow.lite.testing.zip_test_utils.create_tensor_data", "tensorflow.compat.v1.compat.v1.placeholder", "tensorflow.lite.testing.zip_test_utils.register_make_test_function" ]
[((1115, 1144), 'tensorflow.lite.testing.zip_test_utils.register_make_test_function', 'register_make_test_function', ([], {}), '()\n', (1142, 1144), False, 'from tensorflow.lite.testing.zip_test_utils import register_make_test_function\n'), ((4290, 4389), 'tensorflow.lite.testing.zip_test_utils.make_zip_of_tests', 'mak...
import argparse import os import json import re import numpy as np # python eval.py -c weights/VTN-10-liver -g YOUR_GPU_DEVICES parser = argparse.ArgumentParser() parser.add_argument('-c', '--checkpoint', type=str, default='weights/VTN-10-liver', help='Specifies a previous checkpoint to load') parse...
[ "os.mkdir", "json.load", "argparse.ArgumentParser", "tensorflow.get_collection", "os.path.dirname", "tensorflow.Session", "os.path.exists", "tflearn.is_training", "numpy.savez", "os.path.join", "os.listdir", "re.compile" ]
[((137, 162), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (160, 162), False, 'import argparse\n'), ((1645, 1677), 'os.path.dirname', 'os.path.dirname', (['args.checkpoint'], {}), '(args.checkpoint)\n', (1660, 1677), False, 'import os\n'), ((3132, 3144), 'tensorflow.Session', 'tf.Session', ([...
import matplotlib.pyplot as plt import math import numpy as np class PrimeNumberAnalyzer(): """ Analyzes prime numbers """ def __init__(self, lower, higher): self.run_analysis(lower, higher) def is_prime(self, number): """ Determines whether the number "number" is in fact...
[ "matplotlib.pyplot.show", "math.sqrt", "matplotlib.pyplot.legend", "numpy.asarray", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((3676, 3700), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""percentage"""'], {}), "('percentage')\n", (3686, 3700), True, 'import matplotlib.pyplot as plt\n'), ((3709, 3729), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""number"""'], {}), "('number')\n", (3719, 3729), True, 'import matplotlib.pyplot as plt\n'), (...
import numpy as np import pandas as pd from .comparisontools import (do_count_event, make_match_count_matrix, make_agreement_scores_from_count) class BaseComparison: """ Base class for all comparison classes: * GroundTruthComparison * MultiSortingComparison * SymmetricSortingComparison ...
[ "numpy.abs", "numpy.argmax", "numpy.any", "numpy.arange", "numpy.all", "numpy.in1d" ]
[((816, 861), 'numpy.any', 'np.any', (["[('_' in name) for name in name_list]"], {}), "([('_' in name) for name in name_list])\n", (822, 861), True, 'import numpy as np\n'), ((4850, 4876), 'numpy.arange', 'np.arange', (['scores.shape[1]'], {}), '(scores.shape[1])\n', (4859, 4876), True, 'import numpy as np\n'), ((1688,...
# TrueSkill is a rating system based on Bayesian inference, estimating each players skill as a gaussian like Elo rating. # See trueskill.org for more. import pandas as pd, numpy as np from trueskill import TrueSkill, Rating, rate_1vs1 ts = TrueSkill(draw_probability=0.01) # 0.01 is arbitary small number beta = 25 / 6...
[ "pandas.read_csv", "trueskill.TrueSkill", "trueskill.rate_1vs1", "numpy.concatenate", "numpy.sqrt" ]
[((242, 274), 'trueskill.TrueSkill', 'TrueSkill', ([], {'draw_probability': '(0.01)'}), '(draw_probability=0.01)\n', (251, 274), False, 'from trueskill import TrueSkill, Rating, rate_1vs1\n'), ((556, 606), 'pandas.read_csv', 'pd.read_csv', (['"""../input/SampleSubmissionStage1.csv"""'], {}), "('../input/SampleSubmissio...
from constants import * import math import numpy as np import time from util import getPolicies, UpperP, LowerP, indexOfPolicy from util import itConvergencePolicy, getRewards, getProb, allOneNeighbours from util import CalculateDelDelV, prob_step, delW from evaluatePolicy import evaluatePolicy verbose = 0 ## policyM...
[ "numpy.random.seed", "util.UpperP", "numpy.copy", "numpy.argmax", "util.LowerP", "util.delW", "evaluatePolicy.evaluatePolicy", "numpy.sum", "numpy.zeros", "numpy.ones", "util.CalculateDelDelV", "time.sleep", "util.prob_step", "util.getRewards", "numpy.linalg.norm", "util.getProb", "m...
[((698, 719), 'numpy.zeros', 'np.zeros', (['numPolicies'], {}), '(numPolicies)\n', (706, 719), True, 'import numpy as np\n'), ((1059, 1100), 'numpy.zeros', 'np.zeros', (['(mdp.numStates, mdp.numActions)'], {}), '((mdp.numStates, mdp.numActions))\n', (1067, 1100), True, 'import numpy as np\n'), ((1116, 1186), 'numpy.zer...
# ------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # ----------------------------------------------------------------------...
[ "numpy.diag", "numpy.random.seed", "gp.model_wrapper.GPyTorchModelWrapper", "GPy.models.GPRegression", "numpy.concatenate", "gp.model_wrapper._map_to_tensor", "pytest.approx", "emukit.model_wrappers.gpy_model_wrappers.GPyModelWrapper", "numpy.sin", "pytest.mark.parametrize", "numpy.cos", "nump...
[((564, 588), 'numpy.random.seed', 'np.random.seed', (['(31415926)'], {}), '(31415926)\n', (578, 588), True, 'import numpy as np\n'), ((600, 621), 'numpy.random.rand', 'np.random.rand', (['(10)', '(2)'], {}), '(10, 2)\n', (614, 621), True, 'import numpy as np\n'), ((798, 816), 'numpy.random.seed', 'np.random.seed', (['...
''' 程序功能,先确定图片文件夹路径/标记结果路径/以及标记车位个数(小于6) F5运行后鼠标选择车位 按上下显示上下图片 按左右显示标记到的图片 ''' import cv2 import numpy as np import os from detect_utils import parking_line from detect_utils import show_parking_line path_img = r'W:\dataset\inroad_parking_videos\pics\2020_01_10\DDT2G1907ZMY00124SY' # 路径 path_txt_for_check = os.path....
[ "cv2.imshow", "cv2.waitKeyEx", "cv2.imread", "detect_utils.show_parking_line", "numpy.array", "cv2.setMouseCallback", "os.chdir", "cv2.startWindowThread", "os.path.splitext", "cv2.resizeWindow", "cv2.destroyAllWindows", "os.listdir", "cv2.namedWindow", "os.path.split" ]
[((1562, 1583), 'numpy.array', 'np.array', (['data_raw_np'], {}), '(data_raw_np)\n', (1570, 1583), True, 'import numpy as np\n'), ((1783, 1803), 'os.listdir', 'os.listdir', (['path_img'], {}), '(path_img)\n', (1793, 1803), False, 'import os\n'), ((1880, 1898), 'os.chdir', 'os.chdir', (['path_img'], {}), '(path_img)\n',...
# Copyright 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
[ "argparse.ArgumentParser", "numpy.std", "numpy.asarray", "numpy.zeros", "numpy.mean", "tensorboard.backend.event_processing.event_accumulator.EventAccumulator", "glob.glob", "os.chdir" ]
[((758, 804), 'tensorboard.backend.event_processing.event_accumulator.EventAccumulator', 'event_accumulator.EventAccumulator', (['event_file'], {}), '(event_file)\n', (792, 804), False, 'from tensorboard.backend.event_processing import event_accumulator\n'), ((1072, 1118), 'tensorboard.backend.event_processing.event_ac...
import pytest import os import numpy as np import pyscal.core as pc import pyscal.crystal_structures as pcs def test_sro(): atoms, box = pcs.make_crystal('l12', lattice_constant=4.00, repetitions=[2,2,2]) sys = pc.System() sys.box = box sys.atoms = atoms sys.find_neighbors(method='cutoff', cutoff=...
[ "pyscal.crystal_structures.make_crystal", "numpy.round", "pyscal.core.System" ]
[((142, 210), 'pyscal.crystal_structures.make_crystal', 'pcs.make_crystal', (['"""l12"""'], {'lattice_constant': '(4.0)', 'repetitions': '[2, 2, 2]'}), "('l12', lattice_constant=4.0, repetitions=[2, 2, 2])\n", (158, 210), True, 'import pyscal.crystal_structures as pcs\n'), ((220, 231), 'pyscal.core.System', 'pc.System'...
import primes import math import numpy as np from PIL import Image def run(params, v=False): txt_path = params['txt_path'] end_with = params['end_with'] img_path = params['img_path'] exp_path = params['exp_path'] if v: print(f"Opening text file: {txt_path}...") txt_string = gettext(txt_path, endwith=end_with) ...
[ "math.sqrt", "math.ceil", "PIL.Image.open", "numpy.array", "PIL.Image.fromarray" ]
[((1635, 1657), 'PIL.Image.fromarray', 'Image.fromarray', (['image'], {}), '(image)\n', (1650, 1657), False, 'from PIL import Image\n'), ((1074, 1102), 'math.sqrt', 'math.sqrt', (['(minpixels / ratio)'], {}), '(minpixels / ratio)\n', (1083, 1102), False, 'import math\n'), ((1150, 1170), 'math.ceil', 'math.ceil', (['(ra...
#!/usr/bin/env python import os import sys import simdna import simdna.util as util import simdna.synthetic as synthetic import argparse def do(options): if (options.seed is not None): import numpy as np np.random.seed(options.seed) import random random.seed(options.seed) ...
[ "simdna.util.ArrArgument", "numpy.random.seed", "argparse.ArgumentParser", "simdna.synthetic.UniformPositionGenerator", "simdna.synthetic.GenerateSequenceNTimes", "random.seed", "simdna.synthetic.printSequences", "simdna.synthetic.LoadedEncodeMotifs", "simdna.util.ArgumentToAdd", "simdna.util.Bool...
[((1072, 1145), 'simdna.synthetic.LoadedEncodeMotifs', 'synthetic.LoadedEncodeMotifs', (['options.pathToMotifs'], {'pseudocountProb': '(0.001)'}), '(options.pathToMotifs, pseudocountProb=0.001)\n', (1100, 1145), True, 'import simdna.synthetic as synthetic\n'), ((2128, 2196), 'simdna.synthetic.GenerateSequenceNTimes', '...
# Copyright 2020 Regents of the University of Colorado. All Rights Reserved. # Released under the MIT license. # This software was developed at the University of Colorado's Laboratory for # Atmospheric and Space Physics. # Verify current version before use at: https://github.com/MAVENSDC/PyTplot import cdflib # If th...
[ "copy.deepcopy", "pytplot.store_data.store_data", "cdflib.epochs.CDFepoch.unixtime", "numpy.asarray", "pytplot.data_quants.keys", "re.match", "xarray.concat", "numpy.equal", "cdflib.CDF", "numpy.array", "pytplot.tplot.tplot", "pytplot.options.options", "numpy.concatenate", "re.compile" ]
[((4544, 4565), 're.compile', 're.compile', (['varformat'], {}), '(varformat)\n', (4554, 4565), False, 'import re\n'), ((4637, 4657), 'cdflib.CDF', 'cdflib.CDF', (['filename'], {}), '(filename)\n', (4647, 4657), False, 'import cdflib\n'), ((18287, 18310), 'pytplot.tplot.tplot', 'tplot', (['stored_variables'], {}), '(st...
# -*- coding: utf-8 -*- """ Created on Thu Jun 28 16:36:56 2018 @author: Alex """ #%% Import packages import pickle import numpy as np import matplotlib.pyplot as plt import networkx as nx import os os.chdir('C:\\Users\\Alex\\Documents\\GitHub\\insight-articles-project\\src\\topic modeling\\') from plotly_network ...
[ "networkx.from_numpy_matrix", "matplotlib.pyplot.close", "networkx.relabel_nodes", "numpy.any", "plotly_network.plot", "matplotlib.pyplot.figure", "numpy.where", "networkx.layout.circular_layout", "networkx.draw", "networkx.draw_networkx_labels", "pickle.load", "numpy.min", "os.chdir" ]
[((204, 309), 'os.chdir', 'os.chdir', (['"""C:\\\\Users\\\\Alex\\\\Documents\\\\GitHub\\\\insight-articles-project\\\\src\\\\topic modeling\\\\"""'], {}), "(\n 'C:\\\\Users\\\\Alex\\\\Documents\\\\GitHub\\\\insight-articles-project\\\\src\\\\topic modeling\\\\'\n )\n", (212, 309), False, 'import os\n'), ((859, 87...
#!/usr/bin/env python import click import logging import os from tqdm import tqdm import numpy as np from src.features.spectrum import Spectrum from src.utils.data_utils import M4AStreamer logger = logging.getLogger(__name__) def validate_and_save(sgrams, dur, base_name: str): for i, sgram in enumerate(sgrams)...
[ "tqdm.tqdm", "numpy.save", "click.option", "click.command", "click.Choice", "os.path.splitext", "src.features.spectrum.Spectrum", "src.utils.data_utils.M4AStreamer", "logging.getLogger" ]
[((201, 228), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (218, 228), False, 'import logging\n'), ((442, 457), 'click.command', 'click.command', ([], {}), '()\n', (455, 457), False, 'import click\n'), ((568, 655), 'click.option', 'click.option', (['"""--duration"""'], {'default': '(3.0...
import airsim import cv2 import time import os import numpy as np from tensorflow.keras.models import load_model as tf_load_model MIN_ALTITUDE = 5 MAX_ALTITUDE = 8 def go_back(client, home): client.moveToPositionAsync(home.x_val, home.y_val, -1*np.random.randint(MIN_ALTITUDE,MAX_ALTITUDE+1), 5).join() time.sl...
[ "tensorflow.keras.models.load_model", "numpy.argmax", "cv2.cvtColor", "numpy.frombuffer", "numpy.zeros", "airsim.ImageRequest", "time.sleep", "airsim.MultirotorClient", "numpy.random.randint", "numpy.array", "cv2.resize", "numpy.sqrt" ]
[((313, 328), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (323, 328), False, 'import time\n'), ((517, 532), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (527, 532), False, 'import time\n'), ((706, 776), 'numpy.sqrt', 'np.sqrt', (['((home.x_val - pos.x_val) ** 2 + (home.y_val - pos.y_val) ** 2)'],...
import calendar from datetime import datetime import locale import unicodedata import numpy as np import pytest import pandas as pd from pandas import ( DatetimeIndex, Index, Timedelta, Timestamp, date_range, offsets, ) import pandas._testing as tm from pandas.core.arrays import DatetimeArray ...
[ "unicodedata.normalize", "pandas.Timestamp", "pandas.date_range", "pandas._testing.set_locale", "pandas.offsets.CustomBusinessDay", "pandas._testing.assert_produces_warning", "numpy.datetime64", "pandas.DatetimeIndex", "datetime.datetime", "pytest.raises", "pandas.to_datetime", "pandas._testin...
[((11494, 11513), 'pandas.to_datetime', 'pd.to_datetime', (['arr'], {}), '(arr)\n', (11508, 11513), True, 'import pandas as pd\n'), ((11632, 11683), 'pandas.date_range', 'date_range', ([], {'start': '"""2019-12-29"""', 'freq': '"""D"""', 'periods': '(4)'}), "(start='2019-12-29', freq='D', periods=4)\n", (11642, 11683),...
import cv2 import random import numpy as np from got10k.trackers import Tracker from config import config as cfg, finalize_configs from tensorpack import PredictConfig, get_model_loader, OfflinePredictor, logger from train import ResNetFPNModel from common import CustomResize, box_to_point8, point8_to_box class Prec...
[ "tensorpack.get_model_loader", "random.randint", "eval.predict_image_track_with_precomputed_ref_features", "tensorpack.OfflinePredictor", "config.finalize_configs", "config.config.freeze", "common.box_to_point8", "common.CustomResize", "dataset.DetectionDataset", "cv2.imread", "common.point8_to_...
[((516, 584), 'common.CustomResize', 'CustomResize', (['cfg.PREPROC.TEST_SHORT_EDGE_SIZE', 'cfg.PREPROC.MAX_SIZE'], {}), '(cfg.PREPROC.TEST_SHORT_EDGE_SIZE, cfg.PREPROC.MAX_SIZE)\n', (528, 584), False, 'from common import CustomResize, box_to_point8, point8_to_box\n'), ((3594, 3615), 'train.ResNetFPNTrackModel', 'ResNe...
from rllab.envs.base import Step from rllab.misc.overrides import overrides from .mujoco_env import MujocoEnv import numpy as np from rllab.core.serializable import Serializable from rllab.misc import logger from rllab.misc import autoargs class SwimmerEnv(MujocoEnv, Serializable): FILE = 'swimmer.xml' @aut...
[ "numpy.std", "numpy.square", "rllab.envs.base.Step", "numpy.max", "numpy.mean", "numpy.min", "rllab.misc.autoargs.arg" ]
[((317, 403), 'rllab.misc.autoargs.arg', 'autoargs.arg', (['"""ctrl_cost_coeff"""'], {'type': 'float', 'help': '"""cost coefficient for controls"""'}), "('ctrl_cost_coeff', type=float, help=\n 'cost coefficient for controls')\n", (329, 403), False, 'from rllab.misc import autoargs\n'), ((1295, 1323), 'rllab.envs.bas...
# !/usr/bin python3 # encoding : utf-8 -*- # @author : <NAME> # @file : shrodinger_equation_pinn.py # @Time : 2021/12/4 15:11 import os import sys sys.path.append(os.curdir) # add ROOT to PATH import time...
[ "numpy.random.seed", "numpy.abs", "torch.autograd.grad", "models.PINN_models.PINN", "logging.Formatter", "torch.device", "torch.no_grad", "os.path.join", "sys.path.append", "torch.ones", "logging.FileHandler", "torch.utils.data.DataLoader", "torch.load", "numpy.max", "random.seed", "nu...
[((262, 288), 'sys.path.append', 'sys.path.append', (['os.curdir'], {}), '(os.curdir)\n', (277, 288), False, 'import sys\n'), ((627, 756), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.NOTSET', 'format': '"""%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s"""'}), "(level=...
from matplotlib import pyplot as plt from config import * from shared_utils import * from plot_utils import * import pickle as pkl import numpy as np from collections import OrderedDict diseases = ["campylobacter", "rotavirus", "borreliosis"] with open('../data/counties/counties.pkl',"rb") as f: counties = pkl.lo...
[ "matplotlib.pyplot.figure", "pickle.load", "numpy.mean", "numpy.reshape", "matplotlib.pyplot.GridSpec", "collections.OrderedDict", "matplotlib.pyplot.gcf" ]
[((376, 1658), 'collections.OrderedDict', 'OrderedDict', (["[('Düsseldorf', '05111'), ('Recklinghausen', '05562'), ('Hannover', '03241'\n ), ('Hamburg', '02000'), ('Berlin-Mitte', '11001'), ('Osnabrück',\n '03404'), ('Frankfurt (Main)', '06412'), ('Görlitz', '14626'), (\n 'Stuttgart', '08111'), ('Potsdam', '12...
# coding:utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2018 yutiansut/QUANTAXIS # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation th...
[ "pandas.DataFrame", "asyncio.get_event_loop", "QUANTAXIS.QAUtil.QA_util_date_stamp", "numpy.asarray", "QUANTAXIS.QAUtil.QA_util_date_valid", "QUANTAXIS.QAUtil.QA_util_log_info", "QUANTAXIS.QAUtil.QA_util_code_tolist", "pandas.to_datetime", "QUANTAXIS.QAUtil.QA_util_to_json_from_pandas", "QUANTAXIS...
[((2115, 2140), 'QUANTAXIS.QAUtil.QA_util_code_tolist', 'QA_util_code_tolist', (['code'], {}), '(code)\n', (2134, 2140), False, 'from QUANTAXIS.QAUtil import QA_Setting, QA_util_code_tolist, QA_util_date_stamp, QA_util_date_str2int, QA_util_date_valid, QA_util_dict_remove_key, QA_util_log_info, QA_util_sql_mongo_sort_D...
""" A minimal integration test to make sure the most critical parts of Verde work as expected. """ import numpy.testing as npt import pyproj from ..datasets import fetch_california_gps from ..spline import Spline from ..vector import Vector from ..trend import Trend from ..chain import Chain from ..model_selection imp...
[ "numpy.testing.assert_allclose" ]
[((1313, 1356), 'numpy.testing.assert_allclose', 'npt.assert_allclose', (['(0.99)', 'score'], {'atol': '(0.01)'}), '(0.99, score, atol=0.01)\n', (1332, 1356), True, 'import numpy.testing as npt\n')]
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math import random from os import path as osp import magnum as mn import numpy as np import pytest import quater...
[ "os.path.abspath", "quaternion.as_rotation_matrix", "numpy.random.seed", "magnum.Rad", "numpy.allclose", "habitat_sim.utils.common.quat_to_magnum", "os.path.exists", "numpy.identity", "habitat_sim.geo.Ray", "numpy.zeros", "habitat_sim.Simulator", "numpy.array", "numpy.random.rand", "numpy....
[((1182, 1212), 'habitat_sim.Simulator', 'habitat_sim.Simulator', (['hab_cfg'], {}), '(hab_cfg)\n', (1203, 1212), False, 'import habitat_sim\n'), ((2167, 2181), 'numpy.identity', 'np.identity', (['(4)'], {}), '(4)\n', (2178, 2181), True, 'import numpy as np\n'), ((2809, 2818), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)...
# Copyright 2019-2021 Canaan Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
[ "onnx.helper.make_node", "onnx.helper.make_model", "onnx.helper.make_tensor_value_info", "numpy.ones", "pytest.main", "onnx_test_runner.OnnxTestRunner", "pytest.mark.parametrize", "onnx.helper.make_graph" ]
[((2269, 2315), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""in_shape"""', 'in_shapes'], {}), "('in_shape', in_shapes)\n", (2292, 2315), False, 'import pytest\n'), ((2317, 2371), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""expand_shape"""', 'expand_shapes'], {}), "('expand_shape', expand_...
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import numpy as np X,Y = np.meshgrid(np.linspace(-5,5,100),np.linspace(-5,5,100)) Z = np.exp(-(X**2-X*Y+Y**2)/2) map = plt.get_cmap('viridis') fig = plt.figure() ax = fig.add_subplot(122) ax.set_aspect('equal') ax.contour...
[ "matplotlib.pyplot.figure", "matplotlib.pyplot.get_cmap", "numpy.exp", "numpy.linspace" ]
[((185, 223), 'numpy.exp', 'np.exp', (['(-(X ** 2 - X * Y + Y ** 2) / 2)'], {}), '(-(X ** 2 - X * Y + Y ** 2) / 2)\n', (191, 223), True, 'import numpy as np\n'), ((218, 241), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['"""viridis"""'], {}), "('viridis')\n", (230, 241), True, 'import matplotlib.pyplot as plt\n'), (...
''' Authors: <NAME>. Copyright: Copyright (c) 2018 Microsoft Research Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use,...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "numpy.unique", "numpy.min", "pickle.load", "numpy.array", "numpy.max", "os.path.join", "matplotlib.pyplot.savefig" ]
[((3486, 3495), 'numpy.min', 'np.min', (['x'], {}), '(x)\n', (3492, 3495), True, 'import numpy as np\n'), ((3511, 3520), 'numpy.max', 'np.max', (['x'], {}), '(x)\n', (3517, 3520), True, 'import numpy as np\n'), ((1791, 1827), 'pickle.load', 'pickle.load', (['file'], {'encoding': '"""latin1"""'}), "(file, encoding='lati...
# -*-coding:utf8-*- """ personal rank主题类 author:zhangyu email:<EMAIL> """ from __future__ import division import sys sys.path.append("../util") import PR.util.read as read import operator import PR.util.mat_util as mat_util from scipy.sparse.linalg import gmres import numpy as np def personal_rank(graph, root, alp...
[ "sys.path.append", "PR.util.read.get_graph_from_data", "numpy.array", "scipy.sparse.linalg.gmres", "PR.util.mat_util.mat_all_point", "PR.util.mat_util.graph_to_m", "operator.itemgetter" ]
[((120, 146), 'sys.path.append', 'sys.path.append', (['"""../util"""'], {}), "('../util')\n", (135, 146), False, 'import sys\n'), ((1805, 1831), 'PR.util.mat_util.graph_to_m', 'mat_util.graph_to_m', (['graph'], {}), '(graph)\n', (1824, 1831), True, 'import PR.util.mat_util as mat_util\n'), ((1937, 1977), 'PR.util.mat_u...
import numpy try: import matplotlib.pyplot as pypl plotting = True except: plotting = False import os,time this_dir = os.path.dirname(os.path.realpath(__file__)) import condor import logging logger = logging.getLogger("condor") #logger.setLevel("DEBUG") #logger.setLevel("WARNING") logger.setLevel("INFO"...
[ "condor.utils.cxiwriter.CXIWriter", "os.path.realpath", "condor.Source", "logging.getLogger", "condor.Experiment", "time.time", "numpy.fft.ifftn", "numpy.log10", "condor.Detector", "condor.ParticleMap" ]
[((216, 243), 'logging.getLogger', 'logging.getLogger', (['"""condor"""'], {}), "('condor')\n", (233, 243), False, 'import logging\n'), ((396, 472), 'condor.Source', 'condor.Source', ([], {'wavelength': '(1.47e-10)', 'pulse_energy': '(0.001)', 'focus_diameter': '(1e-06)'}), '(wavelength=1.47e-10, pulse_energy=0.001, fo...
""" Module to interface with data loader. """ import os import matplotlib.pyplot as plt import numpy as np from tbase.skeleton import Skeleton def to_3_channels_rep(data): """ Converts the input in shape (batch_size, 73, width) to (batch_size, 22 + 7, width, 3). Can also handle missing foot contacts, in w...
[ "numpy.copy", "numpy.zeros", "numpy.transpose", "numpy.expand_dims", "numpy.array", "numpy.reshape", "numpy.swapaxes", "numpy.squeeze", "os.path.join", "numpy.concatenate" ]
[((581, 594), 'numpy.copy', 'np.copy', (['data'], {}), '(data)\n', (588, 594), True, 'import numpy as np\n'), ((775, 830), 'numpy.reshape', 'np.reshape', (['pose', '[batch_size, n_joints, 3, seq_length]'], {}), '(pose, [batch_size, n_joints, 3, seq_length])\n', (785, 830), True, 'import numpy as np\n'), ((844, 878), 'n...
from .architecture import Network import numpy as np import math import keras import keras.backend as K from keras.layers import Input, multiply, concatenate, Conv1D, Lambda, add, Dropout, Dense, Reshape from keras.models import Model, load_model from neuralparticles.tensorflow.tools.spatial_transformer import Spati...
[ "keras.models.load_model", "neuralparticles.tensorflow.tools.zero_mask.soft_trunc_mask", "keras.regularizers.l2", "numpy.ones", "keras.models.Model", "keras.layers.Input", "keras.layers.concatenate", "keras.layers.Reshape", "keras.optimizers.adam", "math.pow", "neuralparticles.tensorflow.tools.s...
[((821, 843), 'tensorflow.stack', 'tf.stack', (['X'], {'axis': 'axis'}), '(X, axis=axis)\n', (829, 843), True, 'import tensorflow as tf\n'), ((854, 875), 'keras.layers.Lambda', 'Lambda', (['tmp'], {}), '(tmp, **kwargs)\n', (860, 875), False, 'from keras.layers import Input, multiply, concatenate, Conv1D, Lambda, add, D...
from numba import njit, boolean, int64, float64, optional from numba.experimental import jitclass import numpy as np @njit def cluster(data, n_clusters, ncat, maxit=100): """ Runs KMeans on data and returns the labels of each sample. Parameters ---------- data: numpy array ...
[ "numpy.full", "numpy.empty", "numpy.zeros", "numba.optional", "numpy.isnan", "numpy.random.normal", "numpy.random.choice", "numpy.random.shuffle", "numpy.nanmean" ]
[((1557, 1596), 'numpy.zeros', 'np.zeros', (['data.shape[0]'], {'dtype': 'np.int64'}), '(data.shape[0], dtype=np.int64)\n', (1565, 1596), True, 'import numpy as np\n'), ((4638, 4682), 'numpy.random.normal', 'np.random.normal', ([], {'loc': 'upper', 'size': '[lower, n]'}), '(loc=upper, size=[lower, n])\n', (4654, 4682),...
# -*- coding: utf-8 -*- """ Spectral Bandpass Dependence Correction ======================================= Defines objects to perform spectral bandpass dependence correction. The following correction methods are available: - :func:`colour.colorimetry.bandpass_correction_Stearns1988`: *Stearns and Stearns (198...
[ "colour.utilities.CaseInsensitiveMapping", "numpy.copy" ]
[((3710, 3783), 'colour.utilities.CaseInsensitiveMapping', 'CaseInsensitiveMapping', (["{'Stearns 1988': bandpass_correction_Stearns1988}"], {}), "({'Stearns 1988': bandpass_correction_Stearns1988})\n", (3732, 3783), False, 'from colour.utilities import CaseInsensitiveMapping\n'), ((3260, 3278), 'numpy.copy', 'np.copy'...
# Copyright 2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
[ "unittest.main", "dpctl.device_context", "numba.njit", "numpy.ones", "numba.tests.support.captured_stdout", "numba.prange" ]
[((831, 859), 'numpy.ones', 'np.ones', (['n'], {'dtype': 'np.float64'}), '(n, dtype=np.float64)\n', (838, 859), True, 'import numpy as np\n'), ((870, 898), 'numpy.ones', 'np.ones', (['n'], {'dtype': 'np.float64'}), '(n, dtype=np.float64)\n', (877, 898), True, 'import numpy as np\n'), ((909, 937), 'numpy.ones', 'np.ones...
from os import listdir import subprocess import fire import matplotlib.pyplot as plt import random import pandas as pd import re import json import numpy as np from functools import reduce from tqdm import tqdm import pickle from src.data.loop_ast import * from src.data.schedule import * class Stats(): def __i...
[ "pandas.MultiIndex.from_tuples", "fire.Fire", "matplotlib.pyplot.show", "numpy.median", "numpy.std", "matplotlib.pyplot.bar", "numpy.mean", "pickle.load", "functools.reduce", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xticks", "os.listdir", "re.compile" ]
[((16494, 16510), 'fire.Fire', 'fire.Fire', (['Stats'], {}), '(Stats)\n', (16503, 16510), False, 'import fire\n'), ((1249, 1281), 'os.listdir', 'listdir', (['(self.data_path + folder)'], {}), '(self.data_path + folder)\n', (1256, 1281), False, 'from os import listdir\n'), ((2117, 2165), 'os.listdir', 'listdir', (["(sel...
#!/usr/bin/env python # -*- coding: utf-8 -*- import rectv import numpy as np import dxchange import tomopy def rec_tv(data,m,nsp,rot_center, lambda0,lambda1,niters,ngpus): """ Reconstruct. Time-domain decomposition + regularization. """ [nframes, nproj, ns, n] = data.shape if (rot_ce...
[ "numpy.load", "numpy.zeros", "rectv.rectv", "numpy.mod", "numpy.reshape", "numpy.linspace", "tomopy.circ_mask" ]
[((525, 567), 'numpy.reshape', 'np.reshape', (['data', '[nframes * nproj, ns, n]'], {}), '(data, [nframes * nproj, ns, n])\n', (535, 567), True, 'import numpy as np\n'), ((653, 696), 'numpy.zeros', 'np.zeros', (['[n * n * ns * m]'], {'dtype': '"""float32"""'}), "([n * n * ns * m], dtype='float32')\n", (661, 696), True,...
# -*- coding: utf-8 -*- # This file was generated import array # noqa: F401 import ctypes import datetime # noqa: F401 # Used by @ivi_synchronized from functools import wraps import nifgen._attributes as _attributes import nifgen._converters as _converters import nifgen._library_singleton as _library_singleton impor...
[ "nifgen._attributes.AttributeEnum", "nifgen._attributes.AttributeViReal64TimeDeltaSeconds", "nifgen._visatype.ViInt16", "nifgen._visatype.ViStatus", "nifgen._library_singleton.get", "nifgen._visatype.ViSession", "numpy.isfortran", "nifgen._visatype.ViAttr", "nifgen.enums.HardwareState", "ctypes.po...
[((467, 497), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'indent': '(4)'}), '(indent=4)\n', (487, 497), False, 'import pprint\n'), ((2077, 2085), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (2082, 2085), False, 'from functools import wraps\n'), ((4585, 4623), 'nifgen._attributes.AttributeViReal64', '_a...
# -*- coding: utf-8 -*- """ Created on Sun Aug 3 15:18:38 2014 @author: <NAME> and <NAME> Loads .continuous, .events, and .spikes files saved from the Open Ephys GUI Usage: import OpenEphys data = OpenEphys.load(pathToFile) # returns a dict with data, timestamps, etc. """ import os import numpy as np impo...
[ "numpy.fromfile", "numpy.median", "numpy.dtype", "numpy.zeros", "struct.pack", "time.time", "numpy.shape", "numpy.mean", "numpy.array", "numpy.arange", "numpy.reshape", "sys.stdout.flush", "os.path.join", "os.listdir" ]
[((611, 653), 'numpy.array', 'np.array', (['[0, 1, 2, 3, 4, 5, 6, 7, 8, 255]'], {}), '([0, 1, 2, 3, 4, 5, 6, 7, 8, 255])\n', (619, 653), True, 'import numpy as np\n'), ((1570, 1581), 'time.time', 'time.time', ([], {}), '()\n', (1579, 1581), False, 'import time\n'), ((2711, 2722), 'time.time', 'time.time', ([], {}), '()...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class PositionalEncoding(nn.Module): def __init__(self, d_model, dropout=0.1, max_len=5000): super(PositionalEncoding, self).__init__() self.dropout = nn.Dropout(p=dropout) pe = torch.zeros(max_len, d_mo...
[ "torch.nn.Dropout", "torch.nn.TransformerEncoder", "torch.ones", "torch.nn.TransformerDecoderLayer", "torch.stack", "torch.nn.TransformerDecoder", "numpy.log", "torch.norm", "torch.nn.TransformerEncoderLayer", "torch.cat", "torch.nn.functional.one_hot", "torch.randn", "torch.cos", "torch.a...
[((259, 280), 'torch.nn.Dropout', 'nn.Dropout', ([], {'p': 'dropout'}), '(p=dropout)\n', (269, 280), True, 'import torch.nn as nn\n'), ((295, 324), 'torch.zeros', 'torch.zeros', (['max_len', 'd_model'], {}), '(max_len, d_model)\n', (306, 324), False, 'import torch\n'), ((520, 550), 'torch.sin', 'torch.sin', (['(positio...
import numpy as np import numpy.ma as ma from numba import njit import pairwise import common from common import Models, debug from mutrel import Mutrel import util def _check_clusters(variants, clusters, garbage): for C in clusters: assert len(C) > 0 vids = common.extract_vids(variants) clustered = [chi...
[ "pairwise.remove_variants", "numpy.minimum", "numpy.sum", "pairwise.calc_posterior", "numpy.argmax", "numpy.ma.masked_equal", "numpy.ones", "common.extract_vids", "numpy.any", "numpy.array" ]
[((272, 301), 'common.extract_vids', 'common.extract_vids', (['variants'], {}), '(variants)\n', (291, 301), False, 'import common\n'), ((659, 751), 'pairwise.calc_posterior', 'pairwise.calc_posterior', (['supervars', 'logprior'], {'rel_type': '"""supervariant"""', 'parallel': 'parallel'}), "(supervars, logprior, rel_ty...
import tensorflow as tf from src.base.base_test import BaseTest from tqdm import tqdm import numpy as np import cv2 class SimpleTester(BaseTest): def __init__(self, sess, model, data, config, logger): super().__init__(sess, model, data, config, logger) def test(self): loop = tqdm(range(self.da...
[ "numpy.mean" ]
[((520, 535), 'numpy.mean', 'np.mean', (['losses'], {}), '(losses)\n', (527, 535), True, 'import numpy as np\n'), ((550, 563), 'numpy.mean', 'np.mean', (['accs'], {}), '(accs)\n', (557, 563), True, 'import numpy as np\n')]
import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F import matplotlib.pyplot as plt import pdb import numpy as np EPS = 1e-6 def ncc(a,v, zero_norm=True): a = a.flatten() v = v.flatten() if zero_norm: a = (a - np.mean(a)) / (np.std(a) * len(a))...
[ "numpy.sum", "numpy.log", "torch.nn.init.kaiming_normal_", "numpy.std", "matplotlib.pyplot.imshow", "numpy.zeros", "numpy.mean", "numpy.array", "numpy.correlate", "torch.nn.init.orthogonal_" ]
[((453, 471), 'numpy.correlate', 'np.correlate', (['a', 'v'], {}), '(a, v)\n', (465, 471), True, 'import numpy as np\n'), ((864, 891), 'numpy.mean', 'np.mean', (['sample_arr'], {'axis': '(0)'}), '(sample_arr, axis=0)\n', (871, 891), True, 'import numpy as np\n'), ((1020, 1041), 'numpy.zeros', 'np.zeros', (['(N, sX, sY)...
# %%Author <NAME> # plot the distribution of variance in sphere import numpy from sklearn.neighbors import KDTree import matplotlib # matplotlib.use('Agg') import seaborn as sns from matplotlib import pyplot as plt from matplotlib.colors import LogNorm import pyemma ''' Converting the 3D-Euler angles (in...
[ "matplotlib.pyplot.xlim", "numpy.matrix", "matplotlib.pyplot.ylim", "matplotlib.pyplot.scatter", "pyemma.plots.plot_free_energy", "numpy.mean", "numpy.array", "numpy.loadtxt", "numpy.cos", "numpy.sin", "matplotlib.pyplot.tick_params", "sklearn.neighbors.KDTree", "matplotlib.pyplot.savefig" ]
[((2661, 2681), 'numpy.array', 'numpy.array', (['data_xy'], {}), '(data_xy)\n', (2672, 2681), False, 'import numpy\n'), ((2690, 2719), 'sklearn.neighbors.KDTree', 'KDTree', (['data_xy'], {'leaf_size': '(10)'}), '(data_xy, leaf_size=10)\n', (2696, 2719), False, 'from sklearn.neighbors import KDTree\n'), ((3308, 3328), '...
import numpy as np import PIL from keras.applications import ResNet50 import io from keras.preprocessing.image import img_to_array from keras.applications import imagenet_utils from PIL import Image from PIL.ExifTags import TAGS, GPSTAGS class PhotoProcessor(object): def __init__(self, image): self._image ...
[ "io.BytesIO", "numpy.expand_dims", "keras.preprocessing.image.img_to_array", "keras.applications.imagenet_utils.preprocess_input", "PIL.ExifTags.GPSTAGS.get", "PIL.ExifTags.TAGS.get" ]
[((1439, 1461), 'keras.preprocessing.image.img_to_array', 'img_to_array', (['rgb_data'], {}), '(rgb_data)\n', (1451, 1461), False, 'from keras.preprocessing.image import img_to_array\n'), ((1481, 1513), 'numpy.expand_dims', 'np.expand_dims', (['rgb_data'], {'axis': '(0)'}), '(rgb_data, axis=0)\n', (1495, 1513), True, '...
import imageio from skimage.transform import resize import os import numpy as np import sys import h5py def get_train_data(file_local): data_ = [] labels_ = [] for idx in range(0, 30): file_temp = os.path.join(file_local, str(idx + 1) + '.mp4') # frame size is (720, 1280, 3) label...
[ "sys.stdout.write", "h5py.File", "numpy.asarray", "numpy.zeros", "sys.stdout.flush", "skimage.transform.resize", "imageio.get_reader" ]
[((968, 985), 'numpy.asarray', 'np.asarray', (['data_'], {}), '(data_)\n', (978, 985), True, 'import numpy as np\n'), ((1000, 1019), 'numpy.asarray', 'np.asarray', (['labels_'], {}), '(labels_)\n', (1010, 1019), True, 'import numpy as np\n'), ((1128, 1166), 'h5py.File', 'h5py.File', (['"""jd_pig_train_data.h5"""', '"""...
import numpy as np from numba import types from numba.errors import TypingError from numba.extending import overload @overload(np.clip) def impl_clip(x, a, b): # In numba type checking happens at *compile time*. We check the types of # the arguments here, and return a proper implementation based on those ...
[ "numba.extending.overload", "numpy.empty_like", "numpy.clip", "numba.errors.TypingError" ]
[((120, 137), 'numba.extending.overload', 'overload', (['np.clip'], {}), '(np.clip)\n', (128, 137), False, 'from numba.extending import overload\n'), ((514, 557), 'numba.errors.TypingError', 'TypingError', (['"""a must be a scalar int/float"""'], {}), "('a must be a scalar int/float')\n", (525, 557), False, 'from numba...
''' Copyright 2021 OpenDILab. All Rights Reserved: Description: Carla simulator. ''' import os import numpy as np import random from typing import Any, Union, Optional, Dict, List from distutils.version import LooseVersion import pkg_resources from collections import defaultdict from .base_simulator import BaseSimulat...
[ "core.utils.simulator_utils.carla_utils.control_to_signal", "core.utils.simulator_utils.sensor_utils.TrafficLightHelper", "random.shuffle", "core.simulators.carla_data_provider.CarlaDataProvider.get_acceleration", "core.simulators.carla_data_provider.CarlaDataProvider.get_speed_vector", "collections.defau...
[((5195, 5234), 'pkg_resources.get_distribution', 'pkg_resources.get_distribution', (['"""carla"""'], {}), "('carla')\n", (5225, 5234), False, 'import pkg_resources\n'), ((7531, 7548), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (7542, 7548), False, 'from collections import defaultdict\n'), ((...
# Copyright 2014 <NAME>, <NAME>, <NAME>, <NAME>, # <NAME> and <NAME>. # 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 ap...
[ "scipy.linalg.kron", "numpy.identity", "elecsus.libs.ang_mom.jz" ]
[((1182, 1187), 'elecsus.libs.ang_mom.jz', 'jz', (['S'], {}), '(S)\n', (1184, 1187), False, 'from elecsus.libs.ang_mom import jz\n'), ((1213, 1225), 'numpy.identity', 'identity', (['gL'], {}), '(gL)\n', (1221, 1225), False, 'from numpy import identity\n'), ((1251, 1263), 'numpy.identity', 'identity', (['gI'], {}), '(gI...
from typing import Any, Tuple import numpy as np from hlrl.core.common.wrappers import MethodWrapper class VectorizedEnv(MethodWrapper): """ A wrapper of vectorized environments, used to handle terminal steps properly. """ def step( self, action: Tuple[Any] ) -> Tu...
[ "numpy.expand_dims" ]
[((737, 768), 'numpy.expand_dims', 'np.expand_dims', (['reward'], {'axis': '(-1)'}), '(reward, axis=-1)\n', (751, 768), True, 'import numpy as np\n')]
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import sys, os import cv2 import argparse import numpy as np import warnings from keras import backend as K sys.path.append(os.path.dirname(os.path.abspath(__file__))) import util, utilFit, utilDataGenerator, utilModelREDNet util.init() w...
[ "argparse.ArgumentParser", "keras.backend.set_image_data_format", "utilFit.batch_fit_with_data_generator", "os.path.abspath", "cv2.imwrite", "os.path.dirname", "tensorflow.compat.v1.Session", "cv2.resize", "utilDataGenerator.LazyChunkGenerator", "keras.backend.backend", "util.load_array_of_files...
[((307, 318), 'util.init', 'util.init', ([], {}), '()\n', (316, 318), False, 'import util, utilFit, utilDataGenerator, utilModelREDNet\n'), ((319, 352), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (342, 352), False, 'import warnings\n'), ((353, 393), 'keras.backend.set_...
import pandas as pd import matplotlib.pyplot as plt import statistics from datetime import datetime import copy import json import numpy as np from os import listdir from os.path import isfile, join import unknown import baseline import known_approx as kapprox import mary_optimal as mary dirs = ['/localdisk1/DOT/flig...
[ "known_approx.ApproxAlg", "matplotlib.pyplot.clf", "pandas.read_csv", "os.path.join", "known_approx.MaryTarget", "matplotlib.pyplot.close", "matplotlib.pyplot.rc", "datetime.datetime.now", "matplotlib.pyplot.subplots", "pandas.concat", "copy.deepcopy", "matplotlib.pyplot.get_cmap", "baseline...
[((810, 824), 'pandas.concat', 'pd.concat', (['dfs'], {}), '(dfs)\n', (819, 824), True, 'import pandas as pd\n'), ((947, 967), 'pandas.read_csv', 'pd.read_csv', (['alldata'], {}), '(alldata)\n', (958, 967), True, 'import pandas as pd\n'), ((10740, 10762), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {}), "('font'...
import os import numpy as np import sys LOAD_PATH = ['/cache/rmishra/cc16_366a_converted/spectro', '/cache/rmishra/cc16_352a_converted/spectro', '/cache/rmishra/cc16_352b_converted/spectro'] SAVE_PATH = '/cache/rmishra/combined' if not os.path.exists(SAVE_PATH): os.mkdir(SAVE_PATH) for...
[ "os.mkdir", "os.path.exists", "numpy.array", "os.path.splitext", "os.path.join", "os.listdir" ]
[((871, 892), 'os.listdir', 'os.listdir', (['LOAD_PATH'], {}), '(LOAD_PATH)\n', (881, 892), False, 'import os\n'), ((1052, 1069), 'numpy.array', 'np.array', (['dataset'], {}), '(dataset)\n', (1060, 1069), True, 'import numpy as np\n'), ((265, 290), 'os.path.exists', 'os.path.exists', (['SAVE_PATH'], {}), '(SAVE_PATH)\n...
""" Utilities for randomness. Complete docstrings. """ import ctypes import multiprocessing import os import random import subprocess import time import traceback from timeit import default_timer as timer from typing import Any, Dict, List, Tuple import GPUtil import numpy as np import psutil im...
[ "psutil.virtual_memory", "GPUtil.getGPUs", "numpy.random.seed", "multiprocessing.Array", "torch.manual_seed", "torch.cuda.manual_seed", "torch.empty", "torch.cuda.manual_seed_all", "random.seed", "numpy.array", "os.getenv" ]
[((1289, 1330), 'multiprocessing.Array', 'multiprocessing.Array', (['c_type', 'flat_shape'], {}), '(c_type, flat_shape)\n', (1310, 1330), False, 'import multiprocessing\n'), ((1816, 1836), 'torch.manual_seed', 'th.manual_seed', (['seed'], {}), '(seed)\n', (1830, 1836), True, 'import torch as th\n'), ((1842, 1864), 'tor...
''' Created on Feb 27, 2015 @author: <NAME> ''' from . import const import numpy as np from . import cosmology as cm def noise_error_ps(nu_c, k, t, **kwargs): ''' Calculate the system noise error on the power spectrum, using the analytical expression in Mellema et al 2013 (equation 11). If no argumen...
[ "numpy.sqrt" ]
[((2112, 2138), 'numpy.sqrt', 'np.sqrt', (['(2 * multipole + 1)'], {}), '(2 * multipole + 1)\n', (2119, 2138), True, 'import numpy as np\n'), ((2267, 2283), 'numpy.sqrt', 'np.sqrt', (['epsilon'], {}), '(epsilon)\n', (2274, 2283), True, 'import numpy as np\n'), ((2175, 2212), 'numpy.sqrt', 'np.sqrt', (['(Dc ** 2 * delta...
import distutils.version as vers import pytest from numpy.testing import assert_allclose import astropy.version as astrov from astropy.utils.data import get_pkg_data_filename from astropy.table import Table from astropy.coordinates import SkyCoord from astropy import units as u from astropy.io import fits from astrop...
[ "astropy.table.Table", "numpy.testing.assert_allclose", "astropy.utils.data.get_pkg_data_filename", "astropy.wcs.WCS", "pytest.raises", "astropy.io.fits.open", "pytest.mark.parametrize", "astropy.coordinates.SkyCoord", "astropy.table.Table.read" ]
[((699, 761), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""filename"""', "['data/fits_region.fits']"], {}), "('filename', ['data/fits_region.fits'])\n", (722, 761), False, 'import pytest\n'), ((808, 839), 'astropy.utils.data.get_pkg_data_filename', 'get_pkg_data_filename', (['filename'], {}), '(filename)...
""" Estimates the CPU time required for a phosim simulation of a 30-s visit. The inputs are filter, moonalt, and moonphase, or obsHistID (an Opsim ID from a specified (hard coded) Opsim sqlite database. The random forest is generated (and saved as a pickle file) by run1_cpu_generate_rf.py, using only the filter, moon...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.zeros", "matplotlib.pyplot.ylabel", "math.degrees", "pylab.savefig", "numpy.array", "pylab.ylim", "pylab.xlim", "numpy.log10", "matplotlib.pyplot.xlabel", "os.path.join" ]
[((3447, 3475), 'numpy.array', 'np.array', (["run1meta['filter']"], {}), "(run1meta['filter'])\n", (3455, 3475), True, 'import numpy as np\n'), ((3490, 3519), 'numpy.array', 'np.array', (["run1meta['moonalt']"], {}), "(run1meta['moonalt'])\n", (3498, 3519), True, 'import numpy as np\n'), ((3536, 3567), 'numpy.array', '...
import warnings warnings.filterwarnings("ignore") import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import time from os import path import numpy as np import pandas as pd from tqdm import tqdm import pickle from deepface.commons import functions, distance as dst from deepface.DeepFace import represent, build_model...
[ "pandas.DataFrame", "pickle.dump", "deepface.commons.distance.findThreshold", "warnings.filterwarnings", "os.path.isdir", "numpy.argmax", "os.walk", "os.path.exists", "deepface.commons.distance.l2_normalize", "time.time", "deepface.DeepFace.build_model", "pickle.load", "deepface.DeepFace.rep...
[((17, 50), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (40, 50), False, 'import warnings\n'), ((1833, 1844), 'time.time', 'time.time', ([], {}), '()\n', (1842, 1844), False, 'import time\n'), ((1872, 1908), 'deepface.commons.functions.initialize_input', 'functions.init...
""" A unit test for the pyxsim analysis module. """ from pyxsim import \ TableApecModel, TBabsModel, \ ThermalSourceModel, PhotonList from pyxsim.instruments import \ Lynx_Calorimeter from pyxsim.tests.utils import \ BetaModelSource, ParticleBetaModelSource from yt.testing import requires_module import...
[ "numpy.abs", "soxs.instrument.AuxiliaryResponseFile", "shutil.rmtree", "os.chdir", "pyxsim.instruments.Lynx_Calorimeter", "yt.utilities.physical_constants.clight.in_units", "soxs.instrument.instrument_simulator", "sherpa.astro.ui.load_user_model", "sherpa.astro.ui.set_model", "sherpa.astro.ui.get_...
[((1024, 1067), 'soxs.instrument.RedistributionMatrixFile', 'RedistributionMatrixFile', (["mucal_spec['rmf']"], {}), "(mucal_spec['rmf'])\n", (1048, 1067), False, 'from soxs.instrument import RedistributionMatrixFile, AuxiliaryResponseFile, instrument_simulator\n'), ((1074, 1114), 'soxs.instrument.AuxiliaryResponseFile...
import numpy as np import torchvision import time import math import os import copy import pdb import argparse import sys import cv2 import skimage.io import skimage.transform import skimage.color import skimage import torch from torch.utils.data import Dataset, DataLoader from torchvision import data...
[ "argparse.ArgumentParser", "cv2.VideoWriter_fourcc", "torch.no_grad", "os.path.join", "torch.__version__.split", "numpy.transpose", "os.path.exists", "numpy.append", "skimage.io.imread", "math.ceil", "cv2.waitKey", "numpy.asarray", "torch.cuda.is_available", "scipy.optimize.linear_sum_assi...
[((3731, 3753), 'numpy.zeros', 'np.zeros', (['(num1, num2)'], {}), '((num1, num2))\n', (3739, 3753), True, 'import numpy as np\n'), ((3899, 3930), 'scipy.optimize.linear_sum_assignment', 'linear_sum_assignment', (['cost_mat'], {}), '(cost_mat)\n', (3920, 3930), False, 'from scipy.optimize import linear_sum_assignment\n...
import numpy as np from neuron import h from .psd import PSD class Exp2PSD(PSD): """ Simple double-exponential PSD from Neuron (fast). """ def __init__(self, section, terminal, weight=0.01, loc=0.5, tau1=0.1, tau2=0.3, erev=0): """ Parameters ---------- section : Secti...
[ "neuron.h.Vector", "neuron.h.Exp2Syn", "numpy.array" ]
[((702, 729), 'neuron.h.Exp2Syn', 'h.Exp2Syn', (['loc'], {'sec': 'section'}), '(loc, sec=section)\n', (711, 729), False, 'from neuron import h\n'), ((2182, 2193), 'numpy.array', 'np.array', (['v'], {}), '(v)\n', (2190, 2193), True, 'import numpy as np\n'), ((1546, 1556), 'neuron.h.Vector', 'h.Vector', ([], {}), '()\n',...
import pickle import numpy as np from datetime import datetime class Prediction: def __init__(self, date, time): self.date = date self.time = time def getIrradiance(self): date_time_obj = datetime.strptime(self.time,'%H:%M:%S') hour = date_time_obj.hour print(hour) ...
[ "datetime.datetime.strptime", "pickle.load", "numpy.array" ]
[((224, 264), 'datetime.datetime.strptime', 'datetime.strptime', (['self.time', '"""%H:%M:%S"""'], {}), "(self.time, '%H:%M:%S')\n", (241, 264), False, 'from datetime import datetime\n'), ((338, 378), 'datetime.datetime.strptime', 'datetime.strptime', (['self.date', '"""%Y-%m-%d"""'], {}), "(self.date, '%Y-%m-%d')\n", ...
from SPARQLWrapper import SPARQLWrapper, JSON from collections import defaultdict from rltk.similarity import levenshtein_similarity import numpy as np from sklearn.metrics.pairwise import cosine_similarity from scipy.stats import rankdata def generate_visualization_data(class_name, property_name): ''' :param...
[ "sklearn.metrics.pairwise.cosine_similarity", "scipy.stats.rankdata", "SPARQLWrapper.SPARQLWrapper", "numpy.where", "numpy.array" ]
[((935, 985), 'SPARQLWrapper.SPARQLWrapper', 'SPARQLWrapper', (['"""http://localhost:3030/games/query"""'], {}), "('http://localhost:3030/games/query')\n", (948, 985), False, 'from SPARQLWrapper import SPARQLWrapper, JSON\n'), ((5704, 5754), 'SPARQLWrapper.SPARQLWrapper', 'SPARQLWrapper', (['"""http://localhost:3030/ga...
"""Viewing Box Module This file contains a class required for creating a viewing box enabling the user to view the data. Usage: To use this module, import it and instantiate is as you wish: from Paint4Brains.GUI.ModViewBox import ModViewBox view = ModViewBox() """ import numpy as np from pyqtg...
[ "pyqtgraph.functions.invertQTransform", "pyqtgraph.Point.Point", "numpy.array" ]
[((1446, 1498), 'numpy.array', 'np.array', (["self.state['mouseEnabled']"], {'dtype': 'np.float'}), "(self.state['mouseEnabled'], dtype=np.float)\n", (1454, 1498), True, 'import numpy as np\n'), ((5736, 5759), 'pyqtgraph.functions.invertQTransform', 'fn.invertQTransform', (['tr'], {}), '(tr)\n', (5755, 5759), True, 'fr...
import panel as pn import dask_cudf import numpy as np from .core_aggregate import BaseAggregateChart from ....assets.numba_kernels import calc_groupby, calc_value_counts from ....layouts import chart_view class BaseLine(BaseAggregateChart): chart_type: str = "line" reset_event = None _datatile_loaded_st...
[ "panel.widgets.RangeSlider", "numpy.round", "numpy.array" ]
[((6883, 7067), 'panel.widgets.RangeSlider', 'pn.widgets.RangeSlider', ([], {'start': 'self.min_value', 'end': 'self.max_value', 'value': '(self.min_value, self.max_value)', 'step': 'self.stride', 'sizing_mode': '"""scale_width"""'}), "(start=self.min_value, end=self.max_value, value=(\n self.min_value, self.max_val...
# -*- coding: utf-8 -*- import os import json from json import encoder import numpy as np from sklearn_porter.estimator.classifier.Classifier import Classifier class BernoulliNB(Classifier): """ See also -------- sklearn.naive_bayes.BernoulliNB http://scikit-learn.org/stable/modules/generated/ ...
[ "hashlib.md5", "os.path.isdir", "json.dumps", "numpy.exp", "os.path.join" ]
[((6242, 6280), 'json.dumps', 'json.dumps', (['model_data'], {'sort_keys': '(True)'}), '(model_data, sort_keys=True)\n', (6252, 6280), False, 'import json\n'), ((6486, 6519), 'os.path.join', 'os.path.join', (['directory', 'filename'], {}), '(directory, filename)\n', (6498, 6519), False, 'import os\n'), ((3582, 3611), '...
"""Loading words vectors.""" import gzip import logging import pickle from os.path import join, exists from typing import Iterable, Optional import numpy as np from tqdm import tqdm from debias import config from debias.utils import py_utils FASTTEXT_URL = "https://dl.fbaipublicfiles.com/fasttext/vectors-english/cra...
[ "tqdm.tqdm", "gzip.open", "os.path.exists", "logging.info", "pickle.load", "numpy.fromstring", "os.path.join", "debias.utils.py_utils.download_zip" ]
[((901, 986), 'debias.utils.py_utils.download_zip', 'py_utils.download_zip', (['"""crawl-300d-2M.vec"""', 'FASTTEXT_URL', 'config.WORD_VEC_SOURCE'], {}), "('crawl-300d-2M.vec', FASTTEXT_URL, config.WORD_VEC_SOURCE\n )\n", (922, 986), False, 'from debias.utils import py_utils\n'), ((1105, 1176), 'debias.utils.py_util...
#!/usr/bin/env python import argparse import logging import numpy as np import os import re import torch import json import csv import pytorch_lightning as pl from pprint import pprint as pp from model import ErrorCheckerInferenceModule from nltk import sent_tokenize from utils.utils import Label from utils import to...
[ "model.ErrorCheckerInferenceModule", "numpy.random.seed", "argparse.ArgumentParser", "logging.basicConfig", "utils.tokenizer.Tokenizer", "utils.sentence_scorer.SentenceScorer", "torch.manual_seed", "nltk.sent_tokenize", "preprocess.load_games", "csv.reader", "torch.set_num_threads", "os.path.j...
[((444, 559), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(message)s"""', 'level': 'logging.INFO', 'datefmt': '"""%H:%M:%S"""'}), "(format='%(asctime)s - %(levelname)s - %(message)s',\n level=logging.INFO, datefmt='%H:%M:%S')\n", (463, 559), False, 'import logging...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the ellipse module. """ from astropy.coordinates import Angle, SkyCoord import astropy.units as u import numpy as np import pytest from .test_aperture_common import BaseTestAperture from ..ellipse import (EllipticalAperture, EllipticalAnnul...
[ "astropy.units.Quantity", "numpy.transpose", "pytest.raises", "pytest.mark.parametrize", "astropy.coordinates.Angle", "astropy.coordinates.SkyCoord" ]
[((457, 480), 'numpy.transpose', 'np.transpose', (['POSITIONS'], {}), '(POSITIONS)\n', (469, 480), True, 'import numpy as np\n'), ((492, 528), 'astropy.coordinates.SkyCoord', 'SkyCoord', ([], {'ra': 'RA', 'dec': 'DEC', 'unit': '"""deg"""'}), "(ra=RA, dec=DEC, unit='deg')\n", (500, 528), False, 'from astropy.coordinates...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Jun 1 14:38:58 2017 @author: bonny """ from sklearn.metrics import explained_variance_score import pandas as pd from sklearn.model_selection import KFold from sklearn import linear_model, ensemble import numpy as np from CleanHousingData import CleanHo...
[ "matplotlib.pyplot.title", "pandas.read_csv", "sklearn.ensemble.GradientBoostingRegressor", "matplotlib.pyplot.figure", "numpy.mean", "sklearn.linear_model.PassiveAggressiveRegressor", "matplotlib.pyplot.yticks", "matplotlib.pyplot.xticks", "CleanHousingData.CleanHousingData", "sklearn.linear_mode...
[((454, 478), 'pandas.read_csv', 'pd.read_csv', (['"""train.csv"""'], {}), "('train.csv')\n", (465, 478), True, 'import pandas as pd\n'), ((585, 610), 'CleanHousingData.CleanHousingData', 'CleanHousingData', (['tr_data'], {}), '(tr_data)\n', (601, 610), False, 'from CleanHousingData import CleanHousingData, NormalizeHo...
import os import sys import gzip import zlib import json import bz2 import tempfile import requests import subprocess from aenum import Enum import capnp import numpy as np import platform from tools.lib.exceptions import DataUnreadableError try: from xx.chffr.lib.filereader import FileReader except ImportError: ...
[ "tempfile.NamedTemporaryFile", "cereal.log.Event.from_bytes", "tools.lib.log_util.convert_old_pkt_to_new", "json.loads", "tools.lib.filereader.FileReader", "numpy.frombuffer", "os.path.dirname", "subprocess.check_output", "os.path.realpath", "tools.lib.exceptions.DataUnreadableError", "numpy.app...
[((485, 520), 'os.path.dirname', 'os.path.dirname', (['capnp_log.__file__'], {}), '(capnp_log.__file__)\n', (500, 520), False, 'import os\n'), ((650, 690), 'os.path.join', 'os.path.join', (['index_log_dir', '"""index_log"""'], {}), "(index_log_dir, 'index_log')\n", (662, 690), False, 'import os\n'), ((711, 745), 'os.pa...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # Copyright (c) 2020 TsinghuaAI Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
[ "paddlenlp.utils.log.logger.info", "numpy.array" ]
[((1474, 1533), 'paddlenlp.utils.log.logger.info', 'logger.info', (['"""Loading the model parameters, please wait..."""'], {}), "('Loading the model parameters, please wait...')\n", (1485, 1533), False, 'from paddlenlp.utils.log import logger\n'), ((1749, 1777), 'paddlenlp.utils.log.logger.info', 'logger.info', (['"""M...
'''Evaluation: evaluates a batch of experiments. * loads multi experiment files. * verify parameters -- if they're compatible proceed * for each experiment loads all Q-tables, from that experiment. filter Q-tables from S to S steps. for each table runs R rollouts (defaults 1). ''' ...
[ "copy.deepcopy", "json.load", "ilurl.networks.base.Network", "flow.core.params.EnvParams", "numpy.random.seed", "ilurl.envs.base.TrafficLightEnv", "ilurl.loaders.nets.get_tls_custom", "configargparse.ArgumentTypeError", "flow.core.params.SumoParams", "dill.load", "pathlib.Path", "ilurl.core.ex...
[((911, 935), 're.compile', 're.compile', (['"""Q.1-(\\\\d+)"""'], {}), "('Q.1-(\\\\d+)')\n", (921, 935), False, 'import re\n'), ((1234, 1410), 'configargparse.ArgumentParser', 'configargparse.ArgumentParser', ([], {'default_config_files': 'config_file_path', 'description': '"""\n This script performs a sing...
#! /user/bin/env python # -*- coding: utf-8 -*- """ @author: gingkg @contact: <EMAIL> @software: PyCharm @project: man-machine_counteraction @file: replay_buffer.py @date: 2021-07-04 15:39 @desc: """ import numpy as np import threading class ReplayBuffer: def __init__(self, args): self.args = args ...
[ "numpy.empty", "threading.Lock", "numpy.random.randint", "numpy.arange", "numpy.concatenate" ]
[((1959, 1975), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (1973, 1975), False, 'import threading\n'), ((3133, 3184), 'numpy.random.randint', 'np.random.randint', (['(0)', 'self.current_size', 'batch_size'], {}), '(0, self.current_size, batch_size)\n', (3150, 3184), True, 'import numpy as np\n'), ((751, 823)...
# -*- coding: utf-8 -*- """ Created on Wed Jan 02 13:43:44 2013 Author: <NAME> """ from __future__ import print_function import numpy as np import statsmodels.nonparametric.api as nparam if __name__ == '__main__': np.random.seed(500) nobs = [250, 1000][0] sig_fac = 1 x = np.random.uniform(-2, 2, si...
[ "numpy.random.uniform", "numpy.random.seed", "matplotlib.pyplot.show", "numpy.abs", "matplotlib.pyplot.figure", "numpy.sin", "numpy.random.normal", "statsmodels.nonparametric.api.EstimatorSettings", "statsmodels.nonparametric.api.KernelReg" ]
[((223, 242), 'numpy.random.seed', 'np.random.seed', (['(500)'], {}), '(500)\n', (237, 242), True, 'import numpy as np\n'), ((293, 328), 'numpy.random.uniform', 'np.random.uniform', (['(-2)', '(2)'], {'size': 'nobs'}), '(-2, 2, size=nobs)\n', (310, 328), True, 'import numpy as np\n'), ((756, 834), 'statsmodels.nonparam...
''' =============================================================================== -- Author: <NAME>, <NAME> -- Create date: 01/11/2020 -- Description: This code is for T-distributed Stochastic Neighbor Embedding (t-SNE) which is a method for redcuing dimension for image comparison. ...
[ "matplotlib.pyplot.show", "sklearn.manifold.TSNE", "matplotlib.pyplot.scatter", "os.walk", "cv2.imread", "matplotlib.pyplot.figure", "numpy.array", "os.path.join", "cv2.resize" ]
[((889, 909), 'os.walk', 'os.walk', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (896, 909), False, 'import os\n'), ((1332, 1346), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (1340, 1346), True, 'import numpy as np\n'), ((1355, 1391), 'sklearn.manifold.TSNE', 'TSNE', ([], {'n_components': '(2)', 'random_state':...