code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A general curve plotter to create curves such as: https://github.com/ppwwyyxx/tensorpack/tree/master/examples/ResNet A simplest example: $ cat examples/train_log/mnist-convnet/stat.json \ | jq '.[] | .train_error, .validation_error' \ | paste - - \ ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "argparse.ArgumentParser", "numpy.copy", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.font_manager.FontProperties", "matplotlib.pyplot.legend", "numpy.asarray", "collections.defaultdict", "matplot...
[((934, 982), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (957, 982), False, 'import argparse\n'), ((3711, 3724), 'numpy.copy', 'np.copy', (['data'], {}), '(data)\n', (3718, 3724), True, 'import numpy as np\n'), ((6248, 6291), 'matplotlib.py...
import numpy as np from numba import jit import matplotlib.pyplot as plt import quantecon as qe from quantecon.distributions import BetaBinomial n, a, b = 50, 200, 100 w_min, w_max = 10, 60 w_vals = np.linspace(w_min, w_max, n+1) dist = BetaBinomial(n, a, b) psi_vals = dist.pdf() def plot_w_distribution(w_vals, psi_...
[ "quantecon.distributions.BetaBinomial", "numpy.abs", "matplotlib.pyplot.show", "numpy.linspace", "numpy.dot", "matplotlib.pyplot.subplots" ]
[((200, 232), 'numpy.linspace', 'np.linspace', (['w_min', 'w_max', '(n + 1)'], {}), '(w_min, w_max, n + 1)\n', (211, 232), True, 'import numpy as np\n'), ((238, 259), 'quantecon.distributions.BetaBinomial', 'BetaBinomial', (['n', 'a', 'b'], {}), '(n, a, b)\n', (250, 259), False, 'from quantecon.distributions import Bet...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2021-06-02 08:10:13 # @Author : <NAME> (<EMAIL>) """From ByT5: Towards a token-free future with pre-trained byte-to-byte models.""" import numpy as np from typing import Optional, List, Dict from text_embeddings.base import EmbeddingTokenizer from ...
[ "loguru.logger.info", "loguru.logger.warning", "numpy.zeros" ]
[((2522, 2598), 'loguru.logger.info', 'logger.info', (['"""Be sure to add an embedding layer when using a ByT5Tokenizer."""'], {}), "('Be sure to add an embedding layer when using a ByT5Tokenizer.')\n", (2533, 2598), False, 'from loguru import logger\n'), ((3592, 3620), 'numpy.zeros', 'np.zeros', (['(self.embed_size,)'...
import os import tensorflow as tf from tensorflow.keras.preprocessing import image import numpy as np from preprocessing import CNNModel gpu_options = tf.compat.v1.GPUOptions(allow_growth=True) session_config = tf.compat.v1.ConfigProto(allow_soft_placement=True, log_device_placement=False, ...
[ "tensorflow.keras.models.load_model", "tensorflow.keras.preprocessing.image.img_to_array", "tensorflow.compat.v1.GPUOptions", "numpy.expand_dims", "tensorflow.keras.preprocessing.image.load_img", "os.path.isfile", "tensorflow.compat.v1.ConfigProto", "preprocessing.CNNModel" ]
[((152, 194), 'tensorflow.compat.v1.GPUOptions', 'tf.compat.v1.GPUOptions', ([], {'allow_growth': '(True)'}), '(allow_growth=True)\n', (175, 194), True, 'import tensorflow as tf\n'), ((212, 321), 'tensorflow.compat.v1.ConfigProto', 'tf.compat.v1.ConfigProto', ([], {'allow_soft_placement': '(True)', 'log_device_placemen...
import pandas as pd from datetime import date, datetime import re import logging import spacy from sklearn.feature_extraction import text import scipy as sp import scipy.sparse import numpy as np import multiprocessing as mp from pathos.multiprocessing import ProcessingPool as Pool nlp = spacy.load("en_core_web_sm") t...
[ "logging.error", "sklearn.feature_extraction.text.ENGLISH_STOP_WORDS.union", "logging.basicConfig", "datetime.datetime.timestamp", "datetime.datetime", "spacy.load", "logging.info", "numpy.mean", "sklearn.feature_extraction.text.lower", "pandas.DataFrame.sparse.from_spmatrix", "pathos.multiproce...
[((290, 318), 'spacy.load', 'spacy.load', (['"""en_core_web_sm"""'], {}), "('en_core_web_sm')\n", (300, 318), False, 'import spacy\n'), ((367, 494), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""vectorize-tweets.log"""', 'filemode': '"""a"""', 'format': '"""%(asctime)s - %(message)s"""', 'level': ...
#!/usr/bin/env python3 import pvml import numpy as np import sys import PIL.Image def process_batch(paths, net): images = [] for impath in paths: im = PIL.Image.open(impath).convert("RGB") im = np.array(im.resize((224, 224), PIL.Image.BILINEAR)) images.append(im / 255.0) images = ...
[ "numpy.stack", "pvml.PVMLNet.load", "numpy.savetxt", "sys.exit" ]
[((688, 720), 'pvml.PVMLNet.load', 'pvml.PVMLNet.load', (['"""pvmlnet.npz"""'], {}), "('pvmlnet.npz')\n", (705, 720), False, 'import pvml\n'), ((320, 339), 'numpy.stack', 'np.stack', (['images', '(0)'], {}), '(images, 0)\n', (328, 339), True, 'import numpy as np\n'), ((651, 661), 'sys.exit', 'sys.exit', ([], {}), '()\n...
import pytest import sys, os myPath = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, myPath + '/../') from traintorch import * import numpy as np import pandas as pd class TestClass: def test_metric(self): test=metric('test',w_size=10,average=False,xaxis_int=True,n_ticks=(5, 5)) ass...
[ "os.path.abspath", "sys.path.insert", "numpy.hstack" ]
[((81, 116), 'sys.path.insert', 'sys.path.insert', (['(0)', "(myPath + '/../')"], {}), "(0, myPath + '/../')\n", (96, 116), False, 'import sys, os\n'), ((54, 79), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (69, 79), False, 'import sys, os\n'), ((588, 609), 'numpy.hstack', 'np.hstack', (['...
import os import cv2 import numpy as np import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.applications import VGG19 from tensorflow.keras.layers import MaxPooling2D #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # Settings #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
[ "tensorflow.keras.applications.VGG19", "tensorflow.variables_initializer", "numpy.clip", "tensorflow.Variable", "tensorflow.keras.backend.get_session", "os.path.join", "tensorflow.subtract", "cv2.imwrite", "os.path.exists", "tensorflow.summary.FileWriter", "cv2.resize", "tensorflow.keras.backe...
[((4996, 5115), 'tensorflow.Variable', 'tf.Variable', (['content_img'], {'dtype': 'tf.float32', 'expected_shape': '(None, None, None, NUM_COLOR_CHANNELS)', 'name': '"""input_var"""'}), "(content_img, dtype=tf.float32, expected_shape=(None, None, None,\n NUM_COLOR_CHANNELS), name='input_var')\n", (5007, 5115), True, ...
from typing import Any, Union, List import copy import numpy as np from easydict import EasyDict from ding.envs import BaseEnv, BaseEnvTimestep, BaseEnvInfo, update_shape from ding.envs.common.env_element import EnvElement, EnvElementInfo from ding.envs.common.common_function import affine_transform from ding.torch_ut...
[ "copy.deepcopy", "numpy.random.seed", "ding.torch_utils.to_ndarray", "ding.envs.common.env_element.EnvElementInfo", "ding.envs.BaseEnvTimestep", "numpy.random.randint", "ding.envs.common.common_function.affine_transform", "numpy.float64", "ding.utils.ENV_REGISTRY.register" ]
[((6743, 6774), 'ding.utils.ENV_REGISTRY.register', 'ENV_REGISTRY.register', (['"""mujoco"""'], {}), "('mujoco')\n", (6764, 6774), False, 'from ding.utils import ENV_REGISTRY\n'), ((8362, 8388), 'numpy.random.seed', 'np.random.seed', (['self._seed'], {}), '(self._seed)\n', (8376, 8388), True, 'import numpy as np\n'), (...
from spectrum import CORRELOGRAMPSD, CORRELATION, pcorrelogram, marple_data from spectrum import data_two_freqs from pylab import log10, plot, savefig, linspace from numpy.testing import assert_array_almost_equal, assert_almost_equal def test_correlog(): psd = CORRELOGRAMPSD(marple_data, marple_data, lag=15) ...
[ "spectrum.pcorrelogram", "numpy.testing.assert_array_almost_equal", "numpy.testing.assert_almost_equal", "pylab.savefig", "spectrum.CORRELOGRAMPSD", "spectrum.data_two_freqs" ]
[((268, 316), 'spectrum.CORRELOGRAMPSD', 'CORRELOGRAMPSD', (['marple_data', 'marple_data'], {'lag': '(15)'}), '(marple_data, marple_data, lag=15)\n', (282, 316), False, 'from spectrum import CORRELOGRAMPSD, CORRELATION, pcorrelogram, marple_data\n'), ((321, 360), 'numpy.testing.assert_almost_equal', 'assert_almost_equa...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ "absl.testing.absltest.main", "jax.random.PRNGKey", "numpy.random.randint", "numpy.arange", "numpy.tile", "os.path.join", "ml_collections.FrozenConfigDict", "language.mentionmemory.tasks.memory_generation_task.MemoryGenerationTask.make_collater_fn", "language.mentionmemory.utils.test_utils.gen_menti...
[((11178, 11193), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (11191, 11193), False, 'from absl.testing import absltest\n'), ((2906, 2932), 'copy.deepcopy', 'copy.deepcopy', (['self.config'], {}), '(self.config)\n', (2919, 2932), False, 'import copy\n'), ((2946, 2985), 'ml_collections.FrozenConfigD...
#!/usr/bin/env python import numpy as np from scipy import optimize, stats import math def lnLikelihoodGaussian(parameters, values, errors, weights=None): """ Calculates the total log-likelihood of an ensemble of values, with uncertainties, for a Gaussian distribution. INPUTS parame...
[ "scipy.optimize.fmin", "numpy.size", "numpy.abs", "numpy.sum", "numpy.zeros", "numpy.ones", "numpy.mean", "math.lgamma", "numpy.sqrt" ]
[((1083, 1101), 'numpy.abs', 'np.abs', (['dispersion'], {}), '(dispersion)\n', (1089, 1101), True, 'import numpy as np\n'), ((1513, 1535), 'numpy.sum', 'np.sum', (['ln_likelihoods'], {}), '(ln_likelihoods)\n', (1519, 1535), True, 'import numpy as np\n'), ((3421, 3470), 'scipy.optimize.fmin', 'optimize.fmin', (['partial...
# -*- coding:utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the ...
[ "numpy.min", "numpy.array", "logging.getLogger", "zeus.common.ClassFactory.register" ]
[((700, 727), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (717, 727), False, 'import logging\n'), ((731, 771), 'zeus.common.ClassFactory.register', 'ClassFactory.register', (['ClassType.NETWORK'], {}), '(ClassType.NETWORK)\n', (752, 771), False, 'from zeus.common import ClassType, Clas...
# -*- coding: utf-8 -*- # Copyright (C) 2010-2011, <NAME> <<EMAIL>> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # License: MIT. See COPYING.MIT file in the milk distribution ''' Random Forest ------------- Main elements ------------- rf_learner : A learner object ''' from __future__ import division import n...
[ "numpy.array" ]
[((1004, 1023), 'numpy.array', 'np.array', (['sfeatures'], {}), '(sfeatures)\n', (1012, 1023), True, 'import numpy as np\n'), ((1025, 1042), 'numpy.array', 'np.array', (['slabels'], {}), '(slabels)\n', (1033, 1042), True, 'import numpy as np\n')]
# Copyright (c) 2019, <NAME>. All rights reserved. # # This work is licensed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain View, CA 940...
[ "tensorflow.assign_sub", "tensorflow.control_dependencies", "tensorflow.add_n", "tensorflow.is_finite", "tensorflow.contrib.nccl.all_sum", "tensorflow.convert_to_tensor", "numpy.float32", "tensorflow.device", "tensorflow.zeros_like", "tensorflow.cast", "tensorflow.assign_add", "tensorflow.grou...
[((1589, 1624), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['learning_rate'], {}), '(learning_rate)\n', (1609, 1624), True, 'import tensorflow as tf\n'), ((2118, 2131), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2129, 2131), False, 'from collections import OrderedDict\n'), ((2181, 2194),...
from __future__ import print_function # Use a function definition from future version (say 3.x from 2.7 interpreter) import numpy as np import os import sys import time import cntk as C from cntk.train.training_session import * # comment out the following line to get auto device selection for multi-GPU training C.dev...
[ "numpy.random.seed", "cntk.input", "cntk.sgd", "os.path.isfile", "cntk.logging.log_number_of_parameters", "cntk.layers.Dense", "cntk.train.distributed.Communicator.rank", "os.path.join", "cntk.layers.Convolution2D", "cntk.cross_entropy_with_softmax", "cntk.io.StreamDef", "cntk.train.distribute...
[((418, 435), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (432, 435), True, 'import numpy as np\n'), ((2297, 2321), 'cntk.input', 'C.input', (['input_dim_model'], {}), '(input_dim_model)\n', (2304, 2321), True, 'import cntk as C\n'), ((2326, 2353), 'cntk.input', 'C.input', (['num_output_classes'], {}...
# -*- coding: utf-8 -*- """ RED Log Encodings ================= Defines the *RED* log encodings: - :func:`colour.models.log_encoding_REDLog` - :func:`colour.models.log_decoding_REDLog` - :func:`colour.models.log_encoding_REDLogFilm` - :func:`colour.models.log_decoding_REDLogFilm` - :func:`colour.models.log_...
[ "numpy.abs", "colour.utilities.from_range_1", "colour.utilities.CaseInsensitiveMapping", "colour.utilities.to_domain_1", "colour.models.rgb.transfer_functions.log_decoding_Cineon", "numpy.sign", "numpy.log10", "colour.models.rgb.transfer_functions.log_encoding_Cineon" ]
[((12468, 12558), 'colour.utilities.CaseInsensitiveMapping', 'CaseInsensitiveMapping', (["{'v1': log_encoding_Log3G10_v1, 'v2': log_encoding_Log3G10_v2}"], {}), "({'v1': log_encoding_Log3G10_v1, 'v2':\n log_encoding_Log3G10_v2})\n", (12490, 12558), False, 'from colour.utilities import CaseInsensitiveMapping, from_ra...
import numpy as np import nltk import ssl import random import math import plots as pl import filters as f import dataset as dt import img_feature_ext as fea_ext from config import configs as conf configs = conf() print(configs.keys()) import ssl try: _create_unverified_https_context = ssl._create_unv...
[ "filters.get_answers_matrix", "plots.plot_answers_frequency", "nltk.download", "filters.get_answers_frequency", "img_feature_ext.get_images_features", "random.Random", "filters.tokenize_questions", "filters.vectorize_tokens", "filters.filter_data", "plots.plot_tokens_length_frequency", "filters....
[((210, 216), 'config.configs', 'conf', ([], {}), '()\n', (214, 216), True, 'from config import configs as conf\n'), ((448, 470), 'nltk.download', 'nltk.download', (['"""punkt"""'], {}), "('punkt')\n", (461, 470), False, 'import nltk\n'), ((485, 514), 'dataset.get_original_data', 'dt.get_original_data', (['configs'], {...
# -*- coding: utf-8 -*- """ ipcai2016 Copyright (c) German Cancer Research Center, Computer Assisted Interventions. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE for details """ """ Crea...
[ "numpy.squeeze", "msi.msi.Msi", "SimpleITK.GetArrayFromImage", "SimpleITK.ImageFileReader" ]
[((1384, 1401), 'numpy.squeeze', 'np.squeeze', (['image'], {}), '(image)\n', (1394, 1401), True, 'import numpy as np\n'), ((1416, 1435), 'msi.msi.Msi', 'Msi', (['squeezed_image'], {}), '(squeezed_image)\n', (1419, 1435), False, 'from msi.msi import Msi\n'), ((749, 771), 'SimpleITK.ImageFileReader', 'sitk.ImageFileReade...
import numpy as np import torch import SimpleITK as sitk import random from datetime import datetime from scipy.ndimage import zoom from skimage.transform import resize from config import Config from utils.load_dicom_slice import load_dicom_slice from utils.get_dicom_slice_size import get_dicom_slice_size from utils.m...
[ "utils.blurSharpAugmenter.BlurSharpAugmenter", "utils.load_dicom_slice.load_dicom_slice", "utils.matrixDeformer.MatrixDeformer", "numpy.expand_dims", "random.random", "skimage.transform.resize", "torch.from_numpy" ]
[((1297, 1319), 'torch.from_numpy', 'torch.from_numpy', (['data'], {}), '(data)\n', (1313, 1319), False, 'import torch\n'), ((1536, 1558), 'torch.from_numpy', 'torch.from_numpy', (['mask'], {}), '(mask)\n', (1552, 1558), False, 'import torch\n'), ((4292, 4319), 'utils.load_dicom_slice.load_dicom_slice', 'load_dicom_sli...
import torch import numpy as np from torch.nn import Linear from nlp_losses import Losses from nlp_metrics import Metrics from ..BaseTrainerModule import BaseTrainerModule class SkipgramTrainerModule(BaseTrainerModule): def __init__(self, word_embedding, embedding_dim, vocab_size, learning_rate=1e-3): ...
[ "nlp_metrics.Metrics", "nlp_losses.Losses", "torch.squeeze", "torch.exp", "numpy.mean", "torch.nn.Linear", "torch.unsqueeze", "torch.sum" ]
[((431, 464), 'torch.nn.Linear', 'Linear', (['embedding_dim', 'vocab_size'], {}), '(embedding_dim, vocab_size)\n', (437, 464), False, 'from torch.nn import Linear\n'), ((658, 687), 'torch.squeeze', 'torch.squeeze', (['outputs'], {'dim': '(1)'}), '(outputs, dim=1)\n', (671, 687), False, 'import torch\n'), ((2135, 2168),...
""" Script that trains Weave models on SIDER dataset. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import numpy as np np.random.seed(123) import tensorflow as tf tf.set_random_seed(123) import deepchem as dc sider_tasks, sider_datasets, transformers...
[ "numpy.random.seed", "deepchem.nn.AlternateWeaveLayer", "deepchem.nn.AlternateSequentialWeaveGraph", "tensorflow.set_random_seed", "deepchem.nn.Dense", "deepchem.molnet.load_sider", "deepchem.nn.BatchNormalization", "deepchem.nn.AlternateWeaveGather", "deepchem.metrics.Metric" ]
[((188, 207), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (202, 207), True, 'import numpy as np\n'), ((232, 255), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(123)'], {}), '(123)\n', (250, 255), True, 'import tensorflow as tf\n'), ((323, 363), 'deepchem.molnet.load_sider', 'dc.molnet.l...
# Copyright 2018 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[ "pandas.DataFrame", "io.BytesIO", "numpy.save", "numpy.load", "typing.cast", "numpy.frombuffer", "collections.Counter", "numpy.packbits", "cirq._compat.proper_repr", "cirq._compat._warn_or_error", "numpy.append", "cirq._compat.deprecated", "cirq.value.big_endian_bits_to_int", "typing.TypeV...
[((1035, 1047), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (1042, 1047), False, 'from typing import Any, Callable, Dict, Iterable, Mapping, Optional, Sequence, TYPE_CHECKING, Tuple, TypeVar, Union, cast\n'), ((5267, 5411), 'cirq._compat.deprecated', 'deprecated', ([], {'deadline': '"""v0.15"""', 'fix': ...
import numpy from pycuda.compiler import SourceModule import aesara import aesara.misc.pycuda_init import aesara.sandbox.cuda as cuda class PyCUDADoubleOp(aesara.Op): def __eq__(self, other): return type(self) == type(other) def __hash__(self): return hash(type(self)) def __str__(self):...
[ "pycuda.compiler.SourceModule", "numpy.ceil", "aesara.tensor.fmatrix", "numpy.ones", "numpy.intc", "aesara.sandbox.cuda.basic_ops.as_cuda_ndarray_variable", "aesara.sandbox.cuda.CudaNdarray.zeros" ]
[((1503, 1526), 'aesara.tensor.fmatrix', 'aesara.tensor.fmatrix', ([], {}), '()\n', (1524, 1526), False, 'import aesara\n'), ((1578, 1613), 'numpy.ones', 'numpy.ones', (['(4, 5)'], {'dtype': '"""float32"""'}), "((4, 5), dtype='float32')\n", (1588, 1613), False, 'import numpy\n'), ((663, 856), 'pycuda.compiler.SourceMod...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Author: <NAME> @Contact: <EMAIL> @File: data.py @Time: 2018/10/13 6:21 PM """ import os import sys import glob import h5py import numpy as np from torch.utils.data import Dataset from model import knn import torch def download(): BASE_DIR = os.path.dirname(os.pa...
[ "os.mkdir", "numpy.sin", "torch.arange", "os.path.join", "os.path.abspath", "numpy.multiply", "numpy.random.randn", "os.path.exists", "torch.zeros", "numpy.random.shuffle", "h5py.File", "os.path.basename", "os.system", "numpy.cos", "numpy.dot", "torch.sum", "numpy.concatenate", "mo...
[((357, 387), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""data"""'], {}), "(BASE_DIR, 'data')\n", (369, 387), False, 'import os\n'), ((923, 953), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""data"""'], {}), "(BASE_DIR, 'data')\n", (935, 953), False, 'import os\n'), ((1320, 1352), 'numpy.concatenate', 'np.con...
"""Test several functions distibuted over common.py, misc.py, scada.py""" import straxen import pandas import os import tempfile from .test_basics import test_run_id import numpy as np import strax from matplotlib.pyplot import clf as plt_clf def test_pmt_pos_1t(): """ Test if we can get the 1T PMT...
[ "straxen.get_secret", "tempfile.TemporaryDirectory", "numpy.sum", "straxen.contexts.demo", "matplotlib.pyplot.clf", "strax.endtime", "straxen.dataframe_to_wiki", "straxen.plot_pmts", "numpy.ones", "straxen.get_livetime_sec", "straxen.pmt_positions", "straxen.scada._average_scada", "os.chdir"...
[((4925, 4952), 'numpy.ones', 'np.ones', (['straxen.n_tpc_pmts'], {}), '(straxen.n_tpc_pmts)\n', (4932, 4952), True, 'import numpy as np\n'), ((4958, 4978), 'straxen.plot_pmts', 'straxen.plot_pmts', (['c'], {}), '(c)\n', (4975, 4978), False, 'import straxen\n'), ((4984, 5020), 'straxen.plot_pmts', 'straxen.plot_pmts', ...
import gym import numpy as np from vel.exceptions import VelException def take_along_axis(large_array, indexes): """ Take along axis """ # Reshape indexes into the right shape if len(large_array.shape) > len(indexes.shape): indexes = indexes.reshape(indexes.shape + tuple([1] * (len(large_array.sh...
[ "numpy.stack", "numpy.moveaxis", "numpy.zeros_like", "numpy.zeros", "numpy.arange", "numpy.take", "vel.exceptions.VelException", "numpy.random.choice", "numpy.take_along_axis", "numpy.concatenate", "numpy.logical_or.accumulate" ]
[((361, 409), 'numpy.take_along_axis', 'np.take_along_axis', (['large_array', 'indexes'], {'axis': '(0)'}), '(large_array, indexes, axis=0)\n', (379, 409), True, 'import numpy as np\n'), ((2141, 2206), 'numpy.zeros', 'np.zeros', (['[self.buffer_capacity, self.num_envs]'], {'dtype': 'np.float32'}), '([self.buffer_capaci...
from zlib import crc32 import numpy as np def test_set_check(identifier, test_ratio): return crc32(np.int64(identifier)) & 0xffffffff < test_ratio * 2**32 def split_train_test_by_id(data, test_ratio, id_column): ids = data[id_column] in_test_set = ids.apply(lambda id_: test_set_check(id_, test_ratio)) ...
[ "numpy.int64" ]
[((106, 126), 'numpy.int64', 'np.int64', (['identifier'], {}), '(identifier)\n', (114, 126), True, 'import numpy as np\n')]
#!/usr/bin/env python # encoding: utf-8 ''' @license: (C) Copyright 2013-2020, Node Supply Chain Manager Corporation Limited. @time: 2021/5/7 16:30 @file: app.py @author: baidq @Software: PyCharm @desc: ''' import json import flask import pickle import ahocorasick import numpy as np from gevent import pywsgi import ten...
[ "json.load", "numpy.argmax", "keras.preprocessing.sequence.pad_sequences", "bilstm_crf_model.BiLstmCrfModel", "flask.Flask", "tensorflow.Session", "tensorflow.ConfigProto", "flask.jsonify", "ahocorasick.Automaton", "gevent.pywsgi.WSGIServer", "keras.backend.tensorflow_backend.set_session", "te...
[((5553, 5569), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (5567, 5569), True, 'import tensorflow as tf\n'), ((5614, 5639), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (5624, 5639), True, 'import tensorflow as tf\n'), ((5648, 5670), 'tensorflow.get_default_gra...
# Copyright (c) 2019 <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, modify, merge, publish, distribute, ...
[ "numpy.radians", "numpy.sum", "argparse.ArgumentParser", "gpxpy.parse", "gpxpy.gpx.GPX", "numpy.nonzero", "gpxpy.gpx.GPXTrack", "numpy.cumsum", "numpy.sin", "numpy.cos", "datetime.datetime.fromtimestamp", "scipy.interpolate.splev", "gpxpy.gpx.GPXTrackSegment", "numpy.sqrt" ]
[((2285, 2305), 'scipy.interpolate.splev', 'splev', (['u_interp', 'tck'], {}), '(u_interp, tck)\n', (2290, 2305), False, 'from scipy.interpolate import interp1d, splprep, splev\n'), ((6169, 6184), 'gpxpy.gpx.GPX', 'gpxpy.gpx.GPX', ([], {}), '()\n', (6182, 6184), False, 'import gpxpy\n'), ((6201, 6221), 'gpxpy.gpx.GPXTr...
from typing import Union import mxnet as mx import numpy as np import pytest import optuna from optuna.integration.mxnet import MXNetPruningCallback from optuna.testing.integration import DeterministicPruner def test_mxnet_pruning_callback() -> None: def objective(trial: optuna.trial.Trial, eval_metric: Union[l...
[ "mxnet.optimizer.RMSProp", "optuna.trial.Trial", "mxnet.symbol.Activation", "mxnet.symbol.FullyConnected", "optuna.integration.mxnet.MXNetPruningCallback", "mxnet.mod.Module", "numpy.zeros", "mxnet.symbol.SoftmaxOutput", "mxnet.symbol.Variable", "pytest.raises", "optuna.testing.integration.Deter...
[((375, 401), 'mxnet.symbol.Variable', 'mx.symbol.Variable', (['"""data"""'], {}), "('data')\n", (393, 401), True, 'import mxnet as mx\n'), ((417, 466), 'mxnet.symbol.FullyConnected', 'mx.symbol.FullyConnected', ([], {'data': 'data', 'num_hidden': '(1)'}), '(data=data, num_hidden=1)\n', (441, 466), True, 'import mxnet ...
# -*- coding: utf-8 -*- # # windstress.py # # purpose: # author: <NAME> # e-mail: <EMAIL> # web: http://ocefpaf.github.io/ # created: 21-Aug-2013 # modified: Mon 21 Jul 2014 12:16:28 PM BRT # # obs: # import numpy as np from .constants import kappa, Charnock_alpha, g, R_roughness from .atmosphere import vis...
[ "numpy.abs", "numpy.log", "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.any", "numpy.sqrt" ]
[((2478, 2492), 'numpy.asarray', 'np.asarray', (['sp'], {}), '(sp)\n', (2488, 2492), True, 'import numpy as np\n'), ((2494, 2507), 'numpy.asarray', 'np.asarray', (['z'], {}), '(z)\n', (2504, 2507), True, 'import numpy as np\n'), ((2509, 2523), 'numpy.asarray', 'np.asarray', (['Ta'], {}), '(Ta)\n', (2519, 2523), True, '...
"""Atmospheric soundings. --- NOTATION --- The following letters will be used throughout this module. T = number of lead times n = number of storm objects p = number of pressure levels, not including surface P = number of pressure levels, including surface F = number of sounding fields N = number of soundings = T*n...
[ "gewittergefahr.gg_utils.moisture_conversions.dewpoint_to_specific_humidity", "numpy.maximum", "numpy.sum", "gewittergefahr.gg_utils.nwp_model_utils.get_lowest_height_name", "numpy.invert", "gewittergefahr.gg_utils.geodetic_utils.get_elevations", "numpy.isnan", "gewittergefahr.gg_utils.storm_tracking_...
[((3805, 3832), 'numpy.array', 'numpy.array', (['[0]'], {'dtype': 'int'}), '([0], dtype=int)\n', (3816, 3832), False, 'import numpy\n'), ((3920, 3963), 'numpy.linspace', 'numpy.linspace', (['(0)', '(12000)'], {'num': '(49)', 'dtype': 'int'}), '(0, 12000, num=49, dtype=int)\n', (3934, 3963), False, 'import numpy\n'), ((...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # File: cifar10-preact18-mixup.py # Author: <NAME> <<EMAIL>>, <NAME> <<EMAIL>> import numpy as np import argparse import os import tensorflow as tf from tensorpack import * from tensorpack.tfutils.summary import * from tensorpack.dataflow import dataset BATCH_SIZE = 128...
[ "argparse.ArgumentParser", "os.path.join", "tensorflow.get_variable", "tensorflow.add_n", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorpack.dataflow.dataset.Cifar10", "tensorflow.nn.in_top_k", "numpy.random.beta", "tensorflow.re...
[((3490, 3520), 'tensorpack.dataflow.dataset.Cifar10', 'dataset.Cifar10', (['train_or_test'], {}), '(train_or_test)\n', (3505, 3520), False, 'from tensorpack.dataflow import dataset\n'), ((4652, 4677), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4675, 4677), False, 'import argparse\n'), ((1...
# Copyright 2019 RnD at Spoon Radio # # 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...
[ "argparse.ArgumentParser", "SpecAugment.SpecAugment.spec_augment_tensorflow.visualization_spectrogram", "SpecAugment.SpecAugment.spec_augment_pytorch.spec_augment", "os.path.dirname", "torch.FloatTensor", "librosa.magphase", "librosa.load", "torchaudio.load", "librosa.feature.melspectrogram", "lib...
[((1007, 1058), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Spec Augment"""'}), "(description='Spec Augment')\n", (1030, 1058), False, 'import argparse\n'), ((2174, 2221), 'torchaudio.load', 'torchaudio.load', (['audio_path'], {'normalization': '(True)'}), '(audio_path, normalization=...
""" Copyright (c) Facebook, Inc. and its affiliates. """ from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib import plotly.graph_objs as go matplotlib.use("Agg") import matplotlib.pyplot as plt import visdom import pickle import os import torch GEOSCORER_DIR = os.path.dirname(os.path.realpat...
[ "sys.path.append", "matplotlib.pyplot.title", "inst_seg_dataset.SegmentCenterInstanceData", "argparse.ArgumentParser", "os.path.realpath", "numpy.asarray", "visdom.Visdom", "matplotlib.pyplot.draw", "matplotlib.pyplot.figure", "matplotlib.use", "numpy.array", "plotly.graph_objs.Figure", "sha...
[((167, 188), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (181, 188), False, 'import matplotlib\n'), ((342, 382), 'os.path.join', 'os.path.join', (['GEOSCORER_DIR', '"""../../../"""'], {}), "(GEOSCORER_DIR, '../../../')\n", (354, 382), False, 'import os\n'), ((305, 331), 'os.path.realpath', 'o...
# Copyright 2020 Google LLC # # # 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,...
[ "os.makedirs", "numpy.log2", "tensorflow.keras.models.Model", "numpy.min", "numpy.max", "six.itervalues", "multiprocessing.Pool", "shutil.rmtree", "numpy.sqrt", "os.getenv", "numpy.random.shuffle", "multiprocessing.cpu_count" ]
[((1054, 1075), 'os.getenv', 'os.getenv', (['"""DEBUG"""', '(0)'], {}), "('DEBUG', 0)\n", (1063, 1075), False, 'import os\n'), ((8457, 8483), 'numpy.random.shuffle', 'np.random.shuffle', (['indexes'], {}), '(indexes)\n', (8474, 8483), True, 'import numpy as np\n'), ((8802, 8845), 'tensorflow.keras.models.Model', 'Model...
import sys sys.path.append('droid_slam') from tqdm import tqdm import numpy as np import torch import lietorch import cv2 import os import glob import time import argparse from torch.multiprocessing import Process from droid import Droid import torch.nn.functional as F def show_image(image): image = image.per...
[ "sys.path.append", "droid.Droid", "argparse.ArgumentParser", "cv2.waitKey", "numpy.sqrt", "torch.multiprocessing.set_start_method", "numpy.loadtxt", "torch.as_tensor", "numpy.eye", "cv2.imshow", "os.path.join", "os.listdir", "cv2.resize", "cv2.undistort" ]
[((11, 40), 'sys.path.append', 'sys.path.append', (['"""droid_slam"""'], {}), "('droid_slam')\n", (26, 40), False, 'import sys\n'), ((352, 386), 'cv2.imshow', 'cv2.imshow', (['"""image"""', '(image / 255.0)'], {}), "('image', image / 255.0)\n", (362, 386), False, 'import cv2\n'), ((391, 405), 'cv2.waitKey', 'cv2.waitKe...
""" QVM Device ========== **Module name:** :mod:`pennylane_forest.qvm` .. currentmodule:: pennylane_forest.qvm This module contains the :class:`~.QVMDevice` class, a PennyLane device that allows evaluation and differentiation of Rigetti's Forest Quantum Virtual Machines (QVMs) using PennyLane. Classes ------- .. a...
[ "pyquil.gates.RESET", "pyquil.api._quantum_computer._get_qvm_with_topology", "pyquil.gates.MEASURE", "numpy.zeros", "numpy.ones", "pyquil.get_qc", "pyquil.quil.Pragma", "numpy.linalg.eigh", "numpy.array", "re.search", "numpy.all" ]
[((3928, 4023), 'pyquil.api._quantum_computer._get_qvm_with_topology', '_get_qvm_with_topology', (['"""device"""'], {'topology': 'device', 'noisy': 'noisy', 'connection': 'self.connection'}), "('device', topology=device, noisy=noisy, connection=\n self.connection)\n", (3950, 4023), False, 'from pyquil.api._quantum_c...
''' Multi-Layer Perceptron ''' import numpy as np import tensorflow as tf #import input_data from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops imp...
[ "tensorflow.image.resize_images", "tensorflow.clip_by_value", "tensorflow.python.ops.array_ops.where", "tensorflow.python.ops.array_ops.zeros_like", "numpy.random.laplace", "tensorflow.contrib.layers.batch_norm", "tensorflow.transpose", "tensorflow.stack", "tensorflow.multiply", "math.log", "ten...
[((3837, 3943), 'tensorflow.contrib.layers.batch_norm', 'tf.contrib.layers.batch_norm', (['h'], {'scale': '(True)', 'is_training': '(True)', 'updates_collections': '[AECODER_VARIABLES]'}), '(h, scale=True, is_training=True,\n updates_collections=[AECODER_VARIABLES])\n', (3865, 3943), True, 'import tensorflow as tf\n...
# -*- coding: utf-8 -*- """ @Time : 2019/8/7 22:05 @Author : <NAME> @Email : <EMAIL> @File : validator.py.py """ import sys import cv2 import torch import numpy as np import torch.nn.functional as F from easydict import EasyDict as edict from tqdm import tqdm from modules.utils.img_utils import normali...
[ "numpy.concatenate", "modules.utils.img_utils.pad_image_to_shape", "torch.LongTensor", "modules.utils.img_utils.normalize", "torch.FloatTensor", "numpy.hstack", "torch.exp", "torch.cuda.empty_cache", "torch.no_grad", "modules.metircs.seg.metric.SegMetric", "cv2.resize" ]
[((1284, 1319), 'modules.metircs.seg.metric.SegMetric', 'SegMetric', ([], {'n_classes': 'self.class_num'}), '(n_classes=self.class_num)\n', (1293, 1319), False, 'from modules.metircs.seg.metric import SegMetric\n'), ((3648, 3672), 'torch.cuda.empty_cache', 'torch.cuda.empty_cache', ([], {}), '()\n', (3670, 3672), False...
import pandas as pd import numpy as np import pkg_resources import torch from glycowork.glycan_data.loader import lib, unwrap from glycowork.ml.processing import dataset_to_dataloader try: from torch_geometric.data import Data from torch_geometric.loader import DataLoader except ImportError: raise ImportError('<...
[ "pandas.DataFrame", "pandas.read_csv", "pkg_resources.resource_stream", "pandas.Series", "torch.no_grad", "numpy.concatenate" ]
[((378, 473), 'pkg_resources.resource_stream', 'pkg_resources.resource_stream', (['__name__', '"""glycowork_lectinoracle_background_correction.csv"""'], {}), "(__name__,\n 'glycowork_lectinoracle_background_correction.csv')\n", (407, 473), False, 'import pkg_resources\n'), ((515, 530), 'pandas.read_csv', 'pd.read_cs...
import matplotlib.pyplot as plt import numpy as np import seaborn as sns def gevd_cdf(z, mu, xi, sigma): """Compute the CDF of the GEVD with the given parameters (i.e. probability that max <= z) """ return np.exp(-((1 + xi * (z - mu) / sigma) ** (-1 / xi))) def plot_gevd( mu, xi, sigma,...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "numpy.where", "numpy.exp", "numpy.linspace", "numpy.round", "matplotlib.pyplot.tight_layout", "seaborn.set_theme" ]
[((225, 274), 'numpy.exp', 'np.exp', (['(-(1 + xi * (z - mu) / sigma) ** (-1 / xi))'], {}), '(-(1 + xi * (z - mu) / sigma) ** (-1 / xi))\n', (231, 274), True, 'import numpy as np\n'), ((611, 648), 'numpy.linspace', 'np.linspace', (['min_z', 'max_z', 'resolution'], {}), '(min_z, max_z, resolution)\n', (622, 648), True, ...
import copy import cv2 import numpy as np from . import classif def bold_bottom_staff(img, staff_idx, thickness = 1): """Bolding the bottom staff line Args: img (array): array of the image staff_idx (list of tuples): tuples of the staff indices Returns: modified image (copy) ...
[ "copy.deepcopy", "numpy.copy" ]
[((337, 349), 'numpy.copy', 'np.copy', (['img'], {}), '(img)\n', (344, 349), True, 'import numpy as np\n'), ((772, 795), 'copy.deepcopy', 'copy.deepcopy', (['base_img'], {}), '(base_img)\n', (785, 795), False, 'import copy\n')]
"""Common processing tasks.""" import numpy as np from scipy import signal from copper.core import PipelineBlock class Windower(PipelineBlock): """Windows incoming data to a specific length. Takes new input data and combines with past data to maintain a sliding window with optional overlap. The window ...
[ "scipy.signal.lfilter", "numpy.zeros", "scipy.signal.lfiltic", "numpy.hstack", "numpy.mean", "numpy.atleast_2d" ]
[((3071, 3106), 'numpy.zeros', 'np.zeros', (['(n_channels, self.length)'], {}), '((n_channels, self.length))\n', (3079, 3106), True, 'import numpy as np\n'), ((13145, 13164), 'numpy.atleast_2d', 'np.atleast_2d', (['data'], {}), '(data)\n', (13158, 13164), True, 'import numpy as np\n'), ((3579, 3592), 'numpy.mean', 'np....
import numpy as np import time import pyasdf import scipy from scipy.fftpack.helper import next_fast_len from obspy.signal.util import _npts2nfft import matplotlib.pyplot as plt ''' this script compares the computational efficiency of the two numpy function to do the fft, which are rfft and fft respectively ''' hfile...
[ "matplotlib.pyplot.subplot", "numpy.fft.rfft", "matplotlib.pyplot.show", "numpy.fft.irfft", "matplotlib.pyplot.plot", "pyasdf.ASDFDataSet", "scipy.fftpack.helper.next_fast_len", "obspy.signal.util._npts2nfft", "numpy.abs", "time.time", "scipy.fftpack.fft", "scipy.fftpack.ifft", "numpy.linspa...
[((408, 443), 'pyasdf.ASDFDataSet', 'pyasdf.ASDFDataSet', (['hfile'], {'mode': '"""r"""'}), "(hfile, mode='r')\n", (426, 443), False, 'import pyasdf\n'), ((740, 756), 'obspy.signal.util._npts2nfft', '_npts2nfft', (['npts'], {}), '(npts)\n', (750, 756), False, 'from obspy.signal.util import _npts2nfft\n'), ((894, 905), ...
import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from scipy.interpolate import interp1d if __name__ == '__main__': sns.set(color_codes=True) """create linear interpolants for the temperature standard conversion scales""" raw = np.loadtxt('T27_T9...
[ "numpy.abs", "matplotlib.pyplot.figure", "matplotlib.pyplot.tick_params", "scipy.interpolate.interp1d", "matplotlib.pyplot.tight_layout", "pandas.ExcelFile", "numpy.savetxt", "numpy.loadtxt", "numpy.linspace", "numpy.int32", "seaborn.set", "matplotlib.pyplot.errorbar", "matplotlib.pyplot.sho...
[((177, 202), 'seaborn.set', 'sns.set', ([], {'color_codes': '(True)'}), '(color_codes=True)\n', (184, 202), True, 'import seaborn as sns\n'), ((302, 354), 'numpy.loadtxt', 'np.loadtxt', (['"""T27_T90.csv"""'], {'delimiter': '""","""', 'skiprows': '(0)'}), "('T27_T90.csv', delimiter=',', skiprows=0)\n", (312, 354), Tru...
""" desitarget.cmx.cmx_cuts ======================== Target Selection for DESI commissioning (cmx) derived from `the cmx wiki`_. A collection of helpful (static) methods to check whether an object's flux passes a given selection criterion (*e.g.* STD_TEST). .. _`the Gaia data model`: https://gea.esac.esa.int/archive...
[ "numpy.bool_", "desitarget.geomask.sweep_files_touch_hp", "numpy.abs", "desitarget.gaiamatch.gaia_dr_from_ref_cat", "desitarget.myRF.myRF", "desitarget.io.read_external_file", "pkg_resources.resource_filename", "numpy.isnan", "fitsio.read", "desitarget.geomask.bundle_bricks", "numpy.arange", "...
[((1365, 1377), 'desiutil.log.get_logger', 'get_logger', ([], {}), '()\n', (1375, 1377), False, 'from desiutil.log import get_logger\n'), ((1409, 1415), 'time.time', 'time', ([], {}), '()\n', (1413, 1415), False, 'from time import time\n'), ((2961, 2993), 'numpy.zeros', 'np.zeros', (['(nbEntries, nfeatures)'], {}), '((...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
[ "tensorflow.train.Coordinator", "tensorflow.logging.info", "tensorflow.train.Int64List", "tensorflow.get_collection", "tensorflow.train.batch_join", "tensorflow.variables_initializer", "tensorflow.logging.set_verbosity", "tensorflow.ConfigProto", "os.path.isfile", "tensorflow.assign", "tensorflo...
[((952, 1029), 'tensorflow.flags.DEFINE_string', 'flags.DEFINE_string', (['"""output_dir"""', '""""""', '"""The file to save the predictions to."""'], {}), "('output_dir', '', 'The file to save the predictions to.')\n", (971, 1029), False, 'from tensorflow import flags\n'), ((1058, 1191), 'tensorflow.flags.DEFINE_strin...
import numpy as np def rx1(z_w,rmask): """ function rx1 = rx1(z_w,rmask) This function computes the bathymetry slope from a SCRUM NetCDF file. On Input: z_w layer depth. rmask Land/Sea masking at RHO-points. On Output: rx1 Haney stiffness ratios. ...
[ "numpy.amax", "numpy.zeros", "numpy.maximum", "numpy.median" ]
[((420, 437), 'numpy.zeros', 'np.zeros', (['(L, Mp)'], {}), '((L, Mp))\n', (428, 437), True, 'import numpy as np\n'), ((591, 608), 'numpy.zeros', 'np.zeros', (['(Lp, M)'], {}), '((Lp, M))\n', (599, 608), True, 'import numpy as np\n'), ((897, 917), 'numpy.zeros', 'np.zeros', (['(N, L, Mp)'], {}), '((N, L, Mp))\n', (905,...
import os import unittest import tempfile import json import numpy as np import pandas as pd import shutil from supervised import AutoML from supervised.exceptions import AutoMLException class AutoMLInitTest(unittest.TestCase): automl_dir = "automl_testing" def tearDown(self): shutil.rmtree(self.au...
[ "numpy.random.uniform", "shutil.rmtree", "numpy.random.randint", "supervised.AutoML" ]
[((299, 349), 'shutil.rmtree', 'shutil.rmtree', (['self.automl_dir'], {'ignore_errors': '(True)'}), '(self.automl_dir, ignore_errors=True)\n', (312, 349), False, 'import shutil\n'), ((396, 427), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(30, 2)'}), '(size=(30, 2))\n', (413, 427), True, 'import numpy a...
#!/usr/bin/env python #coding=utf-8 # 輸入點 並且 計算 各自的距離 import numpy as np import matplotlib import matplotlib.pyplot as plt # 為了繪製出圖形 # 4 nodes # x=[0.09,0.16,0.84,0.70 ] # 以list的形式 # y=[0.17,0.52,0.92,0.16] # 原點+9 個節點 原點設為index 0 x = [0,19.47000,-6.47000,40.09000,5.39000,15.23000,-10,-20.47000,5.20000,16.30...
[ "numpy.zeros", "matplotlib.pyplot.show" ]
[((841, 851), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (849, 851), True, 'import matplotlib.pyplot as plt\n'), ((1025, 1041), 'numpy.zeros', 'np.zeros', (['(n, 2)'], {}), '((n, 2))\n', (1033, 1041), True, 'import numpy as np\n'), ((1173, 1189), 'numpy.zeros', 'np.zeros', (['(n, n)'], {}), '((n, n))\n', (...
import numpy as np import math from RandomBot import RandomBot from TicTacToe import TicTacToeStatic from PrioritizeMoves import PrioritizeMoves class Node: def __init__(self,s,cnt,x=1, parent=None): self.s = np.array(s) self.parent = parent self.c= [] self.x=x self.N=0 ...
[ "TicTacToe.TicTacToeStatic.getNTW", "RandomBot.RandomBot", "TicTacToe.TicTacToeStatic.removecopies", "TicTacToe.TicTacToeStatic.available_moves", "numpy.array", "math.log", "TicTacToe.TicTacToeStatic.Status" ]
[((222, 233), 'numpy.array', 'np.array', (['s'], {}), '(s)\n', (230, 233), True, 'import numpy as np\n'), ((401, 431), 'TicTacToe.TicTacToeStatic.Status', 'TicTacToeStatic.Status', (['self.s'], {}), '(self.s)\n', (423, 431), False, 'from TicTacToe import TicTacToeStatic\n'), ((496, 535), 'TicTacToe.TicTacToeStatic.avai...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: <NAME> @copyright 2018 @licence: 2-clause BSD licence Demonstration of bidirectional edges by using state-antistate graphs """ import sys sys.path.insert(0,'../src') import os from common_code import * import numpy as _np from numpy import * from matplot...
[ "numpy.sum", "numpy.zeros", "sys.path.insert", "numpy.clip", "numpy.hstack", "phasestatemachine.Kernel", "numpy.array", "numpy.linspace" ]
[((202, 230), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../src"""'], {}), "(0, '../src')\n", (217, 230), False, 'import sys\n'), ((3788, 3907), 'phasestatemachine.Kernel', 'phasestatemachine.Kernel', ([], {'alpha': '(20.0)', 'numStates': '(2)', 'dt': '(0.01)', 'epsilon': '(0.001)', 'successors': '[[1], [0]]', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import numpy as np from keras.models import Model from keras.layers.recurrent import LSTM from keras.layers import Input, Bidirectional, Conv1D, Flatten, Dropout from keras.layers import Dense, Activation, concatenate, RepeatVector from keras.layers import Time...
[ "keras.layers.RepeatVector", "keras.layers.embeddings.Embedding", "keras.layers.Activation", "keras.backend.set_value", "numpy.float32", "keras.layers.Dropout", "keras.optimizers.Adam", "keras.layers.Flatten", "keras.models.Model", "keras.backend.get_value", "keras.layers.Dense", "os.sep.join"...
[((4213, 4250), 'keras.models.Model', 'Model', ([], {'inputs': 'inputs', 'outputs': 'outputs'}), '(inputs=inputs, outputs=outputs)\n', (4218, 4250), False, 'from keras.models import Model\n'), ((4271, 4298), 'keras.optimizers.Adam', 'optimizers.Adam', ([], {'lr': 'self.lr'}), '(lr=self.lr)\n', (4286, 4298), False, 'fro...
import numpy as np import matplotlib.pyplot as plt import itertools import pandas as pd import os from numpy import polyfit from sklearn.mixture import GaussianMixture as GMM # of course this is a fake one just to offer an example def source(): return itertools.cycle((1, 0, 1, 4, 8, 2, 1, 3, 3, 2)) # import pyl...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.legend", "sklearn.mixture.GaussianMixture", "pandas.read_excel", "numpy.arange", "numpy.array", "itertools.cycle", "matplotlib.pyplot.xlabel", "os.path.join" ]
[((619, 672), 'os.path.join', 'os.path.join', (['processed_result_path', '"""Distances.xlsx"""'], {}), "(processed_result_path, 'Distances.xlsx')\n", (631, 672), False, 'import os\n'), ((688, 746), 'pandas.read_excel', 'pd.read_excel', (['distances_info_path'], {'sheet_name': '"""Distances"""'}), "(distances_info_path,...
# coding: utf-8 import numpy as np x = np.array([1, 5]) w = np.array([2, 9]) b = 5 z = np.sum(w*x) + b print(z) z = (w * 3).sum() print(z)
[ "numpy.array", "numpy.sum" ]
[((40, 56), 'numpy.array', 'np.array', (['[1, 5]'], {}), '([1, 5])\n', (48, 56), True, 'import numpy as np\n'), ((61, 77), 'numpy.array', 'np.array', (['[2, 9]'], {}), '([2, 9])\n', (69, 77), True, 'import numpy as np\n'), ((88, 101), 'numpy.sum', 'np.sum', (['(w * x)'], {}), '(w * x)\n', (94, 101), True, 'import numpy...
#Programmer: <NAME> #Purpose: To extract cover song alignments for use in the GUI import numpy as np import sys sys.path.append("../") sys.path.append("../SequenceAlignment") import os import glob import scipy.io as sio import skimage import skimage.io import time import matplotlib.pyplot as plt from CSMSSMTools import...
[ "sys.path.append", "os.remove", "matplotlib.pyplot.get_cmap", "argparse.ArgumentParser", "json.dumps", "numpy.max", "base64.b64encode", "os.path.splitext", "numpy.array", "numpy.round", "skimage.io.imsave" ]
[((112, 134), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (127, 134), False, 'import sys\n'), ((135, 174), 'sys.path.append', 'sys.path.append', (['"""../SequenceAlignment"""'], {}), "('../SequenceAlignment')\n", (150, 174), False, 'import sys\n'), ((530, 549), 'base64.b64encode', 'base64.b6...
# coding: utf-8 '''Quick viewer to look at photometry''' import glob import os import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import CheckButtons import sdf.result import sdf.plotting import sdf.utils from classifier.photometry import * import classifier.config as cfg def view_one(file...
[ "matplotlib.widgets.CheckButtons", "matplotlib.pyplot.show", "os.path.basename", "matplotlib.pyplot.axes", "matplotlib.pyplot.close", "numpy.argmax", "glob.glob", "matplotlib.pyplot.subplots" ]
[((1280, 1305), 'glob.glob', 'glob.glob', (['"""labels/*.csv"""'], {}), "('labels/*.csv')\n", (1289, 1305), False, 'import glob\n'), ((458, 486), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(8, 5)'}), '(figsize=(8, 5))\n', (470, 486), True, 'import matplotlib.pyplot as plt\n'), ((607, 644), 'matplot...
import os import sys import time import subprocess import webbrowser from collections import defaultdict import pandas as pd import numpy as np from numpy import floor, ceil path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(path) pd.set_option('display.float_format', lambda x: '%.3f' % x) from valida...
[ "sys.path.append", "os.path.join", "numpy.ceil", "os.path.realpath", "numpy.floor", "os.system", "time.sleep", "webbrowser.open_new_tab", "collections.defaultdict", "pandas.Series", "pandas.Categorical", "pandas.set_option", "pandas.concat", "sys.exit" ]
[((226, 247), 'sys.path.append', 'sys.path.append', (['path'], {}), '(path)\n', (241, 247), False, 'import sys\n'), ((248, 307), 'pandas.set_option', 'pd.set_option', (['"""display.float_format"""', "(lambda x: '%.3f' % x)"], {}), "('display.float_format', lambda x: '%.3f' % x)\n", (261, 307), True, 'import pandas as p...
import numpy as np from gym.spaces import Box, Discrete from rlberry.utils.binsearch import binary_search_nd from rlberry.utils.binsearch import unravel_index_uniform_bin class Discretizer: def __init__(self, space, n_bins): assert isinstance( space, Box ), "Discretization is only impl...
[ "numpy.zeros", "rlberry.utils.binsearch.unravel_index_uniform_bin", "gym.spaces.Discrete", "rlberry.utils.binsearch.binary_search_nd" ]
[((1216, 1236), 'gym.spaces.Discrete', 'Discrete', (['n_elements'], {}), '(n_elements)\n', (1224, 1236), False, 'from gym.spaces import Box, Discrete\n'), ((1313, 1345), 'numpy.zeros', 'np.zeros', (['(self.dim, n_elements)'], {}), '((self.dim, n_elements))\n', (1321, 1345), True, 'import numpy as np\n'), ((1517, 1558),...
""" Some common functions """ import copy import networkx as nx import matplotlib.pyplot as plt import random import numpy as np from collections import OrderedDict import networkx as nx import pyproj from shapely.ops import transform from functools import partial import math #DISTRIBUTIONS # def next_time_uniform_di...
[ "shapely.ops.transform", "networkx.draw_networkx_nodes", "networkx.draw_networkx_labels", "math.radians", "matplotlib.pyplot.close", "networkx.shortest_path", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "math.sqrt", "math.sin", "matplotlib.pyplot.ion", "random.random", "networkx....
[((872, 902), 'networkx.get_node_attributes', 'nx.get_node_attributes', (['G', '"""x"""'], {}), "(G, 'x')\n", (894, 902), True, 'import networkx as nx\n'), ((910, 940), 'networkx.get_node_attributes', 'nx.get_node_attributes', (['G', '"""y"""'], {}), "(G, 'y')\n", (932, 940), True, 'import networkx as nx\n'), ((1107, 1...
# -*- coding: utf-8 -*- print("Loading HaasoscopeLibQt.py") # You might adjust these, just override them before calling construct() num_board = 1 # Number of Haasoscope boards to read out ram_width = 9 # width in bits of sample ram to use (e.g. 9==512 samples, 12(max)==4096 samples) max10adcchans = []#[(0,110),(...
[ "numpy.sum", "numpy.arctan2", "numpy.amin", "numpy.argmax", "numpy.empty", "numpy.ones", "ripyl.util.plot.Plotter", "numpy.mean", "numpy.arange", "numpy.sin", "serial.Serial", "numpy.multiply", "numpy.std", "numpy.fft.fft", "os.uname", "ripyl.streaming.samples_to_sample_stream", "num...
[((80039, 80050), 'time.time', 'time.time', ([], {}), '()\n', (80048, 80050), False, 'import time, json, os\n'), ((80065, 80076), 'time.time', 'time.time', ([], {}), '()\n', (80074, 80076), False, 'import time, json, os\n'), ((968, 978), 'os.uname', 'os.uname', ([], {}), '()\n', (976, 978), False, 'import time, json, o...
import os import numpy as np from hapiclient import hapi debug = False def comparisonOK(a, b): if a.dtype != b.dtype: if debug: print('Data types differ.') if debug: print(a.dtype, b.dtype) if debug: import pdb; pdb.set_trace() return False if equal(a, b): retu...
[ "numpy.abs", "os.path.realpath", "numpy.allclose", "hapiclient.hapi", "numpy.finfo", "pdb.set_trace", "numpy.array_equal", "numpy.issubdtype" ]
[((3791, 3845), 'hapiclient.hapi', 'hapi', (['server', 'dataset', 'parameters', 'start', 'stop'], {}), '(server, dataset, parameters, start, stop, **opts)\n', (3795, 3845), False, 'from hapiclient import hapi\n'), ((4064, 4118), 'hapiclient.hapi', 'hapi', (['server', 'dataset', 'parameters', 'start', 'stop'], {}), '(se...
import numpy as np import typing as tp import matplotlib.pyplot as plt from dgutils import compute_bounding_box import h5py import argparse import logging import os from pathlib import Path from scipy.signal import welch logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO")) logger = logging.getLogger(__nam...
[ "dgutils.compute_bounding_box", "matplotlib.pyplot.show", "scipy.signal.welch", "numpy.concatenate", "argparse.ArgumentParser", "matplotlib.pyplot.close", "numpy.asarray", "numpy.argsort", "os.environ.get", "pathlib.Path", "logging.info", "matplotlib.pyplot.subplots", "logging.getLogger" ]
[((297, 324), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (314, 324), False, 'import logging\n'), ((624, 663), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': '(2)', 'figsize': '(15, 10)'}), '(nrows=2, figsize=(15, 10))\n', (636, 663), True, 'import matplotlib.pyplot as pl...
import torch from torch.autograd import Variable from torchvision import models import cv2 import sys import numpy as np import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import dataset from prune import * import argparse from operator import itemgetter from heapq impo...
[ "torch.nn.Dropout", "argparse.ArgumentParser", "numpy.clip", "matplotlib.pyplot.figure", "torch.device", "matplotlib.pyplot.imshow", "torch.load", "matplotlib.pyplot.yticks", "dataset.eval_loader", "torch.nn.Linear", "torchvision.models.vgg16", "matplotlib.pyplot.xticks", "dataset.loader", ...
[((12813, 12838), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (12836, 12838), False, 'import argparse\n'), ((569, 598), 'torchvision.models.vgg16', 'models.vgg16', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (581, 598), False, 'from torchvision import models\n'), ((4315, 4341), 'd...
import sys import gym import numpy as np import gym.spaces import torch from io import StringIO from GenerateMap import GenerateMap class dqnEnvironment(gym.Env): metadata = {'render.modes': ['human', 'ansi']} MAP = np.loadtxt('../ProcessData/newmap.txt') line = len(MAP) observation_map = np.zeros(...
[ "gym.spaces.Discrete", "numpy.zeros", "numpy.loadtxt" ]
[((229, 268), 'numpy.loadtxt', 'np.loadtxt', (['"""../ProcessData/newmap.txt"""'], {}), "('../ProcessData/newmap.txt')\n", (239, 268), True, 'import numpy as np\n'), ((311, 346), 'numpy.zeros', 'np.zeros', (['(line, line)'], {'dtype': 'float'}), '((line, line), dtype=float)\n', (319, 346), True, 'import numpy as np\n')...
from bokeh.layouts import gridplot, column from bokeh.io import output_file, show from bokeh.plotting import figure from bokeh import palettes from bokeh.models import Spacer, CustomJS, DataRange1d, ColumnDataSource, \ LinearColorMapper, ColorBar, BasicTicker, Div, Tool, Column, HoverTool from bokeh.transform impor...
[ "bokeh.models.ColumnDataSource", "bokeh.plotting.figure", "bokeh.models.BasicTicker", "bokeh.models.Div", "scipy.cluster.hierarchy.linkage", "seaborn.load_dataset", "bokeh.models.Spacer", "bokeh.io.output_file", "bokeh.palettes.viridis", "numpy.array", "bokeh.transform.transform", "scipy.clust...
[((631, 652), 'bokeh.palettes.viridis', 'palettes.viridis', (['(256)'], {}), '(256)\n', (647, 652), False, 'from bokeh import palettes\n'), ((3178, 3231), 'scipy.cluster.hierarchy.linkage', 'hierarchy.linkage', (['df.values'], {'method': 'dendogram_method'}), '(df.values, method=dendogram_method)\n', (3195, 3231), Fals...
""" Test classes for the liwc module. """ import unittest import numpy as np from numpy.testing import assert_allclose from liwc_methods import LIWCScores class TestLIWCScores(unittest.TestCase): """ Tests for the LIWCScore class. """ def test_get_neuroticism(self): """ Test if the ...
[ "numpy.testing.assert_allclose", "numpy.array", "liwc_methods.LIWCScores" ]
[((452, 468), 'numpy.array', 'np.array', (['[0.18]'], {}), '([0.18])\n', (460, 468), True, 'import numpy as np\n'), ((573, 626), 'numpy.testing.assert_allclose', 'assert_allclose', (['expected', 'result'], {'rtol': '(1e-10)', 'atol': '(0)'}), '(expected, result, rtol=1e-10, atol=0)\n', (588, 626), False, 'from numpy.te...
import os #import random import imp import numpy as np from cheminfo import * from ase.db import connect def read_input(inputfile): """ Read the main input file. Whenever possible, parameters have defaults. """ global par f = open(os.path.expanduser('~/ml-kinbot/code/kinbot/de...
[ "imp.load_source", "ase.db.connect", "os.path.expanduser", "numpy.reshape" ]
[((347, 376), 'imp.load_source', 'imp.load_source', (['"""par"""', '""""""', 'f'], {}), "('par', '', f)\n", (362, 376), False, 'import imp\n'), ((430, 459), 'imp.load_source', 'imp.load_source', (['"""par"""', '""""""', 'f'], {}), "('par', '', f)\n", (445, 459), False, 'import imp\n'), ((900, 941), 'numpy.reshape', 'np...
from torch import nn import numpy as np import utils import excitability_modules as em class fc_layer(nn.Module): '''Fully connected layer, with possibility of returning "pre-activations". Input: [batch_size] x ... x [in_size] tensor Output: [batch_size] x ... x [out_size] tensor''' def __init__(s...
[ "torch.nn.Dropout", "torch.nn.ReLU", "torch.nn.BatchNorm1d", "utils.Identity", "torch.nn.Sigmoid", "excitability_modules.LinearExcitability", "numpy.repeat", "numpy.linspace", "torch.nn.Linear", "torch.nn.LeakyReLU", "torch.nn.Hardtanh" ]
[((347, 356), 'torch.nn.ReLU', 'nn.ReLU', ([], {}), '()\n', (354, 356), False, 'from torch import nn\n'), ((579, 713), 'excitability_modules.LinearExcitability', 'em.LinearExcitability', (['in_size', 'out_size'], {'bias': '(False if batch_norm else bias)', 'excitability': 'excitability', 'excit_buffer': 'excit_buffer'}...
# -*- coding: utf-8 -*- """ """ from __future__ import division, print_function, unicode_literals import pytest import numpy.testing as test from declarative import Bunch import phasor.electronics as electronics import phasor.readouts as readouts import phasor.system as system from phasor.electronics.models.PDAmp imp...
[ "numpy.testing.assert_almost_equal", "phasor.system.BGSystem", "phasor.electronics.models.PDAmp.PDTransimpedance" ]
[((425, 442), 'phasor.system.BGSystem', 'system.BGSystem', ([], {}), '()\n', (440, 442), True, 'import phasor.system as system\n'), ((460, 478), 'phasor.electronics.models.PDAmp.PDTransimpedance', 'PDTransimpedance', ([], {}), '()\n', (476, 478), False, 'from phasor.electronics.models.PDAmp import PDTransimpedance\n'),...
# -*- coding: utf-8 -*- """ Created on Fri Aug 31 17:04:47 2018 ------------------------------------------------------------------------------- =============================== VarNet Library ================================ ------------------------------------------------------------------------------- Author...
[ "matplotlib.pyplot.title", "pickle.dump", "numpy.sum", "numpy.abs", "matplotlib.pyplot.clf", "UtilityFunc.UF", "numpy.ones", "matplotlib.pyplot.figure", "pickle.load", "numpy.arange", "numpy.tile", "os.path.join", "numpy.prod", "FiniteElement.FE", "matplotlib.pyplot.axvline", "os.path....
[((1570, 1574), 'UtilityFunc.UF', 'UF', ([], {}), '()\n', (1572, 1574), False, 'from UtilityFunc import UF\n'), ((4352, 4380), 'numpy.zeros', 'np.zeros', (['seqLen'], {'dtype': 'bool'}), '(seqLen, dtype=bool)\n', (4360, 4380), True, 'import numpy as np\n'), ((4432, 4459), 'numpy.tile', 'np.tile', (['tDiscIND'], {'reps'...
import numpy as np from src.display_consts import DisplayConsts # pieces are encoded as # 0 - line, 1 - square, 2 - T(flip), 3 - |__, 4 - __|, 5 - -|_,6 - _|- PIECE_NAMES = ['line', 'square', 'T(flip)', '|__', '__|', '-|_', '_|-'] def name_piece(piece: int) -> str: return PIECE_NAMES[piece] # in RGB original_...
[ "src.display_consts.DisplayConsts", "numpy.zeros" ]
[((329, 353), 'numpy.zeros', 'np.zeros', (['(7, 3)', 'np.int'], {}), '((7, 3), np.int)\n', (337, 353), True, 'import numpy as np\n'), ((653, 677), 'numpy.zeros', 'np.zeros', (['(7, 3)', 'np.int'], {}), '((7, 3), np.int)\n', (661, 677), True, 'import numpy as np\n'), ((968, 1021), 'src.display_consts.DisplayConsts', 'Di...
""" Massively univariate analysis of face vs house recognition ========================================================== A permuted Ordinary Least Squares algorithm is run at each voxel in order to detemine whether or not it behaves differently under a "face viewing" condition and a "house viewing" condition. We cons...
[ "numpy.abs", "numpy.empty", "numpy.isnan", "numpy.recfromtxt", "matplotlib.pyplot.figure", "numpy.round", "numpy.unique", "nilearn.image.mean_img", "scipy.linalg.inv", "nilearn.input_data.NiftiMasker", "numpy.loadtxt", "numpy.log10", "matplotlib.pyplot.show", "nilearn._utils.fixes.f_regres...
[((1466, 1495), 'nilearn.datasets.fetch_haxby_simple', 'datasets.fetch_haxby_simple', ([], {}), '()\n', (1493, 1495), False, 'from nilearn import datasets\n'), ((1815, 1890), 'nilearn.input_data.NiftiMasker', 'NiftiMasker', ([], {'mask_img': 'mask_filename', 'memory': '"""nilearn_cache"""', 'memory_level': '(1)'}), "(m...
import os import logging import yaml import numpy as np import unittest import irrad_spectroscopy.spectroscopy as sp from irrad_spectroscopy.spec_utils import get_measurement_time, source_to_dict, select_peaks from irrad_spectroscopy.physics import decay_law from irrad_spectroscopy import testing_path, gamma_table te...
[ "irrad_spectroscopy.spectroscopy.fit_spectrum", "irrad_spectroscopy.spectroscopy.do_efficiency_calibration", "unittest.TextTestRunner", "logging.basicConfig", "irrad_spectroscopy.spec_utils.source_to_dict", "irrad_spectroscopy.spectroscopy.get_activity", "numpy.isclose", "yaml.safe_load", "irrad_spe...
[((335, 374), 'os.path.join', 'os.path.join', (['testing_path', '"""test_data"""'], {}), "(testing_path, 'test_data')\n", (347, 374), False, 'import os\n'), ((13018, 13152), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s - %(name)s - [%(levelname)-8s] (%(threadNam...
import tarfile import numpy as np from tqdm import tqdm from .embedding import Embedding def ngrams(sentence, n): """ Returns: list: a list of lists of words corresponding to the ngrams in the sentence. """ return [sentence[i:i+n] for i in range(len(sentence)-n+1)] class KazumaCharEmbedding(...
[ "tqdm.tqdm", "numpy.zeros", "time.time", "numpy.array", "tarfile.open" ]
[((1096, 1134), 'numpy.zeros', 'np.zeros', (['self.d_emb'], {'dtype': 'np.float32'}), '(self.d_emb, dtype=np.float32)\n', (1104, 1134), True, 'import numpy as np\n'), ((2668, 2674), 'time.time', 'time', ([], {}), '()\n', (2672, 2674), False, 'from time import time\n'), ((1693, 1723), 'tarfile.open', 'tarfile.open', (['...
import sys import numpy as np import tensorflow as tf import tf_slim as slim if sys.version_info.major == 3: xrange = range def im2uint8(x): if x.__class__ == tf.Tensor: return tf.cast(tf.clip_by_value(x, 0.0, 1.0) * 255.0, tf.uint8) else: t = np.clip(x, 0.0, 1.0) * 255.0 return t...
[ "tensorflow.clip_by_value", "tensorflow.variable_scope", "tf_slim.conv2d", "numpy.clip" ]
[((393, 417), 'tensorflow.variable_scope', 'tf.variable_scope', (['scope'], {}), '(scope)\n', (410, 417), True, 'import tensorflow as tf\n'), ((433, 483), 'tf_slim.conv2d', 'slim.conv2d', (['x', 'dim', '[ksize, ksize]'], {'scope': '"""conv1"""'}), "(x, dim, [ksize, ksize], scope='conv1')\n", (444, 483), True, 'import t...
# Copyright (c) 1996-2015 PSERC. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Solves combined unit decommitment / optimal power flow. """ from time import time from copy import deepcopy from numpy import flatnonzero as find from pypow...
[ "copy.deepcopy", "pypower.totcost.totcost", "pypower.opf.opf", "pypower.ppoption.ppoption", "pypower.fairmax.fairmax", "numpy.flatnonzero", "pypower.isload.isload", "time.time", "pypower.opf_args.opf_args2" ]
[((1568, 1574), 'time.time', 'time', ([], {}), '()\n', (1572, 1574), False, 'from time import time\n'), ((1671, 1687), 'pypower.opf_args.opf_args2', 'opf_args2', (['*args'], {}), '(*args)\n', (1680, 1687), False, 'from pypower.opf_args import opf_args2\n'), ((3006, 3021), 'pypower.opf.opf', 'opf', (['ppc', 'ppopt'], {}...
import torch import os import cv2 import argparse import kernel import random import diffjpeg from degradations import random_add_gaussian_noise_pt, random_add_poisson_noise_pt import numpy as np from img_process_util import filter2D,USMSharp import yaml from collections import OrderedDict from torch.nn import function...
[ "diffjpeg.DiffJPEG", "random.choices", "torch.device", "torch.no_grad", "os.path.join", "img_process_util.filter2D", "numpy.transpose", "tqdm.tqdm", "yaml.Loader.add_constructor", "torch.clamp", "kernel.kernel", "os.listdir", "numpy.random.uniform", "degradations.random_add_gaussian_noise_...
[((1121, 1143), 'torch.device', 'torch.device', (['"""cuda:0"""'], {}), "('cuda:0')\n", (1133, 1143), False, 'import torch\n'), ((1221, 1242), 'os.listdir', 'os.listdir', (['file_path'], {}), '(file_path)\n', (1231, 1242), False, 'import os\n'), ((1333, 1351), 'kernel.kernel', 'kernel.kernel', (['opt'], {}), '(opt)\n',...
#!/usr/bin/python3 import matplotlib.pyplot as plt import numpy as np from matplotlib import colors, cm from matplotlib.ticker import PercentFormatter import pathlib, json, glob, os from numpy.lib.function_base import append from scipy import stats, fft from scipy.fftpack import fftfreq import scipy import random impo...
[ "json.load", "matplotlib.pyplot.show", "numpy.median", "numpy.percentile", "pathlib.Path", "glob.glob", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((4406, 4456), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {'sharey': '(True)', 'tight_layout': '(True)'}), '(1, 1, sharey=True, tight_layout=True)\n', (4418, 4456), True, 'import matplotlib.pyplot as plt\n'), ((5502, 5581), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {'sharey': '...
import numpy as np import math from transforms3d.quaternions import quat2mat, mat2quat get_statis = lambda arr: 'Size={} Min={:.2f} Max={:.2f} Mean={:.2f} Median={:.2f}'.format( arr.shape, np.min(arr), np.max(arr), np.mean(arr), np.median(arr)) ''' Epipolar geometry functionals''' skew...
[ "numpy.sum", "numpy.abs", "numpy.multiply", "numpy.median", "numpy.ones", "numpy.clip", "numpy.expand_dims", "numpy.isnan", "numpy.min", "numpy.max", "numpy.array", "numpy.mean", "numpy.linalg.inv", "numpy.linalg.norm", "numpy.dot", "numpy.arccos", "numpy.concatenate", "numpy.sqrt"...
[((333, 397), 'numpy.array', 'np.array', (['[[0, -v[2], v[1]], [v[2], 0, -v[0]], [-v[1], v[0], 0]]'], {}), '([[0, -v[2], v[1]], [v[2], 0, -v[0]], [-v[1], v[0], 0]])\n', (341, 397), True, 'import numpy as np\n'), ((1345, 1385), 'numpy.concatenate', 'np.concatenate', (['[arr2d, ones]'], {'axis': 'axis'}), '([arr2d, ones]...
import numpy as np import pandas as pd from scipy.stats import pearsonr from scipy.stats import norm def bracketing(arr, border_size=1, range=None): """ A simplified measure of 'U-shapeness'. Negative values imply inverted U. Mean values at center subtracted from mean border values. Parameters ---...
[ "pandas.DataFrame", "scipy.stats.norm.ppf", "numpy.isin", "numpy.logical_and", "scipy.stats.pearsonr", "numpy.arange", "numpy.bincount" ]
[((3623, 3673), 'scipy.stats.pearsonr', 'pearsonr', (['firing_rate[use_times]', 'times[use_times]'], {}), '(firing_rate[use_times], times[use_times])\n', (3631, 3673), False, 'from scipy.stats import pearsonr\n'), ((3522, 3572), 'numpy.logical_and', 'np.logical_and', (['(times > range[0])', '(times < range[1])'], {}), ...
from scipy.special import jacobi from numpy.polynomial.legendre import leggauss from jax.lax import switch from optimism.JaxConfig import * QuadratureRule = namedtuple('QuadratureRule', ['xigauss', 'wgauss']) def len(quadRule): return quadRule.xigauss.shape[0] def create_quadrature_rule_1D(degree): n = np....
[ "scipy.special.jacobi", "numpy.polynomial.legendre.leggauss", "jax.lax.switch" ]
[((359, 374), 'scipy.special.jacobi', 'jacobi', (['n', '(0)', '(0)'], {}), '(n, 0, 0)\n', (365, 374), False, 'from scipy.special import jacobi\n'), ((858, 869), 'numpy.polynomial.legendre.leggauss', 'leggauss', (['n'], {}), '(n)\n', (866, 869), False, 'from numpy.polynomial.legendre import leggauss\n'), ((5424, 5548), ...
# Copyright (c) 2017 Microsoft Corporation. # # 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, modify, merge, publis...
[ "tkinter.ttk.Label", "PIL.ImageTk.PhotoImage", "tkinter.Canvas", "six.moves.range", "malmopy.agent.RandomAgent", "time.time", "numpy.mean", "collections.namedtuple", "sys.exit" ]
[((3192, 3258), 'collections.namedtuple', 'namedtuple', (['"""Neighbour"""', "['cost', 'x', 'z', 'direction', 'action']"], {}), "('Neighbour', ['cost', 'x', 'z', 'direction', 'action'])\n", (3202, 3258), False, 'from collections import namedtuple\n'), ((5468, 5476), 'six.moves.range', 'range', (['(4)'], {}), '(4)\n', (...
import torch import torch.nn as nn import torch.optim as optim import os import math import numpy as np from tqdm import tqdm import matplotlib.pyplot as plt from data_loader import * class double_conv(nn.Module): """(conv => BN => ReLU) * 2""" def __init__(self, in_ch, out_ch): super(double_conv, s...
[ "matplotlib.pyplot.title", "torch.cat", "numpy.arange", "torch.nn.Softmax", "torch.no_grad", "torch.flatten", "torch.squeeze", "torch.nn.Linear", "tqdm.tqdm", "torch.nn.BCEWithLogitsLoss", "matplotlib.pyplot.show", "math.sqrt", "matplotlib.pyplot.legend", "torch.nn.Conv2d", "torch.nn.Bat...
[((1829, 1902), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_planes', 'out_planes'], {'kernel_size': '(3)', 'stride': 'stride', 'padding': '(1)'}), '(in_planes, out_planes, kernel_size=3, stride=stride, padding=1)\n', (1838, 1902), True, 'import torch.nn as nn\n'), ((1987, 2061), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_planes',...
from solvation_predictor import inp from solvation_predictor.train.train import create_logger, load_checkpoint, load_scaler, load_input from solvation_predictor.data.data import DatapointList, read_data from solvation_predictor.train.evaluate import predict import csv import os import matplotlib.pyplot as plt import nu...
[ "solvation_predictor.train.evaluate.predict", "solvation_predictor.train.train.load_checkpoint", "numpy.abs", "csv.writer", "os.path.join", "solvation_predictor.train.train.load_scaler", "numpy.subtract", "sklearn.metrics.mean_absolute_error", "solvation_predictor.train.train.load_input", "solvati...
[((448, 468), 'solvation_predictor.inp.InputArguments', 'inp.InputArguments', ([], {}), '()\n', (466, 468), False, 'from solvation_predictor import inp\n'), ((484, 524), 'solvation_predictor.train.train.create_logger', 'create_logger', (['"""predict"""', 'inp.output_dir'], {}), "('predict', inp.output_dir)\n", (497, 52...
#!/usr/bin/env python3 """ This is the official implementation for the DOVER-Lap algorithm. It combines overlap-aware diarization hypotheses to produce an output RTTM. <NAME>., <NAME>., <NAME>., <NAME>., <NAME>., <NAME>., & <NAME>. DOVER-Lap: A Method for Combining Overlap-aware Diarization Outputs. IEEE Spoken ...
[ "numpy.random.seed", "dover_lap.libs.utils.info", "random.shuffle", "click.option", "dover_lap.src.doverlap.DOVERLap.combine_turns_list", "dover_lap.libs.utils.command_required_option", "click.Choice", "dover_lap.libs.turn.merge_turns", "dover_lap.libs.turn.trim_turns", "dover_lap.libs.utils.error...
[((1516, 1637), 'click.option', 'click.option', (['"""-c"""', '"""--channel"""'], {'type': 'int', 'default': '(1)', 'show_default': '(True)', 'help': '"""Use this value for output channel IDs"""'}), "('-c', '--channel', type=int, default=1, show_default=True,\n help='Use this value for output channel IDs')\n", (1528...
import torch import torch.nn.functional as F import numpy as np import matplotlib.pyplot as plt import seaborn as sns from statistics import mean from sklearn.metrics import roc_auc_score import logging logging.basicConfig(format='%(asctime)s : %(levelname)s - %(message)s', datefmt='%d/%m/%Y %I:...
[ "torch.multinomial", "torch.randn", "matplotlib.pyplot.fill_between", "seaborn.set", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "torch.logical_or", "sklearn.metrics.roc_auc_score", "torch.sort", "torch.from_numpy", "matplotlib.pyplot.xlim", "logging.basicConfig", "matplotlib.pyplot....
[((207, 334), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s : %(levelname)s - %(message)s"""', 'datefmt': '"""%d/%m/%Y %I:%M:%S %p"""', 'level': 'logging.INFO'}), "(format='%(asctime)s : %(levelname)s - %(message)s',\n datefmt='%d/%m/%Y %I:%M:%S %p', level=logging.INFO)\n", (226, 334)...
""" This script assumes that a subdir with name {n_parties} exists in /models with the model files stored here. The number of model files should equal the value of {n_parties} + 1. It kicks off a server for each answering party and a single client who will be requesting queries. client.py holds the clients training pro...
[ "atexit.register", "os.remove", "numpy.save", "libtmux.Server", "argparse.ArgumentParser", "utils.time_utils.log_timing", "warnings.filterwarnings", "numpy.random.seed", "utils.remove_files.remove_files_by_name", "getpass.getuser", "utils.time_utils.get_timestamp", "os.path.exists", "get_r_s...
[((800, 833), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (823, 833), False, 'import warnings\n'), ((859, 921), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (8...
import cv2 import numpy as np from collections import deque import itertools ___author___ = "<NAME>" class MedianFlow(object): TRACKING_LENGTH = 3 def __init__(self, elimination_amount=.6, winSize=(15, 15), maxLevel=2): self.prev_points = None self.prev_frame = None self.lk_params = d...
[ "numpy.subtract", "numpy.median", "itertools.permutations", "numpy.argsort", "numpy.linalg.norm", "numpy.array", "numpy.linspace", "cv2.calcOpticalFlowPyrLK", "itertools.product", "cv2.mean", "collections.deque" ]
[((473, 480), 'collections.deque', 'deque', ([], {}), '()\n', (478, 480), False, 'from collections import deque\n'), ((512, 519), 'collections.deque', 'deque', ([], {}), '()\n', (517, 519), False, 'from collections import deque\n'), ((541, 548), 'collections.deque', 'deque', ([], {}), '()\n', (546, 548), False, 'from c...
import cv2 import numpy as np class detector: def __init__(self): self.net = cv2.dnn.readNet("yolov3-tiny-obj_9000327.weights", "yolov3-tiny-obj326.cfg") self.classes = [] with open("obj.names.txt", "r") as f: self.classes = [line.strip() for line in f.readlines()] layer...
[ "cv2.dnn.blobFromImage", "numpy.argmax", "cv2.dnn.readNet" ]
[((89, 165), 'cv2.dnn.readNet', 'cv2.dnn.readNet', (['"""yolov3-tiny-obj_9000327.weights"""', '"""yolov3-tiny-obj326.cfg"""'], {}), "('yolov3-tiny-obj_9000327.weights', 'yolov3-tiny-obj326.cfg')\n", (104, 165), False, 'import cv2\n'), ((642, 716), 'cv2.dnn.blobFromImage', 'cv2.dnn.blobFromImage', (['img', '(0.003)', '(...
import matplotlib.pyplot as plt import numpy as np x = np.linspace(0,2*np.pi,100) y = np.sin(x) ax = plt.subplot(1,1,1) ax.spines['bottom'].set_linewidth(5) plt.plot(x,y,'r') plt.show()
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.sin", "numpy.linspace" ]
[((56, 86), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(100)'], {}), '(0, 2 * np.pi, 100)\n', (67, 86), True, 'import numpy as np\n'), ((87, 96), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (93, 96), True, 'import numpy as np\n'), ((103, 123), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(1)', '(1)', ...
""" This module is a wrapper for csv input reader It returns data which read from csv file as NumPy Array """ import pandas as pd import numpy as np def read_csv_input(file_name): # Read data from file df = pd.read_csv(file_name, sep=',',header=None) # encode all input types to interger so that it is in a...
[ "pandas.read_csv", "numpy.zeros", "numpy.where", "numpy.array", "numpy.unique" ]
[((216, 260), 'pandas.read_csv', 'pd.read_csv', (['file_name'], {'sep': '""","""', 'header': 'None'}), "(file_name, sep=',', header=None)\n", (227, 260), True, 'import pandas as pd\n'), ((549, 583), 'numpy.zeros', 'np.zeros', (['(num_data, num_features)'], {}), '((num_data, num_features))\n', (557, 583), True, 'import ...
# This material was prepared as an account of work sponsored by an agency of the # United States Government. Neither the United States Government nor the United # States Department of Energy, nor Battelle, nor any of their employees, nor any # jurisdiction or organization that has cooperated in the development of thes...
[ "exarl.utils.candleDriver.lookup_params", "time.time", "exarl.ExaLearner", "numpy.float64", "exarl.utils.analyze_reward.save_reward_plot" ]
[((1616, 1632), 'exarl.ExaLearner', 'erl.ExaLearner', ([], {}), '()\n', (1630, 1632), True, 'import exarl as erl\n'), ((1730, 1763), 'exarl.utils.candleDriver.lookup_params', 'lookup_params', (['"""introspector_dir"""'], {}), "('introspector_dir')\n", (1743, 1763), False, 'from exarl.utils.candleDriver import lookup_pa...
import numpy as np def to_array(value, types=None): """Converts value to a list of values while checking the type of value. Parameters ---------- value : The value to convert from. types : class or tuple of class, optional Value types which are allowed to be. Defaults t...
[ "numpy.atleast_1d" ]
[((463, 483), 'numpy.atleast_1d', 'np.atleast_1d', (['value'], {}), '(value)\n', (476, 483), True, 'import numpy as np\n')]
from builtins import range from future.utils import iteritems import warnings import numpy as np import scipy.ndimage as nd from collections import OrderedDict from peri import util, interpolation from peri.comp import psfs, psfcalc from peri.fft import fft, fftkwargs def moment(p, v, order=1): """ Calculates t...
[ "numpy.abs", "numpy.polyfit", "numpy.clip", "numpy.isnan", "peri.util.Tile", "numpy.exp", "peri.comp.psfcalc.vec_to_halfvec", "builtins.range", "numpy.pad", "numpy.fft.ifftshift", "numpy.zeros_like", "numpy.polyval", "peri.util.amax", "peri.comp.psfcalc.wrap_and_calc_psf", "future.utils....
[((6462, 6540), 'numpy.array', 'np.array', (['[kfki, zslab, zscale, alpha, n2n1, laser_wavelength, sigkf, sph6_ab]'], {}), '([kfki, zslab, zscale, alpha, n2n1, laser_wavelength, sigkf, sph6_ab])\n', (6470, 6540), True, 'import numpy as np\n'), ((9244, 9282), 'numpy.array', 'np.array', (['[zoffset * (zint > 0), 0, 0]'],...
from VC.encoder.data_objects.speaker_verification_dataset import SpeakerVerificationDataset from datetime import datetime from time import perf_counter as timer import matplotlib.pyplot as plt import numpy as np # import webbrowser import visdom import umap colormap = np.array([ [76, 255, 0], [0, 12...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.clf", "numpy.std", "matplotlib.pyplot.scatter", "visdom.Visdom", "time.perf_counter", "umap.UMAP", "numpy.mean", "numpy.array", "numpy.arange", "matplotlib.pyplot.gca", "datetime.datetime.now", "matplotlib.pyplot.savefig" ]
[((279, 504), 'numpy.array', 'np.array', (['[[76, 255, 0], [0, 127, 70], [255, 0, 0], [255, 217, 38], [0, 135, 255], [\n 165, 0, 165], [255, 167, 255], [0, 255, 255], [255, 96, 38], [142, 76, \n 0], [33, 0, 127], [0, 0, 0], [183, 183, 183]]'], {'dtype': 'np.float'}), '([[76, 255, 0], [0, 127, 70], [255, 0, 0], [2...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ "tf_parameters.InputExample", "pickle.dump", "tensorflow.reduce_sum", "tokenization.printable_text", "tensorflow.logging.info", "modeling.BertModel", "tensorflow.trainable_variables", "random.shuffle", "tensorflow.train.Scaffold", "tensorflow.logging.set_verbosity", "tensorflow.matmul", "tenso...
[((7929, 8057), 'tf_parameters.InputFeatures', 'InputFeatures', ([], {'input_ids': 'input_ids', 'input_mask': 'input_mask', 'segment_ids': 'segment_ids', 'label_id': 'label_id', 'is_real_example': '(True)'}), '(input_ids=input_ids, input_mask=input_mask, segment_ids=\n segment_ids, label_id=label_id, is_real_example...
# ----------------------------------------------------------------------- # Copyright (c) 2020, NVIDIA Corporation. All rights reserved. # # This work is made available # under the Nvidia Source Code License (1-way Commercial). # # Official Implementation of the CVPR2020 Paper # Two-shot Spatially-varying BRDF and Shap...
[ "tensorflow.clip_by_value", "tensorflow.identity", "tensorflow.reshape", "tensorflow.zeros_like", "tensorpack.tfutils.gradproc.CheckGradient", "tensorflow.get_variable", "tensorflow.check_numerics", "tensorflow.abs", "tensorpack.tfutils.argscope.argscope", "tensorflow.losses.add_loss", "tensorfl...
[((2332, 2353), 'numpy.asarray', 'np.asarray', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (2342, 2353), True, 'import numpy as np\n'), ((2373, 2394), 'numpy.asarray', 'np.asarray', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (2383, 2394), True, 'import numpy as np\n'), ((2416, 2437), 'numpy.asarray', 'np.asarray', (['[1, 1, 1]'],...