code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""File that aims to visualize the facial images data"""
import numpy as np
import tensorflow as tf
import umap
import umap.plot
from src.data.image_data_reader import ImageDataReader, Set
def embedding_model() -> tf.keras.Model:
input = tf.keras.layers.Input(
shape=(48, 48, 3), dtype=tf.float32, name="... | [
"tensorflow.keras.applications.EfficientNetB2",
"tensorflow.image.grayscale_to_rgb",
"tensorflow.keras.applications.efficientnet.preprocess_input",
"numpy.empty",
"umap.plot.plt.show",
"tensorflow.keras.Model",
"src.data.image_data_reader.ImageDataReader",
"umap.UMAP",
"tensorflow.keras.layers.Input... | [((246, 318), 'tensorflow.keras.layers.Input', 'tf.keras.layers.Input', ([], {'shape': '(48, 48, 3)', 'dtype': 'tf.float32', 'name': '"""image"""'}), "(shape=(48, 48, 3), dtype=tf.float32, name='image')\n", (267, 318), True, 'import tensorflow as tf\n'), ((345, 403), 'tensorflow.keras.applications.efficientnet.preproce... |
import unittest
import numpy as np
from pykrev import van_krevelen_plot, element_ratios, element_counts, kendrick_mass_defect_plot, multi_van_krevelen_plot, van_krevelen_histogram, missing_plot, unique_plot, double_bond_equivalent, atomic_class_plot, compound_class_plot, mass_spectrum, mass_histogram
class TestPLOTTIN... | [
"unittest.main",
"pykrev.kendrick_mass_defect_plot",
"pykrev.atomic_class_plot",
"pykrev.mass_histogram",
"pykrev.mass_spectrum",
"pykrev.compound_class_plot",
"pykrev.missing_plot",
"pykrev.unique_plot",
"numpy.array",
"pykrev.double_bond_equivalent",
"pykrev.van_krevelen_plot",
"pykrev.van_k... | [((4514, 4529), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4527, 4529), False, 'import unittest\n'), ((581, 606), 'pykrev.double_bond_equivalent', 'double_bond_equivalent', (['x'], {}), '(x)\n', (603, 606), False, 'from pykrev import van_krevelen_plot, element_ratios, element_counts, kendrick_mass_defect_plot... |
import argparse
import json
import numpy as np
from evaulate_pt import *
from evaulate_pt import Config as cg_pt
from evaulate_tf import DatasetGeneratorTF, TfModel
from evaulate_tf import Config as cg
from evaulate_sst import *
def argp():
parser = argparse.ArgumentParser(description='Script to train pytorch s... | [
"evaulate_tf.DatasetGeneratorTF",
"json.load",
"argparse.ArgumentParser",
"numpy.argmax"
] | [((258, 345), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Script to train pytorch script on text data"""'}), "(description=\n 'Script to train pytorch script on text data')\n", (281, 345), False, 'import argparse\n'), ((2441, 2456), 'numpy.argmax', 'np.argmax', (['temp'], {}), '(te... |
import warnings
import unittest
from itertools import product
import random
import torch
from torch.testing._internal.common_utils import \
(TestCase, run_tests, do_test_empty_full, TEST_NUMPY, suppress_warnings,
IS_WINDOWS, torch_to_numpy_dtype_dict, slowTest)
from torch.testing._internal.common_device_type... | [
"torch.eye",
"torch.iinfo",
"torch.ByteTensor",
"numpy.logspace",
"torch.testing._internal.common_device_type.skipCPUIf",
"torch.set_default_tensor_type",
"torch.randn",
"torch.full",
"torch.empty",
"torch.cuda.device_count",
"torch.set_default_dtype",
"torch.testing.get_all_complex_dtypes",
... | [((1681, 1702), 'torch.testing._internal.common_device_type.deviceCountAtLeast', 'deviceCountAtLeast', (['(1)'], {}), '(1)\n', (1699, 1702), False, 'from torch.testing._internal.common_device_type import instantiate_device_type_tests, deviceCountAtLeast, onlyOnCPUAndCUDA, onlyCPU, skipCUDAIfNotRocm, largeCUDATensorTest... |
import numpy as np
import matplotlib.pyplot as plt
x = np.array([0.0, 1.0, 2.0, 3.0, 4.0, 5.0])
y = np.array([0.0, 0.8, 0.9, 0.1, -0.8, -1.0])
beta = np.polyfit(x, y, deg=5)
# create a polynomial function from the beta coefficients
p = np.poly1d(beta)
# print(p)
xx = np.linspace(0.0,5.0, 100)
plt.scatter(x,y, 50, ... | [
"numpy.poly1d",
"matplotlib.pyplot.show",
"numpy.polyfit",
"matplotlib.pyplot.scatter",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((56, 96), 'numpy.array', 'np.array', (['[0.0, 1.0, 2.0, 3.0, 4.0, 5.0]'], {}), '([0.0, 1.0, 2.0, 3.0, 4.0, 5.0])\n', (64, 96), True, 'import numpy as np\n'), ((103, 145), 'numpy.array', 'np.array', (['[0.0, 0.8, 0.9, 0.1, -0.8, -1.0]'], {}), '([0.0, 0.8, 0.9, 0.1, -0.8, -1.0])\n', (111, 145), True, 'import numpy as n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
2D MAF data of Cs2O.4.72SiO2 glass
==================================
"""
# %%
# The following example illustrates an application of the statistical learning method
# applied in determining the distribution of the nuclear shielding tensor parameters
# from a 2D magic-an... | [
"matplotlib.pyplot.subplot",
"csdmpy.load",
"matplotlib.pyplot.show",
"csdmpy.statistics.std",
"matplotlib.pyplot.legend",
"mrinversion.linear_model.SmoothLasso",
"mrinversion.kernel.utils.x_y_to_zeta_eta",
"mrinversion.utils.to_Haeberlen_grid",
"csdmpy.statistics.integral",
"matplotlib.pyplot.fig... | [((1583, 1600), 'csdmpy.load', 'cp.load', (['filename'], {}), '(filename)\n', (1590, 1600), True, 'import csdmpy as cp\n'), ((4138, 4372), 'mrinversion.kernel.nmr.ShieldingPALineshape', 'ShieldingPALineshape', ([], {'anisotropic_dimension': 'anisotropic_dimension', 'inverse_dimension': 'inverse_dimensions', 'channel': ... |
import numpy as np
import dask.array as da
import xarray as xr
from xrspatial.utils import ArrayTypeFunctionMapping
def general_output_checks(input_agg: xr.DataArray,
output_agg: xr.DataArray,
expected_results: np.ndarray = None,
... | [
"numpy.testing.assert_allclose",
"xrspatial.utils.ArrayTypeFunctionMapping"
] | [((1828, 1952), 'xrspatial.utils.ArrayTypeFunctionMapping', 'ArrayTypeFunctionMapping', ([], {'numpy_func': 'numpy_func', 'dask_func': 'dask_func', 'cupy_func': 'cupy_func', 'dask_cupy_func': 'dask_cupy_func'}), '(numpy_func=numpy_func, dask_func=dask_func,\n cupy_func=cupy_func, dask_cupy_func=dask_cupy_func)\n', (... |
#!/usr/bin/python3.6
import numpy as np
from domains import UnitDisk
from dynamics import NVortexProblem
from plot import VortexPlot
from utils import star_configuration
if __name__ == '__main__':
domain = UnitDisk()
problem = NVortexProblem(domain, Tmax=16)
x0, Gamma = star_configuration([-1/8], [.1], 3)... | [
"dynamics.NVortexProblem",
"domains.UnitDisk",
"utils.star_configuration",
"plot.VortexPlot",
"numpy.sqrt"
] | [((212, 222), 'domains.UnitDisk', 'UnitDisk', ([], {}), '()\n', (220, 222), False, 'from domains import UnitDisk\n'), ((237, 268), 'dynamics.NVortexProblem', 'NVortexProblem', (['domain'], {'Tmax': '(16)'}), '(domain, Tmax=16)\n', (251, 268), False, 'from dynamics import NVortexProblem\n'), ((285, 323), 'utils.star_con... |
import time
from functools import reduce
from typing import Dict, List, Any, Optional
import numpy as np
import torch
from falkon.hopt.objectives.objectives import HyperoptObjective, FakeTorchModelMixin
from falkon.hopt.optimization.reporting import pred_reporting, EarlyStop, epoch_bookkeeping
__all__ = [
"train... | [
"torch.optim.lr_scheduler.StepLR",
"torch.zeros_like",
"torch.autograd.profiler.profile",
"falkon.hopt.optimization.reporting.epoch_bookkeeping",
"torch.autograd.grad",
"falkon.hopt.optimization.reporting.pred_reporting",
"time.time",
"torch.optim.Adam",
"numpy.arange",
"torch.cuda.empty_cache",
... | [((6821, 6844), 'numpy.arange', 'np.arange', (['Xtr.shape[0]'], {}), '(Xtr.shape[0])\n', (6830, 6844), True, 'import numpy as np\n'), ((2196, 2225), 'torch.optim.Adam', 'torch.optim.Adam', (['opt_modules'], {}), '(opt_modules)\n', (2212, 2225), False, 'import torch\n'), ((2431, 2486), 'torch.optim.lr_scheduler.StepLR',... |
# CGD optim source code from:
# https://github.com/devzhk/Implicit-Competitive-Regularization
import random
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.autograd as autograd
from scipy.stats import gaussian_kde
import torch.nn.functional as F
import matplotlib.p... | [
"torch.cuda.synchronize",
"torch.dot",
"numpy.random.seed",
"torch.autograd.grad",
"torch.randn",
"torch.cat",
"matplotlib.pyplot.figure",
"numpy.mean",
"torch.device",
"torch.isnan",
"torch.ones",
"numpy.random.randn",
"matplotlib.pyplot.close",
"torch.FloatTensor",
"os.path.exists",
... | [((460, 477), 'random.seed', 'random.seed', (['(1234)'], {}), '(1234)\n', (471, 477), False, 'import random\n'), ((478, 498), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (492, 498), True, 'import numpy as np\n'), ((499, 522), 'torch.manual_seed', 'torch.manual_seed', (['(1234)'], {}), '(1234)\n... |
#!/usr/bin/env python
#
# get uncertainty of a single DEM, using the provided reference points (e.g. ICESAT).
# last modified: <NAME>, June 6, 2019
#
#
# usage: DEMUncertainty.py [-h] [-z Z_FIELD] Refpts_file DEM_file
# positional arguments:
# Refpts_file Path to the reference points
# ... | [
"UtilRaster.SingleRaster",
"os.path.abspath",
"argparse.ArgumentParser",
"os.path.dirname",
"UtilXYZ.ZArray",
"numpy.isnan",
"numpy.array",
"numpy.loadtxt",
"geopandas.read_file"
] | [((1972, 1988), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1986, 1988), False, 'from argparse import ArgumentParser\n'), ((2712, 2734), 'UtilRaster.SingleRaster', 'SingleRaster', (['demfpath'], {}), '(demfpath)\n', (2724, 2734), False, 'from UtilRaster import SingleRaster, timeit\n'), ((2831, 2856)... |
#!/usr/bin/python
#learn TFA matrix values from
# symbolic TFA matrix,
# CS matrix,
# and measured log expression values
from gurobipy import *
import numpy
import random
import argparse
import time
def parseInputs():
parser = argparse.ArgumentParser(description='Infer CS and TFA values')
parser.add_argumen... | [
"argparse.ArgumentParser",
"numpy.copy",
"random.uniform",
"numpy.savetxt",
"numpy.genfromtxt",
"time.time",
"numpy.mean",
"numpy.var"
] | [((237, 299), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Infer CS and TFA values"""'}), "(description='Infer CS and TFA values')\n", (260, 299), False, 'import argparse\n'), ((11831, 11842), 'time.time', 'time.time', ([], {}), '()\n', (11840, 11842), False, 'import time\n'), ((12477,... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 2 13:04:57 2018
@author: pscog
"""
#import sys
#import os
#sys.path.append(os.path.dirname(os.getcwd()))
from multiprocessing import Process, Pool
import PyThurstonian
from PyThurstonian import thurstonian, hdi
import pandas as pd
import seaborn as sns
import m... | [
"seaborn.set_style",
"PyThurstonian.thurstonian",
"matplotlib.pyplot.show",
"numpy.sum",
"matplotlib.pyplot.hist",
"simulate_data.simulate_data",
"numpy.array",
"multiprocessing.Pool",
"pandas.factorize",
"seaborn.set_context"
] | [((470, 494), 'seaborn.set_context', 'sns.set_context', (['"""paper"""'], {}), "('paper')\n", (485, 494), True, 'import seaborn as sns\n'), ((499, 525), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (512, 525), True, 'import seaborn as sns\n'), ((705, 749), 'numpy.array', 'np.array... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
import tbmodels
import numpy as np
def test_consistency(get_model_clean, models_equal, sparse):
model1 = get_model_clean(0.1, 0.2, sparse=sparse)
hoppings = []
for k, v in model1.hop.items():
hoppings.extend(tbmodels.helpers.matrix_to_... | [
"tbmodels.Model.from_hop_list",
"numpy.array"
] | [((357, 492), 'tbmodels.Model.from_hop_list', 'tbmodels.Model.from_hop_list', ([], {'size': '(2)', 'hop_list': 'hoppings', 'contains_cc': '(False)', 'occ': '(1)', 'pos': '((0.0,) * 3, (0.5, 0.5, 0.0))', 'sparse': 'sparse'}), '(size=2, hop_list=hoppings, contains_cc=False,\n occ=1, pos=((0.0,) * 3, (0.5, 0.5, 0.0)), ... |
# coding: utf-8
"""
This module offers a simple, matlab-style API built on top of the gr package.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import sys
import warnings
import numpy as np
imp... | [
"gr.text",
"gr.setviewport",
"gr.setwswindow",
"gr3.clear",
"numpy.arctan2",
"gr.shadepoints",
"numpy.ones",
"gr.setwindow",
"numpy.arange",
"numpy.interp",
"gr.endprint",
"gr.contour",
"gr.uselinespec",
"numpy.degrees",
"gr.restorestate",
"numpy.max",
"gr3.deletemesh",
"gr.trisurf... | [((749, 770), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (764, 770), False, 'import functools\n'), ((9365, 9376), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (9373, 9376), True, 'import numpy as np\n'), ((9635, 9673), 'numpy.bincount', 'np.bincount', (['binned_x'], {'weights': 'weights'}), '... |
import numpy as np
from copy import deepcopy
from math import ceil, modf
from scipy.integrate import odeint
dWdN = 1e6 * 24 * 3600 / (1.23 / 235)
class Calculate():
def __init__(self, data, settings):
self.DATA = data
self.FUEL = {}
for nuclide, weight_ratio in settings['Initial'].items(... | [
"copy.deepcopy",
"math.ceil",
"scipy.integrate.odeint",
"math.modf",
"numpy.hstack",
"numpy.array",
"numpy.exp"
] | [((2462, 2474), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (2470, 2474), True, 'import numpy as np\n'), ((2498, 2517), 'copy.deepcopy', 'deepcopy', (['self.FUEL'], {}), '(self.FUEL)\n', (2506, 2517), False, 'from copy import deepcopy\n'), ((5413, 5425), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (5421, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pcap, socket, struct
import numpy as np
from cymru import *
'''open a lot of pcaps at once, using a number of worker processes'''
def inspect_pcaps(pcaps, processes=1):
from multiprocessing import Pool
p = Pool(processes)
flows = p.map(flow, pcaps)
r... | [
"matplotlib.pyplot.yscale",
"numpy.average",
"argparse.ArgumentParser",
"pcap.pcap",
"matplotlib.pyplot.show",
"numpy.std",
"csv.DictReader",
"numpy.median",
"struct.unpack",
"matplotlib.pyplot.figure",
"multiprocessing.Pool",
"matplotlib.patches.Patch",
"socket.inet_ntoa"
] | [((268, 283), 'multiprocessing.Pool', 'Pool', (['processes'], {}), '(processes)\n', (272, 283), False, 'from multiprocessing import Pool\n'), ((551, 580), 'struct.unpack', 'struct.unpack', (['"""!HH"""', 'tcp[:4]'], {}), "('!HH', tcp[:4])\n", (564, 580), False, 'import pcap, socket, struct\n'), ((2403, 2422), 'numpy.av... |
import numpy as np
from PIL import Image
import cv2
import sys
def output_to_image(net_input, output, name, path):
l = net_input.cpu().detach().numpy()[0][0] # l channel
a = output.cpu().detach().numpy()[0][0] # a channel
b = output.cpu().detach().numpy()[0][1] # b channel
mapped_l_channel = [[0 f... | [
"cv2.cvtColor",
"numpy.size",
"numpy.array",
"PIL.Image.fromarray"
] | [((1223, 1271), 'cv2.cvtColor', 'cv2.cvtColor', (['merged_channels', 'cv2.COLOR_LAB2RGB'], {}), '(merged_channels, cv2.COLOR_LAB2RGB)\n', (1235, 1271), False, 'import cv2\n'), ((579, 592), 'numpy.size', 'np.size', (['l', '(1)'], {}), '(l, 1)\n', (586, 592), True, 'import numpy as np\n'), ((729, 742), 'numpy.size', 'np.... |
from dataloader import colmap_loader
import os
import sys
import argparse
import numpy as np
import cv2
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
parser = argparse.ArgumentParser()
parser.add_argument('seq_path', help='the path to the sequence of images.')
parser.add_argumen... | [
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"dataloader.colmap_loader.COLMAPData.extract_data_to_param",
"math.sqrt",
"matplotlib.pyplot.figure",
"cv2.Rodrigues",
"numpy.array"
] | [((200, 225), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (223, 225), False, 'import argparse\n'), ((604, 665), 'dataloader.colmap_loader.COLMAPData.extract_data_to_param', 'colmap_loader.COLMAPData.extract_data_to_param', (['args.seq_path'], {}), '(args.seq_path)\n', (650, 665), False, 'fro... |
"""Unit tests for radar_plotting.py."""
import unittest
import numpy
from gewittergefahr.gg_utils import radar_utils
from gewittergefahr.deep_learning import input_examples
from gewittergefahr.plotting import radar_plotting
METRES_TO_KM = 0.001
# The following constants are used to test layer_operations_to_names.
TH... | [
"unittest.main",
"gewittergefahr.plotting.radar_plotting.fields_and_heights_to_names",
"gewittergefahr.plotting.radar_plotting.layer_operations_to_names",
"numpy.array"
] | [((663, 736), 'numpy.array', 'numpy.array', (['([1000] * 3 + [1000] * 3 + [2000] * 3 + [5000] * 3)'], {'dtype': 'int'}), '([1000] * 3 + [1000] * 3 + [2000] * 3 + [5000] * 3, dtype=int)\n', (674, 736), False, 'import numpy\n'), ((768, 841), 'numpy.array', 'numpy.array', (['([3000] * 3 + [3000] * 3 + [4000] * 3 + [8000] ... |
from sklearn.feature_selection import VarianceThreshold, SelectFromModel
from sklearn.svm import LinearSVC
import numpy as np
def remove_features(data, target, fn):
"""
Function that transforms the data for the selected knn algorithm
:param target:
:param fn:
:param k:
:param data:
:return... | [
"sklearn.svm.LinearSVC",
"sklearn.feature_selection.SelectFromModel",
"numpy.transpose",
"sklearn.feature_selection.VarianceThreshold"
] | [((698, 725), 'numpy.transpose', 'np.transpose', (['selected_data'], {}), '(selected_data)\n', (710, 725), True, 'import numpy as np\n'), ((739, 757), 'numpy.transpose', 'np.transpose', (['data'], {}), '(data)\n', (751, 757), True, 'import numpy as np\n'), ((392, 436), 'sklearn.feature_selection.VarianceThreshold', 'Va... |
import numpy as np
import torch
import argparse
def strToBool(value):
if value.lower() in {'false', 'f', '0', 'no', 'n'}:
return False
elif value.lower() in {'true', 't', '1', 'yes', 'y'}:
return True
raise ValueError(f'{value} is not a valid boolean value')
parser = argparse.ArgumentParse... | [
"numpy.asarray",
"argparse.ArgumentParser",
"torch.device"
] | [((298, 323), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (321, 323), False, 'import argparse\n'), ((5660, 5797), 'numpy.asarray', 'np.asarray', (['[[0.45 - workspace_size / 2, 0.45 + workspace_size / 2], [0 - \n workspace_size / 2, 0 + workspace_size / 2], [0.01, 0.25]]'], {}), '([[0.45 ... |
import cv2
import numpy as np
LEFT_EYE_INDICES = [36, 37, 38, 39, 40, 41]
RIGHT_EYE_INDICES = [42, 43, 44, 45, 46, 47]
class MyFaceAligner:
def __init__(self, desiredLeftEye=(0.35, 0.35),
desiredFaceWidth=256, desiredFaceHeight=None):
# store the facial landmark predictor, desired output... | [
"cv2.warpAffine",
"numpy.arctan2",
"cv2.getRotationMatrix2D",
"numpy.sqrt"
] | [((2099, 2125), 'numpy.sqrt', 'np.sqrt', (['(dX ** 2 + dY ** 2)'], {}), '(dX ** 2 + dY ** 2)\n', (2106, 2125), True, 'import numpy as np\n'), ((2612, 2661), 'cv2.getRotationMatrix2D', 'cv2.getRotationMatrix2D', (['eyesCenter', 'angle', 'scale'], {}), '(eyesCenter, angle, scale)\n', (2635, 2661), False, 'import cv2\n'),... |
# -*- coding: utf-8 -*-
# @Time : 2019/10/10 17:06
# @Author : <NAME>
# @FileName: DataLoader.py
# @Email: <EMAIL>
import os
from skimage import io
import torch
import pandas as pd
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from torchvision.models import resnet18
from... | [
"torch.utils.data.DataLoader",
"os.path.dirname",
"numpy.random.randint",
"skimage.transform.resize",
"torch.cuda.is_available",
"numpy.array",
"torch.is_tensor",
"os.listdir",
"skimage.io.imread",
"torch.from_numpy"
] | [((5623, 5685), 'torch.utils.data.DataLoader', 'DataLoader', (['dataset'], {'batch_size': '(4)', 'shuffle': '(True)', 'num_workers': '(4)'}), '(dataset, batch_size=4, shuffle=True, num_workers=4)\n', (5633, 5685), False, 'from torch.utils.data import Dataset, DataLoader\n'), ((1102, 1122), 'torch.is_tensor', 'torch.is_... |
"""
HSDS data extraction functions
"""
import dateutil
import h5pyd
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from pyproj import Proj
from scipy.spatial import cKDTree
import seaborn as sns
mpl.rcParams['font.sans-serif'] = 'DejaVu Sans'
mpl.rcParams['pdf... | [
"matplotlib.rc",
"numpy.abs",
"matplotlib.pyplot.figure",
"h5pyd.File",
"scipy.spatial.cKDTree",
"pandas.DataFrame",
"os.path.exists",
"matplotlib.pyplot.colorbar",
"numpy.max",
"seaborn.set_style",
"matplotlib.pyplot.show",
"seaborn.boxplot",
"pandas.to_datetime",
"numpy.subtract",
"os.... | [((337, 366), 'matplotlib.rc', 'mpl.rc', (['"""xtick"""'], {'labelsize': '(14)'}), "('xtick', labelsize=14)\n", (343, 366), True, 'import matplotlib as mpl\n'), ((367, 396), 'matplotlib.rc', 'mpl.rc', (['"""ytick"""'], {'labelsize': '(14)'}), "('ytick', labelsize=14)\n", (373, 396), True, 'import matplotlib as mpl\n'),... |
# %%
# Python standard library
import math
import random
# Scientific stack
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.patches as patches
# Visualization
# ------------------------------------------------------------------------------
def rotate(x1y1, x2y2):
"Ro... | [
"numpy.array",
"random.seed",
"matplotlib.pyplot.subplots",
"matplotlib.cm.get_cmap"
] | [((846, 891), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(fig_width, fig_height)'}), '(figsize=(fig_width, fig_height))\n', (858, 891), True, 'import matplotlib.pyplot as plt\n'), ((3358, 3372), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (3369, 3372), False, 'import random\n'), ((1497, 1... |
"""
--- Day 3: Squares With Three Sides ---
https://adventofcode.com/2016/day/3
"""
import numpy as np
from aocd import data
A = np.fromstring(data, sep=" ", dtype=int)
R = A.reshape(-1, 3).T
C = R.reshape(-1, 3).T
for A in R, C:
T = A[0] + A[1] > A[2]
T &= A[0] + A[2] > A[1]
T &= A[1] + A[2] > A[0]
... | [
"numpy.fromstring"
] | [((131, 170), 'numpy.fromstring', 'np.fromstring', (['data'], {'sep': '""" """', 'dtype': 'int'}), "(data, sep=' ', dtype=int)\n", (144, 170), True, 'import numpy as np\n')] |
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from base import BaseModel, BaseModule
from model.model_helpers import Beam
from torch.autograd import Variable
import matplotlib.pyplot as plt
import math
class KWSModel(BaseModel):
def __init__(self, hiddenDNNV,... | [
"torch.nn.Dropout",
"argparse.ArgumentParser",
"torch.nn.Embedding",
"torch.nn.LSTMCell",
"torch.cat",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.Conv1d",
"torch.nn.functional.log_softmax",
"model.model_helpers.Beam",
"torch.nn.Linear",
"torc... | [((18884, 18909), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (18907, 18909), False, 'import argparse\n'), ((2216, 2232), 'torch.sigmoid', 'torch.sigmoid', (['o'], {}), '(o)\n', (2229, 2232), False, 'import torch\n'), ((3023, 3151), 'torch.nn.LSTM', 'nn.LSTM', ([], {'input_size': '(hiddenDim... |
"""
Find the row in the stacked_tgas file given the KIC id.
"""
import numpy as np
import pandas as pd
from astropy.table import Table
def row_ind(kepid, tgas=None):
"""
Takes a KIC id (kepid) and returns the indices of the corresponding rows
in stacked tgas.
returns:
matched_star_ind: (int)
... | [
"pandas.read_csv",
"numpy.where",
"astropy.table.Table.read"
] | [((540, 567), 'pandas.read_csv', 'pd.read_csv', (['"""kic_tgas.csv"""'], {}), "('kic_tgas.csv')\n", (551, 567), True, 'import pandas as pd\n'), ((955, 996), 'numpy.where', 'np.where', (["(table['source_id'] == source_id)"], {}), "(table['source_id'] == source_id)\n", (963, 996), True, 'import numpy as np\n'), ((1007, 1... |
"""
top level module for pytorch
<NAME> <EMAIL>
September 16, 2019
"""
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
torch.set_printoptions(precision=10)
#data
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import torch.optim as optim
import operat... | [
"transform.ImageTransformOpticalFlow",
"shift.ImageShiftGradientBased",
"utilities.ImageRotation",
"shift.is_correlation_method",
"numpy.arange",
"sys.stdout.flush",
"torch.device",
"torch.nn.functional.pad",
"torch.flatten",
"torch.nn.MSELoss",
"torch.utils.data.DataLoader",
"torch.squeeze",
... | [((157, 193), 'torch.set_printoptions', 'torch.set_printoptions', ([], {'precision': '(10)'}), '(precision=10)\n', (179, 193), False, 'import torch\n'), ((5959, 5980), 'regularizers.Regularizer', 'Regularizer', ([], {}), '(**kwargs)\n', (5970, 5980), False, 'from regularizers import Regularizer\n'), ((6008, 6051), 'uti... |
import random
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn import tree
from sklearn import svm
from sklearn.model_selection import cross_validate
import numpy as np
import time
import click
import feature_extraction
start_time = time.time()
X = []
... | [
"sklearn.ensemble.RandomForestClassifier",
"sklearn.model_selection.cross_validate",
"random.shuffle",
"feature_extraction.section_name_checker",
"feature_extraction.compilation_time",
"click.option",
"feature_extraction.extract_file_info",
"sklearn.tree.DecisionTreeClassifier",
"click.command",
"... | [((301, 312), 'time.time', 'time.time', ([], {}), '()\n', (310, 312), False, 'import time\n'), ((5492, 5507), 'click.command', 'click.command', ([], {}), '()\n', (5505, 5507), False, 'import click\n'), ((5509, 5585), 'click.option', 'click.option', (['"""--malwarepath"""'], {'required': '(True)', 'help': '"""path of ma... |
"""Default network architectures for TD3."""
from typing import Dict, Sequence
from acme import specs
from acme.jax import networks as networks_lib
from acme.jax import utils
import haiku as hk
import jax
import jax.numpy as jnp
import numpy as np
def apply_policy_sample(networks, eval_mode: bool):
def policy_ne... | [
"jax.numpy.squeeze",
"jax.random.normal",
"acme.jax.utils.zeros_like",
"jax.numpy.concatenate",
"haiku.initializers.VarianceScaling",
"acme.jax.utils.add_batch_dim",
"haiku.transform",
"jax.numpy.clip",
"numpy.prod"
] | [((848, 886), 'numpy.prod', 'np.prod', (['spec.actions.shape'], {'dtype': 'int'}), '(spec.actions.shape, dtype=int)\n', (855, 886), True, 'import numpy as np\n'), ((2297, 2327), 'acme.jax.utils.zeros_like', 'utils.zeros_like', (['spec.actions'], {}), '(spec.actions)\n', (2313, 2327), False, 'from acme.jax import utils\... |
import collections
import gym
import numpy as np
import tensorflow as tf
def make_env(gym_id, seed):
def thunk():
env = gym.make(gym_id)
env = gym.wrappers.RecordEpisodeStatistics(env)
env.seed(seed)
env.action_space.seed(seed)
env.observation_space.seed(seed)
retu... | [
"gym.make",
"numpy.random.randn",
"numpy.square",
"tensorflow.constant",
"collections.namedtuple",
"gym.wrappers.RecordEpisodeStatistics"
] | [((709, 835), 'collections.namedtuple', 'collections.namedtuple', (['"""LossInfo"""', "('total_loss', 'value_loss', 'policy_loss', 'entropy_loss', 'approx_kl',\n 'clip_fracs')"], {}), "('LossInfo', ('total_loss', 'value_loss',\n 'policy_loss', 'entropy_loss', 'approx_kl', 'clip_fracs'))\n", (731, 835), False, 'im... |
#!/usr/bin/python
# (c) 2017 Treadco software.
# this defaults to python 2 on my machine
import numpy as np
import sys,os
from PIL import Image
from PIL import ImageChops
from pylab import *
import kernel
def normalize( a ):
# written generally
# a tuple resolves to an index
# just need to find the right tuple
l... | [
"kernel.gaussian",
"numpy.multiply",
"numpy.subtract",
"numpy.fft.fftn",
"PIL.Image.open",
"sys.stdout.flush",
"numpy.array",
"numpy.real",
"PIL.ImageChops.subtract",
"sys.exit",
"PIL.Image.merge"
] | [((756, 768), 'numpy.real', 'np.real', (['acf'], {}), '(acf)\n', (763, 768), True, 'import numpy as np\n'), ((846, 860), 'numpy.fft.fftn', 'np.fft.fftn', (['a'], {}), '(a)\n', (857, 860), True, 'import numpy as np\n'), ((1131, 1141), 'numpy.real', 'np.real', (['b'], {}), '(b)\n', (1138, 1141), True, 'import numpy as np... |
import numpy as np
def norm(x, axis=None):
return np.linalg.norm(x, axis=axis)
#-------------------------
#----- Poincaré Disk -----
#-------------------------
# NOTE: POSSIBLE ISSUE WITH DIFFERENT WAYS TO SPECIFY MINKOWSKI DOT PRODUCT
# arbritray sign gives different signatures (+, +, +, -), (+, -, -, -)
#... | [
"numpy.random.uniform",
"numpy.zeros",
"numpy.isnan",
"numpy.arccosh",
"numpy.sin",
"numpy.linalg.norm",
"numpy.cos",
"numpy.dot",
"numpy.sqrt"
] | [((55, 83), 'numpy.linalg.norm', 'np.linalg.norm', (['x'], {'axis': 'axis'}), '(x, axis=axis)\n', (69, 83), True, 'import numpy as np\n'), ((468, 481), 'numpy.arccosh', 'np.arccosh', (['d'], {}), '(d)\n', (478, 481), True, 'import numpy as np\n'), ((608, 624), 'numpy.zeros', 'np.zeros', (['(n, n)'], {}), '((n, n))\n', ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 7 23:34:50 2020
@author: panpanhuang
"""
import numpy as np
from numpy.random import default_rng
import xraylib as xlib
import xraylib_np as xlib_np
import torch as tc
import torch.nn.functional as F
import os
from tqdm import tqdm
import pickle
... | [
"os.mkdir",
"numpy.load",
"torch.nn.functional.affine_grid",
"numpy.sum",
"xraylib_np.CS_Total",
"numpy.argmax",
"numpy.floor",
"torch.cat",
"numpy.argmin",
"xraylib_np.LineEnergy",
"numpy.random.default_rng",
"torch.cos",
"os.path.isfile",
"numpy.argsort",
"os.path.join",
"numpy.full"... | [((425, 560), 'numpy.array', 'np.array', (['[xlib.KA1_LINE, xlib.KA2_LINE, xlib.KA3_LINE, xlib.KB1_LINE, xlib.KB2_LINE,\n xlib.KB3_LINE, xlib.KB4_LINE, xlib.KB5_LINE]'], {}), '([xlib.KA1_LINE, xlib.KA2_LINE, xlib.KA3_LINE, xlib.KB1_LINE, xlib.\n KB2_LINE, xlib.KB3_LINE, xlib.KB4_LINE, xlib.KB5_LINE])\n', (433, 56... |
# Authors: <NAME> <<EMAIL>>
# License: BSD 3 clause
from yyskmultilearn.base import MLClassifierBase
import numpy as np
import scipy.sparse as sp
from scipy.linalg import norm
from scipy.sparse.linalg import inv as inv_sparse
from scipy.linalg import inv as inv_dense
class MLTSVM(MLClassifierBase):
"""Twin multi... | [
"scipy.sparse.issparse",
"numpy.zeros",
"numpy.identity",
"numpy.ones",
"numpy.hstack",
"numpy.nonzero",
"numpy.max",
"numpy.where",
"scipy.linalg.norm",
"scipy.sparse.identity",
"numpy.dot",
"numpy.diag",
"scipy.sparse.hstack"
] | [((5807, 5821), 'scipy.sparse.issparse', 'sp.issparse', (['Y'], {}), '(Y)\n', (5818, 5821), True, 'import scipy.sparse as sp\n'), ((6004, 6018), 'scipy.sparse.issparse', 'sp.issparse', (['Y'], {}), '(Y)\n', (6015, 6018), True, 'import scipy.sparse as sp\n'), ((6183, 6197), 'scipy.sparse.issparse', 'sp.issparse', (['X']... |
import torch
import pandas as pd
import numpy as np
from torch.utils.data import Dataset, DataLoader
from sklearn.model_selection import train_test_split
from deepfm import DeepFM
torch.manual_seed(2022)
data = pd.read_csv('./temp_data.csv').reset_index(drop=True)
category_cols = ['CODE_GENDER', 'FLAG_OWN_CAR', 'FLA... | [
"torch.utils.data.DataLoader",
"pandas.read_csv",
"torch.manual_seed",
"sklearn.model_selection.train_test_split",
"deepfm.DeepFM",
"numpy.asarray",
"numpy.cumsum",
"torch.tensor"
] | [((182, 205), 'torch.manual_seed', 'torch.manual_seed', (['(2022)'], {}), '(2022)\n', (199, 205), False, 'import torch\n'), ((2380, 2417), 'sklearn.model_selection.train_test_split', 'train_test_split', (['data'], {'test_size': '(0.2)'}), '(data, test_size=0.2)\n', (2396, 2417), False, 'from sklearn.model_selection imp... |
import numpy, Image
for n in xrange(10000):
a = numpy.random.rand(64,64,3) * 255
im_out = Image.fromarray(a.astype('uint8')).convert('RGBA')
im_out.save('%000d.jpg' % n) | [
"numpy.random.rand"
] | [((53, 81), 'numpy.random.rand', 'numpy.random.rand', (['(64)', '(64)', '(3)'], {}), '(64, 64, 3)\n', (70, 81), False, 'import numpy, Image\n')] |
#!/usr/bin/env python
import cPickle
import cv2
import numpy as np
import h5py
from vizdoom import *
import math
import os
import os.path
import sys
import random
import scipy.misc
from constants import *
from video_writer import *
import cv2
import os
import cPickle
import numpy as np
np.random.seed(DEFAULT_RANDOM_S... | [
"h5py.File",
"numpy.zeros_like",
"numpy.random.seed",
"random.randint",
"math.sqrt",
"math.fabs",
"cv2.cvtColor",
"numpy.argmax",
"numpy.zeros",
"random.random",
"cPickle.dump",
"numpy.array",
"random.seed",
"cv2.pyrDown",
"numpy.concatenate",
"cv2.pyrUp"
] | [((289, 324), 'numpy.random.seed', 'np.random.seed', (['DEFAULT_RANDOM_SEED'], {}), '(DEFAULT_RANDOM_SEED)\n', (303, 324), True, 'import numpy as np\n'), ((352, 384), 'random.seed', 'random.seed', (['DEFAULT_RANDOM_SEED'], {}), '(DEFAULT_RANDOM_SEED)\n', (363, 384), False, 'import random\n'), ((764, 779), 'numpy.array'... |
import streamlit as st
from streamlit_player import st_player
import cv2
import numpy as np
import tempfile
import time
from PIL import Image
############################################################
############################################################
import os
import collections
# comment out below line t... | [
"streamlit.sidebar.slider",
"core.utils.get_anchors",
"tensorflow._api.v2.compat.v1.InteractiveSession",
"streamlit.image",
"cv2.VideoWriter_fourcc",
"numpy.floor",
"streamlit.title",
"collections.defaultdict",
"streamlit.sidebar.title",
"streamlit.sidebar.selectbox",
"cv2.VideoWriter",
"deep_... | [((1119, 1172), 'tools.generate_detections.create_box_encoder', 'gdet.create_box_encoder', (['model_filename'], {'batch_size': '(1)'}), '(model_filename, batch_size=1)\n', (1142, 1172), True, 'from tools import generate_detections as gdet\n'), ((1217, 1304), 'deep_sort.nn_matching.NearestNeighborDistanceMetric', 'nn_ma... |
import pickle
from datetime import datetime
import numpy as np
from gensim.models import KeyedVectors
from sklearn.metrics import accuracy_score, f1_score
from sklearn.metrics import confusion_matrix
from utils_d.ml_models import train_lgb
from utils_d.ml_utils import Ensemble
def annotate(
match_df, algo... | [
"utils_d.ml_utils.Ensemble",
"sklearn.metrics.confusion_matrix",
"numpy.argmax",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.f1_score",
"gensim.models.KeyedVectors.load_word2vec_format",
"utils_d.ml_models.train_lgb",
"datetime.datetime.now",
"numpy.unique"
] | [((2062, 2101), 'gensim.models.KeyedVectors.load_word2vec_format', 'KeyedVectors.load_word2vec_format', (['path'], {}), '(path)\n', (2095, 2101), False, 'from gensim.models import KeyedVectors\n'), ((2814, 2921), 'utils_d.ml_models.train_lgb', 'train_lgb', (['x_train', 'x_test', 'y_train', 'y_test'], {'k_fold': 'k_fold... |
#!/usr/bin/python
"""Plot LFE difference of a binary OP against another OP."""
import argparse
import sys
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import pandas as pd
from origamipy import plot
def main():
args = parse_ar... | [
"argparse.ArgumentParser",
"matplotlib.colors.Normalize",
"pandas.read_csv",
"matplotlib.cm.ScalarMappable",
"matplotlib.pyplot.figure",
"matplotlib.use",
"matplotlib.colorbar.ColorbarBase",
"matplotlib.gridspec.GridSpec",
"matplotlib.gridspec.GridSpecFromSubplotSpec",
"matplotlib.pyplot.tight_lay... | [((134, 148), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (141, 148), True, 'import matplotlib as mpl\n'), ((2727, 2830), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=__doc__, formatter... |
import time
import numpy as np
import torch
import sqapy
class RBM:
def __init__(self, n_visible=784, n_hidden=2, alpha=0.01, device='cpu'):
self.n_visible = n_visible
self.n_hidden = n_hidden
self.alpha = alpha
self.device = device
self.data = None
self.wei... | [
"torch.dot",
"torch.t",
"torch.randint",
"sqapy.SQASampler",
"torch.Tensor.numpy",
"sqapy.BipartiteGraph",
"torch.FloatTensor",
"time.time",
"numpy.mean",
"torch.rand",
"torch.zeros",
"torch.matmul"
] | [((1471, 1482), 'time.time', 'time.time', ([], {}), '()\n', (1480, 1482), False, 'import time\n'), ((2411, 2422), 'time.time', 'time.time', ([], {}), '()\n', (2420, 2422), False, 'import time\n'), ((2448, 2473), 'numpy.mean', 'np.mean', (['self.energy_list'], {}), '(self.energy_list)\n', (2455, 2473), True, 'import num... |
import numpy as np
import scipy
import metrics
FEPS = 1e-8
NTESTS = 1000
def true_svd(x):
u, s, vt = np.linalg.svd(x)
return u, s, vt
def my_svd(x):
return x, x, x
def check_svd(x, u, s, vt):
m = x.shape[0]
n = x.shape[1]
k = min(m, n)
if u.shape[0] != m or u.shape[1] != m:
ra... | [
"numpy.random.randn",
"numpy.zeros",
"numpy.linalg.svd",
"numpy.random.randint",
"numpy.eye",
"metrics.tdist"
] | [((110, 126), 'numpy.linalg.svd', 'np.linalg.svd', (['x'], {}), '(x)\n', (123, 126), True, 'import numpy as np\n'), ((1024, 1040), 'numpy.zeros', 'np.zeros', (['(m, n)'], {}), '((m, n))\n', (1032, 1040), True, 'import numpy as np\n'), ((1108, 1140), 'metrics.tdist', 'metrics.tdist', (['(u @ s_mat @ vt)', 'x'], {}), '(u... |
import csv, os, argparse
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--main_dir', nargs=1, default=['./gama'],
help='Directory containing GAMA data')
parser.add_argument('-o', '--output_dir', nargs=1, default=['./output'],
help='Sub-directory containing output'... | [
"csv.reader",
"argparse.ArgumentParser",
"pandas.read_csv",
"numpy.std",
"numpy.mean",
"numpy.array",
"os.path.join"
] | [((35, 60), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (58, 60), False, 'import csv, os, argparse\n'), ((613, 659), 'os.path.join', 'os.path.join', (['main_dir', '"""parameter_values.txt"""'], {}), "(main_dir, 'parameter_values.txt')\n", (625, 659), False, 'import csv, os, argparse\n'), ((6... |
import os
import imp
import numpy as np
from scipy.ndimage import imread as imread0
import tifffile as tiff
def conv_labels2dto3d(labels):
lbnums = np.unique(labels)
arr = np.zeros((labels.shape[0], labels.shape[1], len(lbnums)), np.uint8)
for i in lbnums:
arr[:, :, i] = labels == i
return ar... | [
"numpy.dstack",
"numpy.pad",
"numpy.minimum",
"numpy.maximum",
"os.makedirs",
"numpy.percentile",
"numpy.array",
"numpy.squeeze",
"tifffile.imread",
"scipy.ndimage.imread",
"numpy.unique"
] | [((155, 172), 'numpy.unique', 'np.unique', (['labels'], {}), '(labels)\n', (164, 172), True, 'import numpy as np\n'), ((382, 417), 'numpy.percentile', 'np.percentile', (['orig_img', 'percentile'], {}), '(orig_img, percentile)\n', (395, 417), True, 'import numpy as np\n'), ((428, 469), 'numpy.percentile', 'np.percentile... |
import numpy as np
from typing import List
import ipal_iids.settings as settings
from .preprocessor import Preprocessor
class MeanPreprocessor(Preprocessor):
_name = "mean"
_description = "Scale by mean-standard deviation"
means: List[float]
stds: List[float]
def __init__(self, features):
... | [
"ipal_iids.settings.logger.critical",
"numpy.mean",
"numpy.std"
] | [((538, 608), 'ipal_iids.settings.logger.critical', 'settings.logger.critical', (['"""Feature length does not match data length!"""'], {}), "('Feature length does not match data length!')\n", (562, 608), True, 'import ipal_iids.settings as settings\n'), ((1220, 1290), 'ipal_iids.settings.logger.critical', 'settings.log... |
"""
Tests scikit-learn's binarizer converter.
"""
import unittest
import numpy
from sklearn.feature_extraction.text import TfidfVectorizer
from skl2onnx import convert_sklearn
from skl2onnx.common.data_types import StringTensorType
from test_utils import dump_data_and_model
class TestSklearnTfidfVectorizer(unittest.T... | [
"unittest.main",
"sklearn.feature_extraction.text.TfidfVectorizer",
"test_utils.dump_data_and_model",
"skl2onnx.common.data_types.StringTensorType",
"numpy.array"
] | [((6195, 6210), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6208, 6210), False, 'import unittest\n'), ((654, 700), 'sklearn.feature_extraction.text.TfidfVectorizer', 'TfidfVectorizer', ([], {'ngram_range': '(1, 1)', 'norm': 'None'}), '(ngram_range=(1, 1), norm=None)\n', (669, 700), False, 'from sklearn.feature... |
# Copyright (c) 2020 SMHI, Swedish Meteorological and Hydrological Institute
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
"""
Created on 2021-03-11 13:52
@author: johannes
"""
# import os
# os.environ['PROJ_LIB'] = '/_PYTHON_INSTALLATION_PATH_/Library/share/proj'
import numpy as np
... | [
"numpy.power",
"satpy.Scene",
"senplot.plotting.map.PlotSatProd",
"datetime.datetime"
] | [((839, 865), 'satpy.Scene', 'Scene', ([], {'filenames': 'filenames'}), '(filenames=filenames)\n', (844, 865), False, 'from satpy import Scene, find_files_and_readers\n'), ((1860, 1887), 'numpy.power', 'np.power', (['(10)', "scn['chl_nn']"], {}), "(10, scn['chl_nn'])\n", (1868, 1887), True, 'import numpy as np\n'), ((2... |
#!/usr/bin/env python3
"""
Put a cutoff on DIAMOND prioritization
"""
__author__ = "<NAME>"
__version__ = "0.1.0"
__license__ = "MIT"
import argparse
import logging
from funcs import utils
import numpy as np
import matplotlib.pyplot as plt
def main(args):
logging.basicConfig(level=logging.INFO,
... | [
"funcs.utils.read_gene_list",
"funcs.utils.read_network",
"argparse.ArgumentParser",
"matplotlib.pyplot.show",
"logging.FileHandler",
"funcs.utils.write_gene_list",
"numpy.savetxt",
"logging.StreamHandler",
"numpy.argmin",
"logging.info",
"matplotlib.pyplot.semilogy"
] | [((496, 514), 'logging.info', 'logging.info', (['args'], {}), '(args)\n', (508, 514), False, 'import logging\n'), ((528, 567), 'funcs.utils.read_gene_list', 'utils.read_gene_list', (['args.in_seed_path'], {}), '(args.in_seed_path)\n', (548, 567), False, 'from funcs import utils\n'), ((585, 629), 'funcs.utils.read_gene_... |
import os
import numpy as np
from envs.mujoco.envs import kuka_env
from envs.mujoco.envs.assets import kuka_asset_dir
from envs.mujoco.utils.insertion import hole_insertion_samples
from envs.mujoco.utils.kinematics import forwardKinSite, forwardKinJacobianSite
from envs.mujoco.utils.projection import rotate_cost_by_mat... | [
"envs.mujoco.utils.projection.rotate_cost_by_matrix",
"envs.mujoco.utils.kinematics.forwardKinSite",
"envs.mujoco.utils.quaternion.mat2Quat",
"numpy.eye",
"numpy.zeros",
"envs.mujoco.utils.quaternion.subQuat",
"envs.mujoco.envs.assets.kuka_asset_dir",
"numpy.diag",
"envs.mujoco.utils.kinematics.forw... | [((2161, 2185), 'numpy.diag', 'np.diag', (['[100, 100, 100]'], {}), '([100, 100, 100])\n', (2168, 2185), True, 'import numpy as np\n'), ((2201, 2222), 'numpy.diag', 'np.diag', (['[30, 30, 30]'], {}), '([30, 30, 30])\n', (2208, 2222), True, 'import numpy as np\n'), ((2837, 2904), 'envs.mujoco.utils.kinematics.forwardKin... |
import numpy as np
import torch
from ignite.engine import Engine
def mixup_data(x, y, alpha=1.0, use_cuda=True):
'''Returns mixed inputs, pairs of targets, and lambda'''
if alpha > 0:
lam = np.random.beta(alpha, alpha)
else:
lam = 1
batch_size = x.size()[0]
if use_cuda:
... | [
"numpy.random.beta",
"ignite.engine.Engine",
"torch.randperm",
"ignite.engine._prepare_batch"
] | [((1820, 1835), 'ignite.engine.Engine', 'Engine', (['_update'], {}), '(_update)\n', (1826, 1835), False, 'from ignite.engine import Engine\n'), ((3209, 3224), 'ignite.engine.Engine', 'Engine', (['_update'], {}), '(_update)\n', (3215, 3224), False, 'from ignite.engine import Engine\n'), ((210, 238), 'numpy.random.beta',... |
import os
import sys
from datetime import datetime
sys.path.append("../../")
import numpy as np
import pandas as pd
from bandit.env import MultiBanditEnv
class PatientEnv(MultiBanditEnv):
def __init__(self, iterations, epochs):
super().__init__(iterations, epochs)
self._average_adhs = dict()
... | [
"sys.path.append",
"pandas.DataFrame",
"numpy.mean",
"numpy.random.randint",
"numpy.where",
"datetime.datetime.now"
] | [((51, 76), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (66, 76), False, 'import sys\n'), ((457, 489), 'pandas.DataFrame', 'pd.DataFrame', (['self._average_adhs'], {}), '(self._average_adhs)\n', (469, 489), True, 'import pandas as pd\n'), ((543, 570), 'pandas.DataFrame', 'pd.DataFrame'... |
#!/usr/bin/env python
"""
Trains the neural network on the training data, supports resuming training
"""
import glob
import logging
import multiprocessing as mp
import os
import random
from argparse import Namespace
import numpy as np
import tensorflow as tf
from wormpose.commands import _log_parameters
from wormpo... | [
"argparse.Namespace",
"tensorflow.random.set_seed",
"wormpose.commands._log_parameters",
"os.mkdir",
"numpy.random.seed",
"argparse.ArgumentParser",
"wormpose.config.experiment_config.load_config",
"multiprocessing.set_start_method",
"tensorflow.keras.callbacks.ModelCheckpoint",
"os.path.isfile",
... | [((848, 869), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (867, 869), False, 'import logging\n'), ((879, 906), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (896, 906), False, 'import logging\n'), ((1050, 1111), 'os.path.join', 'os.path.join', (['experiment_dir', 'def... |
"""
Train TC on all *good* objects in the 11,057 overlap set
(9594 objects)
"""
import numpy as np
import glob
import matplotlib.pyplot as plt
import sys
import os
import pyfits
from astropy.table import Table
from matplotlib.colors import LogNorm
from matplotlib import rc
rc('font', family='serif')
rc('text', usetex... | [
"matplotlib.rc",
"numpy.load",
"pyfits.open",
"numpy.where",
"numpy.vstack",
"numpy.savez",
"TheCannon.model.CannonModel",
"TheCannon.dataset.Dataset"
] | [((276, 302), 'matplotlib.rc', 'rc', (['"""font"""'], {'family': '"""serif"""'}), "('font', family='serif')\n", (278, 302), False, 'from matplotlib import rc\n'), ((303, 326), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (305, 326), False, 'from matplotlib import rc\n'), ((4... |
#from scripts.category_tree import CategoryTree
import multiprocessing
from keras.activations import softmax
import keras.backend as K
from keras import metrics
from .per_group_func import PerGroupFunc
import numpy as np
# original algorithm/code is from this URL
# https://github.com/pjreddie/darknet/blob/1e729804f6... | [
"keras.backend.concatenate",
"numpy.argmax",
"numpy.asarray",
"keras.backend.sum",
"numpy.isnan",
"numpy.append",
"numpy.isclose",
"numpy.diff",
"numpy.array",
"numpy.where",
"multiprocessing.Pool",
"keras.activations.softmax",
"multiprocessing.cpu_count"
] | [((429, 456), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (454, 456), False, 'import multiprocessing\n'), ((1011, 1057), 'numpy.append', 'np.append', (['self.group_segments', '[self.nlabels]'], {}), '(self.group_segments, [self.nlabels])\n', (1020, 1057), True, 'import numpy as np\n'), (... |
from builtins import range
import numpy as np
from random import shuffle
from past.builtins import xrange
def softmax_loss_naive(W, X, y, reg):
"""
Softmax loss function, naive implementation (with loops)
Inputs have dimension D, there are C classes, and we operate on minibatches
of N examples.
I... | [
"numpy.zeros_like",
"numpy.sum",
"numpy.log",
"numpy.max",
"numpy.arange",
"numpy.exp",
"numpy.reshape",
"builtins.range"
] | [((829, 845), 'numpy.zeros_like', 'np.zeros_like', (['W'], {}), '(W)\n', (842, 845), True, 'import numpy as np\n'), ((1496, 1512), 'builtins.range', 'range', (['num_train'], {}), '(num_train)\n', (1501, 1512), False, 'from builtins import range\n'), ((2313, 2329), 'numpy.zeros_like', 'np.zeros_like', (['W'], {}), '(W)\... |
# 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... | [
"mindspore.dataset.text.BasicTokenizer",
"numpy.testing.assert_array_equal",
"mindspore.dataset.text.to_str",
"mindspore.dataset.TextFileDataset",
"mindspore.log.info"
] | [((2167, 2222), 'mindspore.dataset.TextFileDataset', 'ds.TextFileDataset', (['BASIC_TOKENIZER_FILE'], {'shuffle': '(False)'}), '(BASIC_TOKENIZER_FILE, shuffle=False)\n', (2185, 2222), True, 'import mindspore.dataset as ds\n'), ((2377, 2544), 'mindspore.dataset.text.BasicTokenizer', 'nlp.BasicTokenizer', ([], {'lower_ca... |
import os
from termcolor import colored
from datetime import datetime
import socket
import numpy as np
from tqdm import tqdm
import shutil, errno
from pathlib import Path
import statistics
import torch
import logging
import argparse
def basic_logger(name='basic_logger'):
logger = logging.getLogger(name)
return... | [
"numpy.random.seed",
"statistics.median",
"os.path.join",
"os.walk",
"socket.socket",
"os.system",
"torch.cat",
"termcolor.colored",
"shutil.copy",
"shutil.copytree",
"datetime.datetime.now",
"logging.getLogger",
"argparse.ArgumentTypeError"
] | [((286, 309), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (303, 309), False, 'import logging\n'), ((366, 399), 'termcolor.colored', 'colored', (['text', '"""yellow"""', '"""on_red"""'], {}), "(text, 'yellow', 'on_red')\n", (373, 399), False, 'from termcolor import colored\n'), ((488, 521), 'te... |
import numpy as np
from model.rta import ChunkCalculator
min_nperseg = 512
stride = 25
def test_first_data_is_too_small():
cc = ChunkCalculator(min_nperseg, stride)
data = np.arange(60).reshape(3, 20).transpose()
chunks = cc.recalc('test', data)
assert chunks is None
assert 'test' not in cc.last_... | [
"model.rta.ChunkCalculator",
"numpy.arange"
] | [((135, 171), 'model.rta.ChunkCalculator', 'ChunkCalculator', (['min_nperseg', 'stride'], {}), '(min_nperseg, stride)\n', (150, 171), False, 'from model.rta import ChunkCalculator\n'), ((379, 415), 'model.rta.ChunkCalculator', 'ChunkCalculator', (['min_nperseg', 'stride'], {}), '(min_nperseg, stride)\n', (394, 415), Fa... |
import dataclasses
import itertools
import logging
import os.path
import numpy as np
import openmdao.api as om
import xlwings
from pywintypes import com_error
from .macro_execution import run_and_raise_macro, wrap_macros
from .timeout_utils import TimeoutComponentMixin, kill_pid
logger = logging.getLogger(__package_... | [
"openmdao.api.AnalysisError",
"xlwings.App",
"numpy.ones",
"logging.getLogger",
"itertools.chain",
"dataclasses.dataclass"
] | [((292, 322), 'logging.getLogger', 'logging.getLogger', (['__package__'], {}), '(__package__)\n', (309, 322), False, 'import logging\n'), ((380, 414), 'dataclasses.dataclass', 'dataclasses.dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (401, 414), False, 'import dataclasses\n'), ((353, 367), 'numpy.ones', '... |
############################################################################
# Copyright ESIEE Paris (2018) #
# #
# Contributor(s) : <NAME> #
# ... | [
"higra.adjacency_matrix_2_undirected_graph",
"higra.UndirectedGraph",
"scipy.sparse.issparse",
"numpy.arange",
"higra.get_4_adjacency_graph",
"unittest.main",
"higra.CptMinimumSpanningTree.get_edge_map",
"higra.subgraph",
"higra.line_graph",
"higra.is_in_bijection",
"higra.undirected_graph_2_adj... | [((13996, 14011), 'unittest.main', 'unittest.main', ([], {}), '()\n', (14009, 14011), False, 'import unittest\n'), ((1150, 1182), 'higra.get_4_adjacency_graph', 'hg.get_4_adjacency_graph', (['(3, 3)'], {}), '((3, 3))\n', (1174, 1182), True, 'import higra as hg\n'), ((1206, 1270), 'numpy.asarray', 'np.asarray', (['(1, 0... |
import cv2
import numpy as np
from argparse import ArgumentParser
from time import perf_counter
from cs229.display import open_window, show_image
from cs229.files import read_video, write_video
from cs229.image import img_to_mask, bound_point
from cs229.contour import find_contours
from cs229.patch import crop_to_cont... | [
"cs229.image.img_to_mask",
"cs229.files.write_video",
"argparse.ArgumentParser",
"cs229.display.show_image",
"numpy.sin",
"cs229.files.read_video",
"cs229.load_data_wing.male_fly_patch",
"cv2.drawContours",
"cs229.image.bound_point",
"cs229.train_wing.WingPredictor",
"cv2.circle",
"cs229.train... | [((737, 763), 'cs229.image.bound_point', 'bound_point', (['(ax, ay)', 'img'], {}), '((ax, ay), img)\n', (748, 763), False, 'from cs229.image import img_to_mask, bound_point\n'), ((768, 825), 'cv2.arrowedLine', 'cv2.arrowedLine', (['img', 'point', 'tip', 'color', '(5)'], {'tipLength': '(0.3)'}), '(img, point, tip, color... |
import base64
import cloudpickle
from copy import deepcopy
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple
import numpy as np
from triad import assert_or_throw, to_uuid
from triad.utils.convert import get_full_type_path
from tune._utils import product
from tune._utils.math import (
normal_t... | [
"tune._utils.product",
"numpy.random.uniform",
"copy.deepcopy",
"numpy.random.seed",
"tune._utils.math.uniform_to_discrete",
"tune._utils.math.normal_to_discrete",
"triad.assert_or_throw",
"triad.utils.convert.get_full_type_path",
"cloudpickle.dumps",
"tune._utils.math.normal_to_continuous",
"tr... | [((1189, 1218), 'triad.to_uuid', 'to_uuid', (['"""grid"""', 'self._values'], {}), "('grid', self._values)\n", (1196, 1218), False, 'from triad import assert_or_throw, to_uuid\n'), ((2543, 2565), 'triad.to_uuid', 'to_uuid', (['self.jsondict'], {}), '(self.jsondict)\n', (2550, 2565), False, 'from triad import assert_or_t... |
#######################################################
# #
# This file is test #
# maybe contains wrong logical operation #
# ignore this file #
# ... | [
"matplotlib.pyplot.show",
"numpy.log",
"cv2.cvtColor",
"skimage.util.random_noise",
"cv2.blur",
"numpy.exp",
"os.path.join"
] | [((628, 670), 'cv2.cvtColor', 'cv2.cvtColor', (['cameraman', 'cv2.COLOR_BGR2RGB'], {}), '(cameraman, cv2.COLOR_BGR2RGB)\n', (640, 670), False, 'import cv2\n'), ((777, 815), 'cv2.cvtColor', 'cv2.cvtColor', (['babon', 'cv2.COLOR_BGR2RGB'], {}), '(babon, cv2.COLOR_BGR2RGB)\n', (789, 815), False, 'import cv2\n'), ((1628, 1... |
'''
3D FFT tester for Python Interface on CPUs
-- heFFTe --
Univ. of Tennessee, Knoxville
'''
import sys, math
import cmath
import numpy as np
from mpi4py import MPI
import heffte
# * Allocate and initialize data
def make_data(fftsize):
global work, work2
work = np.arange(1,fftsize+1).astype(n... | [
"heffte.box3d",
"mpi4py.MPI.Wtime",
"heffte.split_world",
"numpy.zeros",
"heffte.fft3d",
"numpy.arange",
"heffte.proc_setup",
"math.log"
] | [((582, 658), 'heffte.box3d', 'heffte.box3d', (['[0, 0, 0]', '[size_fft[0] - 1, size_fft[1] - 1, size_fft[2] - 1]'], {}), '([0, 0, 0], [size_fft[0] - 1, size_fft[1] - 1, size_fft[2] - 1])\n', (594, 658), False, 'import heffte\n'), ((741, 773), 'heffte.proc_setup', 'heffte.proc_setup', (['world', 'nprocs'], {}), '(world... |
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.models import Model, Sequential
from tensorflow.keras.layers import Layer
from tensorflow.keras.layers import (Input, Add, BatchNormalization,
Conv2D, Conv3D, Dense, ReLU, LeakyReLU,
... | [
"os.mkdir",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv3D",
"numpy.ones",
"tensorflow.keras.layers.LeakyReLU",
"numpy.random.randint",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.applications.vgg19",
"matplotlib.pyplot.close",
"os.path.dirname",
"tensorflow... | [((3104, 3131), 'tensorflow.keras.optimizers.Adam', 'Adam', ([], {'lr': '(0.0002)', 'beta_1': '(0.5)'}), '(lr=0.0002, beta_1=0.5)\n', (3108, 3131), False, 'from tensorflow.keras.optimizers import Adam\n'), ((3373, 3417), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': 'self.high_resolution_image_size'}), '(sha... |
from argparse import RawDescriptionHelpFormatter
import open3d as o3d
import numpy as np
from glob import glob
from scipy.spatial.transform import Rotation as R
import os
import pandas as pd
import argparse
# lidar_ext = [-2.502, -0.004, 2.033, 3.5, -0.2, 0 ]
lidar_ext = [0, 0, -0.3, -2.5, 0, 0]
radar_ext = [0.06, -0... | [
"os.mkdir",
"open3d.visualization.Visualizer",
"argparse.ArgumentParser",
"os.path.join",
"open3d.geometry.OrientedBoundingBox",
"open3d.geometry.PointCloud",
"open3d.io.read_point_cloud",
"os.path.exists",
"os.system",
"open3d.utility.Vector3dVector",
"numpy.array",
"numpy.loadtxt",
"pandas... | [((446, 471), 'open3d.geometry.PointCloud', 'o3d.geometry.PointCloud', ([], {}), '()\n', (469, 471), True, 'import open3d as o3d\n'), ((489, 520), 'open3d.utility.Vector3dVector', 'o3d.utility.Vector3dVector', (['pts'], {}), '(pts)\n', (515, 520), True, 'import open3d as o3d\n'), ((577, 619), 'scipy.spatial.transform.R... |
import numpy as np
from scipy.interpolate import interp1d
class Planktonic_agent:
'''
Hetta kemur at verða tær forskelligu Føstu lísnar
'''
def __init__(self, delta_time, save_time=40):
'''
:params:
born <NAME> # TODO Fjerna meg
save_time how many days we look b... | [
"numpy.ceil",
"numpy.floor",
"numpy.zeros",
"scipy.interpolate.interp1d",
"numpy.dot"
] | [((526, 553), 'numpy.zeros', 'np.zeros', (['cols'], {'dtype': 'float'}), '(cols, dtype=float)\n', (534, 553), True, 'import numpy as np\n'), ((671, 711), 'numpy.zeros', 'np.zeros', (['(save_time, cols)'], {'dtype': 'float'}), '((save_time, cols), dtype=float)\n', (679, 711), True, 'import numpy as np\n'), ((1270, 1349)... |
""" Module containing custom MPI functions """
import numpy as np
import sys
from os import getpid
from time import time
#from ...base.Error import Error as Err
def print_msg_mpi(aStr='', end='\n'):
"""Prints the str to sys.stdout and flushes the buffer so that printing is immediate
Parameters
----------... | [
"sys.stdout.write",
"numpy.full",
"numpy.size",
"os.getpid",
"numpy.abs",
"numpy.empty",
"numpy.asarray",
"numpy.ndim",
"numpy.cumsum",
"numpy.int",
"sys.stdout.flush",
"numpy.linalg.norm",
"numpy.reshape",
"numpy.int32",
"numpy.vstack",
"numpy.prod"
] | [((537, 565), 'sys.stdout.write', 'sys.stdout.write', (['(aStr + end)'], {}), '(aStr + end)\n', (553, 565), False, 'import sys\n'), ((570, 588), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (586, 588), False, 'import sys\n'), ((3198, 3206), 'os.getpid', 'getpid', ([], {}), '()\n', (3204, 3206), False, 'fro... |
import numpy as np
def make_zero(x):
mat = x
operation = []
for i,j in enumerate(mat):
if i==0 : continue
operation.append(f"R{i+1} -> {j[0]}*R1 - R{i+1}")
mat[i] = j[0]*mat[0] - j
return mat,operation
print(make_zero(np.array([[1,2],[3,4],[3,4],[5,9]]))[1])
def rank(x,y=None):
... | [
"numpy.array"
] | [((385, 396), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (393, 396), True, 'import numpy as np\n'), ((258, 300), 'numpy.array', 'np.array', (['[[1, 2], [3, 4], [3, 4], [5, 9]]'], {}), '([[1, 2], [3, 4], [3, 4], [5, 9]])\n', (266, 300), True, 'import numpy as np\n'), ((438, 449), 'numpy.array', 'np.array', (['x'],... |
from __future__ import print_function
import logging
import math
import sys
import numpy as np
import matplotlib.pyplot as plt
from .solution import Solution
class Animator:
def __init__(self, grid, tfinal):
self._grid = grid
self._tfinal = tfinal
plt.ion()
self._fig, (self._ax... | [
"numpy.zeros_like",
"math.ceil",
"logging.getLogger",
"matplotlib.pyplot.ion",
"numpy.min",
"numpy.max",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.subplots",
"sys.exit"
] | [((282, 291), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (289, 291), True, 'import matplotlib.pyplot as plt\n'), ((347, 365), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(3)', '(1)'], {}), '(3, 1)\n', (359, 365), True, 'import matplotlib.pyplot as plt\n'), ((3337, 3364), 'logging.getLogger', 'logging.ge... |
import json
import os
from typing import Any, Dict, Generator, List, Optional, Set, Tuple, Union
import qcelemental as qcel
import qcportal as ptl
import tqdm
from openforcefield import topology as off
from pydantic import PositiveInt, constr, validator
from qcfractal.interface import FractalClient
from qcportal.model... | [
"openeye.oedepict.OERenderMolecule",
"openeye.oedepict.OEPen",
"os.path.join",
"basis_set_exchange.get_metadata",
"openeye.oedepict.OE2DMolDisplayOptions",
"qcportal.models.KeywordSet",
"openforcefield.topology.Molecule.from_smiles",
"openeye.oechem.OEAtomBondSet",
"openeye.oedepict.OEPrepareDepicti... | [((10344, 10382), 'pydantic.constr', 'constr', ([], {'min_length': '(8)', 'regex': '"""[a-zA-Z]"""'}), "(min_length=8, regex='[a-zA-Z]')\n", (10350, 10382), False, 'from pydantic import PositiveInt, constr, validator\n'), ((10749, 10787), 'pydantic.constr', 'constr', ([], {'min_length': '(8)', 'regex': '"""[a-zA-Z]"""'... |
# imports
import os
from os.path import join
import numpy as np
import pandas as pd
from scipy.optimize import curve_fit
from scipy.interpolate import griddata, Akima1DInterpolator
from scipy.stats import norm
from scipy.stats import pearsonr, spearmanr
from sklearn.neighbors import KernelDensity
from sklearn.utils.fi... | [
"utils.plotting.lighten_color",
"numpy.abs",
"utils.io.read_calib_coords",
"numpy.floor",
"correction.correct.merge_calib_pid_defocus_and_correction_coords",
"matplotlib.pyplot.style.use",
"numpy.mean",
"utils.plotting.plot_particle_to_particle_similarity",
"matplotlib.pyplot.figure",
"analyze.eva... | [((932, 948), 'matplotlib.font_manager.FontProperties', 'FontProperties', ([], {}), '()\n', (946, 948), False, 'from matplotlib.font_manager import FontProperties\n'), ((975, 1023), 'matplotlib.pyplot.style.use', 'plt.style.use', (["['science', 'ieee', 'std-colors']"], {}), "(['science', 'ieee', 'std-colors'])\n", (988... |
#!/usr/bin/env python
'''This script plots tables as a pdf. The type of plot is determined
based on the columns in the input dataframe.'''
from __future__ import division
#Our standard Modules
import argparse
import numpy as np
import sys
import pandas as pd
import mpathic.utils as utils
import matplotlib.pyplot ... | [
"matplotlib.pyplot.title",
"weblogolib.colorscheme.ColorGroup",
"weblogolib.colorscheme.ColorScheme",
"numpy.isnan",
"matplotlib.pyplot.figure",
"scipy.optimize.newton",
"weblogolib.colorscheme.SymbolColor",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.subplots",
"pandas.concat",
"mpathic.ut... | [((502, 516), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (514, 516), True, 'import matplotlib.pyplot as plt\n'), ((613, 658), 'matplotlib.pyplot.title', 'plt.title', (['"""Zipf Frequency Plot"""'], {'fontsize': '(15)'}), "('Zipf Frequency Plot', fontsize=15)\n", (622, 658), True, 'import matplotlib... |
from __future__ import absolute_import
from typing import Union, Optional, List, Dict, Any, Tuple
import math
import numpy as np
import tensorflow as tf
from .factory import AbstractFactory, AbstractTensor, AbstractConstant, AbstractVariable, AbstractPlaceholder
from .shared import binarize, im2col
class PrimeTenso... | [
"tensorflow.random_uniform",
"math.log2",
"tensorflow.reduce_sum",
"tensorflow.cumsum",
"tensorflow.strided_slice",
"tensorflow.reshape",
"tensorflow.concat",
"tensorflow.constant",
"tensorflow.transpose",
"tensorflow.stack",
"tensorflow.placeholder",
"tensorflow.assign",
"tensorflow.Variabl... | [((3081, 3123), 'tensorflow.split', 'tf.split', (['self.value', 'num_split'], {'axis': 'axis'}), '(self.value, num_split, axis=axis)\n', (3089, 3123), True, 'import tensorflow as tf\n'), ((4900, 4945), 'tensorflow.constant', 'tf.constant', (['value'], {'dtype': 'factory.native_type'}), '(value, dtype=factory.native_typ... |
# -*- coding: utf-8 -*-
"""
# @Time : 23/10/18 9:10 PM
# @Author : <NAME>
# @FileName: fuzzy_control.py
# @Software: PyCharm
# @Github : https://github.com/hzm2016
"""
import matplotlib.pyplot as plt
import tensorflow as tf
import argparse
import numpy as np
import copy as cp
import skfuzzy.control as ctrl
from... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"skfuzzy.control.ControlSystemSimulation",
"numpy.meshgrid",
"numpy.zeros_like",
"matplotlib.pyplot.show",
"skfuzzy.control.Rule",
"skfuzzy.control.Antecedent",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.linspace",
"matplotlib.pypl... | [((580, 617), 'numpy.array', 'np.array', (['[-40, -40, -40, -5, -5, -5]'], {}), '([-40, -40, -40, -5, -5, -5])\n', (588, 617), True, 'import numpy as np\n'), ((647, 677), 'numpy.array', 'np.array', (['[40, 40, 0, 5, 5, 5]'], {}), '([40, 40, 0, 5, 5, 5])\n', (655, 677), True, 'import numpy as np\n'), ((707, 747), 'numpy... |
### This is inteded to be an easily modifiable VAE parent class for everyone who uses VAE-models
### Based on the pytorch lightning bolts VAE code
### neptune.AI support added (specifiy username and token in input var)
from argparse import ArgumentParser
import pytorch_lightning as pl
import torch
import torch.nn as ... | [
"seaborn.heatmap",
"argparse.ArgumentParser",
"systems.Mixture_of_gaussians.ResNet.ResNet18Dec",
"numpy.sum",
"torch.cat",
"torch.full",
"matplotlib.pyplot.figure",
"sklearn.metrics.f1_score",
"torch.std",
"torch.isnan",
"sys.path.append",
"neptune.init",
"pandas.DataFrame",
"torch.nn.init... | [((687, 711), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (702, 711), False, 'import sys\n'), ((1628, 1662), 'systems.ecgresnet_uncertainty.ECGResNetUncertaintySystem', 'ECGResNetUncertaintySystem', ([], {}), '(**args)\n', (1654, 1662), False, 'from systems.ecgresnet_uncertainty import E... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017, AGB & GC
# Full license can be found in License.md
# ----------------------------------------------------------------------------
""" Functions that specify the boundary location as a function of MLT
Functions
---------
circular(mlt, [r_add])
Retu... | [
"numpy.full",
"numpy.asarray",
"numpy.sin",
"ocbpy.ocb_time.hr2rad",
"numpy.cos"
] | [((1313, 1328), 'numpy.asarray', 'np.asarray', (['mlt'], {}), '(mlt)\n', (1323, 1328), True, 'import numpy as np\n'), ((1342, 1384), 'numpy.full', 'np.full', ([], {'shape': 'mlt.shape', 'fill_value': 'r_add'}), '(shape=mlt.shape, fill_value=r_add)\n', (1349, 1384), True, 'import numpy as np\n'), ((2510, 2521), 'ocbpy.o... |
# from mmdet.apis import init_detector, inference_detector
# import mmcv
# import cv2
# import demo1
# import numpy as np
# # Specify the path to model config and checkpoint file
# config_file = 'configs/hrnet/cascade_rcnn_hrnetv2p_w32_20e_coco.py'
# #checkpoint_file = 'work_dirs/cascade_rcnn_hrnetv2p_w32_20e_coco/lat... | [
"xml.dom.minidom.Document",
"os.path.basename",
"mmdet.apis.init_detector",
"mmdet.apis.inference_detector",
"cv2.imread",
"os.path.splitext",
"numpy.uint16",
"os.path.join"
] | [((9623, 9683), 'mmdet.apis.init_detector', 'init_detector', (['config_file', 'checkpoint_file'], {'device': '"""cuda:0"""'}), "(config_file, checkpoint_file, device='cuda:0')\n", (9636, 9683), False, 'from mmdet.apis import init_detector, inference_detector\n'), ((9802, 9863), 'mmdet.apis.init_detector', 'init_detecto... |
# encoding=utf8
# pylint: disable=mixed-indentation, trailing-whitespace, multiple-statements, attribute-defined-outside-init, logging-not-lazy, no-self-use, line-too-long, arguments-differ, bad-continuation
import logging
from numpy import apply_along_axis, zeros, argsort, concatenate, array, exp, cos, pi
from NiaPy... | [
"numpy.concatenate",
"logging.basicConfig",
"NiaPy.algorithms.algorithm.Algorithm.initPopulation",
"numpy.zeros",
"numpy.argsort",
"numpy.apply_along_axis",
"numpy.array",
"numpy.exp",
"numpy.cos",
"NiaPy.algorithms.algorithm.Algorithm.typeParameters",
"logging.getLogger",
"NiaPy.algorithms.al... | [((360, 381), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (379, 381), False, 'import logging\n'), ((391, 434), 'logging.getLogger', 'logging.getLogger', (['"""NiaPy.algorithms.basic"""'], {}), "('NiaPy.algorithms.basic')\n", (408, 434), False, 'import logging\n'), ((1627, 1653), 'NiaPy.algorithms.al... |
import os
from os.path import join
import numpy as np
from shutil import which
import pkg_resources
from .. import prepare
from .. import runstatus as rs
from .. import runinfo as ri
from .qsub import qsub
from .qsub import QUEUE_NAME
from .qstat import qstat
from ..tools import jsonlog
QSUB_OBS_PRODUCE_PREFIX = 'phs_... | [
"os.path.join",
"shutil.which",
"numpy.isnan"
] | [((503, 616), 'os.path.join', 'join', (['"""/"""', '"""home"""', '"""guest"""', '"""relleums"""', '"""fact_photon_stream"""', '"""fact-tools"""', '"""target"""', '"""fact-tools-0.18.1.jar"""'], {}), "('/', 'home', 'guest', 'relleums', 'fact_photon_stream', 'fact-tools',\n 'target', 'fact-tools-0.18.1.jar')\n", (507,... |
#!/usr/bin/env python
import sys
sys.path.append('../neural_networks')
import numpy as np
import numpy.matlib
import pickle
import copy
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import os
import time
import copy
from gym_collision_avoidance.envs.policies.CADRL.s... | [
"matplotlib.pyplot.title",
"numpy.arctan2",
"numpy.sum",
"numpy.amin",
"numpy.argmax",
"matplotlib.pyplot.clf",
"numpy.ones",
"numpy.clip",
"numpy.argpartition",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.linalg.norm",
"numpy.random.randint",
"matplotlib.pyplot.arrow",
"sys.path.app... | [((33, 70), 'sys.path.append', 'sys.path.append', (['"""../neural_networks"""'], {}), "('../neural_networks')\n", (48, 70), False, 'import sys\n'), ((1584, 1637), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', 'num_angles'], {'endpoint': '(False)'}), '(0, 2 * np.pi, num_angles, endpoint=False)\n', (1595, 1637... |
# support/Layer.py
import numpy as np
from support.AbstractLayer import Layers
class Layer(Layers): #weigth layer
def __init__(self, inputSize, outputSize):
self.weights = np.random.randn(inputSize, outputSize) * 0.1 # keep initial weights small
self.bias = np.random.rand(1, outputSize) * 0.1 # n... | [
"numpy.sum",
"numpy.random.randn",
"numpy.zeros",
"numpy.random.normal",
"numpy.random.rand",
"numpy.dot",
"numpy.sqrt"
] | [((1302, 1354), 'numpy.random.normal', 'np.random.normal', (['mu', 'sigma'], {'size': '(numrows, numcols)'}), '(mu, sigma, size=(numrows, numcols))\n', (1318, 1354), True, 'import numpy as np\n'), ((1903, 1931), 'numpy.zeros', 'np.zeros', (['(numrows, numcols)'], {}), '((numrows, numcols))\n', (1911, 1931), True, 'impo... |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 18 12:47:56 2020
@author: Sila
"""
# Monte Carlo methods, or Monte Carlo experiments, are a broad class of computational algorithms
# that rely on repeated random sampling to obtain numerical results.
import numpy as np
import math
import random
import matplotlib.pyplot ... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"math.sqrt",
"matplotlib.pyplot.axes",
"random.random",
"numpy.sin",
"numpy.linspace",
"numpy.cos"
] | [((436, 466), 'numpy.linspace', 'np.linspace', (['(0)', '(np.pi / 2)', '(100)'], {}), '(0, np.pi / 2, 100)\n', (447, 466), True, 'import numpy as np\n'), ((1570, 1580), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1578, 1580), True, 'import matplotlib.pyplot as plt\n'), ((1428, 1462), 'matplotlib.pyplot.plo... |
import cv2
import numpy as np
img = cv2.imread("resources/example.jpg")
kernal = np.ones((2, 2), np.uint8)
"""
What this function does it makes the edges of the picture thick
so that the canny function can process them in a better way, and also
numpy is used here in the kernal variable to do that main part which is ... | [
"cv2.Canny",
"cv2.dilate",
"cv2.waitKey",
"numpy.ones",
"cv2.imread",
"cv2.imshow"
] | [((37, 72), 'cv2.imread', 'cv2.imread', (['"""resources/example.jpg"""'], {}), "('resources/example.jpg')\n", (47, 72), False, 'import cv2\n'), ((82, 107), 'numpy.ones', 'np.ones', (['(2, 2)', 'np.uint8'], {}), '((2, 2), np.uint8)\n', (89, 107), True, 'import numpy as np\n'), ((441, 465), 'cv2.Canny', 'cv2.Canny', (['i... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 21 15:21:36 2019
@author: rakshit
"""
# Confirmed code works perfectly. Do not display.
import os
import cv2
import sys
import json
import argparse
import matplotlib
import numpy as np
import deepdish as dd
import scipy.io as scio
from matplotlib.pa... | [
"helperfunctions.generateEmptyStorage",
"numpy.sum",
"argparse.ArgumentParser",
"numpy.ones",
"helperfunctions.my_ellipse",
"helperfunctions.getValidPoints",
"matplotlib.get_backend",
"os.path.join",
"helperfunctions.ransac",
"sys.path.append",
"numpy.zeros_like",
"numpy.max",
"matplotlib.py... | [((390, 411), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (405, 411), False, 'import sys\n'), ((928, 953), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (951, 953), False, 'import argparse\n'), ((1675, 1684), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (1682... |
import numpy as np
import math
from matplotlib import cm
from matplotlib.colors import ListedColormap
from losses import binaryNegLikelihood
from tensorflow import keras
from data_read import get_toy_paths, get_TPS_and_TIS_paths
class Const():
def __init__(self, dataSetType):
self._dataSetType = dataSetTy... | [
"matplotlib.cm.get_cmap",
"tensorflow.keras.losses.MeanAbsoluteError",
"numpy.linspace",
"math.log",
"numpy.vstack"
] | [((12325, 12358), 'matplotlib.cm.get_cmap', 'cm.get_cmap', (['"""summer"""', 'resolution'], {}), "('summer', resolution)\n", (12336, 12358), False, 'from matplotlib import cm\n'), ((12495, 12519), 'matplotlib.cm.get_cmap', 'cm.get_cmap', (['"""Greys"""', '(10)'], {}), "('Greys', 10)\n", (12506, 12519), False, 'from mat... |
from distutils.core import setup, Extension
import os
import numpy
H2PACK_DIR = ".."
OPENBLAS_INSTALL_DIR = "/usr/local/opt/openblas"
#C_DIR = "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
extra_cflags = ["-I"+H2PACK_DIR+"/include"]
extra_cflags += ["-I"+OPENBLAS_INSTALL_DIR+"/include"]
extra_cfl... | [
"numpy.get_include"
] | [((975, 994), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (992, 994), False, 'import numpy\n')] |
"""
"""
import numpy as np
from ..probabilistic_binning import fuzzy_digitize
__all__ = ('test1', )
def test1():
""" Enforce assigned centroid span the sensible range
"""
npts = int(1e5)
x = np.random.uniform(-1, 1, npts)
nbins = 100
centroids = np.linspace(-2, 2, nbins)
centroid_number... | [
"numpy.random.uniform",
"numpy.count_nonzero",
"numpy.all",
"numpy.any",
"numpy.mean",
"numpy.random.randint",
"numpy.linspace",
"numpy.unique"
] | [((211, 241), 'numpy.random.uniform', 'np.random.uniform', (['(-1)', '(1)', 'npts'], {}), '(-1, 1, npts)\n', (228, 241), True, 'import numpy as np\n'), ((274, 299), 'numpy.linspace', 'np.linspace', (['(-2)', '(2)', 'nbins'], {}), '(-2, 2, nbins)\n', (285, 299), True, 'import numpy as np\n'), ((410, 439), 'numpy.all', '... |
"""
@author: LXA
Date: 2020 年 5 月 31 日
"""
import os
import sys
import tensorflow as tf
import numpy as np
import matplotlib
import platform
import shutil
import time
import DNN_base
import DNN_tools
import General_Laplace
import MS_LaplaceEqs
import MS_BoltzmannEqs
import Load_data2Mat
import DNN_da... | [
"os.mkdir",
"tensorflow.square",
"tensorflow.reduce_sum",
"DNN_tools.print_and_log_train_one_epoch",
"tensorflow.reshape",
"tensorflow.ConfigProto",
"tensorflow.multiply",
"tensorflow.Variable",
"numpy.random.randint",
"numpy.arange",
"numpy.mean",
"DNN_Print_Log.dictionary_out2file",
"os.pa... | [((767, 896), 'DNN_Print_Log.dictionary_out2file', 'DNN_Print_Log.dictionary_out2file', (['R', 'log_fileout_NN'], {'actName2normal': "R['act_name2Normal']", 'actName2scale': "R['act_name2Scale']"}), "(R, log_fileout_NN, actName2normal=R[\n 'act_name2Normal'], actName2scale=R['act_name2Scale'])\n", (800, 896), False,... |
# 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 by appli... | [
"paddle.nn.Dropout",
"paddle.enable_static",
"paddle.static.program_guard",
"paddle.set_flags",
"paddle.device.cuda.graphs.is_cuda_graph_supported",
"paddle.device.cuda.graphs.cuda_graph_transform",
"unittest.main",
"paddle.optimizer.SGD",
"paddle.nn.GELU",
"paddle.seed",
"paddle.device.cuda.gra... | [((785, 807), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (805, 807), False, 'import paddle\n'), ((3830, 3845), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3843, 3845), False, 'import unittest\n'), ((949, 977), 'paddle.nn.Linear', 'nn.Linear', (['in_size', 'out_size'], {}), '(in_size, out... |
#%%
import os
import json
import pathlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from collections import defaultdict
def tsplot(d, x=None, ax=None, label=None, color=None, ci=True):
if ax is None:
ax = plt
line = d.mean(0)
std = d.std(0)
if x is None:
x =... | [
"numpy.stack",
"json.load",
"numpy.array"
] | [((2111, 2127), 'numpy.stack', 'np.stack', (['values'], {}), '(values)\n', (2119, 2127), True, 'import numpy as np\n'), ((2140, 2155), 'numpy.stack', 'np.stack', (['times'], {}), '(times)\n', (2148, 2155), True, 'import numpy as np\n'), ((2168, 2183), 'numpy.stack', 'np.stack', (['steps'], {}), '(steps)\n', (2176, 2183... |
"""
misc_plots.py
This script contains miscellanous plotting functions.
Authors: <NAME>
Date: January, 2021
Note: this code uses python 3.7.
"""
import logging
import numpy as np
import pandas as pd
from util import logger_util, gen_util, plot_util
from sess_util import sess_plot_util
from plot_fcts import plot_... | [
"util.plot_util.plot_errorbars",
"numpy.concatenate",
"numpy.asarray",
"plot_fcts.plot_helper_fcts.get_line_plane_idxs",
"util.gen_util.accepted_values_error",
"sess_util.sess_plot_util.fig_init_linpla",
"util.plot_util.init_fig",
"sess_util.sess_plot_util.format_linpla_subaxes",
"util.plot_util.set... | [((353, 380), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (370, 380), False, 'import logging\n'), ((2230, 2430), 'plot_fcts.seq_plots.plot_sess_data', 'seq_plots.plot_sess_data', (['scores_df'], {'analyspar': 'analyspar', 'sesspar': 'sesspar', 'permpar': 'permpar', 'figpar': 'figpar', ... |
# -*- coding: utf8 -*-
# Copyright 2019 JSALT2019 Distant Supervision Team
#
# 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
#
# U... | [
"ptvsd.enable_attach",
"torch.cat",
"numpy.argmin",
"matplotlib.pyplot.figure",
"torch.std",
"numpy.isclose",
"torch.arange",
"torch.nn.utils.rnn.pad_packed_sequence",
"numpy.arange",
"numpy.unique",
"argparse.ArgumentTypeError",
"torch.ones",
"logging.log",
"torch.nn.Linear",
"torch.zer... | [((4872, 4913), 'logging.log', 'logging.log', (['level', "(msg + ' ' + extra_msg)"], {}), "(level, msg + ' ' + extra_msg)\n", (4883, 4913), False, 'import logging\n'), ((11144, 11192), 'torch.arange', 'torch.arange', (['mask_length'], {'device': 'lengths.device'}), '(mask_length, device=lengths.device)\n', (11156, 1119... |
import numpy as np
from utils import mean_err
def variance(X):
cov = np.cov(X.T)
var = np.trace(cov)/cov.shape[0]
# var = np.mean(np.var(X, axis=0))
# var = np.linalg.det(cov)
# var = var**(1./cov.shape[0])
return var
def rdiv(X_train, X_gen):
''' Relative div '''
X_train = np.squeeze(X_... | [
"numpy.random.uniform",
"numpy.trace",
"utils.mean_err",
"numpy.zeros",
"numpy.ones",
"numpy.squeeze",
"numpy.cov"
] | [((75, 86), 'numpy.cov', 'np.cov', (['X.T'], {}), '(X.T)\n', (81, 86), True, 'import numpy as np\n'), ((307, 326), 'numpy.squeeze', 'np.squeeze', (['X_train'], {}), '(X_train)\n', (317, 326), True, 'import numpy as np\n'), ((1029, 1040), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (1037, 1040), True, 'import numpy... |
import cv2
import numpy as np
from preprocess_inputs import pose_estimation, text_detection, car_meta
# Image locations
POSE_IMAGE = cv2.imread("images/sitting-on-car.jpg")
TEXT_IMAGE = cv2.imread("images/sign.jpg")
CAR_IMAGE = cv2.imread("images/blue-car.jpg")
# Test names
test_names = ["Pose Estimation", "Text Det... | [
"numpy.array_equal",
"cv2.imread",
"cv2.resize"
] | [((135, 174), 'cv2.imread', 'cv2.imread', (['"""images/sitting-on-car.jpg"""'], {}), "('images/sitting-on-car.jpg')\n", (145, 174), False, 'import cv2\n'), ((188, 217), 'cv2.imread', 'cv2.imread', (['"""images/sign.jpg"""'], {}), "('images/sign.jpg')\n", (198, 217), False, 'import cv2\n'), ((230, 263), 'cv2.imread', 'c... |
import cv2
import imutils
import numpy as np
from frigate.config import MotionConfig
class MotionDetector:
def __init__(self, frame_shape, config: MotionConfig):
self.config = config
self.frame_shape = frame_shape
self.resize_factor = frame_shape[0] / config.frame_height
self.motio... | [
"cv2.findContours",
"cv2.contourArea",
"cv2.bitwise_and",
"cv2.dilate",
"cv2.cvtColor",
"cv2.accumulateWeighted",
"cv2.threshold",
"cv2.vconcat",
"numpy.zeros",
"cv2.imwrite",
"numpy.clip",
"numpy.percentile",
"cv2.rectangle",
"numpy.where",
"cv2.convertScaleAbs",
"imutils.grab_contour... | [((473, 515), 'numpy.zeros', 'np.zeros', (['self.motion_frame_size', 'np.float'], {}), '(self.motion_frame_size, np.float)\n', (481, 515), True, 'import numpy as np\n'), ((541, 583), 'numpy.zeros', 'np.zeros', (['self.motion_frame_size', 'np.float'], {}), '(self.motion_frame_size, np.float)\n', (549, 583), True, 'impor... |
#!/usr/bin/env python
# coding=utf-8
try:
import mock
except ImportError:
import unittest.mock as mock
import numpy as np
from marvin_image_classification_engine.training import MetricsEvaluator
@mock.patch('marvin_image_classification_engine.training.metrics_evaluator.sk_metrics.accuracy_score')
@mock.pat... | [
"unittest.mock.patch",
"numpy.array",
"unittest.mock.MagicMock",
"marvin_image_classification_engine.training.MetricsEvaluator"
] | [((209, 320), 'unittest.mock.patch', 'mock.patch', (['"""marvin_image_classification_engine.training.metrics_evaluator.sk_metrics.accuracy_score"""'], {}), "(\n 'marvin_image_classification_engine.training.metrics_evaluator.sk_metrics.accuracy_score'\n )\n", (219, 320), True, 'import unittest.mock as mock\n'), ((... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.