code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
from mpi4py import MPI
from tacs import TACS, elements
import numpy as np
import sys
import matplotlib.pylab as plt
# Define an element in TACS using the pyElement feature
class SpringMassDamper(elements.pyElement):
def __init__(self, num_disps, num_nodes, m, c, k):
self.m = m
self.c = c
se... | [
"matplotlib.pylab.show",
"tacs.TACS.DIRKIntegrator",
"tacs.TACS.BDFIntegrator",
"numpy.sin",
"numpy.array",
"numpy.exp",
"numpy.fabs",
"tacs.TACS.Assembler.create",
"numpy.sqrt",
"numpy.arctan",
"matplotlib.pylab.loglog",
"matplotlib.pylab.figure"
] | [((1234, 1270), 'tacs.TACS.Assembler.create', 'TACS.Assembler.create', (['comm', '(1)', '(1)', '(1)'], {}), '(comm, 1, 1, 1)\n', (1255, 1270), False, 'from tacs import TACS, elements\n'), ((1282, 1313), 'numpy.array', 'np.array', (['[0, 1]'], {'dtype': 'np.intc'}), '([0, 1], dtype=np.intc)\n', (1290, 1313), True, 'impo... |
from datetime import datetime
from decimal import Decimal
import numpy as np
import pytest
import pytz
from pandas.compat import is_platform_little_endian
from pandas import CategoricalIndex, DataFrame, Index, Interval, RangeIndex, Series
import pandas._testing as tm
class TestFromRecords:
def test_from_record... | [
"pandas.Interval",
"numpy.core.records.fromarrays",
"numpy.isnan",
"numpy.random.randint",
"numpy.arange",
"pandas.DataFrame",
"pandas.RangeIndex",
"numpy.random.randn",
"pandas._testing.assert_series_equal",
"pytest.raises",
"pandas._testing.assert_index_equal",
"pandas.compat.is_platform_lit... | [((1010, 1042), 'pandas.DataFrame.from_records', 'DataFrame.from_records', (['recarray'], {}), '(recarray)\n', (1032, 1042), False, 'from pandas import CategoricalIndex, DataFrame, Index, Interval, RangeIndex, Series\n'), ((1051, 1090), 'pandas._testing.assert_frame_equal', 'tm.assert_frame_equal', (['result', 'expecte... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"tvm.relax.transform.LayoutRewrite",
"tvm.relax.transform.FuseOps",
"pytest.main",
"tvm.cuda",
"tvm.meta_schedule.integration.extract_task_from_relax",
"pytest.mark.parametrize",
"tempfile.TemporaryDirectory",
"tvm.cpu",
"tvm.meta_schedule.ReplayTraceConfig",
"tvm.relay.transform.SimplifyInference... | [((2600, 2639), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dev"""', "['cpu']"], {}), "('dev', ['cpu'])\n", (2623, 2639), False, 'import pytest\n'), ((2699, 2772), 'tvm.relay.testing.resnet.get_workload', 'testing.resnet.get_workload', ([], {'num_layers': '(18)', 'batch_size': '(1)', 'dtype': '"""float3... |
import numpy as np
import torch
import torch.nn as nn
class channel_selection(nn.Module):
"""
Select channels from the output of BatchNorm2d layer. It should be put directly after BatchNorm2d layer.
The output shape of this layer is determined by the number of 1 in `self.indexes`.
"""
def __init_... | [
"torch.ones",
"numpy.resize"
] | [((662, 686), 'torch.ones', 'torch.ones', (['num_channels'], {}), '(num_channels)\n', (672, 686), False, 'import torch\n'), ((1007, 1038), 'numpy.resize', 'np.resize', (['selected_index', '(1,)'], {}), '(selected_index, (1,))\n', (1016, 1038), True, 'import numpy as np\n')] |
# coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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 appl... | [
"tensorflow.io.gfile.listdir",
"tensorflow_datasets.public_api.features.ClassLabel",
"os.path.basename",
"tensorflow_datasets.public_api.core.lazy_imports.PIL_Image.open",
"tensorflow_datasets.public_api.features.Text",
"tensorflow_datasets.public_api.features.Image",
"tensorflow_datasets.public_api.cor... | [((8417, 8446), 'tensorflow.io.gfile.glob', 'tf.io.gfile.glob', (["(path + '/*')"], {}), "(path + '/*')\n", (8433, 8446), True, 'import tensorflow as tf\n'), ((7267, 7439), 'tensorflow_datasets.public_api.core.DatasetInfo', 'tfds.core.DatasetInfo', ([], {'builder': 'self', 'description': '_DESCRIPTION', 'features': 'fe... |
from abc import abstractmethod
from typing import Tuple
import numpy as np
from gym_gathering.rewards.base_reward_generator import (
RewardGenerator,
StepInformationProvider,
)
class TimePenaltyReward(RewardGenerator):
def __init__(
self, information_provider: StepInformationProvider = None, sca... | [
"numpy.linspace"
] | [((4565, 4627), 'numpy.linspace', 'np.linspace', (['self.min_reward', 'self.max_reward', 'self.n_subgoals'], {}), '(self.min_reward, self.max_reward, self.n_subgoals)\n', (4576, 4627), True, 'import numpy as np\n'), ((5379, 5483), 'numpy.linspace', 'np.linspace', (['(2 * self.calculator.goal_range)', '(0.95 * self.calc... |
import numpy as np
def gaonkar(X, y, rcond=1e-3):
"""Gaonkar 2013 procedure
Parameters
-----------
X : ndarray or scipy.sparse matrix, (n_samples, n_features)
Data
y : ndarray, shape (n_samples,) or (n_samples, n_targets)
Target. Will be cast to X's dtype if necessary
rcond : ... | [
"numpy.size",
"numpy.sum",
"numpy.asarray",
"numpy.linalg.svd",
"numpy.dot",
"numpy.diag"
] | [((572, 585), 'numpy.asarray', 'np.asarray', (['X'], {}), '(X)\n', (582, 585), True, 'import numpy as np\n'), ((690, 699), 'numpy.sum', 'np.sum', (['K'], {}), '(K)\n', (696, 699), True, 'import numpy as np\n'), ((774, 792), 'numpy.dot', 'np.dot', (['X.T', '(K + L)'], {}), '(X.T, K + L)\n', (780, 792), True, 'import num... |
"""
Test various functions regarding chapter 4: Sampling (Bootstrapping, Concurrency).
"""
import os
import unittest
import numpy as np
import pandas as pd
from sklearn.metrics import precision_score, roc_auc_score, accuracy_score, mean_absolute_error, \
mean_squared_error
from sklearn.model_selection import tra... | [
"mlfinlab.labeling.labeling.add_vertical_barrier",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"numpy.ones",
"sklearn.metrics.mean_absolute_error",
"mlfinlab.ensemble.sb_bagging.SequentiallyBootstrappedBaggingRegressor",
"numpy.mean",
"mlfinlab.fi... | [((984, 1008), 'numpy.random.RandomState', 'np.random.RandomState', (['(1)'], {}), '(1)\n', (1005, 1008), True, 'import numpy as np\n'), ((1561, 1598), 'mlfinlab.sampling.bootstrapping.get_ind_mat_label_uniqueness', 'get_ind_mat_label_uniqueness', (['ind_mat'], {}), '(ind_mat)\n', (1589, 1598), False, 'from mlfinlab.sa... |
import keras
import numpy as np
import schafkopf.players.data.encodings as enc
from schafkopf.game_modes import GAME_MODES, PARTNER_MODE, SOLO, WENZ
from schafkopf.players.data.data_processing import switch_suits_played_cards, switch_card_suit
from schafkopf.players.player import Player
from schafkopf.suits import ACO... | [
"keras.models.load_model",
"schafkopf.players.data.data_processing.switch_suits_played_cards",
"schafkopf.players.data.data_processing.switch_card_suit",
"schafkopf.players.data.encodings.decode_mode_index",
"numpy.argmax",
"schafkopf.players.data.encodings.encode_played_cards",
"numpy.array",
"schafk... | [((497, 529), 'schafkopf.players.player.Player.__init__', 'Player.__init__', (['self'], {'name': 'name'}), '(self, name=name)\n', (512, 529), False, 'from schafkopf.players.player import Player\n'), ((1172, 1206), 'schafkopf.players.data.encodings.encode_one_hot_hand', 'enc.encode_one_hot_hand', (['self.hand'], {}), '(... |
# Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... | [
"alphafold.model.model.RunModel",
"alphafold.data.templates.HmmsearchHitFeaturizer",
"pickle.dump",
"multiprocessing.set_start_method",
"alphafold.data.pipeline_multimer.DataPipeline",
"json.dumps",
"absl.logging.info",
"os.path.isfile",
"alphafold.model.data.get_model_haiku_params",
"pathlib.Path... | [((1628, 1639), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1637, 1639), False, 'import os\n'), ((1995, 2051), 'os.path.join', 'os.path.join', (['DOWNLOAD_DIR', '"""uniref90"""', '"""uniref90.fasta"""'], {}), "(DOWNLOAD_DIR, 'uniref90', 'uniref90.fasta')\n", (2007, 2051), False, 'import os\n'), ((2133, 2188), 'os.path... |
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from sklearn.model_selection import train_test_split
import unicodedata
import re
import numpy as np
import os
import io
import time
# Converts the unicode file to ascii
def unicode_to_ascii(s):
return ''.join(c for c in unico... | [
"tensorflow.reduce_sum",
"tensorflow.keras.layers.Dense",
"sklearn.model_selection.train_test_split",
"tensorflow.reshape",
"json.dumps",
"os.path.join",
"urllib.parse.urlparse",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.preprocessing.text.Tokenizer",
"tensorflow.n... | [((2812, 2872), 'sklearn.model_selection.train_test_split', 'train_test_split', (['input_tensor', 'target_tensor'], {'test_size': '(0.1)'}), '(input_tensor, target_tensor, test_size=0.1)\n', (2828, 2872), False, 'from sklearn.model_selection import train_test_split\n'), ((7781, 7807), 'tensorflow.keras.optimizers.Adam'... |
"""
ppTSM InferModel
"""
import sys
import numpy as np
import time
sys.path.append('../')
from utils.preprocess import get_images
from utils.config_utils import parse_config
import reader
from paddle.inference import Config
from paddle.inference import create_predictor
class InferModel(object):
"""pptsm infer""... | [
"sys.path.append",
"reader.get_reader",
"utils.preprocess.get_images",
"paddle.inference.create_predictor",
"time.time",
"utils.config_utils.parse_config",
"numpy.array",
"numpy.squeeze",
"paddle.inference.Config",
"numpy.vstack"
] | [((68, 90), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (83, 90), False, 'import sys\n'), ((2020, 2042), 'utils.config_utils.parse_config', 'parse_config', (['cfg_file'], {}), '(cfg_file)\n', (2032, 2042), False, 'from utils.config_utils import parse_config\n'), ((2181, 2202), 'utils.preproc... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 8 14:45:53 2016
Similar to program.py except made specifically for use with Julia and Bayes Nets,
as well as the machine learning
run with:
$ nohup python3 -u program.py | ts | tee ./<logfile>
Change the model in run() function
@author: LordPhillips
"""
import numpy a... | [
"sklearn.externals.joblib.dump",
"random.shuffle",
"lib.data_util.augOrigData",
"os.walk",
"tensorflow.logging.set_verbosity",
"collections.defaultdict",
"lib.data_util.normalize_wrapper",
"sklearn.svm.SVC",
"tensorflow.contrib.learn.infer_real_valued_columns_from_input",
"shutil.rmtree",
"lib.s... | [((1245, 1286), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.INFO'], {}), '(tf.logging.INFO)\n', (1269, 1286), True, 'import tensorflow as tf\n'), ((2023, 2054), 'numpy.array_split', 'np.array_split', (['fids', 'numSplits'], {}), '(fids, numSplits)\n', (2037, 2054), True, 'import numpy ... |
from configparser import ConfigParser
from math import sqrt
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal, assert_array_equal
from ef.external_field_expression import ExternalFieldExpression
from ef.external_field_uniform import ExternalFieldUniform
from ef.field.solvers.field_s... | [
"ef.particle_interaction_model.ParticleInteractionModel",
"math.sqrt",
"ef.config.config.Config.from_configparser",
"ef.particle_array.ParticleArray",
"numpy.zeros",
"ef.external_field_expression.ExternalFieldExpression",
"ef.config.config.Config",
"numpy.array",
"pytest.mark.parametrize",
"config... | [((4883, 4952), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""model"""', "['noninteracting', 'PIC', 'binary']"], {}), "('model', ['noninteracting', 'PIC', 'binary'])\n", (4906, 4952), False, 'import pytest\n'), ((5370, 5439), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""model"""', "['nonint... |
"""
File: mixup
Description: Contains functions for mixup using OT
Author <NAME> <<EMAIL>>
License: Mit License
"""
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import pandas as pd
from ot.ot1d import *
def sample_mixup_param(n,alpha=0.75):
"""
Sample X from a beta distribution with ... | [
"numpy.random.beta",
"numpy.max",
"numpy.concatenate"
] | [((600, 641), 'numpy.random.beta', 'np.random.beta', (['alpha', 'alpha'], {'size': '[n, 1]'}), '(alpha, alpha, size=[n, 1])\n', (614, 641), True, 'import numpy as np\n'), ((684, 732), 'numpy.concatenate', 'np.concatenate', (['(l_sample, 1 - l_sample)'], {'axis': '(1)'}), '((l_sample, 1 - l_sample), axis=1)\n', (698, 73... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"unittest.main",
"numpy.random.uniform",
"numpy.log",
"paddle.fluid.layers.sigmoid_cross_entropy_with_logits",
"paddle.enable_static",
"paddle.fluid.layers.data",
"scipy.special.expit",
"numpy.where",
"numpy.random.randint",
"numpy.array",
"paddle.fluid.CPUPlace",
"paddle.fluid.Program"
] | [((11481, 11503), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (11501, 11503), False, 'import paddle\n'), ((11508, 11523), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11521, 11523), False, 'import unittest\n'), ((1901, 1924), 'scipy.special.expit', 'expit', (["self.inputs['X']"], {}), "(se... |
#!/usr/bin/env python3
import optax
import tensorflow as tf
import deepfnf_utils.utils as ut
import deepfnf_utils.tf_utils as tfu
from deepfnf_utils.dataset import Dataset
import jax
from cvgutils.nn import jaxutils
from jaxopt import implicit_diff, OptaxSolver, linear_solve
import argparse
import jax.numpy as jnp
imp... | [
"optax.adam",
"argparse.ArgumentParser",
"jax.random.PRNGKey",
"cvgutils.nn.jaxutils.UNet",
"jax.jvp",
"deepfnf_utils.tf_utils.add_read_shot_noise_jax",
"jax.numpy.abs",
"jax.tree_util.tree_flatten",
"jax.config.config.update",
"jax.numpy.pad",
"jax.numpy.concatenate",
"cvgutils.nn.jaxutils.St... | [((503, 540), 'jax.config.config.update', 'config.update', (['"""jax_debug_nans"""', '(True)'], {}), "('jax_debug_nans', True)\n", (516, 540), False, 'from jax.config import config\n'), ((729, 780), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {... |
import numpy as np
from scipy.integrate import quad
from scipy.io import loadmat
import pylab as plt
import time
from openmdao.api import Component, Problem, Group
from _porteagel_fortran import porteagel_analyze as porteagel_analyze_fortran
from _porteagel_fortran import porteagel_analyze_bv, porteagel_analyze_dv
fr... | [
"_porteagel_fortran.x0_func",
"numpy.ones",
"numpy.clip",
"numpy.argsort",
"pylab.subplots",
"numpy.arange",
"openmdao.api.Group",
"numpy.copy",
"numpy.power",
"pylab.ylabel",
"numpy.linspace",
"pylab.xlabel",
"pylab.legend",
"openmdao.api.Problem",
"numpy.ones_like",
"_porteagel_fortr... | [((1017, 1064), '_porteagel_fortran.x0_func', 'x0_func', (['rotorDiameter', 'yaw', 'Ct', 'alpha', 'I', 'beta'], {}), '(rotorDiameter, yaw, Ct, alpha, I, beta)\n', (1024, 1064), False, 'from _porteagel_fortran import theta_c_0_func, x0_func, sigmay_func, sigmaz_func, wake_offset_func\n'), ((1082, 1105), '_porteagel_fort... |
# Copyright 2017 Google 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 wri... | [
"copy.deepcopy",
"numpy.ones_like",
"numpy.nan_to_num",
"numpy.allclose",
"autograd.grad",
"tangent.autodiff",
"tangent.init_grad",
"numpy.array",
"numpy.dot",
"autograd.value_and_grad"
] | [((1102, 1172), 'tangent.autodiff', 'tangent.autodiff', (['func'], {'mode': '"""forward"""', 'preserve_result': '(False)', 'wrt': 'wrt'}), "(func, mode='forward', preserve_result=False, wrt=wrt)\n", (1118, 1172), False, 'import tangent\n'), ((3048, 3063), 'numpy.ones_like', 'np.ones_like', (['y'], {}), '(y)\n', (3060, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 22 11:39:43 2018
Demonstration of 3D CPU regularisers
@authors: <NAME>, <NAME>
"""
import matplotlib.pyplot as plt
import numpy as np
import os
import timeit
from ccpi.filters.regularisers import ROF_TV, FGP_TV, SB_TV, LLT_ROF, FGP_dTV, NDF, DIFF... | [
"ccpi.filters.regularisers.LLT_ROF",
"ccpi.filters.regularisers.FGP_TV",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.imshow",
"numpy.asarray",
"timeit.default_timer",
"numpy.zeros",
"qualitymetrics.rmse",
"ccpi.filters.regularisers.DIFF4th",
"ccpi.filters.regularisers.FGP_dTV",
"numpy.shape... | [((1033, 1092), 'os.path.join', 'os.path.join', (['""".."""', '""".."""', '""".."""', '"""data"""', '"""lena_gray_512.tif"""'], {}), "('..', '..', '..', 'data', 'lena_gray_512.tif')\n", (1045, 1092), False, 'import os\n'), ((1115, 1135), 'matplotlib.pyplot.imread', 'plt.imread', (['filename'], {}), '(filename)\n', (112... |
import numpy as np
from typing import Union
def geometric_mech(mu: Union[float, np.ndarray], epsilon: int, sensitivity: float = 1.0):
"""Implementation of the Geometric Mechanism. The Geometric Mechanism is a
discrete variant of the Laplace Mechanism. It is useful when integer-valued
output is desired.
... | [
"numpy.shape",
"numpy.random.geometric",
"numpy.exp"
] | [((501, 513), 'numpy.shape', 'np.shape', (['mu'], {}), '(mu)\n', (509, 513), True, 'import numpy as np\n'), ((563, 575), 'numpy.exp', 'np.exp', (['(-eps)'], {}), '(-eps)\n', (569, 575), True, 'import numpy as np\n'), ((584, 618), 'numpy.random.geometric', 'np.random.geometric', (['p'], {'size': 'shape'}), '(p, size=sha... |
import numpy as np
from molsysmt._private.exceptions import *
def surface_area(molecular_system, selection='all', type='collantes'):
from molsysmt.basic import get
if type == 'collantes':
from .groups.surface_area import collantes as values
else:
raise NotImplementedError()
group_typ... | [
"numpy.array",
"molsysmt.basic.get"
] | [((325, 395), 'molsysmt.basic.get', 'get', (['molecular_system'], {'element': '"""group"""', 'selection': 'selection', 'name': '(True)'}), "(molecular_system, element='group', selection=selection, name=True)\n", (328, 395), False, 'from molsysmt.basic import get\n'), ((497, 513), 'numpy.array', 'np.array', (['output'],... |
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import (generate_binary_structure,
iterate_structure, binary_erosion)
import hashlib
from operator import itemgetter
IDX... | [
"scipy.ndimage.morphology.binary_erosion",
"scipy.ndimage.filters.maximum_filter",
"matplotlib.pyplot.show",
"scipy.ndimage.morphology.iterate_structure",
"scipy.ndimage.morphology.generate_binary_structure",
"numpy.where",
"matplotlib.pyplot.gca",
"numpy.log10",
"operator.itemgetter",
"matplotlib... | [((3782, 3813), 'scipy.ndimage.morphology.generate_binary_structure', 'generate_binary_structure', (['(2)', '(1)'], {}), '(2, 1)\n', (3807, 3813), False, 'from scipy.ndimage.morphology import generate_binary_structure, iterate_structure, binary_erosion\n'), ((3833, 3882), 'scipy.ndimage.morphology.iterate_structure', '... |
# This module contains some functionality from the Python Imaging
# Library, that has been ported to use Numpy arrays rather than PIL
# Image objects.
# The Python Imaging Library is
# Copyright (c) 1997-2009 by Secret Labs AB
# Copyright (c) 1995-2009 by <NAME>
# By obtaining, using, and/or copying this software a... | [
"numpy.empty",
"matplotlib.cbook.deprecated",
"six.moves.xrange",
"numpy.histogram",
"numpy.arange",
"matplotlib.cbook.warn_deprecated"
] | [((1687, 1773), 'matplotlib.cbook.warn_deprecated', 'warn_deprecated', (['"""1.4.0"""'], {'name': '"""matplotlib.testing.image_util"""', 'obj_type': '"""module"""'}), "('1.4.0', name='matplotlib.testing.image_util', obj_type=\n 'module')\n", (1702, 1773), False, 'from matplotlib.cbook import deprecated, warn_depreca... |
# ------------------------------------------------------------------------------
# IMPORTS
# ------------------------------------------------------------------------------
from sys import version_info
from sys import path as syspath
from os import path
_CURRENT_DIRECTORY = syspath[0]
... | [
"util.plotImages",
"numpy.sum",
"numpy.copy",
"cv2.cvtColor",
"numpy.empty",
"packaging.version.parse",
"click.option",
"click.command",
"numpy.shape",
"urllib.request.urlretrieve",
"util.install",
"numpy.max",
"os.path.join",
"cv2.Sobel",
"util.load_image_RGB"
] | [((2857, 2901), 'os.path.join', 'path.join', (['_CURRENT_DIRECTORY', '"""../../data/"""'], {}), "(_CURRENT_DIRECTORY, '../../data/')\n", (2866, 2901), False, 'from os import path\n'), ((2954, 2995), 'os.path.join', 'path.join', (['_PATH_2_DATA', '_IMG_HARRIS_NAME'], {}), '(_PATH_2_DATA, _IMG_HARRIS_NAME)\n', (2963, 299... |
import sys
import numpy as np
import librosa as lr
from glob import glob
import matplotlib.pyplot as plt
# Audio to compare
userAudioDir = "./userAudio.wav"
userAudio, userFrequency = lr.load(userAudioDir)
userAudio = np.true_divide(userAudio, max(userAudio))
# Comparator
audiosDir = "./originalAudios"
audioFiles =... | [
"sys.stdout.write",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.corrcoef",
"librosa.load",
"glob.glob"
] | [((186, 207), 'librosa.load', 'lr.load', (['userAudioDir'], {}), '(userAudioDir)\n', (193, 207), True, 'import librosa as lr\n'), ((321, 347), 'glob.glob', 'glob', (["(audiosDir + '/*.wav')"], {}), "(audiosDir + '/*.wav')\n", (325, 347), False, 'from glob import glob\n'), ((1458, 1480), 'sys.stdout.write', 'sys.stdout.... |
import argparse
import logging
import time
from enum import IntEnum
import gym.spaces
import numpy as np
import pybullet as p
from igibson import object_states
from igibson.envs.behavior_env import BehaviorEnv
from igibson.external.pybullet_tools.utils import CIRCULAR_LIMITS
from igibson.object_states.on_floor import... | [
"pybullet.getQuaternionFromEuler",
"numpy.random.uniform",
"logging.debug",
"argparse.ArgumentParser",
"pybullet.removeState",
"pybullet.stepSimulation",
"pybullet.saveState",
"numpy.zeros",
"pybullet.restoreState",
"igibson.utils.behavior_robot_planning_utils.dry_run_base_plan",
"time.time",
... | [((23383, 23408), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (23406, 23408), False, 'import argparse\n'), ((989, 1005), 'pybullet.getNumBodies', 'p.getNumBodies', ([], {}), '()\n', (1003, 1005), True, 'import pybullet as p\n'), ((1112, 1161), 'pybullet.getClosestPoints', 'p.getClosestPoints... |
"""
Project: RadarBook
File: hertzian_dipole.py
Created by: <NAME>
On: 6/20/2018
Created with: PyCharm
Copyright (C) 2019 Artech House (<EMAIL>)
This file is part of Introduction to Radar Using Python and MATLAB
and can not be copied and/or distributed without the express permission of Artech House.
"""
from scipy.con... | [
"numpy.sin",
"numpy.exp",
"numpy.sqrt"
] | [((1305, 1323), 'numpy.sqrt', 'sqrt', (['(mu / epsilon)'], {}), '(mu / epsilon)\n', (1309, 1323), False, 'from numpy import sqrt, sin, exp\n'), ((3032, 3050), 'numpy.sqrt', 'sqrt', (['(mu / epsilon)'], {}), '(mu / epsilon)\n', (3036, 3050), False, 'from numpy import sqrt, sin, exp\n'), ((3885, 3903), 'numpy.sqrt', 'sqr... |
import itertools
import json
import numpy as np
import pandas as pd
import spacy
import pickle
from ast import literal_eval as make_tuple
from collections import defaultdict, Counter
from scipy import sparse
from sklearn.cluster import KMeans
from sklearn.preprocessing import Normalizer
from spacy.symbols import *
f... | [
"numpy.load",
"pickle.dump",
"numpy.argmin",
"collections.defaultdict",
"numpy.argsort",
"pickle.load",
"pandas.DataFrame",
"json.loads",
"scipy.sparse.linalg.svds",
"sklearn.cluster.KMeans",
"spacy.load",
"numpy.save",
"numpy.ones_like",
"pandas.DataFrame.from_dict",
"numpy.median",
"... | [((15767, 15820), 'pandas.DataFrame', 'pd.DataFrame', (["{'content': content}"], {'index': 'comment_ids'}), "({'content': content}, index=comment_ids)\n", (15779, 15820), True, 'import pandas as pd\n'), ((17399, 17420), 'pandas.DataFrame', 'pd.DataFrame', (['sent_df'], {}), '(sent_df)\n', (17411, 17420), True, 'import ... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"tqdm.tqdm",
"numpy.load",
"sklearn.preprocessing.StandardScaler",
"argparse.ArgumentParser",
"logging.info",
"pathlib.Path",
"jsonlines.open",
"paddlespeech.t2s.datasets.data_table.DataTable",
"operator.itemgetter"
] | [((975, 1104), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Normalize dumped raw features (See detail in parallel_wavegan/bin/normalize.py)."""'}), "(description=\n 'Normalize dumped raw features (See detail in parallel_wavegan/bin/normalize.py).'\n )\n", (998, 1104), False, 'imp... |
import certifi
from datetime import datetime,timedelta
from handle_logging_lib import HandleLogging
import json
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import urllib3
class PlotWeather:
def __init__(self):
self.handle_logging = HandleLogging()
... | [
"handle_logging_lib.HandleLogging",
"numpy.amin",
"matplotlib.pyplot.close",
"os.environ.get",
"numpy.amax",
"certifi.where",
"matplotlib.use",
"numpy.array",
"datetime.timedelta",
"datetime.datetime.fromtimestamp",
"matplotlib.pyplot.subplots"
] | [((131, 152), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (145, 152), False, 'import matplotlib\n'), ((303, 318), 'handle_logging_lib.HandleLogging', 'HandleLogging', ([], {}), '()\n', (316, 318), False, 'from handle_logging_lib import HandleLogging\n'), ((780, 809), 'os.environ.get', 'os.envi... |
"""
This module provides 3 different methods to perform 'all relevant feature selection'
Reference:
----------
NILSSON, <NAME>, <NAME>., <NAME>, et al.
Consistent feature selection for pattern recognition in polynomial time.
Journal of Machine Learning Research, 2007, vol. 8, no Mar, p. 589-612.
KURSA, <NAME>., RUDN... | [
"lightgbm.LGBMClassifier",
"numpy.random.seed",
"sklearn.model_selection.train_test_split",
"sklearn.inspection.permutation_importance",
"numpy.ones",
"numpy.random.gamma",
"sklearn.datasets.load_boston",
"matplotlib.pyplot.style.use",
"sklearn.compose.ColumnTransformer",
"numpy.arange",
"numpy.... | [((2816, 2985), 'lightgbm.LGBMRegressor', 'lgb.LGBMRegressor', ([], {'verbose': '(-1)', 'force_col_wise': '(True)', 'n_estimators': 'n_estimators', 'subsample': '(0.632)', 'colsample_bytree': 'feat_frac', 'boosting_type': '"""rf"""', 'subsample_freq': '(1)'}), "(verbose=-1, force_col_wise=True, n_estimators=\n n_est... |
# Copyright 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of con... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"numpy.random.randint",
"prettytable.PrettyTable",
"builtins.range",
"sys.path.append",
"numpy.full",
"Queue.Queue",
"test_util.get_sequence_model_name",
"numpy.random.RandomState",
"threading.Lock",
"tritonclientutils.np_to_triton_dtype",
"tra... | [((1554, 1582), 'sys.path.append', 'sys.path.append', (['"""../common"""'], {}), "('../common')\n", (1569, 1582), False, 'import sys\n'), ((2168, 2227), 'os.environ.get', 'os.environ.get', (['"""BACKENDS"""', '"""graphdef savedmodel onnx plan"""'], {}), "('BACKENDS', 'graphdef savedmodel onnx plan')\n", (2182, 2227), F... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"tvm.ir.save_json",
"numpy.mean",
"os.path.join",
"os.path.abspath",
"tensorflow.python.framework.convert_to_constants.convert_variables_to_constants_v2",
"tvm.nd.array",
"numpy.std",
"tvm.cpu",
"tensorflow.keras.Input",
"tvm.relay.build_config",
"numpy.random.choice",
"tvm.relay.frontend.from... | [((5270, 5279), 'tvm.cpu', 'tvm.cpu', ([], {}), '()\n', (5277, 5279), False, 'import tvm\n'), ((6228, 6297), 'tensorflow.keras.Input', 'tf.keras.Input', ([], {'shape': '[seq_len]', 'batch_size': 'batch_size', 'dtype': '"""int32"""'}), "(shape=[seq_len], batch_size=batch_size, dtype='int32')\n", (6242, 6297), True, 'imp... |
#
# pool2d paddle model generator
#
import numpy as np
from save_model import saveModel
import sys
data_type = 'float32'
def paddle_argmax(name : str, x, axis):
import paddle
paddle.enable_static()
with paddle.static.program_guard(paddle.static.Program(), paddle.static.Program()):
node_x = pa... | [
"paddle.cast",
"paddle.static.data",
"paddle.static.cpu_places",
"paddle.enable_static",
"paddle.argmax",
"paddle.static.Program",
"save_model.saveModel",
"numpy.random.random",
"paddle.static.Executor",
"paddle.static.default_startup_program"
] | [((185, 207), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (205, 207), False, 'import paddle\n'), ((984, 1006), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (1004, 1006), False, 'import paddle\n'), ((318, 378), 'paddle.static.data', 'paddle.static.data', ([], {'name': '"""x"""'... |
"""
Harness for conducting experiments for MF Optimisation.
-- <EMAIL>
"""
# pylint: disable=import-error
# pylint: disable=no-member
# pylint: disable=relative-import
# pylint: disable=abstract-class-not-used
from argparse import Namespace
from datetime import datetime
import numpy as np
import os
# Local import... | [
"argparse.Namespace",
"utils.optimisers.direct_maximise_from_mfof",
"utils.reporters.get_reporter",
"mf_gp_bandit.mfgpb_from_mfoptfunc",
"numpy.empty",
"numpy.zeros",
"numpy.ones",
"datetime.datetime.now",
"numpy.append",
"scratch.get_finite_fidel_mfof.get_finite_mfof_from_mfof",
"os.path.join"
... | [((1782, 1811), 'utils.reporters.get_reporter', 'get_reporter', (['method_reporter'], {}), '(method_reporter)\n', (1794, 1811), False, 'from utils.reporters import get_reporter\n'), ((2292, 2330), 'os.path.join', 'os.path.join', (['save_dir', 'save_file_name'], {}), '(save_dir, save_file_name)\n', (2304, 2330), False, ... |
# Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | [
"yaml.load",
"json.dumps",
"collections.defaultdict",
"os.path.abspath",
"logging.error",
"json.loads",
"re.findall",
"savu.plugins.utils.parse_config_string",
"re.search",
"savu.plugins.utils.is_template_param",
"savu.data.framework_citations.get_framework_citations",
"h5py.File",
"savu.plu... | [((2404, 2428), 'h5py.File', 'h5py.File', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (2413, 2428), False, 'import h5py\n'), ((7286, 7314), 'savu.data.framework_citations.get_framework_citations', 'fc.get_framework_citations', ([], {}), '()\n', (7312, 7314), True, 'import savu.data.framework_citations as fc\n')... |
import numpy as np
import math
class Sigmoid:
def __init__(self):
def sig(x):
return 1 / (1 + math.exp(-x))
def sig_grad(x):
sigx = sig(x)
return sigx*(1-sigx)
self.func_vec = np.vectorize(sig)
self.func_vec_grad = np.vectorize(sig_grad)
d... | [
"math.exp",
"numpy.vectorize",
"math.tanh"
] | [((243, 260), 'numpy.vectorize', 'np.vectorize', (['sig'], {}), '(sig)\n', (255, 260), True, 'import numpy as np\n'), ((290, 312), 'numpy.vectorize', 'np.vectorize', (['sig_grad'], {}), '(sig_grad)\n', (302, 312), True, 'import numpy as np\n'), ((640, 658), 'numpy.vectorize', 'np.vectorize', (['tanh'], {}), '(tanh)\n',... |
"""Plot examples of SciencePlot styles."""
import numpy as np
import matplotlib.pyplot as plt
def model(x, p):
return x ** (2 * p + 1) / (1 + x ** (2 * p))
pparam = dict(xlabel='Voltage (mV)', ylabel='Current ($\mu$A)')
x = np.linspace(0.75, 1.25, 201)
with plt.style.context(['science']):
fig, ax = plt.s... | [
"numpy.random.normal",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.style.context",
"numpy.linspace"
] | [((234, 262), 'numpy.linspace', 'np.linspace', (['(0.75)', '(1.25)', '(201)'], {}), '(0.75, 1.25, 201)\n', (245, 262), True, 'import numpy as np\n'), ((269, 299), 'matplotlib.pyplot.style.context', 'plt.style.context', (["['science']"], {}), "(['science'])\n", (286, 299), True, 'import matplotlib.pyplot as plt\n'), ((3... |
"""
.. _l-b-reducesumsquare:
Compares implementations of ReduceSumSquare
===========================================
This example compares the *numpy* for the operator *ReduceSumSquare*
to :epkg:`onnxruntime` implementation.
If available, :epkg:`tensorflow` and :epkg:`pytorch` are included as well.
.. contents::
... | [
"pandas.DataFrame",
"tqdm.tqdm",
"torch.from_numpy",
"skl2onnx.algebra.onnx_ops.OnnxReduceSumSquare",
"matplotlib.pyplot.show",
"mlprodict.testing.experimental_c.code_optimisation",
"torch.sum",
"numpy.sum",
"tensorflow.convert_to_tensor",
"mlprodict.tools.measure_time",
"skl2onnx.common.data_ty... | [((7471, 7489), 'pandas.concat', 'pandas.concat', (['dfs'], {}), '(dfs)\n', (7484, 7489), False, 'import pandas\n'), ((7616, 7649), 'matplotlib.pyplot.savefig', 'plt.savefig', (["('plot_%s.png' % name)"], {}), "('plot_%s.png' % name)\n", (7627, 7649), True, 'import matplotlib.pyplot as plt\n'), ((7651, 7661), 'matplotl... |
"""
Optuna example that optimizes a configuration for Olivetti faces dataset using
skimage.
In this example, we optimize a classifier configuration for Olivetti faces dataset.
We optimize parameters of local_binary_pattern function in skimage and the
choice of distance metric classes.
"""
import numpy as np
import s... | [
"skimage.feature.local_binary_pattern",
"numpy.argmax",
"numpy.log2",
"sklearn.datasets.fetch_olivetti_faces",
"numpy.random.RandomState",
"numpy.argmin",
"optuna.create_study",
"numpy.where",
"numpy.array",
"numpy.arange",
"numpy.matmul",
"numpy.dot",
"numpy.unique",
"numpy.sqrt"
] | [((458, 482), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)'], {}), '(0)\n', (479, 482), True, 'import numpy as np\n'), ((497, 549), 'sklearn.datasets.fetch_olivetti_faces', 'fetch_olivetti_faces', ([], {'shuffle': '(True)', 'random_state': 'rng'}), '(shuffle=True, random_state=rng)\n', (517, 549), False,... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Ricequant, Inc
#
# * Commercial Usage: please contact <EMAIL>
# * Non-Commercial Usage:
# 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
#
... | [
"rqalpha.environment.Environment.get_instance",
"rqalpha.execution_context.ExecutionContext.phase",
"numpy.isnan",
"rqalpha.utils.logger.system_log.exception",
"rqalpha.utils.i18n.gettext",
"numpy.dot",
"rqalpha.utils.datetime_func.convert_int_to_datetime",
"six.iteritems"
] | [((5948, 5995), 'rqalpha.utils.datetime_func.convert_int_to_datetime', 'convert_int_to_datetime', (["self._data['datetime']"], {}), "(self._data['datetime'])\n", (5971, 5995), False, 'from rqalpha.utils.datetime_func import convert_int_to_datetime\n'), ((6511, 6540), 'numpy.isnan', 'np.isnan', (["self._data['close']"],... |
# -*- coding: utf-8 -*-
import itertools
import logging
from typing import Iterable, Union
import numpy as np
def prepare_neighborhood_vectors(neighborhood_type, neighborhood_radius):
"""
Prepare neighborhood vectors either with the 'axes' option or the
'grid' option. See each method for a description.
... | [
"logging.debug",
"numpy.asarray",
"numpy.zeros",
"numpy.identity",
"numpy.tile",
"itertools.product",
"numpy.concatenate",
"numpy.repeat"
] | [((2694, 2708), 'numpy.identity', 'np.identity', (['(3)'], {}), '(3)\n', (2705, 2708), True, 'import numpy as np\n'), ((2725, 2762), 'numpy.concatenate', 'np.concatenate', (['(tmp_axes, -tmp_axes)'], {}), '((tmp_axes, -tmp_axes))\n', (2739, 2762), True, 'import numpy as np\n'), ((2937, 2961), 'numpy.asarray', 'np.asarr... |
import numpy as np
import pandas as pd
from statsmodels.tsa.ar_model import AR
values = np.loadtxt('F.txt')
voice = 3
#train the autoregression model
model = AR(values[:, voice])
model_fit = model.fit()
predictions=[]
window = model_fit.k_ar #num variables
coeff = model_fit.params # Coefficients
predict_steps = 128... | [
"statsmodels.tsa.ar_model.AR",
"numpy.append",
"numpy.savetxt",
"numpy.loadtxt"
] | [((89, 108), 'numpy.loadtxt', 'np.loadtxt', (['"""F.txt"""'], {}), "('F.txt')\n", (99, 108), True, 'import numpy as np\n'), ((161, 181), 'statsmodels.tsa.ar_model.AR', 'AR', (['values[:, voice]'], {}), '(values[:, voice])\n', (163, 181), False, 'from statsmodels.tsa.ar_model import AR\n'), ((765, 840), 'numpy.savetxt',... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | [
"tensorflow.compat.v2.io.gfile.GFile",
"jax.nn.log_softmax",
"absl.logging.info",
"jax.lax.psum",
"jax.nn.one_hot",
"numpy.pad",
"jax.numpy.finfo",
"jax.local_device_count",
"jax.numpy.argmax",
"jax.random.randint",
"jax.numpy.minimum",
"functools.partial",
"jax.numpy.sum",
"numpy.ceil",
... | [((904, 996), 'numpy.array', 'onp.array', (['[[0.299, -0.16874, 0.5], [0.587, -0.33126, -0.41869], [0.114, 0.5, -0.08131]]'], {}), '([[0.299, -0.16874, 0.5], [0.587, -0.33126, -0.41869], [0.114, 0.5,\n -0.08131]])\n', (913, 996), True, 'import numpy as onp\n'), ((4275, 4322), 'functools.partial', 'functools.partial'... |
import numpy as np
import tempfile
from dnnv.verifiers.common.base import Parameter, Verifier
from dnnv.verifiers.common.results import SAT, UNSAT, UNKNOWN
from .errors import ERANError, ERANTranslatorError
class ERAN(Verifier):
translator_error = ERANTranslatorError
verifier_error = ERANError
parameter... | [
"tempfile.NamedTemporaryFile",
"dnnv.verifiers.common.base.Parameter",
"numpy.save",
"numpy.load"
] | [((344, 480), 'dnnv.verifiers.common.base.Parameter', 'Parameter', (['str'], {'default': '"""deepzono"""', 'choices': "['deepzono', 'deeppoly', 'refinezono', 'refinepoly']", 'help': '"""The abstract domain to use."""'}), "(str, default='deepzono', choices=['deepzono', 'deeppoly',\n 'refinezono', 'refinepoly'], help=... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"paddle.fluid.layers.data",
"paddle.fluid.program_guard",
"numpy.allclose",
"paddle.nn.Sequential",
"op_test.OpTest.np_dtype_to_fluid_dtype",
"paddle.nn.SyncBatchNorm.convert_sync_batchnorm",
"unittest.main",
"paddle.fluid.Executor",
"paddle.fluid.layers.reduce_sum",
"paddle.fluid.optimizer.SGD",
... | [((1010, 1041), 'op_test._set_use_system_allocator', '_set_use_system_allocator', (['(True)'], {}), '(True)\n', (1035, 1041), False, 'from op_test import OpTest, _set_use_system_allocator\n'), ((10554, 10569), 'unittest.main', 'unittest.main', ([], {}), '()\n', (10567, 10569), False, 'import unittest\n'), ((2017, 2032)... |
import autofit as af
import numpy as np
from astropy import cosmology as cosmo
from scipy.integrate import quad
from autoarray.structures import grids
from autoastro.util import cosmology_util
from autoastro import dimensions as dim
from autofit.tools import text_util
from autoastro.profiles import geometry_profiles
... | [
"autofit.tools.text_util.within_radius_label_value_and_unit_string",
"numpy.divide",
"scipy.integrate.quad",
"numpy.seterr",
"numpy.power",
"autoastro.util.cosmology_util.kpc_per_arcsec_from_redshift_and_cosmology",
"numpy.exp",
"autoastro.dimensions.Length",
"numpy.sqrt"
] | [((15711, 15734), 'numpy.seterr', 'np.seterr', ([], {'all': '"""ignore"""'}), "(all='ignore')\n", (15720, 15734), True, 'import numpy as np\n'), ((5158, 5204), 'autoastro.dimensions.Length', 'dim.Length', ([], {'value': 'radius', 'unit_length': '"""arcsec"""'}), "(value=radius, unit_length='arcsec')\n", (5168, 5204), T... |
"""
This version of nmrmath features speed-optimized hamiltonian, simsignals,
and transition_matrix functions. Up to at least 8 spins, the new non-sparse
Hamilton code is about 10x faster. The overall performance is dramatically
better than the original code.
"""
import numpy as np
from math import sqrt
from scipy.li... | [
"numpy.matrix",
"numpy.multiply",
"numpy.empty",
"numpy.zeros",
"numpy.linalg.eigh",
"scipy.sparse.lil_matrix",
"scipy.sparse.csc_matrix",
"numpy.asmatrix",
"scipy.sparse.csr_matrix",
"numpy.kron",
"numpy.dot",
"numpy.vstack"
] | [((1657, 1675), 'scipy.sparse.lil_matrix', 'lil_matrix', (['(n, n)'], {}), '((n, n))\n', (1667, 1675), False, 'from scipy.sparse import kron, csc_matrix, csr_matrix, lil_matrix, bmat\n'), ((2225, 2260), 'numpy.matrix', 'np.matrix', (['[[0, 1 / 2], [1 / 2, 0]]'], {}), '([[0, 1 / 2], [1 / 2, 0]])\n', (2234, 2260), True, ... |
# IMPORTS
import sys
sys.path.append("..")
from preprocessing.temporal_aggregation import TemporalAggregator
import numpy as np
import pandas as pd
from tools.processing import groupwise_normalise, groupwise_expansion
from misc.utils import matchfinder, fano_inequality
from tqdm import tqdm
from structures.trajectory... | [
"numpy.polyfit",
"tqdm.tqdm.pandas",
"numpy.exp",
"sys.path.append",
"pandas.DataFrame",
"numpy.power",
"tools.processing.groupwise_expansion",
"misc.utils.fano_inequality",
"concurrent.futures.ThreadPoolExecutor",
"pandas.concat",
"preprocessing.temporal_aggregation.TemporalAggregator",
"pand... | [((23, 44), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (38, 44), False, 'import sys\n'), ((347, 360), 'tqdm.tqdm.pandas', 'tqdm.pandas', ([], {}), '()\n', (358, 360), False, 'from tqdm import tqdm\n'), ((1632, 1664), 'tools.processing.groupwise_normalise', 'groupwise_normalise', (['frequencie... |
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import numpy
from matplotlib import gridspec
import os
def jointplotRSDvCorrelation(rsd, correlation, histBins=100, savePath=None, figureFormat='png', dpi=72, figureSize=(11, 7)):
"""
Plot a 2D histogram of feature RSDs *vs* correlations ... | [
"matplotlib.pyplot.subplot",
"seaborn.axes_style",
"matplotlib.pyplot.show",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.close",
"numpy.isfinite",
"numpy.finfo",
"matplotlib.pyplot.figure",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.savefig",
"matplotlib.ticker.ScalarFormatter"
] | [((1275, 1341), 'matplotlib.gridspec.GridSpec', 'gridspec.GridSpec', (['(2)', '(2)'], {'width_ratios': '[3, 1]', 'height_ratios': '[1, 4]'}), '(2, 2, width_ratios=[3, 1], height_ratios=[1, 4])\n', (1292, 1341), False, 'from matplotlib import gridspec\n'), ((1350, 1389), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'... |
import math
import random
try:
import numpy
except ImportError:
numpy = None
def pysparkling_poisson(lambda_):
if lambda_ == 0.0:
return 0
n = 0
exp_neg_lambda = math.exp(-lambda_)
prod = 1.0
while True:
prod *= random.random()
if prod > exp_neg_lambda:
... | [
"random.random",
"math.exp",
"numpy.random.poisson"
] | [((194, 212), 'math.exp', 'math.exp', (['(-lambda_)'], {}), '(-lambda_)\n', (202, 212), False, 'import math\n'), ((260, 275), 'random.random', 'random.random', ([], {}), '()\n', (273, 275), False, 'import random\n'), ((429, 458), 'numpy.random.poisson', 'numpy.random.poisson', (['lambda_'], {}), '(lambda_)\n', (449, 45... |
import cv2
import numpy as np
'''
def MyImage():
img = cv2.imread("pipes2.jpg")
#cv2.imshow('original',img)
cv2.waitKey()
return img
'''
def circleDetection(imagePath):
image = cv2.imread(imagePath)
detector = cv2.SimpleBlobDetector_create()
keypoints = detector.detect(imag... | [
"cv2.drawKeypoints",
"cv2.putText",
"cv2.SimpleBlobDetector_Params",
"cv2.waitKey",
"numpy.zeros",
"cv2.SimpleBlobDetector_create",
"cv2.imread",
"cv2.destroyAllWindows"
] | [((211, 232), 'cv2.imread', 'cv2.imread', (['imagePath'], {}), '(imagePath)\n', (221, 232), False, 'import cv2\n'), ((249, 280), 'cv2.SimpleBlobDetector_create', 'cv2.SimpleBlobDetector_create', ([], {}), '()\n', (278, 280), False, 'import cv2\n'), ((338, 354), 'numpy.zeros', 'np.zeros', (['(1, 1)'], {}), '((1, 1))\n',... |
import shutil
from pathlib import Path
from distutils.dir_util import copy_tree
import csv
import json
from mne.externals.pymatreader import read_mat
from bids import BIDSLayout
import numpy as np
from bids.layout.utils import write_derivative_description
import tqdm
bd_root = Path("/media/christian/ElementsSE/MPI-Lei... | [
"json.dump",
"bids.BIDSLayout",
"numpy.concatenate",
"csv.writer",
"mne.externals.pymatreader.read_mat",
"bids.layout.utils.write_derivative_description",
"pathlib.Path",
"numpy.array",
"numpy.unique"
] | [((279, 349), 'pathlib.Path', 'Path', (['"""/media/christian/ElementsSE/MPI-Leipzig_Mind-Brain-Body-LEMON/"""'], {}), "('/media/christian/ElementsSE/MPI-Leipzig_Mind-Brain-Body-LEMON/')\n", (283, 349), False, 'from pathlib import Path\n'), ((816, 913), 'bids.layout.utils.write_derivative_description', 'write_derivative... |
import numpy as np
a = np.array([(1, 2, 3), (4, -1, 5), (10, 11, 12),
(8, 8, 8), (7, -4, 6), (2, 2, 0)], dtype=float)
x = np.array([(2, ), (11, ), (-1, )], dtype=float)
print(a @ x)
# with open('smallX.dat', 'w') as file:
# matrix = x
# file.write(str(matrix.shape[0]) + '\n')
# file.write(... | [
"numpy.array"
] | [((24, 122), 'numpy.array', 'np.array', (['[(1, 2, 3), (4, -1, 5), (10, 11, 12), (8, 8, 8), (7, -4, 6), (2, 2, 0)]'], {'dtype': 'float'}), '([(1, 2, 3), (4, -1, 5), (10, 11, 12), (8, 8, 8), (7, -4, 6), (2, 2,\n 0)], dtype=float)\n', (32, 122), True, 'import numpy as np\n'), ((137, 180), 'numpy.array', 'np.array', ([... |
import math
import gym
from enum import IntEnum
import numpy as np
from gym import error, spaces, utils
from gym.utils import seeding
from ray.rllib.env import MultiAgentEnv
from .rendering import *
# Size in pixels of a tile in the full-scale human view
TILE_PIXELS = 32
DEFAULT_AGENT_ID = 'default'
# Map of color na... | [
"gym.utils.seeding.np_random",
"copy.deepcopy",
"numpy.zeros",
"numpy.ones",
"numpy.array",
"gym.spaces.Box",
"numpy.array_equal",
"numpy.all",
"gym.spaces.Dict"
] | [((360, 381), 'numpy.array', 'np.array', (['[255, 0, 0]'], {}), '([255, 0, 0])\n', (368, 381), True, 'import numpy as np\n'), ((396, 417), 'numpy.array', 'np.array', (['[0, 255, 0]'], {}), '([0, 255, 0])\n', (404, 417), True, 'import numpy as np\n'), ((431, 452), 'numpy.array', 'np.array', (['[0, 0, 255]'], {}), '([0, ... |
import cv2
import numpy as np
import pytesseract
from PIL import Image
src_path = 'C:/Users/stevi/Documents/StackOverflow/WarmColorDetection/'
pytesseract.pytesseract.tesseract_cmd = 'C:/Users/stevi/AppData/Local/Tesseract-OCR/tesseract.exe'
def find_temperature_range(img, y1=0, y2=0, x1=0, x2=0):
'''
Find t... | [
"cv2.GaussianBlur",
"cv2.circle",
"cv2.putText",
"cv2.dilate",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.threshold",
"cv2.imshow",
"numpy.ones",
"pytesseract.image_to_string",
"cv2.imread",
"PIL.Image.fromarray",
"cv2.minMaxLoc",
"cv2.resizeWindow",
"cv2.destroyAllWindows",
"cv2.namedWindow"... | [((753, 790), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2GRAY'], {}), '(img, cv2.COLOR_BGR2GRAY)\n', (765, 790), False, 'import cv2\n'), ((946, 971), 'numpy.ones', 'np.ones', (['(1, 1)', 'np.uint8'], {}), '((1, 1), np.uint8)\n', (953, 971), True, 'import numpy as np\n'), ((987, 1027), 'cv2.dilate', 'cv2.di... |
import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
from evalml.pipelines.components import DropColumns, SelectColumns
@pytest.mark.parametrize("class_to_test", [DropColumns, SelectColumns])
def test_column_transformer_init(class_to_test):
transformer = class_to_tes... | [
"pandas.DataFrame",
"pytest.mark.parametrize",
"pytest.raises",
"numpy.arange"
] | [((170, 240), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""class_to_test"""', '[DropColumns, SelectColumns]'], {}), "('class_to_test', [DropColumns, SelectColumns])\n", (193, 240), False, 'import pytest\n'), ((725, 795), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""class_to_test"""', '[Dro... |
# -*- coding: utf-8 -*-
"""Testing GLSAR against STATA
Created on Wed May 30 09:25:24 2012
Author: <NAME>
"""
import numpy as np
from numpy.testing import assert_almost_equal, assert_allclose
from statsmodels.regression.linear_model import GLSAR
from statsmodels.tools.tools import add_constant
from statsmodels.data... | [
"numpy.log",
"numpy.testing.assert_almost_equal",
"nose.runmodule",
"statsmodels.datasets.macrodata.load",
"numpy.testing.assert_allclose",
"statsmodels.regression.linear_model.GLSAR",
"statsmodels.tools.tools.add_constant"
] | [((1878, 1935), 'nose.runmodule', 'nose.runmodule', ([], {'argv': "[__file__, '-vvs', '-x']", 'exit': '(False)'}), "(argv=[__file__, '-vvs', '-x'], exit=False)\n", (1892, 1935), False, 'import nose\n'), ((470, 520), 'numpy.testing.assert_almost_equal', 'assert_almost_equal', (['res.params', 'results.params', '(3)'], {}... |
"""
The Patchmatch Algorithm. The actual algorithm is a nearly
line to line port of the original c++ version.
The distance calculation is different to leverage numpy's vectorized
operations.
This version uses 4 images instead of 2.
You can supply the same image twice to use patchmatch between 2 images.
"""
import os ... | [
"os.path.abspath",
"numpy.zeros_like",
"numpy.zeros",
"pycuda.driver.In",
"numpy.random.randint",
"numpy.mean",
"pycuda.driver.InOut",
"numpy.int32",
"numpy.random.rand",
"os.path.join",
"cv2.resize"
] | [((357, 382), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (372, 382), False, 'import os\n'), ((1673, 1748), 'numpy.random.randint', 'np.random.randint', (['self.B.shape[1]'], {'size': '(self.A.shape[0], self.A.shape[1])'}), '(self.B.shape[1], size=(self.A.shape[0], self.A.shape[1]))\n', (1... |
'''
CartPole solution by <NAME>
https://github.com/FitMachineLearning/FitML/
https://www.youtube.com/channel/UCi7_WxajoowBl4_9P0DhzzA/featured
Using Actor Critic
Note that I prefe the terms Action Predictor Network and Q/Reward Predictor network better
Update
Cleaned up variables and more readable memory
Improved hyp... | [
"numpy.around",
"os.path.isfile",
"numpy.arange",
"keras.optimizers.adam",
"numpy.full",
"matplotlib.pyplot.show",
"os.path.realpath",
"numpy.alen",
"matplotlib.use",
"numpy.delete",
"numpy.vstack",
"numpy.concatenate",
"gym.make",
"matplotlib.pyplot.plot",
"numpy.zeros",
"keras.layers... | [((445, 468), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (459, 468), False, 'import matplotlib\n'), ((1248, 1277), 'numpy.arange', 'np.arange', (['(0)', 'num_env_actions'], {}), '(0, num_env_actions)\n', (1257, 1277), True, 'import numpy as np\n'), ((1293, 1337), 'numpy.zeros', 'np.zeros'... |
import json
import multiprocessing as mp
import os
import random
from argparse import ArgumentParser
from itertools import repeat
from time import time
import numpy as np
from PIL import Image as Im, ImageDraw
from .model import Model
from .util import get_background, channel_wise_gaussian
def generate(args, id):
... | [
"numpy.pad",
"json.load",
"argparse.ArgumentParser",
"random.sample",
"random.shuffle",
"numpy.zeros",
"random.choice",
"numpy.ones",
"time.time",
"os.path.isfile",
"numpy.max",
"numpy.rot90",
"numpy.min",
"PIL.ImageDraw.Draw",
"os.path.join",
"os.listdir",
"itertools.repeat",
"mul... | [((378, 429), 'random.choice', 'random.choice', (["[m for m in args['models'] if m.ooi]"], {}), "([m for m in args['models'] if m.ooi])\n", (391, 429), False, 'import random\n'), ((449, 528), 'random.sample', 'random.sample', (["[m for m in args['models'] if not m.ooi]", "(args['item_count'] - 1)"], {}), "([m for m in ... |
import numpy as np
from os import listdir, path
from imageio import imread
import torch
from torch.autograd import Variable
from torch.utils.data import Dataset, DataLoader
class FlumeData(Dataset):
"""
Data from a single run of the flume experiment.
Args:
rundir: directory containing run images... | [
"numpy.load",
"torch.autograd.Variable",
"imageio.imread",
"numpy.transpose",
"torch.cat",
"torch.cuda.is_available",
"numpy.random.rand",
"os.path.join",
"os.listdir"
] | [((3156, 3195), 'torch.cat', 'torch.cat', (['[batch[t] for t in pinds]', '(1)'], {}), '([batch[t] for t in pinds], 1)\n', (3165, 3195), False, 'import torch\n'), ((3204, 3243), 'torch.cat', 'torch.cat', (['[batch[t] for t in finds]', '(1)'], {}), '([batch[t] for t in finds], 1)\n', (3213, 3243), False, 'import torch\n'... |
from decimal import Decimal
from fractions import Fraction
import gspaces
import numpy as np
import pytest
@pytest.mark.parametrize(
"start,stop,step",
[
(0, 100, 10),
(0.5, 10.5, 4),
pytest.param(0, 10, -1, marks=pytest.mark.xfail),
(Fraction(1, 2), Fraction(36, 4), Fraction(... | [
"gspaces.linspace",
"pytest.approx",
"pytest.param",
"numpy.arange",
"numpy.linspace",
"fractions.Fraction",
"gspaces.arange"
] | [((474, 502), 'numpy.arange', 'np.arange', (['start', 'stop', 'step'], {}), '(start, stop, step)\n', (483, 502), True, 'import numpy as np\n'), ((518, 551), 'gspaces.arange', 'gspaces.arange', (['start', 'stop', 'step'], {}), '(start, stop, step)\n', (532, 551), False, 'import gspaces\n'), ((967, 996), 'numpy.linspace'... |
from keras.models import Sequential, load_model
from keras.layers import Conv2D, MaxPooling2D, Dense, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint
from keras.preprocessing.image import ImageDataGenerator
import numpy as np
import pandas as pd
import tensorflow as tf
from sklea... | [
"keras.models.load_model",
"pandas.DataFrame",
"keras.preprocessing.image.ImageDataGenerator",
"numpy.argmax",
"keras.callbacks.ModelCheckpoint",
"tensorflow.math.confusion_matrix",
"sklearn.metrics.accuracy_score",
"keras.optimizers.Adam",
"keras.layers.Flatten",
"keras.layers.Dense",
"keras.la... | [((1218, 1230), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1228, 1230), False, 'from keras.models import Sequential, load_model\n'), ((1860, 1887), 'keras.optimizers.Adam', 'Adam', ([], {'lr': 'self.learning_rate'}), '(lr=self.learning_rate)\n', (1864, 1887), False, 'from keras.optimizers import Adam\n... |
import skimage.io as io
import skimage.transform as skt
import numpy as np
from PIL import Image
from src.models.class_patcher import patcher
from src.utils.imgproc import *
from skimage.color import rgb2hsv, hsv2rgb
class patcher(patcher):
def __init__(self, body='./body/body_rei.png', **options):
super(... | [
"numpy.dstack",
"PIL.Image.new",
"skimage.color.hsv2rgb",
"numpy.copy",
"skimage.io.imread",
"skimage.color.rgb2hsv",
"numpy.float32",
"numpy.zeros",
"numpy.clip",
"numpy.rot90",
"numpy.array",
"numpy.mean",
"numpy.linspace",
"PIL.Image.fromarray",
"numpy.concatenate"
] | [((1592, 1607), 'numpy.array', 'np.array', (['image'], {}), '(image)\n', (1600, 1607), True, 'import numpy as np\n'), ((1658, 1670), 'numpy.zeros', 'np.zeros', (['(25)'], {}), '(25)\n', (1666, 1670), True, 'import numpy as np\n'), ((1868, 1915), 'numpy.concatenate', 'np.concatenate', (['[front[:, ::-1], front]'], {'axi... |
#!/usr/bin/env python
#!Python
#Usage:
#SVelter.py [option] [Parametres]
#option:
#For debug use only
#command='SVelter.py SVPredict --deterministic-flag 1 --workdir /mnt/EXT/Mills-scratch2/Xuefang/NA12878.NGS --sample /mnt/EXT/Mills-scratch2/Xuefang/NA12878.NGS/alignment/NA12878_S1.chr10.bam'
#command='SVelter.py SVP... | [
"svelter_sv.readme.print_default_parameters_clean",
"numpy.sum",
"getopt.getopt",
"os.popen",
"time.strftime",
"os.path.isfile",
"numpy.mean",
"svelter_sv.readme.print_default_parameters_genotyper",
"svelter_sv.readme.print_default_parameters_svpredict",
"random.randint",
"numpy.std",
"numpy.m... | [((1606, 1639), 'svelter_sv.readme.print_default_parameters', 'readme.print_default_parameters', ([], {}), '()\n', (1637, 1639), False, 'from svelter_sv import readme\n'), ((1785, 2390), 'getopt.getopt', 'getopt.getopt', (['sys.argv[2:]', '"""o:h:S:"""', "['deterministic-flag=', 'ref-index=', 'help=', 'batch=', 'prefix... |
import sys
import os
import glob
import csv
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
from matplotlib import patches
from matplotlib.pyplot import figure
from datetime import timedelta, date
from sklearn.metrics import confusion_matrix, classification_report, f1_sco... | [
"os.remove",
"numpy.argmax",
"pandas.read_csv",
"tensorflow.python.keras.models.Model",
"tensorflow.python.keras.layers.LeakyReLU",
"sklearn.metrics.f1_score",
"os.path.isfile",
"tensorflow.python.keras.layers.BatchNormalization",
"tensorflow.python.keras.Input",
"tensorflow.python.keras.regulariz... | [((5495, 5521), 'tensorflow.test.is_gpu_available', 'tf.test.is_gpu_available', ([], {}), '()\n', (5519, 5521), True, 'import tensorflow as tf\n'), ((5622, 5645), 'pandas.read_csv', 'pd.read_csv', (['"""task.csv"""'], {}), "('task.csv')\n", (5633, 5645), True, 'import pandas as pd\n'), ((5664, 5692), 'os.path.isfile', ... |
import tvm
import topi
import numpy as np
from tvm.contrib.pickle_memoize import memoize
from scipy import signal
from topi.util import get_const_tuple
from topi.nn.util import get_pad_tuple
from topi.cuda.depthwise_conv2d import schedule_depthwise_conv2d_backward_weight_nhwc
def verify_depthwise_conv2d_back_weight(b... | [
"topi.nn.depthwise_conv2d_backward_weight_nhwc",
"numpy.random.uniform",
"topi.nn.util.get_pad_tuple",
"tvm.nd.array",
"topi.testing.dilate_python",
"tvm.context",
"tvm.placeholder",
"tvm.contrib.pickle_memoize.memoize",
"numpy.zeros",
"tvm.build",
"topi.util.get_const_tuple",
"numpy.rot90",
... | [((531, 587), 'numpy.int', 'np.int', (['((in_h + 2 * padding_h - filter_h) / stride_h + 1)'], {}), '((in_h + 2 * padding_h - filter_h) / stride_h + 1)\n', (537, 587), True, 'import numpy as np\n'), ((590, 646), 'numpy.int', 'np.int', (['((in_w + 2 * padding_w - filter_w) / stride_w + 1)'], {}), '((in_w + 2 * padding_w ... |
import dataset
import tensorflow as tf
import time
from datetime import timedelta
import math
import random
import numpy as np
import os
# Adding Seed so that random initialization is consistent
from numpy.random import seed
seed(1)
from tensorflow import set_random_seed
set_random_seed(2)
batch_si... | [
"numpy.random.seed",
"tensorflow.reshape",
"tensorflow.matmul",
"tensorflow.nn.conv2d",
"dataset.read_train_sets",
"tensorflow.truncated_normal",
"tensorflow.nn.softmax",
"tensorflow.nn.relu",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.set_random_seed",
"tensorflow.placeholde... | [((239, 246), 'numpy.random.seed', 'seed', (['(1)'], {}), '(1)\n', (243, 246), False, 'from numpy.random import seed\n'), ((290, 308), 'tensorflow.set_random_seed', 'set_random_seed', (['(2)'], {}), '(2)\n', (305, 308), False, 'from tensorflow import set_random_seed\n'), ((363, 389), 'os.listdir', 'os.listdir', (['"""t... |
"""
Defines the classes to manage the datasets and the CSV-based Metadata database.
"""
import os
import json
import string
import random
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from Exceptions import NoDatasetFoundError
class MetadataDB:
"""Metadata Database ob... | [
"pandas.DataFrame",
"numpy.load",
"json.load",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"os.path.exists",
"Exceptions.NoDatasetFoundError",
"numpy.savez",
"string.hexdigits.upper"
] | [((1883, 1901), 'pandas.DataFrame', 'pd.DataFrame', (['rows'], {}), '(rows)\n', (1895, 1901), True, 'import pandas as pd\n'), ((3450, 3513), 'Exceptions.NoDatasetFoundError', 'NoDatasetFoundError', (['f"""No Dataset with ID ({ds_id}) was found."""'], {}), "(f'No Dataset with ID ({ds_id}) was found.')\n", (3469, 3513), ... |
import numpy as np
import pandas as pd
from scipy.stats.distributions import chi2, norm
from statsmodels.graphics import utils
def _calc_survfunc_right(time, status, weights=None, entry=None, compress=True,
retall=True):
"""
Calculate the survival function and its standard error for a... | [
"statsmodels.graphics.utils.create_mpl_ax",
"numpy.sum",
"numpy.abs",
"numpy.clip",
"numpy.sin",
"numpy.exp",
"numpy.unique",
"pandas.DataFrame",
"numpy.logical_not",
"numpy.isfinite",
"numpy.cumsum",
"numpy.bincount",
"numpy.roll",
"numpy.asarray",
"numpy.dot",
"numpy.concatenate",
... | [((1723, 1733), 'numpy.log', 'np.log', (['sp'], {}), '(sp)\n', (1729, 1733), True, 'import numpy as np\n'), ((1743, 1756), 'numpy.cumsum', 'np.cumsum', (['sp'], {}), '(sp)\n', (1752, 1756), True, 'import numpy as np\n'), ((1766, 1776), 'numpy.exp', 'np.exp', (['sp'], {}), '(sp)\n', (1772, 1776), True, 'import numpy as ... |
"""
GigaDb Motor imagery dataset.
"""
import logging
import numpy as np
from mne import create_info
from mne.channels import make_standard_montage
from mne.io import RawArray
from scipy.io import loadmat
from . import download as dl
from .base import BaseDataset
log = logging.getLogger()
GIGA_URL = "ftp://parrot.g... | [
"mne.channels.make_standard_montage",
"scipy.io.loadmat",
"numpy.zeros",
"logging.getLogger",
"mne.create_info",
"numpy.vstack",
"mne.io.RawArray"
] | [((274, 293), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (291, 293), False, 'import logging\n'), ((3658, 3696), 'mne.channels.make_standard_montage', 'make_standard_montage', (['"""standard_1005"""'], {}), "('standard_1005')\n", (3679, 3696), False, 'from mne.channels import make_standard_montage\n'), ... |
"""
We generate data for the MNIST Normalizing Flow
experiment as proposed in Section 4.4 of our paper
KSD Aggregated Goodness-of-fit Test
<NAME>, <NAME>, <NAME>
https://arxiv.org/pdf/2202.00824.pdf
The data is saved in the directory data/NF_MNIST.
We use the code from Tutorial 11: Normalizing Flows for image modelin... | [
"pytorch_lightning.seed_everything",
"numpy.random.seed",
"torch.optim.lr_scheduler.StepLR",
"numpy.empty",
"torch.cat",
"os.path.isfile",
"torch.rand_like",
"pathlib.Path",
"torch.arange",
"numpy.exp",
"torch.device",
"torch.nn.functional.elu",
"torch.no_grad",
"os.path.join",
"numpy.pr... | [((1400, 1422), 'pytorch_lightning.seed_everything', 'pl.seed_everything', (['(42)'], {}), '(42)\n', (1418, 1422), True, 'import pytorch_lightning as pl\n'), ((2105, 2148), 'os.makedirs', 'os.makedirs', (['CHECKPOINT_PATH'], {'exist_ok': '(True)'}), '(CHECKPOINT_PATH, exist_ok=True)\n', (2116, 2148), False, 'import os\... |
#!/usr/bin/env python
# -- coding: utf-8 --
"""
Copyright (c) 2019. All rights reserved.
Created by <NAME> on 2020/2/6
"""
import numpy as np
def norm_img(x):
"""
正则化
"""
x = x.astype('float')
x /= 127.5
x -= 1.
return x
def avg_list(x_list):
x_np = np.array(x_list)
avg = np.ave... | [
"numpy.average",
"numpy.array",
"numpy.exp"
] | [((287, 303), 'numpy.array', 'np.array', (['x_list'], {}), '(x_list)\n', (295, 303), True, 'import numpy as np\n'), ((314, 330), 'numpy.average', 'np.average', (['x_np'], {}), '(x_np)\n', (324, 330), True, 'import numpy as np\n'), ((459, 473), 'numpy.exp', 'np.exp', (['(x * -1)'], {}), '(x * -1)\n', (465, 473), True, '... |
#!/usr/bin/env python
# coding: utf-8
# # How to use this notebook ?
# * In the last cell, enter the json files of data you wish to use in the game_files list.
# * In relative_path, put the path of the folder containing Hololens data (dafault is './Hololens_data/')
# * Call the function simple_features_generator with ... | [
"pandas.DataFrame",
"json.load",
"ntpath.basename",
"numpy.savetxt",
"numpy.array",
"numpy.arctan",
"numpy.float64",
"pandas.concat",
"numpy.sqrt"
] | [((760, 772), 'numpy.sqrt', 'np.sqrt', (['sum'], {}), '(sum)\n', (767, 772), True, 'import numpy as np\n'), ((1069, 1137), 'pandas.DataFrame', 'pd.DataFrame', (["data['datasList'][0]['listLevelDatas'][0]['userDatas']"], {}), "(data['datasList'][0]['listLevelDatas'][0]['userDatas'])\n", (1081, 1137), True, 'import panda... |
"""
Emulate an oscilloscope. Requires the animation API introduced in
matplotlib 1.0 SVN.
"""
import matplotlib
import numpy as np
from matplotlib.lines import Line2D
import matplotlib.pyplot as plt
import matplotlib.animation as animation
class Scope:
def __init__(self, ax, maxt=10, dt=0.01):
self.ax = a... | [
"matplotlib.pyplot.show",
"matplotlib.lines.Line2D",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure",
"numpy.random.rand"
] | [((1248, 1260), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1258, 1260), True, 'import matplotlib.pyplot as plt\n'), ((1311, 1386), 'matplotlib.animation.FuncAnimation', 'animation.FuncAnimation', (['fig', 'scope.update', 'emitter'], {'interval': '(10)', 'blit': '(True)'}), '(fig, scope.update, emitter... |
import tensorflow as tf
import numpy as np
import os
from scipy import misc
g_mean = np.array(([126.88,120.24,112.19])).reshape([1,1,3])
saliency_folder = "./saliency_output"
def rgba2rgb(img):
return img[:,:,:3]*np.expand_dims(img[:,:,3],2)
def saliency(folder,path):
with tf.Session() as sess:... | [
"tensorflow.train.import_meta_graph",
"tensorflow.get_collection",
"tensorflow.Session",
"numpy.expand_dims",
"tensorflow.train.latest_checkpoint",
"numpy.array",
"numpy.squeeze",
"os.path.join",
"scipy.misc.imread"
] | [((91, 125), 'numpy.array', 'np.array', (['[126.88, 120.24, 112.19]'], {}), '([126.88, 120.24, 112.19])\n', (99, 125), True, 'import numpy as np\n'), ((225, 256), 'numpy.expand_dims', 'np.expand_dims', (['img[:, :, 3]', '(2)'], {}), '(img[:, :, 3], 2)\n', (239, 256), True, 'import numpy as np\n'), ((299, 311), 'tensorf... |
import aperturefit as af
import numpy as np
import matplotlib.pyplot as pl
import psffit as pf
import simulateK2
from datetime import datetime
from tqdm import tqdm
from everest import detrender
class PSFrun(object):
def __init__(self):
# self.ID = input("Enter EPIC ID: ")
self.ID = 205998445
... | [
"matplotlib.pyplot.show",
"numpy.abs",
"aperturefit.ApertureFit",
"datetime.datetime.now",
"numpy.min",
"numpy.mean",
"numpy.max",
"psffit.PSFFit",
"matplotlib.pyplot.subplots",
"numpy.concatenate"
] | [((343, 357), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (355, 357), False, 'from datetime import datetime\n'), ((616, 640), 'aperturefit.ApertureFit', 'af.ApertureFit', (['self.trn'], {}), '(self.trn)\n', (630, 640), True, 'import aperturefit as af\n'), ((779, 810), 'psffit.PSFFit', 'pf.PSFFit', (['sel... |
# import the necessary packages
import numpy as np
import cv2
def color_transfer(source, target):
"""
Transfers the color distribution from the source to the target
image using the mean and standard deviations of the L*a*b*
color space.
This implementation is (loosely) based on to the "Color Transfer
between Im... | [
"cv2.cvtColor",
"cv2.merge",
"cv2.split",
"numpy.clip"
] | [((1225, 1242), 'cv2.split', 'cv2.split', (['target'], {}), '(target)\n', (1234, 1242), False, 'import cv2\n'), ((1567, 1585), 'numpy.clip', 'np.clip', (['l', '(0)', '(255)'], {}), '(l, 0, 255)\n', (1574, 1585), True, 'import numpy as np\n'), ((1591, 1609), 'numpy.clip', 'np.clip', (['a', '(0)', '(255)'], {}), '(a, 0, ... |
"""
LIBRARY: specindex
PURPOSE: A Library of tools to generate, compare, test, etc. custom colour maps
for radio spectral index (alpha) data. Two fixed divergent points are defined
as alpha_steep <-0.8 and alpha_flat >-0.1.
AUTHORS: <NAME>, <NAME>, <NAME>
DATE: Last Edited: 2021-07-11
FUNCTIONS:
__generat... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"numpy.meshgrid",
"numpy.copy",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.figure",
"colourspace.gamut.Cmax_for_LH",
"numpy.arange",
"numpy.sin",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.subplots_adjus... | [((8725, 8782), 'colourspace.maps.make_cmap_segmented', 'maps.make_cmap_segmented', (['points', 'values'], {'name': '"""blue-red"""'}), "(points, values, name='blue-red')\n", (8749, 8782), False, 'from colourspace import maps\n'), ((10545, 10613), 'matplotlib.pyplot.imshow', 'plt.imshow', (['array'], {'aspect': '"""aut... |
'''
@Author: <NAME>
@GitHub: https://github.com/athon2
@Date: 2018-11-30 09:53:44
'''
from torch.utils.data import Dataset
import tables
import numpy as np
import nibabel as nib
from nilearn.image import new_img_like, resample_to_img
from utils import pickle_load
def open_data_file(filename, readwrite="r"):
return... | [
"nibabel.Nifti1Image",
"numpy.flip",
"numpy.asarray",
"numpy.zeros",
"numpy.where",
"utils.pickle_load",
"numpy.random.random",
"numpy.random.choice",
"tables.open_file",
"numpy.concatenate",
"nilearn.image.new_img_like"
] | [((321, 358), 'tables.open_file', 'tables.open_file', (['filename', 'readwrite'], {}), '(filename, readwrite)\n', (337, 358), False, 'import tables\n'), ((830, 864), 'nilearn.image.new_img_like', 'new_img_like', (['image'], {'data': 'new_data'}), '(image, data=new_data)\n', (842, 864), False, 'from nilearn.image import... |
# Copyright 2021 The Flax 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 applicable law or agreed to in wri... | [
"flax.linen.avg_pool",
"flax.linen.Conv",
"flax.linen.relu",
"flax.linen.Dense",
"optax.softmax_cross_entropy",
"flax.training.train_state.TrainState.create",
"jax.numpy.float32",
"jax.numpy.argmax",
"tensorflow_datasets.builder",
"jax.random.PRNGKey",
"numpy.mean",
"flax.metrics.tensorboard.S... | [((1858, 1899), 'jax.value_and_grad', 'jax.value_and_grad', (['loss_fn'], {'has_aux': '(True)'}), '(loss_fn, has_aux=True)\n', (1876, 1899), False, 'import jax\n'), ((2840, 2859), 'numpy.mean', 'np.mean', (['epoch_loss'], {}), '(epoch_loss)\n', (2847, 2859), True, 'import numpy as np\n'), ((2879, 2902), 'numpy.mean', '... |
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.http import HttpResponseRedirect
from django.core.files.storage import FileSystemStorage
from .forms import CreateUserForm
from django.core.files.storage import default_storage
from django.contrib.auth.forms import UserCreati... | [
"django.shortcuts.redirect",
"django.contrib.messages.error",
"numpy.array",
"django.contrib.auth.authenticate",
"django.shortcuts.render",
"django.contrib.messages.success",
"django.core.files.storage.default_storage.save",
"django.core.files.storage.default_storage.path",
"django.contrib.auth.logi... | [((1129, 1157), 'django.shortcuts.render', 'render', (['request', '"""base.html"""'], {}), "(request, 'base.html')\n", (1135, 1157), False, 'from django.shortcuts import render, redirect\n'), ((1195, 1224), 'django.shortcuts.render', 'render', (['request', '"""about.html"""'], {}), "(request, 'about.html')\n", (1201, 1... |
#!/usr/bin/env python3
"""
Script created from the mongo_to_pg.ipynb Jupyter Notebook.
"""
import argparse
import json
from uuid import uuid4
import numpy as np
import pandas as pd
def _to_camel_case(snake_str):
components = snake_str.split('_')
# We capitalize the first letter of each component except the... | [
"uuid.uuid4",
"argparse.ArgumentParser",
"pandas.json_normalize",
"pandas.read_json",
"pandas.to_datetime",
"numpy.array_split"
] | [((494, 512), 'pandas.read_json', 'pd.read_json', (['file'], {}), '(file)\n', (506, 512), True, 'import pandas as pd\n'), ((547, 589), 'pandas.json_normalize', 'pd.json_normalize', (['df.content'], {'max_level': '(0)'}), '(df.content, max_level=0)\n', (564, 589), True, 'import pandas as pd\n'), ((1699, 1744), 'pandas.t... |
import pygame as pg
import Screen, Handler
import imageFunction, eventFunction, objectFunction, textFunction
import numpy as np
print('Object library imported')
class Object:
def __init__(self,name,position,size,scale,velocity,father,
type = None,
text = None,
textPosition =... | [
"Handler.Handler",
"numpy.ceil",
"pygame.font.SysFont",
"Screen.Screen",
"pygame.Rect",
"textFunction.parsePosition",
"imageFunction.getImagePath",
"pygame.font.init",
"objectFunction.getBlitOrder",
"imageFunction.getNoImage",
"imageFunction.getImage"
] | [((907, 940), 'objectFunction.getBlitOrder', 'objectFunction.getBlitOrder', (['self'], {}), '(self)\n', (934, 940), False, 'import imageFunction, eventFunction, objectFunction, textFunction\n'), ((1576, 1647), 'pygame.Rect', 'pg.Rect', (['self.position[0]', 'self.position[1]', 'self.size[0]', 'self.size[1]'], {}), '(se... |
import numpy as _np
import matplotlib.pyplot as _plt
from johnspythonlibrary2.Process.Misc import findNearest
import xarray as _xr
# from scipy.signal import gaussian as _gaussian
#%% Basic signal generation
def gaussian_pulse(sigma, t, amplitude=1, plot=False):
"""
Basic gaussian pulse with units in time
std_t... | [
"matplotlib.pyplot.plot",
"scipy.integrate.odeint",
"matplotlib.rcParams.update",
"xarray.open_dataset",
"numpy.zeros",
"numpy.ones",
"xarray.Dataset",
"matplotlib.pyplot.figure",
"scipy.signal.chirp",
"numpy.arange",
"johnspythonlibrary2.Process.Misc.findNearest",
"xarray.DataArray",
"numpy... | [((2309, 2338), 'johnspythonlibrary2.Process.Misc.findNearest', 'findNearest', (['t', 'tStartStop[0]'], {}), '(t, tStartStop[0])\n', (2320, 2338), False, 'from johnspythonlibrary2.Process.Misc import findNearest\n'), ((2346, 2375), 'johnspythonlibrary2.Process.Misc.findNearest', 'findNearest', (['t', 'tStartStop[1]'], ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 16 2018
@author: <NAME>
"""
import matplotlib.pyplot as plt
from scipy import exp
from scipy.special import gamma
import numpy as np
import pandas as pd
from scipy.optimize import minimize
#import time
def BCPE(M, S, L, T, x):
c = np.sqrt(2**(-2/T)*gamma(1/T)... | [
"numpy.poly1d",
"scipy.optimize.minimize",
"matplotlib.pyplot.show",
"numpy.log",
"matplotlib.pyplot.plot",
"numpy.polyfit",
"pandas.read_csv",
"numpy.polyval",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"numpy.std",
"numpy.abs",
"numpy.cumsum",
"numpy.mean",
"numpy.arange"... | [((2212, 2243), 'pandas.read_csv', 'pd.read_csv', (['"""example_data.csv"""'], {}), "('example_data.csv')\n", (2223, 2243), True, 'import pandas as pd\n'), ((2418, 2443), 'numpy.poly1d', 'np.poly1d', (['results.x[0:2]'], {}), '(results.x[0:2])\n', (2427, 2443), True, 'import numpy as np\n'), ((2449, 2474), 'numpy.polyv... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from ase.build import (
add_adsorbate,
add_vacuum,
bcc100,
bcc110,
bcc111,
diamond100,
diamo... | [
"pyiron_atomistics.atomistics.structure.factories.aimsgb.AimsgbFactory",
"pyiron_atomistics.atomistics.structure.factories.compound.CompoundFactory",
"pyiron_atomistics.atomistics.structure.periodic_table.PeriodicTable",
"pyiron_atomistics.atomistics.structure.atoms.ase_to_pyiron",
"pyiron_atomistics.atomis... | [((2645, 2712), 'pyiron_base.deprecate', 'deprecate', ([], {'message': '"""Please use .read or .ase.read"""', 'version': '"""0.2.2"""'}), "(message='Please use .read or .ase.read', version='0.2.2')\n", (2654, 2712), False, 'from pyiron_base import state, PyironFactory, deprecate\n'), ((2854, 2921), 'pyiron_base.depreca... |
import argparse
import math
from datetime import datetime
import numpy as np
import tensorflow as tf
import socket
import importlib
import os
import sys
import glob
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
import pickle
import pdb
import utils.tf_util
from utils.pointnet_util impo... | [
"numpy.load",
"numpy.sum",
"argparse.ArgumentParser",
"numpy.ones",
"tensorflow.ConfigProto",
"tensorflow.Variable",
"numpy.mean",
"os.path.join",
"sys.path.append",
"os.path.abspath",
"tensorflow.minimum",
"tensorflow.placeholder",
"importlib.import_module",
"tensorflow.train.Saver",
"t... | [((219, 244), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (234, 244), False, 'import sys\n'), ((420, 445), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (443, 445), False, 'import argparse\n'), ((2345, 2381), 'importlib.import_module', 'importlib.import_module', (... |
from typing import List, Any
import numpy as np
from pyNastran.op2.op2_helper import polar_to_real_imag
def reshape_bytes_block(block: bytes) -> bytes:
"""
Converts the nonsense 64-bit string to 32-bit format.
Note
----
Requires a multiple of 8 characters.
"""
nwords = len(block) // 2
... | [
"numpy.abs",
"numpy.angle",
"pyNastran.op2.op2_helper.polar_to_real_imag"
] | [((2472, 2502), 'pyNastran.op2.op2_helper.polar_to_real_imag', 'polar_to_real_imag', (['mag', 'phase'], {}), '(mag, phase)\n', (2490, 2502), False, 'from pyNastran.op2.op2_helper import polar_to_real_imag\n'), ((2794, 2811), 'numpy.abs', 'np.abs', (['real_imag'], {}), '(real_imag)\n', (2800, 2811), True, 'import numpy ... |
# using python 3
from os import name
from flask import Flask, render_template
from flask_bootstrap import Bootstrap
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, FileField
from wtforms.validators import Required
from data import PLANTS
import tensorflow as tf
import pandas as pd
import ... | [
"keras.models.load_model",
"flask.flash",
"flask.redirect",
"cv2.cvtColor",
"numpy.asarray",
"flask.Flask",
"sklearn.preprocessing.LabelEncoder",
"werkzeug.utils.secure_filename",
"wtforms.SubmitField",
"wtforms.FileField",
"cv2.imread",
"wtforms.validators.Required",
"flask.render_template"... | [((646, 661), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (651, 661), False, 'from flask import Flask, render_template\n'), ((824, 838), 'flask_bootstrap.Bootstrap', 'Bootstrap', (['app'], {}), '(app)\n', (833, 838), False, 'from flask_bootstrap import Bootstrap\n'), ((1307, 1328), 'wtforms.SubmitField'... |
"""Internal module for stability tests."""
from __future__ import annotations
# stdlib
import functools
import os
from pathlib import Path
# third party
import numpy as np
import matplotlib.pyplot as plt
# tdub
import tdub.rex as tr
import tdub.art as ta
SUBSET_FIGSIZE = (4.0, 4.6)
def restore_cwd(func):
""... | [
"tdub.rex.fit_parameter",
"os.getcwd",
"tdub.rex.prettify_label",
"tdub.rex.delta_param",
"pathlib.Path",
"tdub.art.draw_impact_barh",
"numpy.array",
"functools.wraps",
"tdub.rex.nuispar_impact",
"tdub.rex.nuispar_impact_plot_df",
"matplotlib.pyplot.subplots",
"os.chdir"
] | [((375, 396), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (390, 396), False, 'import functools\n'), ((1731, 1744), 'pathlib.Path', 'Path', (['rex_dir'], {}), '(rex_dir)\n', (1735, 1744), False, 'from pathlib import Path\n'), ((1831, 1886), 'tdub.rex.fit_parameter', 'tr.fit_parameter', (["(fit_dir ... |
"""
Tests for block sparse dot
"""
import numpy as np
from numpy.random import randn
import aesara
import aesara.tensor as at
import tests.unittest_tools as utt
from aesara.tensor.elemwise import DimShuffle
from aesara.tensor.nnet.blocksparse import (
SparseBlockGemv,
SparseBlockOuter,
sparse_block_dot... | [
"tests.unittest_tools.verify_grad",
"numpy.einsum",
"aesara.function",
"aesara.tensor.type.imatrix",
"numpy.random.randn",
"aesara.tensor.as_tensor_variable",
"aesara.tensor.nnet.blocksparse.sparse_block_dot",
"numpy.swapaxes",
"aesara.tensor.elemwise.DimShuffle",
"numpy.random.permutation",
"ae... | [((4217, 4226), 'aesara.tensor.type.fmatrix', 'fmatrix', ([], {}), '()\n', (4224, 4226), False, 'from aesara.tensor.type import fmatrix, ftensor3, ftensor4, imatrix\n'), ((4239, 4249), 'aesara.tensor.type.ftensor4', 'ftensor4', ([], {}), '()\n', (4247, 4249), False, 'from aesara.tensor.type import fmatrix, ftensor3, ft... |
import os
from abc import ABC, abstractmethod
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision.transforms import ToPILImage, RandomCrop, RandomHorizontalFlip, ToTensor, Normalize, Compose
from autokeras.constant import Constant
from autokeras.utils import read_csv_file... | [
"torch.utils.data.DataLoader",
"autokeras.utils.read_image",
"numpy.std",
"torchvision.transforms.RandomHorizontalFlip",
"torchvision.transforms.ToPILImage",
"numpy.ones",
"numpy.clip",
"torchvision.transforms.ToTensor",
"autokeras.utils.read_csv_file",
"torchvision.transforms.Compose",
"numpy.a... | [((4075, 4096), 'torchvision.transforms.Compose', 'Compose', (['compose_list'], {}), '(compose_list)\n', (4082, 4096), False, 'from torchvision.transforms import ToPILImage, RandomCrop, RandomHorizontalFlip, ToTensor, Normalize, Compose\n'), ((1496, 1510), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (1504, 1... |
# Copyright 2020 Juneau
#
# 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, softw... | [
"math.exp",
"random.sample",
"ast.parse",
"logging.info",
"numpy.array",
"sys.getsizeof",
"numpy.intersect1d",
"numpy.union1d"
] | [((3877, 3896), 'ast.parse', 'ast.parse', (['all_code'], {}), '(all_code)\n', (3886, 3896), False, 'import ast\n'), ((4411, 4437), 'numpy.intersect1d', 'np.intersect1d', (['colA', 'colB'], {}), '(colA, colB)\n', (4425, 4437), True, 'import numpy as np\n'), ((4103, 4117), 'numpy.array', 'np.array', (['colA'], {}), '(col... |
import warnings
import numpy as np
from dftfit.io import VaspReader
def test_vasp_reader():
with warnings.catch_warnings():
warnings.simplefilter("ignore")
calculation = VaspReader(
'test_files/vasp', vasprun_filename='vasprun.xml.mgo')
assert np.all(np.isclose(calculation.energy... | [
"warnings.simplefilter",
"dftfit.io.VaspReader",
"numpy.zeros",
"numpy.isclose",
"warnings.catch_warnings",
"numpy.eye"
] | [((105, 130), 'warnings.catch_warnings', 'warnings.catch_warnings', ([], {}), '()\n', (128, 130), False, 'import warnings\n'), ((140, 171), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {}), "('ignore')\n", (161, 171), False, 'import warnings\n'), ((194, 259), 'dftfit.io.VaspReader', 'VaspReader'... |
from typing import Optional, Tuple
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from tensorflow.keras.layers import (
Embedding,
Input,
Dot,
Add,
)
from tensorflow.keras.models import Model
from recommender.layers import SqueezeLayer, ScalingLayer
from re... | [
"numpy.full_like",
"recommender.utils.MovieLens100K",
"tensorflow.keras.layers.Dot",
"numpy.split",
"tensorflow.keras.models.Model",
"recommender.layers.SqueezeLayer",
"numpy.array",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.Embedding",
"recommender... | [((365, 390), 'recommender.utils.MovieLens100K', 'MovieLens100K', (['"""../data/"""'], {}), "('../data/')\n", (378, 390), False, 'from recommender.utils import MovieLens100K\n'), ((574, 591), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '(1,)'}), '(shape=(1,))\n', (579, 591), False, 'from tensorflow.keras.l... |
"""
Copyright 2022 Institute of Parallel and Distributed Systems, Shanghai Jiao Tong University
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/LICE... | [
"pandas.read_csv",
"os.path.exists",
"numpy.zeros",
"os.system",
"scipy.sparse.coo_matrix",
"numpy.concatenate"
] | [((2584, 2620), 'numpy.concatenate', 'np.concatenate', (['(edges[0], edges[1])'], {}), '((edges[0], edges[1]))\n', (2598, 2620), True, 'import numpy as np\n'), ((2631, 2667), 'numpy.concatenate', 'np.concatenate', (['(edges[1], edges[0])'], {}), '((edges[1], edges[0]))\n', (2645, 2667), True, 'import numpy as np\n'), (... |
# Lint as: python3
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
"tf_quant_finance.experimental.instruments.ForwardRateAgreement",
"tf_quant_finance.experimental.instruments.InterestRateMarket",
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.convert_to_tensor",
"numpy.array",
"numpy.testing.assert_allclose"
] | [((6069, 6083), 'tensorflow.compat.v2.test.main', 'tf.test.main', ([], {}), '()\n', (6081, 6083), True, 'import tensorflow.compat.v2 as tf\n'), ((1338, 1491), 'tf_quant_finance.experimental.instruments.ForwardRateAgreement', 'tff.experimental.instruments.ForwardRateAgreement', (['settlement_date', 'fixing_date', 'fixed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.