code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import math
import random
import logging
import pickle
import numpy as np
import sklearn
from data import FaceImageIter
import mxnet as mx
from mxnet import ndarray as nd
import argparse
im... | [
"numpy.abs",
"argparse.ArgumentParser",
"numpy.sum",
"numpy.argmax",
"fresnet.get_symbol",
"fmobilenet.get_symbol",
"mxnet.io.PrefetchingIter",
"mxnet.optimizer.SGD",
"os.path.join",
"mxnet.sym.BlockGrad",
"mxnet.callback.Speedometer",
"os.path.dirname",
"os.path.exists",
"mxnet.gpu",
"m... | [((484, 503), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (501, 503), False, 'import logging\n'), ((3241, 3298), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train face network"""'}), "(description='Train face network')\n", (3264, 3298), False, 'import argparse\n'), ((6... |
#
from __future__ import division
import timeit
import time
from math import sqrt
from numpy import concatenate
import matplotlib.pyplot as plt
from pandas import read_csv
from pandas import DataFrame
from pandas import concat
from sklearn.metrics import mean_squared_error
from sklearn import preprocessing
import nump... | [
"keras.models.load_model",
"pandas.read_csv",
"sklearn.preprocessing.MinMaxScaler",
"numpy.argsort",
"os.path.isfile",
"pickle.load",
"pandas.DataFrame",
"os.path.exists",
"random.seed",
"pandas.concat",
"keras.callbacks.ModelCheckpoint",
"keras.layers.Dropout",
"numpy.min",
"numpy.concate... | [((2622, 2652), 'numpy.array', 'np.array', (['data.loc[:, Ut_list]'], {}), '(data.loc[:, Ut_list])\n', (2630, 2652), True, 'import numpy as np\n'), ((2673, 2701), 'sklearn.preprocessing.MinMaxScaler', 'preprocessing.MinMaxScaler', ([], {}), '()\n', (2699, 2701), False, 'from sklearn import preprocessing\n'), ((3394, 34... |
# This code is written at BigVision LLC. It is based on the OpenCV project. It is subject to the license terms in the LICENSE file found in this distribution and at http://opencv.org/license.html
# Usage example: python3 object_detection_yolo.py --video=run.mp4 --device 'cpu'
# python3 object_detectio... | [
"win32gui.ClientToScreen",
"argparse.ArgumentParser",
"cv2.dnn.NMSBoxes",
"numpy.argmax",
"pyautogui.screenshot",
"os.path.isfile",
"cv2.rectangle",
"win32gui.SetForegroundWindow",
"requests.post",
"cv2.imshow",
"telebot.TeleBot",
"cv2.getTickFrequency",
"cv2.dnn.blobFromImage",
"datetime.... | [((1220, 1285), 'telebot.TeleBot', 'telebot.TeleBot', (['"""2002045567:AAFBWxp3Fpxf9OdhRFm8HxCUMvAhuZVLwq4"""'], {}), "('2002045567:AAFBWxp3Fpxf9OdhRFm8HxCUMvAhuZVLwq4')\n", (1235, 1285), False, 'import telebot\n'), ((1418, 1474), 'ftplib.FTP', 'FTP', (['"""172.16.58.3"""'], {'user': '"""taxiuser"""', 'passwd': '"""<PA... |
import netCDF4
import bisect
import warnings
from collections import OrderedDict
import numpy as np
from kid_readout.roach.tools import ntone_power_correction
import kid_readout.analysis.timeseries.fftfilt
from kid_readout.measurement.io.data_block import lpf
import kid_readout.roach.tools
class TimestreamGroup(obj... | [
"netCDF4.Dataset",
"numpy.zeros_like",
"numpy.flatnonzero",
"numpy.zeros",
"kid_readout.roach.tools.ntone_power_correction",
"numpy.where",
"numpy.arange",
"collections.OrderedDict",
"warnings.warn",
"bisect.bisect_left"
] | [((5280, 5336), 'numpy.zeros', 'np.zeros', (['indexes_to_calculate.shape[0]'], {'dtype': '"""complex"""'}), "(indexes_to_calculate.shape[0], dtype='complex')\n", (5288, 5336), True, 'import numpy as np\n'), ((6564, 6599), 'netCDF4.Dataset', 'netCDF4.Dataset', (['filename'], {'mode': '"""r"""'}), "(filename, mode='r')\n... |
import os
import csv
from PIL import Image
import numpy as np
import torch
import torch.utils.data as data
from torchvision import datasets, transforms
import params
class COVID19_Dataset(Dataset):
"""
COVID-19 image data collection
Dataset: https://github.com/ieee8023/covid-chestxray-dataset
... | [
"numpy.random.seed",
"numpy.asarray",
"os.path.join"
] | [((422, 481), 'os.path.join', 'os.path.join', (['thispath', '"""covid-chestxray-dataset"""', '"""images"""'], {}), "(thispath, 'covid-chestxray-dataset', 'images')\n", (434, 481), False, 'import os\n'), ((509, 574), 'os.path.join', 'os.path.join', (['thispath', '"""covid-chestxray-dataset"""', '"""metadata.csv"""'], {}... |
'''
Created on Mar 13, 2012
.. codeauthor:: jhkwakkel <j.h.kwakkel (at) tudelft (dot) nl>
'''
import unittest
import numpy as np
import pandas as pd
from ema_workbench.analysis import prim
from ema_workbench.analysis.prim import PrimBox
from test import utilities
from ema_workbench.analysis.scenario_discovery_util i... | [
"test.utilities.load_flu_data",
"numpy.abs",
"numpy.ones",
"ema_workbench.analysis.prim.PrimBox",
"numpy.random.randint",
"numpy.arange",
"unittest.main",
"pandas.DataFrame",
"ema_workbench.analysis.prim.Prim",
"numpy.max",
"ema_workbench.analysis.prim.setup_prim",
"numpy.min",
"pandas.Serie... | [((546, 571), 'numpy.zeros', 'np.zeros', (['result.shape[0]'], {}), '(result.shape[0])\n', (554, 571), True, 'import numpy as np\n'), ((813, 854), 'numpy.abs', 'np.abs', (['(outcome[:, 1:] - outcome[:, 0:-1])'], {}), '(outcome[:, 1:] - outcome[:, 0:-1])\n', (819, 854), True, 'import numpy as np\n'), ((876, 898), 'numpy... |
import sys, os, glob
import pandas as pd, numpy as np
import ujson
import datetime
from ast import literal_eval
from get_workflow_info import get_workflow_info, get_class_cols, translate_non_alphanumerics, get_short_slug
################################################################################
# Jailbreak ... | [
"pandas.DataFrame",
"numpy.zeros_like",
"get_workflow_info.get_class_cols",
"numpy.ones_like",
"get_workflow_info.translate_non_alphanumerics",
"pandas.Series",
"ast.literal_eval",
"datetime.datetime.now"
] | [((2197, 2216), 'pandas.Series', 'pd.Series', (['theclass'], {}), '(theclass)\n', (2206, 2216), True, 'import pandas as pd, numpy as np\n'), ((6722, 6744), 'pandas.DataFrame', 'pd.DataFrame', (['subj_ans'], {}), '(subj_ans)\n', (6734, 6744), True, 'import pandas as pd, numpy as np\n'), ((9013, 9030), 'pandas.DataFrame'... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"unittest.main",
"jax.numpy.dot",
"objax.zoo.dnnet.DNNet",
"numpy.zeros",
"numpy.ones",
"objax.nn.Conv2D",
"objax.nn.BatchNorm2D",
"jax.numpy.ones",
"jax.numpy.zeros",
"objax.functional.loss.cross_entropy_logits_sparse",
"objax.util.find_used_variables"
] | [((758, 769), 'jax.numpy.zeros', 'jn.zeros', (['(5)'], {}), '(5)\n', (766, 769), True, 'import jax.numpy as jn\n'), ((797, 808), 'jax.numpy.zeros', 'jn.zeros', (['(1)'], {}), '(1)\n', (805, 808), True, 'import jax.numpy as jn\n'), ((5718, 5733), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5731, 5733), False, '... |
import numpy as np
from ..testing_utils import DummyConverter, DummyLoad, DummyNoise, DummyOdeSolver, DummyVoltageSupply, DummyElectricMotor,\
mock_instantiate, instantiate_dict
from gym_electric_motor.physical_systems import physical_systems as ps, converters as cv, electric_motors as em,\
mechanical_loads as ... | [
"numpy.zeros_like",
"numpy.concatenate",
"numpy.zeros",
"numpy.array",
"numpy.arange",
"numpy.random.rand",
"numpy.all"
] | [((2433, 2464), 'numpy.all', 'np.all', (['(initial_state == target)'], {}), '(initial_state == target)\n', (2439, 2464), True, 'import numpy as np\n'), ((3391, 3408), 'numpy.random.rand', 'np.random.rand', (['(4)'], {}), '(4)\n', (3405, 3408), True, 'import numpy as np\n'), ((3520, 3537), 'numpy.random.rand', 'np.rando... |
#coding=utf-8
'''
Created on 2016年9月27日
@author: dengdan
'''
import numpy as np
import time
import random
rng = np.random.RandomState(int(time.time()))
rand = np.random.rand
"""
Create an array of the given shape and populate it with random samples from a uniform distribution over [0, 1)
"""
def normal(shape, mu =... | [
"random.sample",
"random.shuffle",
"time.time",
"numpy.array",
"numpy.sqrt"
] | [((433, 462), 'numpy.array', 'np.array', (['tensor'], {'dtype': 'dtype'}), '(tensor, dtype=dtype)\n', (441, 462), True, 'import numpy as np\n'), ((799, 818), 'random.shuffle', 'random.shuffle', (['lst'], {}), '(lst)\n', (813, 818), False, 'import random\n'), ((851, 872), 'random.sample', 'random.sample', (['lst', 'n'],... |
# Import the libraries we need for this lab
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from torch.utils.data import Dataset, DataLoader
# Plot the data
def plot_decision_regions_2class(model,data... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"torch.nn.BCELoss",
"matplotlib.pyplot.plot",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.legend",
"torch.randn",
"matplotlib.pyplot.subplots",
"torch.Tensor",
"numpy.arange",
"matplotlib.pyplot.pcolormesh",
"torch.nn.Linear",
"torch... | [((4111, 4123), 'torch.nn.BCELoss', 'nn.BCELoss', ([], {}), '()\n', (4121, 4123), True, 'import torch.nn as nn\n'), ((4206, 4248), 'torch.utils.data.DataLoader', 'DataLoader', ([], {'dataset': 'data_set', 'batch_size': '(1)'}), '(dataset=data_set, batch_size=1)\n', (4216, 4248), False, 'from torch.utils.data import Dat... |
import os
import sys
os.environ["OMP_NUM_THREADS"] = "1"
import tensorflow as tf
import numpy as np
import time
n = 8192
dtype = tf.float32
with tf.device("/gpu:0"):
matrix1 = tf.Variable(tf.ones((n, n), dtype=dtype))
matrix2 = tf.Variable(tf.ones((n, n), dtype=dtype))
product = tf.matmul(matrix1, matrix... | [
"tensorflow.ones",
"tensorflow.global_variables_initializer",
"tensorflow.device",
"tensorflow.Session",
"numpy.ones",
"tensorflow.OptimizerOptions",
"time.time",
"tensorflow.matmul",
"numpy.matmul"
] | [((500, 525), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (510, 525), True, 'import tensorflow as tf\n'), ((626, 637), 'time.time', 'time.time', ([], {}), '()\n', (635, 637), False, 'import time\n'), ((690, 701), 'time.time', 'time.time', ([], {}), '()\n', (699, 701), False, 'im... |
# Modulos
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
np.set_printoptions(suppress=True)
# Declaracion de clases
class Adeline:
def __init__(self, r, landa, training_type, iter):
self.iter = iter
self.training_type = train... | [
"numpy.random.uniform",
"numpy.set_printoptions",
"sklearn.model_selection.train_test_split",
"numpy.zeros",
"numpy.transpose",
"numpy.array",
"numpy.exp",
"sklearn.metrics.mean_squared_error"
] | [((129, 163), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (148, 163), True, 'import numpy as np\n'), ((1979, 2002), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (1996, 2002), True, 'import numpy as np\n'), ((2304, 2317), 'numpy.ar... |
# -*- coding: utf-8 -*-
import pandas as pd
# Read in track metadata with genre labels
tracks = pd.read_csv('datasets/fma-rock-vs-hiphop.csv')
# Read in track metrics with the features
echonest_metrics = pd.read_json('datasets/echonest-metrics.json', precise_float=True)
# Merge the relevant columns of tracks and ec... | [
"sklearn.preprocessing.StandardScaler",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.model_selection.cross_val_score",
"pandas.read_json",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.metrics.classification_report",
"numpy.cumsum",
"sklearn.linear_model.LogisticRegressi... | [((98, 144), 'pandas.read_csv', 'pd.read_csv', (['"""datasets/fma-rock-vs-hiphop.csv"""'], {}), "('datasets/fma-rock-vs-hiphop.csv')\n", (109, 144), True, 'import pandas as pd\n'), ((207, 273), 'pandas.read_json', 'pd.read_json', (['"""datasets/echonest-metrics.json"""'], {'precise_float': '(True)'}), "('datasets/echon... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from data_worker.data_worker import combine_batches, split_into_batches, \
unpickle, unpack_data, display_img
from torch_lib.Interface import Interface
from torch_lib.Nets import MediumNet
from torch_lib.data_worker import suit4p... | [
"data_worker.data_worker.unpack_data",
"numpy.argmax",
"data_worker.data_worker.unpickle",
"data_worker.data_worker.combine_batches",
"torch_lib.Interface.Interface",
"torch_lib.data_worker.suit4pytorch",
"torch_lib.Nets.MediumNet",
"data_worker.data_worker.split_into_batches"
] | [((833, 866), 'data_worker.data_worker.combine_batches', 'combine_batches', (['unpacked_batches'], {}), '(unpacked_batches)\n', (848, 866), False, 'from data_worker.data_worker import combine_batches, split_into_batches, unpickle, unpack_data, display_img\n'), ((911, 938), 'data_worker.data_worker.split_into_batches', ... |
'''
<NAME> 2012-2013
<<EMAIL>>
'''
import numpy as np
import scipy.io as sio
def create_icosahedron(height=1.,payloadR=0.3):
'''
Creates a tensegrity icosahedron
'''
#create points
points = np.zeros((3,2*6+2))
phi = (1+np.sqrt(5))*0.5
offest = 0.792
points[:,0] = (-phi,0,1*offest)
... | [
"numpy.eye",
"numpy.zeros",
"numpy.sqrt"
] | [((214, 238), 'numpy.zeros', 'np.zeros', (['(3, 2 * 6 + 2)'], {}), '((3, 2 * 6 + 2))\n', (222, 238), True, 'import numpy as np\n'), ((1188, 1216), 'numpy.zeros', 'np.zeros', (['(6 + 1, 6 * 2 + 2)'], {}), '((6 + 1, 6 * 2 + 2))\n', (1196, 1216), True, 'import numpy as np\n'), ((1228, 1241), 'numpy.eye', 'np.eye', (['(6 +... |
import numpy as np
import pandas as pd
def Preprc(raw_data: object, flag: object = 0) -> object:
"""
Function to compute the decoded values in motionsense HRV sensors and
interploate the timestamps given the decoded sequence numbers
:param raw_data:
:param flag:
:return:
"""
# process... | [
"numpy.stack",
"pandas.DataFrame",
"numpy.uint8",
"numpy.copy",
"numpy.zeros",
"numpy.diff",
"numpy.where"
] | [((493, 517), 'numpy.copy', 'np.copy', (['data_arr2[:, 1]'], {}), '(data_arr2[:, 1])\n', (500, 517), True, 'import numpy as np\n'), ((552, 564), 'numpy.diff', 'np.diff', (['seq'], {}), '(seq)\n', (559, 564), True, 'import numpy as np\n'), ((2056, 2077), 'numpy.zeros', 'np.zeros', (['num_samples'], {}), '(num_samples)\n... |
#/usr/bin/env python3
import numpy as np
# Try importing matplotlib; if it works show a plot of generated data
try:
import matplotlib.pyplot as plt
except ImportError:
MAKE_PLOT = False
else:
MAKE_PLOT = True
FILTERSIZE = 50
def smooth(x, window_len=11, window='hanning'):
"""smooth the data using a... | [
"numpy.random.rand",
"matplotlib.pyplot.show",
"numpy.ones"
] | [((2053, 2075), 'numpy.random.rand', 'np.random.rand', (['(360000)'], {}), '(360000)\n', (2067, 2075), True, 'import numpy as np\n'), ((1890, 1914), 'numpy.ones', 'np.ones', (['window_len', '"""d"""'], {}), "(window_len, 'd')\n", (1897, 1914), True, 'import numpy as np\n'), ((2301, 2311), 'matplotlib.pyplot.show', 'plt... |
from __future__ import annotations
from typing import Tuple, NoReturn
from ...base import BaseEstimator
import numpy as np
from itertools import product
class DecisionStump(BaseEstimator):
"""
A decision stump classifier for {-1,1} labels according to the CART algorithm
Attributes
----------
self... | [
"numpy.full",
"numpy.tril_indices",
"numpy.abs",
"numpy.argmax",
"numpy.argsort",
"numpy.sign"
] | [((2399, 2422), 'numpy.full', 'np.full', (['X.shape[0]', '(-1)'], {}), '(X.shape[0], -1)\n', (2406, 2422), True, 'import numpy as np\n'), ((3600, 3618), 'numpy.argsort', 'np.argsort', (['values'], {}), '(values)\n', (3610, 3618), True, 'import numpy as np\n'), ((3758, 3790), 'numpy.full', 'np.full', (['(size, size + 1)... |
import torch
import torch.nn as nn
from numpy.random import random_sample
def make_rand_coords(input_size=(256,256,256), patch_size=(64,64,64)):
return [get_dims(input_size[0] - patch_size[0]), \
get_dims(input_size[1] - patch_size[1]), \
get_dims(input_size[2] - patch_size[2])]
def get_di... | [
"torch.nn.PReLU",
"numpy.random.random_sample",
"torch.nn.Conv3d",
"model.VNetAttention.EncoderBlock",
"model.VNetAttention.BottleNeck",
"torch.nn.GroupNorm",
"model.VNetSE.DecoderBlock",
"torchsummary.summary",
"model.VNetSE.BottleNeck",
"model.VNetSE.EncoderBlock",
"torch.device",
"model.VNe... | [((3296, 3316), 'model.VNetSE.EncoderBlock', 'EncoderBlock', (['params'], {}), '(params)\n', (3308, 3316), False, 'from model.VNetSE import EncoderBlock, BottleNeck, DecoderBlock\n'), ((3550, 3570), 'model.VNetSE.EncoderBlock', 'EncoderBlock', (['params'], {}), '(params)\n', (3562, 3570), False, 'from model.VNetSE impo... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import pytest
import numpy as np
import scipy.sparse as sparse
import cntk as C
csr... | [
"cntk.ops.tests.ops_test_utils.cntk_device",
"cntk.input",
"cntk.asvalue",
"cntk.tests.test_utils._to_csr",
"numpy.asarray",
"cntk.cpu",
"cntk.parameter",
"pytest.raises",
"numpy.array",
"cntk.tests.test_utils._to_dense",
"numpy.array_equal",
"pytest.mark.parametrize",
"cntk.internal._value_... | [((3041, 3169), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""data, num_of_dynamic_axes, expected_value_shape, expected_array_shapes"""', 'DENSE_CONFIGURATIONS'], {}), "(\n 'data, num_of_dynamic_axes, expected_value_shape, expected_array_shapes',\n DENSE_CONFIGURATIONS)\n", (3064, 3169), False, 'imp... |
# MIT License
#
# Copyright (c) 2019-2021 Tskit Developers
#
# 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, modif... | [
"msprime.RecombinationMap.uniform_map",
"numpy.empty",
"numpy.ones",
"msprime.InfiniteSites",
"numpy.arange",
"pytest.mark.parametrize",
"pytest.mark.skip",
"numpy.zeros_like",
"random.randint",
"pytest.warns",
"tskit.TableCollection",
"itertools.permutations",
"itertools.zip_longest",
"py... | [((1739, 1767), 'tests.test_highlevel.get_example_tree_sequences', 'get_example_tree_sequences', ([], {}), '()\n', (1765, 1767), False, 'from tests.test_highlevel import get_example_tree_sequences\n'), ((2312, 2365), 'numpy.zeros', 'np.zeros', (['(ts.num_nodes, ts.num_sites)'], {'dtype': 'np.int8'}), '((ts.num_nodes, t... |
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modif... | [
"numpy.isin",
"sys.path.remove",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"numpy.logical_and",
"scripts.DrawCameras.camera_draw",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.scatter",
"numpy.eye",
"numpy.zeros",
"numpy.transpose",
"numpy.identity",
"numpy.where",
"numpy.array"... | [((2049, 2144), 'numpy.array', 'np.array', (['[[568.996140852, 0, 643.21055941], [0, 568.988362396, 477.982801038], [0, 0, 1]\n ]'], {}), '([[568.996140852, 0, 643.21055941], [0, 568.988362396, \n 477.982801038], [0, 0, 1]])\n', (2057, 2144), True, 'import numpy as np\n'), ((2240, 2284), 'numpy.array', 'np.array'... |
import numpy as _np
from openpnm.utils import Docorator
__all__ = ["pore_coords"]
docstr = Docorator()
@docstr.dedent
def pore_coords(target):
r"""
Calculate throat centroid values by averaging adjacent pore coordinates
Parameters
----------
%(models.target.parameters)s
Returns
-------... | [
"numpy.mean",
"openpnm.utils.Docorator"
] | [((93, 104), 'openpnm.utils.Docorator', 'Docorator', ([], {}), '()\n', (102, 104), False, 'from openpnm.utils import Docorator\n'), ((567, 598), 'numpy.mean', '_np.mean', (['coords[conns]'], {'axis': '(1)'}), '(coords[conns], axis=1)\n', (575, 598), True, 'import numpy as _np\n')] |
import numpy as np
from ldpc import bposd_decoder
from panqec.codes import StabilizerCode
from panqec.error_models import BaseErrorModel
from panqec.decoders import BaseDecoder
class BeliefPropagationOSDDecoder(BaseDecoder):
label = 'BP-OSD decoder'
def __init__(self,
code: StabilizerCode,
... | [
"numpy.zeros",
"time.time",
"numpy.random.default_rng",
"numpy.hstack",
"numpy.array",
"panqec.error_models.PauliErrorModel",
"panqec.codes.XCubeCode",
"ldpc.bposd_decoder",
"numpy.concatenate"
] | [((5722, 5745), 'numpy.random.default_rng', 'np.random.default_rng', ([], {}), '()\n', (5743, 5745), True, 'import numpy as np\n'), ((5769, 5787), 'panqec.codes.XCubeCode', 'XCubeCode', (['L', 'L', 'L'], {}), '(L, L, L)\n', (5778, 5787), False, 'from panqec.codes import XCubeCode\n'), ((5866, 5896), 'panqec.error_model... |
import numpy as np
import pandas as pd
import random
from sklearn.model_selection import train_test_split
class SVM:
def __init__(self, max_iterations=1000, C=1, epsilon=0.001):
self.max_iterations = max_iterations
self.C = C
self.epsilon = epsilon
def fit(self, X, y):
# Ens... | [
"numpy.sum",
"random.randint",
"numpy.copy",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"numpy.zeros",
"numpy.where",
"numpy.array",
"numpy.linalg.norm",
"numpy.matmul",
"numpy.dot"
] | [((4792, 4840), 'pandas.read_csv', 'pd.read_csv', (['"""data/breast-cancer-wisconsin.data"""'], {}), "('data/breast-cancer-wisconsin.data')\n", (4803, 4840), True, 'import pandas as pd\n'), ((5051, 5088), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.2)'}), '(X, y, test_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 4 14:13:34 2020
Testing out the ADS1115 ADC with the raspberry pi
@author: nlourie
"""
import board
import busio
import time
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from datetime import datetime
import numpy as... | [
"adafruit_ads1x15.ads1115.ADS1115",
"matplotlib.pyplot.show",
"busio.I2C",
"matplotlib.animation.FuncAnimation",
"datetime.datetime.utcnow",
"matplotlib.pyplot.figure",
"numpy.int",
"adafruit_ads1x15.analog_in.AnalogIn"
] | [((333, 364), 'busio.I2C', 'busio.I2C', (['board.SCL', 'board.SDA'], {}), '(board.SCL, board.SDA)\n', (342, 364), False, 'import busio\n'), ((460, 476), 'adafruit_ads1x15.ads1115.ADS1115', 'ADS.ADS1115', (['i2c'], {}), '(i2c)\n', (471, 476), True, 'import adafruit_ads1x15.ads1115 as ADS\n'), ((485, 506), 'adafruit_ads1... |
import sys
import string
from itertools import product
import scipy.constants as co
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.colors import LogNorm
from scipy import stats
import h5py
plt.rc('text', usetex=True)
plt.rc('text.latex', preamble=r'\usepackage[varg]{txfonts}')
plt.rc('axes'... | [
"matplotlib.pyplot.subplot",
"h5py.File",
"matplotlib.pyplot.gca",
"numpy.amax",
"matplotlib.pyplot.figure",
"numpy.array",
"matplotlib.pyplot.rc",
"numpy.arange",
"itertools.product",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.savefig"
] | [((218, 245), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (224, 245), True, 'from matplotlib import pyplot as plt\n'), ((246, 306), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text.latex"""'], {'preamble': '"""\\\\usepackage[varg]{txfonts}"""'}), "('text.latex', prea... |
# Copyright 2021 Sony Group 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 ... | [
"numpy.abs",
"nnabla.ext_utils.get_extension_context",
"nnabla.Variable.from_numpy_array",
"click.option",
"nnabla.get_parameters",
"numpy.random.randint",
"nnabla.functions.add2",
"nnabla.functions.dropout",
"numpy.full",
"nnabla.logger.logger.info",
"numpy.random.randn",
"nnabla.solvers.Sgd"... | [((13790, 13805), 'click.command', 'click.command', ([], {}), '()\n', (13803, 13805), False, 'import click\n'), ((13807, 13853), 'click.option', 'click.option', (['"""--loop/--no-loop"""'], {'default': '(True)'}), "('--loop/--no-loop', default=True)\n", (13819, 13853), False, 'import click\n'), ((13855, 13918), 'click.... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modified 2017 Microsoft 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... | [
"tensorflow.app.flags.DEFINE_float",
"tensorflow.nn.zero_fraction",
"tensorflow.get_collection",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.logging.set_verbosity",
"tensorflow.app.flags.DEFINE_boolean",
"numpy.random.randint",
"tensorflow.train.latest_checkpoint",
"tensorflow.python.ops.contro... | [((1201, 1324), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""train_dir"""', '"""D:\\\\tf\\\\models"""', '"""Directory where checkpoints and event logs are written to."""'], {}), "('train_dir', 'D:\\\\tf\\\\models',\n 'Directory where checkpoints and event logs are written to.')\n", (1227... |
import jieba
import pandas as pd
import numpy as np
from sklearn import feature_extraction
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
import time
import os
import re
def readExcel(url):
df=pd.read_excel(url,na_values='')
return df
d... | [
"pandas.DataFrame",
"sklearn.feature_extraction.text.CountVectorizer",
"os.path.abspath",
"jieba.cut",
"os.walk",
"time.clock",
"pandas.read_excel",
"numpy.array",
"numpy.dot",
"pandas.ExcelWriter",
"re.compile"
] | [((272, 304), 'pandas.read_excel', 'pd.read_excel', (['url'], {'na_values': '""""""'}), "(url, na_values='')\n", (285, 304), True, 'import pandas as pd\n'), ((358, 377), 'pandas.ExcelWriter', 'pd.ExcelWriter', (['url'], {}), '(url)\n', (372, 377), True, 'import pandas as pd\n'), ((566, 614), 'pandas.DataFrame', 'pd.Dat... |
# ============================================================================
# 第十章 家電・調理
# Ver.04(エネルギー消費性能計算プログラム(住宅版)Ver.02~)
# ============================================================================
import numpy as np
from pyhees.section11_3 import load_schedule, get_schedule_app, get_schedule_cc
# =======... | [
"pyhees.section11_3.get_schedule_cc",
"pyhees.section11_3.get_schedule_app",
"numpy.zeros",
"pyhees.section11_3.load_schedule",
"numpy.repeat"
] | [((823, 838), 'pyhees.section11_3.load_schedule', 'load_schedule', ([], {}), '()\n', (836, 838), False, 'from pyhees.section11_3 import load_schedule, get_schedule_app, get_schedule_cc\n'), ((858, 884), 'pyhees.section11_3.get_schedule_app', 'get_schedule_app', (['schedule'], {}), '(schedule)\n', (874, 884), False, 'fr... |
from __future__ import print_function, division
import numpy as np
import imgaug as ia
from imgaug import augmenters as iaa
def main():
quokka = ia.quokka(size=0.5)
h, w = quokka.shape[0:2]
heatmap = np.zeros((h, w), dtype=np.float32)
heatmap[70:120, 90:150] = 0.1
heatmap[30:70, 50:65] = 0.5
... | [
"imgaug.HeatmapsOnImage",
"imgaug.augmenters.ElasticTransformation",
"imgaug.draw_grid",
"imgaug.quokka",
"numpy.zeros",
"numpy.hstack",
"imgaug.augmenters.Affine",
"imgaug.augmenters.PerspectiveTransform",
"imgaug.augmenters.CropAndPad",
"imgaug.augmenters.Scale",
"imgaug.augmenters.PiecewiseAf... | [((153, 172), 'imgaug.quokka', 'ia.quokka', ([], {'size': '(0.5)'}), '(size=0.5)\n', (162, 172), True, 'import imgaug as ia\n'), ((216, 250), 'numpy.zeros', 'np.zeros', (['(h, w)'], {'dtype': 'np.float32'}), '((h, w), dtype=np.float32)\n', (224, 250), True, 'import numpy as np\n'), ((399, 457), 'imgaug.HeatmapsOnImage'... |
import pytest
import numpy as np
import pclpy
def test_eigen_vectorxf():
a = np.array([1, 1, 1, 1], "f")
vec = pclpy.pcl.vectors.VectorXf(a)
assert np.allclose(np.array(vec), a)
| [
"numpy.array",
"pclpy.pcl.vectors.VectorXf"
] | [((84, 111), 'numpy.array', 'np.array', (['[1, 1, 1, 1]', '"""f"""'], {}), "([1, 1, 1, 1], 'f')\n", (92, 111), True, 'import numpy as np\n'), ((122, 151), 'pclpy.pcl.vectors.VectorXf', 'pclpy.pcl.vectors.VectorXf', (['a'], {}), '(a)\n', (148, 151), False, 'import pclpy\n'), ((175, 188), 'numpy.array', 'np.array', (['ve... |
"""StyleGAN.
This module implements teh Generative Adversarial Network described in:
A Style-Based Generator Architecture for Generative Adversarial Networks
<NAME> (NVIDIA), <NAME> (NVIDIA), <NAME> (NVIDIA)
http://stylegan.xyz/paper
Code derived from:
https://github.com/SsnL/stylegan
"""
import collections
import o... | [
"torch.sqrt",
"torch.nn.Embedding",
"torch.cat",
"collections.defaultdict",
"torch.nn.functional.leaky_relu",
"torch.device",
"torch.no_grad",
"os.path.join",
"numpy.prod",
"os.path.dirname",
"torch.lerp",
"torch.zeros",
"torch.hub.load_state_dict_from_url",
"torch.mean",
"torch.randint"... | [((428, 465), 'collections.defaultdict', 'collections.defaultdict', (['(lambda : 512)'], {}), '(lambda : 512)\n', (451, 465), False, 'import collections\n'), ((790, 815), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (805, 815), False, 'import os\n'), ((2324, 2334), 'numpy.sqrt', 'np.sqrt', ... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"supcon.classification_head.ClassificationHead",
"tensorflow.compat.v1.random.uniform",
"numpy.isnan",
"tensorflow.compat.v1.test.main",
"tensorflow.compat.v1.gradients",
"absl.testing.parameterized.named_parameters",
"tensorflow.compat.v1.compat.v1.global_variables_initializer",
"tensorflow.compat.v1... | [((882, 957), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["('rank_1', 1)", "('rank_4', 4)", "('rank_8', 8)"], {}), "(('rank_1', 1), ('rank_4', 4), ('rank_8', 8))\n", (912, 957), False, 'from absl.testing import parameterized\n'), ((1265, 1375), 'absl.testing.parameterized.named_pa... |
# License: MIT
# ref: https://github.com/thomas-young-2013/open-box/blob/master/openbox/surrogate/skrf.py
import logging
import typing
import numpy as np
from typing import List, Optional, Tuple, Union
from xbbo.surrogate.base import BaseRF
from xbbo.configspace.space import DenseConfigurationSpace
from xbbo.utils.con... | [
"numpy.std",
"numpy.isfinite",
"numpy.random.RandomState",
"xbbo.utils.util.get_types",
"sklearn.ensemble.RandomForestRegressor",
"numpy.finfo",
"numpy.mean",
"numpy.var",
"logging.getLogger"
] | [((390, 417), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (407, 417), False, 'import logging\n'), ((784, 809), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (805, 809), True, 'import numpy as np\n'), ((3751, 3779), 'numpy.mean', 'np.mean', (['prediction... |
from __future__ import division
import numpy as np
from pdb import set_trace
class Counter:
def __init__(self, before, after, indx):
self.indx = indx
self.actual = before
self.predicted = after
self.TP, self.TN, self.FP, self.FN = 0, 0, 0, 0
for a, b in zip(self.actual, sel... | [
"numpy.sqrt"
] | [((1004, 1023), 'numpy.sqrt', 'np.sqrt', (['(Sen * Spec)'], {}), '(Sen * Spec)\n', (1011, 1023), True, 'import numpy as np\n')] |
'''
Author : <NAME>
Description :
-------------
The following code lets you click on a set of points and then create a curve that fits the set of points.
In order to execute this code, you need to install bokeh,
'''
from bokeh.io import curdoc
from bokeh.plotting import figure, output_file
from bokeh.la... | [
"bokeh.models.ColumnDataSource",
"bokeh.models.PointDrawTool",
"bokeh.plotting.figure",
"bokeh.models.Button",
"os.system",
"numpy.append",
"bokeh.io.curdoc",
"numpy.array",
"bokeh.layouts.column",
"scipy.interpolate.interp1d",
"scipy.spatial.ConvexHull",
"bokeh.layouts.row"
] | [((1052, 1159), 'bokeh.plotting.figure', 'figure', ([], {'title': '"""CAD/Curves/Curve Fit"""', 'plot_width': '(800)', 'plot_height': '(500)', 'x_range': '(-5, 5)', 'y_range': '(-5, 5)'}), "(title='CAD/Curves/Curve Fit', plot_width=800, plot_height=500,\n x_range=(-5, 5), y_range=(-5, 5))\n", (1058, 1159), False, 'f... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
from .GetDataAvailability import GetDataAvailability
import DateTimeTools as TT
months = ['J','F','M','A','M','J','J','A','S','O','N','D']
def PlotDataAvailability(Stations,Da... | [
"numpy.meshgrid",
"matplotlib.colors.Normalize",
"numpy.float32",
"numpy.zeros",
"numpy.where",
"numpy.arange",
"DateTimeTools.DateSplit"
] | [((684, 703), 'numpy.meshgrid', 'np.meshgrid', (['xe', 'ye'], {}), '(xe, ye)\n', (695, 703), True, 'import numpy as np\n'), ((800, 815), 'DateTimeTools.DateSplit', 'TT.DateSplit', (['x'], {}), '(x)\n', (812, 815), True, 'import DateTimeTools as TT\n'), ((1404, 1450), 'matplotlib.colors.Normalize', 'colors.Normalize', (... |
# this script is based on ./examples/cars segmentation (camvid).ipynb
# ========== loading data ==========
'''
For this example, we will use PASCAL2012 dataset. It is a set of:
- train images + instance segmentation masks
- validation images + instance segmentation masks
'''
import os
os.environ['CUDA_VISIBLE_DEVICES']... | [
"numpy.absolute",
"segmentation_models_pytorch.utils.train.ValidEpoch",
"albumentations.Lambda",
"numpy.sum",
"scipy.ndimage.measurements.label",
"numpy.ones",
"segmentation_models_pytorch.utils.train.TrainEpoch",
"matplotlib.pyplot.figure",
"skimage.transform.resize",
"numpy.arange",
"segmentat... | [((702, 738), 'os.path.join', 'os.path.join', (['DATA_DIR', '"""JPEGImages"""'], {}), "(DATA_DIR, 'JPEGImages')\n", (714, 738), False, 'import os\n'), ((747, 791), 'os.path.join', 'os.path.join', (['DATA_DIR', '"""SegmentationObject"""'], {}), "(DATA_DIR, 'SegmentationObject')\n", (759, 791), False, 'import os\n'), ((8... |
import unittest.mock as umock
from argparse import ArgumentTypeError
import numpy as np
import pytest
from functions import do_embossing, do_edge_detection, do_blur_5x5, do_blur_3x3, do_sharpen, do_bw, do_darken, \
do_inverse, do_lighten, do_mirror, do_rotate, percentage, read_image, save_image
test_array = np.a... | [
"functions.do_bw",
"functions.do_lighten",
"unittest.mock.MagicMock",
"functions.percentage",
"functions.do_darken",
"functions.do_inverse",
"functions.do_blur_5x5",
"numpy.all",
"functions.do_rotate",
"functions.do_embossing",
"functions.save_image",
"pytest.raises",
"numpy.array",
"funct... | [((316, 359), 'numpy.array', 'np.array', (['[[1, 1, 1], [1, 1, 1], [1, 1, 1]]'], {}), '([[1, 1, 1], [1, 1, 1], [1, 1, 1]])\n', (324, 359), True, 'import numpy as np\n'), ((374, 412), 'functions.read_image', 'read_image', (['"""test_images/test_img.png"""'], {}), "('test_images/test_img.png')\n", (384, 412), False, 'fro... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import numpy as np
import tensorflow as tf
from tensorflow.python.platform import flags
sys.path.append("../")
from nmutant_util.utils_file import get_data_... | [
"sys.path.append",
"tensorflow.python.platform.flags.DEFINE_string",
"tensorflow.reset_default_graph",
"nmutant_util.utils_file.get_data_file",
"numpy.asarray",
"nmutant_data.data.get_data",
"tensorflow.app.run"
] | [((251, 273), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (266, 273), False, 'import sys\n'), ((577, 601), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (599, 601), True, 'import tensorflow as tf\n'), ((641, 659), 'nmutant_data.data.get_data', 'get_data', (['d... |
from datetime import datetime
import traceback
import numpy as np
import face_recognition as fr
import glob
import datetime
import os
from stat import *
from scipy.spatial.distance import cdist
from sklearn.cluster import KMeans
import cv2
import matplotlib.pyplot as plt
import time
import sys
import re
... | [
"numpy.argmin",
"cv2.rectangle",
"glob.glob",
"numpy.unique",
"cv2.imwrite",
"face_recognition.face_encodings",
"sklearn.cluster.KMeans",
"traceback.format_exc",
"datetime.datetime.now",
"re.sub",
"numpy.save",
"os.stat",
"face_recognition.batch_face_locations",
"dlib.cuda.get_device",
"... | [((2125, 2154), 'numpy.asanyarray', 'np.asanyarray', (['face_encodings'], {}), '(face_encodings)\n', (2138, 2154), True, 'import numpy as np\n'), ((2392, 2428), 'numpy.argmin', 'np.argmin', (['dists[:, largest_cluster]'], {}), '(dists[:, largest_cluster])\n', (2401, 2428), True, 'import numpy as np\n'), ((2963, 2993), ... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"random.shuffle",
"json.dumps",
"tensorflow.ConfigProto",
"tensorflow.train.latest_checkpoint",
"tensorflow.tables_initializer",
"os.path.join",
"utils.misc_utils.add_summary",
"tensorflow.summary.FileWriter",
"tensorflow.contrib.training.wait_for_new_checkpoint",
"copy.deepcopy",
"numpy.average... | [((1737, 1776), 're.match', 're.match', (['"""<fl_(\\\\d+)>"""', 'pred_action[2]'], {}), "('<fl_(\\\\d+)>', pred_action[2])\n", (1745, 1776), False, 'import re\n'), ((1858, 1897), 're.match', 're.match', (['"""<st_(\\\\w+)>"""', 'pred_action[3]'], {}), "('<st_(\\\\w+)>', pred_action[3])\n", (1866, 1897), False, 'import... |
import logging
import time
import numpy as np
from param_net.param_fcnet import ParamFCNetRegression
from keras.losses import mean_squared_error
from keras import backend as K
from smac.tae.execute_func import ExecuteTAFuncDict
from smac.scenario.scenario import Scenario
from smac.facade.smac_facade import SMAC
fro... | [
"sklearn.preprocessing.StandardScaler",
"keras.backend.clear_session",
"numpy.maximum",
"param_net.param_fcnet.ParamFCNetRegression",
"mini_autonet.tae.simple_tae.SimpleTAFunc",
"ConfigSpace.util.fix_types",
"numpy.random.RandomState",
"time.time",
"param_net.param_fcnet.ParamFCNetRegression.get_con... | [((784, 812), 'logging.getLogger', 'logging.getLogger', (['"""AutoNet"""'], {}), "('AutoNet')\n", (801, 812), False, 'import logging\n'), ((1006, 1022), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (1020, 1022), False, 'from sklearn.preprocessing import StandardScaler\n'), ((1046, 1062), ... |
import unittest
import os
import numpy as np
from skimage.io import imsave
import torch
import neural_renderer as nr
current_dir = os.path.dirname(os.path.realpath(__file__))
data_dir = os.path.join(current_dir, 'data')
class TestCore(unittest.TestCase):
def test_tetrahedron(self):
vertices_ref = np.array(
... | [
"unittest.main",
"os.path.realpath",
"neural_renderer.load_obj",
"numpy.array",
"neural_renderer.get_points_from_angles",
"neural_renderer.Renderer",
"os.path.join",
"torch.from_numpy"
] | [((189, 222), 'os.path.join', 'os.path.join', (['current_dir', '"""data"""'], {}), "(current_dir, 'data')\n", (201, 222), False, 'import os\n'), ((150, 176), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (166, 176), False, 'import os\n'), ((2219, 2234), 'unittest.main', 'unittest.main', ([... |
# Lint as: python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
"lingvo.compat.test.main",
"waymo_open_dataset.label_pb2.Label.Type.Value",
"lingvo.tasks.car.waymo.waymo_ap_metric.WaymoAPMetrics.Params",
"numpy.zeros",
"numpy.ones",
"lingvo.tasks.car.waymo.waymo_ap_metric.BuildWaymoMetricConfig",
"numpy.array",
"lingvo.tasks.car.waymo.waymo_metadata.WaymoMetadata"... | [((5177, 5191), 'lingvo.compat.test.main', 'tf.test.main', ([], {}), '()\n', (5189, 5191), True, 'from lingvo import compat as tf\n'), ((1111, 1141), 'lingvo.tasks.car.waymo.waymo_metadata.WaymoMetadata', 'waymo_metadata.WaymoMetadata', ([], {}), '()\n', (1139, 1141), False, 'from lingvo.tasks.car.waymo import waymo_me... |
import numpy as np
import torch
from scipy.special import comb
class Metric:
def __init__(self, **kwargs):
self.requires = ['kmeans_cosine', 'kmeans_nearest_cosine', 'features_cosine', 'target_labels']
self.name = 'c_f1'
def __call__(self, target_labels, computed_cluster_labels_cosine, featur... | [
"scipy.special.comb",
"numpy.zeros",
"numpy.argmin",
"numpy.where",
"numpy.linalg.norm",
"numpy.unique"
] | [((747, 788), 'numpy.unique', 'np.unique', (['computed_cluster_labels_cosine'], {}), '(computed_cluster_labels_cosine)\n', (756, 788), True, 'import numpy as np\n'), ((1046, 1070), 'numpy.unique', 'np.unique', (['target_labels'], {}), '(target_labels)\n', (1055, 1070), True, 'import numpy as np\n'), ((1187, 1205), 'num... |
#right now, requires source /project/projectdirs/desi/software/desi_environment.sh master
from astropy.table import Table
import numpy as np
import os
import argparse
import fitsio
from desitarget.targetmask import zwarn_mask
parser = argparse.ArgumentParser()
parser.add_argument("--night", help="use this if you want ... | [
"astropy.table.Table.read",
"numpy.sum",
"argparse.ArgumentParser",
"desitarget.targetmask.zwarn_mask.mask",
"numpy.zeros",
"numpy.unique"
] | [((236, 261), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (259, 261), False, 'import argparse\n'), ((472, 600), 'astropy.table.Table.read', 'Table.read', (["('/global/cfs/cdirs/desi/spectro/redux/daily/exposure_tables/' + month +\n '/exposure_table_' + args.night + '.csv')"], {}), "('/glo... |
#!/usr/bin/env python3
import numpy as np
import random
if __name__ == '__main__':
nbViewpoint = 3
nbTileList = [1, 3*2, 6*4]
#nbTileList = [1]
#nbQuality = 4
nbQuality = 3
#nbChunk = 4*60
nbChunk = 256
#nbChunk = 60
nbBandwidth = 1
nbUser = 4
nbProcessedChunk = 32
#nb... | [
"numpy.random.seed",
"random.seed",
"numpy.random.normal"
] | [((3166, 3181), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (3177, 3181), False, 'import random\n'), ((3186, 3204), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (3200, 3204), True, 'import numpy as np\n'), ((6374, 6433), 'numpy.random.normal', 'np.random.normal', (['averageBandwidth', '(... |
# %matplotlib inline
# +
import os, sys
import numpy as np
import random
import copy
import torch
import torch.autograd as autograd
from torch.autograd import Variable
import torch.optim as optim
from torch.utils.data import DataLoader, Dataset, TensorDataset
import torchvision.transforms as transforms
import torchvis... | [
"numpy.random.seed",
"torch.randn",
"torch.set_default_tensor_type",
"torch.full",
"numpy.random.randint",
"numpy.arange",
"torch.device",
"torchvision.transforms.Normalize",
"os.path.join",
"torch.utils.data.DataLoader",
"numpy.savetxt",
"random.seed",
"numpy.loadtxt",
"torchvision.transf... | [((1654, 1692), 'torch.norm', 'torch.norm', (['grad_wrt_image'], {'p': '(2)', 'dim': '(1)'}), '(grad_wrt_image, p=2, dim=1)\n', (1664, 1692), False, 'import torch\n'), ((2455, 2493), 'torch.norm', 'torch.norm', (['grad_wrt_image'], {'p': '(2)', 'dim': '(1)'}), '(grad_wrt_image, p=2, dim=1)\n', (2465, 2493), False, 'imp... |
import open3d as o3d
import glob, plyfile, numpy as np, multiprocessing as mp, torch
import copy
import numpy as np
import json
import pdb
import os
#CLASS_LABELS = ['cabinet', 'bed', 'chair', 'sofa', 'table', 'door', 'window', 'bookshelf', 'picture', 'counter', 'desk', 'curtain', 'refrigerator', 'shower curtain', 't... | [
"json.load",
"plyfile.PlyData",
"numpy.ones",
"torch.save",
"numpy.array",
"glob.glob",
"numpy.ascontiguousarray",
"multiprocessing.cpu_count"
] | [((613, 698), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 24, 28, 33, 34, 36, 39]'], {}), '([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 24, 28, 33, 34, 36,\n 39])\n', (621, 698), True, 'import numpy as np\n'), ((1322, 1334), 'numpy.ones', 'np.ones', (['(500)'], {}), '(500)\n', (... |
import numpy as np
import cv2
from skimage.io import imread, imsave
from skimage.io import imshow
# lifted from http://blog.christianperone.com/2015/01/real-time-drone-object-tracking-using-python-and-opencv/
def run_main():
cap = cv2.VideoCapture('upabove.mp4')
# Read the first frame of the video
ret, f... | [
"cv2.putText",
"cv2.cvtColor",
"cv2.calcHist",
"cv2.waitKey",
"cv2.imshow",
"cv2.VideoCapture",
"cv2.rectangle",
"numpy.array",
"cv2.calcBackProject",
"skimage.io.imshow",
"cv2.normalize",
"cv2.destroyAllWindows",
"cv2.meanShift"
] | [((237, 268), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""upabove.mp4"""'], {}), "('upabove.mp4')\n", (253, 268), False, 'import cv2\n'), ((411, 424), 'skimage.io.imshow', 'imshow', (['frame'], {}), '(frame)\n', (417, 424), False, 'from skimage.io import imshow\n'), ((683, 719), 'cv2.cvtColor', 'cv2.cvtColor', (['roi... |
"""
EfficientNet for ImageNet-1K, implemented in Keras.
Original paper: 'EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks,'
https://arxiv.org/abs/1905.11946.
"""
__all__ = ['efficientnet_model', 'efficientnet_b0', 'efficientnet_b1', 'efficientnet_b2', 'efficientnet_b3',
'... | [
"math.ceil",
"keras.layers.Dropout",
"keras.layers.add",
"numpy.zeros",
"keras.models.Model",
"keras.layers.GlobalAveragePooling2D",
"keras.layers.Dense",
"keras.utils.layer_utils.count_params",
"keras.layers.Input",
"os.path.join"
] | [((1245, 1272), 'math.ceil', 'math.ceil', (['(height / strides)'], {}), '(height / strides)\n', (1254, 1272), False, 'import math\n'), ((1282, 1308), 'math.ceil', 'math.ceil', (['(width / strides)'], {}), '(width / strides)\n', (1291, 1308), False, 'import math\n'), ((9902, 9929), 'keras.layers.Input', 'nn.Input', ([],... |
# Copyright (c) ElementAI and its affiliates.
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Script to train DCGAN on MNIST, adaptted from https://github.com/pytorch/examples/blob/master/... | [
"pickle.dump",
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.randn",
"torch.cat",
"torch.nn.InstanceNorm2d",
"torch.nn.GroupNorm",
"torchvision.transforms.Normalize",
"os.path.join",
"random.randint",
"plot_path_tools.plot_eigenvalues",
"torch.load",
"os.path.exists",
"numpy.rando... | [((7565, 7610), 'os.path.join', 'os.path.join', (['config.exp_dir', 'config.exp_name'], {}), '(config.exp_dir, config.exp_name)\n', (7577, 7610), False, 'import os\n'), ((7693, 7729), 'os.path.join', 'os.path.join', (['exp_dir', '"""extra_plots"""'], {}), "(exp_dir, 'extra_plots')\n", (7705, 7729), False, 'import os\n'... |
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from src.system import System
def plot():
data = {
"hp": {
"cop": 3.0
},
"swhe": {
"pipe": {
"outer-dia": 0.02667,
"inner-dia": 0.0215392,
"... | [
"src.system.System",
"pathlib.Path",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((648, 660), 'src.system.System', 'System', (['data'], {}), '(data)\n', (654, 660), False, 'from src.system import System\n'), ((670, 697), 'numpy.arange', 'np.arange', (['(-3000)', '(3000)', '(200)'], {}), '(-3000, 3000, 200)\n', (679, 697), True, 'import numpy as np\n'), ((866, 880), 'matplotlib.pyplot.subplots', 'p... |
# analyze binom_test to each pair
# for further analyze ANOVA
# gt/-our gt/-nerf -our/gt -our/nerf -nerf/gt nerf/-our
# 40 1 38 77 1 75
# 78 78 78 78 78 78
from scipy import stats
import numpy as np
# choose us, or nerf is no us
choose = [64, 110, 111]
stimuli = ["our-g... | [
"numpy.savetxt",
"scipy.stats.binom_test"
] | [((525, 561), 'numpy.savetxt', 'np.savetxt', (['"""bintest.csv"""', 'binresult'], {}), "('bintest.csv', binresult)\n", (535, 561), True, 'import numpy as np\n'), ((413, 480), 'scipy.stats.binom_test', 'stats.binom_test', (['eachChoose'], {'n': 'total', 'p': '(0.5)', 'alternative': '"""greater"""'}), "(eachChoose, n=tot... |
"""Plots (and/or saves) the graphical trading data using Matplotlib"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from models.Trading import TechnicalAnalysis
import datetime, re, sys
sys.path.append('.')
class TradingGraphs():
def __init__(self, tech... | [
"matplotlib.pyplot.style.use",
"numpy.arange",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.tight_layout",
"sys.path.append",
"pandas.DataFrame",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.close",
"datetime.timedelta",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.subplots",
"matp... | [((248, 268), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (263, 268), False, 'import datetime, re, sys\n'), ((799, 815), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (808, 815), True, 'import matplotlib.pyplot as plt\n'), ((1175, 1199), 'matplotlib.pyplot.style.use',... |
import h5py
import numpy as np
import math
import matplotlib.pyplot as plt
# multiple h5 files?
f = h5py.File('shockwave.h5', 'r')
dset2 = f['2'] # fourier
k_density_re = dset2['k_density_re'][...]
k_density_im = dset2['k_density_im'][...]
kx = dset2['kx'][...]
tk = dset2['t'][...]
k_density = k_density_re + 1j * k_d... | [
"h5py.File",
"numpy.abs",
"numpy.angle",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"numpy.gradient"
] | [((101, 131), 'h5py.File', 'h5py.File', (['"""shockwave.h5"""', '"""r"""'], {}), "('shockwave.h5', 'r')\n", (110, 131), False, 'import h5py\n'), ((1842, 1870), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)'], {'sharex': '(True)'}), '(2, sharex=True)\n', (1854, 1870), True, 'import matplotlib.pyplot as plt\n'), (... |
import os
import time
import numpy as np
import pandas as pd
import normalizedDistance
from pprint import pprint
from recourse.builder import RecourseBuilder
from recourse.builder import ActionSet
def genExp(model_trained, factual_sample, norm_type, dataset_obj):
start_time = time.time()
# SIMPLE HACK!!
# Act... | [
"numpy.sum",
"time.time",
"normalizedDistance.getDistanceBetweenSamples",
"recourse.builder.ActionSet",
"pandas.Series",
"numpy.add",
"recourse.builder.RecourseBuilder",
"numpy.round"
] | [((282, 293), 'time.time', 'time.time', ([], {}), '()\n', (291, 293), False, 'import time\n'), ((1428, 1471), 'recourse.builder.ActionSet', 'ActionSet', ([], {'X': 'X', 'custom_bounds': 'custom_bounds'}), '(X=X, custom_bounds=custom_bounds)\n', (1437, 1471), False, 'from recourse.builder import ActionSet\n'), ((2692, 2... |
#!/usr/bin/env python
# coding=utf8
import os
import matplotlib as mpl
import numpy as np
import path
import pytest
from triflow import Model, Simulation, display_fields, display_probe # noqa
if os.environ.get('DISPLAY', '') == '':
print('no display found. Using non-interactive Agg backend')
mpl.use('Agg')... | [
"triflow.Model",
"triflow.display_probe",
"path.tempdir",
"os.environ.get",
"triflow.display_fields",
"matplotlib.use",
"triflow.Simulation",
"numpy.linspace",
"numpy.cos",
"pytest.mark.parametrize"
] | [((1367, 1420), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fmt"""', "['png', 'svg', 'pdf']"], {}), "('fmt', ['png', 'svg', 'pdf'])\n", (1390, 1420), False, 'import pytest\n'), ((1707, 1760), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fmt"""', "['png', 'svg', 'pdf']"], {}), "('fmt', ['p... |
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 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 app... | [
"pandas.DataFrame",
"neural_compressor.experimental.Quantization",
"tensorflow.io.gfile.GFile",
"utils.tokenizer.Subtokenizer",
"six.unichr",
"tensorflow.compat.v1.logging.info",
"time.time",
"tensorflow.compat.v1.Session",
"neural_compressor.experimental.common.Model",
"numpy.array",
"tensorflo... | [((3905, 3966), 'tensorflow.compat.v1.logging.info', 'tf.compat.v1.logging.info', (["('Loading graph from: ' + file_name)"], {}), "('Loading graph from: ' + file_name)\n", (3930, 3966), True, 'import tensorflow as tf\n'), ((4475, 4505), 'utils.tokenizer.Subtokenizer', 'Subtokenizer', (['FLAGS.vocab_file'], {}), '(FLAGS... |
import argparse
import torch
import os
import numpy as np
import datasets.crowd as crowd
from models import vgg19
def run():
torch.multiprocessing.freeze_support()
parser = argparse.ArgumentParser(description='Test ')
parser.add_argument('--device', default='0', help='assign device')
parser.add_argume... | [
"numpy.abs",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"os.makedirs",
"torch.sum",
"torch.load",
"torch.set_grad_enabled",
"os.path.exists",
"numpy.square",
"models.vgg19",
"torch.multiprocessing.freeze_support",
"numpy.array",
"cv2.applyColorMap",
"torch.device",
"os.pat... | [((130, 168), 'torch.multiprocessing.freeze_support', 'torch.multiprocessing.freeze_support', ([], {}), '()\n', (166, 168), False, 'import torch\n'), ((183, 227), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Test """'}), "(description='Test ')\n", (206, 227), False, 'import argparse\n'... |
# coding=utf-8
# Copyright 2020 The uncertainty_metrics Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [
"tensorflow.compat.v2.keras.layers.Lambda",
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.enable_v2_behavior",
"tensorflow.compat.v2.convert_to_tensor",
"numpy.array",
"uncertainty_metrics.ExpectedCalibrationError"
] | [((6981, 7004), 'tensorflow.compat.v2.enable_v2_behavior', 'tf.enable_v2_behavior', ([], {}), '()\n', (7002, 7004), True, 'import tensorflow.compat.v2 as tf\n'), ((7007, 7021), 'tensorflow.compat.v2.test.main', 'tf.test.main', ([], {}), '()\n', (7019, 7021), True, 'import tensorflow.compat.v2 as tf\n'), ((884, 942), 'n... |
# Copyright (c) 2021, TU Wien, Department of Geodesy and Geoinformation
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,... | [
"h5py.File",
"numpy.datetime64",
"numpy.dtype",
"xarray.Dataset",
"numpy.array",
"numpy.tile",
"numpy.repeat",
"collections.OrderedDict",
"ascat.read_native.eps_native.set_flags"
] | [((7767, 7786), 'numpy.array', 'np.array', (['[4, 3, 5]'], {}), '([4, 3, 5])\n', (7775, 7786), True, 'import numpy as np\n'), ((8330, 8346), 'ascat.read_native.eps_native.set_flags', 'set_flags', (['flags'], {}), '(flags)\n', (8339, 8346), False, 'from ascat.read_native.eps_native import set_flags\n'), ((5399, 5412), '... |
'''
Functions similar to blocks.graph
'''
import logging
import numpy
import theano
from theano import tensor
from theano.sandbox.rng_mrg import MRG_RandomStreams
from blocks.config import config
from blocks.bricks.base import Brick, application
from picklable_itertools.extras import equizip
from blocks.graph impo... | [
"theano.tensor.log",
"numpy.zeros_like",
"numpy.log",
"theano.tensor.exp",
"theano.tensor.cast",
"numpy.float32",
"blocks.bricks.base.application",
"theano.tensor.patternbroadcast",
"theano.tensor.grad",
"theano.sandbox.rng_mrg.MRG_RandomStreams",
"theano.tensor.sqrt",
"collections.OrderedDict... | [((387, 414), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (404, 414), False, 'import logging\n'), ((945, 1065), 'blocks.bricks.base.application', 'application', ([], {'inputs': "['train_cost', 'model_cost', 'model_prior_mean', 'model_prior_variance']", 'outputs': "['total_cost']"}), "(... |
# -*- coding: utf-8 -*-
"""
===============================================================================
Generating pulse trains
===============================================================================
This example shows how to use :py:class:`~pulse2percept.stimuli.PulseTrain`
and its variants.
Biphasic pul... | [
"pulse2percept.stimuli.BiphasicTripletTrain",
"pulse2percept.stimuli.BiphasicPulseTrain",
"pulse2percept.stimuli.PulseTrain",
"pulse2percept.stimuli.Stimulus",
"pulse2percept.stimuli.AsymmetricBiphasicPulseTrain",
"numpy.concatenate"
] | [((945, 1010), 'pulse2percept.stimuli.BiphasicPulseTrain', 'BiphasicPulseTrain', (['(20)', '(30)', '(2)'], {'stim_dur': '(200)', 'cathodic_first': '(False)'}), '(20, 30, 2, stim_dur=200, cathodic_first=False)\n', (963, 1010), False, 'from pulse2percept.stimuli import BiphasicPulseTrain\n'), ((1207, 1284), 'pulse2percep... |
"""This module implements the RYGate."""
from __future__ import annotations
import numpy as np
from bqskit.ir.gates.qubitgate import QubitGate
from bqskit.qis.unitary.differentiable import DifferentiableUnitary
from bqskit.qis.unitary.optimizable import LocallyOptimizableUnitary
from bqskit.qis.unitary.unitary import... | [
"bqskit.qis.unitary.unitarymatrix.UnitaryMatrix",
"numpy.sin",
"numpy.array",
"numpy.real",
"numpy.cos",
"numpy.sqrt"
] | [((1151, 1172), 'numpy.cos', 'np.cos', (['(params[0] / 2)'], {}), '(params[0] / 2)\n', (1157, 1172), True, 'import numpy as np\n'), ((1187, 1208), 'numpy.sin', 'np.sin', (['(params[0] / 2)'], {}), '(params[0] / 2)\n', (1193, 1208), True, 'import numpy as np\n'), ((1225, 1265), 'bqskit.qis.unitary.unitarymatrix.UnitaryM... |
#!/usr/bin/env python3
import logging
import numpy as np
import copy
import crosstalk
import gates
import predistortion
import pulses
import qubits
import readout
import tomography
# Allow logging to Labber's instrument log
log = logging.getLogger('LabberDriver')
# TODO Reduce calc of CZ by finding all unique TwoQub... | [
"numpy.kaiser",
"numpy.sum",
"readout.Demodulation",
"numpy.abs",
"numpy.floor",
"numpy.ones",
"numpy.arange",
"numpy.convolve",
"numpy.round",
"predistortion.Predistortion",
"tomography.StateTomography",
"numpy.zeros_like",
"crosstalk.Crosstalk",
"numpy.max",
"tomography.ProcessTomograp... | [((232, 265), 'logging.getLogger', 'logging.getLogger', (['"""LabberDriver"""'], {}), "('LabberDriver')\n", (249, 265), False, 'import logging\n'), ((5054, 5084), 'tomography.ProcessTomography', 'tomography.ProcessTomography', ([], {}), '()\n', (5082, 5084), False, 'import tomography\n'), ((5192, 5220), 'tomography.Sta... |
#
# @file plotter.py
# @package openmoc.plotter
# @brief The plotter module provides utility functions to plot data from
# OpenMOCs C++ classes, in particular, the geomery, including Material,
# Cells and flat source regions, and fluxes and pin powers.
# @author <NAME> (<EMAIL>)
# @date March 10, 2013
im... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.loglog",
"numpy.sum",
"numpy.abs",
"matplotlib.pyplot.suptitle",
"numpy.isnan",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.unique",
"openmoc.get_output_directory",
"matplotlib.pyplot.close",
"matplotlib.pyplot.imshow",
"matplotlib.cm.Scal... | [((486, 507), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (500, 507), False, 'import matplotlib\n'), ((898, 908), 'matplotlib.pyplot.ioff', 'plt.ioff', ([], {}), '()\n', (906, 908), True, 'import matplotlib.pyplot as plt\n'), ((2455, 2471), 'numpy.array', 'np.array', (['coords'], {}), '(coords... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Determine screen gamma using motion-nulling method
of <NAME> Smith, 1994, Vision Research, 34, 2727-2740
A similar system had been used early for chromatic isoluminance:
Anstis SM, <NAME>. A minimum motion technique for judging equiluminance.
In: Sharpe MJD & LT Colour... | [
"numpy.random.randint",
"numpy.arange",
"psychopy.tools.filetools.toFile",
"psychopy.event.clearEvents",
"psychopy.gui.DlgFromDict",
"builtins.range",
"psychopy.event.getKeys",
"psychopy.tools.filetools.fromFile",
"builtins.next",
"psychopy.visual.Window",
"psychopy.core.quit",
"time.localtime... | [((1183, 1204), 'psychopy.gui.DlgFromDict', 'gui.DlgFromDict', (['info'], {}), '(info)\n', (1198, 1204), False, 'from psychopy import visual, core, event, gui, data\n'), ((1495, 1564), 'psychopy.visual.Window', 'visual.Window', (['(1024, 768)'], {'units': '"""pix"""', 'allowGUI': '(True)', 'bitsMode': 'None'}), "((1024... |
'''
Code of 'Searching Central Difference Convolutional Networks for Face Anti-Spoofing'
By <NAME> & <NAME>, 2019
If you use the code, please cite:
@inproceedings{yu2020searching,
title={Searching Central Difference Convolutional Networks for Face Anti-Spoofing},
author={<NAME> and <NAME> and <NAME> and <NAME... | [
"os.mkdir",
"numpy.abs",
"sklearn.metrics.roc_curve",
"numpy.argmax",
"os.path.isdir",
"os.path.basename",
"torch.load",
"os.path.exists",
"torch.save",
"sklearn.metrics.auc",
"shutil.copyfile",
"os.path.join",
"os.listdir"
] | [((876, 892), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (886, 892), False, 'import os\n'), ((5255, 5276), 'numpy.argmax', 'np.argmax', (['RightIndex'], {}), '(RightIndex)\n', (5264, 5276), True, 'import numpy as np\n'), ((6862, 6910), 'sklearn.metrics.roc_curve', 'roc_curve', (['test_labels', 'test_scores... |
import numpy as _np
import pandas as _pd
import matplotlib.pyplot as _plt
from src.plot_helpers.matplotlib_helpers\
import range_axis_ticks as _range_axis_ticks
def plot_value_by_element(df, xaxis, element_col, value_col, ax, cmap,
alpha=1.0, lw=1.0,
x_inte... | [
"numpy.zeros_like",
"matplotlib.pyplot.get_cmap",
"numpy.ones",
"src.plot_helpers.matplotlib_helpers.range_axis_ticks",
"pandas.Series"
] | [((7095, 7114), 'matplotlib.pyplot.get_cmap', '_plt.get_cmap', (['cmap'], {}), '(cmap)\n', (7108, 7114), True, 'import matplotlib.pyplot as _plt\n'), ((1726, 1776), 'src.plot_helpers.matplotlib_helpers.range_axis_ticks', '_range_axis_ticks', (['ax', '"""x"""', 'x_intervals'], {'fmt': 'x_fmt'}), "(ax, 'x', x_intervals, ... |
"""
This files only purpose is to pretty print the given map.
Input to printer is a map, the path the robot took and a planned path
if there is no path the robot took or planned path, they args can be left
printer(map, rob_path, planned_path)
result is nothing.
is saves the file in this folder. the name is by defau... | [
"PIL.Image.fromarray",
"numpy.zeros"
] | [((600, 636), 'numpy.zeros', 'np.zeros', (['[x_range + 1, y_range + 1]'], {}), '([x_range + 1, y_range + 1])\n', (608, 636), True, 'import numpy as np\n'), ((831, 851), 'PIL.Image.fromarray', 'Image.fromarray', (['arr'], {}), '(arr)\n', (846, 851), False, 'from PIL import Image\n')] |
#%% Import
import sys
import re
import math
import string
import time
from pathlib import Path
import numpy as np
import pandas as pd
import string
import pickle
from scipy.sparse import hstack
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklea... | [
"pandas.DataFrame",
"numpy.zeros",
"time.time",
"numpy.argsort",
"spacy.load",
"pathlib.Path",
"pickle.load",
"scipy.sparse.hstack",
"gensim.models.KeyedVectors.load_word2vec_format",
"numpy.matmul",
"re.sub",
"pandas.concat",
"nltk.tokenize.word_tokenize"
] | [((644, 655), 'time.time', 'time.time', ([], {}), '()\n', (653, 655), False, 'import time\n'), ((806, 834), 'spacy.load', 'spacy.load', (['"""en_core_web_sm"""'], {}), "('en_core_web_sm')\n", (816, 834), False, 'import spacy\n'), ((2050, 2112), 'gensim.models.KeyedVectors.load_word2vec_format', 'KeyedVectors.load_word2... |
# -*- coding: utf-8 -*-
# =============================================================================
# 2mmn40 week 3 report
# version 2017-12-03 afternoon
# BA
#
#
# for BA: Make sure to run in directory
# C:\Users\20165263\Dropbox\tue\2mmn40\src
#
# ==============================================================... | [
"numpy.sum",
"numpy.nan_to_num",
"numpy.linalg.norm",
"numpy.array",
"numpy.sqrt"
] | [((836, 856), 'numpy.array', 'np.array', (['[1.0, 1.0]'], {}), '([1.0, 1.0])\n', (844, 856), True, 'import numpy as np\n'), ((1078, 1125), 'numpy.array', 'np.array', (['[[0.0, 0.1, -0.1], [1.01, 0.9, 0.95]]'], {}), '([[0.0, 0.1, -0.1], [1.01, 0.9, 0.95]])\n', (1086, 1125), True, 'import numpy as np\n'), ((1147, 1191), ... |
"""
Heuristic agents for various OpenAI Gym environments. The agent policies, in
this case, are deterministic functions, and often handcrafted or found by
non-gradient optimization algorithms, such as evolutionary strategies.
Many of the heuristic policies were adapted from the following source:
```
@book{xiao2022,
... | [
"torch.stack",
"numpy.zeros",
"torch.clip",
"torch.clamp",
"torch.abs"
] | [((1686, 1719), 'torch.clip', 'torch.clip', (['angle_targ', '(-0.4)', '(0.4)'], {}), '(angle_targ, -0.4, 0.4)\n', (1696, 1719), False, 'import torch\n'), ((2194, 2244), 'torch.stack', 'torch.stack', (['[hover * 20 - 1, -angle * 20]'], {'dim': '(-1)'}), '([hover * 20 - 1, -angle * 20], dim=-1)\n', (2205, 2244), False, '... |
import numpy as np
import tensorflow as tf
from baselines.a2c.utils import conv, fc, conv_to_fc, batch_to_seq, seq_to_batch, lstm, lnlstm, sample
class CnnPolicy(object):
def __init__(self, sess, ob_space, ac_space, nenv, nsteps, nstack, reuse=False):
nbatch = nenv*nsteps
#nh, nw, nc = ob_space.s... | [
"baselines.a2c.utils.sample",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.cast",
"baselines.a2c.utils.conv_to_fc",
"baselines.a2c.utils.fc",
"numpy.sqrt"
] | [((435, 496), 'tensorflow.placeholder', 'tf.placeholder', (['tf.uint8'], {'shape': '[nbatch, nh, nw, nc * nstack]'}), '(tf.uint8, shape=[nbatch, nh, nw, nc * nstack])\n', (449, 496), True, 'import tensorflow as tf\n'), ((1515, 1525), 'baselines.a2c.utils.sample', 'sample', (['pi'], {}), '(pi)\n', (1521, 1525), False, '... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from openvino.tools.mo.middle.dequantize_linear_resolver import DequantizeLinearResolver
from openvino.tools.mo.front.common.partial_infer.utils import int64_array
from openvino.tools.mo.utils.ir_engi... | [
"openvino.tools.mo.front.common.partial_infer.utils.int64_array",
"numpy.uint8",
"openvino.tools.mo.utils.ir_engine.compare_graphs.compare_graphs",
"unit_tests.utils.graph.build_graph",
"numpy.float32",
"openvino.tools.mo.middle.dequantize_linear_resolver.DequantizeLinearResolver",
"numpy.array"
] | [((5432, 5492), 'openvino.tools.mo.utils.ir_engine.compare_graphs.compare_graphs', 'compare_graphs', (['graph', 'graph_ref', '"""out"""'], {'check_op_attrs': '(True)'}), "(graph, graph_ref, 'out', check_op_attrs=True)\n", (5446, 5492), False, 'from openvino.tools.mo.utils.ir_engine.compare_graphs import compare_graphs\... |
import numpy as np
import imageio
import matplotlib.pyplot as plt
import random
import sys
import argparse
from numba import jit,jitclass,prange
from numba import int64,float64
'''
Suceptible-Infected-Removed (SIR) [012]
'''
def press(event,obj):
sys.stdout.flush()
if event.key == 'q':
if obj.save:
... | [
"numpy.sum",
"argparse.ArgumentParser",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"sys.stdout.flush",
"numpy.linalg.norm",
"numpy.random.normal",
"matplotlib.pyplot.gca",
"imageio.mimsave",
"matplotlib.pyplot.show",
"numba.jitclass",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.ion... | [((674, 688), 'numba.jitclass', 'jitclass', (['spec'], {}), '(spec)\n', (682, 688), False, 'from numba import jit, jitclass, prange\n'), ((251, 269), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (267, 269), False, 'import sys\n'), ((5019, 5093), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'... |
import numpy as np
def custom_image_generator(generator, directory, class_names, batch_size=16, target_size=(512, 512),
color_mode="grayscale", class_mode="binary", mean=None, std=None, cam=False, verbose=0):
"""
In paper chap 3.1:
we downscale the images to 1024x1024 and normal... | [
"numpy.array"
] | [((1637, 1665), 'numpy.array', 'np.array', (['batch_y_multilabel'], {}), '(batch_y_multilabel)\n', (1645, 1665), True, 'import numpy as np\n'), ((465, 496), 'numpy.array', 'np.array', (['[0.485, 0.456, 0.406]'], {}), '([0.485, 0.456, 0.406])\n', (473, 496), True, 'import numpy as np\n'), ((540, 572), 'numpy.array', 'np... |
import numpy as np
import Levenshtein as Lev
def cer_calculate(s1, s2, no_spaces=False):
"""
Computes the Character Error Rate, defined as the edit distance.
Arguments:
s1 (string): space-separated sentence
s2 (string): space-separated sentence
"""
if no_spaces:
s1, s2, = s... | [
"Levenshtein.distance",
"numpy.array"
] | [((384, 404), 'Levenshtein.distance', 'Lev.distance', (['s1', 's2'], {}), '(s1, s2)\n', (396, 404), True, 'import Levenshtein as Lev\n'), ((1917, 1935), 'numpy.array', 'np.array', (['accuracy'], {}), '(accuracy)\n', (1925, 1935), True, 'import numpy as np\n'), ((2694, 2712), 'numpy.array', 'np.array', (['cer_list'], {}... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 10 10:43:18 2019
@author: nevalaio
"""
import ee
import time
import datetime
import satelliteTools as st
import pandas as pd
from geetools import batch, tools
import numpy as np
ee.Initialize()
#----------------- Sentinel-2 ------------------------... | [
"pandas.DataFrame",
"satelliteTools.sentinelTitle2Datetime",
"ee.Reducer.stdDev",
"satelliteTools.getShapeAtrrtibutesWithIdentifier",
"satelliteTools.wkt2coordinates",
"ee.Reducer.toList",
"ee.FeatureCollection",
"ee.ImageCollection",
"ee.Image",
"time.time",
"geetools.tools.geometry.getRegion",... | [((249, 264), 'ee.Initialize', 'ee.Initialize', ([], {}), '()\n', (262, 264), False, 'import ee\n'), ((625, 636), 'time.time', 'time.time', ([], {}), '()\n', (634, 636), False, 'import time\n'), ((930, 992), 'satelliteTools.getShapeAtrrtibutesWithIdentifier', 'st.getShapeAtrrtibutesWithIdentifier', (['aoi_shp', 'AOI_id... |
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
"""In this script are all modules required for the generator and discriminator"""
### Helper Functions ###
def make_mlp(dim_list, activation_list, batch_norm=False, dropout=0):
"""
Generates MLP network:
Parameters
... | [
"torch.nn.Dropout",
"torch.empty",
"torch.cat",
"torch.randn",
"torch.rand_like",
"numpy.arange",
"torch.arange",
"torch.nn.init.kaiming_normal_",
"torch.nn.init.xavier_uniform",
"torch.Tensor",
"torch.nn.Linear",
"torch.zeros",
"torch.nn.LSTM",
"torch.log",
"torch.nn.Dropout2d",
"torc... | [((1379, 1401), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (1392, 1401), True, 'import torch.nn as nn\n'), ((1850, 1865), 'torch.nn.Sequential', 'nn.Sequential', ([], {}), '()\n', (1863, 1865), True, 'import torch.nn as nn\n'), ((3321, 3336), 'torch.nn.Sequential', 'nn.Sequential', ([], {... |
"""Tools for generating maps from a text search."""
import geopy as gp
import numpy as np
import matplotlib.pyplot as plt
import warnings
from .tile import howmany, bounds2raster, bounds2img, _sm2ll, _calculate_zoom
from .plotting import INTERPOLATION, ZOOM, add_attribution
from . import providers
from ._providers imp... | [
"warnings.warn",
"numpy.random.randint",
"matplotlib.pyplot.subplots",
"geopy.geocoders.Nominatim"
] | [((373, 399), 'numpy.random.randint', 'np.random.randint', (['(1000000)'], {}), '(1000000)\n', (390, 399), True, 'import numpy as np\n'), ((9145, 9352), 'warnings.warn', 'warnings.warn', (['"""The method `plot_map` is deprecated and will be removed from the library in future versions. Please use either `add_basemap` or... |
#!/usr/bin/env python
# Copyright (c) 2017, DIANA-HEP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list ... | [
"numpy.searchsorted",
"numpy.cumsum",
"numpy.array",
"functools.wraps",
"numpy.all"
] | [((3620, 3645), 'functools.wraps', 'functools.wraps', (['function'], {}), '(function)\n', (3635, 3645), False, 'import functools\n'), ((4061, 4086), 'functools.wraps', 'functools.wraps', (['function'], {}), '(function)\n', (4076, 4086), False, 'import functools\n'), ((4509, 4534), 'functools.wraps', 'functools.wraps', ... |
def load_data(logfile=None):
import datetime
import time
import numpy as np
import csv
from datetime import datetime
from keras.preprocessing.sequence import pad_sequences
vocabulary = list()
csvfile = open(logfile, 'r')
if "receipt" in logfile: # For Receipt Dataset
l... | [
"csv.reader",
"numpy.log",
"keras.preprocessing.sequence.pad_sequences",
"datetime.datetime.strptime",
"numpy.mean",
"numpy.array",
"numpy.unique"
] | [((2377, 2436), 'numpy.mean', 'np.mean', (['[item for sublist in timeseqs for item in sublist]'], {}), '([item for sublist in timeseqs for item in sublist])\n', (2384, 2436), True, 'import numpy as np\n'), ((4099, 4121), 'numpy.array', 'np.array', (['prefix_sizes'], {}), '(prefix_sizes)\n', (4107, 4121), True, 'import ... |
from path import Path
import cv2
from tqdm import tqdm
import numpy as np
import matplotlib.pyplot as plt
root =Path('/home/roit/aws/aprojects/xdr94_mono2/mc_test_gt')
out_p = Path('./plasma_gt')
out_p.mkdir_p()
files = root.files()
def main():
cnt=0
for item in tqdm(files):
img = cv2.imread(item)
... | [
"tqdm.tqdm",
"cv2.cvtColor",
"cv2.imread",
"path.Path",
"numpy.mean",
"matplotlib.pyplot.imsave"
] | [((112, 167), 'path.Path', 'Path', (['"""/home/roit/aws/aprojects/xdr94_mono2/mc_test_gt"""'], {}), "('/home/roit/aws/aprojects/xdr94_mono2/mc_test_gt')\n", (116, 167), False, 'from path import Path\n'), ((176, 195), 'path.Path', 'Path', (['"""./plasma_gt"""'], {}), "('./plasma_gt')\n", (180, 195), False, 'from path im... |
"""
General purpose rational polynomial tools
"""
__classification__ = "UNCLASSIFIED"
__author__ = "<NAME>"
import logging
from typing import List, Sequence
import numpy
from numpy.polynomial import polynomial
from scipy.linalg import lstsq, LinAlgError
from sarpy.compliance import SarpyError
logger = logging.getL... | [
"numpy.stack",
"numpy.ndindex",
"numpy.power",
"numpy.polynomial.polynomial.polyval2d",
"numpy.polynomial.polynomial.polyval3d",
"numpy.max",
"numpy.min",
"numpy.array",
"numpy.polynomial.polynomial.polyval",
"scipy.linalg.lstsq",
"logging.getLogger"
] | [((308, 335), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (325, 335), False, 'import logging\n'), ((2705, 2733), 'numpy.ndindex', 'numpy.ndindex', (['shape_details'], {}), '(shape_details)\n', (2718, 2733), False, 'import numpy\n'), ((15941, 15957), 'numpy.min', 'numpy.min', (['array']... |
import math
import numpy as np
from download_mnist import load
import operator
import time
# classify using kNN
# x_train = np.load('../x_train.npy')
# y_train = np.load('../y_train.npy')
# x_test = np.load('../x_test.npy')
# y_test = np.load('../y_test.npy')
x_train, y_train, x_test, y_test = load()
x... | [
"numpy.count_nonzero",
"numpy.argmax",
"download_mnist.load",
"numpy.zeros",
"time.time",
"numpy.argsort",
"numpy.linalg.norm"
] | [((311, 317), 'download_mnist.load', 'load', ([], {}), '()\n', (315, 317), False, 'from download_mnist import load\n'), ((1385, 1396), 'time.time', 'time.time', ([], {}), '()\n', (1394, 1396), False, 'import time\n'), ((709, 740), 'numpy.zeros', 'np.zeros', (['(test_len, train_len)'], {}), '((test_len, train_len))\n', ... |
import argparse
import os
import random
import sys
from pathlib import Path
import numpy as np
import toml
import torch
import torch.distributed as dist
from torch.utils.data import DataLoader, DistributedSampler
sys.path.append(os.path.abspath(os.path.join(__file__, "..", "..", ".."))) # without installation, add /... | [
"numpy.random.seed",
"torch.distributed.init_process_group",
"torch.utils.data.DataLoader",
"argparse.ArgumentParser",
"os.path.basename",
"torch.manual_seed",
"torch.utils.data.DistributedSampler",
"pathlib.Path",
"random.seed",
"audio_zen.utils.initialize_module",
"torch.cuda.set_device",
"o... | [((470, 511), 'torch.manual_seed', 'torch.manual_seed', (["config['meta']['seed']"], {}), "(config['meta']['seed'])\n", (487, 511), False, 'import torch\n'), ((540, 578), 'numpy.random.seed', 'np.random.seed', (["config['meta']['seed']"], {}), "(config['meta']['seed'])\n", (554, 578), True, 'import numpy as np\n'), ((5... |
# -----------------------------------------------------------------------------
# @author:
# <NAME>
# @brief:
# generate the videos into the same directory
# -----------------------------------------------------------------------------
import env_wrapper
import numpy as np
import argparse
import glob
im... | [
"numpy.load",
"os.path.abspath",
"argparse.ArgumentParser",
"cv2.VideoWriter_fourcc",
"env_wrapper.make_env",
"os.path.join"
] | [((509, 571), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Plot results from a dir"""'}), "(description='Plot results from a dir')\n", (532, 571), False, 'import argparse\n'), ((1282, 1343), 'env_wrapper.make_env', 'env_wrapper.make_env', ([], {'args': 'args', 'rand_seed': '(1)', 'allo... |
import copy
import itertools
import re
from typing import Any, Callable, Dict, Generator, Iterator, List, Optional, Union
import numpy as np
import torch
from omegaconf import DictConfig
from torch.nn.utils.rnn import pad_sequence
from torch.utils.data import IterableDataset
from classy.data.data_drivers import Class... | [
"copy.deepcopy",
"classy.utils.commons.flatten",
"classy.utils.commons.chunks",
"re.sub",
"torch.nn.utils.rnn.pad_sequence",
"torch.is_tensor",
"classy.utils.log.get_project_logger",
"numpy.random.shuffle"
] | [((514, 542), 'classy.utils.log.get_project_logger', 'get_project_logger', (['__name__'], {}), '(__name__)\n', (532, 542), False, 'from classy.utils.log import get_project_logger\n'), ((635, 703), 'torch.nn.utils.rnn.pad_sequence', 'pad_sequence', (['tensors'], {'batch_first': '(True)', 'padding_value': 'padding_value'... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
# In[2]:
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import KFold
from sklearn.metrics import accuracy_score
... | [
"sklearn.ensemble.RandomForestClassifier",
"numpy.empty",
"sklearn.metrics.accuracy_score",
"sklearn.model_selection.KFold",
"sklearn.tree.DecisionTreeClassifier",
"numpy.mean"
] | [((408, 429), 'sklearn.model_selection.KFold', 'KFold', ([], {'n_splits': 'folds'}), '(n_splits=folds)\n', (413, 429), False, 'from sklearn.model_selection import KFold\n'), ((986, 1001), 'numpy.mean', 'np.mean', (['scores'], {}), '(scores)\n', (993, 1001), True, 'import numpy as np\n'), ((1184, 1200), 'numpy.empty', '... |
from PIL import Image
import pandas as pd
import numpy as np
import time
import os
import random
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from config import CONFIG
def parse_co... | [
"pandas.DataFrame",
"warnings.simplefilter",
"os.makedirs",
"os.path.exists",
"time.time",
"numpy.cumsum",
"random.random",
"numpy.array",
"inspect.currentframe",
"os.path.join",
"os.listdir"
] | [((216, 278), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (237, 278), False, 'import warnings\n'), ((346, 380), 'os.path.join', 'os.path.join', (['currentdir', '"""assets"""'], {}), "(currentdir, 'assets'... |
import common as com
import matplotlib.pyplot as plt
import os
import numpy as np
def get_xy(file):
import csv
import numpy as np
x = []
y = []
with open(file, 'r') as fh:
open_file = csv.reader(fh, delimiter='\t')
for line in open_file:
x_ = line[0]
... | [
"matplotlib.pyplot.title",
"matplotlib.rc",
"csv.reader",
"argparse.ArgumentParser",
"matplotlib.pyplot.figure",
"os.path.isfile",
"numpy.exp",
"common.plot_hysteresis",
"matplotlib.pyplot.axvline",
"common.saveplot",
"common.get_path",
"matplotlib.pyplot.show",
"common.normalize",
"common... | [((1114, 1149), 'common.print_running_message', 'com.print_running_message', (['__file__'], {}), '(__file__)\n', (1139, 1149), True, 'import common as com\n'), ((1187, 1212), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1210, 1212), False, 'import argparse\n'), ((2263, 2289), 'common.read_ya... |
"""
Tests of noise input.
"""
import unittest
import numpy as np
from chspy import CubicHermiteSpline
from neurolib.models.aln import ALNModel
from neurolib.utils.stimulus import (
ConcatenatedStimulus,
ExponentialInput,
LinearRampInput,
OrnsteinUhlenbeckProcess,
RectifiedInput,
SinusoidalInpu... | [
"neurolib.utils.stimulus.RectifiedInput",
"neurolib.utils.stimulus.StepInput",
"neurolib.utils.stimulus.SinusoidalInput",
"neurolib.utils.stimulus.OrnsteinUhlenbeckProcess",
"numpy.around",
"numpy.mean",
"neurolib.utils.stimulus.LinearRampInput",
"unittest.main",
"neurolib.utils.stimulus.Exponential... | [((580, 612), 'numpy.array', 'np.array', (['[-0.214062, -0.215043]'], {}), '([-0.214062, -0.215043])\n', (588, 612), True, 'import numpy as np\n'), ((632, 662), 'numpy.array', 'np.array', (['[0.193429, 0.073445]'], {}), '([0.193429, 0.073445])\n', (640, 662), True, 'import numpy as np\n'), ((21803, 21818), 'unittest.ma... |
import os
import cv2
import sys
import time
import collections
import torch
import argparse
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from config import *
from torch.autograd import Variable
from torch.utils import data
from dataLoader import TestLoader
import fpn_resnet as models
#impor... | [
"torch.cuda.synchronize",
"os.path.isfile",
"cv2.boxPoints",
"cv2.minAreaRect",
"shutil.rmtree",
"os.path.join",
"torch.utils.data.DataLoader",
"cv2.imwrite",
"torch.load",
"os.path.exists",
"torch.sign",
"cv2.resize",
"torch.jit.trace",
"fpn_resnet.resnet50",
"torch.cuda.is_available",
... | [((5724, 5753), 'cv2.imwrite', 'cv2.imwrite', (['output_path', 'img'], {}), '(output_path, img)\n', (5735, 5753), False, 'import cv2\n'), ((5827, 5854), 'os.path.exists', 'os.path.exists', (['output_Path'], {}), '(output_Path)\n', (5841, 5854), False, 'import os\n'), ((5895, 5919), 'os.makedirs', 'os.makedirs', (['outp... |
# ===================================================================================== #
# Module for solving Ising models exactly.
#
# Distributed with ConIII.
#
# NOTE: This code needs cleanup.
#
# Author : <NAME>, <EMAIL>
# ===================================================================================== #
#
... | [
"numpy.set_printoptions",
"numpy.sum",
"os.makedirs",
"numpy.log",
"numpy.abs",
"os.path.isdir",
"mpmath.log",
"numpy.zeros",
"time.strftime",
"numpy.ones",
"numpy.append",
"numpy.array",
"numpy.exp",
"numpy.argwhere",
"re.sub",
"numpy.all"
] | [((1545, 1587), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'sys.maxsize'}), '(threshold=sys.maxsize)\n', (1564, 1587), True, 'import numpy as np\n'), ((12751, 12770), 'numpy.zeros', 'np.zeros', (['(n, n, n)'], {}), '((n, n, n))\n', (12759, 12770), True, 'import numpy as np\n'), ((3451, 3490), '... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.