code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import tensorflow as tf
from scipy.stats import rankdata
import numpy as np
import os
import time
import datetime
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from builddata_softplus import *
from capsuleNet import CapsE
# Parameters
# ==================================================
parser = A... | [
"numpy.sum",
"argparse.ArgumentParser",
"tensorflow.Session",
"scipy.stats.rankdata",
"tensorflow.set_random_seed",
"numpy.insert",
"tensorflow.ConfigProto",
"numpy.append",
"tensorflow.Variable",
"numpy.array",
"numpy.reshape",
"tensorflow.Graph",
"os.path.join",
"numpy.delete"
] | [((319, 421), 'argparse.ArgumentParser', 'ArgumentParser', (['"""CapsE"""'], {'formatter_class': 'ArgumentDefaultsHelpFormatter', 'conflict_handler': '"""resolve"""'}), "('CapsE', formatter_class=ArgumentDefaultsHelpFormatter,\n conflict_handler='resolve')\n", (333, 421), False, 'from argparse import ArgumentParser,... |
#%%
import matplotlib.pyplot as plt
from numpy import sin, pi
from cmath import phase
import os
def stringToComplex(s):
s = s.replace('\n', '')
s = s.replace('j', '')
s = s.replace(' ', '')
real, imag = tuple( s.split('+') )
real, imag = float(real), float(imag)
return complex(real, imag)
def ... | [
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"os.path.join",
"matplotlib.pyplot.plot",
"cmath.phase",
"os.path.dirname",
"os.system",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.sin",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig"
] | [((457, 484), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 5)'}), '(figsize=(12, 5))\n', (467, 484), True, 'import matplotlib.pyplot as plt\n'), ((487, 501), 'matplotlib.pyplot.plot', 'plt.plot', (['data'], {}), '(data)\n', (495, 501), True, 'import matplotlib.pyplot as plt\n'), ((502, 512), 'matplo... |
import numpy
from matchms import Spectrum
from matplotlib import pyplot as plt
def test_spectrum_plot_with_histogram_unspecified():
mz = numpy.array([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110], dtype="float")
intensities = numpy.array([1, 1, 5, 5, 5, 5, 7, 7, 7, 9, 9], dtype="float")
spectrum = Spectr... | [
"matchms.Spectrum",
"numpy.array"
] | [((144, 218), 'numpy.array', 'numpy.array', (['[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110]'], {'dtype': '"""float"""'}), "([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110], dtype='float')\n", (155, 218), False, 'import numpy\n'), ((237, 298), 'numpy.array', 'numpy.array', (['[1, 1, 5, 5, 5, 5, 7, 7, 7, 9, 9]'], {'dtyp... |
# third party
import numpy as np
import pytest
# syft absolute
from syft import deserialize
from syft import serialize
from syft.core.adp.entity import Entity
from syft.core.tensor.tensor import Tensor
gonzalo = Entity(name="Gonzalo")
@pytest.fixture(scope="function")
def x() -> Tensor:
x = Tensor(np.array([[1,... | [
"syft.deserialize",
"syft.serialize",
"pytest.fixture",
"syft.core.adp.entity.Entity",
"numpy.array"
] | [((214, 236), 'syft.core.adp.entity.Entity', 'Entity', ([], {'name': '"""Gonzalo"""'}), "(name='Gonzalo')\n", (220, 236), False, 'from syft.core.adp.entity import Entity\n'), ((240, 272), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (254, 272), False, 'import pytest\n')... |
# -*- coding: utf-8 -*-
'''
Multiclass Budget Support Vector Machine under POM6
'''
__author__ = "<NAME>"
__date__ = "Apr. 2021"
import numpy as np
from MMLL.models.Common_to_all_POMs import Common_to_all_POMs
from transitions import State
from transitions.extensions import GraphMachine
from sklearn.metri... | [
"pickle.dump",
"numpy.random.seed",
"numpy.sum",
"numpy.argmax",
"numpy.ones",
"numpy.linalg.norm",
"numpy.exp",
"numpy.random.normal",
"transitions.extensions.GraphMachine",
"numpy.multiply",
"numpy.max",
"transitions.State",
"dill.dumps",
"numpy.min",
"numpy.linalg.inv",
"numpy.dot",... | [((770, 781), 'time.time', 'time.time', ([], {}), '()\n', (779, 781), False, 'import time\n'), ((833, 858), 'numpy.random.seed', 'np.random.seed', ([], {'seed': 'seed'}), '(seed=seed)\n', (847, 858), True, 'import numpy as np\n'), ((1410, 1446), 'numpy.exp', 'np.exp', (['(-XC2 / 2.0 / self.sigma ** 2)'], {}), '(-XC2 / ... |
import pytest
import os
import pandas as pd
import riptable as rt
from enum import IntEnum
from numpy.testing import assert_array_equal
from riptable import *
from riptable import save_sds, load_sds
from riptable import FastArray, Categorical, CatZero
from riptable.rt_categorical import Categories
from ript... | [
"riptable.rt_enum.FILTERED_LONG_NAME.encode",
"os.remove",
"riptable.tests.utils.LikertDecision.__members__.values",
"riptable.FastArray",
"riptable.hstack",
"riptable.rt_categorical.Categories",
"pytest.mark.parametrize",
"riptable.tests.test_utils.get_all_categorical_data",
"riptable.rt_numpy.isno... | [((861, 876), 'riptable.rt_sds.SDSMakeDirsOn', 'SDSMakeDirsOn', ([], {}), '()\n', (874, 876), False, 'from riptable.rt_sds import SDSMakeDirsOn\n'), ((963, 992), 'riptable.FastArray', 'FastArray', (["[b'a', b'b', b'c']"], {}), "([b'a', b'b', b'c'])\n", (972, 992), False, 'from riptable import FastArray, Categorical, Ca... |
import numpy as np
from scipy import io, sparse, linalg
# run this from elegant scipy chapter
chem = np.load('chem-network.npy')
gap = np.load('gap-network.npy')
neuron_types = np.load('neuron-types.npy')
neuron_ids = np.load('neurons.npy')
A = chem + gap
n = A.shape[0]
c = (A + A.T) / 2
d = sparse.diags([np.sum(c, ax... | [
"numpy.load",
"numpy.sum",
"numpy.copy",
"matplotlib.pyplot.plot",
"scipy.linalg.eig",
"numpy.nonzero",
"matplotlib.pyplot.text",
"numpy.array",
"numpy.arange",
"numpy.sign",
"numpy.linalg.pinv",
"matplotlib.colors.ListedColormap"
] | [((102, 129), 'numpy.load', 'np.load', (['"""chem-network.npy"""'], {}), "('chem-network.npy')\n", (109, 129), True, 'import numpy as np\n'), ((136, 162), 'numpy.load', 'np.load', (['"""gap-network.npy"""'], {}), "('gap-network.npy')\n", (143, 162), True, 'import numpy as np\n'), ((178, 205), 'numpy.load', 'np.load', (... |
'''
Define the operations used to denoise the image.
'''
import cv2
import numpy as np
def denoise(frame, useMorphOps = True, useGaussianBlur = True):
if useMorphOps:
kernel = np.ones((5,5),np.uint8)
frame = cv2.morphologyEx(frame, cv2.MORPH_OPEN, kernel)
frame = cv2.morphologyEx(frame, cv2... | [
"cv2.morphologyEx",
"numpy.ones",
"cv2.GaussianBlur"
] | [((189, 214), 'numpy.ones', 'np.ones', (['(5, 5)', 'np.uint8'], {}), '((5, 5), np.uint8)\n', (196, 214), True, 'import numpy as np\n'), ((229, 276), 'cv2.morphologyEx', 'cv2.morphologyEx', (['frame', 'cv2.MORPH_OPEN', 'kernel'], {}), '(frame, cv2.MORPH_OPEN, kernel)\n', (245, 276), False, 'import cv2\n'), ((293, 341), ... |
""" ###################### EDGE ####################"""
import numpy as np
from collections import defaultdict
class vertex:
def __init__(self, type, node, id):
"""
:param node:
"""
self.id = id
self.Type = type
self.Cells = node
self.Trains = []
... | [
"collections.defaultdict",
"numpy.unique"
] | [((417, 434), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (428, 434), False, 'from collections import defaultdict\n'), ((1552, 1577), 'numpy.unique', 'np.unique', (['self.TrainsDir'], {}), '(self.TrainsDir)\n', (1561, 1577), True, 'import numpy as np\n')] |
import numpy as np
from matplotlib import pyplot as plt, gridspec as gridspec
import seaborn as sns
import matplotlib as mpl
import matplotlib.cm as cm
from rl_agents.utils import remap, constrain
class DQNGraphics(object):
"""
Graphical visualization of the DQNAgent state-action values.
"""
RED ... | [
"matplotlib.pyplot.subplot",
"torch.tensor",
"matplotlib.colors.Normalize",
"pygame.draw.rect",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.figure",
"rl_agents.utils.remap",
"numpy.array",
"numpy.shape",
"seaborn.color_palette",
"pygame.font.Font",
"numpy.linalg.nor... | [((5249, 5261), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (5257, 5261), True, 'import numpy as np\n'), ((6396, 6412), 'matplotlib.pyplot.pause', 'plt.pause', (['(0.001)'], {}), '(0.001)\n', (6405, 6412), True, 'from matplotlib import pyplot as plt, gridspec as gridspec\n'), ((6421, 6431), 'matplotlib.pyplot.dr... |
import datetime as DT
import numpy as NP
import matplotlib.pyplot as PLT
import matplotlib.colors as PLTC
import scipy.constants as FCNST
from astropy.io import fits
from astropy.io import ascii
from astropy.table import Table
import progressbar as PGB
import antenna_array as AA
import geometry as GEOM
import my_DSP_mo... | [
"antenna_array.InterferometerArray",
"numpy.random.uniform",
"numpy.random.seed",
"numpy.abs",
"numpy.sum",
"sim_observe.stochastic_E_timeseries",
"numpy.ones",
"datetime.datetime.now",
"numpy.hstack",
"matplotlib.pyplot.figure",
"numpy.mean",
"antenna_array.NewImage",
"numpy.loadtxt",
"nu... | [((608, 680), 'numpy.loadtxt', 'NP.loadtxt', (['antenna_file'], {'skiprows': '(6)', 'comments': '"""#"""', 'usecols': '(0, 1, 2, 3)'}), "(antenna_file, skiprows=6, comments='#', usecols=(0, 1, 2, 3))\n", (618, 680), True, 'import numpy as NP\n'), ((696, 719), 'numpy.mean', 'NP.mean', (['ant_info[:, 1]'], {}), '(ant_inf... |
from torch.autograd import Variable
from net_gan_mnist import *
import torch
import torch.nn as nn
import numpy as np
from init import *
class MNISTGanTrainer(object):
def __init__(self, batch_size=64, latent_dims=100):
super(MNISTGanTrainer, self).__init__()
self.dis = Dis28x28()
self.gen... | [
"numpy.zeros",
"numpy.ones",
"torch.max",
"torch.nn.functional.cross_entropy"
] | [((1144, 1203), 'torch.nn.functional.cross_entropy', 'nn.functional.cross_entropy', (['true_outputs', 'self.true_labels'], {}), '(true_outputs, self.true_labels)\n', (1171, 1203), True, 'import torch.nn as nn\n'), ((1231, 1262), 'torch.max', 'torch.max', (['true_outputs.data', '(1)'], {}), '(true_outputs.data, 1)\n', (... |
from controller import *
import random
from keras.optimizers import Adam
from keras.models import Sequential
from keras.layers.core import Dense, Dropout
from keras.utils.np_utils import to_categorical
import numpy as np
class CellItemType(enum.Enum):
WALL = -1
EMPTY = 0
BODY = 1
HEAD = 2
FRUIT ... | [
"keras.layers.core.Dense",
"numpy.argmax",
"numpy.asarray",
"keras.optimizers.Adam",
"keras.models.Sequential"
] | [((2644, 2662), 'numpy.asarray', 'np.asarray', (['vision'], {}), '(vision)\n', (2654, 2662), True, 'import numpy as np\n'), ((5964, 5981), 'numpy.asarray', 'np.asarray', (['board'], {}), '(board)\n', (5974, 5981), True, 'import numpy as np\n'), ((6052, 6064), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#%%
from numpy import *
import numpy as np
import torch
import aTEAM.nn.functional as aF
#%%
a = np.arange(10)
a = a[:,None]+a[None,:]
b = torch.from_numpy(a)
print(np.roll(a, shift=[0,1],axis=[1,0])-aF.roll(b, shift=[0,1],axis=[1,0]).data.numpy())
print(np.roll(a, shift=[... | [
"aTEAM.nn.functional.roll",
"numpy.roll",
"numpy.arange",
"torch.from_numpy"
] | [((143, 156), 'numpy.arange', 'np.arange', (['(10)'], {}), '(10)\n', (152, 156), True, 'import numpy as np\n'), ((185, 204), 'torch.from_numpy', 'torch.from_numpy', (['a'], {}), '(a)\n', (201, 204), False, 'import torch\n'), ((212, 249), 'numpy.roll', 'np.roll', (['a'], {'shift': '[0, 1]', 'axis': '[1, 0]'}), '(a, shif... |
"""Most test exploit the special case where simulate_moments just returns parameters."""
import itertools
import warnings
import numpy as np
import pandas as pd
import pytest
from estimagic.estimation.estimate_msm import estimate_msm
from estimagic.shared.check_option_dicts import check_numdiff_options
from estimagic.... | [
"pandas.DataFrame",
"estimagic.shared.check_option_dicts.check_numdiff_options",
"warnings.filterwarnings",
"estimagic.estimation.estimate_msm.estimate_msm",
"numpy.zeros",
"pytest.raises",
"estimagic.shared.check_option_dicts.check_optimization_options",
"warnings.catch_warnings",
"pytest.mark.para... | [((761, 781), 'numpy.diag', 'np.diag', (['[1, 2, 3.0]'], {}), '([1, 2, 3.0])\n', (768, 781), True, 'import numpy as np\n'), ((791, 811), 'pandas.DataFrame', 'pd.DataFrame', (['cov_np'], {}), '(cov_np)\n', (803, 811), True, 'import pandas as pd\n'), ((947, 1015), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 9 11:59:51 2021
@author: Daniel
"""
import numpy as np
from get_sudoku import get_sudoku_
from copy import deepcopy
def look_row(row):
#creates local set for current square
local_set_row = {i for i in range(1,10)}
#iterates... | [
"copy.deepcopy",
"numpy.sum",
"get_sudoku.get_sudoku_"
] | [((4135, 4155), 'copy.deepcopy', 'deepcopy', (['candidates'], {}), '(candidates)\n', (4143, 4155), False, 'from copy import deepcopy\n'), ((8732, 8745), 'get_sudoku.get_sudoku_', 'get_sudoku_', ([], {}), '()\n', (8743, 8745), False, 'from get_sudoku import get_sudoku_\n'), ((7630, 7652), 'numpy.sum', 'np.sum', (['sudok... |
import math
import numpy as np
import torch
from sklearn.metrics import average_precision_score, roc_auc_score
def choose_target(model,memory_s, memory_g, src_mem):
u = model.memory_merge(memory_s[1], memory_g[1]) #[num_nodes,mem_d]
u_norm = torch.norm(u, dim=1) #[num_nodes, 1]
u_normalized = u/u_norm.view(-1,... | [
"math.ceil",
"torch.norm",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"torch.no_grad",
"torch.sort"
] | [((248, 268), 'torch.norm', 'torch.norm', (['u'], {'dim': '(1)'}), '(u, dim=1)\n', (258, 268), False, 'import torch\n'), ((361, 387), 'torch.norm', 'torch.norm', (['src_mem'], {'dim': '(1)'}), '(src_mem, dim=1)\n', (371, 387), False, 'import torch\n'), ((605, 648), 'torch.sort', 'torch.sort', (['cos_similarity'], {'des... |
__author__ = 'Zander'
from pygame import gfxdraw
from Vector2 import Vector2
from Vector4 import Vector4
from Vector3 import Vector3
from Matrix4 import Matrix4
import math, pygame
import numpy as np
class Renderer:
def __init__(self, screen, width, height, scale=1):
self.width = width
self.heig... | [
"Vector2.Vector2",
"pygame.gfxdraw.pixel",
"math.radians",
"Vector3.Vector3",
"Matrix4.Matrix4",
"numpy.dot",
"pygame.draw.polygon",
"Vector4.Vector4"
] | [((383, 392), 'Matrix4.Matrix4', 'Matrix4', ([], {}), '()\n', (390, 392), False, 'from Matrix4 import Matrix4\n'), ((5489, 5596), 'Vector3.Vector3', 'Vector3', (['(projectedVector[0] + self.width / 2)', '(projectedVector[1] + self.height / 2)', 'projectedVector[2]'], {}), '(projectedVector[0] + self.width / 2, projecte... |
import astropy.units as u
from numpy.linalg import norm
from .izzo import lambert as lambert_izzo
class Maneuver:
r"""Class to represent a Maneuver.
Each ``Maneuver`` consists on a list of impulses :math:`\Delta v_i`
(changes in velocity) each one applied at a certain instant :math:`t_i`.
You can ac... | [
"numpy.linalg.norm",
"astropy.units.quantity_input"
] | [((1476, 1516), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'dts': 'u.s', 'dvs': '(u.m / u.s)'}), '(dts=u.s, dvs=u.m / u.s)\n', (1492, 1516), True, 'import astropy.units as u\n'), ((3069, 3077), 'numpy.linalg.norm', 'norm', (['dv'], {}), '(dv)\n', (3073, 3077), False, 'from numpy.linalg import norm\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import importlib
from cosyai.dataset.base import _BaseDataset
from cosyai.util import check_config_none
class RandSet(_BaseDataset):
def __init__(self, conf):
super().__init__(conf)
check_config_none(conf, ["input_dim", "output_dim"... | [
"numpy.sum",
"importlib.import_module",
"numpy.asarray",
"cosyai.util.check_config_none",
"numpy.random.randint",
"numpy.random.rand"
] | [((270, 338), 'cosyai.util.check_config_none', 'check_config_none', (['conf', "['input_dim', 'output_dim', 'dataset_size']"], {}), "(conf, ['input_dim', 'output_dim', 'dataset_size'])\n", (287, 338), False, 'from cosyai.util import check_config_none\n'), ((717, 750), 'numpy.random.rand', 'np.random.rand', (['num', '(1)... |
'''
Code from
https://github.com/matheusgadelha/MRTNet/blob/master/models/AutoEncoder.py
https://github.com/matheusgadelha/MRTNet/blob/master/models/MRTDecoder.py
revised by <NAME>
'''
import torch
import torch.nn as nn
import numpy as np
import math
from torch.nn import Sequential, Linear, ModuleList
tree_arch = {}
... | [
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.nn.ModuleList",
"torch.nn.Tanh",
"torch.nn.ConvTranspose1d",
"numpy.min",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"math.log2",
"torch.transpose"
] | [((876, 930), 'torch.nn.Linear', 'Linear', (['self.z_dim', '(self.base_size * self.feat_dims[0])'], {}), '(self.z_dim, self.base_size * self.feat_dims[0])\n', (882, 930), False, 'from torch.nn import Sequential, Linear, ModuleList\n'), ((1088, 1111), 'torch.nn.ModuleList', 'ModuleList', (['upconv_list'], {}), '(upconv_... |
# Copyright 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, modify, merge, publish, distribute, subl... | [
"scipy.stats.gamma.rvs",
"numpy.random.randn",
"numpy.zeros",
"scipy.stats.cauchy.rvs",
"numpy.linalg.norm"
] | [((1397, 1425), 'numpy.zeros', 'np.zeros', (['shape'], {'dtype': 'dtype'}), '(shape, dtype=dtype)\n', (1405, 1425), True, 'import numpy as np\n'), ((2233, 2260), 'numpy.linalg.norm', 'np.linalg.norm', (['out'], {'axis': '(0)'}), '(out, axis=0)\n', (2247, 2260), True, 'import numpy as np\n'), ((1575, 1598), 'numpy.rando... |
"""
Build JobStats (returned to the client after job completion) - based mostly on the DataFrame of collected metrics from
the invoker and all workers.
"""
# Copyright 2021 The Funnel Rocket Maintainers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complian... | [
"frocket.invoker.metrics_frame.MetricsFrame",
"frocket.common.config.config.init_logging",
"numpy.ceil",
"frocket.common.config.config.get",
"frocket.common.tasks.base.JobDatasetStats",
"sys.exit",
"numpy.isnan",
"pandas.read_parquet",
"frocket.common.tasks.base.JobStats",
"frocket.common.dataset.... | [((1379, 1406), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1396, 1406), False, 'import logging\n'), ((7793, 7866), 'frocket.common.config.config.init_logging', 'config.init_logging', ([], {'force_level': 'logging.DEBUG', 'force_console_output': '(True)'}), '(force_level=logging.DEBUG... |
import warnings
from io import BytesIO
from tempfile import NamedTemporaryFile
import onnx
import torch.nn
from torch.nn import Module
import torch.nn.functional as F
from torchvision import models
from numpy.testing import assert_almost_equal
import numpy as np
import tensorflow as tf
from onnx2keras import onnx2ker... | [
"tempfile.NamedTemporaryFile",
"io.BytesIO",
"warnings.simplefilter",
"numpy.testing.assert_almost_equal",
"onnx2keras.onnx2keras",
"torch.nn.functional.avg_pool2d",
"tensorflow.__version__.split",
"torch.nn.functional.adaptive_avg_pool2d",
"warnings.catch_warnings",
"torch.nn.Module.__init__",
... | [((515, 524), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (522, 524), False, 'from io import BytesIO\n'), ((733, 746), 'onnx.load', 'onnx.load', (['fd'], {}), '(fd)\n', (742, 746), False, 'import onnx\n'), ((2004, 2042), 'numpy.testing.assert_almost_equal', 'assert_almost_equal', (['y1', 'y2', 'precition'], {}), '(y1, y... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# nnutil2 - Tensorflow utilities for training neural networks
# Copyright (c) 2019, <NAME> <<EMAIL>>
#
# This file is part of 'nnutil2'.
#
# This file may be modified and distributed under the terms of the 3-clause BSD
# license. See the LICENSE file for details.
import... | [
"tensorflow.dtype.as_dtype",
"tensorflow.sparse.to_dense",
"tensorflow.nest.is_nested",
"tensorflow.nest.map_structure",
"numpy.array"
] | [((483, 511), 'tensorflow.nest.is_nested', 'tf.nest.is_nested', (['structure'], {}), '(structure)\n', (500, 511), True, 'import tensorflow as tf\n'), ((1310, 1338), 'tensorflow.nest.is_nested', 'tf.nest.is_nested', (['structure'], {}), '(structure)\n', (1327, 1338), True, 'import tensorflow as tf\n'), ((528, 571), 'ten... |
#!/usr/bin/env python3.7
#
# Copyright (c) University of Luxembourg 2021.
# Created by <NAME>, <EMAIL>, SnT, 2021.
#
import argparse
import numpy
from utilities import print_new_test, is_int, cosine, euclidean, searchStringInFile
parser = argparse.ArgumentParser()
parser.add_argument('--name', type=str)
parser.add_... | [
"utilities.searchStringInFile",
"argparse.ArgumentParser",
"utilities.cosine",
"utilities.print_new_test",
"numpy.array",
"utilities.is_int"
] | [((243, 268), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (266, 268), False, 'import argparse\n'), ((2739, 2771), 'utilities.print_new_test', 'print_new_test', (['result', 'distance'], {}), '(result, distance)\n', (2753, 2771), False, 'from utilities import print_new_test, is_int, cosine, eu... |
import numpy
def permute_node(node, permutation_index, axis=-1):
"""Permute index of `node` array
Args:
node (numpy.ndarray): the array whose `axis` to be permuted.
permutation_index (numpy.ndarray): 1d numpy array whose size should be
same as permutation axis of `node`.
a... | [
"numpy.zeros_like",
"numpy.take"
] | [((2052, 2073), 'numpy.zeros_like', 'numpy.zeros_like', (['adj'], {}), '(adj)\n', (2068, 2073), False, 'import numpy\n'), ((654, 700), 'numpy.take', 'numpy.take', (['node', 'permutation_index'], {'axis': 'axis'}), '(node, permutation_index, axis=axis)\n', (664, 700), False, 'import numpy\n')] |
import cv2
import numpy as np
from random import randint
from scipy.optimize import least_squares
from math import sqrt, atan2
def get_8_points(len_features):
"""
Function to get 8 indices of random points
Implements the 8-point algorithm
:param len_features: total no. of features retrieved from featu... | [
"math.atan2",
"numpy.empty",
"numpy.shape",
"numpy.linalg.svd",
"random.randint",
"numpy.identity",
"numpy.insert",
"scipy.optimize.least_squares",
"numpy.reshape",
"numpy.linalg.det",
"math.sqrt",
"cv2.FlannBasedMatcher",
"numpy.hstack",
"numpy.squeeze",
"numpy.dot",
"numpy.vstack",
... | [((575, 603), 'random.randint', 'randint', (['(0)', '(len_features - 1)'], {}), '(0, len_features - 1)\n', (582, 603), False, 'from random import randint\n'), ((964, 1071), 'numpy.array', 'np.array', (['[[focal_lengths[0], 0, principal_pts[0]], [0, focal_lengths[1],\n principal_pts[1]], [0, 0, 1]]'], {}), '([[focal_... |
import time
import configparser
import numpy as np
import re
class PowerSupplyCalib(object):
def __init__(self, ps, vstart, vend, vstep, scan_speed=1.5):
self.vstart = vstart
self.vend = vend
self.vstep = vstep
self.scan_vals = np.arange(self.vstart, self.vend+(0.5*self.vstep), s... | [
"time.sleep",
"configparser.ConfigParser",
"numpy.arange",
"re.compile"
] | [((268, 332), 'numpy.arange', 'np.arange', (['self.vstart', '(self.vend + 0.5 * self.vstep)', 'self.vstep'], {}), '(self.vstart, self.vend + 0.5 * self.vstep, self.vstep)\n', (277, 332), True, 'import numpy as np\n'), ((514, 548), 're.compile', 're.compile', (['"""address\\\\.([0-9]{3})"""'], {}), "('address\\\\.([0-9]... |
import numpy as np
import pickle
import contrib_to_behavior
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from sklearn import svm
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
plt.rcParams["font.family"] = "arial"
class neural_analysis:
... | [
"numpy.sum",
"numpy.arctan2",
"numpy.maximum",
"numpy.argmax",
"numpy.abs",
"numpy.floor",
"numpy.ones",
"numpy.isnan",
"numpy.argsort",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"numpy.sin",
"sklearn.svm.SVC",
"matplotlib.patches.Patch",
"numpy.diag",
"matplotlib.pyp... | [((54515, 54541), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 4)'}), '(figsize=(8, 4))\n', (54525, 54541), True, 'import matplotlib.pyplot as plt\n'), ((54549, 54571), 'numpy.arange', 'np.arange', (['(0)', '(2700)', 'dt'], {}), '(0, 2700, dt)\n', (54558, 54571), True, 'import numpy as np\n'), ((5568... |
import unittest
import numpy as np
from trip_kinematics.Utility import Rotation as R
class TestStates(unittest.TestCase):
"""Correct results were generated using scipy.spatial.transform.Rotation.
"""
def test_from_euler_to_quat(self):
from_euler_cases = [
([1, 2, 3],
... | [
"trip_kinematics.Utility.Rotation.from_matrix",
"numpy.array",
"trip_kinematics.Utility.Rotation.from_euler"
] | [((5515, 5730), 'numpy.array', 'np.array', (['[[0.41198224566568303, -0.8337376517741568, -0.3676304629248995], [-\n 0.058726644927620864, -0.4269176212762076, 0.902381585483331], [-\n 0.9092974268256819, -0.35017548837401474, -0.2248450953661529]]'], {}), '([[0.41198224566568303, -0.8337376517741568, -0.36763046... |
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import cv2
import glob
import numpy as np
from PIL import Image
from core.utils import load_image, deprocess_image, preprocess_image
from core.networks import unet_spp_large_swish_generator_model
from core.dcp import estimate_transmission
img_size = 51... | [
"core.utils.deprocess_image",
"os.makedirs",
"core.dcp.estimate_transmission",
"os.path.basename",
"cv2.cvtColor",
"numpy.concatenate",
"cv2.imwrite",
"os.path.exists",
"PIL.Image.open",
"cv2.imread",
"numpy.array",
"numpy.reshape",
"os.path.splitext",
"core.networks.unet_spp_large_swish_g... | [((1240, 1278), 'core.networks.unet_spp_large_swish_generator_model', 'unet_spp_large_swish_generator_model', ([], {}), '()\n', (1276, 1278), False, 'from core.networks import unet_spp_large_swish_generator_model\n'), ((371, 411), 'cv2.resize', 'cv2.resize', (['cv_img', '(img_size, img_size)'], {}), '(cv_img, (img_size... |
from OT.PSD import OT_PSD
from basic.select import select_file
from basic.filter import MA
from matplotlib import rcParams
rcParams["font.family"] = "sans-serif"
rcParams["font.sans-serif"] = ["Arial"]
rcParams.update({'font.size': 18})
import pandas as pd
import numpy as np
import random
import math
import matplotlib.... | [
"matplotlib.pyplot.plot",
"random.uniform",
"matplotlib.rcParams.update",
"numpy.isnan",
"pandas.read_excel",
"numpy.sort",
"matplotlib.pyplot.figure",
"numpy.append",
"numpy.array",
"numpy.argsort",
"basic.filter.MA",
"numpy.mean",
"matplotlib.pyplot.subplots"
] | [((202, 236), 'matplotlib.rcParams.update', 'rcParams.update', (["{'font.size': 18}"], {}), "({'font.size': 18})\n", (217, 236), False, 'from matplotlib import rcParams\n'), ((1686, 1705), 'pandas.read_excel', 'pd.read_excel', (['path'], {}), '(path)\n', (1699, 1705), True, 'import pandas as pd\n'), ((2757, 2786), 'mat... |
import copy
import h5py
import math
import numpy as np
import os
import torch
from torch.utils.data import Dataset
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOR_DIR = os.path.dirname(BASE_DIR)
sys.path.append(ROOR_DIR)
from utils import random_select_points, shift_point_cloud, jitter_point_cl... | [
"sys.path.append",
"numpy.isin",
"os.path.abspath",
"h5py.File",
"numpy.random.seed",
"copy.deepcopy",
"math.ceil",
"os.path.dirname",
"utils.generate_random_rotation_matrix",
"utils.generate_random_tranlation_vector",
"numpy.unique",
"utils.jitter_point_cloud",
"utils.shuffle_pc",
"utils.... | [((193, 218), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR'], {}), '(BASE_DIR)\n', (208, 218), False, 'import os\n'), ((219, 244), 'sys.path.append', 'sys.path.append', (['ROOR_DIR'], {}), '(ROOR_DIR)\n', (234, 244), False, 'import sys\n'), ((155, 180), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(_... |
from astropy.table import Table
from astropy.io import fits
from GPSTiming.interpolation import interpolate_boardtimes
from numpy import diff
def test_time_differences_greater_zero(path: str):
fits_file = fits.open(path)
table = Table(fits_file[1].data)
fits_file.close()
table = interpolate_boardtimes... | [
"numpy.diff",
"astropy.table.Table",
"astropy.io.fits.open",
"GPSTiming.interpolation.interpolate_boardtimes"
] | [((211, 226), 'astropy.io.fits.open', 'fits.open', (['path'], {}), '(path)\n', (220, 226), False, 'from astropy.io import fits\n'), ((239, 263), 'astropy.table.Table', 'Table', (['fits_file[1].data'], {}), '(fits_file[1].data)\n', (244, 263), False, 'from astropy.table import Table\n'), ((298, 327), 'GPSTiming.interpol... |
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
class TransitionPlot:
N_COL = 8
OBJ_NAMES = ['BG', 'SQ', 'SC', 'BQ', 'BC', 'P1', 'P2', 'P3', 'P4']
def __init__(self, num_obj_slots):
assert num_obj_slots in (4,8,9)
self.COLORS = [cm.rainbow(x) for x in np.lins... | [
"numpy.ceil",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplot2grid",
"matplotlib.pyplot.subplots",
"matplotlib.cm.rainbow",
"matplotlib.pyplot.pause",
"numpy.linspace",
"matplotlib.pyplot.tight_layout"
] | [((549, 587), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': 'self.FIGURE_SIZE'}), '(figsize=self.FIGURE_SIZE)\n', (561, 587), True, 'import matplotlib.pyplot as plt\n'), ((2120, 2138), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (2136, 2138), True, 'import matplotlib.pyplot ... |
import time
import numpy as np
import mxnet as mx
import matplotlib.pyplot as plt
from mxnet import nd
from mxnet import autograd
from mxnet import gluon
from mxnet.gluon import nn
def gpu_exists():
try:
mx.nd.zeros((1, ), ctx=mx.gpu(0))
except:
return False
return True
data_ctx = mx.cpu... | [
"matplotlib.pyplot.show",
"mxnet.random.seed",
"mxnet.test_utils.get_mnist",
"numpy.reshape",
"mxnet.cpu",
"mxnet.gpu",
"matplotlib.pyplot.subplots"
] | [((314, 322), 'mxnet.cpu', 'mx.cpu', ([], {}), '()\n', (320, 322), True, 'import mxnet as mx\n'), ((484, 501), 'mxnet.random.seed', 'mx.random.seed', (['(1)'], {}), '(1)\n', (498, 501), True, 'import mxnet as mx\n'), ((535, 560), 'mxnet.test_utils.get_mnist', 'mx.test_utils.get_mnist', ([], {}), '()\n', (558, 560), Tru... |
#!/usr/bin/env python3
import os
import sys
import importlib
import h5py
import random
import numpy as np
from argparse import ArgumentParser
def main():
args = parse_args()
if not importlib.util.find_spec('chimeranet'):
print('ChimeraNet is not installed, import from source.')
sys.path.appen... | [
"chimeranet.models.ChimeraPPModel",
"chimeranet.models.probe_model_shape",
"h5py.File",
"chimeranet.models.load_model",
"argparse.ArgumentParser",
"importlib.util.find_spec",
"random.shuffle",
"numpy.arange",
"keras.callbacks.CSVLogger",
"os.path.split",
"numpy.random.shuffle"
] | [((3651, 3667), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (3665, 3667), False, 'from argparse import ArgumentParser\n'), ((192, 230), 'importlib.util.find_spec', 'importlib.util.find_spec', (['"""chimeranet"""'], {}), "('chimeranet')\n", (216, 230), False, 'import importlib\n'), ((794, 825), 'h5py.... |
import numpy as np
import time
from tscc.optimization.optimizescale import optimizescale
# add constraints according to the a,b,c coefficients of quadratic function
def computescale(a, b, c, iters, stateRobo, limitsRobo,
weightSlack, guessScale, deltaT):
nObst = len(a)
for i in range(iters):... | [
"tscc.optimization.optimizescale.optimizescale",
"numpy.sqrt"
] | [((2468, 2546), 'tscc.optimization.optimizescale.optimizescale', 'optimizescale', (['listLeft', 'listRight', 'stateRobo', 'limitsRobo', 'weightSlack', 'deltaT'], {}), '(listLeft, listRight, stateRobo, limitsRobo, weightSlack, deltaT)\n', (2481, 2546), False, 'from tscc.optimization.optimizescale import optimizescale\n'... |
#!/usr/bin/env python
"""plots.py: plots utility functions."""
__author__ = "<NAME>."
__copyright__ = "Copyright 2020, SuperDARN@VT"
__credits__ = []
__license__ = "MIT"
__version__ = "1.0"
__maintainer__ = "<NAME>."
__email__ = "<EMAIL>"
__status__ = "Research"
import os
import sys
sys.path.extend(["code/", "code/r... | [
"numpy.argmax",
"numpy.ones",
"numpy.argmin",
"matplotlib.pyplot.figure",
"pickle.load",
"matplotlib.colors.LogNorm",
"numpy.arange",
"numpy.sin",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.close",
"sys.path.extend",
"os.path.exists",
"matplotlib.dates.DateFormatter",
"numpy.max",
"d... | [((287, 337), 'sys.path.extend', 'sys.path.extend', (["['code/', 'code/rt/', 'code/sd/']"], {}), "(['code/', 'code/rt/', 'code/sd/'])\n", (302, 337), False, 'import sys\n'), ((4759, 4784), 'pydarn.read_hdw_file', 'pydarn.read_hdw_file', (['rad'], {}), '(rad)\n', (4779, 4784), False, 'import pydarn\n'), ((5661, 5696), '... |
#!/usr/bin/python3
# Tested with Python 3.8.6
#------------------------------------------------------------------------------
# runEmceeAfterglow.py
#------------------------------------------------------------------------------
# Authors: <NAME>, <NAME>
# Oregon State University
#-----------------------------------... | [
"numpy.sum",
"os.unlink",
"numpy.abs",
"numpy.empty",
"time.strftime",
"os.path.isfile",
"os.path.islink",
"numpy.mean",
"shutil.rmtree",
"numpy.random.randn",
"emcee.backends.HDFBackend",
"numpy.savetxt",
"numpy.reshape",
"os.rename",
"multiprocessing.Pool",
"os.listdir",
"numpy.all... | [((1831, 1849), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (1841, 1849), False, 'import os\n'), ((2724, 2757), 'os.path.isfile', 'os.path.isfile', (['(folder + filename)'], {}), '(folder + filename)\n', (2738, 2757), False, 'import os\n'), ((3065, 3111), 'numpy.savetxt', 'np.savetxt', (['params_datafil... |
#!/usr/bin/python
"""
"""
# ----
import json
import tempfile
import itertools
import subprocess
import matplotlib.pyplot as plt
import scipy.stats as stats
from matplotlib.font_manager import FontProperties
# ----
import numpy as np
import pandas as pd
import statsmodels.api as sm
## ------------------------... | [
"matplotlib.pyplot.title",
"numpy.sum",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axvline",
"matplotlib.font_manager.FontProperties",
"numpy.std",
"numpy.max",
"numpy.linspace",
"matplotlib.pyplot.axhline",
"numpy.average",
"numpy.min",
"matplotlib.pyplot.ylabel... | [((4652, 4680), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '[9, 4.8]'}), '(figsize=[9, 4.8])\n', (4662, 4680), True, 'import matplotlib.pyplot as plt\n'), ((4691, 4707), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(111)'], {}), '(111)\n', (4702, 4707), True, 'import matplotlib.pyplot as plt\n'), ((48... |
"""
Regression Using Decision Tree, Random Tree, Bootstrap Aggregating,
and Boosting.
Copyright (c) 2020 <NAME>
"""
import numpy as np
class RTLearner:
def __init__(self, leaf=1, tol=1.0e-6):
"""
leaf Lowest number of leaves
tol Tolerance to group close-valued leaves
... | [
"numpy.absolute",
"numpy.empty",
"numpy.random.randint",
"numpy.array",
"numpy.concatenate"
] | [((1001, 1020), 'numpy.absolute', 'np.absolute', (['(Y - Ym)'], {}), '(Y - Ym)\n', (1012, 1020), True, 'import numpy as np\n'), ((3122, 3133), 'numpy.empty', 'np.empty', (['n'], {}), '(n)\n', (3130, 3133), True, 'import numpy as np\n'), ((1076, 1100), 'numpy.array', 'np.array', (['[-1, Ym, 0, 0]'], {}), '([-1, Ym, 0, 0... |
# -*- coding: utf-8 -*-
""" Module summary description.
More detailed description.
"""
import numpy as np
import networkx as nx
from math import sqrt as msqrt
from numba import njit
from shapely.errors import TopologicalError
from shapely.geometry import MultiPolygon, GeometryCollection, Polygon, box, LineString, ... | [
"shapely.ops.unary_union",
"numba.njit",
"shapely.ops.transform",
"numpy.argmin",
"gistools.coordinates.r_tree_idx",
"numpy.mean",
"shapely.geometry.box",
"shapely.geometry.Point",
"shapely.geometry.Polygon",
"shapely.geometry.LineString",
"numpy.tan",
"numpy.radians",
"shapely.ops.cascaded_... | [((9332, 9338), 'numba.njit', 'njit', ([], {}), '()\n', (9336, 9338), False, 'from numba import njit\n'), ((29009, 29109), 'gistools.utils.check.type.type_assert', 'type_assert', ([], {'polygon1': '(Polygon, MultiPolygon)', 'polygon2': '(Polygon, MultiPolygon)', 'normalized': 'bool'}), '(polygon1=(Polygon, MultiPolygon... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import random
import logging
import datetime
import numpy as np
# padle
import paddle
logger = logging.getLogger(__name__)
def get_logger(log_file=None):# {{{
"""Set logger and return it.
If the log_file is not None, log will be written into log_fil... | [
"numpy.random.seed",
"logging.FileHandler",
"logging.basicConfig",
"os.makedirs",
"os.path.exists",
"datetime.datetime.now",
"logging.Formatter",
"numpy.argsort",
"paddle.seed",
"random.seed",
"numpy.swapaxes",
"os.path.join",
"logging.getLogger"
] | [((155, 182), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (172, 182), False, 'import logging\n'), ((600, 724), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(message)s"""', 'datefmt': '"""%m/%d/%Y %H:%M:%S"""', 'level': 'logging.INFO'}... |
import numpy as np
from cloudvolume import CloudVolume
from cloudvolume.lib import Bbox
from cloudvolume.storage import Storage
from chunkflow.chunk.validate import validate_by_template_matching
from tinybrain import downsample_with_averaging
from chunkflow.chunk import Chunk
from .base import OperatorBase
class Cut... | [
"chunkflow.chunk.validate.validate_by_template_matching",
"numpy.transpose",
"cloudvolume.lib.Bbox.from_slices",
"cloudvolume.CloudVolume",
"numpy.array",
"numpy.alltrue",
"numpy.squeeze",
"cloudvolume.storage.Storage",
"tinybrain.downsample_with_averaging",
"chunkflow.chunk.Chunk",
"chunkflow.c... | [((1446, 1627), 'cloudvolume.CloudVolume', 'CloudVolume', (['self.volume_path'], {'bounded': '(False)', 'fill_missing': 'self.fill_missing', 'progress': 'self.verbose', 'mip': 'self.mip', 'cache': '(False)', 'use_https': 'self.use_https', 'green_threads': '(True)'}), '(self.volume_path, bounded=False, fill_missing=self... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import logging
import matplotlib
import multiprocessing as mp
import numpy as np
import os
import sys
# Fix problem: no $DISPLAY environment variable
matplotlib.use('Agg')
from argparse import ArgumentParser
from datetime import datetime as dt
from pprint import pprint
from... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"os.path.exists",
"core.test.test_net",
"multiprocessing.log_to_stderr",
"matplotlib.use",
"pprint.pprint",
"core.train.train_net",
"datetime.datetime.now",
"sys.exit",
"multiprocessing.get_logger"
] | [((194, 215), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (208, 215), False, 'import matplotlib\n'), ((452, 509), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Parser of Runner of Pix2Vox"""'}), "(description='Parser of Runner of Pix2Vox')\n", (466, 509), False, 'from a... |
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applic... | [
"numpy.transpose",
"os.path.exists",
"numpy.expand_dims",
"time.time",
"numpy.array",
"transforms.det_transforms.Compose",
"numpy.squeeze",
"cv2.resize"
] | [((3044, 3071), 'transforms.det_transforms.Compose', 'transforms.Compose', (['op_list'], {}), '(op_list)\n', (3062, 3071), True, 'import transforms.det_transforms as transforms\n'), ((4717, 4728), 'time.time', 'time.time', ([], {}), '()\n', (4726, 4728), False, 'import time\n'), ((7190, 7211), 'numpy.squeeze', 'np.sque... |
"""FFX.py v1.3 (Sept 16, 2011)
This module implements the Fast Function Extraction (FFX) algorithm.
Reference: <NAME>, FFX: Fast, Scalable, Deterministic Symbolic
Regression Technology, Genetic Programming Theory and Practice IX, Edited by R.
Riolo, <NAME>, and <NAME>, Springer, 2011. http://www.trent.st/ffx
HOW TO... | [
"numpy.abs",
"numpy.ones",
"numpy.clip",
"numpy.argsort",
"numpy.mean",
"numpy.arange",
"numpy.isfinite",
"numpy.reshape",
"signal.alarm",
"numpy.log10",
"scipy.isinf",
"math.sqrt",
"numpy.asarray",
"numpy.asfortranarray",
"scipy.isnan",
"functools.wraps",
"numpy.dot",
"signal.sign... | [((41297, 41318), 'numpy.argsort', 'numpy.argsort', (['cost0s'], {}), '(cost0s)\n', (41310, 41318), False, 'import numpy\n'), ((7638, 7665), 'numpy.zeros', 'numpy.zeros', (['N'], {'dtype': 'float'}), '(N, dtype=float)\n', (7649, 7665), False, 'import numpy\n'), ((7723, 7769), 'itertools.izip', 'itertools.izip', (['self... |
"""
DataContainer class for linking directories containing different sorts of data.
This is meant to make plotting and analysis easier.
TO DO
-----
- request random subsets.
- make sure input directories are iterable
- add features to existing files.
"""
__date__ = "July-November 2019"
import h5py
try:
from numba.... | [
"os.remove",
"ava.models.vae.VAE",
"os.path.join",
"ava.models.vae_dataset.get_syllable_partition",
"torch.load",
"os.path.exists",
"numpy.max",
"warnings.catch_warnings",
"numpy.loadtxt",
"h5py.File",
"ava.models.vae_dataset.get_hdf5s_from_dir",
"umap.UMAP",
"numpy.min",
"torch.cuda.is_av... | [((10192, 10309), 'warnings.warn', 'warnings.warn', (["('clean_projections will be deprecated in v0.3.0. ' +\n 'Use clear_projections instead.')", 'UserWarning'], {}), "('clean_projections will be deprecated in v0.3.0. ' +\n 'Use clear_projections instead.', UserWarning)\n", (10205, 10309), False, 'import warning... |
import os
import sys
import logging as log
import numpy as np
import cv2
from openvino.inference_engine import IENetwork, IECore
class ModelDetection:
'''
Class for the Face Detection Model.
'''
def __init__(self, model_name, device='CPU', extensions=None, threshold=0.5):
self.threshold = thres... | [
"openvino.inference_engine.IENetwork",
"openvino.inference_engine.IECore",
"cv2.dnn.blobFromImage",
"numpy.where",
"numpy.array"
] | [((601, 609), 'openvino.inference_engine.IECore', 'IECore', ([], {}), '()\n', (607, 609), False, 'from openvino.inference_engine import IENetwork, IECore\n'), ((628, 673), 'openvino.inference_engine.IENetwork', 'IENetwork', ([], {'model': 'model_xml', 'weights': 'model_bin'}), '(model=model_xml, weights=model_bin)\n', ... |
# Copyright 2017 Google Inc. 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 applicable law or ag... | [
"tensorflow.python.saved_model.loader.maybe_saved_model_directory",
"base64.b64decode",
"collections.defaultdict",
"logging.critical",
"os.path.join",
"StringIO.StringIO",
"logging.error",
"json.loads",
"tensorflow.python.client.session.Session",
"importlib.import_module",
"pydoc.locate",
"num... | [((2882, 2948), 'collections.namedtuple', 'collections.namedtuple', (['"""PredictionErrorType"""', "('message', 'code')"], {}), "('PredictionErrorType', ('message', 'code'))\n", (2904, 2948), False, 'import collections\n'), ((7173, 7202), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n',... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Fast Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
# Copyright (C) 2017-2020 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: <NAME> (<EMAIL>)
#
# Permission is hereby granted, free of cha... | [
"json.loads",
"pyFAI.utils.mathutil.expand2d",
"numpy.zeros",
"numpy.sin",
"numpy.arange",
"numpy.cos",
"collections.OrderedDict",
"logging.getLogger"
] | [((1690, 1717), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1707, 1717), False, 'import logging\n'), ((2486, 2580), 'collections.OrderedDict', 'OrderedDict', (["(('pixel1', self._pixel1), ('pixel2', self._pixel2), ('radius', self.radius))"], {}), "((('pixel1', self._pixel1), ('pixel2'... |
import h5py
import math
import os
import numpy as np
import torch
import torch.optim as optim
import torch.nn as nn
from net import classifier
from torchlight import torchlight
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv1d') != -1:
m.weight.data.normal_(0.0, 0.02)
... | [
"os.mkdir",
"h5py.File",
"numpy.moveaxis",
"numpy.argmax",
"os.path.isdir",
"numpy.empty",
"torch.load",
"torch.nn.CrossEntropyLoss",
"net.classifier.Classifier",
"numpy.max",
"numpy.mean",
"numpy.array",
"numpy.reshape",
"torchlight.torchlight.IO",
"torch.no_grad",
"os.listdir",
"nu... | [((953, 984), 'os.listdir', 'os.listdir', (['path_to_model_files'], {}), '(path_to_model_files)\n', (963, 984), False, 'import os\n'), ((1202, 1221), 'numpy.argmax', 'np.argmax', (['acc_list'], {}), '(acc_list)\n', (1211, 1221), True, 'import numpy as np\n'), ((1819, 1917), 'torchlight.torchlight.IO', 'torchlight.IO', ... |
# Built in python libs
from typing import List, Tuple, Any
# Additional libs
import numpy as np
import cv2
from numba import jit, njit, prange
# Custom imports
# performs the ratio test on a set of matched keypoints
# the ratio test filters matched keypoints out if they are greater than the minimum seperation betw... | [
"numpy.array",
"numpy.float32",
"numba.jit"
] | [((768, 786), 'numba.jit', 'jit', ([], {'forceobj': '(True)'}), '(forceobj=True)\n', (771, 786), False, 'from numba import jit, njit, prange\n'), ((1142, 1160), 'numba.jit', 'jit', ([], {'forceobj': '(True)'}), '(forceobj=True)\n', (1145, 1160), False, 'from numba import jit, njit, prange\n'), ((1798, 1816), 'numba.jit... |
import numpy
from distutils.core import setup
from Cython.Build import cythonize
setup(
name='features_labels',
ext_modules=cythonize('features_labels.pyx', include_dirs=[numpy.get_include()])
)
| [
"numpy.get_include"
] | [((180, 199), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (197, 199), False, 'import numpy\n')] |
"""
Script for extracting particles from membranes by looking for low pass filtering + non-maximum suppression
Input: - Directory with the _imod.csv files with reference picked particles for each microsome
- Directory with offsets for each microsome in a tomogram
- Directory with the ... | [
"pyseg.globals.lin_map",
"time.strftime",
"numpy.argsort",
"gc.collect",
"pyseg.globals.vect_to_zrelion",
"pyseg.sub.Star",
"csv.DictWriter",
"pyseg.sub.TomoPeaks",
"os.path.exists",
"pyseg.disperse_io.load_tomo",
"pyorg.surf.points_to_poly",
"math.ceil",
"numpy.asarray",
"scipy.ndimage.mo... | [((3509, 3527), 'os.listdir', 'os.listdir', (['in_dir'], {}), '(in_dir)\n', (3519, 3527), False, 'import os\n'), ((4771, 4784), 'pyseg.sub.Star', 'ps.sub.Star', ([], {}), '()\n', (4782, 4784), True, 'import pyseg as ps\n'), ((3969, 3982), 'pyseg.sub.Star', 'ps.sub.Star', ([], {}), '()\n', (3980, 3982), True, 'import py... |
import napari
import os
import shutil
import squidpy as sq
from ngff_tables_prototype.writer import write_spatial_anndata
from ngff_tables_prototype.reader import load_to_napari_viewer
import numpy as np
output_fpath = "test_segment.zarr"
def write_segmentation_adata() -> None:
adata = sq.datasets.mibitof()
... | [
"os.path.isdir",
"squidpy.datasets.mibitof",
"numpy.swapaxes",
"ngff_tables_prototype.reader.load_to_napari_viewer",
"shutil.rmtree",
"napari.run"
] | [((294, 315), 'squidpy.datasets.mibitof', 'sq.datasets.mibitof', ([], {}), '()\n', (313, 315), True, 'import squidpy as sq\n'), ((1163, 1267), 'ngff_tables_prototype.reader.load_to_napari_viewer', 'load_to_napari_viewer', ([], {'file_path': 'output_fpath', 'groups': "['labels/label_image', 'tables/regions_table']"}), "... |
from __future__ import division
import numpy as np
#----------------------------- COSMOS galaxy bias (arXiv:1205.1064) ----------------------------------------
def bias_Amara(z, bias_type, zcutoff):
y = z/(1+z)
ycutoff = zcutoff/(1+zcutoff)
#bias_type --> nn:fifth nearest neighbor or gs: gaussian smoothing
if(bi... | [
"numpy.sqrt"
] | [((629, 643), 'numpy.sqrt', 'np.sqrt', (['(1 + z)'], {}), '(1 + z)\n', (636, 643), True, 'import numpy as np\n')] |
import os
import json
from collections import OrderedDict
import numpy as np
import tensorflow as tf
cur_path = os.path.realpath(__file__)
ROOT_PATH = os.path.dirname(cur_path)
# add any new ops under the following
pose_to_heatmap_fn = tf.load_op_library(
os.path.join(ROOT_PATH, 'pose_to_heatmap.so')).pose_to_heatm... | [
"tensorflow.maximum",
"tensorflow.reshape",
"numpy.ones",
"tensorflow.greater_equal",
"tensorflow.reduce_max",
"tensorflow.greater",
"os.path.join",
"tensorflow.image.crop_to_bounding_box",
"tensorflow.gather",
"os.path.dirname",
"tensorflow.variable_scope",
"tensorflow.stack",
"tensorflow.c... | [((113, 139), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (129, 139), False, 'import os\n'), ((152, 177), 'os.path.dirname', 'os.path.dirname', (['cur_path'], {}), '(cur_path)\n', (167, 177), False, 'import os\n'), ((1670, 1810), 'collections.OrderedDict', 'OrderedDict', (['[(9, 0), (8, ... |
"""
Authors: <NAME>
Contact : https://adityajain.me
"""
import numpy as np
class KNeighborsClassifier():
"""
K Nearest Neighbors Classifier which classifies sample point based on majority of k nearby sample classes
Parameters
----------
n_neighbors : integer (Default 5), number of neighbors to consider
metri... | [
"numpy.abs",
"numpy.square",
"numpy.zeros",
"numpy.expand_dims",
"numpy.array",
"numpy.unique"
] | [((2204, 2219), 'numpy.array', 'np.array', (['probs'], {}), '(probs)\n', (2212, 2219), True, 'import numpy as np\n'), ((1039, 1054), 'numpy.abs', 'np.abs', (['(X1 - X2)'], {}), '(X1 - X2)\n', (1045, 1054), True, 'import numpy as np\n'), ((1883, 1913), 'numpy.expand_dims', 'np.expand_dims', (['sample'], {'axis': '(0)'})... |
"""TFRecords data-loader for audiovisual datasets."""
import functools
from typing import Dict, Iterator, List, Optional, Text, Tuple, Union
from absl import logging
from dmvr import modalities as load_modalities
from flax import jax_utils
import jax
import jax.numpy as jnp
import ml_collections
import numpy as np
fro... | [
"numpy.pad",
"functools.partial",
"scenic.projects.mbt.datasets.dataset_utils.add_spectrogram",
"scenic.dataset_lib.datasets.add_dataset",
"dmvr.modalities.add_label",
"numpy.ones",
"scenic.dataset_lib.dataset_utils.distribute",
"absl.logging.info",
"jax.process_count",
"tensorflow.data.Options",
... | [((15405, 15457), 'scenic.dataset_lib.datasets.add_dataset', 'datasets.add_dataset', (['"""audiovisual_tfrecord_dataset"""'], {}), "('audiovisual_tfrecord_dataset')\n", (15425, 15457), False, 'from scenic.dataset_lib import datasets\n'), ((1900, 1929), 'jax.tree_map', 'jax.tree_map', (['zero_pad', 'batch'], {}), '(zero... |
# -*- coding: utf-8 -*-
# File generated according to Generator/ClassesRef/Simulation/InputFlux.csv
# WARNING! All changes made in this file will be lost!
"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/InputFlux
"""
from os import linesep
from sys import getsizeof... | [
"numpy.array_equal",
"numpy.array",
"sys.getsizeof"
] | [((10431, 10452), 'sys.getsizeof', 'getsizeof', (['self.per_a'], {}), '(self.per_a)\n', (10440, 10452), False, 'from sys import getsizeof\n'), ((10466, 10487), 'sys.getsizeof', 'getsizeof', (['self.per_t'], {}), '(self.per_t)\n', (10475, 10487), False, 'from sys import getsizeof\n'), ((10501, 10529), 'sys.getsizeof', '... |
from __future__ import print_function, absolute_import
import stimela
import stimela.dismissable as sdm
from pyrap.tables import table as tbl
import os
import sys
import argparse
import numpy as np
from collections import OrderedDict
import shutil
import vermeerkat
parser = argparse.ArgumentParser("MeerKAT BasicApply... | [
"stimela.dismissable.dismissable",
"numpy.sum",
"argparse.ArgumentParser",
"shutil.rmtree",
"vermeerkat.log.info",
"os.path.isdir",
"os.path.dirname",
"os.path.exists",
"stimela.register_globals",
"os.environ.get",
"numpy.max",
"numpy.min",
"collections.OrderedDict",
"shutil.copytree",
"... | [((277, 345), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""MeerKAT BasicApplyTransfer (BAT) pipeline"""'], {}), "('MeerKAT BasicApplyTransfer (BAT) pipeline')\n", (300, 345), False, 'import argparse\n'), ((8170, 8228), 'vermeerkat.log.info', 'vermeerkat.log.info', (['"""The following fields are available... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""NAO tasks."""
import itertools
import os
import numpy as np
import torch
import torch.nn.functional as F
from fairseq import utils
from fairseq.data import ConcatDataset, NaoLanguagePairDataset
from fairseq.data.nao_dataset import SingleTensorDataset
from . import regi... | [
"numpy.load",
"numpy.minimum",
"numpy.maximum",
"fairseq.data.ConcatDataset",
"os.path.exists",
"itertools.count",
"numpy.any",
"fairseq.data.NaoLanguagePairDataset.from_base_dataset",
"torch.no_grad",
"fairseq.data.NaoLanguagePairDataset",
"torch.from_numpy"
] | [((1550, 1567), 'itertools.count', 'itertools.count', ([], {}), '()\n', (1565, 1567), False, 'import itertools\n'), ((2826, 2870), 'fairseq.data.ConcatDataset', 'ConcatDataset', (['score_datasets', 'sample_ratios'], {}), '(score_datasets, sample_ratios)\n', (2839, 2870), False, 'from fairseq.data import ConcatDataset, ... |
#! -*- coding: utf-8 -*-
# 用GlobalPointer做中文命名实体识别
# 数据集 https://github.com/CLUEbenchmark/CLUENER2020
import json
import numpy as np
from snippets import *
from bert4keras.backend import keras
from bert4keras.backend import multilabel_categorical_crossentropy
from bert4keras.layers import EfficientGlobalPointer as Glo... | [
"tqdm.tqdm",
"json.loads",
"bert4keras.backend.multilabel_categorical_crossentropy",
"bert4keras.backend.keras.models.Model",
"json.dumps",
"bert4keras.snippets.open",
"numpy.where",
"bert4keras.layers.EfficientGlobalPointer",
"bert4keras.snippets.sequence_padding"
] | [((3612, 3656), 'bert4keras.backend.keras.models.Model', 'keras.models.Model', (['base.model.input', 'output'], {}), '(base.model.input, output)\n', (3630, 3656), False, 'from bert4keras.backend import keras\n'), ((3455, 3580), 'bert4keras.layers.EfficientGlobalPointer', 'GlobalPointer', ([], {'heads': 'num_classes', '... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import csv
array=[['wrong_covid_normal','wrong_covid_pneu','correct_covid'],
['wrong_pneu_normal','correct_pneu','wrong_pneu_covid'],
['correct_normal','wrong_normal_pneu','wrong_normal_covid']]
results={1:{},2:{},3:{},4:{},5:{}... | [
"numpy.array",
"numpy.average",
"matplotlib.pyplot.subplots"
] | [((2672, 2686), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (2684, 2686), True, 'import matplotlib.pyplot as plt\n'), ((5142, 5186), 'numpy.average', 'np.average', (["results['Full'][net][param][:-1]"], {}), "(results['Full'][net][param][:-1])\n", (5152, 5186), True, 'import numpy as np\n'), ((2711,... |
# Python 3.7.6
# -*- coding: utf-8 -*-
# Author: <NAME>
import os
import numpy as np
import torch
from torch.nn.utils.rnn import pad_sequence
char_list = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
len_char_list = len(char_list)
def pad_labels():
path = os.getcwd()
... | [
"numpy.load",
"torch.LongTensor",
"os.getcwd",
"torch.save",
"torch.nn.utils.rnn.pad_sequence",
"torch.from_numpy"
] | [((301, 312), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (310, 312), False, 'import os\n'), ((388, 444), 'numpy.load', 'np.load', (["(path + '/val/val_labels.npy')"], {'allow_pickle': '(True)'}), "(path + '/val/val_labels.npy', allow_pickle=True)\n", (395, 444), True, 'import numpy as np\n'), ((459, 517), 'numpy.load'... |
from copy import deepcopy
import numpy as np
import pickle as pkl
import random
from joblib import Parallel, delayed
from tqdm.notebook import tqdm
import colorednoise as cn
import mne
from time import time
from . import util
DEFAULT_SETTINGS = {
'number_of_sources': (1, 20),
'extents': (1, 50)... | [
"pickle.dump",
"numpy.sum",
"numpy.abs",
"tqdm.notebook.tqdm",
"numpy.clip",
"numpy.mean",
"numpy.arange",
"numpy.sin",
"numpy.std",
"numpy.max",
"numpy.swapaxes",
"numpy.random.shuffle",
"numpy.stack",
"copy.deepcopy",
"colorednoise.powerlaw_psd_gaussian",
"numpy.zeros",
"numpy.expa... | [((2411, 2424), 'copy.deepcopy', 'deepcopy', (['fwd'], {}), '(fwd)\n', (2419, 2424), False, 'from copy import deepcopy\n'), ((4332, 4349), 'tqdm.notebook.tqdm', 'tqdm', (['source_data'], {}), '(source_data)\n', (4336, 4349), False, 'from tqdm.notebook import tqdm\n'), ((8199, 8243), 'numpy.zeros', 'np.zeros', (['(self.... |
# -*- coding: utf-8 -*-
import numpy as np
NUMPY_COMPLEX128_MAX = np.finfo(np.complex128).max
NUMPY_LOG_COMPLEX128_MAX = np.log(NUMPY_COMPLEX128_MAX)
class HestonModel:
def __init__(self, forward, vol, kappa, theta, sigma, rho, rate):
self.forward = forward
self.vol = vol
self.kappa = kapp... | [
"numpy.log",
"numpy.finfo",
"numpy.expm1",
"numpy.sin",
"numpy.exp",
"numpy.cos",
"numpy.cosh",
"numpy.sinh",
"numpy.log1p",
"numpy.sqrt"
] | [((122, 150), 'numpy.log', 'np.log', (['NUMPY_COMPLEX128_MAX'], {}), '(NUMPY_COMPLEX128_MAX)\n', (128, 150), True, 'import numpy as np\n'), ((67, 90), 'numpy.finfo', 'np.finfo', (['np.complex128'], {}), '(np.complex128)\n', (75, 90), True, 'import numpy as np\n'), ((952, 1000), 'numpy.sqrt', 'np.sqrt', (['(beta * beta ... |
import numpy as np
import unittest
from laika.gps_time import GPSTime
from laika import AstroDog
gps_times_list = [[1950, 415621.0],
[1895, 455457.0],
[1885, 443787.0]]
svIds = ['G01', 'G31', 'R08']
gps_times = [GPSTime(*gps_time_list) for gps_time_list in gps_times_list]
class TestAstroDog(unittest.TestCa... | [
"unittest.main",
"numpy.testing.assert_allclose",
"laika.AstroDog",
"laika.gps_time.GPSTime"
] | [((223, 246), 'laika.gps_time.GPSTime', 'GPSTime', (['*gps_time_list'], {}), '(*gps_time_list)\n', (230, 246), False, 'from laika.gps_time import GPSTime\n'), ((1704, 1719), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1717, 1719), False, 'import unittest\n'), ((1070, 1095), 'laika.AstroDog', 'AstroDog', ([], {... |
import numpy as np
a = np.array([1, 2, 3, 4, 5])
np.sum(a ** 2)
| [
"numpy.array",
"numpy.sum"
] | [((23, 48), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (31, 48), True, 'import numpy as np\n'), ((49, 63), 'numpy.sum', 'np.sum', (['(a ** 2)'], {}), '(a ** 2)\n', (55, 63), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 5 12:43:51 2019
@author: Blackr
"""
"""Cyclic Voltammetry (CV) technique class.
The CV technique returns data on fields (in order):
* time (float)
* Ec (float)
* I (float)
* Ewe (float)
* cycle (int)
"""
''' E_we
^
| E_1
... | [
"bio_logic.CV",
"numpy.transpose",
"numpy.append",
"numpy.array",
"bio_logic.SP150"
] | [((2207, 2301), 'bio_logic.SP150', 'SP150', (['ip_address', '"""C:\\\\EC-Lab Development Package\\\\EC-Lab Development Package\\\\EClib.dll"""'], {}), "(ip_address,\n 'C:\\\\EC-Lab Development Package\\\\EC-Lab Development Package\\\\EClib.dll')\n", (2212, 2301), False, 'from bio_logic import SP150, CV\n'), ((2590, ... |
"""
Matplotlib volumetric benchmarking plotting routines.
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Go... | [
"matplotlib.pyplot.title",
"seaborn.set_style",
"matplotlib.cm.get_cmap",
"seaborn.despine",
"numpy.isnan",
"seaborn.color_palette",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"matplotlib.colors.ListedColormap"
] | [((946, 969), 'seaborn.set_style', '_sns.set_style', (['"""white"""'], {}), "('white')\n", (960, 969), True, 'import seaborn as _sns\n'), ((974, 997), 'seaborn.set_style', '_sns.set_style', (['"""ticks"""'], {}), "('ticks')\n", (988, 997), True, 'import seaborn as _sns\n'), ((1136, 1158), 'matplotlib.colors.ListedColor... |
import os
import numpy as np
opj = os.path.join
from astropy.io import fits
data_path = '../../data/cosmology'
def downsample(parameter_file, root_dir, resize=64, nsamples=30000, ncosmo=10):
'''
downsample cosmolgy image
'''
print('preprocessing...')
img_size = 256
params_ = np.loadtxt(para... | [
"numpy.stack",
"numpy.random.randint",
"astropy.io.fits.open",
"numpy.loadtxt"
] | [((1017, 1040), 'numpy.stack', 'np.stack', (['image'], {'axis': '(0)'}), '(image, axis=0)\n', (1025, 1040), True, 'import numpy as np\n'), ((1054, 1078), 'numpy.stack', 'np.stack', (['params'], {'axis': '(0)'}), '(params, axis=0)\n', (1062, 1078), True, 'import numpy as np\n'), ((305, 331), 'numpy.loadtxt', 'np.loadtxt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Core IO, DSP and utility functions."""
import os
import six
import audioread
import numpy as np
import scipy.signal
import scipy.fftpack as fft
import resampy
from .time_frequency import frames_to_samples, time_to_samples
from .. import cache
from .. import util
from ... | [
"numpy.abs",
"resampy.filters.get_filter",
"numpy.mean",
"numpy.arange",
"numpy.sqrt",
"numpy.round",
"resampy.resample",
"six.callable",
"numpy.ceil",
"os.path.realpath",
"audioread.audio_open",
"scipy.fftpack.ifft",
"scipy.fftpack.fft",
"numpy.concatenate",
"numpy.iscomplexobj",
"num... | [((552, 593), 'resampy.filters.get_filter', 'resampy.filters.get_filter', (['"""kaiser_best"""'], {}), "('kaiser_best')\n", (578, 593), False, 'import resampy\n'), ((610, 651), 'resampy.filters.get_filter', 'resampy.filters.get_filter', (['"""kaiser_fast"""'], {}), "('kaiser_fast')\n", (636, 651), False, 'import resamp... |
import tkinter as tk
from collections import deque
from tkinter.constants import BUTT, END, GROOVE, NW, RAISED, RIDGE, S, SUNKEN
import numpy as np
import cv2
from PIL import Image,ImageTk
import os
import face_recognition
import time
window =tk.Tk()
window.option_add("*Font","Helvetica 14")
window.geometr... | [
"numpy.argmin",
"cv2.rectangle",
"tkinter.Label",
"collections.deque",
"tkinter.Button",
"cv2.imwrite",
"os.path.dirname",
"tkinter.Entry",
"os.path.exists",
"cv2.cvtColor",
"face_recognition.face_encodings",
"tkinter.Toplevel",
"tkinter.Tk",
"cv2.resize",
"face_recognition.face_distance... | [((254, 261), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (259, 261), True, 'import tkinter as tk\n'), ((971, 1006), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0 + cv2.CAP_DSHOW)'], {}), '(0 + cv2.CAP_DSHOW)\n', (987, 1006), False, 'import cv2\n'), ((9862, 10013), 'tkinter.Button', 'tk.Button', ([], {'master': 'window', ... |
import numpy as np
import cv2 as cv
import cmath
#cap = cv.VideoCapture(0)
cap = cv.VideoCapture('udpsrc port=5004 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! videoconvert ! appsink', cv.CAP_GSTREAMER)
PI = 3.14159
while(1):
# read the video capture frame
_, frame... | [
"cv2.minAreaRect",
"cv2.GaussianBlur",
"cv2.contourArea",
"cv2.circle",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.threshold",
"cv2.moments",
"cv2.imshow",
"cv2.fillPoly",
"cv2.VideoCapture",
"cv2.fitEllipse",
"numpy.array",
"cv2.rectangle",
"cv2.drawContours",
"cv2.destroyAllWindows",
"cv2... | [((82, 248), 'cv2.VideoCapture', 'cv.VideoCapture', (['"""udpsrc port=5004 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! videoconvert ! appsink"""', 'cv.CAP_GSTREAMER'], {}), "(\n 'udpsrc port=5004 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! video... |
import sys
import sysconfig
import warnings
import numpy as nu
import ctypes
import ctypes.util
from numpy.ctypeslib import ndpointer
import os
from galpy import potential
from galpy.util import galpyWarning
from galpy.orbit_src.integratePlanarOrbit import _parse_integrator, _parse_tol
#Find and load the library
_lib= ... | [
"numpy.ctypeslib.ndpointer",
"ctypes.c_int",
"ctypes.c_double",
"galpy.orbit_src.integratePlanarOrbit._parse_tol",
"ctypes.byref",
"sysconfig.get_config_var",
"numpy.asfortranarray",
"numpy.require",
"numpy.array",
"warnings.warn",
"galpy.orbit_src.integratePlanarOrbit._parse_integrator",
"os.... | [((404, 442), 'sysconfig.get_config_var', 'sysconfig.get_config_var', (['"""EXT_SUFFIX"""'], {}), "('EXT_SUFFIX')\n", (428, 442), False, 'import sysconfig\n'), ((5307, 5352), 'numpy.array', 'nu.array', (['pot_type'], {'dtype': 'nu.int32', 'order': '"""C"""'}), "(pot_type, dtype=nu.int32, order='C')\n", (5315, 5352), Tr... |
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelBinarizer
from sklearn.model_selection import StratifiedKFold
from sklearn.preprocessing import StandardScaler
from joblib import parallel_backend
from multiprocessing import cpu_count
import os, gc, joblib
from tqdm import tqdm
from collec... | [
"sklearn.preprocessing.LabelBinarizer",
"sklearn.preprocessing.StandardScaler",
"collections.defaultdict",
"gc.collect",
"os.path.isfile",
"numpy.sin",
"joblib.parallel_backend",
"pandas.set_option",
"multiprocessing.cpu_count",
"pandas.DataFrame",
"numpy.nanmean",
"numpy.linspace",
"pandas.... | [((375, 408), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (398, 408), False, 'import warnings\n'), ((409, 451), 'pandas.set_option', 'pd.set_option', (['"""display.max_colwidth"""', '(100)'], {}), "('display.max_colwidth', 100)\n", (422, 451), True, 'import pandas as pd... |
import tensorflow as tf
import numpy as np
def _tf_fspecial_gauss(size, sigma, ch=1):
"""Function to mimic the 'fspecial' gaussian MATLAB function
"""
x_data, y_data = np.mgrid[-size//2 + 1:size//2 + 1, -size//2 + 1:size//2 + 1]
x_data = np.expand_dims(x_data, axis=-1)
x_data = np.expand_dims(x_d... | [
"tensorflow.image.rgb_to_grayscale",
"tensorflow.reduce_sum",
"tensorflow.reduce_mean",
"numpy.expand_dims",
"tensorflow.constant",
"tensorflow.tile",
"tensorflow.nn.avg_pool",
"tensorflow.exp",
"tensorflow.nn.conv2d",
"tensorflow.reduce_prod",
"tensorflow.pack"
] | [((257, 288), 'numpy.expand_dims', 'np.expand_dims', (['x_data'], {'axis': '(-1)'}), '(x_data, axis=-1)\n', (271, 288), True, 'import numpy as np\n'), ((302, 333), 'numpy.expand_dims', 'np.expand_dims', (['x_data'], {'axis': '(-1)'}), '(x_data, axis=-1)\n', (316, 333), True, 'import numpy as np\n'), ((348, 379), 'numpy... |
import train_keras
from keras.models import load_model
import os
import numpy as np
import pandas as pd
from tqdm import tqdm
from keras.callbacks import ModelCheckpoint
import sys
TF_CPP_MIN_LOG_LEVEL=2
TEST_BATCH = 128
def load_params():
X_test = os.listdir('./test-jpg')
X_test = [fn.replace('.jpg', '') for... | [
"keras.models.load_model",
"numpy.save",
"train_keras.load_image",
"pandas.DataFrame.from_dict",
"os.listdir",
"numpy.concatenate"
] | [((255, 279), 'os.listdir', 'os.listdir', (['"""./test-jpg"""'], {}), "('./test-jpg')\n", (265, 279), False, 'import os\n'), ((347, 422), 'keras.models.load_model', 'load_model', (['"""model_amazon6.h5"""'], {'custom_objects': "{'fbeta': train_keras.fbeta}"}), "('model_amazon6.h5', custom_objects={'fbeta': train_keras.... |
# -*- coding: utf-8 -*-
#
# BRAINS
# (B)LR (R)everberation-mapping (A)nalysis (I)n AGNs with (N)ested (S)ampling
# <NAME>, <EMAIL>
# Thu, Aug 4, 2016
#
import os
import sys
import corner
import numpy as np
import configparser as cp
import matplotlib.pyplot as plt
__all__ = ['plotbackend']
class plotbackend:
"""
... | [
"os.path.isabs",
"corner.corner",
"matplotlib.pyplot.plot",
"configparser.RawConfigParser",
"numpy.min",
"numpy.loadtxt",
"matplotlib.pyplot.subplots"
] | [((2873, 3027), 'configparser.RawConfigParser', 'cp.RawConfigParser', ([], {'delimiters': '""" """', 'comment_prefixes': '"""%"""', 'inline_comment_prefixes': '"""%"""', 'default_section': 'cp.DEFAULTSECT', 'empty_lines_in_values': '(False)'}), "(delimiters=' ', comment_prefixes='%',\n inline_comment_prefixes='%', d... |
import sys
import os
import numpy as np
import random
from collections import OrderedDict
import pickle
import datetime
from tqdm import tqdm
from recordclass import recordclass
import math
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
... | [
"torch.nn.Dropout",
"recordclass.recordclass",
"pickle.dump",
"os.mkdir",
"numpy.random.seed",
"random.shuffle",
"torch.nn.Embedding",
"torch.nn.MaxPool1d",
"torch.nn.LSTMCell",
"torch.cat",
"torch.cuda.device_count",
"torch.nn.NLLLoss",
"pickle.load",
"torch.no_grad",
"os.path.join",
... | [((707, 720), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (718, 720), False, 'from collections import OrderedDict\n'), ((743, 756), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (754, 756), False, 'from collections import OrderedDict\n'), ((2338, 2351), 'collections.OrderedDict', 'OrderedD... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import pickle
class Line():
def __init__(self,n):
self.n=n
self.detected =False
#Polynomial coefficients of the lines
self.A=[]
self.B=[]
self.C=[]
#Running average of coefficients
sel... | [
"numpy.mean"
] | [((950, 965), 'numpy.mean', 'np.mean', (['self.A'], {}), '(self.A)\n', (957, 965), True, 'import numpy as np\n'), ((982, 997), 'numpy.mean', 'np.mean', (['self.B'], {}), '(self.B)\n', (989, 997), True, 'import numpy as np\n'), ((1014, 1029), 'numpy.mean', 'np.mean', (['self.C'], {}), '(self.C)\n', (1021, 1029), True, '... |
# Copyright 2016 <NAME>, alexggmatthews
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | [
"tensorflow.Dimension",
"tensorflow.add_n",
"quadrature.hermgauss",
"tensorflow.convert_to_tensor",
"tensorflow.reshape",
"tensorflow.TensorShape",
"tensorflow.concat",
"tensorflow.stack",
"tensorflow.matmul",
"tensorflow.shape",
"tensorflow.sqrt",
"tensorflow.rank",
"numpy.sqrt"
] | [((1333, 1368), 'quadrature.hermgauss', 'hermgauss', (['num_gauss_hermite_points'], {}), '(num_gauss_hermite_points)\n', (1342, 1368), False, 'from quadrature import hermgauss\n'), ((1460, 1473), 'tensorflow.shape', 'tf.shape', (['Fmu'], {}), '(Fmu)\n', (1468, 1473), True, 'import tensorflow as tf\n'), ((2263, 2278), '... |
# Copyright 2019 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
"pyspiel.load_game",
"absl.testing.absltest.main",
"numpy.ones",
"pyspiel.load_matrix_game",
"open_spiel.python.algorithms.double_oracle.DoubleOracleSolver"
] | [((2171, 2186), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (2184, 2186), False, 'from absl.testing import absltest\n'), ((875, 913), 'pyspiel.load_matrix_game', 'pyspiel.load_matrix_game', (['"""matrix_rps"""'], {}), "('matrix_rps')\n", (899, 913), False, 'import pyspiel\n'), ((927, 965), 'open_sp... |
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
# open text file and read in data as `text`
with open('data/anna.txt', 'r') as f:
text = f.read()
# print(text[:100])
# encode the text and map each character to an integer and vice versa
# we create two dictionaries:
# 1. int2... | [
"torch.nn.Dropout",
"numpy.zeros_like",
"numpy.multiply",
"torch.load",
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.softmax",
"torch.save",
"numpy.mean",
"torch.cuda.is_available",
"numpy.array",
"numpy.arange",
"torch.from_numpy"
] | [((630, 669), 'numpy.array', 'np.array', (['[char2int[ch] for ch in text]'], {}), '([char2int[ch] for ch in text])\n', (638, 669), True, 'import numpy as np\n'), ((1170, 1191), 'numpy.array', 'np.array', (['[[3, 5, 1]]'], {}), '([[3, 5, 1]])\n', (1178, 1191), True, 'import numpy as np\n'), ((2383, 2408), 'torch.cuda.is... |
"""
Dataset classes for variable number of speakers
Author: <NAME>
"""
import numpy as np
import torch
import torch.utils.data as data
from librosa import load
from time import time
import glob
import os
import random
import json
from tqdm import tqdm
def load_json(filename):
with open(filename) as f:
data ... | [
"numpy.stack",
"tqdm.tqdm",
"json.load",
"torch.utils.data.DataLoader",
"time.time",
"torch.Tensor",
"random.seed",
"librosa.load",
"numpy.array",
"os.path.join"
] | [((7485, 7559), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['dataset'], {'batch_size': '(3)', 'collate_fn': '_collate_fn'}), '(dataset, batch_size=3, collate_fn=_collate_fn)\n', (7512, 7559), False, 'import torch\n'), ((7625, 7641), 'tqdm.tqdm', 'tqdm', (['dataloader'], {}), '(dataloader)\n', (7629,... |
import os
from pathlib import Path
import pytest
from flopy.utils import binaryfile as bf
import numpy as np
import fiona
import rasterio
from shapely.geometry import box
import pytest
from ..grid import load_modelgrid
from ..results import export_cell_budget, export_heads, export_drawdown, export_sfr_results
@pytest... | [
"rasterio.open",
"fiona.open",
"numpy.isscalar",
"os.path.getsize",
"numpy.allclose",
"pytest.fixture",
"os.path.exists",
"flopy.utils.binaryfile.HeadFile",
"pathlib.Path",
"os.path.splitext",
"flopy.utils.binaryfile.CellBudgetFile",
"pytest.mark.parametrize",
"os.path.split",
"os.path.joi... | [((314, 344), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (328, 344), False, 'import pytest\n'), ((3345, 3480), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""export_depth_to_water,export_layers,export_water_table"""', '((True, False, True), (False, True, Fals... |
## Compiled from NodeLoads.ipynb on Sun Dec 10 12:51:11 2017
## DO NOT EDIT THIS FILE. YOUR CHANGES WILL BE LOST!!
## In [1]:
import numpy as np
from salib import extend
## In [9]:
class NodeLoad(object):
def __init__(self,fx=0.,fy=0.,mz=0.):
if np.isscalar(fx):
self.forces = np.matrix([f... | [
"numpy.isscalar",
"numpy.matrix",
"numpy.array"
] | [((265, 280), 'numpy.isscalar', 'np.isscalar', (['fx'], {}), '(fx)\n', (276, 280), True, 'import numpy as np\n'), ((308, 349), 'numpy.matrix', 'np.matrix', (['[fx, fy, mz]'], {'dtype': 'np.float64'}), '([fx, fy, mz], dtype=np.float64)\n', (317, 349), True, 'import numpy as np\n'), ((662, 685), 'numpy.array', 'np.array'... |
import os
filename = 'seg-0_0_0.npz'
outputdir = os.getcwd() + os.sep + 'inferred_segmentation'
inputdir = os.getcwd()
import numpy as np
import h5py
import PIL
import PIL.Image
import cv2
import png
def save_tif8(id_data, filename):
cv2.imwrite(filename, id_data.astype('uint8'))
def save_tifc(id_data, fil... | [
"os.getcwd",
"numpy.load",
"numpy.save",
"png.Writer"
] | [((110, 121), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (119, 121), False, 'import os\n'), ((1251, 1262), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1260, 1262), False, 'import os\n'), ((1272, 1309), 'numpy.load', 'np.load', (['(inputdir + os.sep + filename)'], {}), '(inputdir + os.sep + filename)\n', (1279, 1309),... |
"""
A. Long-term future prediction (model rollout)
1. encoder-decoder (0, 1 -> 8192-dim latent -> 2', 3'):
- feed (2', 3') images as input to predict (4', 5') images ...
2. encoder-decoder-64 (0, 1 -> 64-dim latent -> 2', 3'):
- feed (2', 3') images as input to predict (4', 5') images ...
3. encoder-decoder-6... | [
"pytorch_lightning.seed_everything",
"numpy.array_equal",
"torch.cat",
"yaml.safe_load",
"pprint.pprint",
"shutil.rmtree",
"os.path.join",
"models.VisDynamicsModel",
"torch.load",
"os.path.exists",
"torchvision.transforms.ToPILImage",
"json.dump",
"tqdm.tqdm",
"munch.munchify",
"torch.ma... | [((1128, 1150), 'os.path.exists', 'os.path.exists', (['folder'], {}), '(folder)\n', (1142, 1150), False, 'import os\n'), ((1186, 1205), 'os.makedirs', 'os.makedirs', (['folder'], {}), '(folder)\n', (1197, 1205), False, 'import os\n'), ((1454, 1481), 'torch.manual_seed', 'torch.manual_seed', (['cfg.seed'], {}), '(cfg.se... |
from keras.utils import Sequence
import os
import signal
import psutil
import gc
import pandas as pd
import numpy as np
import random
import math
import pysam
from ..util import *
import threading
import pickle
import pdb
def kill_child_processes(parent_pid, sig=signal.SIGTERM):
try:
parent = psutil.Proce... | [
"psutil.Process",
"os.getpid",
"pandas.read_hdf",
"numpy.concatenate",
"math.ceil",
"pandas.read_csv",
"pysam.FastaFile",
"numpy.zeros",
"numpy.expand_dims",
"threading.Lock",
"numpy.arange",
"numpy.tile",
"numpy.random.shuffle",
"gc.unfreeze"
] | [((308, 334), 'psutil.Process', 'psutil.Process', (['parent_pid'], {}), '(parent_pid)\n', (322, 334), False, 'import psutil\n'), ((5035, 5051), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (5049, 5051), False, 'import threading\n'), ((9662, 9693), 'numpy.arange', 'np.arange', (['len_sub_batch_coords'], {}), '(... |
'''
This script executes 2D FFT convolution on images in grayscale.
Usage:
Run without argument will use builtin Lena image:
python fftconvolve.py
Or, specify an image to use
python fftconvolve.py myimage.jpg
python fftconvolve.py myimage.png
= Getting The Requirements =
For Conda user, run the foll... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"numpy.zeros_like",
"numba.cuda.stream",
"matplotlib.pyplot.show",
"timeit.default_timer",
"accelerate.cuda.fft.FFTPlan",
"matplotlib.pyplot.imshow",
"scipy.misc.face",
"matplotlib.pyplot.axis",
"numba.cuda.to_device",
"numba.cuda.pinned"... | [((837, 885), 'numba.cuda.jit', 'cuda.jit', (['"""void(complex64[:,:], complex64[:,:])"""'], {}), "('void(complex64[:,:], complex64[:,:])')\n", (845, 885), False, 'from numba import cuda\n'), ((926, 938), 'numba.cuda.grid', 'cuda.grid', (['(2)'], {}), '(2)\n', (935, 938), False, 'from numba import cuda\n'), ((1654, 167... |
"""
Contains class that runs inferencing
"""
import torch
import numpy as np
from networks.RecursiveUNet import UNet
from utils.utils import med_reshape
import torch.nn.functional as F
class UNetInferenceAgent:
"""
Stores model and parameters and some methods to handle inferencing
"""
def __init__(sel... | [
"utils.utils.med_reshape",
"torch.load",
"torch.nn.functional.softmax",
"numpy.max",
"networks.RecursiveUNet.UNet",
"torch.no_grad",
"torch.from_numpy"
] | [((535, 554), 'networks.RecursiveUNet.UNet', 'UNet', ([], {'num_classes': '(3)'}), '(num_classes=3)\n', (539, 554), False, 'from networks.RecursiveUNet import UNet\n'), ((1107, 1121), 'numpy.max', 'np.max', (['volume'], {}), '(volume)\n', (1113, 1121), True, 'import numpy as np\n'), ((2217, 2232), 'torch.no_grad', 'tor... |
# Copyright 2020 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | [
"os.remove",
"numpy.abs",
"tempfile.mkstemp",
"alignment_pb2.AlignmentTask",
"librosa.core.cqt",
"absl.logging.debug",
"numpy.median",
"numpy.interp",
"absl.logging.info",
"numpy.max",
"librosa.power_to_db",
"os.close",
"numpy.array",
"numpy.mean",
"numpy.min",
"librosa.midi_to_hz",
... | [((1334, 1356), 'librosa.midi_to_hz', 'librosa.midi_to_hz', (['(36)'], {}), '(36)\n', (1352, 1356), False, 'import librosa\n'), ((1762, 1786), 'librosa.power_to_db', 'librosa.power_to_db', (['cqt'], {}), '(cqt)\n', (1781, 1786), False, 'import librosa\n'), ((2725, 2753), 'absl.logging.info', 'logging.info', (['"""Synth... |
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 8 22:37:00 2019
@author: for_y
"""
import numpy as np
from AnnoDomini.hamilton_mc import HMC, describe
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
def test_hmc():
def norm_function(x):
var = 1
... | [
"AnnoDomini.hamilton_mc.HMC",
"numpy.log",
"os.path.dirname",
"numpy.isnan",
"numpy.exp"
] | [((457, 565), 'AnnoDomini.hamilton_mc.HMC', 'HMC', ([], {'target_pdf': 'norm_function', 'burn_in': '(0)', 'thinning': '(1)', 'chain_len': '(100)', 'q_init': '[start_point]', 'epsilon': '(0.05)'}), '(target_pdf=norm_function, burn_in=0, thinning=1, chain_len=100, q_init=\n [start_point], epsilon=0.05)\n', (460, 565),... |
import librosa
from utils.hparams import Hparams
from jamo import hangul_to_jamo
from tqdm import tqdm
import numpy as np
import os, glob, json, shutil, torch, torchaudio
hparams = Hparams()
class KSSDatasetPath():
def __init__(self, Hparams):
self.Hparams = Hparams
# Origina... | [
"numpy.abs",
"numpy.maximum",
"librosa.filters.mel",
"librosa.istft",
"librosa.resample",
"shutil.rmtree",
"os.path.join",
"torch.nn.functional.pad",
"utils.hparams.Hparams",
"numpy.power",
"librosa.core.griffinlim",
"torch.load",
"torch.Tensor",
"librosa.effects.trim",
"librosa.stft",
... | [((189, 198), 'utils.hparams.Hparams', 'Hparams', ([], {}), '()\n', (196, 198), False, 'from utils.hparams import Hparams\n'), ((2348, 2404), 'torch.nn.utils.rnn.pad_sequence', 'torch.nn.utils.rnn.pad_sequence', (['texts'], {'batch_first': '(True)'}), '(texts, batch_first=True)\n', (2379, 2404), False, 'import os, glob... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=wrong-import-position
"""
Generate a json file summarizing a CLSim table
"""
from __future__ import absolute_import, division, print_function
__all__ = [
'summarize_clsim_table',
'parse_args',
'main'
]
__author__ = '<NAME>'
__license__ = ''... | [
"argparse.ArgumentParser",
"os.path.isfile",
"numpy.mean",
"os.path.join",
"retro.utils.misc.mkdir",
"sys.path.append",
"os.path.abspath",
"pisa.utils.jsons.from_json",
"os.path.dirname",
"numpy.max",
"numpy.ma.median",
"retro.utils.misc.wstderr",
"os.path.basename",
"pisa.utils.jsons.to_j... | [((2394, 2400), 'time.time', 'time', ([], {}), '()\n', (2398, 2400), False, 'from time import time\n'), ((2497, 2516), 'retro.utils.misc.expand', 'expand', (['table_fpath'], {}), '(table_fpath)\n', (2503, 2516), False, 'from retro.utils.misc import expand, mkdir, wstderr\n'), ((2821, 2835), 'retro.utils.misc.expand', '... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.