code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import copy
import sys
import gc
import tempfile
import pytest
from os import path
from io import BytesIO
from itertools import chain
import numpy as np
from numpy.testing import (
assert_, assert_equal, IS_PYPY, assert_almost_equal,
assert_array_equal, assert_array_almost_equal, assert_raises,
... | [
"numpy.ones",
"numpy.frompyfunc",
"numpy.arange",
"numpy.bytes_",
"numpy.add.reduce",
"numpy.compat.pickle.load",
"numpy.testing.assert_equal",
"numpy.add.accumulate",
"numpy.divide.accumulate",
"re.sub",
"numpy.fromstring",
"numpy.testing.assert_raises_regex",
"numpy.compat.pickle.dumps",
... | [((51259, 51328), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not HAS_REFCOUNT)'], {'reason': '"""Python lacks refcounts"""'}), "(not HAS_REFCOUNT, reason='Python lacks refcounts')\n", (51277, 51328), False, 'import pytest\n'), ((55157, 55226), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not HAS_REFCOUNT)'], {'... |
from __future__ import print_function
from builtins import range
from builtins import object
import numpy as np
import matplotlib.pyplot as plt
from past.builtins import xrange
class TwoLayerNet(object):
"""
A two-layer fully-connected neural network. The net has an input dimension of
N, a hidden layer di... | [
"numpy.maximum",
"numpy.sum",
"numpy.random.randn",
"numpy.zeros",
"numpy.exp",
"builtins.range"
] | [((1642, 1663), 'numpy.zeros', 'np.zeros', (['hidden_size'], {}), '(hidden_size)\n', (1650, 1663), True, 'import numpy as np\n'), ((1768, 1789), 'numpy.zeros', 'np.zeros', (['output_size'], {}), '(output_size)\n', (1776, 1789), True, 'import numpy as np\n'), ((4584, 4598), 'numpy.exp', 'np.exp', (['scores'], {}), '(sco... |
from __future__ import print_function, division, absolute_import
# Non-std. lib imports
from PySide.QtCore import Signal, QObject
from PySide.QtGui import QGroupBox, QHBoxLayout, QLabel, \
QLineEdit, QIntValidator, QCheckBox
from numpy import arange
# Local imports
from rapid.gui.guicommon imp... | [
"rapid.gui.guicommon.toolTipText",
"PySide.QtGui.QLineEdit",
"numpy.arange",
"PySide.QtCore.Signal",
"PySide.QtGui.QIntValidator",
"PySide.QtGui.QCheckBox",
"PySide.QtGui.QLabel",
"rapid.gui.guicommon.error.showMessage",
"PySide.QtGui.QHBoxLayout"
] | [((1401, 1413), 'PySide.QtCore.Signal', 'Signal', (['bool'], {}), '(bool)\n', (1407, 1413), False, 'from PySide.QtCore import Signal, QObject\n'), ((693, 716), 'numpy.arange', 'arange', (['(1790)', '(2110)', '(0.5)'], {}), '(1790, 2110, 0.5)\n', (699, 716), False, 'from numpy import arange\n'), ((1248, 1279), 'numpy.ar... |
#!/usr/bin/python3
"""Training and Validation On Segmentation Task."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import math
import random
import shutil
import argparse
import importlib
import data_utils
import numpy as np
import ... | [
"tensorflow.reduce_sum",
"argparse.ArgumentParser",
"tensorflow.local_variables",
"tensorflow.trainable_variables",
"tensorflow.gather_nd",
"tensorflow.maximum",
"tensorflow.get_collection",
"tensorflow.reshape",
"tensorflow.local_variables_initializer",
"tensorflow.Variable",
"numpy.arange",
... | [((502, 527), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (525, 527), False, 'import argparse\n'), ((2203, 2238), 'importlib.import_module', 'importlib.import_module', (['args.model'], {}), '(args.model)\n', (2226, 2238), False, 'import importlib\n'), ((2314, 2343), 'sys.path.append', 'sys.p... |
# 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.relay.nn.bias_add",
"numpy.random.uniform",
"numpy.random.seed",
"tvm.relay.nn.dense",
"numpy.random.randint",
"tvm.relay.const"
] | [((1343, 1364), 'tvm.relay.const', 'relay.const', (['w', 'dtype'], {}), '(w, dtype)\n', (1354, 1364), False, 'from tvm import relay\n'), ((1375, 1431), 'tvm.relay.nn.dense', 'relay.nn.dense', (['a', 'weights'], {'units': 'units', 'out_dtype': 'dtype'}), '(a, weights, units=units, out_dtype=dtype)\n', (1389, 1431), Fals... |
#xyz Dec 2017
from __future__ import print_function
import pdb, traceback
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
import numpy as np
import h5py
import glob
import time
import multiprocessing as mp
import itertools
import zipfile,gzip
from plyfile import PlyD... | [
"numpy.ones",
"datasets.block_data_prep_util.check_h5fs_intact",
"datasets.block_data_prep_util.Raw_H5f",
"os.path.join",
"sys.path.append",
"os.path.abspath",
"os.path.dirname",
"os.path.exists",
"MATTERPORT_util.get_cat40_from_rawcat",
"numpy.reshape",
"plyfile.PlyData.read",
"h5py.File",
... | [((149, 174), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (164, 174), False, 'import sys\n'), ((438, 468), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""data"""'], {}), "(ROOT_DIR, 'data')\n", (450, 468), False, 'import os\n'), ((122, 147), 'os.path.abspath', 'os.path.abspath', (['__fi... |
from __future__ import print_function
import numpy as np
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from openpyxl import Workbook
from openpyxl.drawing.spreadsheet_drawing import TwoCellAnchor, AnchorMarker
import openpyxl
from openpyxl import load_workbook
from openpyxl.drawing.drawing i... | [
"openpyxl.Workbook",
"openpyxl.styles.Font",
"openpyxl.load_workbook",
"PIL.Image.open",
"PIL.ImageFont.truetype",
"numpy.array",
"openpyxl.drawing.spreadsheet_drawing.AnchorMarker",
"PIL.ImageDraw.Draw",
"openpyxl.drawing.image.Image"
] | [((1032, 1042), 'openpyxl.Workbook', 'Workbook', ([], {}), '()\n', (1040, 1042), False, 'from openpyxl import Workbook\n'), ((2380, 2405), 'PIL.Image.open', 'Image.open', (['imageFilePath'], {}), '(imageFilePath)\n', (2390, 2405), False, 'from PIL import Image\n'), ((2901, 2916), 'numpy.array', 'np.array', (['image'], ... |
#
# Utility classes for PyBaMM
#
# The code in this file is adapted from Pints
# (see https://github.com/pints-team/pints)
#
import importlib
import numpy as np
import os
import sys
import timeit
import pathlib
import pickle
import pybamm
import numbers
from collections import defaultdict
def root_dir():
""" retu... | [
"sys.path.append",
"os.path.isabs",
"sys.path.remove",
"importlib.import_module",
"timeit.default_timer",
"os.walk",
"os.path.exists",
"numpy.zeros",
"pybamm.root_dir",
"collections.defaultdict",
"pathlib.Path",
"pickle.load",
"os.path.isfile",
"os.path.split",
"os.path.join",
"numpy.n... | [((8156, 8179), 'os.path.isabs', 'os.path.isabs', (['filename'], {}), '(filename)\n', (8169, 8179), False, 'import os\n'), ((9576, 9605), 'os.path.split', 'os.path.split', (['valid_filename'], {}), '(valid_filename)\n', (9589, 9605), False, 'import os\n'), ((9610, 9637), 'sys.path.append', 'sys.path.append', (['valid_p... |
import collections
import importlib.util
import numpy as np
import xgboost as xgb
import testing as tm
import tempfile
import os
import shutil
import pytest
import json
rng = np.random.RandomState(1994)
pytestmark = pytest.mark.skipif(**tm.no_sklearn())
class TemporaryDirectory(object):
"""Context manager for t... | [
"sklearn.datasets.make_hastie_10_2",
"sklearn.datasets.load_digits",
"sklearn.datasets.load_iris",
"sklearn.model_selection.GridSearchCV",
"numpy.random.seed",
"sklearn.preprocessing.StandardScaler",
"numpy.polyfit",
"sklearn.model_selection.train_test_split",
"xgboost.XGBRFClassifier",
"numpy.all... | [((176, 203), 'numpy.random.RandomState', 'np.random.RandomState', (['(1994)'], {}), '(1994)\n', (197, 203), True, 'import numpy as np\n'), ((661, 683), 'sklearn.datasets.load_digits', 'load_digits', ([], {'n_class': '(2)'}), '(n_class=2)\n', (672, 683), False, 'from sklearn.datasets import load_digits\n'), ((741, 790)... |
import numpy as np
import matplotlib.pyplot as plt
from glob import glob
from scipy.io import loadmat
import skimage.io as sio
import os
from tqdm import tqdm
# Constants
root_dir = "./flowers"
# loading train and test files
train_files = np.load(root_dir+"/flower_train_files.npy")
test_files = np.load(root_dir+... | [
"numpy.load",
"tqdm.tqdm",
"os.makedirs",
"os.path.exists",
"glob.glob",
"skimage.io.imsave",
"skimage.io.imread"
] | [((245, 290), 'numpy.load', 'np.load', (["(root_dir + '/flower_train_files.npy')"], {}), "(root_dir + '/flower_train_files.npy')\n", (252, 290), True, 'import numpy as np\n'), ((303, 347), 'numpy.load', 'np.load', (["(root_dir + '/flower_test_files.npy')"], {}), "(root_dir + '/flower_test_files.npy')\n", (310, 347), Tr... |
import unittest
import numpy as np
from unittest.mock import patch
from small_text.utils.clustering import init_kmeans_plusplus_safe
class ClusteringTest(unittest.TestCase):
@patch('small_text.utils.clustering.warnings.warn')
@patch('small_text.utils.clustering.choice')
@patch('small_text.utils.cluster... | [
"unittest.mock.patch",
"numpy.random.rand",
"numpy.array",
"small_text.utils.clustering.init_kmeans_plusplus_safe"
] | [((184, 234), 'unittest.mock.patch', 'patch', (['"""small_text.utils.clustering.warnings.warn"""'], {}), "('small_text.utils.clustering.warnings.warn')\n", (189, 234), False, 'from unittest.mock import patch\n'), ((240, 283), 'unittest.mock.patch', 'patch', (['"""small_text.utils.clustering.choice"""'], {}), "('small_t... |
from __future__ import absolute_import
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME> and <NAME>
# --------------------------------------------------------
# -------------------------... | [
"numpy.meshgrid",
"torch.cat",
"numpy.array",
"numpy.arange",
"torch.sort"
] | [((2988, 3017), 'numpy.meshgrid', 'np.meshgrid', (['shift_x', 'shift_y'], {}), '(shift_x, shift_y)\n', (2999, 3017), True, 'import numpy as np\n'), ((4856, 4888), 'torch.sort', 'torch.sort', (['scores_keep', '(1)', '(True)'], {}), '(scores_keep, 1, True)\n', (4866, 4888), False, 'import torch\n'), ((9233, 9262), 'numpy... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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... | [
"tensorflow.identity",
"tensorflow.zeros_like",
"numpy.shape",
"tensorflow.nest.map_structure",
"numpy.full",
"tf_agents.utils.composite.slice_to",
"tf_agents.utils.composite.squeeze",
"tensorflow.get_static_value",
"typing.NamedTuple",
"tf_agents.trajectories.time_step.TimeStep",
"tensorflow.na... | [((1201, 1553), 'typing.NamedTuple', 'NamedTuple', (['"""Trajectory"""', "[('step_type', types.SpecTensorOrArray), ('observation', types.\n NestedSpecTensorOrArray), ('action', types.NestedSpecTensorOrArray), (\n 'policy_info', types.NestedSpecTensorOrArray), ('next_step_type', types\n .SpecTensorOrArray), ('r... |
from itertools import dropwhile
from typing import Optional, Type, Dict
import numpy as np
from numpy import ndarray
from .mesh2d import Mesh2D, MeshType
from .mesh_tri import MeshTri
class MeshQuad(Mesh2D):
"""A mesh consisting of quadrilateral elements.
The different constructors are
- :meth:`~s... | [
"numpy.sum",
"numpy.concatenate",
"numpy.copy",
"skfem.element.ElementQuad1",
"numpy.zeros",
"numpy.hstack",
"numpy.nonzero",
"numpy.sort",
"numpy.max",
"numpy.arange",
"numpy.array",
"numpy.array_equal",
"numpy.vstack",
"skfem.element.ElementLineP1",
"numpy.ascontiguousarray",
"numpy.... | [((983, 1015), 'numpy.zeros', 'np.zeros', (['(4, 0)'], {'dtype': 'np.int64'}), '((4, 0), dtype=np.int64)\n', (991, 1015), True, 'import numpy as np\n'), ((1026, 1058), 'numpy.zeros', 'np.zeros', (['(4, 0)'], {'dtype': 'np.int64'}), '((4, 0), dtype=np.int64)\n', (1034, 1058), True, 'import numpy as np\n'), ((3433, 3453)... |
import re
from pathlib import Path
import click
import numpy as np
import torch
import dnnlib
import legacy
def convert_to_rgb(state_ros, state_nv, ros_name, nv_name):
state_ros[f"{ros_name}.conv.weight"] = state_nv[f"{nv_name}.torgb.weight"].unsqueeze(0)
state_ros[f"{ros_name}.bias"] = state_nv[f"{nv_name}.torgb... | [
"numpy.log",
"click.argument",
"click.command",
"torch.save",
"dnnlib.util.open_url",
"re.findall",
"legacy.load_network_pkl"
] | [((1769, 1784), 'click.command', 'click.command', ([], {}), '()\n', (1782, 1784), False, 'import click\n'), ((1786, 1815), 'click.argument', 'click.argument', (['"""network-pkl"""'], {}), "('network-pkl')\n", (1800, 1815), False, 'import click\n'), ((1817, 1846), 'click.argument', 'click.argument', (['"""output-file"""... |
# Copyright 2016 ELIFE. All rights reserved.
# Use of this source code is governed by a MIT
# license that can be found in the LICENSE file.
"""
`Mutual information`_ (MI) is a measure of the amount of mutual dependence
between two random variables. When applied to time series, two time series are
used to construct the... | [
"ctypes.c_double",
"ctypes.c_int",
"pyinform.error.error_guard",
"ctypes.byref",
"numpy.empty",
"ctypes.c_ulong",
"pyinform.error.ErrorCode",
"numpy.amax",
"numpy.ascontiguousarray",
"ctypes.POINTER"
] | [((2479, 2519), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['xs'], {'dtype': 'np.int32'}), '(xs, dtype=np.int32)\n', (2499, 2519), True, 'import numpy as np\n'), ((2529, 2569), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['ys'], {'dtype': 'np.int32'}), '(ys, dtype=np.int32)\n', (2549, 2569), True, 'imp... |
#%%
#Importing packages
import matplotlib.pyplot as plt
import matplotlib.patches as ptch
import numpy as np
import math
from scipy.spatial.distance import euclidean
from scipy.optimize import minimize
#%%
#test dataget to make diagrams
#p,r,0 = passer, reciever, opponent
p,r,o = (2.8747200000000035, -6.010519999999... | [
"matplotlib.pyplot.xlim",
"scipy.optimize.minimize",
"matplotlib.pyplot.show",
"scipy.spatial.distance.euclidean",
"math.sqrt",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.Circle",
"numpy.linspace",
"matplotlib.pyplot.subplots"
] | [((2249, 2264), 'scipy.spatial.distance.euclidean', 'euclidean', (['p', 'r'], {}), '(p, r)\n', (2258, 2264), False, 'from scipy.spatial.distance import euclidean\n'), ((806, 848), 'math.sqrt', 'math.sqrt', (['((x1 - x0) ** 2 + (y1 - y0) ** 2)'], {}), '((x1 - x0) ** 2 + (y1 - y0) ** 2)\n', (815, 848), False, 'import mat... |
#!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# <NAME>, U.S. Geological Survey
# <NAME>, GNS Science
# <NAME>, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) ... | [
"numpy.array",
"pyre.components.Component.Component.__init__"
] | [((1188, 1235), 'pyre.components.Component.Component.__init__', 'Component.__init__', (['self', 'name'], {'facility': '"""mesh"""'}), "(self, name, facility='mesh')\n", (1206, 1235), False, 'from pyre.components.Component import Component\n'), ((1353, 1406), 'numpy.array', 'numpy.array', (['[0.0, -100000000.0]'], {'dty... |
import tensorflow as tf
from tensorlayer.layers import PadLayer,Conv2d,UpSampling2dLayer,InputLayer,ConcatLayer
import numpy as np
def upsampling_factor_padding(h_res,w_res):
res_temp = h_res
py =[res_temp%2]
while res_temp!=1:
res_temp = res_temp//2
py.append(res_temp%2)
del... | [
"numpy.flip",
"tensorflow.constant_initializer",
"numpy.ones",
"tensorflow.constant",
"tensorflow.variable_scope",
"numpy.append",
"tensorflow.tile",
"tensorflow.random_normal_initializer",
"tensorlayer.layers.InputLayer",
"tensorlayer.layers.UpSampling2dLayer",
"tensorlayer.layers.PadLayer",
... | [((341, 352), 'numpy.flip', 'np.flip', (['py'], {}), '(py)\n', (348, 352), True, 'import numpy as np\n'), ((517, 528), 'numpy.flip', 'np.flip', (['px'], {}), '(px)\n', (524, 528), True, 'import numpy as np\n'), ((967, 1010), 'tensorlayer.layers.PadLayer', 'PadLayer', (['batch_input', 'padding_d', '"""REFLECT"""'], {}),... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding 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-... | [
"numpy.result_type",
"itertools.chain.from_iterable"
] | [((6545, 6588), 'numpy.result_type', 'np.result_type', (['*[t.dtype for t in tensors]'], {}), '(*[t.dtype for t in tensors])\n', (6559, 6588), True, 'import numpy as np\n'), ((3571, 3612), 'itertools.chain.from_iterable', 'itertools.chain.from_iterable', (['raw_inputs'], {}), '(raw_inputs)\n', (3600, 3612), False, 'imp... |
import tensorflow as tf
import numpy as np
import argparse
import socket
import importlib
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = BASE_DIR
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(ROOT_DIR, 'models'))
sys.path.append(os.path.join(ROOT_DIR, 'utils'))
import mod... | [
"os.mkdir",
"numpy.sum",
"argparse.ArgumentParser",
"numpy.argmax",
"tensorflow.get_collection",
"tensorflow.ConfigProto",
"numpy.arange",
"os.path.join",
"sys.path.append",
"os.path.abspath",
"tensorflow.add_n",
"os.path.exists",
"socket.gethostname",
"tensorflow.placeholder",
"numpy.ra... | [((185, 210), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (200, 210), False, 'import sys\n'), ((382, 407), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (405, 407), False, 'import argparse\n'), ((1737, 1773), 'importlib.import_module', 'importlib.import_module', (... |
# coding=utf-8
# Copyright 2022 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... | [
"argparse.ArgumentParser",
"lego.data_process.dataloader.UnfoldedProgramDataloader",
"lego.common.utils.set_train_mode",
"lego.common.utils.construct_graph",
"lego.common.utils.set_global_seed",
"numpy.ones",
"numpy.mean",
"pickle.load",
"lego.model.synthesizer.BatchPowersetParser",
"lego.data_pro... | [((1447, 1590), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Training and Testing Knowledge Graph Embedding Models"""', 'usage': '"""train.py [<args>] [-h | --help]"""'}), "(description=\n 'Training and Testing Knowledge Graph Embedding Models', usage=\n 'train.py [<args>] [-h | ... |
import pandas as pd
import tensorflow as tf
import numpy as np
import json
import pickle
import logging
import time
import os
import sklearn
from sklearn import metrics
def compute_auc(labels, pred):
if len(labels) != len(pred):
print("error labels or pred")
return 0
sorted_pred = sorted(range(... | [
"tensorflow.trainable_variables",
"tensorflow.contrib.layers.l2_regularizer",
"tensorflow.contrib.layers.sparse_column_with_hash_bucket",
"tensorflow.clip_by_value",
"tensorflow.contrib.lookup.index_table_from_tensor",
"tensorflow.reshape",
"tensorflow.feature_column.input_layer",
"tensorflow.string_s... | [((4781, 4805), 'logging.getLogger', 'logging.getLogger', (['"""brc"""'], {}), "('brc')\n", (4798, 4805), False, 'import logging\n'), ((5881, 5892), 'time.time', 'time.time', ([], {}), '()\n', (5890, 5892), False, 'import time\n'), ((5913, 5925), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (5923, 5925), True,... |
import numpy as np
import math
from yt.units.yt_array import \
YTArray
prec_accum = {
np.int: np.int64,
np.int8: np.int64,
np.int16: np.int64,
np.int32: np.int64,
np.int64: np.int64,
np.uint8: np.uint64,
... | [
"numpy.abs",
"numpy.sum",
"numpy.arctan2",
"numpy.amin",
"numpy.resize",
"numpy.empty",
"numpy.ones",
"numpy.isnan",
"numpy.sin",
"numpy.linalg.norm",
"numpy.tile",
"numpy.inner",
"numpy.zeros_like",
"numpy.power",
"numpy.reshape",
"numpy.radians",
"math.sqrt",
"numpy.cross",
"nu... | [((730, 745), 'numpy.dtype', 'np.dtype', (['"""int"""'], {}), "('int')\n", (738, 745), True, 'import numpy as np\n'), ((768, 784), 'numpy.dtype', 'np.dtype', (['"""int8"""'], {}), "('int8')\n", (776, 784), True, 'import numpy as np\n'), ((806, 823), 'numpy.dtype', 'np.dtype', (['"""int16"""'], {}), "('int16')\n", (814,... |
from __future__ import print_function
from collections import defaultdict
from datetime import datetime
import os
import json
import numpy as np
from torch.utils.data import DataLoader
import logging
try:
import pygraphviz as pgv
enable_graph = True
except:
print("Cannot import graphviz package")
... | [
"json.dump",
"os.remove",
"os.makedirs",
"os.path.basename",
"torch.autograd.Variable",
"os.rename",
"os.path.dirname",
"os.path.exists",
"imageio.imread",
"numpy.ones",
"datetime.datetime.now",
"logging.info",
"pygraphviz.AGraph",
"torch.Tensor",
"numpy.array",
"os.path.splitext",
"... | [((7873, 7914), 'os.path.join', 'os.path.join', (['args.data_dir', 'args.dataset'], {}), '(args.data_dir, args.dataset)\n', (7885, 7914), False, 'import os\n'), ((8157, 8200), 'os.path.join', 'os.path.join', (['args.model_dir', '"""params.json"""'], {}), "(args.model_dir, 'params.json')\n", (8169, 8200), False, 'import... |
import numpy as np
import pandas as pd
import nltk
from nltk.corpus import stopwords
import torch
from torchtext.legacy import data
from torchtext.vocab import Vectors
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from string import punctuation
import re
import spacy
from sklear... | [
"torch.nn.Dropout",
"pickle.dump",
"numpy.argmax",
"torch.nn.Embedding",
"torchtext.vocab.Vectors",
"torch.cat",
"pathlib.Path",
"numpy.mean",
"pickle.load",
"nltk.download",
"torch.no_grad",
"torchtext.legacy.data.TabularDataset",
"pandas.DataFrame",
"torch.load",
"spacy.load",
"numpy... | [((650, 679), 'spacy.load', 'spacy.load', (['"""ru_core_news_lg"""'], {}), "('ru_core_news_lg')\n", (660, 679), False, 'import spacy\n'), ((680, 706), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (693, 706), False, 'import nltk\n'), ((719, 745), 'nltk.corpus.stopwords.words', 'stopwor... |
#!/usr/bin/env python
import ast
import configparser
import os
os.environ['QT_QPA_PLATFORM'] = 'offscreen'
import pickle
import sys
sys.path.insert(1, os.path.dirname(sys.path[0]))
__package__ = 'running_times'
import numpy as np
init_survival_estimator_name = 'deephit'
survival_estimator_name = 'nks_mlp_init_deephi... | [
"pickle.dump",
"numpy.std",
"os.path.dirname",
"os.path.isfile",
"numpy.max",
"pickle.load",
"numpy.loadtxt",
"numpy.mean",
"ast.literal_eval",
"configparser.ConfigParser",
"os.path.join",
"sys.exit"
] | [((481, 508), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (506, 508), False, 'import configparser\n'), ((881, 928), 'ast.literal_eval', 'ast.literal_eval', (["config['DEFAULT']['datasets']"], {}), "(config['DEFAULT']['datasets'])\n", (897, 928), False, 'import ast\n'), ((1109, 1160), 'as... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.python.ops.linalg_ops.self_adjoint_eig",
"tensorflow.contrib.kfac.python.ops.utils.on_tpu",
"tensorflow.python.ops.array_ops.reshape",
"six.add_metaclass",
"tensorflow.python.ops.math_ops.maximum",
"tensorflow.python.training.moving_averages.assign_moving_average",
"tensorflow.python.ops.lin... | [((7315, 7345), 'six.add_metaclass', 'six.add_metaclass', (['abc.ABCMeta'], {}), '(abc.ABCMeta)\n', (7332, 7345), False, 'import six\n'), ((3537, 3565), 'tensorflow.python.ops.array_ops.ones', 'array_ops.ones', (['shape', 'dtype'], {}), '(shape, dtype)\n', (3551, 3565), False, 'from tensorflow.python.ops import array_o... |
from __future__ import division, absolute_import, print_function
import sys, warnings
import numpy as np
from numpy import array, arange, nditer, all
from numpy.compat import asbytes, sixu
from numpy.testing import *
def iter_multi_index(i):
ret = []
while not i.finished:
ret.append(i.multi_index)
... | [
"numpy.sum",
"numpy.ones",
"numpy.arange",
"numpy.float64",
"numpy.prod",
"warnings.simplefilter",
"sys.getrefcount",
"numpy.int32",
"numpy.compat.asbytes",
"numpy.complex128",
"numpy.lib.stride_tricks.as_strided",
"numpy.all",
"numpy.concatenate",
"numpy.matrix",
"numpy.compat.sixu",
... | [((704, 713), 'numpy.arange', 'arange', (['(6)'], {}), '(6)\n', (710, 713), False, 'from numpy import array, arange, nditer, all\n'), ((764, 782), 'sys.getrefcount', 'sys.getrefcount', (['a'], {}), '(a)\n', (779, 782), False, 'import sys, warnings\n'), ((795, 814), 'sys.getrefcount', 'sys.getrefcount', (['dt'], {}), '(... |
"""
Training script for scene graph detection. Integrated with my faster rcnn setup
"""
from dataloaders.visual_genome import VGDataLoader, VG
import numpy as np
from torch import optim
import torch
import pandas as pd
import time
import os
from tensorboardX import SummaryWriter
from config import ModelConfig, BOX_SC... | [
"lib.pytorch_misc.set_random_seed",
"dataloaders.visual_genome.VG.splits",
"lib.pytorch_misc.add_module_summary",
"numpy.mean",
"torch.load",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"lib.shz_models.rel_model_fusion_beta.RelModel",
"lib.pytorch_misc.optimistic_restore",
"pandas.concat",
"lib.... | [((745, 758), 'config.ModelConfig', 'ModelConfig', ([], {}), '()\n', (756, 758), False, 'from config import ModelConfig, BOX_SCALE, IM_SCALE\n'), ((1659, 1881), 'dataloaders.visual_genome.VG.splits', 'VG.splits', ([], {'num_val_im': 'conf.val_size', 'filter_duplicate_rels': '(True)', 'use_proposals': 'conf.use_proposal... |
import numpy as np
import math
from functools import partial
import torch
class LRSchedulerStep(object):
def __init__(self, fai_optimizer, total_step, lr_phases, mom_phases):
self.optimizer = fai_optimizer
self.total_step = total_step
self.lr_phases = []
for i, (start, lambda_func... | [
"functools.partial",
"matplotlib.pyplot.show",
"numpy.cos",
"matplotlib.pyplot.plot"
] | [((5583, 5596), 'matplotlib.pyplot.plot', 'plt.plot', (['lrs'], {}), '(lrs)\n', (5591, 5596), True, 'import matplotlib.pyplot as plt\n'), ((5660, 5670), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (5668, 5670), True, 'import matplotlib.pyplot as plt\n'), ((2526, 2545), 'numpy.cos', 'np.cos', (['(np.pi * pct... |
import logging
from functools import cached_property
import numpy as np
import pandas as pd
from scipy import stats
from .api import (
get_worldrowing_data, get_race_results, get_worldrowing_record,
find_world_best_time, INTERMEDIATE_FIELDS
)
from .utils import (
extract_fields, format_yaxis_splits, make... | [
"pandas.DataFrame",
"scipy.stats.norm",
"pandas.DataFrame.from_dict",
"pandas.merge",
"numpy.zeros",
"numpy.ndim",
"numpy.hstack",
"numpy.diff",
"numpy.ma.masked_array",
"numpy.linspace",
"matplotlib.pyplot.gca",
"numpy.interp",
"numpy.diag",
"matplotlib.pyplot.subplots",
"logging.getLog... | [((422, 467), 'logging.getLogger', 'logging.getLogger', (['"""world_rowing.livetracker"""'], {}), "('world_rowing.livetracker')\n", (439, 467), False, 'import logging\n'), ((18371, 18397), 'numpy.diff', 'np.diff', (['distances'], {'axis': '(0)'}), '(distances, axis=0)\n', (18378, 18397), True, 'import numpy as np\n'), ... |
from __future__ import print_function, division
import numpy as np
from PyAstronomy.pyaC import pyaErrors as PE
import six.moves as smo
class _Gdl:
def __init__(self, vsini, epsilon):
"""
Calculate the broadening profile.
Parameters
----------
vsini : float
Projected r... | [
"numpy.sum",
"numpy.abs",
"numpy.floor",
"PyAstronomy.pyaC.pyaErrors.PyAValError",
"numpy.ones",
"numpy.mean",
"numpy.where",
"numpy.arange",
"numpy.convolve",
"numpy.concatenate",
"numpy.sqrt"
] | [((3400, 3534), 'PyAstronomy.pyaC.pyaErrors.PyAValError', 'PE.PyAValError', (['"""Input wavelength array is not evenly spaced."""'], {'where': '"""pyasl.rotBroad"""', 'solution': '"""Use evenly spaced input array."""'}), "('Input wavelength array is not evenly spaced.', where=\n 'pyasl.rotBroad', solution='Use evenl... |
'''Utility file.'''
import re
import ast
import copy
import platform
import six
from six import iteritems
import numpy as np
import pandas as pd
from lxml import objectify
from lxml.builder import ElementMaker
from pptx.util import Inches
from pptx.dml.color import RGBColor
from pptx.enum.base import EnumValue
from ppt... | [
"copy.deepcopy",
"lxml.builder.ElementMaker",
"numpy.nan_to_num",
"gramex.transforms.build_transform",
"numpy.zeros",
"numpy.isinf",
"numpy.nanmin",
"numpy.isnan",
"platform.system",
"pptx.util.Inches",
"numpy.array",
"lxml.objectify.fromstring",
"ast.literal_eval",
"numpy.log10",
"six.i... | [((4725, 4753), 'copy.deepcopy', 'copy.deepcopy', (['shape.element'], {}), '(shape.element)\n', (4738, 4753), False, 'import copy\n'), ((4976, 5013), 'six.iteritems', 'six.iteritems', (['source_slide.part.rels'], {}), '(source_slide.part.rels)\n', (4989, 5013), False, 'import six\n'), ((7183, 7210), 'pptx.util.Inches',... |
import os
import time
from importlib import reload
import numpy as np
from matplotlib import pyplot as plt
from fusilib.io import righw, spikeglx, phy
def mk_block_times_contiguous(block_times, verbose=True):
'''Concatenate a list of block times so that they are contiguous
Parameters
----------
bloc... | [
"numpy.linalg.lstsq",
"numpy.logical_and",
"unittest.TestCase",
"numpy.isscalar",
"numpy.asarray",
"numpy.allclose",
"time.time",
"numpy.hstack",
"numpy.diff",
"numpy.arange",
"numpy.round"
] | [((960, 987), 'numpy.hstack', 'np.hstack', (['contiguous_times'], {}), '(contiguous_times)\n', (969, 987), True, 'import numpy as np\n'), ((1532, 1543), 'time.time', 'time.time', ([], {}), '()\n', (1541, 1543), False, 'import time\n'), ((1784, 1802), 'numpy.asarray', 'np.asarray', (['atimes'], {}), '(atimes)\n', (1794,... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import xavier_init
from mmdet.core import AnchorGenerator, anchor_target, multi_apply
from ..losses import smooth_l1_loss
from ..registry import HEADS
from .anchor_head import AnchorHead
def set_bn_to_eval(m):
cla... | [
"torch.nn.ModuleList",
"torch.LongTensor",
"mmdet.core.anchor_target",
"torch.nn.Conv2d",
"mmdet.core.AnchorGenerator",
"torch.nn.functional.cross_entropy",
"numpy.floor",
"torch.cat",
"torch.nn.BatchNorm2d",
"mmcv.cnn.xavier_init",
"mmdet.core.multi_apply",
"numpy.sqrt"
] | [((780, 922), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': 'in_channels', 'out_channels': 'in_channels', 'kernel_size': 'kernel_size', 'groups': 'in_channels', 'stride': 'stride', 'padding': 'padding'}), '(in_channels=in_channels, out_channels=in_channels, kernel_size=\n kernel_size, groups=in_channels, stri... |
import cv2
import numpy as np
import pyautogui
import pygetwindow as gw
import sys
# the window name, e.g "notepad", "Chrome", etc.
window_name = sys.argv[1]
# define the codec
fourcc = cv2.VideoWriter_fourcc(*"XVID")
# frames per second
fps = 12.0
# the time you want to record in seconds
record_seconds = 10
# search... | [
"cv2.VideoWriter_fourcc",
"cv2.cvtColor",
"cv2.waitKey",
"pyautogui.screenshot",
"cv2.imshow",
"pygetwindow.getWindowsWithTitle",
"numpy.array",
"cv2.destroyAllWindows"
] | [((188, 219), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (["*'XVID'"], {}), "(*'XVID')\n", (210, 219), False, 'import cv2\n'), ((1118, 1141), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1139, 1141), False, 'import cv2\n'), ((389, 424), 'pygetwindow.getWindowsWithTitle', 'gw.getWindowsW... |
import bakefont3 as bf3
from PIL import Image
import numpy as np
import freetype
import copy
class Render(bf3.Cube):
__slots__ = [
'image', 'bitmap_left', 'bitmap_top',
'horiBearingX', 'horiBearingY', 'horiAdvance',
'vertBearingX', 'vertBearingY', 'vertAdvance'
]
def __init__(self... | [
"PIL.Image.fromarray",
"numpy.zeros"
] | [((1030, 1077), 'numpy.zeros', 'np.zeros', ([], {'shape': '(height, width)', 'dtype': 'np.uint8'}), '(shape=(height, width), dtype=np.uint8)\n', (1038, 1077), True, 'import numpy as np\n'), ((1704, 1734), 'PIL.Image.fromarray', 'Image.fromarray', (['arr'], {'mode': '"""L"""'}), "(arr, mode='L')\n", (1719, 1734), False,... |
"""
# Author : <NAME>
# Experiment : PRECOG_Carla
# Note : Dataset-specific script to read dataset (JSON files), modified from carla_json_loader.py of https://github.com/nrhine1/precog_carla_dataset
"""
import numpy as np
import math, json, os
import matplotlib.pyplot as plt
import attrdict
from random imp... | [
"torch.utils.data.DataLoader",
"numpy.asarray",
"os.path.isfile",
"numpy.random.randint",
"attrdict.AttrDict",
"os.listdir",
"numpy.random.shuffle"
] | [((2021, 2144), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['dataset'], {'batch_size': 'batch_size', 'sampler': 'trainset_sampler', 'num_workers': 'N', 'pin_memory': '(False)'}), '(dataset, batch_size=batch_size, sampler=\n trainset_sampler, num_workers=N, pin_memory=False)\n', (2048, 2144), Fals... |
import numpy as np
from aif360.datasets import BinaryLabelDataset
from aif360.algorithms import Transformer
class ARTClassifier(Transformer):
"""Wraps an instance of an :obj:`art.classifiers.Classifier` to extend
:obj:`~aif360.algorithms.Transformer`.
"""
def __init__(self, art_classifier):
... | [
"numpy.argmax"
] | [((1908, 1938), 'numpy.argmax', 'np.argmax', (['pred_labels'], {'axis': '(1)'}), '(pred_labels, axis=1)\n', (1917, 1938), True, 'import numpy as np\n')] |
import numpy as np
from os.path import join
class ConfigMorphV0:
# data paths
img_folder = '/hdd/2020/Research/datasets/Agedataset/img'
# dataset_path = '/hdd2/2019/datasets/results_AADB/datasetImages_warp256'
train_list = '/hdd/2020/Research/datasets/Agedataset/morph_fold/Setting_B/Setting_2_S1_train... | [
"numpy.log",
"numpy.linspace"
] | [((471, 489), 'numpy.log', 'np.log', (['age_minmax'], {}), '(age_minmax)\n', (477, 489), True, 'import numpy as np\n'), ((1324, 1365), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'num_quantization_level'], {}), '(0, 1, num_quantization_level)\n', (1335, 1365), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
"""
Unit tests for fit_constrained
Tests for Poisson and Binomial are in discrete
Created on Sun Jan 7 09:21:39 2018
Author: <NAME>
"""
import warnings
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from statsmodels.genmod.families import family
from statsmodel... | [
"statsmodels.regression.linear_model.WLS",
"numpy.random.seed",
"statsmodels.genmod.generalized_linear_model.GLM",
"numpy.eye",
"numpy.random.randn",
"warnings.simplefilter",
"numpy.asarray",
"statsmodels.genmod.families.family.Binomial",
"statsmodels.regression.linear_model.OLS",
"numpy.array",
... | [((651, 673), 'numpy.random.seed', 'np.random.seed', (['(987125)'], {}), '(987125)\n', (665, 673), True, 'import numpy as np\n'), ((686, 719), 'numpy.random.randn', 'np.random.randn', (['nobs', '(k_exog - 1)'], {}), '(nobs, k_exog - 1)\n', (701, 719), True, 'import numpy as np\n'), ((732, 747), 'statsmodels.tools.tools... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.compat.v2.nest.map_structure",
"tensorflow.compat.v2.__internal__.test.combinations.combine",
"keras.optimizers.optimizer_v2.gradient_descent.SGD",
"numpy.ones",
"keras.layers.Input",
"keras.losses.binary_crossentropy",
"tensorflow.compat.v2.GradientTape",
"tensorflow.compat.v2.data.Datase... | [((1381, 1546), 'tensorflow.compat.v2.__internal__.test.combinations.combine', 'tf.__internal__.test.combinations.combine', ([], {'distribution': '(strategy_combinations.all_strategies + strategy_combinations.\n multiworker_strategies)', 'mode': "['eager']"}), "(distribution=\n strategy_combinations.all_strategie... |
from __future__ import division
from collections import deque
import os
import warnings
import numpy as np
import tensorflow.keras.backend as K
import tensorflow.keras.optimizers as optimizers
from rl.core import Agent
from rl.random import OrnsteinUhlenbeckProcess
from rl.util import *
def mean_q(y_true, y_pred):
... | [
"tensorflow.keras.backend.backend",
"tensorflow.keras.backend.mean",
"tensorflow.keras.optimizers.get",
"tensorflow.keras.backend.learning_phase",
"tensorflow.keras.backend.max",
"numpy.array",
"os.path.splitext"
] | [((338, 360), 'tensorflow.keras.backend.max', 'K.max', (['y_pred'], {'axis': '(-1)'}), '(y_pred, axis=-1)\n', (343, 360), True, 'import tensorflow.keras.backend as K\n'), ((7543, 7569), 'os.path.splitext', 'os.path.splitext', (['filepath'], {}), '(filepath)\n', (7559, 7569), False, 'import os\n'), ((7911, 7937), 'os.pa... |
import inspect
import logging
from typing import Dict, Optional
import numpy as np
import pandas as pd
from great_expectations.core import ExpectationConfiguration
from great_expectations.exceptions import InvalidExpectationConfigurationError
from great_expectations.execution_engine import (
ExecutionEngine,
... | [
"great_expectations.expectations.core.expect_column_values_to_be_of_type._get_dialect_type_module",
"great_expectations.expectations.util.add_values_with_json_schema_from_list_in_params",
"inspect.isclass",
"great_expectations.expectations.registry.get_metric_kwargs",
"numpy.dtype",
"great_expectations.re... | [((1216, 1243), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1233, 1243), False, 'import logging\n'), ((9854, 9901), 'great_expectations.render.renderer.renderer.renderer', 'renderer', ([], {'renderer_type': '"""renderer.prescriptive"""'}), "(renderer_type='renderer.prescriptive')\n", ... |
import os
import glob
import pickle
import cv2
import numpy as np
import matplotlib.pyplot as plt
from moviepy.editor import VideoFileClip
# Parameters for calibration
mtx = []
dist = []
calibration_file = "calibration_pickle.p"
# Parameters for gradient threshold
ksize = 7
gradx_thresh = (50, 255)
grady_thresh = (50... | [
"numpy.absolute",
"numpy.arctan2",
"numpy.polyfit",
"cv2.getPerspectiveTransform",
"matplotlib.pyplot.clf",
"numpy.argmax",
"numpy.mean",
"glob.glob",
"cv2.undistort",
"cv2.warpPerspective",
"numpy.zeros_like",
"numpy.int_",
"numpy.copy",
"cv2.cvtColor",
"matplotlib.pyplot.imshow",
"os... | [((504, 538), 'numpy.zeros', 'np.zeros', (['(ny * nx, 3)', 'np.float32'], {}), '((ny * nx, 3), np.float32)\n', (512, 538), True, 'import numpy as np\n'), ((816, 856), 'glob.glob', 'glob.glob', (['"""camera_cal/calibration*.jpg"""'], {}), "('camera_cal/calibration*.jpg')\n", (825, 856), False, 'import glob\n'), ((1626, ... |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.python.data.ops.dataset_ops.Dataset.zip",
"tensorflow.python.util.tf_export.keras_export",
"tensorflow.python.ops.io_ops.read_file",
"tensorflow.python.keras.preprocessing.dataset_utils.get_training_or_validation_split",
"numpy.random.randint",
"tensorflow.python.keras.preprocessing.dataset_ut... | [((1128, 1198), 'tensorflow.python.util.tf_export.keras_export', 'keras_export', (['"""keras.preprocessing.text_dataset_from_directory"""'], {'v1': '[]'}), "('keras.preprocessing.text_dataset_from_directory', v1=[])\n", (1140, 1198), False, 'from tensorflow.python.util.tf_export import keras_export\n'), ((6124, 6280), ... |
import numpy as np
import copy
from scipy import optimize
from scipy.linalg import cholesky, cho_solve
class log_likelihood(object):
"""Return and optimize (if requested) the log likelihood of gaussian process.
:param X: Coordinates of the field. (n_samples, 1 or 2)
:param y: Values of the fiel... | [
"copy.deepcopy",
"scipy.optimize.minimize",
"numpy.log",
"scipy.linalg.cholesky",
"scipy.linalg.cho_solve",
"numpy.dot",
"numpy.diag"
] | [((1718, 1771), 'scipy.optimize.minimize', 'optimize.minimize', (['_minus_logl', 'p0'], {'method': '"""L-BFGS-B"""'}), "(_minus_logl, p0, method='L-BFGS-B')\n", (1735, 1771), False, 'from scipy import optimize\n'), ((1881, 1902), 'copy.deepcopy', 'copy.deepcopy', (['kernel'], {}), '(kernel)\n', (1894, 1902), False, 'im... |
import csv
import cv2
import numpy as np
from PIL import Image
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.layers import Flatten, Dense, Lambda
from tensorflow.keras.layers import Dense, Activation, Flatten, Dropout
from ten... | [
"matplotlib.pyplot.title",
"tensorflow.image.resize_images",
"tensorflow.keras.layers.Cropping2D",
"csv.reader",
"tensorflow.keras.layers.Conv2D",
"matplotlib.pyplot.plot",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"PIL.Image.open",
"numpy.array",
"tensorflow.keras.mode... | [((2171, 2189), 'numpy.array', 'np.array', (['aug_mens'], {}), '(aug_mens)\n', (2179, 2189), True, 'import numpy as np\n'), ((2198, 2218), 'numpy.array', 'np.array', (['aug_images'], {}), '(aug_images)\n', (2206, 2218), True, 'import numpy as np\n'), ((2274, 2299), 'numpy.array', 'np.array', (['steering_angles'], {}), ... |
# coding=utf-8
import tensorflow as tf
import re
import numpy as np
import globals as g_
FLAGS = tf.app.flags.FLAGS
# Basic model parameters.
tf.app.flags.DEFINE_integer('batch_size', g_.BATCH_SIZE,
"""Number of images to process in a batch.""")
tf.app.flags.DEFINE_float('learning_rate', g_... | [
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.app.flags.DEFINE_float",
"numpy.load",
"tensorflow.nn.zero_fraction",
"tensorflow.trainable_variables",
"tensorflow.get_collection",
"tensorflow.constant_initializer",
"tensorflow.reshape",
"tensorflow.matmul",
"tensorflow.nn.conv2d",
"... | [((143, 246), 'tensorflow.app.flags.DEFINE_integer', 'tf.app.flags.DEFINE_integer', (['"""batch_size"""', 'g_.BATCH_SIZE', '"""Number of images to process in a batch."""'], {}), "('batch_size', g_.BATCH_SIZE,\n 'Number of images to process in a batch.')\n", (170, 246), True, 'import tensorflow as tf\n'), ((275, 370)... |
# -*- coding: utf-8 -*-
"""
Various useful functions
"""
# Author: <NAME> <<EMAIL>>
#
# License: MIT License
from functools import reduce
import time
import numpy as np
from scipy.spatial.distance import cdist
import sys
import warnings
from inspect import signature
from .backend import get_backend
__time_tic_toc =... | [
"scipy.spatial.distance.cdist",
"numpy.sum",
"warnings.simplefilter",
"numpy.log",
"numpy.median",
"numpy.ones",
"numpy.random.RandomState",
"time.time",
"warnings.filters.pop",
"numpy.max",
"inspect.signature",
"numpy.array",
"numpy.arange",
"warnings.catch_warnings",
"functools.reduce"... | [((321, 332), 'time.time', 'time.time', ([], {}), '()\n', (330, 332), False, 'import time\n'), ((452, 463), 'time.time', 'time.time', ([], {}), '()\n', (461, 463), False, 'import time\n'), ((573, 584), 'time.time', 'time.time', ([], {}), '()\n', (582, 584), False, 'import time\n'), ((740, 751), 'time.time', 'time.time'... |
"""Automated rejection and repair of trials in M/EEG."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import os.path as op
from functools import partial
import numpy as np
from scipy.stats.distributions import uniform
from joblib import Parallel, delayed
import mne
from mne i... | [
"numpy.sum",
"numpy.invert",
"mne.pick_types",
"sklearn.model_selection.cross_val_score",
"numpy.ones",
"numpy.isnan",
"numpy.argsort",
"os.path.isfile",
"numpy.mean",
"matplotlib.colors.ListedColormap",
"numpy.unique",
"sklearn.model_selection.check_cv",
"sklearn.model_selection.RandomizedS... | [((3703, 3739), 'mne.externals.h5io.read_hdf5', 'read_hdf5', (['fname'], {'title': '"""autoreject"""'}), "(fname, title='autoreject')\n", (3712, 3739), False, 'from mne.externals.h5io import read_hdf5, write_hdf5\n'), ((6885, 6897), 'sklearn.model_selection.check_cv', 'check_cv', (['cv'], {}), '(cv)\n', (6893, 6897), F... |
from os import listdir
from os.path import expanduser
from random import shuffle
from matplotlib import pyplot
import numpy as np
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
from keras.utils import to_categorical
from keras.models import Sequential
from keras.layers i... | [
"random.shuffle",
"sklearn.metrics.accuracy_score",
"numpy.asarray",
"keras.models.Sequential",
"keras.layers.Flatten",
"sklearn.preprocessing.LabelEncoder",
"keras.utils.np_utils.to_categorical",
"keras.layers.Dense",
"keras.layers.Conv2D",
"sklearn.metrics.confusion_matrix",
"os.path.expanduse... | [((845, 874), 'random.shuffle', 'shuffle', (['training_image_files'], {}), '(training_image_files)\n', (852, 874), False, 'from random import shuffle\n'), ((1136, 1150), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (1148, 1150), False, 'from sklearn.preprocessing import LabelEncoder\n'), ((12... |
from math import log
import numpy as np
import functools
import tree
from ray.rllib.models.action_dist import ActionDistribution
from ray.rllib.utils import MIN_LOG_NN_OUTPUT, MAX_LOG_NN_OUTPUT, \
SMALL_NUMBER
from ray.rllib.utils.annotations import override, DeveloperAPI
from ray.rllib.utils.framework import try_... | [
"numpy.sum",
"ray.rllib.utils.spaces.space_utils.get_base_struct_from_space",
"ray.rllib.models.action_dist.ActionDistribution.__init__",
"numpy.less",
"numpy.log",
"ray.rllib.utils.annotations.override",
"tree.unflatten_as",
"math.log",
"ray.rllib.utils.framework.try_import_tfp",
"tree.flatten",
... | [((436, 451), 'ray.rllib.utils.framework.try_import_tf', 'try_import_tf', ([], {}), '()\n', (449, 451), False, 'from ray.rllib.utils.framework import try_import_tf, try_import_tfp\n'), ((458, 474), 'ray.rllib.utils.framework.try_import_tfp', 'try_import_tfp', ([], {}), '()\n', (472, 474), False, 'from ray.rllib.utils.f... |
# Heuristica y Optimizacion. Practica 2. Parte 1: Asignacion de antenas de transmision a satelites
from constraint import *
import numpy as np
problem = Problem()
# VARIABLES DE SATELITES, cada satelite corresponde a una franja, los satelites 3 y 6 tienen dos franjas asignadas, por lo que se les toma como version... | [
"numpy.savetxt"
] | [((2418, 2469), 'numpy.savetxt', 'np.savetxt', (['f', 'solutions'], {'delimiter': '""" """', 'fmt': '"""%s"""'}), "(f, solutions, delimiter=' ', fmt='%s')\n", (2428, 2469), True, 'import numpy as np\n')] |
import argparse
import glob
from os import PathLike
from pathlib import Path
from subprocess import Popen, PIPE
import sys
from typing import List, Union
import numpy as np
import pandas as pd
from schrodinger import structure
from schrodinger.structutils import analyze, measure
def lig_avg_bfact(lig:analyze.Ligand)... | [
"subprocess.Popen",
"argparse.ArgumentParser",
"schrodinger.structure.StructureReader",
"schrodinger.structutils.analyze.find_ligands",
"pathlib.Path",
"numpy.array",
"sys.stdout.flush",
"glob.glob",
"schrodinger.structutils.measure.get_atoms_close_to_structure"
] | [((1255, 1315), 'schrodinger.structutils.measure.get_atoms_close_to_structure', 'measure.get_atoms_close_to_structure', (['cplx', 'lig.st', 'distance'], {}), '(cplx, lig.st, distance)\n', (1291, 1315), False, 'from schrodinger.structutils import analyze, measure\n'), ((1691, 1705), 'pathlib.Path', 'Path', (['base_dir']... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"atexit.register",
"numpy.empty",
"official.recommendation.popen_helper.get_forkpool",
"official.recommendation.stat_utils.mask_duplicates",
"tensorflow.zeros_like",
"numpy.iinfo",
"official.recommendation.stat_utils.very_slightly_biased_randint",
"tensorflow.io.gfile.makedirs",
"official.recommenda... | [((3652, 3665), 'six.moves.queue.Queue', 'queue.Queue', ([], {}), '()\n', (3663, 3665), False, 'from six.moves import queue\n'), ((3883, 3921), 'os.path.join', 'os.path.join', (['self._shard_root', 'subdir'], {}), '(self._shard_root, subdir)\n', (3895, 3921), False, 'import os\n'), ((6043, 6102), 'tensorflow.cast', 'tf... |
""" Defines the Label class.
"""
from __future__ import with_statement
# Major library imports
from math import cos, sin, pi
from numpy import array, dot
# Enthought library imports
from enable.api import black_color_trait, transparent_color_trait
from kiva.constants import FILL
from kiva.trait_defs.kiva_font_trait ... | [
"traits.api.Float",
"traits.api.Any",
"traits.api.on_trait_change",
"kiva.trait_defs.kiva_font_trait.KivaFont",
"traits.api.Int",
"traits.api.Bool",
"math.sin",
"traits.api.List",
"traits.api.HasTraits.__init__",
"numpy.array",
"math.cos"
] | [((1429, 1437), 'traits.api.Float', 'Float', (['(0)'], {}), '(0)\n', (1434, 1437), False, 'from traits.api import Any, Bool, Enum, Float, HasTraits, Int, List, Str, on_trait_change\n'), ((1675, 1681), 'traits.api.Int', 'Int', (['(0)'], {}), '(0)\n', (1678, 1681), False, 'from traits.api import Any, Bool, Enum, Float, H... |
# Written by <NAME>, 2017
import numpy as np
import random
from sdr import SDR
# TODO: This should use or at least print the radius, ie the distance at which
# two numbers will have 50% overlap. Radius is a replacement for resolution.
class RandomDistributedScalarEncoder:
"""https://arxiv.org/pdf/1602.05925.pdf... | [
"numpy.random.uniform",
"numpy.logical_and",
"sdr.SDR",
"numpy.zeros",
"numpy.array",
"numpy.random.normal"
] | [((439, 451), 'sdr.SDR', 'SDR', (['(size,)'], {}), '((size,))\n', (442, 451), False, 'from sdr import SDR\n'), ((707, 737), 'numpy.zeros', 'np.zeros', (['size'], {'dtype': 'np.uint8'}), '(size, dtype=np.uint8)\n', (715, 737), True, 'import numpy as np\n'), ((1702, 1714), 'sdr.SDR', 'SDR', (['(size,)'], {}), '((size,))\... |
# coding=utf-8
# Copyright 2021 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.compat.v2.io.gfile.exists",
"functools.partial",
"tensorflow.compat.v2.nest.map_structure",
"tensorflow_datasets.core.tfrecords_reader._make_id_dataset",
"random.Random",
"os.path.dirname",
"tensorflow.compat.v2.data.experimental.assert_cardinality",
"numpy.random.RandomState",
"contextl... | [((1825, 1836), 'enum.auto', 'enum.auto', ([], {}), '()\n', (1834, 1836), False, 'import enum\n'), ((1850, 1861), 'enum.auto', 'enum.auto', ([], {}), '()\n', (1859, 1861), False, 'import enum\n'), ((1876, 1887), 'enum.auto', 'enum.auto', ([], {}), '()\n', (1885, 1887), False, 'import enum\n'), ((5079, 5112), 'tensorflo... |
""" MSE """
# import multiprocessing
import threading
import numpy as np
import os
import shutil
import matplotlib.pyplot as plt
import tensorflow as tf
import math
import pickle
import sympy as sym
from scipy import signal
import random
np.random.seed(42)
# PARAMETERS
OUTPUT_GRAPH = False # save lo... | [
"matplotlib.pyplot.title",
"pickle.dump",
"tensorflow.train.Coordinator",
"numpy.random.seed",
"tensorflow.clip_by_value",
"tensorflow.get_collection",
"tensorflow.constant_initializer",
"tensorflow.train.RMSPropOptimizer",
"numpy.clip",
"matplotlib.pyplot.figure",
"numpy.sin",
"pickle.load",
... | [((253, 271), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (267, 271), True, 'import numpy as np\n'), ((1057, 1079), 'numpy.array', 'np.array', (['[0.02, 0.02]'], {}), '([0.02, 0.02])\n', (1065, 1079), True, 'import numpy as np\n'), ((1081, 1101), 'numpy.array', 'np.array', (['[2.0, 2.0]'], {}), '([... |
import datetime
import re
from warnings import (
catch_warnings,
simplefilter,
)
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
import pandas as pd
from pandas import (
DataFrame,
HDFStore,
Index,
Int64Index,
MultiIndex,
RangeIndex,
... | [
"pandas.HDFStore",
"pandas._libs.tslibs.Timestamp",
"pandas.Int64Index",
"numpy.arange",
"pandas.set_option",
"pandas.tests.io.pytables.common.ensure_clean_store",
"pandas.DataFrame",
"warnings.simplefilter",
"numpy.random.randn",
"pandas.tests.io.pytables.common.ensure_clean_path",
"pandas._tes... | [((616, 640), 'pandas.DataFrame', 'DataFrame', (["{'A': [1, 2]}"], {}), "({'A': [1, 2]})\n", (625, 640), False, 'from pandas import DataFrame, HDFStore, Index, Int64Index, MultiIndex, RangeIndex, Series, _testing as tm, concat\n'), ((5287, 5309), 'pandas._testing.makeTimeDataFrame', 'tm.makeTimeDataFrame', ([], {}), '(... |
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
Index,
Interval,
IntervalIndex,
Timedelta,
Timestamp,
date_range,
timedelta_range,
)
import pandas._testing as tm
from pandas.core.arrays import IntervalArray
@pytest.fixtu... | [
"pyarrow.table",
"pandas.util._test_decorators.skip_if_no",
"pandas._testing.assert_interval_array_equal",
"pandas.Interval",
"pandas.core.arrays.IntervalArray.from_breaks",
"pytest.mark.parametrize",
"pandas._testing.assert_numpy_array_equal",
"pandas.DataFrame",
"pandas.core.arrays.IntervalArray.f... | [((5595, 5641), 'pandas.util._test_decorators.skip_if_no', 'td.skip_if_no', (['"""pyarrow"""'], {'min_version': '"""0.16.0"""'}), "('pyarrow', min_version='0.16.0')\n", (5608, 5641), True, 'import pandas.util._test_decorators as td\n'), ((1327, 1397), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""construc... |
# pylint: disable=no-self-use
import numpy
from keras.layers import Input, Embedding, merge
from keras.models import Model
import keras.backend as K
from deep_qa.layers.encoders import AttentiveGru
class TestAttentiveGRU:
def test_on_unmasked_input(self):
sentence_length = 5
embedding_dim = 10
... | [
"numpy.array_equal",
"keras.backend.expand_dims",
"numpy.asarray",
"keras.models.Model",
"keras.layers.Embedding",
"keras.layers.Input",
"deep_qa.layers.encoders.AttentiveGru",
"keras.layers.merge"
] | [((371, 417), 'keras.layers.Input', 'Input', ([], {'shape': '(sentence_length,)', 'dtype': '"""int32"""'}), "(shape=(sentence_length,), dtype='int32')\n", (376, 417), False, 'from keras.layers import Input, Embedding, merge\n'), ((438, 486), 'keras.layers.Input', 'Input', ([], {'shape': '(sentence_length,)', 'dtype': '... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 0.8.6
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
import math
import numpy as np
import h5py
import matpl... | [
"h5py.File",
"tensorflow.nn.relu",
"numpy.random.seed",
"tensorflow.argmax",
"tensorflow.convert_to_tensor",
"math.floor",
"tensorflow.Session",
"tensorflow.placeholder",
"tensorflow.matmul",
"numpy.array",
"numpy.random.permutation",
"numpy.eye"
] | [((449, 490), 'h5py.File', 'h5py.File', (['"""datasets/train_signs.h5"""', '"""r"""'], {}), "('datasets/train_signs.h5', 'r')\n", (458, 490), False, 'import h5py\n'), ((514, 555), 'numpy.array', 'np.array', (["train_dataset['train_set_x'][:]"], {}), "(train_dataset['train_set_x'][:])\n", (522, 555), True, 'import numpy... |
import os
import json
import numpy as np
from hand_eye_calibration.dual_quaternion import DualQuaternion
class ExtrinsicCalibration:
def __init__(self, time_offset, pose_dual_quat):
self.time_offset = time_offset
self.pose_dq = pose_dual_quat
def writeJson(self, out_file, switchConvention = False):
po... | [
"json.dump",
"json.load",
"numpy.hstack"
] | [((675, 720), 'json.dump', 'json.dump', (['calib', 'f'], {'indent': '(3)', 'sort_keys': '(True)'}), '(calib, f, indent=3, sort_keys=True)\n', (684, 720), False, 'import json\n'), ((842, 854), 'json.load', 'json.load', (['f'], {}), '(f)\n', (851, 854), False, 'import json\n'), ((1086, 1103), 'numpy.hstack', 'np.hstack',... |
import pandas as pd
import numpy as np
import xarray as xr
import datetime
from river_dl.RGCN import RGCNModel
from river_dl.postproc_utils import prepped_array_to_df
from river_dl.preproc_utils import (
scale,
convert_batch_reshape,
coord_as_reshaped_array,
)
from river_dl.rnns import LSTMModel, GRUModel
... | [
"pandas.DataFrame",
"river_dl.preproc_utils.convert_batch_reshape",
"river_dl.preproc_utils.scale",
"river_dl.RGCN.RGCNModel",
"river_dl.rnns.LSTMModel",
"river_dl.rnns.GRUModel",
"numpy.unique",
"river_dl.train.get_data_if_file",
"datetime.datetime.strptime",
"river_dl.postproc_utils.prepped_arra... | [((3419, 3444), 'river_dl.train.get_data_if_file', 'get_data_if_file', (['io_data'], {}), '(io_data)\n', (3435, 3444), False, 'from river_dl.train import get_data_if_file\n'), ((5569, 5626), 'river_dl.postproc_utils.prepped_array_to_df', 'prepped_array_to_df', (['y_pred', 'pred_dates', 'pred_ids', 'y_vars'], {}), '(y_p... |
import numpy as np
from scipy.interpolate import interp1d
from scipy.integrate import solve_ivp
class ThermalModel:
"""
here
"""
def __init__(self, params):
"""
here
"""
# self.rc = params.rc
# self.ru = params.ru
# self.cc = params.cc
# self.cs... | [
"numpy.zeros",
"scipy.integrate.solve_ivp",
"numpy.diff",
"numpy.array",
"scipy.interpolate.interp1d"
] | [((678, 695), 'scipy.interpolate.interp1d', 'interp1d', (['time', 'q'], {}), '(time, q)\n', (686, 695), False, 'from scipy.interpolate import interp1d\n'), ((2184, 2270), 'scipy.integrate.solve_ivp', 'solve_ivp', (['func', 'tspan', '(298.15, 298.15)'], {'method': '"""BDF"""', 't_eval': 'time', 'jac': 'jacobian'}), "(fu... |
# -*- coding: utf-8 -*-
"""
@File : photometric.py
@Time : 2019/10/27 下午3:57
@Author : yizuotian
@Description :
"""
import cv2
import numpy as np
import random
class Identity(object):
"""
恒等转换
"""
def __init__(self):
super(Identity, self).__init__()
def __call__(self, image... | [
"cv2.equalizeHist",
"random.uniform",
"cv2.cvtColor",
"numpy.clip",
"random.random",
"cv2.LUT",
"numpy.arange"
] | [((1861, 1906), 'numpy.clip', 'np.clip', (['(image[:, :, 1] * self.factor)', '(0)', '(255)'], {}), '(image[:, :, 1] * self.factor, 0, 255)\n', (1868, 1906), True, 'import numpy as np\n'), ((2862, 2897), 'numpy.clip', 'np.clip', (['(image + self.delta)', '(0)', '(255)'], {}), '(image + self.delta, 0, 255)\n', (2869, 289... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/04_classes.ipynb (unless otherwise specified).
__all__ = ['ClockStructClass', 'OutputClass', 'ParamStructClass', 'SoilClass', 'CropClass', 'IrrMngtClass',
'IrrMngtStruct', 'spec', 'FieldMngtClass', 'FieldMngtStruct', 'spec', 'GwClass', 'InitWCClass', 'CropStru... | [
"pandas.DataFrame",
"numpy.log",
"numpy.power",
"numpy.zeros",
"numba.experimental.jitclass",
"numpy.ones",
"numpy.cumsum",
"numpy.array"
] | [((38777, 38791), 'numba.experimental.jitclass', 'jitclass', (['spec'], {}), '(spec)\n', (38785, 38791), False, 'from numba.experimental import jitclass\n'), ((40999, 41013), 'numba.experimental.jitclass', 'jitclass', (['spec'], {}), '(spec)\n', (41007, 41013), False, 'from numba.experimental import jitclass\n'), ((447... |
import warnings
import numpy as np
import shap
import skimage.segmentation
from onnx_tf.backend import prepare # onnx to tf model converter&runner
from dianna import utils
class KernelSHAP:
"""Kernel SHAP implementation based on shap https://github.com/slundberg/shap."""
# axis labels required to be present ... | [
"dianna.utils.to_xarray",
"dianna.utils.get_kwargs_applicable_to_function",
"warnings.simplefilter",
"numpy.zeros",
"numpy.transpose",
"onnx_tf.backend.prepare",
"warnings.catch_warnings",
"dianna.utils.onnx_model_node_loader",
"dianna.utils.move_axis"
] | [((4808, 4843), 'dianna.utils.onnx_model_node_loader', 'utils.onnx_model_node_loader', (['model'], {}), '(model)\n', (4836, 4843), False, 'from dianna import utils\n'), ((5133, 5207), 'dianna.utils.get_kwargs_applicable_to_function', 'utils.get_kwargs_applicable_to_function', (['skimage.segmentation.slic', 'kwargs'], {... |
import numpy as np
from itertools import combinations
__NRTL_IP = {('100-41-4', '100-42-5'): ('ETHYLBENZENE',
'STYRENE',
'-539.7919',
'813.9959',
'.3466',
'Ethylbenzene/Styrene p... | [
"itertools.combinations",
"numpy.zeros"
] | [((170019, 170035), 'numpy.zeros', 'np.zeros', (['(n, n)'], {}), '((n, n))\n', (170027, 170035), True, 'import numpy as np\n'), ((170048, 170064), 'numpy.zeros', 'np.zeros', (['(n, n)'], {}), '((n, n))\n', (170056, 170064), True, 'import numpy as np\n'), ((170089, 170116), 'itertools.combinations', 'combinations', (['c... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Script to visualize the model coordination environments
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "2.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"... | [
"pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies.NormalizedAngleDistanceNbSetWeight",
"pymatgen.analysis.chemenv.coordination_environments.coordination_geometry_finder.AbstractGeometry.from_cg",
"pymatgen.core.structure.Structure",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.is... | [((1607, 1634), 'pymatgen.analysis.chemenv.coordination_environments.coordination_geometries.AllCoordinationGeometries', 'AllCoordinationGeometries', ([], {}), '()\n', (1632, 1634), False, 'from pymatgen.analysis.chemenv.coordination_environments.coordination_geometries import AllCoordinationGeometries\n'), ((14397, 14... |
import numpy as np
from sklearn.model_selection import train_test_split
import pandas as pd
class CAPB():
def __init__(self, data_dir, set_type, train_val):
# set_name should be in ['blouse' 'dress' 'outwear' 'skirt' 'trousers']
self.data_dir = data_dir
set_df = pd.read_table(data_d... | [
"pandas.read_table",
"numpy.array"
] | [((300, 396), 'pandas.read_table', 'pd.read_table', (["(data_dir + 'Eval/list_eval_partition.txt')"], {'delim_whitespace': '(True)', 'skiprows': '(1)'}), "(data_dir + 'Eval/list_eval_partition.txt', delim_whitespace=\n True, skiprows=1)\n", (313, 396), True, 'import pandas as pd\n'), ((482, 578), 'pandas.read_table'... |
import argparse
import numpy as np
from railrl.envs.multitask.reacher_env import XyMultitaskReacherEnv
env = XyMultitaskReacherEnv()
def set_state(target_pos, joint_angles, velocity):
qpos = np.concatenate([joint_angles, target_pos])
qvel = np.array([velocity[0], velocity[1], 0, 0])
env.reset()
env.... | [
"numpy.random.uniform",
"railrl.envs.multitask.reacher_env.XyMultitaskReacherEnv",
"argparse.ArgumentParser",
"numpy.arctan2",
"numpy.argmax",
"numpy.hstack",
"numpy.array",
"numpy.linalg.norm",
"numpy.concatenate"
] | [((111, 134), 'railrl.envs.multitask.reacher_env.XyMultitaskReacherEnv', 'XyMultitaskReacherEnv', ([], {}), '()\n', (132, 134), False, 'from railrl.envs.multitask.reacher_env import XyMultitaskReacherEnv\n'), ((199, 241), 'numpy.concatenate', 'np.concatenate', (['[joint_angles, target_pos]'], {}), '([joint_angles, targ... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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... | [
"tritonclient.utils.np_to_triton_dtype",
"soundfile.read",
"numpy.array"
] | [((1002, 1019), 'soundfile.read', 'sf.read', (['wav_file'], {}), '(wav_file)\n', (1009, 1019), True, 'import soundfile as sf\n'), ((1038, 1076), 'numpy.array', 'np.array', (['[waveform]'], {'dtype': 'np.float32'}), '([waveform], dtype=np.float32)\n', (1046, 1076), True, 'import numpy as np\n'), ((1322, 1355), 'tritoncl... |
# Load pre-trained network.
# if __name__ == '__main__':
import multiprocessing
import os
import pickle
from multiprocessing import Queue
import PIL
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
from skimage.transform import resize
from sklearn.metrics import roc_curve, confusion_matrix
imp... | [
"numpy.absolute",
"dnnlib.EasyDict",
"numpy.floor",
"pretrained_networks.load_networks",
"skimage.transform.resize",
"multiprocessing.Queue",
"os.path.join",
"dnnlib.tflib.init_tf",
"full_video_test.test_video",
"matplotlib.pyplot.imshow",
"os.fsdecode",
"numpy.random.RandomState",
"numpy.ap... | [((498, 520), 'dnnlib.tflib.init_tf', 'dnnlib.tflib.init_tf', ([], {}), '()\n', (518, 520), False, 'import dnnlib\n'), ((1782, 1798), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1792, 1798), False, 'import os\n'), ((2308, 2330), 'dnnlib.tflib.init_tf', 'dnnlib.tflib.init_tf', ([], {}), '()\n', (2328, 2330)... |
import copy
import random
import numpy as np
import math
from common.utils import set_seed, read_json_file, write_json_file
udr_large = read_json_file(
'/tank/zxxia/PCC-RL/config/train/udr_7_dims_0826/udr_large.json')[0]
def gen_random_range(val_min, val_max, logscale=False, weight=1/3):
if logscale:
... | [
"copy.deepcopy",
"common.utils.set_seed",
"random.uniform",
"math.log10",
"common.utils.read_json_file",
"numpy.log10"
] | [((139, 224), 'common.utils.read_json_file', 'read_json_file', (['"""/tank/zxxia/PCC-RL/config/train/udr_7_dims_0826/udr_large.json"""'], {}), "('/tank/zxxia/PCC-RL/config/train/udr_7_dims_0826/udr_large.json'\n )\n", (153, 224), False, 'from common.utils import set_seed, read_json_file, write_json_file\n'), ((765, ... |
import os
import glob
import h5py
import pyprind
import numpy as np
import pandas as pd
from keras.callbacks import EarlyStopping, ModelCheckpoint
from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.layers.core import Flatten, Dense, Dropout
from keras.models import Sequential
f... | [
"numpy.sum",
"pandas.read_csv",
"os.path.isfile",
"numpy.mean",
"skimage.transform.resize",
"keras.layers.core.Flatten",
"os.path.join",
"numpy.unique",
"keras.optimizers.SGD",
"sklearn.preprocessing.LabelEncoder",
"keras.utils.np_utils.to_categorical",
"keras.layers.core.Dropout",
"skimage.... | [((1092, 1132), 'os.path.join', 'os.path.join', (['INPUT_FOLDER_PATH', '"""train"""'], {}), "(INPUT_FOLDER_PATH, 'train')\n", (1104, 1132), False, 'import os\n'), ((1155, 1194), 'os.path.join', 'os.path.join', (['INPUT_FOLDER_PATH', '"""test"""'], {}), "(INPUT_FOLDER_PATH, 'test')\n", (1167, 1194), False, 'import os\n'... |
import logging
import os
import pickle
import matplotlib.pyplot as plt
import numpy as np
from robo.models import random_forest as rf
from nasbench301.surrogate_models import utils
from nasbench301.surrogate_models.surrogate_model import SurrogateModel
class RandomForest(SurrogateModel):
def __init__(self, data... | [
"numpy.std",
"matplotlib.pyplot.close",
"nasbench301.surrogate_models.utils.evaluate_metrics",
"numpy.isnan",
"logging.info",
"numpy.where",
"numpy.array",
"robo.models.random_forest.RandomForest",
"numpy.mean",
"os.path.join"
] | [((515, 572), 'robo.models.random_forest.RandomForest', 'rf.RandomForest', ([], {'num_trees': "self.model_config['num_trees']"}), "(num_trees=self.model_config['num_trees'])\n", (530, 572), True, 'from robo.models import random_forest as rf\n'), ((1194, 1208), 'numpy.array', 'np.array', (['hyps'], {}), '(hyps)\n', (120... |
# test bin, analyze, and plot functions
import os
from os.path import join
from os import listdir
import matplotlib.pyplot as plt
# imports
import numpy as np
import pandas as pd
from scipy.optimize import curve_fit
import filter
import analyze
from correction import correct
from utils import fit, functions, bin, io,... | [
"numpy.polyfit",
"utils.functions.line",
"utils.io.read_calib_coords",
"matplotlib.pyplot.style.use",
"numpy.arange",
"utils.plot_collections.plot_spct_stats",
"matplotlib.pyplot.tight_layout",
"os.path.join",
"numpy.round",
"pandas.DataFrame",
"utils.io.read_similarity",
"utils.modify.map_val... | [((588, 636), 'matplotlib.pyplot.style.use', 'plt.style.use', (["['science', 'ieee', 'std-colors']"], {}), "(['science', 'ieee', 'std-colors'])\n", (601, 636), True, 'import matplotlib.pyplot as plt\n'), ((647, 661), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (659, 661), True, 'import matplotlib.py... |
import shutil
import os
import random
import numpy as np
from tensorflow import random as tf_random
import yaml
from pathlib import Path
from datetime import datetime
import pytz
import matplotlib.pyplot as plt
import ipykernel # needed when using many metrics, to avoid automatic verbose=2 output
from tensorflow.ker... | [
"tensorflow.random.set_seed",
"numpy.random.seed",
"argparse.ArgumentParser",
"os.path.join",
"yaml.safe_dump",
"matplotlib.pyplot.close",
"numpy.asarray",
"time.perf_counter",
"matplotlib.pyplot.subplots",
"local_utils.getSystemInfo",
"local_utils.getLibVersions",
"git.Repo",
"pathlib.Path"... | [((764, 777), 'pathlib.Path', 'Path', (['"""./tmp"""'], {}), "('./tmp')\n", (768, 777), False, 'from pathlib import Path\n'), ((5908, 5922), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (5920, 5922), False, 'from datetime import datetime\n'), ((6243, 6274), 'pathlib.Path', 'Path', (['tmp_directory', '"""d... |
import copy
import pylab
import random
import numpy as np
from environment import Env
import tensorflow as tf
from tensorflow.keras.layers import Dense
from tensorflow.keras.optimizers import Adam
# 상태가 입력, 각 행동의 확률이 출력인 인공신경망 생성
class REINFORCE(tf.keras.Model):
def __init__(self, action_size):
super(REIN... | [
"tensorflow.keras.layers.Dense",
"numpy.array",
"environment.Env",
"numpy.reshape",
"numpy.random.choice"
] | [((1194, 1216), 'environment.Env', 'Env', ([], {'render_speed': '(0.05)'}), '(render_speed=0.05)\n', (1197, 1216), False, 'from environment import Env\n'), ((363, 391), 'tensorflow.keras.layers.Dense', 'Dense', (['(24)'], {'activation': '"""relu"""'}), "(24, activation='relu')\n", (368, 391), False, 'from tensorflow.ke... |
"""
Factory for the estimation of the flat field coefficients
"""
import numpy as np
from astropy import units as u
from ctapipe.calib.camera.flatfield import FlatFieldCalculator
from ctapipe.core.traits import List
__all__ = [
'FlasherFlatFieldCalculator'
]
class FlasherFlatFieldCalculator(FlatFieldCalculat... | [
"numpy.ma.median",
"numpy.ma.getdata",
"numpy.zeros",
"numpy.ma.array",
"numpy.ma.mean",
"numpy.ma.std",
"ctapipe.core.traits.List",
"numpy.logical_or"
] | [((6475, 6553), 'numpy.logical_or', 'np.logical_or', (['container.charge_median_outliers', 'container.charge_std_outliers'], {}), '(container.charge_median_outliers, container.charge_std_outliers)\n', (6488, 6553), True, 'import numpy as np\n'), ((6692, 6763), 'numpy.logical_or', 'np.logical_or', (['ff_charge_failing_p... |
import os
import sys
import json
import datetime
import numpy as np
import skimage.draw
import skimage.util
import cv2
from mrcnn.visualize import display_instances
import matplotlib.pyplot as plt
import random
import time
# Root directory of the project
ROOT_DIR = os.path.abspath("../../")
# Import Mask RCNN
sys.pat... | [
"sys.path.append",
"os.path.abspath",
"numpy.ones",
"time.time",
"os.path.join"
] | [((267, 292), 'os.path.abspath', 'os.path.abspath', (['"""../../"""'], {}), "('../../')\n", (282, 292), False, 'import os\n'), ((313, 338), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (328, 338), False, 'import sys\n'), ((506, 549), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""mask_rc... |
# Copyright 2020 Kyoto University (<NAME>)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import codecs
import numpy as np
import os
import sentencepiece as spm
from collections import deque
class WordAlignmentConverter(object):
"""Class for converting word alignment into word-piece alignment.
... | [
"codecs.open",
"sentencepiece.SentencePieceProcessor",
"os.path.isfile",
"numpy.array",
"os.path.join"
] | [((3504, 3557), 'os.path.join', 'os.path.join', (['alignment_dir', 'speaker', "(utt_id + '.txt')"], {}), "(alignment_dir, speaker, utt_id + '.txt')\n", (3516, 3557), False, 'import os\n'), ((3767, 3803), 'numpy.array', 'np.array', (['boundaries'], {'dtype': 'np.int32'}), '(boundaries, dtype=np.int32)\n', (3775, 3803), ... |
"""A demo script showing how to DIARIZATION ON WAV USING UIS-RNN."""
import os
import time
import sys
import numpy as np
import uisrnn
import librosa
# sys.path.append('ghostvlad')
# sys.path.append('visualization')
# import toolkits
from ghostvlad import toolkits
from ghostvlad import model as spkModel
# from vie... | [
"uisrnn.UISRNN",
"os.path.abspath",
"argparse.ArgumentParser",
"ghostvlad.toolkits.initialize_GPU",
"ghostvlad.model.vggvox_resnet2d_icassp",
"numpy.std",
"numpy.expand_dims",
"time.time",
"numpy.mean",
"librosa.magphase",
"librosa.load",
"numpy.array",
"visualization.viewer.PlotDiar",
"li... | [((473, 538), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""pretrained/saved_model.uisrnn_benchmark"""'], {}), "(BASE_DIR, 'pretrained/saved_model.uisrnn_benchmark')\n", (485, 538), False, 'import os\n'), ((2205, 2234), 'librosa.load', 'librosa.load', (['vid_path'], {'sr': 'sr'}), '(vid_path, sr=sr)\n', (2217, 2234... |
import datetime
import glob
import logging
import pickle
import math
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import TimeSeriesSplit, train_test_split
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import lear... | [
"sklearn.model_selection.GridSearchCV",
"pickle.dump",
"sklearn.model_selection.train_test_split",
"numpy.mean",
"glob.glob",
"pandas.DataFrame",
"numpy.std",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"sklearn.metrics.mean_squared_error",
"seaborn.set_theme",
"datetime.datetime.now",
"... | [((566, 581), 'seaborn.set_theme', 'sns.set_theme', ([], {}), '()\n', (579, 581), True, 'import seaborn as sns\n'), ((994, 1193), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'f"""/home/team13/logs/models/{model_name}/{current_time}"""', 'format': '"""%(asctime)s %(levelname)-8s %(message)s"""', 'lev... |
import numpy as np
import torch
from torch import nn
from musco.pytorch.compressor.rank_selection.estimator import estimate_rank_for_compression_rate, estimate_vbmf_ranks
class SVDDecomposedLayer():
def __init__(self, layer, layer_name,
rank_selection,
rank = None,
... | [
"torch.nn.Sequential",
"torch.nn.Conv2d",
"musco.pytorch.compressor.rank_selection.estimator.estimate_vbmf_ranks",
"torch.FloatTensor",
"torch.nn.Linear",
"numpy.dot",
"musco.pytorch.compressor.rank_selection.estimator.estimate_rank_for_compression_rate",
"numpy.sqrt"
] | [((2104, 2119), 'torch.nn.Sequential', 'nn.Sequential', ([], {}), '()\n', (2117, 2119), False, 'from torch import nn\n'), ((6756, 6771), 'torch.nn.Sequential', 'nn.Sequential', ([], {}), '()\n', (6769, 6771), False, 'from torch import nn\n'), ((1231, 1307), 'musco.pytorch.compressor.rank_selection.estimator.estimate_vb... |
import os
import logging
import random
import subprocess
import numpy as np
import PIL
import cv2
import torch
from tqdm import tqdm
from .. import image
from .. import audio as ml4a_audio
from ..utils import downloads
from . import submodules
cuda_available = submodules.cuda_available()
#with submodules.localimport... | [
"os.remove",
"cv2.VideoWriter_fourcc",
"os.path.isfile",
"numpy.mean",
"torch.no_grad",
"os.path.join",
"audio.load_wav",
"random.randint",
"torch.load",
"numpy.transpose",
"audio.melspectrogram",
"cv2.resize",
"models.Wav2Lip",
"numpy.asarray",
"subprocess.call",
"torch.cuda.is_availa... | [((1130, 1139), 'models.Wav2Lip', 'Wav2Lip', ([], {}), '()\n', (1137, 1139), False, 'from models import Wav2Lip\n'), ((1771, 1871), 'face_detection.FaceAlignment', 'face_detection.FaceAlignment', (['face_detection.LandmarksType._2D'], {'flip_input': '(False)', 'device': 'device'}), '(face_detection.LandmarksType._2D, f... |
'''
Implementation of augmented memory based strategies to combat catastrophic forgetting
'''
import numpy as np
import torch
import torch.nn as nn
from .mem_net import Net
from utils.metric import accuracy, AverageMeter, Timer
import matplotlib.pyplot as plt
import scipy.io as sio
import random
import math
class Aug... | [
"numpy.sum",
"torch.cat",
"torch.randn",
"numpy.argsort",
"utils.metric.Timer",
"numpy.mean",
"numpy.linalg.norm",
"torch.no_grad",
"numpy.unique",
"utils.metric.accuracy",
"torch.nn.BCELoss",
"torch.load",
"torch.Tensor",
"torch.cuda.set_device",
"torch.zeros",
"torch.argsort",
"num... | [((976, 1021), 'torch.randn', 'torch.randn', (['self.MemNumSlots', 'self.MemFeatSz'], {}), '(self.MemNumSlots, self.MemFeatSz)\n', (987, 1021), False, 'import torch\n'), ((1298, 1319), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (1317, 1319), True, 'import torch.nn as nn\n'), ((1348, 1376), 't... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 7 15:12:38 2020
@author: matthiasboeker
Execute main for time dependent HMM
Main script runs the Baum Welch Algorithm for Hidden Markov Models
The covariate can be added optional within the script BW_func
1. Script loads in time series
2. Sets exte... | [
"Modules.Covariate_model.trig_cov",
"hmmlearn.hmm.GaussianHMM",
"numpy.max",
"numpy.min",
"numpy.array",
"os.chdir"
] | [((714, 813), 'os.chdir', 'os.chdir', (['"""/Users/matthiasboeker/Desktop/Master_Thesis/Schizophrenia_Depression_Project/"""'], {}), "(\n '/Users/matthiasboeker/Desktop/Master_Thesis/Schizophrenia_Depression_Project/'\n )\n", (722, 813), False, 'import os\n'), ((1451, 1481), 'Modules.Covariate_model.trig_cov', 't... |
# evaluate a decision tree on the entire larger dataset
from numpy import mean
from numpy import std
from sklearn.datasets import make_classification
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import StratifiedKFold
from sklearn.tree import DecisionTreeClassifier
# define dataset
X... | [
"numpy.std",
"sklearn.model_selection.cross_val_score",
"sklearn.datasets.make_classification",
"sklearn.tree.DecisionTreeClassifier",
"numpy.mean",
"sklearn.model_selection.StratifiedKFold"
] | [((326, 433), 'sklearn.datasets.make_classification', 'make_classification', ([], {'n_samples': '(10000)', 'n_features': '(500)', 'n_informative': '(10)', 'n_redundant': '(490)', 'random_state': '(1)'}), '(n_samples=10000, n_features=500, n_informative=10,\n n_redundant=490, random_state=1)\n', (345, 433), False, 'f... |
"""Subset module."""
import numbers
import re
import warnings
from functools import wraps
from pathlib import Path
from typing import Dict, Optional, Sequence, Tuple, Union
import cf_xarray # noqa
import geopandas as gpd
import numpy as np
import xarray
from pandas.api.types import is_integer_dtype
from pyproj import... | [
"pyproj.crs.CRS",
"shapely.ops.split",
"pygeos.points",
"roocs_utils.xarray_utils.xarray_utils.get_coord_by_type",
"pygeos.prepare",
"numpy.isnan",
"roocs_utils.utils.time_utils.to_isoformat",
"pygeos.covers",
"xarray.full_like",
"numpy.full",
"xarray.core.utils.get_temp_dimname",
"shapely.geo... | [((1317, 1328), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (1322, 1328), False, 'from functools import wraps\n'), ((4686, 4697), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (4691, 4697), False, 'from functools import wraps\n'), ((8064, 8075), 'functools.wraps', 'wraps', (['func'], {}), '(func)\... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import pickle
import time
from numba import njit
import cProfile
# store shape as a series of points
# coil points stored as columns of 3 x n matrix, in cm
# current stored in amps
# assume infinitely thin conductor
COIL = ... | [
"numpy.zeros",
"time.perf_counter",
"numpy.cross",
"numpy.apply_along_axis",
"numpy.array",
"numpy.reshape",
"numpy.linspace",
"numpy.linalg.norm",
"time.perf_counter_ns",
"numpy.vstack",
"cProfile.run"
] | [((320, 379), 'numpy.array', 'np.array', (['[[0, 0, 0], [10, 0, 0], [10, 10, 0], [20, 10, 0]]'], {}), '([[0, 0, 0], [10, 0, 0], [10, 10, 0], [20, 10, 0]])\n', (328, 379), True, 'import numpy as np\n'), ((808, 824), 'numpy.zeros', 'np.zeros', (['(1, 3)'], {}), '((1, 3))\n', (816, 824), True, 'import numpy as np\n'), ((1... |
# -*- coding: utf-8 -*-
"""
Colour - Spectroscope
=====================
Analysis of the *Fraunhofer* lines in images captured with the homemade
spectroscope.
Subpackages
-----------
- fraunhofer : Analysis of the *Fraunhofer* lines.
"""
from __future__ import absolute_import
import numpy as np
import os
import su... | [
"os.path.dirname",
"numpy.set_printoptions"
] | [((787, 812), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (802, 812), False, 'import os\n'), ((1423, 1457), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'legacy': '"""1.13"""'}), "(legacy='1.13')\n", (1442, 1457), True, 'import numpy as np\n'), ((1142, 1167), 'os.path.dirname', '... |
"""DAVIS240 test example.
Author: <NAME>
Email : <EMAIL>
"""
from __future__ import print_function
import numpy as np
import cv2
from pyaer import libcaer
from pyaer.davis import DAVIS
device = DAVIS(noise_filter=True)
print ("Device ID:", device.device_id)
if device.device_is_master:
print ("Device is master.... | [
"cv2.waitKey",
"cv2.imshow",
"numpy.clip",
"pyaer.davis.DAVIS"
] | [((198, 222), 'pyaer.davis.DAVIS', 'DAVIS', ([], {'noise_filter': '(True)'}), '(noise_filter=True)\n', (203, 222), False, 'from pyaer.davis import DAVIS\n'), ((1443, 1473), 'cv2.imshow', 'cv2.imshow', (['"""frame"""', 'frames[0]'], {}), "('frame', frames[0])\n", (1453, 1473), False, 'import cv2\n'), ((1861, 1898), 'num... |
# -*- coding: utf-8 -*-
import warnings
from pathlib import Path
import pandas as pd
from typing import Union
import numpy as np
import matplotlib.pyplot as plt
from qa4sm_reader.img import QA4SMImg
import qa4sm_reader.globals as globals
from qa4sm_reader import plotting_methods as plm
from qa4sm_reader.exceptions i... | [
"qa4sm_reader.globals.out_metadata_plots.items",
"qa4sm_reader.plotting_methods.mapplot",
"qa4sm_reader.plotting_methods.boxplot",
"matplotlib.pyplot.close",
"qa4sm_reader.plotting_methods.make_watermark",
"numpy.isnan",
"qa4sm_reader.plotting_methods.boxplot_metadata",
"qa4sm_reader.exceptions.Plotte... | [((2297, 2311), 'pathlib.Path', 'Path', (['out_name'], {}), '(out_name)\n', (2301, 2311), False, 'from pathlib import Path\n'), ((11526, 11598), 'qa4sm_reader.plotting_methods.boxplot', 'plm.boxplot', ([], {'df': 'df', 'ci': 'ci', 'label': 'label', 'figsize': 'figsize', 'dpi': 'globals.dpi'}), '(df=df, ci=ci, label=lab... |
#!/usr/bin/env python
#
# Created by: <NAME>, March 2002
#
""" Test functions for scipy.linalg.matfuncs module
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import array, eye, dot, sqrt, double, exp, random
from numpy.testing import TestCase, run_module_suite, asse... | [
"scipy.linalg.logm",
"numpy.random.seed",
"numpy.iscomplexobj",
"numpy.testing.run_module_suite",
"scipy.sparse.construct.eye",
"scipy.sparse.csc_matrix",
"numpy.array",
"numpy.exp",
"scipy.sparse.linalg.expm",
"numpy.random.rand",
"numpy.eye"
] | [((2221, 2239), 'numpy.testing.run_module_suite', 'run_module_suite', ([], {}), '()\n', (2237, 2239), False, 'from numpy.testing import TestCase, run_module_suite, assert_array_almost_equal, assert_array_almost_equal_nulp\n'), ((598, 623), 'numpy.array', 'array', (['[[0.0, 0], [0, 0]]'], {}), '([[0.0, 0], [0, 0]])\n', ... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2021 Scipp contributors (https://github.com/scipp)
"""
This script generates input parameters to test whether arithmetic
operations are consistent with Python.
It takes the output file as its only command line argument.
"""
from itertools import product
import s... | [
"numpy.random.uniform",
"numpy.random.seed",
"numpy.true_divide",
"numpy.remainder",
"numpy.floor_divide",
"numpy.isneginf",
"numpy.isnan",
"numpy.sign",
"numpy.arange",
"itertools.product",
"numpy.isposinf"
] | [((374, 388), 'numpy.isposinf', 'np.isposinf', (['x'], {}), '(x)\n', (385, 388), True, 'import numpy as np\n'), ((423, 437), 'numpy.isneginf', 'np.isneginf', (['x'], {}), '(x)\n', (434, 437), True, 'import numpy as np\n'), ((473, 484), 'numpy.isnan', 'np.isnan', (['x'], {}), '(x)\n', (481, 484), True, 'import numpy as ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.