code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# coding=utf8 import unittest from benchmark_tools import atb_names import benchmark_tools as bt import os from pandas import DataFrame import numpy as np creteil_set = bt.creteil.Annotations_set_Creteil("annotations/creteil") amman_set = bt.amman.Annotations_set_Amman('annotations/amman/amman_test.csv') class Bench...
[ "unittest.main", "benchmark_tools.amman.Annotations_set_Amman", "numpy.isnan", "benchmark_tools.atb_names.i2a.full2short", "benchmark_tools.atb_names.i2a.short2full", "benchmark_tools.astscript.annotation_to_ASTscript", "benchmark_tools.creteil.Annotations_set_Creteil" ]
[((170, 227), 'benchmark_tools.creteil.Annotations_set_Creteil', 'bt.creteil.Annotations_set_Creteil', (['"""annotations/creteil"""'], {}), "('annotations/creteil')\n", (204, 227), True, 'import benchmark_tools as bt\n'), ((240, 306), 'benchmark_tools.amman.Annotations_set_Amman', 'bt.amman.Annotations_set_Amman', (['"...
import os import cv2 import joblib import numpy as np import argparse import time import random from ksvd import ApproximateKSVD from skimage import io, util from sklearn.feature_extraction import image from sklearn.linear_model import orthogonal_mp_gram from sklearn import preprocessing def clip(img): img = np.mi...
[ "argparse.ArgumentParser", "random.randint", "numpy.zeros", "sklearn.linear_model.orthogonal_mp_gram", "numpy.ones", "numpy.where", "sklearn.feature_extraction.image.extract_patches_2d", "joblib.load", "skimage.util.img_as_float", "os.listdir", "skimage.io.imread" ]
[((1023, 1044), 'os.listdir', 'os.listdir', (['base_path'], {}), '(base_path)\n', (1033, 1044), False, 'import os\n'), ((2535, 2560), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2558, 2560), False, 'import argparse\n'), ((326, 344), 'numpy.ones', 'np.ones', (['img.shape'], {}), '(img.shape)...
from multiprocessing import Value from typing import Type from pulse2percept.models.granley2021 import DefaultBrightModel, \ DefaultSizeModel, DefaultStreakModel from pulse2percept.utils.base import FreezeError import numpy as np import pytest import numpy.testing as npt from pulse2percept.implants import ArgusI, ...
[ "pulse2percept.models.granley2021.DefaultSizeModel", "pulse2percept.implants.ArgusII", "pulse2percept.models.granley2021.DefaultStreakModel", "numpy.sum", "pulse2percept.stimuli.BiphasicPulseTrain", "numpy.testing.assert_almost_equal", "pulse2percept.models.AxonMapSpatial", "numpy.zeros", "numpy.one...
[((1984, 2046), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""engine"""', "('serial', 'cython', 'jax')"], {}), "('engine', ('serial', 'cython', 'jax'))\n", (2007, 2046), False, 'import pytest\n'), ((5371, 5433), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""engine"""', "('serial', 'cython', ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : class handleFile.py @Contact : <EMAIL> @Modify Time @Author @Version ------------ ------- -------- 2020/12/9 11:59 上午 Ferdinand 1.0 @Desciption ---------------- ---------------- ''' import random import numpy ...
[ "myCode.connector.Connector", "numpy.save", "numpy.load", "numpy.zeros", "numpy.array" ]
[((641, 675), 'myCode.connector.Connector', 'Connector', (['"""FB15K237"""', '"""entity2id"""'], {}), "('FB15K237', 'entity2id')\n", (650, 675), False, 'from myCode.connector import Connector\n'), ((712, 748), 'myCode.connector.Connector', 'Connector', (['"""FB15K237"""', '"""relation2id"""'], {}), "('FB15K237', 'relat...
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches def offset_angle_for(point_count, *, align='point', side='left'): side_to_base = { 'right': 0, 'top': np.pi / 2, 'left': np.pi, 'bottom': 3 * np.pi / 2 } space = np.pi * 2 / point_count ...
[ "matplotlib.pyplot.gca", "numpy.transpose", "numpy.sin", "numpy.array", "numpy.reshape", "matplotlib.patches.Arc", "numpy.cos", "matplotlib.pyplot.Circle", "numpy.linspace" ]
[((715, 731), 'numpy.array', 'np.array', (['center'], {}), '(center)\n', (723, 731), True, 'import numpy as np\n'), ((1832, 1846), 'numpy.cos', 'np.cos', (['angles'], {}), '(angles)\n', (1838, 1846), True, 'import numpy as np\n'), ((1859, 1873), 'numpy.sin', 'np.sin', (['angles'], {}), '(angles)\n', (1865, 1873), True,...
#!/usr/bin/env python3 import os import yaml import numpy as np def ensure_fd(fd): if not os.path.exists(fd): os.system('mkdir -p {}'.format(fd)) class ConfigRandLA: k_n = 16 # KNN num_layers = 4 # Number of layers num_points = 480 * 640 // 24 # Number of input points num_classes = 22...
[ "yaml.load", "os.path.basename", "os.path.dirname", "os.path.exists", "numpy.array", "numpy.loadtxt", "os.path.join" ]
[((96, 114), 'os.path.exists', 'os.path.exists', (['fd'], {}), '(fd)\n', (110, 114), False, 'import os\n'), ((999, 1024), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1014, 1024), False, 'import os\n'), ((1049, 1079), 'os.path.basename', 'os.path.basename', (['self.exp_dir'], {}), '(self.e...
# Sampler Module # <NAME> # July 2020 # Sampler objects create a distribution based on an embedded matrix of data and sample from it. import os import numpy as np from abc import ABC, abstractmethod from sklearn.mixture import GaussianMixture import random ###################### Sampler Class ########################...
[ "random.randint", "sklearn.mixture.GaussianMixture", "numpy.mean", "numpy.arange", "numpy.random.multivariate_normal", "numpy.random.randint", "numpy.array", "numpy.linalg.inv", "numpy.random.normal", "numpy.cov" ]
[((3916, 3941), 'numpy.cov', 'np.cov', (['embedded_matrix.T'], {}), '(embedded_matrix.T)\n', (3922, 3941), True, 'import numpy as np\n'), ((870, 902), 'numpy.mean', 'np.mean', (['embedded_matrix'], {'axis': '(0)'}), '(embedded_matrix, axis=0)\n', (877, 902), True, 'import numpy as np\n'), ((916, 949), 'numpy.cov', 'np....
# coding=utf-8 # Copyright 2019 The Edward2 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 o...
[ "deep_contextual_bandits.synthetic_data_sampler.sample_wheel_bandit_data", "absl.flags.DEFINE_string", "absl.app.run", "absl.flags.DEFINE_integer", "numpy.savez", "absl.flags.DEFINE_list" ]
[((1000, 1065), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""num_instances"""', '(100)', '"""Number of contexts."""'], {}), "('num_instances', 100, 'Number of contexts.')\n", (1020, 1065), False, 'from absl import flags\n'), ((1079, 1145), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""num_con...
__author__ = "<NAME> <<EMAIL>>" __date__ = "$Nov 05, 2015 13:54$" import collections from contextlib import contextmanager import errno import itertools import glob import numbers import os import shutil import tempfile import uuid import zipfile import scandir import h5py import numpy import tifffile import zarr ...
[ "os.remove", "numpy.argsort", "os.path.isfile", "shutil.rmtree", "dask.distributed.default_client", "builtins.range", "os.path.join", "numpy.prod", "zarr.open_group", "zipfile.is_zipfile", "os.path.abspath", "dask.distributed.wait", "kenjutsu.blocks.num_blocks", "zarr.ZipStore", "os.path...
[((1336, 1360), 'os.path.abspath', 'os.path.abspath', (['dirname'], {}), '(dirname)\n', (1351, 1360), False, 'import os\n'), ((1871, 1892), 'os.path.abspath', 'os.path.abspath', (['name'], {}), '(name)\n', (1886, 1892), False, 'import os\n'), ((2015, 2047), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {'prefix': 'tmp_d...
# 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.compiler.plugin.poplar.tests.test_utils.ipu_session", "tensorflow.python.ops.variables.global_variables_initializer", "tensorflow.python.ipu.scopes.ipu_scope", "numpy.ones", "tensorflow.python.ipu.ipu_compiler.compile", "tensorflow.python.platform.googletest.main", "os.environ.get", "tenso...
[((1967, 1984), 'tensorflow.python.platform.googletest.main', 'googletest.main', ([], {}), '()\n', (1982, 1984), False, 'from tensorflow.python.platform import googletest\n'), ((1929, 1963), 'os.environ.get', 'os.environ.get', (['"""TF_XLA_FLAGS"""', '""""""'], {}), "('TF_XLA_FLAGS', '')\n", (1943, 1963), False, 'impor...
import numpy as np import collections import logging import ctypes from ..core import Node, register_node_type, ThreadPollInput from pyqtgraph.Qt import QtCore, QtGui from pyqtgraph.util.mutex import Mutex try: import nidaqmx import nidaqmx.constants as const from nidaqmx._task_modules.read_functions impo...
[ "pyqtgraph.Qt.QtCore.QThread.__init__", "numpy.zeros", "numpy.require", "nidaqmx.Task", "numpy.array", "nidaqmx._task_modules.read_functions._read_analog_f_64", "pyqtgraph.util.mutex.Mutex" ]
[((6315, 6329), 'nidaqmx.Task', 'nidaqmx.Task', ([], {}), '()\n', (6327, 6329), False, 'import nidaqmx\n'), ((7469, 7513), 'pyqtgraph.Qt.QtCore.QThread.__init__', 'QtCore.QThread.__init__', (['self'], {'parent': 'parent'}), '(self, parent=parent)\n', (7492, 7513), False, 'from pyqtgraph.Qt import QtCore, QtGui\n'), ((7...
""" # Part of localization phase # suspected bug detection: # 1. Tensorflow,Theano,CNTK # 2. Tensorflow,Theano,MXNET # # voting process # -> a. inconsistency -> error backend,error layer. # b. check error backend in new container(whether inconsistency disappears). # """ # import numpy as np import os import sys imp...
[ "pandas.DataFrame", "numpy.random.seed", "scripts.tools.filter_bugs.filter_bugs", "numpy.zeros", "datetime.datetime.now", "itertools.combinations", "pickle.load", "itertools.product", "configparser.ConfigParser", "os.path.join" ]
[((494, 518), 'numpy.random.seed', 'np.random.seed', (['(20200501)'], {}), '(20200501)\n', (508, 518), True, 'import numpy as np\n'), ((1265, 1304), 'os.path.join', 'os.path.join', (['exp_dir', '"""metrics_result"""'], {}), "(exp_dir, 'metrics_result')\n", (1277, 1304), False, 'import os\n'), ((8877, 8891), 'datetime.d...
"""Defines the ObservationModel for the continuous light-dark domain; Origin: Belief space planning assuming maximum likelihood observations Quote from the paper: The observation function is identity, :math:`g(x_t) = x_t+\omega`, with zero-mean Gaussian observation noise a function of state, \ome...
[ "numpy.array", "pomdp_py.Gaussian" ]
[((1434, 1474), 'numpy.array', 'np.array', (['[[variance, 0], [0, variance]]'], {}), '([[variance, 0], [0, variance]])\n', (1442, 1474), True, 'import numpy as np\n'), ((1952, 2009), 'pomdp_py.Gaussian', 'pomdp_py.Gaussian', (['[0, 0]', '[[variance, 0], [0, variance]]'], {}), '([0, 0], [[variance, 0], [0, variance]])\n...
from unittest.mock import patch import numpy as np import pytest import common.predictions as sut from common.predictions.datarobot import DataRobotV1APIPredictionService from common.predictions.dummy import DummyPredictionService from common.predictions.embedded import EmbeddedPredictionService def test_prediction...
[ "unittest.mock.patch.object", "common.predictions.get_prediction_service", "numpy.allclose", "pytest.raises", "numpy.array_equal", "pytest.mark.parametrize" ]
[((2281, 2531), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""service_key, expected_type"""', "[('DataRobotV1APIPredictionService', DataRobotV1APIPredictionService), (\n 'DummyPredictionService', DummyPredictionService), (\n 'EmbeddedPredictionService', EmbeddedPredictionService)]"], {}), "('service...
# =============================================================================== # Copyright 2015 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
[ "traits.api.Float", "traits.api.Bool", "numpy.hstack", "numpy.array", "traits.api.DelegatesTo" ]
[((1779, 1806), 'traits.api.DelegatesTo', 'DelegatesTo', (['"""spectrometer"""'], {}), "('spectrometer')\n", (1790, 1806), False, 'from traits.api import DelegatesTo, List, Bool, Any, Float\n'), ((1830, 1857), 'traits.api.DelegatesTo', 'DelegatesTo', (['"""spectrometer"""'], {}), "('spectrometer')\n", (1841, 1857), Fal...
import numpy as np def gpu_nms(polys, thres=0.3, K=100, precision=10000): from .nms_kernel import nms as nms_impl if len(polys) == 0: return np.array([], dtype='float32') p = polys.copy() #p[:,:8] *= precision ret = np.array(nms_impl(p, thres), dtype='int32') #ret[:,:8] /= precision ...
[ "numpy.array", "numpy.zeros", "numpy.reshape" ]
[((857, 933), 'numpy.zeros', 'np.zeros', (['[quadboxes_shape[0], quadboxes_shape[1], query_quadboxes_shape[1]]'], {}), '([quadboxes_shape[0], quadboxes_shape[1], query_quadboxes_shape[1]])\n', (865, 933), True, 'import numpy as np\n'), ((158, 187), 'numpy.array', 'np.array', (['[]'], {'dtype': '"""float32"""'}), "([], ...
import unittest import contextlib import numpy from pathlib import Path, PurePath from BioPlate.array import Array from BioPlate import BioPlate from BioPlate.database.plate_db import PlateDB class TestBioPlateArray(unittest.TestCase): @classmethod def setUpClass(cls): """ This function is ru...
[ "unittest.main", "BioPlate.array.Array._merge_stack", "numpy.testing.assert_array_equal", "BioPlate.BioPlate", "BioPlate.array.Array._add_plate_in_cache", "BioPlate.array.Array._get_stack_in_cache", "contextlib.suppress", "BioPlate.array.Array.get_columns_rows", "BioPlate.array.Array", "pathlib.Pa...
[((3368, 3383), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3381, 3383), False, 'import unittest\n'), ((968, 980), 'BioPlate.array.Array', 'Array', (['(12)', '(8)'], {}), '(12, 8)\n', (973, 980), False, 'from BioPlate.array import Array\n'), ((1003, 1018), 'BioPlate.BioPlate', 'BioPlate', (['(12)', '(8)'], {})...
""" Configurations to create the figure containing the overview over statistical features of the different surrogate methods. """ import os import numpy as np import quantities as pq from generate_artificial_data import get_shape_factor_from_cv2 DATA_PATH = '../data/surrogate_statistics' PLOT_PATH = '../plots' if n...
[ "generate_artificial_data.get_shape_factor_from_cv2", "numpy.arange", "os.makedirs", "os.path.exists" ]
[((1359, 1385), 'numpy.arange', 'np.arange', (['(0.4)', '(1.21)', '(0.05)'], {}), '(0.4, 1.21, 0.05)\n', (1368, 1385), True, 'import numpy as np\n'), ((1840, 1870), 'generate_artificial_data.get_shape_factor_from_cv2', 'get_shape_factor_from_cv2', (['CV2'], {}), '(CV2)\n', (1865, 1870), False, 'from generate_artificial...
import random from itertools import product from collections import namedtuple import numpy as np import tensorflow as tf from neupy import layers from neupy.utils import asfloat, shape_to_tuple from neupy.layers.convolutions import conv_output_shape, deconv_output_shape from neupy.exceptions import LayerConnectionEr...
[ "neupy.layers.convolutions.conv_output_shape", "random.randint", "neupy.layers.Input", "neupy.layers.Convolution", "numpy.ones", "neupy.layers.Relu", "neupy.layers.convolutions.deconv_output_shape", "neupy.utils.shape_to_tuple", "tensorflow.shape", "numpy.random.random", "numpy.array", "collec...
[((554, 577), 'neupy.layers.Input', 'layers.Input', (['(5, 5, 1)'], {}), '((5, 5, 1))\n', (566, 577), False, 'from neupy import layers\n'), ((593, 622), 'neupy.layers.Convolution', 'layers.Convolution', (['(2, 2, 6)'], {}), '((2, 2, 6))\n', (611, 622), False, 'from neupy import layers\n'), ((1071, 1097), 'itertools.pro...
# =========================================================== # # # # =========================================================== import numpy as np if __name__ == '__main__': A = np.random.rand(2, 3) B = np.random.rand(3, 2) # Matrix Multiplication print(np.einsum("ik,kj->ij", A, B)) # Matrix...
[ "numpy.random.rand", "numpy.einsum" ]
[((188, 208), 'numpy.random.rand', 'np.random.rand', (['(2)', '(3)'], {}), '(2, 3)\n', (202, 208), True, 'import numpy as np\n'), ((217, 237), 'numpy.random.rand', 'np.random.rand', (['(3)', '(2)'], {}), '(3, 2)\n', (231, 237), True, 'import numpy as np\n'), ((330, 350), 'numpy.random.rand', 'np.random.rand', (['(2)', ...
# 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...
[ "unittest.main", "paddle.distributed.fleet.init", "paddle.nn.Linear", "paddle.distributed.fleet.get_hybrid_communicate_group", "paddle.distributed.fleet.meta_parallel.LayerDesc", "paddle.nn.MaxPool2D", "paddle.nn.loss.CrossEntropyLoss", "paddle.distributed.fleet.DistributedStrategy", "numpy.testing....
[((5156, 5171), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5169, 5171), False, 'import unittest\n'), ((1825, 1852), 'paddle.nn.Linear', 'nn.Linear', (['(256)', 'num_classes'], {}), '(256, num_classes)\n', (1834, 1852), True, 'import paddle.nn as nn\n'), ((1876, 1902), 'paddle.nn.loss.CrossEntropyLoss', 'nn.lo...
from math import e import warnings from typing import Dict, List, Tuple import numpy as np import pandas as pd from ..optimize import Optimizer from .optimal_scaling_problem import OptimalScalingProblem from .parameter import InnerParameter from .problem import InnerProblem from .solver import InnerSolver REDUCED = ...
[ "numpy.divide", "scipy.optimize.minimize", "scipy.linalg.spsolve", "numpy.abs", "numpy.empty", "numpy.zeros", "numpy.ones", "numpy.shape", "scipy.sparse.csc_matrix", "numpy.max", "numpy.min", "numpy.array", "scipy.optimize.Bounds", "numpy.linspace", "warnings.warn" ]
[((8321, 8334), 'scipy.sparse.csc_matrix', 'csc_matrix', (['A'], {}), '(A)\n', (8331, 8334), False, 'from scipy.sparse import csc_matrix, linalg\n'), ((8481, 8504), 'scipy.linalg.spsolve', 'linalg.spsolve', (['A_sp', 'b'], {}), '(A_sp, b)\n', (8495, 8504), False, 'from scipy import linalg\n'), ((9740, 9788), 'numpy.zer...
''' Calculates potential vorticity on isobaric levels from Isca data. Optionally interpolates the data to isentropic coordinates. ''' from multiprocessing import Pool, cpu_count import numpy as np import xarray as xr import os, sys import PVmodule as PV import glob import matplotlib.pyplot as plt def net...
[ "PVmodule.potential_vorticity_baroclinic", "PVmodule.potential_temperature", "matplotlib.pyplot.yscale", "matplotlib.pyplot.ylim", "matplotlib.pyplot.clf", "numpy.logspace", "xarray.open_dataset", "xarray.concat", "xarray.Dataset", "numpy.exp", "PVmodule.log_interpolate_1d", "xarray.open_mfdat...
[((645, 675), 'xarray.concat', 'xr.concat', (['ens_list'], {'dim': '"""lon"""'}), "(ens_list, dim='lon')\n", (654, 675), True, 'import xarray as xr\n'), ((1756, 1871), 'xarray.open_mfdataset', 'xr.open_mfdataset', (["(f + '.nc')"], {'decode_times': '(False)', 'concat_dim': '"""time"""', 'combine': '"""nested"""', 'chun...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2016 <NAME> (http://www.jdhp.org) # This script is provided under the terms and conditions of the MIT license: # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softw...
[ "pywi.io.fits.load_fits_image", "os.remove", "os.getpid", "pywi.io.images.fill_nan_pixels", "numpy.zeros", "pywi.io.fits.save_fits_image", "os.system", "time.time", "os.path.join" ]
[((4195, 4250), 'pywi.io.images.fill_nan_pixels', 'images.fill_nan_pixels', (['input_image', 'noise_distribution'], {}), '(input_image, noise_distribution)\n', (4217, 4250), False, 'from pywi.io import images\n'), ((4428, 4478), 'os.path.join', 'os.path.join', (['tmp_files_directory', 'input_file_name'], {}), '(tmp_fil...
""" CommunistBadger v1.0.0 This is the code for neural network used in the stock prediction. We use LSTM and GRUs for the task. We use tensorflow for the task. """ import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import Stock_Data_Renderer class StockPredictor(): def __init__(...
[ "tensorflow.contrib.rnn.BasicRNNCell", "tensorflow.losses.mean_squared_error", "tensorflow.train.Saver", "tensorflow.nn.dynamic_rnn", "matplotlib.pyplot.close", "tensorflow.global_variables_initializer", "tensorflow.reshape", "tensorflow.layers.dense", "tensorflow.Session", "tensorflow.placeholder...
[((786, 851), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, self.no_steps, self.no_inputs]'], {}), '(tf.float32, [None, self.no_steps, self.no_inputs])\n', (800, 851), True, 'import tensorflow as tf\n'), ((869, 920), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, self.no_outpu...
""" Modified from KPConv: https://github.com/HuguesTHOMAS/KPConv Author: <NAME> Date: May 2021 """ # Basic libs import numpy as np import tensorflow as tf import time # Subsampling extension import cpp_wrappers.cpp_subsampling.grid_subsampling as cpp_subsampling from utils.ply import read_ply # Load custom operatio...
[ "tensorflow.reduce_sum", "numpy.sum", "tensorflow.reset_default_graph", "tensorflow.reshape", "tensorflow.zeros_like", "tensorflow.ConfigProto", "tensorflow.matmul", "numpy.random.randint", "numpy.sin", "numpy.linalg.norm", "numpy.random.normal", "tensorflow.reduce_max", "numpy.full", "ten...
[((344, 395), 'tensorflow.load_op_library', 'tf.load_op_library', (['"""tf_custom_ops/tf_neighbors.so"""'], {}), "('tf_custom_ops/tf_neighbors.so')\n", (362, 395), True, 'import tensorflow as tf\n'), ((424, 481), 'tensorflow.load_op_library', 'tf.load_op_library', (['"""tf_custom_ops/tf_batch_neighbors.so"""'], {}), "(...
import re import pandas as pd import numpy as np from sfi import Matrix as mat from sfi import Scalar as sca class corr: def __init__(self): pass @staticmethod def unpivot_stata_output(self, data_matrix, column_names, new_column_name): column_names = np.asarray(self.rows) df_retu...
[ "pandas.DataFrame", "sfi.Scalar.getValue", "numpy.asarray", "sfi.Matrix.getRowNames", "sfi.Matrix.getColNames", "pandas.Series", "pandas.melt", "sfi.Matrix.get" ]
[((283, 304), 'numpy.asarray', 'np.asarray', (['self.rows'], {}), '(self.rows)\n', (293, 304), True, 'import numpy as np\n'), ((325, 374), 'pandas.DataFrame', 'pd.DataFrame', (['self.corr_matrix'], {'columns': 'self.rows'}), '(self.corr_matrix, columns=self.rows)\n', (337, 374), True, 'import pandas as pd\n'), ((441, 4...
# -*- coding: utf-8 -*- ''' 时间序列处理工具函数 TODO ---- 改成class以简化函数调用传参 ''' import numpy as np import pandas as pd from dramkit.gentools import con_count, isnull from dramkit.logtools.utils_logger import logger_show #%% def fillna_ma(series, ma=None, ma_min=1): ''' | 用移动平均ma填充序列series中的缺失值 | ma设置填充时向前取平均数用的期数...
[ "pandas.DataFrame", "dramkit.plot_series", "dramkit.logtools.utils_logger.logger_show", "dramkit._tmp.utils_SignalDec.merge_high_modes", "dramkit._tmp.utils_SignalDec.dec_emds", "pandas.merge", "time.time", "dramkit.fintools.load_his_data.load_index_futures_daily", "dramkit.gentools.replace_repeat_p...
[((467, 487), 'pandas.DataFrame', 'pd.DataFrame', (['series'], {}), '(series)\n', (479, 487), True, 'import pandas as pd\n'), ((496, 506), 'dramkit.gentools.isnull', 'isnull', (['ma'], {}), '(ma)\n', (502, 506), False, 'from dramkit.gentools import con_count, isnull\n'), ((1029, 1079), 'pandas.DataFrame', 'pd.DataFrame...
# This is an edited version of https://github.com/minhptx/iswc-2016-semantic-labeling, which was edited to use it as a baseline for Tab2KG (https://github.com/sgottsch/Tab2KG). import logging from numpy import percentile from scipy.stats import mannwhitneyu, f_oneway, ks_2samp, ttest_ind from tests import balance_re...
[ "tests.balance_result", "scipy.stats.mannwhitneyu", "scipy.stats.ttest_ind", "scipy.stats.f_oneway", "numpy.percentile", "scipy.stats.ks_2samp" ]
[((554, 594), 'tests.balance_result', 'balance_result', (['num1', 'num2', '(True)', 'result'], {}), '(num1, num2, True, result)\n', (568, 594), False, 'from tests import balance_result\n'), ((856, 896), 'tests.balance_result', 'balance_result', (['num1', 'num2', '(True)', 'result'], {}), '(num1, num2, True, result)\n',...
import numpy as np def gen_mean(vals, p = 3): p = float(p) return np.power( np.mean( np.power( np.array(vals, dtype=np.float64), p), axis=0), 1 / p ) def get_pmeans(wordembeddings): """give wordembeddings""" pmean_embedding = ...
[ "numpy.max", "numpy.array", "numpy.min", "numpy.concatenate" ]
[((1029, 1068), 'numpy.concatenate', 'np.concatenate', (['pmean_embedding'], {'axis': '(0)'}), '(pmean_embedding, axis=0)\n', (1043, 1068), True, 'import numpy as np\n'), ((641, 671), 'numpy.max', 'np.max', (['wordembeddings'], {'axis': '(0)'}), '(wordembeddings, axis=0)\n', (647, 671), True, 'import numpy as np\n'), (...
import numpy as np import scipy.optimize as spo import scipy.integrate as spi from scipy.integrate import odeint import matplotlib.pyplot as plt from . import viscosity class laminar: """ This class contains a variety of methods for computing quantities of interest for laminar flow in a tube. The argument...
[ "matplotlib.pyplot.loglog", "matplotlib.pyplot.title", "scipy.optimize.brentq", "matplotlib.pyplot.plot", "numpy.linspace", "matplotlib.pyplot.ylabel", "numpy.log10", "matplotlib.pyplot.xlabel" ]
[((3014, 3049), 'numpy.linspace', 'np.linspace', (['(0.0)', 'self.__radius', '(51)'], {}), '(0.0, self.__radius, 51)\n', (3025, 3049), True, 'import numpy as np\n'), ((3106, 3120), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {}), '(x, y)\n', (3114, 3120), True, 'import matplotlib.pyplot as plt\n'), ((3128, 3157)...
# -*- encoding: utf-8 -*- ''' @File : sausn.py @Time : 2020/10/04 22:24:26 @Author : <NAME> ''' import imp from math import cos, sin, pi, sqrt from re import T import socket import struct import numpy as np import time from hk_class import HHV class Robot: def __init__(self, ...
[ "numpy.matrix", "numpy.tanh", "hk_class.HHV", "socket.socket", "struct.unpack", "math.sin", "time.time", "numpy.array", "math.cos", "numpy.linalg.norm", "numpy.concatenate" ]
[((845, 870), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (853, 870), True, 'import numpy as np\n'), ((1210, 1215), 'hk_class.HHV', 'HHV', ([], {}), '()\n', (1213, 1215), False, 'from hk_class import HHV\n'), ((2080, 2113), 'numpy.array', 'np.array', (['[-256.0, -435.0, 304.0]'], {}), '...
import tensorflow as tf import numpy as np from utils.preprocessing_utils import * def preprocess_for_train(image, output_height, output_width, resize_side): """Preprocesses the given image for training. Args: image: A `Tensor` representing an image of arbitrary size. output_height: The height o...
[ "tensorflow.image.rot90", "tensorflow.range", "tensorflow.gather", "tensorflow.convert_to_tensor", "tensorflow.less", "tensorflow.reshape", "numpy.asarray", "tensorflow.concat", "tensorflow.minimum", "tensorflow.cast", "tensorflow.shape", "tensorflow.expand_dims" ]
[((1081, 1100), 'tensorflow.gather', 'tf.gather', (['image', '(0)'], {}), '(image, 0)\n', (1090, 1100), True, 'import tensorflow as tf\n'), ((3610, 3648), 'tensorflow.cast', 'tf.cast', (['input_data_tensor', 'tf.float32'], {}), '(input_data_tensor, tf.float32)\n', (3617, 3648), True, 'import tensorflow as tf\n'), ((913...
""" <NAME>, HKUST, 2018 Common utility functions """ import os import numpy as np from preprocess_matches import read_feature_repo, read_match_repo, get_inlier_image_coords, compute_fmat_error def complete_batch_size(input_list, batch_size): left = len(input_list) % batch_size if left != 0: for _ in ra...
[ "preprocess_matches.read_match_repo", "numpy.matrix", "preprocess_matches.compute_fmat_error", "preprocess_matches.read_feature_repo", "numpy.random.choice", "preprocess_matches.get_inlier_image_coords", "os.path.split", "os.path.join" ]
[((1091, 1136), 'os.path.join', 'os.path.join', (['sift_folder', "(frame_id + '.sift')"], {}), "(sift_folder, frame_id + '.sift')\n", (1103, 1136), False, 'import os\n'), ((1155, 1184), 'preprocess_matches.read_feature_repo', 'read_feature_repo', (['sift_file1'], {}), '(sift_file1)\n', (1172, 1184), False, 'from prepro...
# 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.runtime.convert", "numpy.count_nonzero", "tvm.nd.array", "scipy.sparse.bsr_matrix", "tvm.runtime.ndarray.array", "collections.namedtuple" ]
[((1087, 1154), 'collections.namedtuple', 'namedtuple', (['"""SparseAnalysisResult"""', "['weight_name', 'weight_shape']"], {}), "('SparseAnalysisResult', ['weight_name', 'weight_shape'])\n", (1097, 1154), False, 'from collections import namedtuple\n'), ((2750, 2791), 'scipy.sparse.bsr_matrix', 'sp.bsr_matrix', (['w_np...
# # functional_unit_tests.py # # Author(s): # <NAME> <<EMAIL>> # # Copyright (c) 2020-2021 ETH Zurich. # # 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/...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.hist", "matplotlib.pyplot.scatter", "torch.logical_not", "numpy.transpose", "numpy.histogram", "matplotlib.pyplot.figure", "torch.max", "torch.vstack", "torch.min", "torch.abs", "torch.sort", "torch.all" ]
[((1536, 1557), 'torch.all', 'torch.all', (['equivalent'], {}), '(equivalent)\n', (1545, 1557), False, 'import torch\n'), ((5004, 5038), 'matplotlib.pyplot.scatter', 'plt.scatter', (['x', 'y'], {'s': '(4)', 'marker': '"""."""'}), "(x, y, s=4, marker='.')\n", (5015, 5038), True, 'import matplotlib.pyplot as plt\n'), ((5...
import pickle import gzip import numpy as np import pandas as pd from PIL import Image import os import matplotlib.pyplot as plt import keras import sklearn import tensorflow as tf from tqdm import tqdm_notebook get_ipython().run_line_magic('matplotlib', 'inline') filename = 'mnist.pkl.gz' f = gzip.open(filename, 'rb'...
[ "sklearn.metrics.confusion_matrix", "numpy.sum", "numpy.argmax", "sklearn.metrics.accuracy_score", "numpy.ones", "sklearn.metrics.classification_report", "sklearn.ensemble.VotingClassifier", "pickle.load", "sklearn.svm.SVC", "pandas.DataFrame", "matplotlib.pyplot.imshow", "keras.utils.to_categ...
[((296, 321), 'gzip.open', 'gzip.open', (['filename', '"""rb"""'], {}), "(filename, 'rb')\n", (305, 321), False, 'import gzip\n'), ((366, 399), 'pickle.load', 'pickle.load', (['f'], {'encoding': '"""latin1"""'}), "(f, encoding='latin1')\n", (377, 399), False, 'import pickle\n'), ((510, 535), 'os.listdir', 'os.listdir',...
"""dataset数据预处理 1. 归一化节点特征 2. 将节点划分为训练集、验证集和测试集 3. 正则化邻接矩阵 4. 加载数据至相应设备, cpu或gpu """ import scipy import torch import numpy as np from .utils import PrepData def normalize_adjacency(adjacency): """邻接矩阵正则化 L = D^-0.5 * (A + I) * D^-0.5 A: 邻接矩阵, L: 正则化邻接矩阵 Input: ...
[ "torch.LongTensor", "numpy.power", "torch.FloatTensor", "numpy.where", "torch.cuda.is_available", "scipy.sparse.eye" ]
[((486, 522), 'scipy.sparse.eye', 'scipy.sparse.eye', (['adjacency.shape[0]'], {}), '(adjacency.shape[0])\n', (502, 522), False, 'import scipy\n'), ((1803, 1823), 'torch.FloatTensor', 'torch.FloatTensor', (['X'], {}), '(X)\n', (1820, 1823), False, 'import torch\n'), ((1844, 1876), 'torch.LongTensor', 'torch.LongTensor'...
#!/usr/bin/env python3 from __future__ import print_function from os import path import os.path import sys from keras.preprocessing.image import array_to_img from keras.preprocessing.image import img_to_array from keras.preprocessing.image import load_img from tensorflow.keras.preprocessing.image import ImageDataGener...
[ "tensorflow.keras.models.load_model", "numpy.expand_dims", "keras.preprocessing.image.img_to_array", "keras.preprocessing.image.load_img", "os.path.isfile", "sys.exit" ]
[((729, 767), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (['model_file'], {}), '(model_file)\n', (755, 767), True, 'import tensorflow as tf\n'), ((776, 820), 'keras.preprocessing.image.load_img', 'load_img', (['test_image'], {'target_size': '(150, 150)'}), '(test_image, target_size=(150, 150))\...
# -*- coding: utf-8 -*- """ Created on Tue Dec 15 14:40:34 2020 @author: qtckp """ import sys sys.path.append('..') import numpy as np from OppOpPopInit import OppositionOperators, init_population, SampleInitializers from OppOpPopInit.plotting import plot_opposition from OppOpPopInit import set_seed set_seed(100)...
[ "sys.path.append", "OppOpPopInit.SampleInitializers.Uniform", "OppOpPopInit.OppositionOperators.Reflect", "OppOpPopInit.set_seed", "numpy.array", "OppOpPopInit.OppositionOperators.Continual.over", "OppOpPopInit.init_population", "numpy.vstack" ]
[((96, 117), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (111, 117), False, 'import sys\n'), ((307, 320), 'OppOpPopInit.set_seed', 'set_seed', (['(100)'], {}), '(100)\n', (315, 320), False, 'from OppOpPopInit import set_seed\n'), ((334, 352), 'numpy.array', 'np.array', (['[-8, -1]'], {}), '([-...
""" Extract line_walk code from live_dt for use in other places. Provides a more "hands-on" approach to checking an arbitrary line segment against existing elements of a CGAL constrained delaunay triangulation """ from __future__ import print_function from stompy.spatial import robust_predicates from stompy.grid import...
[ "CGAL.CGAL_Kernel.Point_2", "numpy.array", "stompy.spatial.robust_predicates.orientation", "stompy.grid.exact_delaunay.rel_ordered", "numpy.dot" ]
[((763, 790), 'numpy.array', 'np.array', (['[-vec[1], vec[0]]'], {}), '([-vec[1], vec[0]])\n', (771, 790), True, 'import numpy as np\n'), ((7619, 7633), 'numpy.array', 'np.array', (['nbrs'], {}), '(nbrs)\n', (7627, 7633), True, 'import numpy as np\n'), ((2014, 2058), 'stompy.spatial.robust_predicates.orientation', 'rob...
import numpy as np def load_spontaneous(): return np.load("Data/stringer_spontaneous.npy", allow_pickle=True).item() def load_orientations(): return np.load("Data/stringer_orientations.npy", allow_pickle=True).item()
[ "numpy.load" ]
[((55, 114), 'numpy.load', 'np.load', (['"""Data/stringer_spontaneous.npy"""'], {'allow_pickle': '(True)'}), "('Data/stringer_spontaneous.npy', allow_pickle=True)\n", (62, 114), True, 'import numpy as np\n'), ((159, 219), 'numpy.load', 'np.load', (['"""Data/stringer_orientations.npy"""'], {'allow_pickle': '(True)'}), "...
import file_operations import glob import numpy as np import os import pandas as pd import solution import time OLD_SUBMISSION_FOLDER_PATH = solution.SUBMISSION_FOLDER_PATH NEW_SUBMISSION_FOLDER_PATH = "./" def perform_ensembling(low_threshold, high_threshold): print("Reading the submission files from disk ...")...
[ "os.path.basename", "numpy.median", "pandas.read_csv", "time.time", "numpy.mean", "os.path.join" ]
[((969, 1001), 'numpy.mean', 'np.mean', (['prediction_list'], {'axis': '(0)'}), '(prediction_list, axis=0)\n', (976, 1001), True, 'import numpy as np\n'), ((1026, 1060), 'numpy.median', 'np.median', (['prediction_list'], {'axis': '(0)'}), '(prediction_list, axis=0)\n', (1035, 1060), True, 'import numpy as np\n'), ((401...
""" Save the results along the optimization. """ import numpy as np import pandas as pd from sao_opt.opt_problem import Simulation class AppendResults: """Append the results and save.""" def __init__(self): self.count = [] self.fob_center = [] self.fob_star = [] self.fap_cent...
[ "pandas.DataFrame", "numpy.around", "sao_opt.opt_problem.Simulation" ]
[((1196, 1215), 'pandas.DataFrame', 'pd.DataFrame', (['datas'], {}), '(datas)\n', (1208, 1215), True, 'import pandas as pd\n'), ((2715, 2727), 'sao_opt.opt_problem.Simulation', 'Simulation', ([], {}), '()\n', (2725, 2727), False, 'from sao_opt.opt_problem import Simulation\n'), ((985, 1016), 'numpy.around', 'np.around'...
#coding:utf-8 import sys #sys.path.append("../") sys.path.insert(0,'..') import numpy as np import argparse import os #import cPickle as pickle import pickle import cv2 from train_models.mtcnn_model import P_Net,R_Net from train_models.MTCNN_config import config from loader import TestLoader from Detection.detector imp...
[ "os.mkdir", "pickle.dump", "os.makedirs", "numpy.argmax", "cv2.imwrite", "Detection.fcn_detector.FcnDetector", "os.path.exists", "sys.path.insert", "loader.TestLoader", "cv2.imread", "numpy.max", "numpy.array", "Detection.MtcnnDetector.MtcnnDetector", "Detection.detector.Detector", "nump...
[((49, 73), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (64, 73), False, 'import sys\n'), ((5830, 5958), 'Detection.MtcnnDetector.MtcnnDetector', 'MtcnnDetector', ([], {'detectors': 'detectors', 'min_face_size': 'min_face_size', 'stride': 'stride', 'threshold': 'thresh', 'slide_windo...
import os import numpy as np datafolder="/home/jliu447/lossycompression/aramco_849" ebs=[i*1e-4 for i in range(1,10)]+[i*1e-3 for i in range(1,10)]+[i*1e-2 for i in range(1,11)] idxlist=range(1400,1700,50) cr=np.zeros((29,len(idxlist)+1),dtype=np.float32) psnr=np.zeros((29,len(idxlist)+1),dtype=np.float32) for i,eb...
[ "numpy.savetxt", "os.path.join", "os.system" ]
[((1266, 1319), 'numpy.savetxt', 'np.savetxt', (['"""sz_aramco849_cr.txt"""', 'cr'], {'delimiter': '"""\t"""'}), "('sz_aramco849_cr.txt', cr, delimiter='\\t')\n", (1276, 1319), True, 'import numpy as np\n'), ((1318, 1375), 'numpy.savetxt', 'np.savetxt', (['"""sz_aramco849_psnr.txt"""', 'psnr'], {'delimiter': '"""\t"""'...
"""Example analyzing the FIAC dataset with NIPY. """ #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Stdlib import warnings from tempfile import NamedTemporaryFile from os.path import join as pjoin...
[ "nipy.algorithms.statistics.onesample.estimate_varatio", "numpy.nan_to_num", "numpy.empty", "numpy.ones", "fiac_util.get_fmri_anat", "fiac_util.output_dir", "fiac_util.ensure_dir", "nipy.fixes.scipy.stats.models.regression.ARModel", "numpy.arange", "nipy.fixes.scipy.stats.models.regression.OLSMode...
[((1008, 1050), 'fiac_util.load_image_fiac', 'futil.load_image_fiac', (['"""group"""', '"""mask.nii"""'], {}), "('group', 'mask.nii')\n", (1029, 1050), True, 'import fiac_util as futil\n'), ((1063, 1098), 'numpy.zeros', 'np.zeros', (['GROUP_MASK.shape', 'np.bool'], {}), '(GROUP_MASK.shape, np.bool)\n', (1071, 1098), Tr...
# Author: <NAME> # <NAME> # License: BSD 3 clause import os from matplotlib import image import numpy as np from sklearn.externals import joblib from sklearn.metrics.pairwise import euclidean_distances from sklearn.cluster import KMeans root_dir = os.path.dirname(os.path.abspath(__file__)) DATAPATH = os.path...
[ "os.path.abspath", "sklearn.externals.joblib.dump", "numpy.sum", "matplotlib.image.imread", "sklearn.cluster.KMeans", "sklearn.metrics.pairwise.euclidean_distances", "numpy.random.RandomState", "numpy.argsort", "numpy.array", "sklearn.externals.joblib.load", "numpy.bincount", "os.path.join" ]
[((313, 355), 'os.path.join', 'os.path.join', (['root_dir', '""".."""', '""".."""', '"""data"""'], {}), "(root_dir, '..', '..', 'data')\n", (325, 355), False, 'import os\n'), ((275, 300), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (290, 300), False, 'import os\n'), ((1055, 1097), 'sklearn...
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd from brainiak.isc import isc from statsmodels.stats.multitest import multipletests from statistical_tests import bootstrap_test, fisher_mean from coupling_metrics import lagged_isc # Load in PCA-reduced LSTMS k = 100 lstms_pc...
[ "numpy.load", "numpy.moveaxis", "seaborn.heatmap", "numpy.argsort", "numpy.argpartition", "numpy.mean", "numpy.arange", "matplotlib.patches.Patch", "matplotlib.pyplot.tight_layout", "numpy.unique", "numpy.full", "pandas.DataFrame", "coupling_metrics.lagged_isc", "matplotlib.pyplot.subplots...
[((324, 369), 'numpy.load', 'np.load', (['f"""results/lstms_tanh-z_pca-k{k}.npy"""'], {}), "(f'results/lstms_tanh-z_pca-k{k}.npy')\n", (331, 369), True, 'import numpy as np\n'), ((495, 547), 'numpy.full', 'np.full', (['(n_matchups, n_repeats, n_pairs, k)', 'np.nan'], {}), '((n_matchups, n_repeats, n_pairs, k), np.nan)\...
import numpy as np import math from typing import Tuple, Set def conj_grad(A: np.matrix, b: np.ndarray, x_0: np.ndarray): k = 0 r = {}; r[0] = b - A @ x_0 x = {}; x[0] = x_0 p = {} tau = {} mu = {} while not math.isclose(np.linalg.norm(r[k], ord=2), 0): k += 1 if k == 1: ...
[ "numpy.eye", "numpy.zeros", "math.isclose", "numpy.linalg.norm" ]
[((763, 779), 'numpy.zeros', 'np.zeros', (['b.size'], {}), '(b.size)\n', (771, 779), True, 'import numpy as np\n'), ((929, 945), 'numpy.zeros', 'np.zeros', (['b.size'], {}), '(b.size)\n', (937, 945), True, 'import numpy as np\n'), ((2534, 2556), 'numpy.eye', 'np.eye', (['n'], {'dtype': 'float'}), '(n, dtype=float)\n', ...
# Copyright 2021 Adobe # All Rights Reserved. # NOTICE: Adobe permits you to use, modify, and distribute this file in # accordance with the terms of the Adobe license agreement accompanying # it. ''' Randaugment Cubuk, <NAME>., et al. "Randaugment: Practical automated data augmentation with a reduced search spac...
[ "albumentations.Sequential", "random.choice", "numpy.random.randint", "numpy.linspace", "albumentations.SomeOf" ]
[((9749, 9775), 'albumentations.Sequential', 'A.Sequential', (['initial_augs'], {}), '(initial_augs)\n', (9761, 9775), True, 'import albumentations as A\n'), ((9803, 9838), 'albumentations.SomeOf', 'A.SomeOf', ([], {'transforms': 'main_augs', 'n': 'n'}), '(transforms=main_augs, n=n)\n', (9811, 9838), True, 'import albu...
# -*- coding: utf-8 -*- #import matplotlib.pyplot as plt #import copy import numpy as np np.set_printoptions(precision=6,threshold=1e3) import torch #from torch import nn, autograd from torchvision import datasets, transforms import copy import torch.nn as nn # import torch.nn.functional as F from torch....
[ "torch.eq", "copy.deepcopy", "numpy.set_printoptions", "torchvision.datasets.FashionMNIST", "torch.nn.CrossEntropyLoss", "numpy.array", "torch.max", "torchvision.transforms.Normalize", "torch.tensor", "torchvision.transforms.ToTensor" ]
[((95, 145), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(6)', 'threshold': '(1000.0)'}), '(precision=6, threshold=1000.0)\n', (114, 145), True, 'import numpy as np\n'), ((1031, 1129), 'torchvision.datasets.FashionMNIST', 'datasets.FashionMNIST', (['"""./data/FASHION_MNIST/"""'], {'download': '...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Cross-gradient Joint Inversion of Gravity and Magnetic Anomaly Data =================================================================== Here we simultaneously invert gravity and magentic data using cross-gradient constraint. The recovered density and susceptibility m...
[ "SimPEG.potential_fields.magnetics.sources.SourceField", "SimPEG.regularization.CrossGradient", "SimPEG.optimization.ProjectedGNCG", "numpy.random.seed", "numpy.abs", "SimPEG.utils.download", "SimPEG.data.Data", "numpy.ones", "numpy.shape", "SimPEG.inversion.BaseInversion", "matplotlib.pyplot.fi...
[((1473, 1490), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1487, 1490), True, 'import numpy as np\n'), ((2103, 2146), 'SimPEG.utils.download', 'utils.download', (['data_source'], {'overwrite': '(True)'}), '(data_source, overwrite=True)\n', (2117, 2146), False, 'from SimPEG import maps, data, data_m...
from __future__ import division, print_function, unicode_literals import sys from os import listdir import numpy as np seed = 13 np.random.seed(seed) from keras.models import model_from_json from sklearn.metrics import f1_score, classification_report, confusion_matrix from sklearn.model_selection import KFold, train_te...
[ "numpy.set_printoptions", "numpy.random.seed", "numpy.argmax", "sys.path.insert", "sklearn.model_selection.KFold", "keras.models.model_from_json", "numpy.mean", "segmentation.dataset.Dataset", "segmentation.model.build_model", "segmentation.model.train_model", "os.listdir" ]
[((129, 149), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (143, 149), True, 'import numpy as np\n'), ((330, 354), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (345, 354), False, 'import sys\n'), ((565, 602), 'numpy.set_printoptions', 'np.set_printoptions', ([], ...
import numpy as np import torch from torch.utils.data import Dataset, DataLoader import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import DataLoader from torch.nn import init class DataReader: NEGATIVE_TABLE_SIZE = 1e8 def __init__(self, inputFileName,...
[ "torch.mean", "numpy.concatenate", "torch.utils.data.DataLoader", "torch.LongTensor", "torch.nn.Embedding", "torch.nn.init.uniform_", "torch.mul", "torch.nn.init.constant_", "numpy.array", "torch.clamp", "torch.cuda.is_available", "torch.device", "numpy.random.rand", "numpy.round", "torc...
[((2407, 2455), 'numpy.round', 'np.round', (['(ratio * DataReader.NEGATIVE_TABLE_SIZE)'], {}), '(ratio * DataReader.NEGATIVE_TABLE_SIZE)\n', (2415, 2455), True, 'import numpy as np\n'), ((2566, 2590), 'numpy.array', 'np.array', (['self.negatives'], {}), '(self.negatives)\n', (2574, 2590), True, 'import numpy as np\n'),...
#!/usr/bin/env -S python3 -u import time from typing import Optional import cv2 import numpy as np from tc_cam import Stopwatch from tc_cam.process import ExposureLut from tc_cam.analyze import calc_black_level, histogram_calc, histogram_draw from tc_cam.cvext import CVWindow, region_reparent, extract_region, display...
[ "cv2.resize", "tc_cam.raw_source.AbstractRawSource.get_implementation", "tc_cam.cvext.region_reparent", "numpy.save", "tc_cam.cvext.display_shadow_text", "cv2.imwrite", "tc_cam.analyze.histogram_draw", "time.start", "time.time", "tc_cam.cvext.extract_region", "tc_cam.analyze.calc_black_level", ...
[((933, 953), 'tc_cam.cvext.CVWindow', 'CVWindow', (['"""Telecine"""'], {}), "('Telecine')\n", (941, 953), False, 'from tc_cam.cvext import CVWindow, region_reparent, extract_region, display_shadow_text\n'), ((990, 1028), 'tc_cam.raw_source.AbstractRawSource.get_implementation', 'AbstractRawSource.get_implementation', ...
import numpy as np import random class ReBuffer: def __init__(self, batchsize=64, maxbuffersize=124000): self.batchsize = batchsize self.maxbuffersize = maxbuffersize self.index_done = 0 self.index_done_ = 0 self.num = 0 self.state = [] self.reward = [] ...
[ "numpy.array" ]
[((1274, 1294), 'numpy.array', 'np.array', (['self.state'], {}), '(self.state)\n', (1282, 1294), True, 'import numpy as np\n'), ((1332, 1353), 'numpy.array', 'np.array', (['self.reward'], {}), '(self.reward)\n', (1340, 1353), True, 'import numpy as np\n'), ((1389, 1408), 'numpy.array', 'np.array', (['self.done'], {}), ...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import from builtins import filter from builtins import range from past.builtins import basestring from builtins import object import socket import threading from errno import ECONNREFUSED from functools import partial from mu...
[ "functools.partial", "threading.Thread", "socket.send", "socket.socket", "time.time", "socket.recv_into", "multiprocessing.Pool", "numpy.random.rand", "builtins.range" ]
[((1152, 1165), 'multiprocessing.Pool', 'Pool', (['NO_CPUs'], {}), '(NO_CPUs)\n', (1156, 1165), False, 'from multiprocessing import Pool\n'), ((1182, 1201), 'functools.partial', 'partial', (['ping', 'host'], {}), '(ping, host)\n', (1189, 1201), False, 'from functools import partial\n'), ((4155, 4204), 'socket.socket', ...
"""Python Script Template.""" import gym import numpy as np import torch from rllib.model import AbstractModel from rllib.reward.locomotion_reward import LocomotionReward try: from gym.envs.mujoco.humanoid_v3 import HumanoidEnv, mass_center except (ModuleNotFoundError, gym.error.DependencyNotInstalled): Swimm...
[ "gym.envs.mujoco.humanoid_v3.mass_center", "numpy.zeros", "rllib.reward.locomotion_reward.LocomotionReward", "numpy.linalg.norm", "torch.zeros", "numpy.concatenate" ]
[((2722, 2739), 'numpy.zeros', 'np.zeros', (['dim_pos'], {}), '(dim_pos)\n', (2730, 2739), True, 'import numpy as np\n'), ((2769, 2923), 'rllib.reward.locomotion_reward.LocomotionReward', 'LocomotionReward', ([], {'dim_action': 'dim_action', 'ctrl_cost_weight': 'ctrl_cost_weight', 'forward_reward_weight': 'forward_rewa...
# Copyright 2018 The TensorFlow Probability 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 o...
[ "tensorflow.test.main", "numpy.random.randn", "tensorflow_probability.python.bijectors.DiscreteCosineTransform", "numpy.float32", "scipy.fftpack.dct", "numpy.linspace" ]
[((2961, 2975), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (2973, 2975), True, 'import tensorflow as tf\n'), ((1298, 1345), 'tensorflow_probability.python.bijectors.DiscreteCosineTransform', 'tfb.DiscreteCosineTransform', ([], {'validate_args': '(True)'}), '(validate_args=True)\n', (1325, 1345), True, 'f...
#extract lexical features import re from pathlib import Path import sys from matplotlib import pyplot as plt from collections import Counter import numpy as np import codecs from collections import defaultdict import math import operator from sklearn.metrics.pairwise import kernel_metrics import pickle contents = ['ph...
[ "sklearn.ensemble.RandomForestClassifier", "matplotlib.pyplot.subplot", "pickle.dump", "matplotlib.pyplot.show", "codecs.open", "matplotlib.pyplot.suptitle", "sklearn.model_selection.train_test_split", "numpy.std", "numpy.log2", "collections.defaultdict", "pathlib.Path", "re.findall", "numpy...
[((6770, 6790), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(1)', '(2)', '(1)'], {}), '(1, 2, 1)\n', (6781, 6790), True, 'from matplotlib import pyplot as plt\n'), ((6881, 6901), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(1)', '(2)', '(2)'], {}), '(1, 2, 2)\n', (6892, 6901), True, 'from matplotlib import pyplot...
import numpy as np class Tri6: """Class for a six noded quadratic triangular element. Provides methods for the calculation of section properties based on the finite element method. :param int el_id: Unique element id :param coords: A 2 x 6 array of the coordinates of the tri-6 nodes. The first three...
[ "numpy.zeros", "numpy.transpose", "numpy.cross", "numpy.ones", "numpy.sin", "numpy.array", "numpy.linalg.inv", "numpy.cos", "numpy.linalg.det", "numpy.vstack", "numpy.sqrt" ]
[((23331, 23453), 'numpy.array', 'np.array', (['[eta * (2 * eta - 1), xi * (2 * xi - 1), zeta * (2 * zeta - 1), 4 * eta *\n xi, 4 * xi * zeta, 4 * eta * zeta]'], {}), '([eta * (2 * eta - 1), xi * (2 * xi - 1), zeta * (2 * zeta - 1), 4 *\n eta * xi, 4 * xi * zeta, 4 * eta * zeta])\n', (23339, 23453), True, 'import...
import os, sys import random import numpy as np import json import cv2 import pprint from PIL import Image import torch from torch.utils import data CURR_DIR = os.path.dirname(__file__) random.seed(0); np.random.seed(0); torch.manual_seed(0) class BaseDataset(data.Dataset): def __init__(self, image_dir,layout_p...
[ "numpy.random.seed", "torch.utils.data.DataLoader", "torch.manual_seed", "os.path.dirname", "cv2.imwrite", "numpy.transpose", "custom_transforms.RandomCrop", "custom_transforms.ToTensor", "cv2.imread", "custom_transforms.RandomHorizontalFlip", "torch.Tensor", "random.seed", "pprint.pprint", ...
[((161, 186), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (176, 186), False, 'import os, sys\n'), ((188, 202), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (199, 202), False, 'import random\n'), ((204, 221), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (218, 221)...
import numpy as np import pickle def open_dyn(file): n = 0 L = [] with open(file, "r") as file: for line in file: line = line.strip() [u, v, t] = list(map(int, line.split(" "))) L.append((t, u, v)) n = max(n, u, v) Tmax = L[0][0] L.revers...
[ "pickle.dump", "pickle.load", "numpy.array", "numpy.sum" ]
[((1027, 1052), 'pickle.dump', 'pickle.dump', (['positions', 'f'], {}), '(positions, f)\n', (1038, 1052), False, 'import pickle\n'), ((1121, 1135), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1132, 1135), False, 'import pickle\n'), ((732, 757), 'numpy.array', 'np.array', (['positions[i][t]'], {}), '(positions[...
import os import sys from copy import deepcopy import numpy as np os.chdir(os.path.dirname(__file__)) sys.path.append("../../../..") from local_analyzers.em import BSPM_EM_Analysis from mach_eval.analyzers import structrual_analyzer as stra from mach_eval.analyzers import thermal_analyzer as therm from mach_eval.ana...
[ "sys.path.append", "bspm_designer.designer.create_design", "copy.deepcopy", "mach_eval.analyzers.thermal_analyzer.WindageProblem", "mach_eval.analyzers.thermal_stator.ThermalProblem", "os.path.dirname", "mach_eval.MachineEvaluator", "mach_opt.InvalidDesign", "mach_eval.AnalysisStep", "local_analyz...
[((103, 133), 'sys.path.append', 'sys.path.append', (['"""../../../.."""'], {}), "('../../../..')\n", (118, 133), False, 'import sys\n'), ((988, 1022), 'mach_eval.analyzers.structrual_analyzer.SleeveAnalyzer', 'stra.SleeveAnalyzer', (['stress_limits'], {}), '(stress_limits)\n', (1007, 1022), True, 'from mach_eval.analy...
import numpy as np import os class pickler: def __init__(self,cluster,prefix="data/"): self.cluster = cluster self._cluster_prefix = prefix # os.chdir(self._cluster_prefix) def load(self): if pickler.cluster_exists(self.cluster,self._cluster_prefix): data = np.load...
[ "numpy.savez", "os.path.isfile" ]
[((460, 513), 'numpy.savez', 'np.savez', (['(self._cluster_prefix + self.cluster)'], {}), '(self._cluster_prefix + self.cluster, **data)\n', (468, 513), True, 'import numpy as np\n'), ((636, 660), 'os.path.isfile', 'os.path.isfile', (['filename'], {}), '(filename)\n', (650, 660), False, 'import os\n')]
# MIT License # # Copyright (c) 2018, <NAME>. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pub...
[ "copy.deepcopy", "matplotlib.pyplot.scatter", "matplotlib.pyplot.axis", "inhomogenousPaths.evaluateScheduleAndCourse.evaluate", "matplotlib.pyplot.figure", "numpy.random.randint", "numpy.min", "numpy.linspace", "numpy.random.choice", "numpy.random.rand", "inhomogenousPaths.generateRandomCourse.g...
[((1413, 1435), 'inhomogenousPaths.generateRandomCourse.generate_course', 'grc.generate_course', (['(2)'], {}), '(2)\n', (1432, 1435), True, 'import inhomogenousPaths.generateRandomCourse as grc\n'), ((1436, 1448), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1446, 1448), True, 'import matplotlib.pyplot...
import numpy as np from functools import wraps from typing import List, Optional, Union from autoconf import conf from autoarray.mask.mask_2d import Mask2D from autoarray.structures.arrays.one_d.array_1d import Array1D from autoarray.structures.arrays.two_d.array_2d import Array2D from autoarray.structures.gri...
[ "autoarray.structures.vectors.irregular.VectorYX2DIrregular", "autoarray.structures.arrays.one_d.array_1d.Array1D.manual_slim", "numpy.multiply", "autoarray.exc.GridException", "autoarray.structures.grids.two_d.grid_2d.Grid2D.from_mask", "numpy.errstate", "numpy.isnan", "numpy.where", "autoarray.str...
[((1576, 1587), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (1581, 1587), False, 'from functools import wraps\n'), ((5457, 5468), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (5462, 5468), False, 'from functools import wraps\n'), ((7455, 7466), 'functools.wraps', 'wraps', (['func'], {}), '(func)\...
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, mo...
[ "numpy.stack", "numpy.sum", "numpy.deg2rad", "numpy.cross", "numpy.zeros", "torch.zeros", "numpy.tan", "numpy.array", "numpy.linalg.norm", "numpy.matmul", "numpy.sin", "numpy.cos" ]
[((1176, 1193), 'numpy.linalg.norm', 'np.linalg.norm', (['v'], {}), '(v)\n', (1190, 1193), True, 'import numpy as np\n'), ((1737, 1757), 'numpy.deg2rad', 'np.deg2rad', (['param[0]'], {}), '(param[0])\n', (1747, 1757), True, 'import numpy as np\n'), ((1768, 1788), 'numpy.deg2rad', 'np.deg2rad', (['param[1]'], {}), '(par...
import numpy as np mask = np.array([1,1,1,0,0,1,1,1]) # print([0,*(mask[1:] & mask[:-1])]) # print()
[ "numpy.array" ]
[((28, 62), 'numpy.array', 'np.array', (['[1, 1, 1, 0, 0, 1, 1, 1]'], {}), '([1, 1, 1, 0, 0, 1, 1, 1])\n', (36, 62), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- """ Created on Fri Nov 19 17:31:06 2021 @author: tkdgu """ from sentence_transformers import SentenceTransformer import pandas as pd import numpy as np model = SentenceTransformer('sentence-transformers/multi-qa-mpnet-base-dot-v1') def cosine(u, v): return np.dot(u, v) / (np.linalg.norm(...
[ "numpy.linalg.lstsq", "numpy.array", "numpy.linalg.norm", "numpy.dot", "sentence_transformers.SentenceTransformer" ]
[((187, 258), 'sentence_transformers.SentenceTransformer', 'SentenceTransformer', (['"""sentence-transformers/multi-qa-mpnet-base-dot-v1"""'], {}), "('sentence-transformers/multi-qa-mpnet-base-dot-v1')\n", (206, 258), False, 'from sentence_transformers import SentenceTransformer\n'), ((2170, 2191), 'numpy.array', 'np.a...
import ast import numpy as np from six.moves import configparser from os import sys, path sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) from lib.dac.dac import DAC def get_config(id, filename): """ Get all attributes from a configuration file specified by filename :param id: ident...
[ "os.path.abspath", "numpy.ones", "six.moves.configparser.RawConfigParser" ]
[((454, 484), 'six.moves.configparser.RawConfigParser', 'configparser.RawConfigParser', ([], {}), '()\n', (482, 484), False, 'from six.moves import configparser\n'), ((134, 156), 'os.path.abspath', 'path.abspath', (['__file__'], {}), '(__file__)\n', (146, 156), False, 'from os import sys, path\n'), ((1432, 1454), 'nump...
from abc import ABC, abstractmethod from dataclasses import InitVar, dataclass, field from typing import Literal import numpy as np from matplotlib.path import Path from shapely.geometry import GeometryCollection, LinearRing, MultiPolygon, Polygon from shapely.geometry.base import BaseGeometry from c3nav.mapdata.util...
[ "numpy.logical_not", "dataclasses.field", "numpy.array", "numpy.argwhere", "dataclasses.dataclass", "c3nav.mapdata.utils.geometry.assert_multipolygon" ]
[((718, 739), 'dataclasses.dataclass', 'dataclass', ([], {'slots': '(True)'}), '(slots=True)\n', (727, 739), False, 'from dataclasses import InitVar, dataclass, field\n'), ((2499, 2520), 'dataclasses.dataclass', 'dataclass', ([], {'slots': '(True)'}), '(slots=True)\n', (2508, 2520), False, 'from dataclasses import Init...
import sys, random import numpy as np scale = 1. left_file = sys.argv[1] right_file = sys.argv[2] def to_event(line): comps = line.split(" ") if len(comps) != 4: raise Exception("Wrong AER data format") t = float(comps[0]) x, y, p = [int(x) for x in comps[1:]] return t, x, y, p def write_events(events, out...
[ "numpy.sum", "numpy.zeros", "numpy.mean", "numpy.array", "numpy.sqrt" ]
[((1631, 1650), 'numpy.zeros', 'np.zeros', (['left_dims'], {}), '(left_dims)\n', (1639, 1650), True, 'import numpy as np\n'), ((1451, 1486), 'numpy.zeros', 'np.zeros', (['left_dims'], {'dtype': 'np.int64'}), '(left_dims, dtype=np.int64)\n', (1459, 1486), True, 'import numpy as np\n'), ((1523, 1559), 'numpy.zeros', 'np....
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # All contributions by <NAME>: # Copyright (c) 2019 <NAME> # # MIT License import os import functools import math from tq...
[ "utils.seed_rng", "numpy.load", "torch.cuda.device_count", "os.path.join", "utils.load_weights", "data_utils.utils.get_dataloader", "sync_batchnorm.patch_replication_callback", "train_fns.save_weights", "torch.nn.parallel.DistributedDataParallel", "utils.progress", "torch.exp", "utils.MetricsL...
[((430, 461), 'os.path.join', 'os.path.join', (['sys.path[0]', '""".."""'], {}), "(sys.path[0], '..')\n", (442, 461), False, 'import os\n'), ((1152, 1185), 'utils.update_config_roots', 'utils.update_config_roots', (['config'], {}), '(config)\n', (1177, 1185), False, 'import utils\n'), ((1231, 1257), 'utils.prepare_root...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from abc import ABC, abstractmethod from typing import Dict, Optional, Tuple, Union, cast import gym import gym.wrappers ...
[ "numpy.stack", "mbrl.third_party.dmc2gym.make", "hydra.utils.instantiate", "typing.cast", "omegaconf.OmegaConf.create" ]
[((1809, 1857), 'mbrl.third_party.dmc2gym.make', 'dmc2gym.make', ([], {'domain_name': 'domain', 'task_name': 'task'}), '(domain_name=domain, task_name=task)\n', (1821, 1857), True, 'import mbrl.third_party.dmc2gym as dmc2gym\n'), ((7522, 7553), 'omegaconf.OmegaConf.create', 'omegaconf.OmegaConf.create', (['cfg'], {}), ...
import os, re, json import numpy as np import tensorflow as tf def restore(session, restore_snap, except_list=None, select_list=None, restore_vars=None, raise_if_not_found=False, saver=None, verbose=True): """ restore_vars: the dict for tf saver.restore => a dict {name in ckpt : var in current graph} """ ...
[ "json.dump", "re.fullmatch", "json.loads", "numpy.logical_and", "numpy.concatenate", "tensorflow.train.Saver", "numpy.logical_not", "numpy.zeros", "numpy.expand_dims", "os.path.exists", "tensorflow.get_variable_scope", "numpy.any", "models.basic_operators.get_boundary_mask", "tensorflow.tr...
[((690, 729), 'tensorflow.train.NewCheckpointReader', 'tf.train.NewCheckpointReader', (['save_file'], {}), '(save_file)\n', (718, 729), True, 'import tensorflow as tf\n'), ((5690, 5724), 'numpy.zeros', 'np.zeros', (['labels.shape'], {'dtype': 'bool'}), '(labels.shape, dtype=bool)\n', (5698, 5724), True, 'import numpy a...
# coding: UTF-8 import os from imageio import imread, imsave import numpy as np # import matplotlib.pyplot as plt import torch import torch.nn.functional as F # def plot_text(txt, size=224): # fig = plt.figure(figsize=(1,1), dpi=size) # fontsize = size//len(txt) if len(txt) < 15 else 8 # plt.text(0.5, 0.5...
[ "numpy.dstack", "numpy.meshgrid", "numpy.fmod", "os.path.join", "os.path.basename", "numpy.remainder", "imageio.imread", "os.walk", "os.path.isfile", "numpy.where", "numpy.arange", "numpy.array", "torch.max", "torch.min", "imageio.imsave", "os.listdir", "numpy.issubdtype" ]
[((1839, 1851), 'imageio.imread', 'imread', (['path'], {}), '(path)\n', (1845, 1851), False, 'from imageio import imread, imsave\n'), ((2203, 2220), 'imageio.imsave', 'imsave', (['path', 'img'], {}), '(path, img)\n', (2209, 2220), False, 'from imageio import imread, imsave\n'), ((3325, 3352), 'numpy.arange', 'np.arange...
import nltk import numpy as np import re from scipy import stats from scipy.stats import spearmanr #多読図書のYL x_tadoku = [1.1, 1.1, 3.5, 3.3, 3.9, 4.7, 4.7, 1.2, 1.4, 1.8, 1.3, 2.1, 2.7, 3.8, 3.5, 4.7, 3.3, 3.3, 3.9, 5.7, 0.6, 0.6, 0.7, 3.3, 4.1, 4.1, 3.3, 0.9, 0.8, 0.8, 0.7, 0....
[ "scipy.stats.spearmanr", "numpy.array", "nltk.pos_tag", "re.sub", "nltk.word_tokenize" ]
[((1900, 1917), 'numpy.array', 'np.array', (['x_zenbu'], {}), '(x_zenbu)\n', (1908, 1917), True, 'import numpy as np\n'), ((1925, 1946), 'numpy.array', 'np.array', (['keisankekka'], {}), '(keisankekka)\n', (1933, 1946), True, 'import numpy as np\n'), ((2015, 2046), 'scipy.stats.spearmanr', 'spearmanr', (['x_zenbu', 'ke...
import matplotlib import matplotlib.pyplot as plt import src.imageTrans as it import numpy as np from glob import glob from keras.preprocessing import image def readSavedFiles( path ): files = [] with open( path, "r" ) as readFile: for line in readFile: files.append( line.strip() ) ...
[ "numpy.random.uniform", "matplotlib.pyplot.yscale", "matplotlib.pyplot.show", "matplotlib.pyplot.legend", "keras.preprocessing.image.img_to_array", "matplotlib.pyplot.figure", "keras.preprocessing.image.load_img", "numpy.array", "src.imageTrans.mirrorImages", "numpy.random.rand", "matplotlib.pyp...
[((328, 343), 'numpy.array', 'np.array', (['files'], {}), '(files)\n', (336, 343), True, 'import numpy as np\n'), ((1764, 1795), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {'figsize': '(18, 10)'}), '(1, figsize=(18, 10))\n', (1774, 1795), True, 'import matplotlib.pyplot as plt\n'), ((2073, 2103), 'matplotlib.p...
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import logging as log import numpy as np from extensions.middle.AddIsCyclicAttribute import AddIsCyclicAttribute from extensions.ops.TensorIterator_ops import TensorIteratorInput from mo.graph.graph import Graph from mo.middle.replacem...
[ "numpy.array", "logging.warning", "logging.debug" ]
[((4886, 4948), 'logging.debug', 'log.debug', (['"""================== SmartInputFind ==============="""'], {}), "('================== SmartInputFind ===============')\n", (4895, 4948), True, 'import logging as log\n'), ((7880, 7944), 'logging.debug', 'log.debug', (['"""================== SimpletInputFind =============...
import logging logging.getLogger('tensorflow').disabled = True logging.getLogger('matplotlib').disabled = True from nose.tools import eq_, assert_less, assert_greater, assert_almost_equal import numpy numpy.random.seed(0) import logging logging.getLogger('tensorflow').disabled = True import tensorflow.keras.backen...
[ "numpy.random.seed", "tensorflow.keras.backend.backend", "numpy.maximum", "numpy.testing.assert_almost_equal", "nose.tools.assert_almost_equal", "mhcflurry.custom_loss.MultiallelicMassSpecLoss", "tensorflow.compat.v1.disable_eager_execution", "tensorflow.compat.v1.keras.backend.get_session", "numpy....
[((204, 224), 'numpy.random.seed', 'numpy.random.seed', (['(0)'], {}), '(0)\n', (221, 224), False, 'import numpy\n'), ((15, 46), 'logging.getLogger', 'logging.getLogger', (['"""tensorflow"""'], {}), "('tensorflow')\n", (32, 46), False, 'import logging\n'), ((63, 94), 'logging.getLogger', 'logging.getLogger', (['"""matp...
"""PyTorch-compatible Data Augmentation.""" import sys import cv2 import torch import numpy as np from importlib import import_module def to_tensor(config, ts, image, mask=None, da=False, resize=False): assert len(ts) == 2 # W,H assert image is not None # Resize, ToTensor and Data Augmentation if ...
[ "sys.exit", "numpy.moveaxis", "cv2.resize", "torch.from_numpy" ]
[((625, 678), 'cv2.resize', 'cv2.resize', (['image', 'ts'], {'interpolation': 'cv2.INTER_LINEAR'}), '(image, ts, interpolation=cv2.INTER_LINEAR)\n', (635, 678), False, 'import cv2\n'), ((795, 848), 'cv2.resize', 'cv2.resize', (['mask', 'ts'], {'interpolation': 'cv2.INTER_NEAREST'}), '(mask, ts, interpolation=cv2.INTER_...
import torch import torch.utils.data as data_utils import pandas as pd from sigpyproc.Readers import FilReader as reader import numpy as np import matplotlib.pyplot as plt import sys class FilDataset(data_utils.Dataset): # Dataset which contains the filterbanks def __init__(self, df, df_noise, channels, l...
[ "numpy.load", "numpy.zeros_like", "numpy.asarray", "numpy.zeros", "numpy.append", "numpy.min", "numpy.mean", "torch.Tensor", "numpy.linspace", "torch.rand", "sys.exit", "pandas.isna", "sigpyproc.Readers.FilReader", "numpy.concatenate" ]
[((13963, 13976), 'sigpyproc.Readers.FilReader', 'reader', (['noise'], {}), '(noise)\n', (13969, 13976), True, 'from sigpyproc.Readers import FilReader as reader\n'), ((15262, 15274), 'sigpyproc.Readers.FilReader', 'reader', (['file'], {}), '(file)\n', (15268, 15274), True, 'from sigpyproc.Readers import FilReader as r...
import matplotlib import mdtraj import time matplotlib.use('TkAgg') import signal import matplotlib.pyplot as plt from matplotlib.widgets import RectangleSelector import numpy as np from multiprocessing import Pool import os import hdbscan import sklearn.metrics as mt from tqdm import tqdm, trange import prody import ...
[ "os.mkdir", "argparse.ArgumentParser", "pandas.read_csv", "glob.glob", "sklearn.metrics.silhouette_samples", "os.path.join", "os.path.abspath", "os.path.dirname", "os.path.exists", "os.path.normpath", "pandas.concat", "mdtraj.load_frame", "os.path.basename", "matplotlib.use", "multiproce...
[((44, 67), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (58, 67), False, 'import matplotlib\n'), ((1373, 1384), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1382, 1384), False, 'import os\n'), ((1430, 1455), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1453, 145...
import torch import numpy as np import random from scipy.ndimage import zoom from torchvision import transforms from . import trans_utils as tu from haven import haven_utils as hu # from batchgenerators.augmentations import crop_and_pad_augmentations from . import micnn_augmentor def apply_transform(split, image, la...
[ "torch.LongTensor", "torch.FloatTensor", "torchvision.transforms.ToPILImage", "numpy.random.rand", "torchvision.transforms.Normalize", "torch.tensor", "torchvision.transforms.ToTensor" ]
[((1312, 1348), 'torchvision.transforms.Normalize', 'transforms.Normalize', (['(0.5,)', '(0.5,)'], {}), '((0.5,), (0.5,))\n', (1332, 1348), False, 'from torchvision import transforms\n'), ((2834, 2870), 'torchvision.transforms.Normalize', 'transforms.Normalize', (['(0.5,)', '(0.5,)'], {}), '((0.5,), (0.5,))\n', (2854, ...
# Copyright 2019 the GPflow 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 writi...
[ "gpflow.kernels.SquaredExponential", "gpflow.optimizers.Scipy", "numpy.zeros", "numpy.ones", "gpflow.models.GPLVM", "numpy.random.RandomState", "pytest.raises", "numpy.linspace", "gpflow.utilities.ops.pca_reduce", "numpy.testing.assert_allclose", "numpy.diag" ]
[((749, 775), 'numpy.random.RandomState', 'np.random.RandomState', (['(999)'], {}), '(999)\n', (770, 775), True, 'import numpy as np\n'), ((1102, 1152), 'gpflow.models.GPLVM', 'gpflow.models.GPLVM', (['Data.Y', 'Data.Q'], {'kernel': 'kernel'}), '(Data.Y, Data.Q, kernel=kernel)\n', (1121, 1152), False, 'import gpflow\n'...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import urllib2 import urllib import re try: import astropy.io.ascii as asciitable except ImportError: import asciitable import numpy as np url_lines = "http://physics.nist.gov/cgi-bin/ASD/lines1.pl" # extract stuff within <pre> tag pre_re = re.co...
[ "numpy.recarray", "numpy.array", "asciitable.read", "urllib.urlencode", "urllib2.build_opener", "re.compile" ]
[((315, 361), 're.compile', 're.compile', (['"""<pre>(.*)</pre>"""'], {'flags': 're.DOTALL'}), "('<pre>(.*)</pre>', flags=re.DOTALL)\n", (325, 361), False, 'import re\n'), ((378, 403), 're.compile', 're.compile', (['"""[0-9A-Za-z]"""'], {}), "('[0-9A-Za-z]')\n", (388, 403), False, 'import re\n'), ((6561, 6603), 'numpy....
import pytest import tempfile import numpy as np import os import shutil import soundfile as sf import keras.backend as K from skimage.io import imread import openl3 import openl3.models from openl3.openl3_exceptions import OpenL3Error from openl3.openl3_warnings import OpenL3Warning TEST_DIR = os.path.dirname(__file...
[ "numpy.load", "os.remove", "numpy.abs", "numpy.allclose", "numpy.ones", "numpy.isnan", "numpy.random.randint", "numpy.tile", "shutil.rmtree", "os.path.join", "shutil.copy", "openl3.core._get_num_windows", "pytest.warns", "openl3.process_video_file", "os.path.dirname", "openl3.models.lo...
[((298, 323), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (313, 323), False, 'import os\n'), ((341, 380), 'os.path.join', 'os.path.join', (['TEST_DIR', '"""data"""', '"""audio"""'], {}), "(TEST_DIR, 'data', 'audio')\n", (353, 380), False, 'import os\n'), ((398, 437), 'os.path.join', 'os.pa...
from math import log from cmath import sqrt, sin, cos, exp, pi from functools import reduce import numpy as np # from scipy.sparse import sparse as sps from scipy.linalg import eigvals from numba import njit, jit ops = { "H": 1.0 / sqrt(2.0) * (np.array([[1.0, 1.0], [1.0, -1.0]], dtype=complex)), "I": np.arra...
[ "numpy.trace", "numpy.allclose", "numpy.ones", "numpy.argsort", "numpy.arange", "numpy.conjugate", "numpy.prod", "scipy.linalg.eigvals", "numpy.transpose", "numpy.int", "numpy.reshape", "numpy.kron", "numpy.conj", "cmath.sqrt", "cmath.cos", "cmath.exp", "numpy.dot", "numpy.concaten...
[((313, 362), 'numpy.array', 'np.array', (['[[1.0, 0.0], [0.0, 1.0]]'], {'dtype': 'complex'}), '([[1.0, 0.0], [0.0, 1.0]], dtype=complex)\n', (321, 362), True, 'import numpy as np\n'), ((373, 422), 'numpy.array', 'np.array', (['[[0.0, 1.0], [1.0, 0.0]]'], {'dtype': 'complex'}), '([[0.0, 1.0], [1.0, 0.0]], dtype=complex...
# 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.op.nn.bias_add", "tvm.relay.op.clip", "tvm.relay.op.nn.dense", "tvm.relay.op.nn.conv2d", "tvm.relay.op.nn.relu", "numpy.array", "tvm.relay.op.nn.softmax", "logging.getLogger" ]
[((1086, 1110), 'logging.getLogger', 'logging.getLogger', (['"""HHB"""'], {}), "('HHB')\n", (1103, 1110), False, 'import logging\n'), ((4933, 4969), 'tvm.relay.op.nn.conv2d', '_op.nn.conv2d', (['data', 'weight'], {}), '(data, weight, **attrs)\n', (4946, 4969), True, 'from tvm.relay import op as _op\n'), ((5257, 5278), ...
from abc import ABC, abstractmethod from numbers import Number from typing import Collection, Generic, List, NamedTuple, Tuple, TypeVar, Union import numpy as np import pandas as pd from copulae.copula.estimator import EstimationMethod, fit_copula from copulae.copula.exceptions import InputDataError from copulae.copu...
[ "typing.TypeVar", "numpy.asarray", "copulae.core.pseudo_obs", "copulae.copula.exceptions.InputDataError" ]
[((649, 665), 'typing.TypeVar', 'TypeVar', (['"""Param"""'], {}), "('Param')\n", (656, 665), False, 'from typing import Collection, Generic, List, NamedTuple, Tuple, TypeVar, Union\n'), ((7549, 7571), 'copulae.core.pseudo_obs', 'pseudo_obs', (['data', 'ties'], {}), '(data, ties)\n', (7559, 7571), False, 'from copulae.c...
import numpy as np from .base import BaseMixture from ..distributions import normal class WeightedVariationalDPGMM(BaseMixture): def __init__(self, weights, alpha, prior, truncation, num_samples): """ Parameters ---------- weights : np.ndarray The weights to be used fo...
[ "numpy.tile", "numpy.arange", "numpy.ones", "numpy.atleast_1d" ]
[((884, 907), 'numpy.ones', 'np.ones', (['(truncation - 1)'], {}), '(truncation - 1)\n', (891, 907), True, 'import numpy as np\n'), ((1077, 1108), 'numpy.tile', 'np.tile', (['phi_', '(num_samples, 1)'], {}), '(phi_, (num_samples, 1))\n', (1084, 1108), True, 'import numpy as np\n'), ((938, 961), 'numpy.ones', 'np.ones',...
import os import sys import cma import json import numpy as np from robo.initial_design import init_random_uniform from hpolib.benchmarks.ml.surrogate_svm import SurrogateSVM from hpolib.benchmarks.ml.surrogate_cnn import SurrogateCNN from hpolib.benchmarks.ml.surrogate_fcnet import SurrogateFCNet run_id = int(sys....
[ "json.dump", "os.makedirs", "robo.initial_design.init_random_uniform", "cma.CMAEvolutionStrategy", "hpolib.benchmarks.ml.surrogate_fcnet.SurrogateFCNet", "hpolib.benchmarks.ml.surrogate_cnn.SurrogateCNN", "numpy.array", "hpolib.benchmarks.ml.surrogate_svm.SurrogateSVM", "os.path.join" ]
[((954, 978), 'numpy.array', 'np.array', (["info['bounds']"], {}), "(info['bounds'])\n", (962, 978), True, 'import numpy as np\n'), ((1128, 1224), 'cma.CMAEvolutionStrategy', 'cma.CMAEvolutionStrategy', (['start_point', '(0.6)', "{'bounds': [lower, upper], 'maxfevals': n_iters}"], {}), "(start_point, 0.6, {'bounds': [l...
# This file is part of qa explorer # # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (http://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # This program is free software: you c...
[ "lsst.pipe.base.Task.__init__", "numpy.sum", "numpy.polyfit", "lsst.pipe.tasks.parquetTable.ParquetTable", "numpy.isfinite", "lsst.pex.config.Field", "numpy.sqrt" ]
[((1416, 1519), 'lsst.pex.config.Field', 'pexConfig.Field', ([], {'doc': '"""Label provides version information"""', 'dtype': 'str', 'default': '"""HSC-COSMOS-20180528"""'}), "(doc='Label provides version information', dtype=str,\n default='HSC-COSMOS-20180528')\n", (1431, 1519), True, 'import lsst.pex.config as pex...
import numpy as np def hyperbolic(x): """ Using the hyperbolic function .. _target hyperbolic_function: .. math:: f(x) = \\frac{1}{2} \\left(x + \sqrt{1 + x^2} \\right) Args: x (tensor(shape=(...))): M-dimensional tensor Returns: y (tensor(shape=(...)...
[ "numpy.sqrt" ]
[((664, 684), 'numpy.sqrt', 'np.sqrt', (['(1.0 + x * x)'], {}), '(1.0 + x * x)\n', (671, 684), True, 'import numpy as np\n')]
import os import math import unittest import trw import torch import numpy as np class TestTransformsAffine(unittest.TestCase): def test_2d_identity_nn(self): matrix2 = [ [1, 0, 0], [0, 1, 0], ] matrix2 = torch.FloatTensor(matrix2) images = torch.arange(2 * ...
[ "unittest.main", "torch.ones", "numpy.stack", "os.path.realpath", "numpy.asarray", "torch.FloatTensor", "trw.transforms.affine_transformation_rotation2d", "PIL.Image.open", "torch.abs", "trw.train.Options", "trw.transforms.TransformAffine", "trw.transforms.affine_transform", "torch.arange", ...
[((4539, 4554), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4552, 4554), False, 'import unittest\n'), ((259, 285), 'torch.FloatTensor', 'torch.FloatTensor', (['matrix2'], {}), '(matrix2)\n', (276, 285), False, 'import torch\n'), ((392, 465), 'trw.transforms.affine_transform', 'trw.transforms.affine_transform',...
# -*- coding: utf-8 -*- """ Created on Fri Jun 1 12:43:04 2018 @author: ivan """ import numpy import math """ ## References - [Umeyama's paper](Least-squares estimation of transformation parameters between two point patterns) - [CarloNicolini's python implementation](https://gist.github.com/CarloNicolini/7118...
[ "numpy.eye", "math.sqrt", "numpy.transpose", "numpy.linalg.svd", "numpy.linalg.matrix_rank", "numpy.linalg.det", "numpy.dot", "numpy.concatenate" ]
[((1016, 1064), 'numpy.linalg.svd', 'numpy.linalg.svd', (['cov_matrix'], {'full_matrices': '(True)'}), '(cov_matrix, full_matrices=True)\n', (1032, 1064), False, 'import numpy\n'), ((1082, 1118), 'numpy.linalg.matrix_rank', 'numpy.linalg.matrix_rank', (['cov_matrix'], {}), '(cov_matrix)\n', (1106, 1118), False, 'import...
import sys sys.path.append('/home/jwalker/dynamics/python/atmos-tools') sys.path.append('/home/jwalker/dynamics/python/atmos-read') import numpy as np import xray import pandas as pd import matplotlib.pyplot as plt import atmos as atm import merra # -------------------------------------------------------------------...
[ "sys.path.append", "atmos.save_nc", "atmos.subset", "atmos.squeeze", "atmos.mmdd_to_jday", "atmos.meta", "atmos.gradient", "merra.merra_urls", "atmos.pres_convert", "atmos.expand_dims", "atmos.days_this_month", "atmos.load_concat", "atmos.homedir", "numpy.arange", "xray.concat", "xray....
[((11, 71), 'sys.path.append', 'sys.path.append', (['"""/home/jwalker/dynamics/python/atmos-tools"""'], {}), "('/home/jwalker/dynamics/python/atmos-tools')\n", (26, 71), False, 'import sys\n'), ((72, 131), 'sys.path.append', 'sys.path.append', (['"""/home/jwalker/dynamics/python/atmos-read"""'], {}), "('/home/jwalker/d...
# SIR model with waning immunity import matplotlib.pyplot import numpy h = 0.5 # days (timestep) end_time = 60. # days num_steps = int(end_time / h) times = h * numpy.array(range(num_steps + 1)) def waning(): transmission_coeff = 5e-9 # 1 / (day * person) infectious_time = 5. # days waning_time = infect...
[ "numpy.zeros" ]
[((350, 376), 'numpy.zeros', 'numpy.zeros', (['(num_steps + 1)'], {}), '(num_steps + 1)\n', (361, 376), False, 'import numpy\n'), ((385, 411), 'numpy.zeros', 'numpy.zeros', (['(num_steps + 1)'], {}), '(num_steps + 1)\n', (396, 411), False, 'import numpy\n'), ((420, 446), 'numpy.zeros', 'numpy.zeros', (['(num_steps + 1)...