code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python r"""Test :py:class:`~solarwindpy.core.vector.Vector` and :py:class:`~solarwindpy.core.tensor.Tensor`. """ import pdb # import re as re import numpy as np import pandas as pd import unittest import sys import pandas.testing as pdt from unittest import TestCase from abc import ABC, abstractpropert...
[ "unittest.main", "pandas.DataFrame", "pandas.testing.assert_frame_equal", "pdb.post_mortem", "numpy.arctan2", "solarwindpy.tensor.Tensor", "numpy.rad2deg", "unittest.skip", "traceback.print_exception", "numpy.array", "solarwindpy.vector.Vector", "pandas.Series", "solarwindpy.vector.BField", ...
[((490, 539), 'pandas.set_option', 'pd.set_option', (['"""mode.chained_assignment"""', '"""raise"""'], {}), "('mode.chained_assignment', 'raise')\n", (503, 539), True, 'import pandas as pd\n'), ((15292, 15362), 'unittest.skip', 'unittest.skip', (['"""Need to update with new `spacecraft` position vectors"""'], {}), "('N...
import os import sys import time import glob import numpy as np import random import torch import utils import utils_data import logging import argparse import torch.nn as nn import genotypes import torch.utils import torchvision.datasets as dset import torch.backends.cudnn as cudnn from collections import namedtuple ...
[ "numpy.floor", "time.strftime", "torchvision.datasets.CIFAR10", "logging.Formatter", "model.NetworkCIFAR", "torch.device", "glob.glob", "utils.AvgrageMeter", "os.path.join", "torch.utils.data.DataLoader", "torch.load", "random.seed", "utils.count_parameters_in_MB", "torch.manual_seed", "...
[((1443, 1554), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.INFO', 'format': 'log_format', 'datefmt': '"""%m/%d %I:%M:%S %p"""'}), "(stream=sys.stdout, level=logging.INFO, format=\n log_format, datefmt='%m/%d %I:%M:%S %p')\n", (1462, 1554), False, 'import logging\n')...
from skimage import feature, transform import numpy as np import matplotlib.pyplot as plt import scipy import datetime import os from matplotlib.ticker import FormatStrFormatter COLORS = ["#4e79a7", "#59a14f", "#9c755f", "#edc948", "#bab0ac", "#e15759", "#b0...
[ "numpy.abs", "numpy.amin", "skimage.transform.rescale", "numpy.mean", "numpy.arange", "matplotlib.pyplot.tick_params", "os.path.exists", "matplotlib.ticker.FormatStrFormatter", "datetime.datetime.now", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyplot.get_cmap", "mat...
[((1380, 1413), 'numpy.arange', 'np.arange', (['(0.0)', 'data.shape[1]', 'dx'], {}), '(0.0, data.shape[1], dx)\n', (1389, 1413), True, 'import numpy as np\n'), ((1423, 1456), 'numpy.arange', 'np.arange', (['(0.0)', 'data.shape[0]', 'dy'], {}), '(0.0, data.shape[0], dy)\n', (1432, 1456), True, 'import numpy as np\n'), (...
import copy import time import numpy as np from utils import * import matplotlib.pyplot as plt from shapely.geometry import Point import matplotlib.animation as animation from shapely.geometry.polygon import Polygon # Formation reward changed to a negative function based on distance from mean center class Swarm(object...
[ "numpy.random.uniform", "shapely.geometry.Point", "matplotlib.pyplot.show", "matplotlib.pyplot.clf", "matplotlib.pyplot.scatter", "matplotlib.pyplot.close", "copy.copy", "matplotlib.pyplot.axis", "numpy.random.randint", "numpy.linalg.norm", "shapely.geometry.polygon.Polygon", "numpy.reshape", ...
[((5217, 5227), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (5225, 5227), True, 'import matplotlib.pyplot as plt\n'), ((1327, 1337), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1335, 1337), True, 'import matplotlib.pyplot as plt\n'), ((1389, 1420), 'numpy.linalg.norm', 'np.linalg.norm', (['(poi...
# K-Means Clustering # This chapter introduces a different clustering algorithm - k-means clustering - and its implementation in SciPy. K-means clustering overcomes the biggest drawback of hierarchical clustering that was discussed in the last chapter. As dendrograms are specific to hierarchical clustering, this chapte...
[ "scipy.cluster.vq.vq", "numpy.random.seed", "scipy.cluster.vq.kmeans" ]
[((1349, 1395), 'scipy.cluster.vq.kmeans', 'kmeans', (["comic_con[['x_scaled', 'y_scaled']]", '(2)'], {}), "(comic_con[['x_scaled', 'y_scaled']], 2)\n", (1355, 1395), False, 'from scipy.cluster.vq import kmeans, vq\n'), ((1466, 1522), 'scipy.cluster.vq.vq', 'vq', (["comic_con[['x_scaled', 'y_scaled']]", 'cluster_center...
#!/usr/bin/env python # -*- encoding: utf-8 -*- '''Tests for output functions''' # Disable cache import os try: os.environ.pop('LIBROSA_CACHE_DIR') except: pass import librosa import numpy as np import tempfile from nose.tools import raises, eq_ def test_write_wav(): def __test(mono, norm): y,...
[ "os.unlink", "tempfile.mkstemp", "numpy.random.randn", "librosa.util.normalize", "librosa.util.valid_audio", "numpy.allclose", "librosa.output.annotation", "librosa.output.times_csv", "librosa.load", "numpy.linspace", "nose.tools.raises", "librosa.output.write_wav", "os.environ.pop" ]
[((117, 152), 'os.environ.pop', 'os.environ.pop', (['"""LIBROSA_CACHE_DIR"""'], {}), "('LIBROSA_CACHE_DIR')\n", (131, 152), False, 'import os\n'), ((3352, 3374), 'numpy.random.randn', 'np.random.randn', (['(20)', '(2)'], {}), '(20, 2)\n', (3367, 3374), True, 'import numpy as np\n'), ((326, 382), 'librosa.load', 'libros...
import tensorflow as tf import cv2 import numpy as np from PIL import Image import matplotlib.pyplot as plt def load_image(path_to_img): img = cv2.imread(path_to_img) img = img.astype(np.float32) / 127.5 - 1 img = np.expand_dims(img, 0) img = tf.convert_to_tensor(img) return img #Function to pre-pr...
[ "matplotlib.pyplot.title", "tensorflow.image.resize_with_crop_or_pad", "PIL.Image.new", "tensorflow.io.decode_image", "tensorflow.clip_by_value", "numpy.clip", "matplotlib.pyplot.imread", "cv2.cvtColor", "matplotlib.pyplot.imshow", "tensorflow.cast", "tensorflow.io.read_file", "matplotlib.pypl...
[((1040, 1106), 'tensorflow.lite.Interpreter', 'tf.lite.Interpreter', ([], {'model_path': '"""./whitebox_cartoon_gan_dr.tflite"""'}), "(model_path='./whitebox_cartoon_gan_dr.tflite')\n", (1059, 1106), True, 'import tensorflow as tf\n'), ((1484, 1523), 'cv2.cvtColor', 'cv2.cvtColor', (['output', 'cv2.COLOR_BGR2RGB'], {}...
import pickle from pathlib import Path import matplotlib.font_manager as fm import matplotlib.pyplot as plt import numpy as np from matplotlib.offsetbox import AnchoredText from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar from ScanImageTiffReader import ScanImageTiffReader from skimage import expos...
[ "matplotlib.offsetbox.AnchoredText", "ScanImageTiffReader.ScanImageTiffReader", "tqdm.tqdm", "pickle.dump", "matplotlib.font_manager.FontProperties", "numpy.ix_", "numpy.zeros", "skimage.exposure.rescale_intensity", "pathlib.Path", "numpy.mean", "numpy.array", "numpy.arange", "mpl_toolkits.a...
[((8184, 8201), 'numpy.array', 'np.array', (['nframes'], {}), '(nframes)\n', (8192, 8201), True, 'import numpy as np\n'), ((8354, 8374), 'numpy.concatenate', 'np.concatenate', (['data'], {}), '(data)\n', (8368, 8374), True, 'import numpy as np\n'), ((8674, 8712), 'numpy.arange', 'np.arange', (['(Cx - bb)', '(Cx + bb)']...
import json import numpy as np import pandas as pd import pytest from timeflux.helpers.testing import DummyData from timeflux_ml.nodes.fit import Fit from timeflux_ml.nodes.transform import Transform # ------------------------------------------------------ # Use-case #1 : Not supervised fit Pipeline on pandas data # ...
[ "pandas.DataFrame", "numpy.ptp", "timeflux.helpers.testing.DummyData", "numpy.testing.assert_array_equal", "json.dumps", "pytest.raises", "numpy.array", "timeflux_ml.nodes.fit.Fit", "numpy.testing.assert_array_almost_equal", "timeflux_ml.nodes.transform.Transform" ]
[((526, 576), 'timeflux.helpers.testing.DummyData', 'DummyData', ([], {'rate': '(10)', 'jitter': '(0.05)', 'num_cols': 'num_cols'}), '(rate=10, jitter=0.05, num_cols=num_cols)\n', (535, 576), False, 'from timeflux.helpers.testing import DummyData\n'), ((587, 678), 'timeflux_ml.nodes.fit.Fit', 'Fit', ([], {'pipeline_ste...
# -*- coding: utf-8 -*- """ Created on Mon Nov 2 09:57:38 2020 @author: tobias.grab """ from skimage.transform import downscale_local_mean from keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D, BatchNormalization, Flatten, Reshape from keras.models import Model from keras import backend a...
[ "sys.path.append", "skimage.exposure.equalize_hist", "skimage.transform.downscale_local_mean", "cv2.imread", "numpy.max", "numpy.array", "numpy.squeeze", "os.listdir", "numpy.concatenate" ]
[((513, 570), 'sys.path.append', 'sys.path.append', (['"""/usr/local/lib/python2.7/site-packages"""'], {}), "('/usr/local/lib/python2.7/site-packages')\n", (528, 570), False, 'import sys\n'), ((782, 800), 'os.listdir', 'listdir', (['data_path'], {}), '(data_path)\n', (789, 800), False, 'from os import listdir\n'), ((12...
import matplotlib.pyplot as plt try: import cv2 except ImportError: import sys sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages') import cv2 import argparse import sys import numpy as np import matplotlib.pyplot as plt import torch import random from data import COCODetection from data i...
[ "sys.path.remove", "cv2.putText", "random.randint", "argparse.ArgumentParser", "data.cfg.dataset.print", "cv2.waitKey", "cv2.getTextSize", "data.set_dataset", "numpy.clip", "torch.Tensor", "cv2.rectangle", "utils.augmentations.BaseTransform", "cv2.imshow", "utils.augmentations.SSDAugmentat...
[((468, 524), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Dataset Displayer"""'}), "(description='Dataset Displayer')\n", (491, 524), False, 'import argparse\n'), ((944, 966), 'random.randint', 'random.randint', (['(0)', '(255)'], {}), '(0, 255)\n', (958, 966), False, 'import random\n...
""" Rough outline of how I want to display the actual profit curve. """ import numpy as np import pandas as pd """ X-axis: thresholds (0-1.0) y-axis: profits (large integers) Using the trained model, the test data, and a given threshold calculate the confusion matrix Have a cost confusion matrix cons...
[ "numpy.array", "numpy.linspace" ]
[((1774, 1831), 'numpy.array', 'np.array', (['[[maintenance, repair], [maintenance, revenue]]'], {}), '([[maintenance, repair], [maintenance, revenue]])\n', (1782, 1831), True, 'import numpy as np\n'), ((2268, 2299), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'n_thresholds'], {}), '(0, 1, n_thresholds)\n', (2279,...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2017-2021 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
[ "silx.gui.qt.QTimer.singleShot", "functools.partial", "h5py.h5z.filter_avail", "numpy.product", "silx.gui.qt.QColor", "collections.OrderedDict", "logging.getLogger" ]
[((1875, 1902), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1892, 1902), False, 'import logging\n'), ((10194, 10219), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (10217, 10219), False, 'import collections\n'), ((11243, 11264), 'numpy.product', 'numpy.produc...
""" Adjustment methods ------------------ """ from typing import Any, Mapping, Optional, Sequence, Union from warnings import warn import numpy as np import xarray as xr from xarray.core.dataarray import DataArray from xclim.core.calendar import get_calendar from xclim.core.formatting import update_history from xclim...
[ "xarray.core.utils.get_temp_dimname", "xclim.core.calendar.get_calendar", "xclim.indices.stats.fit", "xclim.indices.stats.get_dist", "numpy.isscalar", "xclim.core.options.set_options", "numpy.clip", "xclim.core.formatting.update_history", "xarray.Dataset", "xclim.core.units.convert_units_to", "n...
[((4873, 4900), 'xclim.core.units.convert_units_to', 'convert_units_to', (['hist', 'ref'], {}), '(hist, ref)\n', (4889, 4900), False, 'from xclim.core.units import convert_units_to\n'), ((5827, 5866), 'xclim.core.units.convert_units_to', 'convert_units_to', (['sim', 'self.train_units'], {}), '(sim, self.train_units)\n'...
import torch import sklearn.metrics import numpy as np from flambe.metric.metric import Metric def one_hot(indices: torch.Tensor, width: int) -> torch.Tensor: """Converts a list of ints into 1-hot format. Parameters ---------- indices: torch.Tensor the indices to be converted width: int ...
[ "numpy.trapz", "torch.argmax", "numpy.searchsorted", "numpy.array", "torch.tensor" ]
[((1503, 1517), 'numpy.array', 'np.array', (['pred'], {}), '(pred)\n', (1511, 1517), True, 'import numpy as np\n'), ((1536, 1552), 'numpy.array', 'np.array', (['target'], {}), '(target)\n', (1544, 1552), True, 'import numpy as np\n'), ((2142, 2160), 'numpy.trapz', 'np.trapz', (['tpr', 'fpr'], {}), '(tpr, fpr)\n', (2150...
import matplotlib.pyplot as plt import numpy as np import sys import time import support_func_QDP as EF def Poten_D(x): V=K*(C_4*(x**4)-C_2*(x**2)+C_0) return V print("\t THE NUMERICAL SOLUTION FOR SYMMETRIC POTENTIAL WELL\n") print("The user has to provide an energy range. This program will try to find an eige...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.axes", "matplotlib.pyplot.legend", "time.time", "time.sleep", "matplotlib.pyplot.figure", "support_func_QDP.Constant_feeder", "support_func_QDP.Eigen_Range_finder", "numpy.linspace", "support_func_QDP.Plot_Eq" ]
[((880, 893), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (890, 893), False, 'import time\n'), ((3477, 3488), 'time.time', 'time.time', ([], {}), '()\n', (3486, 3488), False, 'import time\n'), ((3491, 3523), 'numpy.linspace', 'np.linspace', (['Xmin', 'Xmax', '(10 ** 4)'], {}), '(Xmin, Xmax, 10 ** 4)\n', (3502, ...
# -------------------------------------------------------- # SSH: Single Stage Headless Face Detector # Test module for evaluating the SSH trained network # Written by <NAME> # -------------------------------------------------------- from __future__ import print_function import cPickle import os import sys imp...
[ "cPickle.load", "sys.stdout.flush", "numpy.tile", "utils.test_utils._get_image_blob", "os.path.join", "nms.nms_wrapper.nms", "utils.get_config.get_output_dir", "os.path.exists", "utils.test_utils.visusalize_detections", "os.path.basename", "numpy.hstack", "numpy.concatenate", "cv2.imread", ...
[((1016, 1107), 'numpy.array', 'np.array', (["[[blob['data'].shape[2], blob['data'].shape[3], im_scale]]"], {'dtype': 'np.float32'}), "([[blob['data'].shape[2], blob['data'].shape[3], im_scale]], dtype=\n np.float32)\n", (1024, 1107), True, 'import numpy as np\n'), ((3228, 3247), 'cv2.imread', 'cv2.imread', (['im_pa...
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "numpy.testing.assert_array_equal", "pytest.raises", "mindspore.dataset.NumpySlicesDataset", "mindspore.dataset.transforms.c_transforms.PadEnd" ]
[((962, 992), 'mindspore.dataset.NumpySlicesDataset', 'ds.NumpySlicesDataset', (['[array]'], {}), '([array])\n', (983, 992), True, 'import mindspore.dataset as ds\n'), ((1228, 1268), 'numpy.testing.assert_array_equal', 'np.testing.assert_array_equal', (['res', 'd[0]'], {}), '(res, d[0])\n', (1257, 1268), True, 'import ...
import csv import cv2 import numpy as np from keras.models import Sequential from keras.layers import Flatten, Dense, Lambda, Cropping2D, Dropout from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D from sklearn.model_selection import train_test_split from sklearn.utils import shuffle # ...
[ "csv.reader", "keras.layers.Cropping2D", "cv2.cvtColor", "sklearn.model_selection.train_test_split", "keras.layers.Dropout", "keras.layers.Flatten", "cv2.flip", "keras.layers.Dense", "keras.layers.Lambda", "numpy.array", "keras.layers.convolutional.Convolution2D", "keras.models.Sequential" ]
[((2348, 2395), 'sklearn.model_selection.train_test_split', 'train_test_split', (['images', 'angles'], {'test_size': '(0.1)'}), '(images, angles, test_size=0.1)\n', (2364, 2395), False, 'from sklearn.model_selection import train_test_split\n'), ((2406, 2423), 'numpy.array', 'np.array', (['X_train'], {}), '(X_train)\n',...
"""slideio ZVI driver testing.""" import unittest import pytest import cv2 as cv import numpy as np import slideio from testlib import get_test_image_path class TestZVI(unittest.TestCase): """Tests for slideio ZVI driver functionality.""" def test_not_existing_file(self): """ Opening of not ...
[ "unittest.main", "numpy.fromfile", "slideio.compare_images", "slideio.open_slide", "testlib.get_test_image_path", "pytest.raises", "cv2.imread", "numpy.reshape" ]
[((8472, 8487), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8485, 8487), False, 'import unittest\n'), ((740, 789), 'testlib.get_test_image_path', 'get_test_image_path', (['"""zvi"""', '"""Zeiss-1-Stacked.zvi"""'], {}), "('zvi', 'Zeiss-1-Stacked.zvi')\n", (759, 789), False, 'from testlib import get_test_image_p...
import os import time from PIL import Image from torch.autograd import Variable from torchvision.transforms import transforms from configs.experiment_config import ImageSegmentationConfig from experiments.deep_experiment import DeepExperiment import torch class ImageExperiment(ImageSegmentationConfig, DeepExperimen...
[ "utils.file_utils.make_directory", "os.path.basename", "torch.autograd.Variable", "torch.cat", "PIL.Image.open", "time.time", "PIL.Image.fromarray", "torchvision.transforms.transforms.ToTensor", "numpy.where", "torchvision.transforms.transforms.Grayscale", "torchvision.transforms.transforms.Norm...
[((1487, 1498), 'time.time', 'time.time', ([], {}), '()\n', (1496, 1498), False, 'import time\n'), ((1558, 1569), 'time.time', 'time.time', ([], {}), '()\n', (1567, 1569), False, 'import time\n'), ((4166, 4203), 'utils.file_utils.make_directory', 'make_directory', (['self.result_save_path'], {}), '(self.result_save_pat...
from dataclasses import dataclass, field, InitVar from typing import List import numpy as np from numba import jit from rulelist.datastructure.data import Data from rulelist.rulelistmodel.statistic import Statistic from rulelist.util.bitset_operations import bitset2indexes #@jit(nopython=True) def compute_mean_spec...
[ "rulelist.rulelistmodel.statistic.Statistic.__post_init__", "numpy.empty", "dataclasses.field", "numpy.mean", "numpy.array", "numpy.dot", "rulelist.util.bitset_operations.bitset2indexes", "dataclasses.dataclass" ]
[((1401, 1477), 'dataclasses.dataclass', 'dataclass', ([], {'repr': '(False)', 'eq': '(False)', 'order': '(False)', 'unsafe_hash': '(True)', 'frozen': '(False)'}), '(repr=False, eq=False, order=False, unsafe_hash=True, frozen=False)\n', (1410, 1477), False, 'from dataclasses import dataclass, field, InitVar\n'), ((3942...
# ELEKTRONN3 - Neural Network Toolkit # # Copyright (c) 2017 - now # Max Planck Institute of Neurobiology, Munich, Germany # Authors: <NAME> """Loss functions""" from typing import Sequence, Optional, Tuple, Callable, Union import torch import numpy as np from torch import nn from torch.nn import functional as F fr...
[ "torch.sqrt", "torch.nn.functional.adaptive_avg_pool3d", "torch.cat", "torch.nn.NLLLoss", "torch.nn.Softmax", "numpy.arange", "torch.no_grad", "torch.isnan", "torch.nn.MSELoss", "torch.nn.BCELoss", "IPython.embed", "torch.softmax", "torch.exp", "torch.nn.functional.adaptive_avg_pool2d", ...
[((31687, 31711), 'torch.zeros_like', 'torch.zeros_like', (['output'], {}), '(output)\n', (31703, 31711), False, 'import torch\n'), ((32820, 32844), 'torch.zeros_like', 'torch.zeros_like', (['output'], {}), '(output)\n', (32836, 32844), False, 'import torch\n'), ((1092, 1121), 'torch.nn.ModuleList', 'torch.nn.ModuleLis...
# Copyright (c) 2020 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. import numpy as np from numpy import linalg from pandapipes.component_models.auxiliar...
[ "pandapipes.pipeflow_setup.extract_results_active_pit", "pandapipes.component_models.Junction.table_name", "pandapipes.pipeflow_setup.init_options", "pandapipes.pipeflow_setup.set_net_option", "numpy.abs", "pandapipes.pipeflow_setup.get_lookup", "pandapipes.pipeflow_setup.write_internal_results", "pan...
[((1216, 1243), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1233, 1243), False, 'import logging\n'), ((2546, 2577), 'pandapipes.pipeflow_setup.init_options', 'init_options', (['net', 'local_params'], {}), '(net, local_params)\n', (2558, 2577), False, 'from pandapipes.pipeflow_setup im...
import perfplot import numpy import random import pyavl def get_pair(x): contains = numpy.random.choice(x) contains_not = random.random() while contains_not in x: contains_not = random.random() return contains, contains_not def avl_query(ds): x, s, t = ds c, cn = get_pair(x) assert t.contains(c) assert not...
[ "numpy.random.rand", "random.random", "pyavl.AVL", "numpy.random.choice" ]
[((87, 109), 'numpy.random.choice', 'numpy.random.choice', (['x'], {}), '(x)\n', (106, 109), False, 'import numpy\n'), ((126, 141), 'random.random', 'random.random', ([], {}), '()\n', (139, 141), False, 'import random\n'), ((475, 495), 'numpy.random.rand', 'numpy.random.rand', (['n'], {}), '(n)\n', (492, 495), False, '...
import chainer from chainer import functions as F from chainer import links as L from chainer import reporter import numpy as np import cv2 import functions class ShadowSplitter(chainer.Chain): def __init__(self, lambda_l2=1., lambda_l1=1., lambda_beta_shadow=1e-...
[ "chainer.functions.mean", "chainer.functions.mean_squared_error", "numpy.random.uniform", "chainer.links.Convolution2D", "cv2.GaussianBlur", "chainer.functions.flatten", "numpy.maximum", "chainer.reporter.report", "chainer.functions.max_pooling_2d", "chainer.functions.depth2space", "chainer.func...
[((1188, 1229), 'chainer.backends.cuda.get_array_module', 'chainer.backends.cuda.get_array_module', (['x'], {}), '(x)\n', (1226, 1229), False, 'import chainer\n'), ((4284, 4301), 'chainer.functions.sigmoid', 'F.sigmoid', (['shadow'], {}), '(shadow)\n', (4293, 4301), True, 'from chainer import functions as F\n'), ((4399...
import sys import pandas as pd import numpy as np from sklearn.preprocessing import RobustScaler from sklearn.svm import LinearSVC from evaluate_model import evaluate_model dataset = sys.argv[1] num_param_combinations = int(sys.argv[2]) random_seed = int(sys.argv[3]) np.random.seed(random_seed) pipeline_components =...
[ "numpy.random.uniform", "numpy.random.seed", "evaluate_model.evaluate_model", "numpy.random.choice" ]
[((270, 297), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (284, 297), True, 'import numpy as np\n'), ((384, 452), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(1e-10)', 'high': '(10.0)', 'size': 'num_param_combinations'}), '(low=1e-10, high=10.0, size=num_param_combina...
import unittest from engine.converter import prepare_ir from engine.converter.ops.tensor import Tensor import numpy as np import os import shutil class TestMain(unittest.TestCase): @classmethod def setUpClass(self): pass @classmethod def tearDownClass(self): pass def test_main(se...
[ "unittest.main", "engine.converter.prepare_ir", "os.getcwd", "os.path.exists", "engine.converter.ops.tensor.Tensor", "numpy.random.randint", "shutil.rmtree" ]
[((2918, 2933), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2931, 2933), False, 'import unittest\n'), ((561, 582), 'engine.converter.prepare_ir', 'prepare_ir', (['model_dir'], {}), '(model_dir)\n', (571, 582), False, 'from engine.converter import prepare_ir\n'), ((1428, 1453), 'shutil.rmtree', 'shutil.rmtree',...
import numpy as np import os import sys import getopt import code # For development: code.interact(local=locals()) import time # ======================================================================================= # # Global Parameters # # ==========================================================================...
[ "numpy.datetime64", "numpy.abs", "time.tzset" ]
[((361, 373), 'time.tzset', 'time.tzset', ([], {}), '()\n', (371, 373), False, 'import time\n'), ((2800, 2827), 'numpy.datetime64', 'np.datetime64', (['"""1600-01-01"""'], {}), "('1600-01-01')\n", (2813, 2827), True, 'import numpy as np\n'), ((2858, 2885), 'numpy.datetime64', 'np.datetime64', (['"""1400-01-01"""'], {})...
import dlib import cv2 import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg def facialLandmark(img): predictor_path = "shape_predictor_68_face_landmarks.dat" detector = dlib.get_frontal_face_detector() predictor = dlib.shape_predictor(predictor_path) gray = cv2.cvtColor...
[ "cv2.cvtColor", "numpy.empty", "dlib.get_frontal_face_detector", "cv2.createCLAHE", "dlib.shape_predictor" ]
[((210, 242), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (240, 242), False, 'import dlib\n'), ((259, 295), 'dlib.shape_predictor', 'dlib.shape_predictor', (['predictor_path'], {}), '(predictor_path)\n', (279, 295), False, 'import dlib\n'), ((308, 345), 'cv2.cvtColor', 'cv2.cvt...
# -*- coding: utf-8 -*- """ Visualization component of scHiCTools Author: <NAME> This module define a function to plot scatter plot of embedding points of single cell data. """ import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "pandas.DataFrame", "matplotlib.style.use", "matplotlib.pyplot.scatter", "matplotlib.pyplot.legend", "plotly.express.scatter_3d", "numpy.array", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "plotly.express.scatter" ]
[((2030, 2048), 'matplotlib.style.use', 'mpl.style.use', (['sty'], {}), '(sty)\n', (2043, 2048), True, 'import matplotlib as mpl\n'), ((3561, 3577), 'matplotlib.pyplot.title', 'plt.title', (['title'], {}), '(title)\n', (3570, 3577), True, 'import matplotlib.pyplot as plt\n'), ((2815, 2848), 'matplotlib.pyplot.subplot',...
from fastprogress import master_bar, progress_bar import numpy as np import pandas as pd import sklearn.utils from typing import Optional from ...utils.statistics import bootstrap_stats from ...utils.multiprocessing import mp_run from ...plotting.interpretation import plot_importance from ..models.abs_model import Abs...
[ "fastprogress.master_bar", "numpy.mean", "numpy.array" ]
[((4022, 4038), 'numpy.array', 'np.array', (['scores'], {}), '(scores)\n', (4030, 4038), True, 'import numpy as np\n'), ((6531, 6558), 'fastprogress.master_bar', 'master_bar', (['ensemble.models'], {}), '(ensemble.models)\n', (6541, 6558), False, 'from fastprogress import master_bar, progress_bar\n'), ((6855, 6872), 'n...
import numpy as np # NOTE: numpy is imported for argsorting. We might not use it but then lose in # code clarity (and a bit in speed but negligible). import tensorflow as tf def slice_assign(sliced_tensor, assigned_tensor, *slice_args, verbose=0): """Assign a tensor to the slice of another tensor. No broadca...
[ "tensorflow.meshgrid", "tensorflow.range", "tensorflow.reshape", "tensorflow.transpose", "numpy.argsort", "tensorflow.shape", "tensorflow.tensor_scatter_nd_update" ]
[((707, 730), 'tensorflow.shape', 'tf.shape', (['sliced_tensor'], {}), '(sliced_tensor)\n', (715, 730), True, 'import tensorflow as tf\n'), ((2572, 2621), 'tensorflow.transpose', 'tf.transpose', (['sliced_tensor'], {'perm': 'scatted_nd_perm'}), '(sliced_tensor, perm=scatted_nd_perm)\n', (2584, 2621), True, 'import tens...
import numpy as np from sitator import SiteTrajectory from sitator.dynamics import JumpAnalysis import logging logger = logging.getLogger(__name__) class ConfigurationalEntropy(object): """Compute the S~ (S tilde) configurational entropy. If the SiteTrajectory lacks type information, the summation is taken ...
[ "sitator.dynamics.JumpAnalysis", "numpy.sum", "numpy.true_divide", "numpy.log", "numpy.empty", "numpy.unique", "numpy.ones", "numpy.all", "numpy.where", "numpy.reshape", "logging.getLogger" ]
[((122, 149), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (139, 149), False, 'import logging\n'), ((957, 1007), 'numpy.reshape', 'np.reshape', (['st._traj', '(sn.n_mobile * st.n_frames,)'], {}), '(st._traj, (sn.n_mobile * st.n_frames,))\n', (967, 1007), True, 'import numpy as np\n'), (...
# protonet score import torch import numpy as np from PIL import Image from torch import nn size = 28 def load_image(array): array = list(map(float, map(int, array))) np_image = np.resize(array, (size, size)) torch_image = torch.from_numpy(np.array(np_image, np.float32, copy=False)) torch_image = ...
[ "numpy.resize", "torch.load", "PIL.Image.open", "numpy.array", "torch.unsqueeze" ]
[((192, 222), 'numpy.resize', 'np.resize', (['array', '(size, size)'], {}), '(array, (size, size))\n', (201, 222), True, 'import numpy as np\n'), ((435, 465), 'torch.unsqueeze', 'torch.unsqueeze', (['view_image', '(0)'], {}), '(view_image, 0)\n', (450, 465), False, 'import torch\n'), ((654, 697), 'numpy.array', 'np.arr...
# Copyright (c) 2017 <NAME> # # MIT License # # 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...
[ "numpy.outer", "numpy.ceil", "numpy.zeros", "numpy.ones", "numpy.random.RandomState", "numpy.mean", "numpy.dot" ]
[((2314, 2344), 'numpy.random.RandomState', 'numpy.random.RandomState', (['(1234)'], {}), '(1234)\n', (2338, 2344), False, 'import numpy\n'), ((2610, 2643), 'numpy.zeros', 'numpy.zeros', (['self.params.n_hidden'], {}), '(self.params.n_hidden)\n', (2621, 2643), False, 'import numpy\n'), ((2689, 2723), 'numpy.zeros', 'nu...
# # Copyright 2020 NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
[ "numpy.allclose", "test_utils.get_data_folder", "variantworks.encoders.HaploidLabelEncoder" ]
[((972, 1028), 'variantworks.encoders.HaploidLabelEncoder', 'HaploidLabelEncoder', ([], {'exclude_no_coverage_positions': '(False)'}), '(exclude_no_coverage_positions=False)\n', (991, 1028), False, 'from variantworks.encoders import HaploidLabelEncoder\n'), ((1228, 1271), 'numpy.allclose', 'np.allclose', (['haploid_lab...
import tensorflow as tf from spatial_transformer_network.grid import batch_mgrid from spatial_transformer_network.warp import batch_warp2d, batch_warp3d def batch_affine_warp2d(imgs, theta): """ affine transforms 2d images Parameters ---------- imgs : tf.Tensor images to be warped ...
[ "tensorflow.random_uniform", "spatial_transformer_network.warp.batch_warp3d", "tensorflow.reshape", "spatial_transformer_network.grid.batch_mgrid", "tensorflow.concat", "tensorflow.Session", "tensorflow.transpose", "tensorflow.linalg.expm", "tensorflow.matmul", "tensorflow.shape", "spatial_trans...
[((668, 697), 'tensorflow.reshape', 'tf.reshape', (['theta', '[-1, 2, 3]'], {}), '(theta, [-1, 2, 3])\n', (678, 697), True, 'import tensorflow as tf\n'), ((711, 750), 'tensorflow.slice', 'tf.slice', (['theta', '[0, 0, 0]', '[-1, -1, 2]'], {}), '(theta, [0, 0, 0], [-1, -1, 2])\n', (719, 750), True, 'import tensorflow as...
import sys from contextlib import suppress with suppress(Exception): import numpy import torch import torchvision print("SYSTEM INFORMATION (", socket.gethostname(),")" ) print("---------------------------------") print("%x" % sys.maxsize, sys.maxsize > 2**32) print("Platform:", platform()...
[ "numpy.__config__.show", "sys.version.split", "contextlib.suppress", "torch.backends.cudnn.version" ]
[((49, 68), 'contextlib.suppress', 'suppress', (['Exception'], {}), '(Exception)\n', (57, 68), False, 'from contextlib import suppress\n'), ((625, 648), 'numpy.__config__.show', 'numpy.__config__.show', ([], {}), '()\n', (646, 648), False, 'import numpy\n'), ((373, 396), 'sys.version.split', 'sys.version.split', (['"""...
import matplotlib.pyplot as plt import numpy as np import random import matplotlib.tri as tri from scipy.ndimage.filters import gaussian_filter #import matplotlib #matplotlib.rcParams['text.usetex'] = True def error_line(Prediction, Truth, Sigma, Frac=1): '''Simple function to draw an error line plot. It takes ...
[ "scipy.ndimage.filters.gaussian_filter", "numpy.meshgrid", "matplotlib.pyplot.show", "numpy.std", "random.choices", "matplotlib.pyplot.colorbar", "numpy.mean", "numpy.arange", "matplotlib.tri.LinearTriInterpolator", "matplotlib.tri.Triangulation", "matplotlib.pyplot.subplots" ]
[((931, 960), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(10, 6)'}), '(figsize=(10, 6))\n', (943, 960), True, 'import matplotlib.pyplot as plt\n'), ((1350, 1360), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1358, 1360), True, 'import matplotlib.pyplot as plt\n'), ((1909, 1934), 'numpy....
from functools import lru_cache import numpy as np from .nicp import non_rigid_icp from .data import load_template from scipy.sparse import csr_matrix def smootherstep(x, x_min, x_max): y = np.clip((x - x_min) / (x_max - x_min), 0, 1) return 6 * (y ** 5) - 15 * (y ** 4) + 10 * (y ** 3) def generate_data_wei...
[ "numpy.sum", "numpy.clip", "numpy.argmin", "scipy.sparse.csr_matrix", "numpy.array", "functools.lru_cache" ]
[((1492, 1503), 'functools.lru_cache', 'lru_cache', ([], {}), '()\n', (1501, 1503), False, 'from functools import lru_cache\n'), ((196, 240), 'numpy.clip', 'np.clip', (['((x - x_min) / (x_max - x_min))', '(0)', '(1)'], {}), '((x - x_min) / (x_max - x_min), 0, 1)\n', (203, 240), True, 'import numpy as np\n'), ((1003, 10...
# 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.transform.InferType", "tvm.parser.fromtext", "pytest.main", "tvm.relay.transform.Defunctionalization", "numpy.random.randint", "tvm.relay.create_executor", "numpy.random.rand", "tvm.relay.const" ]
[((3092, 3139), 'tvm.relay.transform.Defunctionalization', 'transform.Defunctionalization', (["mod['main']", 'mod'], {}), "(mod['main'], mod)\n", (3121, 3139), False, 'from tvm.relay import transform, ExprVisitor, TypeVisitor\n'), ((4003, 4033), 'tvm.relay.create_executor', 'relay.create_executor', ([], {'mod': 'mod'})...
#!/usr/bin/env python # encoding: utf-8 """ reserve_price.py Created by <NAME> on 2011-10-11. Copyright (c) 2011 __MyCompanyName__. All rights reserved. """ from __future__ import division import sys import os import numpy as np import scipy.integrate as integral import matplotlib.pyplot as plt from operator import i...
[ "numpy.random.uniform", "matplotlib.rc", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig" ]
[((358, 425), 'matplotlib.rc', 'rc', (['"""font"""'], {}), "('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']})\n", (360, 425), False, 'from matplotlib import rc\n'), ((519, 542), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (521, 542), False, 'from matplotlib ...
import numpy as np from numpy.testing import * def assert_dtype_equal(a, b): assert_equal(a, b) assert_equal(hash(a), hash(b), "two equivalent types do not hash to the same value !") def assert_dtype_not_equal(a, b): assert_(a != b) assert_(hash(a) != hash(b), "two differe...
[ "numpy.dtype" ]
[((1314, 1340), 'numpy.dtype', 'np.dtype', (["[('yo', np.int)]"], {}), "([('yo', np.int)])\n", (1322, 1340), True, 'import numpy as np\n'), ((1353, 1379), 'numpy.dtype', 'np.dtype', (["[('yo', np.int)]"], {}), "([('yo', np.int)])\n", (1361, 1379), True, 'import numpy as np\n'), ((1520, 1546), 'numpy.dtype', 'np.dtype',...
import numpy as np from rllib.utils.utils import compute_cumulative_returns from gym.spaces import Box def collect_traj(env, agent, train=True, render=False): obs = [] acts = [] rews = [] errs = [] upd = 0 ob = env.reset() done = False stochastic = True iteration = 0 while not...
[ "numpy.sum", "rllib.utils.utils.compute_cumulative_returns", "numpy.clip", "numpy.isnan", "numpy.mean" ]
[((1587, 1599), 'numpy.sum', 'np.sum', (['rews'], {}), '(rews)\n', (1593, 1599), True, 'import numpy as np\n'), ((1680, 1701), 'numpy.mean', 'np.mean', (['errs'], {'axis': '(0)'}), '(errs, axis=0)\n', (1687, 1701), True, 'import numpy as np\n'), ((569, 629), 'numpy.clip', 'np.clip', (['action', 'env.action_space.low', ...
from __future__ import print_function, absolute_import import numpy import numpy as np import collections import torch def RefineClusterProcess(Reference_Cluster_result, Target_Cluster_result, divide_ratio): L = len(Reference_Cluster_result) assert L == len(Target_Cluster_result) Target_Cluster_nums = len...
[ "numpy.size", "numpy.argmax", "numpy.setdiff1d", "numpy.zeros", "numpy.intersect1d", "numpy.where", "numpy.bincount" ]
[((414, 441), 'numpy.zeros', 'np.zeros', (['L'], {'dtype': 'np.int64'}), '(L, dtype=np.int64)\n', (422, 441), True, 'import numpy as np\n'), ((756, 802), 'numpy.setdiff1d', 'np.setdiff1d', (['Target_Cluster_index', 'zero_index'], {}), '(Target_Cluster_index, zero_index)\n', (768, 802), True, 'import numpy as np\n'), ((...
import torch import numpy as np from torch.utils.data import Sampler import torch.distributed as dist class VolumeSampler(Sampler): """ Based on pytorch DistributedSampler, the difference is that all instances from the same volume need to go to the same node. Dataset example is a list of tuples (f...
[ "torch.distributed.get_rank", "numpy.array", "torch.randperm", "torch.distributed.get_world_size", "numpy.array_split", "torch.Generator" ]
[((596, 617), 'torch.distributed.get_world_size', 'dist.get_world_size', ([], {}), '()\n', (615, 617), True, 'import torch.distributed as dist\n'), ((638, 653), 'torch.distributed.get_rank', 'dist.get_rank', ([], {}), '()\n', (651, 653), True, 'import torch.distributed as dist\n'), ((837, 891), 'numpy.array_split', 'np...
import argparse from collections import Counter, defaultdict import json import logging import os from pathlib import Path import sys import time sys.path.insert(0, Path(__file__).absolute().parents[2].as_posix()) from calvin_agent.evaluation.multistep_sequences import get_sequences from calvin_agent.evaluation.utils...
[ "pytorch_lightning.seed_everything", "argparse.ArgumentParser", "torch.cat", "collections.defaultdict", "pathlib.Path", "calvin_env.envs.play_table_env.get_env", "numpy.mean", "calvin_agent.evaluation.utils.join_vis_lang", "collections.Counter", "json.dump", "calvin_agent.evaluation.multistep_se...
[((754, 781), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (771, 781), False, 'import logging\n'), ((873, 908), 'calvin_env.envs.play_table_env.get_env', 'get_env', (['val_folder'], {'show_gui': '(False)'}), '(val_folder, show_gui=False)\n', (880, 908), False, 'from calvin_env.envs.play...
from collections import defaultdict from max_ent.examples.compare_hard_results import main from max_ent.examples.grid_9_by_9 import config_world, plot_world import matplotlib.pyplot as plt import numpy as np from max_ent.gridworld import Directions from max_ent.algorithms.gridworld_icrl import ICRL_Result, learn_constr...
[ "pickle.dump", "json.load", "numpy.random.seed", "max_ent.examples.grid_9_by_9.config_world", "max_ent.algorithms.gridworld_icrl.learn_constraints", "pathlib.Path", "numpy.array", "max_ent.examples.compare_hard_results.main", "max_ent.algorithms.gridworld_icrl.generate_trajectories" ]
[((520, 539), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (534, 539), True, 'import numpy as np\n'), ((885, 961), 'max_ent.examples.grid_9_by_9.config_world', 'config_world', (['blue', 'green', '[]', '[]', '[]', 'goal'], {'start': "d['start']", 'p_slip': 'p_slip'}), "(blue, green, [], [], [], goa...
# Copyright (c) 2022 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 b...
[ "tqdm.tqdm", "json.load", "argparse.ArgumentParser", "os.makedirs", "numpy.zeros", "os.path.exists", "numpy.ones", "cv2.fillPoly", "collections.defaultdict", "numpy.array", "PIL.Image.fromarray", "numpy.round", "os.path.join", "os.listdir", "shutil.copy" ]
[((3429, 3484), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""input parameters"""'}), "(description='input parameters')\n", (3452, 3484), False, 'import argparse\n'), ((1126, 1153), 'PIL.Image.fromarray', 'Image.fromarray', (['label', '"""P"""'], {}), "(label, 'P')\n", (1141, 1153), Fal...
import sys import matplotlib.pyplot as plt import numpy as np import torch sys.path.append("..") from skssl.utils.helpers import rescale_range DFLT_FIGSIZE = (11, 5) def plot_dataset_samples(dataset, n_samples=50, title="Dataset", figsize=DFLT_FIGSIZE): """Plot `n_samples` samples of ...
[ "sys.path.append", "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "matplotlib.pyplot.axvline", "matplotlib.pyplot.plot", "skssl.utils.helpers.rescale_range", "matplotlib.pyplot.legend", "torch.randn", "matplotlib.pyplot.figure", "torch.randperm", "numpy.array", "numpy.linspace", "matpl...
[((77, 98), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (92, 98), False, 'import sys\n'), ((341, 368), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (351, 368), True, 'import matplotlib.pyplot as plt\n'), ((617, 646), 'matplotlib.pyplot.title', ...
# Import all necessary libraries import pandas as pd import numpy as np import scipy import scipy.stats as stats from pathlib import Path from scipy.io import loadmat import scipy.sparse.linalg as sla import scipy.linalg as la def controllability_gramian(A, B, T = np.inf): ''' Aim: Compute the ca...
[ "scipy.linalg.expm", "numpy.conj", "scipy.integrate.odeint", "numpy.zeros", "numpy.float", "numpy.mean", "numpy.array", "scipy.sparse.linalg.expm", "numpy.dot", "scipy.sparse.linalg.eigs" ]
[((1064, 1088), 'numpy.array', 'np.array', (['A'], {'dtype': 'float'}), '(A, dtype=float)\n', (1072, 1088), True, 'import numpy as np\n'), ((1097, 1121), 'numpy.array', 'np.array', (['B'], {'dtype': 'float'}), '(B, dtype=float)\n', (1105, 1121), True, 'import numpy as np\n'), ((1130, 1141), 'numpy.float', 'np.float', (...
# Copyright 2021 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
[ "numpy.stack", "numpy.unique", "numpy.zeros", "numpy.random.randint", "numpy.array", "numpy.random.choice", "collections.deque" ]
[((3448, 3459), 'numpy.zeros', 'np.zeros', (['(7)'], {}), '(7)\n', (3456, 3459), True, 'import numpy as np\n'), ((4972, 5012), 'collections.deque', 'collections.deque', (['[(paper_id, 0, 0, 0)]'], {}), '([(paper_id, 0, 0, 0)])\n', (4989, 5012), False, 'import collections\n'), ((8700, 8735), 'numpy.array', 'np.array', (...
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # In this example, we will take our learnings from the ship-loading sample and generalize to load-balancing between any number of ships. # # We will use a PUBO format: indices are either 0 or 1 (-1 or 1 f...
[ "azure.quantum.optimization.Term", "azure.quantum.optimization.Problem", "azure.quantum.optimization.SimulatedAnnealing", "numpy.array_split", "azure.quantum.Workspace" ]
[((6493, 6531), 'azure.quantum.Workspace', 'Workspace', ([], {'resource_id': '""""""', 'location': '""""""'}), "(resource_id='', location='')\n", (6502, 6531), False, 'from azure.quantum import Workspace\n'), ((11247, 11316), 'azure.quantum.optimization.Problem', 'Problem', ([], {'name': 'problemName', 'problem_type': ...
""" adapted from phidl.Geometry """ import rectpack import numpy as np from pp.component import Component from numpy import ndarray from typing import Any, Dict, List, Tuple def _pack_single_bin( rect_dict: Dict[int, Tuple[int, int]], aspect_ratio: Tuple[int, int], max_size: ndarray, sort_by_area: bo...
[ "rectpack.newPacker", "numpy.asarray", "numpy.clip", "numpy.linalg.norm", "pp.component.Component", "numpy.random.rand", "pp.show", "numpy.sqrt" ]
[((1207, 1240), 'numpy.clip', 'np.clip', (['box_size', 'None', 'max_size'], {}), '(box_size, None, max_size)\n', (1214, 1240), True, 'import numpy as np\n'), ((4167, 4205), 'numpy.asarray', 'np.asarray', (['max_size'], {'dtype': 'np.float64'}), '(max_size, dtype=np.float64)\n', (4177, 4205), True, 'import numpy as np\n...
import numpy as np import torch def MultiLabelMarginLossify(target): r""" Converts a numpy array or pytorch tensor of true multilabel with binary indicator into the one required by torch.nn.MultiLabelMarginLoss i.e. the target consists of contiguous block of non-negative targets that starts at th...
[ "numpy.full", "numpy.zeros", "numpy.where", "numpy.unique", "torch.from_numpy" ]
[((437, 462), 'numpy.full', 'np.full', (['target.shape', '(-1)'], {}), '(target.shape, -1)\n', (444, 462), True, 'import numpy as np\n'), ((526, 560), 'numpy.unique', 'np.unique', (['row'], {'return_counts': '(True)'}), '(row, return_counts=True)\n', (535, 560), True, 'import numpy as np\n'), ((680, 708), 'torch.from_n...
import mmcv import numpy as np import pickle from mmcv import track_iter_progress from mmcv.ops import roi_align from os import path as osp from pycocotools import mask as maskUtils from pycocotools.coco import COCO from mmdet3d.core.bbox import box_np_ops as box_np_ops from mmdet3d.datasets import build_dataset from ...
[ "pickle.dump", "pycocotools.mask.decode", "numpy.maximum", "os.path.join", "mmcv.mkdir_or_exist", "mmcv.ops.roi_align", "numpy.zeros", "torch.cat", "mmdet3d.core.bbox.box_np_ops.points_in_rbbox", "numpy.array", "numpy.arange", "torch.arange", "pycocotools.mask.frPyObjects", "pycocotools.ma...
[((864, 885), 'pycocotools.mask.decode', 'maskUtils.decode', (['rle'], {}), '(rle)\n', (880, 885), True, 'from pycocotools import mask as maskUtils\n'), ((2300, 2344), 'torch.cat', 'torch.cat', (['[fake_inds, pos_proposals]'], {'dim': '(1)'}), '([fake_inds, pos_proposals], dim=1)\n', (2309, 2344), False, 'import torch\...
""" Copyright (c) 2020 <NAME> generator and data loader :author: <NAME> """ import torch, torchvision from tqdm import tqdm import torch.nn.functional as F import numpy as np def get_MNIST_loaders(batch_size, shuffle=False, train_batch=None, test_batch=None): if train_batch == None: train_loader, val_l...
[ "torch.utils.data.DataLoader", "torchvision.transforms.RandomHorizontalFlip", "torchvision.transforms.RandomVerticalFlip", "torch.cat", "torchvision.transforms.Grayscale", "numpy.linspace", "torch.utils.data.random_split", "torchvision.transforms.RandomCrop", "torch.nn.functional.normalize", "nump...
[((5541, 5613), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['train_dataset'], {'batch_size': "hyp['batch_size']"}), "(train_dataset, batch_size=hyp['batch_size'])\n", (5568, 5613), False, 'import torch, torchvision\n'), ((5649, 5719), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['...
import os import sys import json import random import numpy as np import torch from tqdm import tqdm, trange from scipy.sparse import coo_matrix from torch.utils.data import DataLoader, SequentialSampler, TensorDataset import blink.candidate_ranking.utils as utils from blink.common.params import BlinkParser from blin...
[ "numpy.random.seed", "blink.joint.crossencoder.CrossEncoderRanker", "torch.cat", "json.dumps", "torch.utils.data.TensorDataset", "torch.no_grad", "os.path.join", "torch.utils.data.DataLoader", "torch.load", "os.path.exists", "scipy.sparse.coo_matrix", "torch.utils.data.SequentialSampler", "r...
[((986, 1013), 'torch.LongTensor', 'torch.LongTensor', (['mod_input'], {}), '(mod_input)\n', (1002, 1013), False, 'import torch\n'), ((1197, 1222), 'tqdm.trange', 'trange', (['contexts.shape[0]'], {}), '(contexts.shape[0])\n', (1203, 1222), False, 'from tqdm import tqdm, trange\n'), ((1663, 1696), 'torch.cat', 'torch.c...
""" Copyright (C) 2018-2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to i...
[ "mo.ops.unsqueeze.Unsqueeze", "mo.ops.const.Const", "numpy.delete", "extensions.ops.elementwise.Add" ]
[((2332, 2373), 'numpy.delete', 'np.delete', (['unsqueeze_dims', 'channel_dim', '(0)'], {}), '(unsqueeze_dims, channel_dim, 0)\n', (2341, 2373), True, 'import numpy as np\n'), ((1675, 1717), 'extensions.ops.elementwise.Add', 'Add', (['graph', "{'name': bias_add.id + '/Add'}"], {}), "(graph, {'name': bias_add.id + '/Add...
import numpy as np import pandas as pd from final_comparison import unpickler from final_epl_eda import LeagueDFEDA import matplotlib.pyplot as plt import matplotlib.image as mpimg from matplotlib.offsetbox import (TextArea, DrawingArea, OffsetImage, AnnotationBbox) from matplotlib.cbo...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.bar", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "matplotlib.offsetbox.AnnotationBbox", "matplotlib.pyplot.imread", "matplotlib.pyplot.tight_layout", "matplotlib.offsetbox.OffsetImage", "matplotlib.pyplot.yticks", "numpy.max", "final_...
[((2822, 2851), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-dark"""'], {}), "('seaborn-dark')\n", (2835, 2851), True, 'import matplotlib.pyplot as plt\n'), ((3089, 3116), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(14, 2)'}), '(figsize=(14, 2))\n', (3099, 3116), True, 'import matplotl...
import os from datetime import datetime import pandas as pd import numpy as np def parse_admission(path) -> dict: print('parsing ADMISSIONS.csv ...') admission_path = os.path.join(path, 'ADMISSIONS.csv') admissions = pd.read_csv( admission_path, usecols=['SUBJECT_ID', 'HADM_ID', 'ADMITTIM...
[ "pandas.read_csv", "datetime.datetime.strptime", "os.path.join", "numpy.int" ]
[((178, 214), 'os.path.join', 'os.path.join', (['path', '"""ADMISSIONS.csv"""'], {}), "(path, 'ADMISSIONS.csv')\n", (190, 214), False, 'import os\n'), ((232, 386), 'pandas.read_csv', 'pd.read_csv', (['admission_path'], {'usecols': "['SUBJECT_ID', 'HADM_ID', 'ADMITTIME']", 'converters': "{'SUBJECT_ID': np.int, 'HADM_ID'...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the PyMVPA package for the # copyright and license terms. # ### ### ### ### ###...
[ "mvpa2.datasets.sources.openfmri.OpenFMRIDataset", "mvpa2.datasets.sources.native.load_tutorial_data", "mvpa2.datasets.sources.native.load_example_fmri_dataset", "datalad.auto.AutomagicIO", "mvpa2.datasets.sources.openfmri._stripext", "numpy.array", "nose.tools.assert_greater", "mvpa2.testing.sweep.sw...
[((909, 1054), 'mvpa2.testing.sweep.sweepargs', 'sweepargs', ([], {'fname': "('something', 'something.nii', 'something.nii.gz', 'something.hdr',\n 'something.hdr.gz', 'something.img', 'something.img.gz')"}), "(fname=('something', 'something.nii', 'something.nii.gz',\n 'something.hdr', 'something.hdr.gz', 'somethi...
from functools import partial import numpy as np from ...utils import box_utils, common_utils, point_box_utils, coords_utils class DataProcessor(object): def __init__(self, processor_configs, point_cloud_range, training, **kwargs): self.point_cloud_range = point_cloud_range self.training = traini...
[ "functools.partial", "numpy.concatenate", "numpy.zeros", "numpy.expand_dims", "numpy.where", "numpy.arange", "numpy.linalg.norm", "numpy.array", "numpy.random.choice", "numpy.random.permutation", "numpy.round", "numpy.random.shuffle", "spconv.utils.VoxelGenerator" ]
[((2391, 2427), 'numpy.expand_dims', 'np.expand_dims', (['actual_num', '(axis + 1)'], {}), '(actual_num, axis + 1)\n', (2405, 2427), True, 'import numpy as np\n'), ((9970, 10005), 'numpy.zeros', 'np.zeros', (['(V, VP)'], {'dtype': 'np.float32'}), '((V, VP), dtype=np.float32)\n', (9978, 10005), True, 'import numpy as np...
#!/usr/bin/env python from __future__ import print_function, division import argparse, os, sys import re import numpy as np import cv2 as cv import pytesseract import platform import itertools from tqdm import tqdm from config import config from datetime import datetime import engine def say(message): sys.stdo...
[ "sys.stdout.write", "argparse.ArgumentParser", "numpy.ones", "sys.stdout.flush", "engine.GameEngine", "cv2.erode", "cv2.cvtColor", "os.path.exists", "engine.model.get_clue_stretch", "tqdm.tqdm", "numpy.uint8", "numpy.average", "numpy.median", "numpy.asarray", "os.system", "platform.sys...
[((312, 344), 'sys.stdout.write', 'sys.stdout.write', (["(message + '\\n')"], {}), "(message + '\\n')\n", (328, 344), False, 'import argparse, os, sys\n'), ((1313, 1331), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (1329, 1331), False, 'import argparse, os, sys\n'), ((2816, 2838), 'tqdm.tqdm', 'tqdm', (['...
from .utils import PyKEArgumentHelpFormatter from . import kepio, kepmsg, kepkey, kepstat, kepfit import numpy as np from scipy import stats from astropy.io import fits as pyfits from matplotlib import pyplot as plt from tqdm import tqdm import re __all__ = ['kepfold'] def kepfold(infile, outfile=None, period=None, ...
[ "numpy.sum", "argparse.ArgumentParser", "matplotlib.pyplot.clf", "matplotlib.pyplot.axes", "astropy.io.fits.ColDefs", "matplotlib.pyplot.ScalarFormatter", "matplotlib.pyplot.figure", "numpy.mean", "matplotlib.pyplot.gca", "numpy.copy", "numpy.linspace", "astropy.io.fits.Column", "re.sub", ...
[((2714, 2752), 'numpy.any', 'np.any', (['[period is None, bjd0 is None]'], {}), '([period is None, bjd0 is None])\n', (2720, 2752), True, 'import numpy as np\n'), ((4480, 4511), 'astropy.io.fits.open', 'pyfits.open', (['infile', '"""readonly"""'], {}), "(infile, 'readonly')\n", (4491, 4511), True, 'from astropy.io imp...
"""@package MuSCADeT """ import numpy as np def mk_pca(vectors, dec = 0): """ Perfoms Principal Component Analysis of a set of vectors INPUTS: vectors: Set of vectors to be decomposed through PCA. OUTPUTS: alpha: PCA coefficients resulting of the decomposition of the vectors. ...
[ "numpy.sum", "numpy.transpose", "numpy.linalg.svd", "numpy.dot", "numpy.sqrt" ]
[((1609, 1628), 'numpy.dot', 'np.dot', (['base', 'alpha'], {}), '(base, alpha)\n', (1615, 1628), True, 'import numpy as np\n'), ((758, 776), 'numpy.linalg.svd', 'np.linalg.svd', (['cov'], {}), '(cov)\n', (771, 776), True, 'import numpy as np\n'), ((989, 1007), 'numpy.transpose', 'np.transpose', (['E_N2'], {}), '(E_N2)\...
# -*- coding: utf-8 -*- __all__ = ["GaussianProcess"] from functools import wraps from typing import Callable, Optional, Union import jax.numpy as jnp import numpy as np from jax import lax from . import ops, terms from .types import Array Mean = Callable[[Array], Array] class ConstantMean: def __init__(self...
[ "jax.numpy.sum", "jax.numpy.log", "numpy.log", "jax.numpy.square", "jax.numpy.sqrt", "jax.numpy.zeros_like", "jax.numpy.asarray", "functools.wraps", "jax.numpy.all", "jax.lax.cond", "jax.numpy.broadcast_to" ]
[((571, 582), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (576, 582), False, 'from functools import wraps\n'), ((655, 669), 'jax.numpy.asarray', 'jnp.asarray', (['y'], {}), '(y)\n', (666, 669), True, 'import jax.numpy as jnp\n'), ((1780, 1794), 'jax.numpy.asarray', 'jnp.asarray', (['t'], {}), '(t)\n', (1791...
""" Module contain a class that encapsulate the state of search tree node. """ from __future__ import annotations import os from typing import TYPE_CHECKING import numpy as np from rdkit.Chem import Draw from aizynthfinder.chem import TreeMolecule if TYPE_CHECKING: from aizynthfinder.utils.type_utils import StrD...
[ "rdkit.Chem.Draw.MolsToGridImage", "numpy.sum", "numpy.exp" ]
[((5143, 5207), 'rdkit.Chem.Draw.MolsToGridImage', 'Draw.MolsToGridImage', (['mols'], {'molsPerRow': 'ncolumns', 'legends': 'legends'}), '(mols, molsPerRow=ncolumns, legends=legends)\n', (5163, 5207), False, 'from rdkit.Chem import Draw\n'), ((5324, 5350), 'numpy.sum', 'np.sum', (['self.in_stock_list'], {}), '(self.in_...
import numpy as np import scipy.io.wavfile as wav import os, pickle class DataStream: def __init__(self, what, batch=100, seed=1000, frac=1, root_dir=None): self.root_dir = "data/gsc/" if root_dir is None else root_dir self.what = what self.last_idx = 0 self.file_names = [] ...
[ "os.walk", "numpy.random.RandomState", "scipy.io.wavfile.read" ]
[((897, 919), 'os.walk', 'os.walk', (['self.root_dir'], {}), '(self.root_dir)\n', (904, 919), False, 'import os, pickle\n'), ((2116, 2143), 'scipy.io.wavfile.read', 'wav.read', (['(self.root_dir + f)'], {}), '(self.root_dir + f)\n', (2124, 2143), True, 'import scipy.io.wavfile as wav\n'), ((1593, 1625), 'numpy.random.R...
# Who is the best player? Can we find out? Let's try. # Sept 2020 import pymongo from bson import objectid from helper_fns import * import matplotlib.pyplot as plt import numpy as np from elo import rate_1vs1 elo = {} for g in db.completed_games.find({"winner":{"$exists":True}}): for u in g["usernames"]: ...
[ "matplotlib.pyplot.axhline", "matplotlib.pyplot.axvline", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.scatter", "elo.rate_1vs1", "numpy.array", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.tight_layout" ]
[((934, 958), 'numpy.array', 'np.array', (['x'], {'dtype': 'float'}), '(x, dtype=float)\n', (942, 958), True, 'import numpy as np\n'), ((963, 987), 'numpy.array', 'np.array', (['y'], {'dtype': 'float'}), '(y, dtype=float)\n', (971, 987), True, 'import numpy as np\n'), ((989, 1006), 'matplotlib.pyplot.scatter', 'plt.sca...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_deterministic_signals ---------------------------------- Tests for deterministic signal module """ import unittest import numpy as np import enterprise from enterprise.pulsar import Pulsar from enterprise.signals import deterministic_signals, parameter, selec...
[ "numpy.load", "numpy.zeros_like", "enterprise.signals.selections.Selection", "enterprise.signals.utils.physical_ephem_delay", "numpy.allclose", "enterprise.signals.deterministic_signals.Deterministic", "enterprise.signals.deterministic_signals.PhysicalEphemerisSignal", "enterprise.signals.utils.get_pl...
[((577, 625), 'numpy.sin', 'np.sin', (['(2 * np.pi * toas * 10 ** log10_f + phase)'], {}), '(2 * np.pi * toas * 10 ** log10_f + phase)\n', (583, 625), True, 'import numpy as np\n'), ((813, 909), 'enterprise.pulsar.Pulsar', 'Pulsar', (["(datadir + '/B1855+09_NANOGrav_9yv1.gls.par')", "(datadir + '/B1855+09_NANOGrav_9yv1...
from __future__ import annotations import numpy as np class Dot(object): x: float y: float weight: float def __init__(self, _x: float, _y: float, _w: float): self.x, self.y, self.weight = _x, _y, _w class SLAE(object): mat: list[list[float]] n: int def build(self, ds: list[Dot...
[ "numpy.arange" ]
[((1820, 1859), 'numpy.arange', 'np.arange', (['ds[0].x', '(ds[-1].x + 0.1)', '(0.1)'], {}), '(ds[0].x, ds[-1].x + 0.1, 0.1)\n', (1829, 1859), True, 'import numpy as np\n')]
# WEIGHTED TRANSFORMER CODEMASTER # CODE BY <NAME> import sys import nltk from nltk.stem import WordNetLemmatizer from nltk.stem.lancaster import LancasterStemmer from nltk.corpus import gutenberg from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from players.codemaster import codemaster im...
[ "sklearn.cluster.AffinityPropagation", "nltk.wordpunct_tokenize", "nltk.download", "torch.no_grad", "numpy.unique", "torch.nn.functional.pad", "torch.flatten", "numpy.isfinite", "sklearn.neighbors.NearestNeighbors", "transformers.BertModel.from_pretrained", "torch.mean", "time.perf_counter", ...
[((2619, 2655), 'nltk.download', 'nltk.download', (['"""popular"""'], {'quiet': '(True)'}), "('popular', quiet=True)\n", (2632, 2655), False, 'import nltk\n'), ((2663, 2697), 'nltk.download', 'nltk.download', (['"""words"""'], {'quiet': '(True)'}), "('words', quiet=True)\n", (2676, 2697), False, 'import nltk\n'), ((395...
import os import math import numpy as np import PIL.Image import tensorflow as tf tf.app.flags.DEFINE_string("model", "inception/tensorflow_inception_graph.pb", "Model") tf.app.flags.DEFINE_string("input", "", "Input Image (JPG)"); tf.app.flags.DEFINE_string("output", "output", "Output prefix"); tf.app.flags.DEFINE_st...
[ "tensorflow.app.flags.DEFINE_float", "numpy.abs", "numpy.clip", "tensorflow.ConfigProto", "tensorflow.app.flags.DEFINE_boolean", "numpy.random.randint", "tensorflow.app.flags.DEFINE_integer", "numpy.full", "numpy.zeros_like", "tensorflow.placeholder", "tensorflow.gradients", "tensorflow.GraphD...
[((83, 174), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""model"""', '"""inception/tensorflow_inception_graph.pb"""', '"""Model"""'], {}), "('model',\n 'inception/tensorflow_inception_graph.pb', 'Model')\n", (109, 174), True, 'import tensorflow as tf\n'), ((171, 231), 'tensorflow.app.fla...
import collections import os.path as osp import numpy as np import PIL.Image import cv2 import scipy.io import torch from torch.utils import data from random import shuffle import os.path import os import sys import copy import time import math import matplotlib.pyplot as plt class custom_data_loader(data.Dataset): ...
[ "collections.defaultdict", "cv2.imread", "os.path.isfile", "numpy.random.randint", "numpy.array", "torch.IntTensor", "numpy.random.choice", "cv2.resize" ]
[((1415, 1428), 'numpy.array', 'np.array', (['[0]'], {}), '([0])\n', (1423, 1428), True, 'import numpy as np\n'), ((1509, 1538), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (1532, 1538), False, 'import collections\n'), ((1871, 1902), 'os.path.isfile', 'os.path.isfile', (['image_fil...
# !/usr/bin/python # -*- coding: utf-8 -*- # @time : 2020/4/23 10:17 # @author : Mo # @function: tools of util of Macadam from macadam.conf.logger_config import logger from collections import Counter, OrderedDict from typing import Union, Dict, List, Any import numpy as np import macropodus import json import os ...
[ "os.remove", "json.load", "json.dumps", "os.path.isfile", "macropodus.cut", "numpy.fromstring", "collections.OrderedDict", "collections.Counter", "os.path.join", "os.listdir" ]
[((1994, 2014), 'os.listdir', 'os.listdir', (['path_dir'], {}), '(path_dir)\n', (2004, 2014), False, 'import os\n'), ((11992, 12017), 'collections.OrderedDict', 'OrderedDict', (['in_dict_sort'], {}), '(in_dict_sort)\n', (12003, 12017), False, 'from collections import Counter, OrderedDict\n'), ((2063, 2088), 'os.path.jo...
from flask import Flask, send_from_directory #import extract feature import os import librosa import numpy as np import tensorflow as tf from tensorflow import keras #import model from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense,Dropout,Activation,Flatten from flask_restful imp...
[ "flask_restful.Api", "tensorflow.keras.layers.Dropout", "flask_cors.CORS", "flask.Flask", "numpy.mean", "librosa.load", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.Activation", "librosa.feature.mfcc", "tensorflow.keras.layers.Flatten" ]
[((459, 526), 'flask.Flask', 'Flask', (['__name__'], {'static_url_path': '""""""', 'static_folder': '"""frontend/build"""'}), "(__name__, static_url_path='', static_folder='frontend/build')\n", (464, 526), False, 'from flask import Flask, send_from_directory\n'), ((527, 536), 'flask_cors.CORS', 'CORS', (['app'], {}), '...
from typing import Tuple, List, Union, Optional, Dict, Any import functools import numpy as np import pandas as pd import random from torch.utils.data import Dataset from mars_gym.meta_config import ProjectConfig, IOType, Column from mars_gym.utils.index_mapping import map_array from mars_gym.utils.utils import paral...
[ "functools.partial", "numpy.zeros", "random.choice", "numpy.random.randint", "numpy.array", "mars_gym.utils.utils.parallel_literal_eval", "numpy.concatenate" ]
[((1899, 1975), 'mars_gym.utils.utils.parallel_literal_eval', 'parallel_literal_eval', (['data_frame[project_config.available_arms_column_name]'], {}), '(data_frame[project_config.available_arms_column_name])\n', (1920, 1975), False, 'from mars_gym.utils.utils import parallel_literal_eval, reduce_df_mem\n'), ((2857, 29...
import json from itertools import product import numpy as np import decimal as d import geemap from shapely import geometry as sg from shapely.ops import unary_union import geopandas as gpd from pyproj import CRS, Transformer from pathlib import Path from component.message import cm from component import parameter a...
[ "component.parameter.down_dir.joinpath", "geemap.geojson_to_ee", "pyproj.CRS.from_epsg", "numpy.nonzero", "geopandas.GeoDataFrame", "decimal.getcontext", "numpy.linspace", "pyproj.Transformer.from_crs", "shapely.geometry.box" ]
[((326, 340), 'decimal.getcontext', 'd.getcontext', ([], {}), '()\n', (338, 340), True, 'import decimal as d\n'), ((694, 723), 'shapely.geometry.box', 'sg.box', (['*aoi_gdf.total_bounds'], {}), '(*aoi_gdf.total_bounds)\n', (700, 723), True, 'from shapely import geometry as sg\n'), ((825, 844), 'pyproj.CRS.from_epsg', '...
import sys import argparse from yolo import YOLO from PIL import Image def iou(rec1, rec2): """ rec1 and rec2 in (xmin,ymin,xmax,ymax) """ # computing area of each rectangles S_rec1 = (rec1[2] - rec1[0]) * (rec1[3] - rec1[1]) S_rec2 = (rec2[2] - rec2[0]) * (rec2[3] - rec2[1]) # computing ...
[ "matplotlib.pyplot.show", "argparse.ArgumentParser", "matplotlib.pyplot.plot", "PIL.Image.open", "numpy.max", "numpy.mean", "numpy.min", "yolo.YOLO.get_defaults" ]
[((1621, 1635), 'matplotlib.pyplot.plot', 'plt.plot', (['ious'], {}), '(ious)\n', (1629, 1635), True, 'import matplotlib.pyplot as plt\n'), ((1640, 1650), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1648, 1650), True, 'import matplotlib.pyplot as plt\n'), ((1780, 1839), 'argparse.ArgumentParser', 'argparse...
import collections import cf_xarray as cf import dask import numpy as np import xarray as xr from .calcs import Datasetcalcs, Diffcalcs def collect_datasets(data_type, varnames, list_of_ds, labels, **kwargs): """ Concatonate several different xarray datasets across a new "collection" dimension, which ca...
[ "pandas.DataFrame.from_dict", "xarray.open_dataset", "numpy.square", "IPython.display.display", "xarray.concat", "numpy.isnan", "dask.is_dask_collection", "IPython.display.HTML", "numpy.min", "xarray.DataArray", "xarray.open_mfdataset", "numpy.unique" ]
[((1571, 1584), 'numpy.unique', 'np.unique', (['sz'], {}), '(sz)\n', (1580, 1584), True, 'import numpy as np\n'), ((1996, 2041), 'xarray.concat', 'xr.concat', (['list_of_ds', '"""collection"""'], {}), "(list_of_ds, 'collection', **kwargs)\n", (2005, 2041), True, 'import xarray as xr\n'), ((2501, 2540), 'xarray.DataArra...
#!/usr/bin/env python import sys import numpy as np import cv2 import matplotlib.pyplot as plt def apply_dft(img, fsize): rows, cols = img.shape frows, fcols = fsize img_pad = np.zeros((frows, fcols), dtype=img.dtype) img_pad[:rows, :cols] = img img_pad = np.roll(img_pad, -int(rows / 2), axis=0) ...
[ "numpy.fft.ifftshift", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "cv2.filter2D", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "numpy.zeros", "cv2.getGaussianKernel", "cv2.imread", "numpy.fft.fftshift", "numpy.fft.fft2", "matplotlib.pyplot.xticks", "numpy.fft.ifft2" ]
[((763, 829), 'cv2.imread', 'cv2.imread', (['"""../python_image_fft/253027.jpg"""', 'cv2.IMREAD_GRAYSCALE'], {}), "('../python_image_fft/253027.jpg', cv2.IMREAD_GRAYSCALE)\n", (773, 829), False, 'import cv2\n'), ((1000, 1051), 'cv2.getGaussianKernel', 'cv2.getGaussianKernel', (['kernel_size', '(kernel_size / 4)'], {}),...
#!/usr/bin/env python """ analyze a subset of the fashion mnist data using dimension reduction and classic machine learning """ from joblib import dump, load import sys import os import time import numpy as np from tensorflow import keras import matplotlib.pyplot as plt from collections import Counter import numpy as ...
[ "sklearn.model_selection.GridSearchCV", "joblib.dump", "sklearn.metrics.classification_report", "matplotlib.pyplot.figure", "sklearn.svm.SVC", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "os.path.exists", "matplotlib.pyplot.colorbar", "collections.Counter", "matplotlib.pyplot.xticks"...
[((1783, 1808), 'numpy.array', 'np.array', (['[0, 1, 2, 3, 4]'], {}), '([0, 1, 2, 3, 4])\n', (1791, 1808), True, 'import numpy as np\n'), ((1820, 1849), 'numpy.in1d', 'np.in1d', (['train_labels', 'subset'], {}), '(train_labels, subset)\n', (1827, 1849), True, 'import numpy as np\n'), ((1948, 1976), 'numpy.in1d', 'np.in...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from keras import keras_parameterized, testing_utils from tfmiss.keras.layers.preprocessing import WordShape @keras_parameterized.run_all_keras_modes class WordShape...
[ "tensorflow.test.main", "numpy.array", "keras.testing_utils.layer_test" ]
[((7982, 7996), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (7994, 7996), True, 'import tensorflow as tf\n'), ((713, 891), 'keras.testing_utils.layer_test', 'testing_utils.layer_test', (['WordShape'], {'kwargs': "{'options': WordShape.SHAPE_HAS_CASE}", 'input_data': 'self.data', 'expected_output_dtype': '...
import unittest import numpy as np from rastervision.core.class_map import (ClassItem, ClassMap) from rastervision.evaluation.semantic_segmentation_evaluation import ( SemanticSegmentationEvaluation) from rastervision.data.label_source.semantic_segmentation_label_source import ( SemanticSegmentationLabelSourc...
[ "unittest.main", "rastervision.evaluation.semantic_segmentation_evaluation.SemanticSegmentationEvaluation", "numpy.zeros", "numpy.ones", "rastervision.core.class_map.ClassItem", "rastervision.core.box.Box", "numpy.random.randint", "rastervision.data.label_source.semantic_segmentation_label_source.Sema...
[((3831, 3846), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3844, 3846), False, 'import unittest\n'), ((1669, 1703), 'rastervision.core.box.Box', 'Box', (['(0)', '(0)', 'self.height', 'self.width'], {}), '(0, 0, self.height, self.width)\n', (1672, 1703), False, 'from rastervision.core.box import Box\n'), ((234...
import numpy as np import pytest from baloo.weld import LazyResult, NumPyEncoder, NumPyDecoder from baloo.weld.pyweld import * # TODO: should be restricted to the encoders, i.e. not through LazyResult/WeldObject class TestNumPyEncoders(object): _encoder = NumPyEncoder() _decoder = NumPyDecoder() @pytest...
[ "numpy.testing.assert_array_equal", "baloo.weld.NumPyDecoder", "numpy.float32", "baloo.weld.NumPyEncoder", "numpy.array", "numpy.int32", "numpy.int64", "numpy.float64", "numpy.int16", "baloo.weld.LazyResult" ]
[((263, 277), 'baloo.weld.NumPyEncoder', 'NumPyEncoder', ([], {}), '()\n', (275, 277), False, 'from baloo.weld import LazyResult, NumPyEncoder, NumPyDecoder\n'), ((293, 307), 'baloo.weld.NumPyDecoder', 'NumPyDecoder', ([], {}), '()\n', (305, 307), False, 'from baloo.weld import LazyResult, NumPyEncoder, NumPyDecoder\n'...
# Copyright 2019 The Magenta 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 ...
[ "numpy.load", "magenta.models.nsynth.wavenet.h512_bo16.Config", "magenta.models.nsynth.wavenet.h512_bo16.FastGenerationConfig", "magenta.models.nsynth.utils.load_audio", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.logging.info", "scipy.io.wavfile.write", "numpy.cumsum", "magenta.models...
[((1600, 1644), 'numpy.cumsum', 'np.cumsum', (['probability_mass_function'], {'axis': '(1)'}), '(probability_mass_function, axis=1)\n', (1609, 1644), True, 'import numpy as np\n'), ((1659, 1685), 'numpy.random.rand', 'np.random.rand', (['batch_size'], {}), '(batch_size)\n', (1673, 1685), True, 'import numpy as np\n'), ...
import pytest import numpy as np import itertools from typing import List, Text, Optional, Dict from rasa.engine.graph import ExecutionContext from rasa.engine.storage.resource import Resource from rasa.engine.storage.storage import ModelStorage from rasa.core.featurizers.precomputation import ( CoreFeaturization...
[ "numpy.full", "rasa.engine.storage.resource.Resource", "rasa.shared.nlu.training_data.training_data.TrainingData", "rasa.shared.core.training_data.structures.StoryStep", "rasa.core.featurizers.precomputation.MessageContainerForCoreFeaturization", "rasa.shared.nlu.training_data.message.Message", "itertoo...
[((1817, 1855), 'rasa.core.featurizers.precomputation.MessageContainerForCoreFeaturization', 'MessageContainerForCoreFeaturization', ([], {}), '()\n', (1853, 1855), False, 'from rasa.core.featurizers.precomputation import CoreFeaturizationCollector, MessageContainerForCoreFeaturization, CoreFeaturizationInputConverter\...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ "bert.modeling.get_assignment_map_from_checkpoint", "tensorflow.compat.v1.matmul", "numpy.argsort", "tensorflow.compat.v1.train.init_from_checkpoint", "tensorflow.compat.v1.gfile.Exists", "numpy.mean", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.variable_scope", "tenso...
[((1038, 1117), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""num_slices"""', '(25)', '"""Divide dataset into this many slices."""'], {}), "('num_slices', 25, 'Divide dataset into this many slices.')\n", (1058, 1117), False, 'from absl import flags\n'), ((1119, 1181), 'absl.flags.DEFINE_integer', 'flags.DE...
# Author : <NAME>, <<EMAIL>> import numpy as np from numpy.testing import assert_array_equal from bayes_mxne.pyrtnorm import rtnorm def test_rtnorm_random_state(): """Test that rtnorm handles the numpy random state properly""" a, b = -2., 2. rng = np.random.RandomState(42) r1 = rtnorm(a, b, mu=0., si...
[ "bayes_mxne.pyrtnorm.rtnorm", "numpy.testing.assert_array_equal", "numpy.all", "numpy.random.RandomState" ]
[((263, 288), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (284, 288), True, 'import numpy as np\n'), ((298, 359), 'bayes_mxne.pyrtnorm.rtnorm', 'rtnorm', (['a', 'b'], {'mu': '(0.0)', 'sigma': '(1.0)', 'size': '(10000)', 'random_state': 'rng'}), '(a, b, mu=0.0, sigma=1.0, size=10000, r...
import kalman_filter as kalman_filter import numpy as np import matplotlib.pyplot as plt import pandas as pd from datetime import datetime from sklearn.metrics import r2_score import random # read data timest=[0] data_filename = '../data/book.csv' df=pd.read_csv(data_filename) #reducing data size for easy computation ...
[ "numpy.full", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pandas.read_csv", "matplotlib.pyplot.legend", "sklearn.metrics.r2_score", "kalman_filter.State", "random.random", "matplotlib.pyplot.figure", "kalman_filter.update", "numpy.array", "pandas.to_datetime", "matplotlib.pyplot.gri...
[((252, 278), 'pandas.read_csv', 'pd.read_csv', (['data_filename'], {}), '(data_filename)\n', (263, 278), True, 'import pandas as pd\n'), ((1638, 1656), 'numpy.full', 'np.full', (['(2, 1)', '(2)'], {}), '((2, 1), 2)\n', (1645, 1656), True, 'import numpy as np\n'), ((1661, 1684), 'numpy.full', 'np.full', (['(2, 2)', '(2...
""" Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany 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/L...
[ "nndet.io.paths.get_case_ids_from_dir", "itertools.repeat", "nndet.preprocessing.resampling.resample_patient", "nndet.io.load.load_case_cropped", "numpy.ones", "numpy.clip", "numpy.isnan", "nndet.io.transforms.instances.instances_to_boxes_np", "loguru.logger.info", "pathlib.Path", "nndet.io.load...
[((24863, 24918), 'typing.TypeVar', 'TypeVar', (['"""PreprocessorType"""'], {'bound': 'AbstractPreprocessor'}), "('PreprocessorType', bound=AbstractPreprocessor)\n", (24870, 24918), False, 'from typing import Dict, Sequence, List, Tuple, TypeVar, Union\n'), ((8353, 8394), 'loguru.logger.info', 'logger.info', (['"""Init...
# This code is based on https://github.com/xrenaa/SBU_Kinect_dataset_process import urllib import os import time import zipfile import shutil import matplotlib.pyplot as plt import argparse import numpy as np import torch import random import pickle #import requests def unzip(sourceFile, targetPath): ''' :pa...
[ "zipfile.ZipFile", "argparse.ArgumentParser", "os.makedirs", "random.shuffle", "os.path.exists", "numpy.array", "numpy.tile", "shutil.rmtree", "os.path.join", "os.listdir", "torch.tensor", "torch.from_numpy" ]
[((421, 453), 'zipfile.ZipFile', 'zipfile.ZipFile', (['sourceFile', '"""r"""'], {}), "(sourceFile, 'r')\n", (436, 453), False, 'import zipfile\n'), ((4356, 4377), 'numpy.array', 'np.array', (['interpolate'], {}), '(interpolate)\n', (4364, 4377), True, 'import numpy as np\n'), ((4591, 4615), 'random.shuffle', 'random.sh...
#! /usr/bin/python3 # -*- coding: utf-8 -*- r""" ******* Dynspec ******* :mod:`~nenupy.undysputed.Dynspec` is the module designed to read and analyze *UnDySPuTeD* DynSpec high-rate data. It benefits from `Dask <https://docs.dask.org/en/latest/>`_, with the possibility of reading and apply...
[ "numpy.sum", "numpy.abs", "numpy.floor", "numpy.ones", "numpy.argmin", "numpy.gradient", "numpy.mean", "os.path.isfile", "numpy.arange", "numpy.round", "numpy.unique", "os.path.abspath", "numpy.std", "numpy.fft.fft", "numpy.insert", "numpy.append", "numpy.max", "numpy.swapaxes", ...
[((15004, 15031), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (15021, 15031), False, 'import logging\n'), ((15883, 15893), 'os.path.abspath', 'abspath', (['l'], {}), '(l)\n', (15890, 15893), False, 'from os.path import isfile, abspath, join, dirname, basename\n'), ((16600, 16648), 'ast...
""" Logic: 1. load data from tsv 2. construct covariate 3. tmle 4. causal output """ import numpy as np from scipy.special import logit, expit from scipy.optimize import minimize def load_predictor_outputs(tsv_filename): pass def truncate_by_g(ite, g, level=0.1): keep_these = np.logical_and(g > level, g < 1...
[ "numpy.zeros_like", "numpy.sum", "numpy.ones_like", "numpy.copy", "numpy.logical_and", "numpy.log", "numpy.square", "numpy.clip", "scipy.special.expit", "scipy.special.logit", "numpy.mean" ]
[((289, 331), 'numpy.logical_and', 'np.logical_and', (['(g > level)', '(g < 1.0 - level)'], {}), '(g > level, g < 1.0 - level)\n', (303, 331), True, 'import numpy as np\n'), ((819, 839), 'scipy.special.expit', 'expit', (['logit_perturb'], {}), '(logit_perturb)\n', (824, 839), False, 'from scipy.special import logit, ex...
from typing import Any, Dict, Tuple, List import numpy as np from vistautils.parameters import Parameters from pegasus_wrapper import ( initialize_vista_pegasus_wrapper, directory_for, run_python_on_parameters, Locator, write_workflow_description, limit_jobs_for_category, ) from pegasus_wrapp...
[ "vistautils.parameters_only_entrypoint.parameters_only_entry_point", "pegasus_wrapper.resource_request.SlurmResourceRequest.from_parameters", "pegasus_wrapper.write_workflow_description", "numpy.linspace", "pegasus_wrapper.initialize_vista_pegasus_wrapper", "pegasus_wrapper.directory_for" ]
[((696, 736), 'pegasus_wrapper.initialize_vista_pegasus_wrapper', 'initialize_vista_pegasus_wrapper', (['params'], {}), '(params)\n', (728, 736), False, 'from pegasus_wrapper import initialize_vista_pegasus_wrapper, directory_for, run_python_on_parameters, Locator, write_workflow_description, limit_jobs_for_category\n'...
import gpflow import numpy as np import tensorflow as tf def _tf_calc_Phi_vector_SqExp(Z, variance, lengthscales, domain): Tmin = domain[:, 0] Tmax = domain[:, 1] inv_fac_lengthscales = np.sqrt(0.5) / lengthscales erf_val = (tf.math.erf((Tmax - Z) * inv_fac_lengthscales) - tf.math.erf(...
[ "tensorflow.math.erf", "tensorflow.reduce_prod", "numpy.sqrt" ]
[((423, 461), 'tensorflow.reduce_prod', 'tf.reduce_prod', (['(mult * erf_val)'], {'axis': '(1)'}), '(mult * erf_val, axis=1)\n', (437, 461), True, 'import tensorflow as tf\n'), ((200, 212), 'numpy.sqrt', 'np.sqrt', (['(0.5)'], {}), '(0.5)\n', (207, 212), True, 'import numpy as np\n'), ((244, 290), 'tensorflow.math.erf'...
from .optimizer import Optimizer import numpy as np import time from multiprocessing import Pool class Particle3RPROP(Optimizer): """ RPROP for particle3 networks Technically, iRPROP- Full-batch, not mini-batch """ def __init__(self, n_epochs=1, verbosity=2, cost_freq=2, init_delta=0.1, e...
[ "numpy.random.uniform", "numpy.zeros_like", "numpy.sign", "time.time", "multiprocessing.Pool", "numpy.array_split" ]
[((4389, 4400), 'time.time', 'time.time', ([], {}), '()\n', (4398, 4400), False, 'import time\n'), ((1861, 1891), 'multiprocessing.Pool', 'Pool', ([], {'processes': 'self.n_threads'}), '(processes=self.n_threads)\n', (1865, 1891), False, 'from multiprocessing import Pool\n'), ((2246, 2288), 'numpy.array_split', 'np.arr...
import os import sys from pathlib import Path from urllib.request import urlretrieve import numpy as np import tensorflow as tf class Weight_loader(object): def __init__(self, var_list, path=None): if path is None: path='./yolov3.weights' self.var_list = var_list ...
[ "numpy.fromfile", "os.path.getsize", "numpy.transpose", "urllib.request.urlretrieve", "pathlib.Path", "tensorflow.assign", "sys.stderr.write", "numpy.prod" ]
[((334, 344), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (338, 344), False, 'from pathlib import Path\n'), ((612, 630), 'numpy.prod', 'np.prod', (['var_shape'], {}), '(var_shape)\n', (619, 630), True, 'import numpy as np\n'), ((1018, 1058), 'tensorflow.assign', 'tf.assign', (['var', 'val'], {'validate_shape': ...