code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import pytest
import numpy as np
import sys
if (sys.version_info > (3, 0)):
from io import StringIO
else:
from StringIO import StringIO
from keras_contrib import callbacks
from keras.models import Sequential, Model
from keras.layers import Input, Dense, Conv2D, Flatten, Activation
from keras import backend as... | [
"StringIO.StringIO",
"keras.layers.Conv2D",
"keras.backend.image_data_format",
"numpy.ones",
"keras.layers.Flatten",
"keras_contrib.callbacks.DeadReluDetector",
"pytest.main",
"keras.models.Sequential",
"numpy.array",
"numpy.zeros",
"keras.layers.Input",
"keras.models.Model",
"keras.layers.A... | [((705, 715), 'StringIO.StringIO', 'StringIO', ([], {}), '()\n', (713, 715), False, 'from StringIO import StringIO\n'), ((2600, 2622), 'numpy.ones', 'np.ones', (['shape_weights'], {}), '(shape_weights)\n', (2607, 2622), True, 'import numpy as np\n'), ((2700, 2722), 'numpy.ones', 'np.ones', (['shape_weights'], {}), '(sh... |
# -*- coding: utf-8 -*-
"""Unit tests for classifier base class functionality."""
__author__ = ["mloning", "fkiraly", "TonyBagnall", "MatthewMiddlehurst"]
import numpy as np
import pandas as pd
import pytest
from sktime.classification.base import (
BaseClassifier,
_check_classifier_input,
_internal_conve... | [
"pandas.Series",
"sktime.classification.feature_based.Catch22Classifier",
"pandas.DataFrame",
"numpy.array",
"pytest.mark.parametrize",
"numpy.random.randint",
"sktime.utils._testing.panel._make_classification_y",
"pytest.raises",
"numpy.random.uniform",
"sktime.classification.base._internal_conve... | [((3943, 3981), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""missing"""', 'TF'], {}), "('missing', TF)\n", (3966, 3981), False, 'import pytest\n'), ((3983, 4026), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""multivariate"""', 'TF'], {}), "('multivariate', TF)\n", (4006, 4026), False, 'impo... |
import subprocess
import os
import numpy as np
def main():
header_lines = ['#!/bin/bash']
out_file = '#SBATCH --output=wolff-{0:0.1f}-{1:0.1f}.out'
job_name = '#SBATCH --job-name="{0:0.1f}-{1:0.1f}"'
script_file = 'wolff-{0:0.1f}-{1:0.1f}.sh'
run_command = './wolff {0} {1} {2} {3}'
filenam... | [
"subprocess.Popen",
"numpy.linspace"
] | [((401, 428), 'numpy.linspace', 'np.linspace', (['(0.01)', '(5)', 'num_T'], {}), '(0.01, 5, num_T)\n', (412, 428), True, 'import numpy as np\n'), ((1547, 1583), 'subprocess.Popen', 'subprocess.Popen', (["['sbatch', script]"], {}), "(['sbatch', script])\n", (1563, 1583), False, 'import subprocess\n')] |
import os
import torch
import argparse
import numpy as np
import torch.nn as nn
import torch.optim as optim
from torchviz import make_dot
import torch.nn.functional as F
from timeit import default_timer as timer
from utils import load_data, DEVICE, human_time
class Net(nn.Module):
def __init__(self, gpu=False):
... | [
"torch.nn.Dropout",
"utils.load_data",
"torch.max",
"torch.nn.functional.softmax",
"os.path.exists",
"numpy.multiply",
"argparse.ArgumentParser",
"utils.human_time",
"torch.cuda.get_device_name",
"os.makedirs",
"timeit.default_timer",
"torch.load",
"os.path.join",
"torch.nn.Conv2d",
"num... | [((4503, 4555), 'utils.load_data', 'load_data', ([], {'batch_size': '(4)', 'split_rate': '(0.2)', 'gpu': 'use_gpu'}), '(batch_size=4, split_rate=0.2, gpu=use_gpu)\n', (4512, 4555), False, 'from utils import load_data, DEVICE, human_time\n'), ((4642, 4654), 'torch.nn.BCELoss', 'nn.BCELoss', ([], {}), '()\n', (4652, 4654... |
from pommerman.constants import Action
import numpy as np
class DataAugmentor():
"""
A class that creates new valid state transitions based on the input
transition.
"""
def __init__(self) -> None:
pass
def augment(self, obs: dict, action: Action, reward: float, nobs: dict, d... | [
"numpy.flip",
"numpy.rot90"
] | [((4511, 4533), 'numpy.rot90', 'np.rot90', (["obs['board']"], {}), "(obs['board'])\n", (4519, 4533), True, 'import numpy as np\n'), ((4580, 4616), 'numpy.rot90', 'np.rot90', (["obs['bomb_blast_strength']"], {}), "(obs['bomb_blast_strength'])\n", (4588, 4616), True, 'import numpy as np\n'), ((4654, 4680), 'numpy.rot90',... |
# -*- coding: utf-8 -*-
# !/usr/bin/env python
"""Ploting data."""
import numpy as np
import matplotlib.pyplot as plt
import datetime
import math
from scipy.interpolate import spline
def get_sec():
"""Get second."""
return int(datetime.datetime.now().strftime("%S"))
def setup(graph, kind):
"""Setup pypl... | [
"numpy.abs",
"numpy.fft.fft",
"numpy.array",
"datetime.datetime.now",
"scipy.interpolate.spline",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.subplots"
] | [((1449, 1464), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)'], {}), '(2)\n', (1461, 1464), True, 'import matplotlib.pyplot as plt\n'), ((1557, 1566), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (1564, 1566), True, 'import matplotlib.pyplot as plt\n'), ((1743, 1759), 'matplotlib.pyplot.pause', 'plt.pa... |
import numpy as np
from typing import Tuple
from typing import List
from typing import Any
import matplotlib.pyplot as plt
import cv2
from GroundedScan.gym_minigrid.minigrid import DIR_TO_VEC
# TODO faster
def topo_sort(items, constraints):
if not constraints:
return items
items = list(items)
con... | [
"numpy.flip",
"matplotlib.pyplot.savefig",
"numpy.ones",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"numpy.random.random",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.imsave",
"matplotlib.pyplot.close",
"numpy.zeros",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.title",
"cv2.imre... | [((865, 878), 'numpy.ones', 'np.ones', (['size'], {}), '(size)\n', (872, 878), True, 'import numpy as np\n'), ((1364, 1389), 'numpy.zeros', 'np.zeros', (['size'], {'dtype': 'int'}), '(size, dtype=int)\n', (1372, 1389), True, 'import numpy as np\n'), ((2402, 2481), 'matplotlib.pyplot.bar', 'plt.bar', (['y_pos', 'values_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 21 09:34:07 2020
kinematics and kinetics diagrams for multi-index dataframes in human gait
@author: nikorose
"""
# import seaborn as sns; sns.set()
import matplotlib.pyplot as plt
import math
from itertools import combinations
from matplotlib.font_m... | [
"numpy.hstack",
"numpy.array",
"shapely.geometry.Polygon",
"os.path.exists",
"pandas.MultiIndex.from_product",
"numpy.mean",
"matplotlib.pyplot.style.use",
"numpy.ndenumerate",
"matplotlib.pyplot.close",
"matplotlib.pyplot.yticks",
"pandas.DataFrame",
"matplotlib.pyplot.ylim",
"matplotlib.py... | [((1656, 1680), 'matplotlib.pyplot.style.use', 'plt.style.use', (['plt_style'], {}), '(plt_style)\n', (1669, 1680), True, 'import matplotlib.pyplot as plt\n'), ((6671, 6747), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': 'nrows', 'ncols': 'ncols', 'squeeze': '(False)', 'figsize': 'self.fig_size'}), '(nro... |
#-------by HYH -------#
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
##
world=np.array([['red','green','green','red', 'red'],
['red','red', 'green','red', 'red'],
['red','red', 'green','green','red'],
['red','red', 'red',... | [
"matplotlib.pyplot.title",
"numpy.ones",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"numpy.log2",
"matplotlib.pyplot.ioff",
"numpy.argsort",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.zeros",
"matplotlib.pyplot.ion",
"numpy.meshgrid",
"numpy.... | [((124, 300), 'numpy.array', 'np.array', (["[['red', 'green', 'green', 'red', 'red'], ['red', 'red', 'green', 'red',\n 'red'], ['red', 'red', 'green', 'green', 'red'], ['red', 'red', 'red',\n 'red', 'red']]"], {}), "([['red', 'green', 'green', 'red', 'red'], ['red', 'red', 'green',\n 'red', 'red'], ['red', 're... |
"""
Name: inherent
Coder: <NAME> (BGI-Research)[V1]
Current Version: 1
Function(s):
(1) Some inherent concepts.
"""
import numpy
# mapping of integer and char
A = 65 # ord('A')
B = 66 # ord('B')
C = 67 # ord('C')
D = 68 # ord('D')
E = 69 # ord('E')
F = 70 # ord('F')
G = 71 # ord('G')
H = ... | [
"numpy.array"
] | [((681, 739), 'numpy.array', 'numpy.array', (['[A, C, G, T, M, R, W, S, Y, K, V, H, D, B, N]'], {}), '([A, C, G, T, M, R, W, S, Y, K, V, H, D, B, N])\n', (692, 739), False, 'import numpy\n'), ((783, 926), 'numpy.array', 'numpy.array', (['[[A], [C], [G], [T], [A, C], [A, G], [A, T], [C, G], [C, T], [G, T], [A, C,\n G... |
from PIL import Image
import numpy as np
import tensorflow as tf
# colour map
label_colours = [(0,0,0)
# 0=background
,(128,0,0),(0,128,0),(128,128,0),(0,0,128),(128,0,128)
# 1=aeroplane, 2=bicycle, 3=bird, 4=boat, 5=bottle
,(0,128,128),(128,128,128),(64,... | [
"tensorflow.one_hot",
"tensorflow.image.resize_nearest_neighbor",
"tensorflow.reduce_sum",
"numpy.array",
"numpy.zeros",
"tensorflow.name_scope",
"tensorflow.reduce_mean",
"tensorflow.squeeze"
] | [((1402, 1449), 'numpy.zeros', 'np.zeros', (['(num_images, h, w, 3)'], {'dtype': 'np.uint8'}), '((num_images, h, w, 3), dtype=np.uint8)\n', (1410, 1449), True, 'import numpy as np\n'), ((3385, 3432), 'numpy.zeros', 'np.zeros', (['(num_images, h, w, c)'], {'dtype': 'np.uint8'}), '((num_images, h, w, c), dtype=np.uint8)\... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from astropy.time import Time
def open_avro(fname):
with open(fname,'rb') as f:
freader = fastavro.reader(f)
schema = freader.writer_schema
for packet in freader:
return packet
def make_dataframe(packet):
... | [
"numpy.log10",
"astropy.time.Time.now",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"numpy.sum",
"matplotlib.pyplot.figure",
"numpy.isnan",
"numpy.isfinite",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.errorbar",
"pandas.DataFrame",
"p... | [((328, 372), 'pandas.DataFrame', 'pd.DataFrame', (["packet['candidate']"], {'index': '[0]'}), "(packet['candidate'], index=[0])\n", (340, 372), True, 'import pandas as pd\n'), ((386, 424), 'pandas.DataFrame', 'pd.DataFrame', (["packet['prv_candidates']"], {}), "(packet['prv_candidates'])\n", (398, 424), True, 'import ... |
"""
It contains the functions to compute the cases that presents an analytical
solutions.
All functions output the analytical solution in kcal/mol
"""
import numpy
from numpy import pi
from scipy import special, linalg
from scipy.misc import factorial
from math import gamma
def an_spherical(q, xq, E_1, E_2, E_0, R, N... | [
"numpy.arccos",
"scipy.misc.factorial",
"numpy.sqrt",
"scipy.special.kv",
"numpy.sinh",
"numpy.arctan2",
"scipy.special.sph_harm",
"numpy.arange",
"math.gamma",
"numpy.tanh",
"numpy.exp",
"numpy.real",
"scipy.special.iv",
"numpy.abs",
"numpy.cos",
"scipy.linalg.solve",
"numpy.sum",
... | [((2216, 2228), 'scipy.misc.factorial', 'factorial', (['n'], {}), '(n)\n', (2225, 2228), False, 'from scipy.misc import factorial\n'), ((2243, 2259), 'scipy.misc.factorial', 'factorial', (['(2 * n)'], {}), '(2 * n)\n', (2252, 2259), False, 'from scipy.misc import factorial\n'), ((6216, 6245), 'scipy.special.kv', 'speci... |
"""
Filename: ifp.py
Authors: <NAME>, <NAME>
Tools for solving the standard optimal savings / income fluctuation
problem for an infinitely lived consumer facing an exogenous income
process that evolves according to a Markov chain.
References
----------
http://quant-econ.net/ifp.html
"""
import numpy as np
from sc... | [
"scipy.interp",
"numpy.array",
"numpy.linspace",
"numpy.empty",
"numpy.min"
] | [((2661, 2697), 'numpy.linspace', 'np.linspace', (['(-b)', 'grid_max', 'grid_size'], {}), '(-b, grid_max, grid_size)\n', (2672, 2697), True, 'import numpy as np\n'), ((3619, 3636), 'numpy.empty', 'np.empty', (['V.shape'], {}), '(V.shape)\n', (3627, 3636), True, 'import numpy as np\n'), ((3653, 3670), 'numpy.empty', 'np... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from tqdm import tqdm
from collections import deque
from plasticity.utils import _check_activation
from plasticity.utils.activations import Linear
from plasticity.model.optimizer import Optimizer
from plasticity.model.weights import BaseWeights
from sk... | [
"numpy.fromfile",
"plasticity.model.weights.BaseWeights",
"numpy.arange",
"collections.deque",
"numpy.full_like",
"plasticity.utils._check_activation",
"numpy.random.seed",
"numpy.concatenate",
"sklearn.utils.validation.check_is_fitted",
"plasticity.utils.activations.Linear",
"numpy.allclose",
... | [((2051, 2062), 'plasticity.model.optimizer.Optimizer', 'Optimizer', ([], {}), '()\n', (2060, 2062), False, 'from plasticity.model.optimizer import Optimizer\n'), ((2134, 2147), 'plasticity.model.weights.BaseWeights', 'BaseWeights', ([], {}), '()\n', (2145, 2147), False, 'from plasticity.model.weights import BaseWeight... |
import numpy as np
from py_diff_stokes_flow.env.env_base import EnvBase
from py_diff_stokes_flow.common.common import ndarray
from py_diff_stokes_flow.core.py_diff_stokes_flow_core import ShapeComposition2d, StdIntArray2d
class FluidicTwisterEnv3d(EnvBase):
def __init__(self, seed, folder):
np.random.seed... | [
"py_diff_stokes_flow.common.common.ndarray",
"numpy.zeros",
"py_diff_stokes_flow.env.env_base.EnvBase.__init__",
"numpy.random.seed",
"py_diff_stokes_flow.core.py_diff_stokes_flow_core.ShapeComposition2d",
"numpy.linalg.norm",
"numpy.full"
] | [((306, 326), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (320, 326), True, 'import numpy as np\n'), ((455, 529), 'py_diff_stokes_flow.env.env_base.EnvBase.__init__', 'EnvBase.__init__', (['self', 'cell_nums', 'E', 'nu', 'vol_tol', 'edge_sample_num', 'folder'], {}), '(self, cell_nums, E, nu, vol_... |
# -*-coding:utf-8 -*-
import numpy as np
from bs4 import BeautifulSoup
import random
def scrapePage(retX, retY, inFile, yr, numPce, origPrc):
"""
函数说明:从页面读取数据,生成retX和retY列表
Parameters:
retX - 数据X
retY - 数据Y
inFile - HTML文件
yr - 年份
numPce - 乐高部件数目
origPrc - 原价
Returns:
无
Website:
http://www.cuijiah... | [
"numpy.mean",
"numpy.mat",
"numpy.multiply",
"random.shuffle",
"numpy.ones",
"sklearn.linear_model.Ridge",
"numpy.linalg.det",
"bs4.BeautifulSoup",
"numpy.exp",
"numpy.zeros",
"numpy.array",
"numpy.nonzero",
"numpy.shape",
"numpy.var"
] | [((439, 458), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html'], {}), '(html)\n', (452, 458), False, 'from bs4 import BeautifulSoup\n'), ((2962, 2978), 'numpy.mean', 'np.mean', (['yMat', '(0)'], {}), '(yMat, 0)\n', (2969, 2978), True, 'import numpy as np\n'), ((3057, 3075), 'numpy.mean', 'np.mean', (['inxMat', '(0)'], {}... |
# plotting.py
#
# This file is part of scqubits.
#
# Copyright (c) 2019, <NAME> and <NAME>
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
##############################################################... | [
"matplotlib.colorbar.ColorbarBase",
"scqubits.utils.plot_defaults.wavefunction2d",
"matplotlib.pyplot.IndexLocator",
"matplotlib.colorbar.make_axes",
"scqubits.utils.plot_defaults.contours",
"numpy.arange",
"scqubits.utils.misc.process_which",
"scqubits.utils.plot_defaults.evals_vs_paramvals",
"nump... | [((5669, 5694), 'mpl_toolkits.axes_grid1.make_axes_locatable', 'make_axes_locatable', (['axes'], {}), '(axes)\n', (5688, 5694), False, 'from mpl_toolkits.axes_grid1 import make_axes_locatable\n'), ((6660, 6687), 'numpy.meshgrid', 'np.meshgrid', (['x_vals', 'y_vals'], {}), '(x_vals, y_vals)\n', (6671, 6687), True, 'impo... |
import torch
from torch import nn
from .utils import EarlyStopping, appendabledict, \
calculate_multiclass_accuracy, calculate_multiclass_f1_score,\
append_suffix, compute_dict_average
from copy import deepcopy
import numpy as np
from torch.utils.data import RandomSampler, BatchSampler
from .categorization imp... | [
"numpy.mean",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.nn.CrossEntropyLoss",
"torch.stack",
"numpy.argmax",
"torch.tensor",
"torch.cuda.is_available",
"torch.nn.Linear",
"copy.deepcopy",
"torch.no_grad",
"torch.cat"
] | [((473, 531), 'torch.nn.Linear', 'nn.Linear', ([], {'in_features': 'input_dim', 'out_features': 'num_classes'}), '(in_features=input_dim, out_features=num_classes)\n', (482, 531), False, 'from torch import nn\n'), ((763, 780), 'copy.deepcopy', 'deepcopy', (['encoder'], {}), '(encoder)\n', (771, 780), False, 'from copy ... |
import argparse
import json
import os
from os import listdir
from os.path import isfile
import shutil
from genson import SchemaBuilder
from enum import Enum
import copy
import flatdict
import pandas as pd
import numpy as np
from collections import OrderedDict
from functools import reduce # forward compatibility for Py... | [
"copy.deepcopy",
"numpy.arange",
"os.listdir",
"genson.SchemaBuilder",
"argparse.ArgumentParser",
"sys.getsizeof",
"flatdict.FlatterDict",
"numpy.concatenate",
"pandas.DataFrame",
"collections.OrderedDict",
"functools.reduce",
"rich.console.Console",
"pandas.get_dummies",
"numpy.bincount",... | [((550, 561), 'echr.utils.logger.getlogger', 'getlogger', ([], {}), '()\n', (559, 561), False, 'from echr.utils.logger import getlogger\n'), ((575, 595), 'rich.console.Console', 'Console', ([], {'record': '(True)'}), '(record=True)\n', (582, 595), False, 'from rich.console import Console\n'), ((630, 697), 'collections.... |
from math import pi, cos, sin
from numpy.random.mtrand import uniform
from pydesim import Model
from pycsmaca.simulations.modules import RandomSource, Queue, Transmitter, \
Receiver, Radio, ConnectionManager, WirelessInterface, SaturatedQueue
from pycsmaca.simulations.modules.app_layer import ControlledSource
fro... | [
"pycsmaca.simulations.modules.Transmitter",
"pycsmaca.simulations.modules.SaturatedQueue",
"collections.namedtuple",
"pycsmaca.simulations.modules.station.Station",
"pycsmaca.simulations.modules.RandomSource",
"pycsmaca.simulations.modules.ConnectionManager",
"math.cos",
"pycsmaca.simulations.modules.... | [((658, 680), 'pycsmaca.simulations.modules.ConnectionManager', 'ConnectionManager', (['sim'], {}), '(sim)\n', (675, 680), False, 'from pycsmaca.simulations.modules import RandomSource, Queue, Transmitter, Receiver, Radio, ConnectionManager, WirelessInterface, SaturatedQueue\n'), ((2015, 2030), 'pycsmaca.simulations.mo... |
#!/usr/bin/env python
# coding=utf-8
"""
Ant Group
Copyright (c) 2004-2020 All Rights Reserved.
------------------------------------------------------
File Name : NN
Author : <NAME>
Email: <EMAIL>
Create Time : 2020-09-11 14:29
Description : description what the main function of this file
"""
fr... | [
"tensorflow.compat.v1.placeholder",
"tensorflow.group",
"numpy.zeros",
"time.time",
"tensorflow.compat.v1.global_variables_initializer"
] | [((2634, 2653), 'tensorflow.group', 'tf.group', (['train_ops'], {}), '(train_ops)\n', (2642, 2653), True, 'import tensorflow as tf\n'), ((3223, 3234), 'time.time', 'time.time', ([], {}), '()\n', (3232, 3234), False, 'import time\n'), ((2935, 2986), 'tensorflow.compat.v1.placeholder', 'tf.compat.v1.placeholder', ([], {'... |
# Copyright 2019 TerraPower, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | [
"matplotlib.pyplot.ylabel",
"math.sqrt",
"ordered_set.OrderedSet",
"numpy.array",
"armi.reactor.flags.Flags.fromString",
"matplotlib.pyplot.xlabel",
"wx.lib.colourdb.getColourList",
"numpy.diff",
"matplotlib.pyplot.close",
"mpl_toolkits.axes_grid1.make_axes_locatable",
"collections.OrderedDict",... | [((1557, 1572), 'wx.lib.colourdb.getColourList', 'getColourList', ([], {}), '()\n', (1570, 1572), False, 'from wx.lib.colourdb import getColourList\n'), ((3398, 3415), 'numpy.array', 'numpy.array', (['data'], {}), '(data)\n', (3409, 3415), False, 'import numpy\n'), ((3427, 3464), 'matplotlib.pyplot.figure', 'plt.figure... |
"""Class for a collection of grid properties"""
version = '24th November 2021'
# Nexus is a registered trademark of the Halliburton Company
import logging
log = logging.getLogger(__name__)
log.debug('property.py version ' + version)
import os
import numpy as np
import resqpy.olio.ab_toolbox as abt
import resqpy.... | [
"logging.getLogger",
"numpy.count_nonzero",
"numpy.array",
"resqpy.olio.xml_et.citation_title_for_node",
"resqpy.olio.box_utilities.extent_of_box",
"numpy.arange",
"resqpy.olio.load_data.load_array_from_file",
"resqpy.olio.xml_et.simplified_data_type",
"numpy.where",
"resqpy.olio.ab_toolbox.load_a... | [((165, 192), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (182, 192), False, 'import logging\n'), ((48495, 48746), 'numpy.nansum', 'np.nansum', (['(a[cell_box[0, 0]:cell_box[1, 0] + 1, cell_box[0, 1]:cell_box[1, 1] + 1,\n cell_box[0, 2]:cell_box[1, 2] + 1] * fine_weight[cell_box[0, ... |
#!/usr/bin/env/python
#-*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import csv
#Coloque aquí el tipo de estrella con el que se va a trabajar. OPCIONES= 'Cefeida', 'RR_Lyrae', 'BinariaECL'.
tipo_estrella='RR_Lyrae';
#Importar los números de las estrellas desde el archivo csv:
ID_estrellas=n... | [
"matplotlib.pyplot.savefig",
"numpy.genfromtxt",
"csv.writer",
"matplotlib.pyplot.close",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.loadtxt",
"numpy.vectorize"
] | [((319, 393), 'numpy.loadtxt', 'np.loadtxt', (['"""numero_estrellas.csv"""'], {'delimiter': '""","""', 'dtype': '"""str"""', 'skiprows': '(1)'}), "('numero_estrellas.csv', delimiter=',', dtype='str', skiprows=1)\n", (329, 393), True, 'import numpy as np\n'), ((1251, 1271), 'numpy.vectorize', 'np.vectorize', (['np.int']... |
import json
import os
import subprocess
import unittest
from shutil import rmtree
from sys import platform
import numpy as np
import pandas as pd
from elf.io import open_file
from pybdv.util import get_key
from mobie import add_image
from mobie.validation import validate_source_metadata
from mobie.metadata import rea... | [
"numpy.random.rand",
"pandas.read_csv",
"unittest.skipIf",
"mobie.validation.validate_source_metadata",
"unittest.main",
"os.path.exists",
"mobie.metadata.read_dataset_metadata",
"pybdv.util.get_key",
"json.dumps",
"subprocess.run",
"elf.io.open_file",
"numpy.unique",
"os.makedirs",
"mobie... | [((3303, 3371), 'unittest.skipIf', 'unittest.skipIf', (["(platform == 'win32')", '"""CLI does not work on windows"""'], {}), "(platform == 'win32', 'CLI does not work on windows')\n", (3318, 3371), False, 'import unittest\n'), ((4221, 4236), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4234, 4236), False, 'impo... |
"""Functions to create and plot outlier scores (or other) in a fixed bounded range. Intended to use to
show the results of an outlier algorithm in a user friendly UI"""
import numpy as np
def make_linear_part(max_score, min_score):
"""
:param bottom: the proportion of the graph used for the bottom "sigmoid"
... | [
"numpy.log",
"numpy.array",
"numpy.sort",
"numpy.mean"
] | [((4671, 4690), 'numpy.array', 'numpy.array', (['scores'], {}), '(scores)\n', (4682, 4690), False, 'import numpy\n'), ((4711, 4729), 'numpy.sort', 'numpy.sort', (['scores'], {}), '(scores)\n', (4721, 4729), False, 'import numpy\n'), ((4894, 4917), 'numpy.mean', 'numpy.mean', (['high_scores'], {}), '(high_scores)\n', (4... |
import csv
import os
import sys
import typing
import keras
import librosa
import numpy as np
sys.path.append(os.path.dirname(os.path.realpath(__file__))) # TODO(TK): replace this with a correct import when mevonai is a package
import bulkDiarize as bk
default_model_path = os.path.join(os.path.dirname(os.path.realpa... | [
"os.listdir",
"keras.models.load_model",
"bulkDiarize.diarizeFromFolder",
"csv.writer",
"os.path.join",
"librosa.feature.mfcc",
"numpy.argmax",
"os.path.realpath",
"numpy.zeros",
"numpy.expand_dims",
"os.remove"
] | [((1679, 1697), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (1689, 1697), False, 'import os\n'), ((2824, 2867), 'keras.models.load_model', 'keras.models.load_model', (['default_model_path'], {}), '(default_model_path)\n', (2847, 2867), False, 'import keras\n'), ((3019, 3048), 'os.listdir', 'os.listdir',... |
# -*- coding: utf-8 -*-
# loader.py
# Copyright (c) 2014-?, <NAME>
# 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,... | [
"numpy.fromfile",
"scipy.io.savemat",
"scipy.io.loadmat",
"argparse.ArgumentTypeError",
"scipy.misc.toimage",
"sys.exit",
"imageio.imread"
] | [((11653, 11670), 'scipy.io.loadmat', 'io.loadmat', (['fname'], {}), '(fname)\n', (11663, 11670), False, 'from scipy import io\n'), ((12973, 12995), 'scipy.io.savemat', 'io.savemat', (['fname', 'out'], {}), '(fname, out)\n', (12983, 12995), False, 'from scipy import io\n'), ((13551, 13572), 'imageio.imread', 'imageio.i... |
__author__ = 'mason'
from domain_orderFulfillment import *
from timer import DURATION
from state import state
import numpy as np
'''
This is a randomly generated problem
'''
def GetCostOfMove(id, r, loc1, loc2, dist):
return 1 + dist
def GetCostOfLookup(id, item):
return max(1, np.random.beta(2, 2))
def Ge... | [
"numpy.random.normal",
"numpy.random.beta"
] | [((291, 311), 'numpy.random.beta', 'np.random.beta', (['(2)', '(2)'], {}), '(2, 2)\n', (305, 311), True, 'import numpy as np\n'), ((375, 399), 'numpy.random.normal', 'np.random.normal', (['(5)', '(0.5)'], {}), '(5, 0.5)\n', (391, 399), True, 'import numpy as np\n'), ((453, 475), 'numpy.random.normal', 'np.random.normal... |
import re
import os
import pandas as pd
import numpy as np
from .extract_tools import default_tokenizer as _default_tokenizer
def _getDictionnaryKeys(dictionnary):
"""
Function that get keys from a dict object and flatten sub dict.
"""
keys_array = []
for key in dictionnary.keys():
... | [
"pandas.Series",
"os.listdir",
"numpy.repeat",
"re.compile",
"numpy.isin",
"os.path.isfile",
"os.path.isdir",
"os.mkdir",
"pandas.DataFrame",
"pandas.concat",
"os.remove"
] | [((5008, 5052), 'os.path.isfile', 'os.path.isfile', (['(self.folder + self.conf_file)'], {}), '(self.folder + self.conf_file)\n', (5022, 5052), False, 'import os\n'), ((9026, 9079), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "self.emptyDFCols['annotations']"}), "(columns=self.emptyDFCols['annotations'])\n", (... |
# Copyright 2019 <NAME> and <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
"torch.nn.CrossEntropyLoss",
"torch.max",
"numpy.array",
"torch.sum",
"torch.arange",
"torch.mean",
"numpy.where",
"itertools.product",
"torch.randn",
"random.sample",
"numpy.random.choice",
"torch.nn.functional.normalize",
"torch.nn.functional.relu",
"warnings.filterwarnings",
"torch.ca... | [((762, 795), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (785, 795), False, 'import warnings\n'), ((4640, 4657), 'numpy.unique', 'np.unique', (['labels'], {}), '(labels)\n', (4649, 4657), True, 'import torch, random, itertools as it, numpy as np, faiss, random\n'), ((5... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 19 13:33:32 2017
@author: saintlyvi
"""
import pandas as pd
import numpy as np
import os
from math import ceil
import colorlover as cl
import plotly.offline as offline
import plotly.graph_objs as go
import plotly as py
offline.init_notebook_mo... | [
"os.listdir",
"math.ceil",
"plotly.offline.iplot",
"plotly.offline.plot",
"plotly.offline.init_notebook_mode",
"os.path.join",
"colorlover.flipper",
"plotly.graph_objs.Bar",
"pandas.DataFrame",
"numpy.arange"
] | [((296, 338), 'plotly.offline.init_notebook_mode', 'offline.init_notebook_mode', ([], {'connected': '(True)'}), '(connected=True)\n', (322, 338), True, 'import plotly.offline as offline\n'), ((9800, 9840), 'plotly.offline.iplot', 'offline.iplot', (['fig'], {'filename': '"""testagain"""'}), "(fig, filename='testagain')\... |
#!/usr/bin/python3
"""
tango colors
"""
import matplotlib.pyplot as plt
import numpy as np
import pdb
def colormap(rgb: bool=False):
"""
Create an array of visually distinctive RGB values.
Args:
- rgb: boolean, whether to return in RGB or BGR order. BGR corresponds to OpenCV default.
Retur... | [
"matplotlib.pyplot.imshow",
"numpy.tile",
"numpy.array",
"pdb.set_trace",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((1532, 1547), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (1545, 1547), False, 'import pdb\n'), ((1567, 1588), 'numpy.arange', 'np.arange', (['num_colors'], {}), '(num_colors)\n', (1576, 1588), True, 'import numpy as np\n'), ((1608, 1638), 'numpy.tile', 'np.tile', (['semantic_img', '(10, 1)'], {}), '(semantic... |
from handy import read
import numpy as np
from numpy.lib.stride_tricks import sliding_window_view
from itertools import combinations
lines = [int(x) for x in read(9)]
def validate(n, last):
last = set((x for x in last if x <= n))
for combo in combinations(last, 2):
if sum(combo) == n:
retu... | [
"itertools.combinations",
"handy.read",
"numpy.lib.stride_tricks.sliding_window_view",
"numpy.where"
] | [((253, 274), 'itertools.combinations', 'combinations', (['last', '(2)'], {}), '(last, 2)\n', (265, 274), False, 'from itertools import combinations\n'), ((159, 166), 'handy.read', 'read', (['(9)'], {}), '(9)\n', (163, 166), False, 'from handy import read\n'), ((558, 611), 'numpy.lib.stride_tricks.sliding_window_view',... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
from timeit import default_timer as timer
#from matplotlib.pylab import imshow, jet, show, ion
import numpy as np
from numba import jit, int32, float64, njit, prange
import cv2
from numba import jit
# colo... | [
"cv2.imencode",
"timeit.default_timer",
"numba.njit",
"numpy.zeros",
"numba.prange"
] | [((1053, 1072), 'numba.njit', 'njit', ([], {'parallel': '(True)'}), '(parallel=True)\n', (1057, 1072), False, 'from numba import jit, int32, float64, njit, prange\n'), ((1753, 1794), 'numpy.zeros', 'np.zeros', (['(2048, 4096, 3)'], {'dtype': 'np.uint8'}), '((2048, 4096, 3), dtype=np.uint8)\n', (1761, 1794), True, 'impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 12 15:40:08 2020
plot composite plots sea level & barotropic currents for ROMS sensitivity experiments with uniform wind speed change and closed english channel,
and difference in responses w.r.t. same experiments with an open english channel
@auth... | [
"os.listdir",
"matplotlib.ticker.FixedLocator",
"cartopy.crs.Orthographic",
"os.path.join",
"cartopy.crs.PlateCarree",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.empty",
"xarray.open_dataset",
"numpy.mod"
] | [((511, 527), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (520, 527), True, 'import matplotlib.pyplot as plt\n'), ((699, 727), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 7.5)'}), '(figsize=(6, 7.5))\n', (709, 727), True, 'import matplotlib.pyplot as plt\n'), ((1455, 15... |
import matplotlib
matplotlib.use('tkagg')
import os
import subprocess
import sys
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
import tensorflow as tf
from ampligraph.common.aux import rel_rank_stat, load_data, eige... | [
"logging.getLogger",
"numpy.hstack",
"tensorflow.logging.set_verbosity",
"numpy.array",
"sys.exit",
"sacred.observers.MongoObserver.create",
"pymongo.MongoClient",
"argparse.ArgumentParser",
"ampligraph.evaluation.hits_at_n_score",
"networkx.spring_layout",
"numpy.concatenate",
"ampligraph.eva... | [((18, 41), 'matplotlib.use', 'matplotlib.use', (['"""tkagg"""'], {}), "('tkagg')\n", (32, 41), False, 'import matplotlib\n'), ((172, 199), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (189, 199), False, 'import logging\n'), ((725, 767), 'tensorflow.logging.set_verbosity', 'tf.logging.s... |
# -*- coding: utf-8 -*-
"""This module provides the base classes for pyflamestk."""
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2016,2017"
__license__ = "Simplified BSD License"
__version__ = "1.0"
import copy, subprocess
import numpy as np
class Atom(object):
"""description of an atom"""
def __init_... | [
"numpy.cross",
"subprocess.Popen",
"numpy.array",
"numpy.zeros",
"copy.deepcopy",
"numpy.aray"
] | [((11638, 11660), 'numpy.zeros', 'np.zeros', ([], {'shape': '[3, 3]'}), '(shape=[3, 3])\n', (11646, 11660), True, 'import numpy as np\n'), ((12282, 12306), 'copy.deepcopy', 'copy.deepcopy', (['supercell'], {}), '(supercell)\n', (12295, 12306), False, 'import copy, subprocess\n'), ((12961, 13051), 'subprocess.Popen', 's... |
import time
from garage.misc import logger
from garage.misc import ext
from garage.misc.overrides import overrides
from garage.tf.algos import BatchPolopt
from garage.tf.optimizers.cg_optimizer import CGOptimizer
from garage.tf.misc import tensor_utils
from garage.core.serializable import Serializable
import tensorflow... | [
"garage.misc.logger.dump_tabular",
"tensorflow.gradients",
"garage.tf.misc.tensor_utils.new_tensor",
"numpy.array",
"garage.tf.optimizers.cg_optimizer.CGOptimizer",
"copy.deepcopy",
"numpy.linalg.norm",
"tensorflow.reduce_mean",
"garage.misc.logger.record_tabular",
"numpy.mean",
"tensorflow.Sess... | [((1545, 1572), 'numpy.random.uniform', 'np.random.uniform', (['(0.0)', '(1.0)'], {}), '(0.0, 1.0)\n', (1562, 1572), True, 'import numpy as np\n'), ((4591, 4610), 'numpy.linalg.norm', 'np.linalg.norm', (['res'], {}), '(res)\n', (4605, 4610), True, 'import numpy as np\n'), ((4829, 4848), 'numpy.linalg.norm', 'np.linalg.... |
import numpy as np
import csv
from sklearn import tree
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import OneClassSVM
import matplotlib.pyplot as plt
import os
###### Read in the data
raw=[]
with open('../data/spambase.data') as cf:
re... | [
"matplotlib.pyplot.ylabel",
"numpy.array",
"os.path.exists",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.svm.OneClassSVM",
"csv.reader",
"matplotlib.pyplot.savefig",
"sklearn.model_selection.train_test_split",
"sklearn.en... | [((555, 567), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (565, 567), True, 'import matplotlib.pyplot as plt\n'), ((569, 616), 'sklearn.tree.plot_tree', 'tree.plot_tree', (['ctree'], {'max_depth': '(3)', 'filled': '(True)'}), '(ctree, max_depth=3, filled=True)\n', (583, 616), False, 'from sklearn import... |
import os
import os.path as osp
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch_geometric.transforms as T
from torch_geometric.data import DataLoader
from torch_geometric.utils import normalized_cut
from torch_geometric.nn import (NNConv, graclus, max_pool... | [
"logging.StreamHandler",
"math.ceil",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"argparse.ArgumentParser",
"torch_geometric.data.DataLoader",
"logging.Formatter",
"os.path.join",
"numpy.array",
"training.gnn.GNNTrainer",
"torch.cuda.is_available",
"numpy.cumsum",
"datasets.hitgraphs.HitGra... | [((865, 925), 'os.path.join', 'osp.join', (["os.environ['GNN_TRAINING_DATA_ROOT']", 'args.dataset'], {}), "(os.environ['GNN_TRAINING_DATA_ROOT'], args.dataset)\n", (873, 925), True, 'import os.path as osp\n'), ((961, 1031), 'datasets.hitgraphs.HitGraphDataset', 'HitGraphDataset', (['path'], {'directed': 'directed', 'ca... |
import pandas as pd
import numpy as np
from .basecomparison import BaseTwoSorterComparison
from .comparisontools import (do_score_labels, make_possible_match,
make_best_match, make_hungarian_match, do_confusion_matrix, do_count_score,
compute_performance)
cl... | [
"numpy.where"
] | [((15093, 15133), 'numpy.where', 'np.where', (['(scores > self.overmerged_score)'], {}), '(scores > self.overmerged_score)\n', (15101, 15133), True, 'import numpy as np\n')] |
import numpy as np
from scipy.integrate import quad
import random
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
# Example for Monte Carlo method.
point_in=0
point_out=0
for i in range(10000):
x=random.uniform(0,1)
y=random.uniform(0,1)
if y<=np.sqrt(1-x**2):
point_in=point_i... | [
"random.uniform",
"numpy.sqrt"
] | [((223, 243), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (237, 243), False, 'import random\n'), ((249, 269), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (263, 269), False, 'import random\n'), ((279, 298), 'numpy.sqrt', 'np.sqrt', (['(1 - x ** 2)'], {}), '(1 - x ** 2)... |
import simulation.quadrotor3 as quad
import simulation.config as cfg
import simulation.animation as ani
import matplotlib.pyplot as pl
import numpy as np
import random
from math import pi, sin, cos
import gym
from gym import error, spaces, utils
from gym.utils import seeding
"""
Environment wrapper for a climb & ... | [
"simulation.animation.Visualization",
"matplotlib.pyplot.ion",
"numpy.arcsin",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.sum",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.pause",
"simulation.q... | [((669, 700), 'numpy.array', 'np.array', (['[[1.5], [0.0], [0.0]]'], {}), '([[1.5], [0.0], [0.0]])\n', (677, 700), True, 'import numpy as np\n'), ((1095, 1126), 'numpy.array', 'np.array', (['[[0.0], [0.0], [0.0]]'], {}), '([[0.0], [0.0], [0.0]])\n', (1103, 1126), True, 'import numpy as np\n'), ((1286, 1300), 'numpy.zer... |
import os
import time
import random
import torch
import logging
import numpy as np
import torch.nn as nn
from pathlib import Path
from args import get_parser
from models.model import MLMBaseline
from data.data_loader import MLMLoader
from utils import IRLoss, LELoss, MTLLoss, AverageMeter, rank, classify
# define crit... | [
"logging.getLogger",
"logging.StreamHandler",
"models.model.MLMBaseline",
"torch.cuda.is_available",
"pathlib.Path",
"logging.FileHandler",
"numpy.random.seed",
"torch.topk",
"os.path.dirname",
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"torch.load",
"random.seed",
"args.get_parser... | [((464, 476), 'args.get_parser', 'get_parser', ([], {}), '()\n', (474, 476), False, 'from args import get_parser\n'), ((1061, 1088), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1078, 1088), False, 'import logging\n'), ((1109, 1131), 'random.seed', 'random.seed', (['args.seed'], {}), '... |
import os
import tarfile
import numpy as np
import pandas as pd
from catalyst.data.bundles.core import download_without_progress
from catalyst.exchange.utils.exchange_utils import get_exchange_bundles_folder
EXCHANGE_NAMES = ['bitfinex', 'bittrex', 'poloniex', 'binance']
API_URL = 'http://data.enigma.co/... | [
"tarfile.open",
"catalyst.data.bundles.core.download_without_progress",
"os.path.join",
"catalyst.exchange.utils.exchange_utils.get_exchange_bundles_folder",
"os.path.isdir",
"numpy.isnan",
"pandas.DataFrame"
] | [((686, 728), 'catalyst.exchange.utils.exchange_utils.get_exchange_bundles_folder', 'get_exchange_bundles_folder', (['exchange_name'], {}), '(exchange_name)\n', (713, 728), False, 'from catalyst.exchange.utils.exchange_utils import get_exchange_bundles_folder\n'), ((926, 950), 'os.path.join', 'os.path.join', (['root', ... |
import numpy as np
def Ent_MS_Plus20201001(x, tau, m, r):
"""
(RCMSE, CMSE, MSE, MSFE) = RCMS_Ent( x, tau, m, r )
inputs - x, single column time seres
- tau, greatest scale factor
- m, length of vectors to be compared
- R, radius for accepting matches (as a proportion of th... | [
"numpy.abs",
"numpy.mean",
"numpy.tile",
"numpy.where",
"numpy.log",
"numpy.max",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.isnan",
"numpy.std",
"numpy.var"
] | [((1622, 1649), 'numpy.zeros', 'np.zeros', (['tau'], {'dtype': 'object'}), '(tau, dtype=object)\n', (1630, 1649), True, 'import numpy as np\n'), ((1660, 1687), 'numpy.zeros', 'np.zeros', (['tau'], {'dtype': 'object'}), '(tau, dtype=object)\n', (1668, 1687), True, 'import numpy as np\n'), ((1699, 1726), 'numpy.zeros', '... |
#!/usr/bin/env python
# Following along with: https://www.learnopencv.com/pytorch-for-beginners-semantic-segmentation-using-torchvision/
# Generated by https://traingenerator.jrieke.com/
# Before running, install required packages:
# pip install numpy torch torchvision pytorch-ignite
from pathlib import Path
import ... | [
"zipfile.ZipFile",
"torchvision.models.segmentation.fcn_resnet101",
"torch.utils.data.DataLoader",
"numpy.array",
"torch.cuda.is_available",
"matplotlib.pyplot.imshow",
"pathlib.Path",
"urllib.request.urlretrieve",
"torchvision.datasets.ImageFolder",
"numpy.stack",
"torchvision.transforms.ToTens... | [((1198, 1223), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1221, 1223), False, 'import torch\n'), ((1440, 1454), 'pathlib.Path', 'Path', (['DATA_DIR'], {}), '(DATA_DIR)\n', (1444, 1454), False, 'from pathlib import Path\n'), ((2147, 2194), 'torchvision.datasets.ImageFolder', 'datasets.Imag... |
'''
Description: multi object tracking
Author: <EMAIL>
FilePath: /obj_evaluation/measure_judge/common/mot.py
Date: 2021-09-24 19:37:53
'''
import numpy as np
class Munkres:
def __init__(self, cost: list, inv_eps=1000) -> None:
"""[summary]
https://brc2.com/the-algorithm-workshop/
Args:
... | [
"numpy.array",
"numpy.sum",
"numpy.zeros"
] | [((898, 930), 'numpy.zeros', 'np.zeros', (['(self.rows, self.cols)'], {}), '((self.rows, self.cols))\n', (906, 930), True, 'import numpy as np\n'), ((956, 975), 'numpy.zeros', 'np.zeros', (['self.rows'], {}), '(self.rows)\n', (964, 975), True, 'import numpy as np\n'), ((1001, 1020), 'numpy.zeros', 'np.zeros', (['self.c... |
"""
Module: utils.c3.c3s1_post_processing
Author: <NAME>
License: The MIT license, https://opensource.org/licenses/MIT
This file is part of the FMP Notebooks (https://www.audiolabs-erlangen.de/FMP)
"""
import numpy as np
from scipy import signal
from numba import jit
@jit(nopython=True)
def log_compre... | [
"numpy.abs",
"scipy.signal.medfilt2d",
"scipy.signal.convolve",
"numpy.sqrt",
"numpy.ones",
"numpy.log",
"numpy.sum",
"numpy.zeros",
"numba.jit",
"scipy.signal.get_window"
] | [((286, 304), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (289, 304), False, 'from numba import jit\n'), ((626, 644), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (629, 644), False, 'from numba import jit\n'), ((598, 619), 'numpy.log', 'np.log', (['(1 + gamma * v)'],... |
from ir_sim.world import obs_circle
from math import pi, cos, sin
import numpy as np
from collections import namedtuple
from ir_sim.util import collision_cir_cir, collision_cir_matrix, collision_cir_seg, reciprocal_vel_obs
class env_obs_cir:
def __init__(self, obs_cir_class=obs_circle, obs_model='static', obs_cir_... | [
"collections.namedtuple",
"ir_sim.util.collision_cir_matrix",
"numpy.linalg.norm",
"ir_sim.util.reciprocal_vel_obs",
"math.cos",
"numpy.array",
"ir_sim.util.collision_cir_seg",
"numpy.random.uniform",
"math.sin"
] | [((5447, 5476), 'collections.namedtuple', 'namedtuple', (['"""circle"""', '"""x y r"""'], {}), "('circle', 'x y r')\n", (5457, 5476), False, 'from collections import namedtuple\n'), ((5493, 5519), 'collections.namedtuple', 'namedtuple', (['"""point"""', '"""x y"""'], {}), "('point', 'x y')\n", (5503, 5519), False, 'fro... |
from math import sqrt, atan
import pytest
from pytest import approx
import ts2vg
import numpy as np
@pytest.fixture
def empty_ts():
return []
@pytest.fixture
def sample_ts():
return [3.0, 4.0, 2.0, 1.0]
def test_basic(sample_ts):
out_got = ts2vg.NaturalVG().build(sample_ts).edges
out_truth = [
... | [
"pytest.approx",
"ts2vg.NaturalVG",
"math.sqrt",
"pytest.raises",
"math.atan",
"numpy.testing.assert_array_equal"
] | [((8103, 8152), 'numpy.testing.assert_array_equal', 'np.testing.assert_array_equal', (['out_got', 'out_truth'], {}), '(out_got, out_truth)\n', (8132, 8152), True, 'import numpy as np\n'), ((8276, 8325), 'numpy.testing.assert_array_equal', 'np.testing.assert_array_equal', (['out_got', 'out_truth'], {}), '(out_got, out_t... |
#!/usr/bin/env python
"""
Custom functions for identifiability analysis to calculate
and plot confidence intervals based on a profile-likelihood analysis. Adapted
from lmfit, with custom functions to select the range for parameter scanning and
for plotting the profile likelihood.
"""
from collections import Ordere... | [
"collections.OrderedDict",
"lmfit.minimizer.MinimizerException",
"math.ceil",
"numpy.log10",
"numpy.linspace",
"scipy.stats.chi2.ppf",
"numpy.isnan",
"multiprocessing.Pool",
"scipy.interpolate.UnivariateSpline",
"matplotlib.pyplot.subplots"
] | [((2517, 2530), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2528, 2530), False, 'from collections import OrderedDict\n'), ((4410, 4465), 'scipy.interpolate.UnivariateSpline', 'sp.interpolate.UnivariateSpline', (['xx', 'yy'], {'k': 'self._k', 's': '(0)'}), '(xx, yy, k=self._k, s=0)\n', (4441, 4465), Tru... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import pdb
class Model(nn.Module):
r"""Spatial temporal graph convolutional networks.
Args:
in_channels (int): Number of channels in the input data
num_class (int): Number... | [
"torch.nn.Sigmoid",
"torch.nn.ReLU",
"torch.nn.BatchNorm2d",
"torch.nn.Dropout",
"torch.nn.Conv2d",
"torch.transpose",
"numpy.sum",
"numpy.zeros",
"torch.tensor",
"torch.einsum",
"numpy.dot"
] | [((1411, 1423), 'numpy.sum', 'np.sum', (['A', '(0)'], {}), '(A, 0)\n', (1417, 1423), True, 'import numpy as np\n'), ((1467, 1497), 'numpy.zeros', 'np.zeros', (['(num_node, num_node)'], {}), '((num_node, num_node))\n', (1475, 1497), True, 'import numpy as np\n'), ((1664, 1701), 'numpy.zeros', 'np.zeros', (['(1, A.shape[... |
import numpy as np
from scipy.signal import stft, istft
from scipy.io import wavfile
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Signature import pkcs1_15
from Crypto.Hash import SHA256
from Crypto.Util.Padding import pad, unpad
from Crypto.Util.strxor import strxor
import random
import s... | [
"numpy.abs",
"scipy.signal.stft",
"Crypto.Util.Padding.pad",
"numpy.angle",
"numpy.complex",
"numpy.array",
"Crypto.Signature.pkcs1_15.new",
"reedsolo.RSCodec",
"scipy.io.wavfile.read",
"scipy.io.wavfile.write",
"os.popen",
"numpy.cos",
"numpy.sin",
"Crypto.Util.strxor.strxor",
"numpy.ar... | [((382, 415), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (405, 415), False, 'import warnings\n'), ((5030, 5053), 'scipy.io.wavfile.read', 'wavfile.read', (['audiofile'], {}), '(audiofile)\n', (5042, 5053), False, 'from scipy.io import wavfile\n'), ((5119, 5187), 'scipy... |
# Copyright (c) 2021 <NAME>
from pylib_sakata import init as init
# uncomment the follows when the file is executed in a Python console.
# init.close_all()
# init.clear_all()
import os
import shutil
import numpy as np
from control import matlab
from pylib_sakata import ctrl
from pylib_sakata import plot
print('Star... | [
"pylib_sakata.plot.plot_nyquist_assistline",
"os.path.exists",
"numpy.log10",
"pylib_sakata.ctrl.pid",
"os.makedirs",
"pylib_sakata.ctrl.pi",
"pylib_sakata.plot.plot_nyquist",
"pylib_sakata.plot.savefig",
"pylib_sakata.ctrl.sys2frd",
"shutil.rmtree",
"numpy.linspace",
"pylib_sakata.ctrl.feedba... | [((400, 432), 'os.path.exists', 'os.path.exists', (['figurefolderName'], {}), '(figurefolderName)\n', (414, 432), False, 'import os\n'), ((470, 499), 'os.makedirs', 'os.makedirs', (['figurefolderName'], {}), '(figurefolderName)\n', (481, 499), False, 'import os\n'), ((731, 751), 'pylib_sakata.ctrl.tf', 'ctrl.tf', (['[1... |
import pandas as pd
import numpy as np
import helper
import project_helper
import project_tests
# Compute the Highs and Lows in a Window
def get_high_lows_lookback(high, low, lookback_days):
"""
Get the highs and lows in a lookback window.
Parameters
----------
high : DataFrame
... | [
"pandas.DataFrame",
"numpy.array"
] | [((1674, 1728), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'close.columns', 'index': 'close.index'}), '(columns=close.columns, index=close.index)\n', (1686, 1728), True, 'import pandas as pd\n'), ((4434, 4490), 'pandas.DataFrame', 'pd.DataFrame', (['[]'], {'columns': 'col_values', 'index': 'index_values'}), '... |
"""
The lidar system, data and fit (1 of 2 datasets)
================================================
Generate a chart of the data fitted by Gaussian curve
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import leastsq
def model(t, coeffs):
return coeffs[0] + coeffs[1] * np.exp(- ((t-... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.exp",
"numpy.array",
"scipy.optimize.leastsq",
"numpy.load",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((424, 449), 'numpy.load', 'np.load', (['"""waveform_1.npy"""'], {}), "('waveform_1.npy')\n", (431, 449), True, 'import numpy as np\n'), ((487, 524), 'numpy.array', 'np.array', (['[3, 30, 15, 1]'], {'dtype': 'float'}), '([3, 30, 15, 1], dtype=float)\n', (495, 524), True, 'import numpy as np\n'), ((535, 579), 'scipy.op... |
from __future__ import annotations
import itertools
import logging
import math
import re
from collections import Counter
from itertools import combinations, starmap
from typing import Dict, Iterable, List, TextIO, Tuple
import networkx as nx
import numpy as np
import numpy.typing as npt
from networkx.drawing.nx_pydot... | [
"logging.getLogger",
"numpy.abs",
"numpy.unique",
"re.compile",
"numpy.where",
"networkx.Graph",
"itertools.combinations",
"collections.Counter",
"numpy.zeros",
"numpy.array",
"numpy.array_equal",
"numpy.sign",
"itertools.chain.from_iterable",
"numpy.linalg.norm",
"networkx.nx_pydot.to_p... | [((423, 450), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (440, 450), False, 'import logging\n'), ((469, 523), 're.compile', 're.compile', (['"""^\\\\-\\\\-\\\\-\\\\sscanner\\\\s\\\\d+\\\\s\\\\-\\\\-\\\\-$"""'], {}), "('^\\\\-\\\\-\\\\-\\\\sscanner\\\\s\\\\d+\\\\s\\\\-\\\\-\\\\-$')\n",... |
import csv
path = "/home/ubuntu/data_set_5/"
csv_binary = "driving_log.csv"
lines = []
#read in the csv file
with open(path + csv_binary) as csvfile:
reader = csv.reader(csvfile)
for line in reader:
lines.append(line)
from sklearn.model_selection import train_test_split
train_samples, validation_samp... | [
"keras.layers.core.Flatten",
"cv2.imread",
"cv2.flip",
"keras.layers.convolutional.Convolution2D",
"sklearn.model_selection.train_test_split",
"sklearn.utils.shuffle",
"keras.layers.Lambda",
"keras.models.Sequential",
"numpy.array",
"keras.layers.Cropping2D",
"keras.layers.core.Dropout",
"csv.... | [((326, 364), 'sklearn.model_selection.train_test_split', 'train_test_split', (['lines'], {'test_size': '(0.2)'}), '(lines, test_size=0.2)\n', (342, 364), False, 'from sklearn.model_selection import train_test_split\n'), ((2650, 2662), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (2660, 2662), False, 'fro... |
"""
Algorithm :
Message in converted in binary values.
Binary digit 0 corresponds to an odd RGB value and binary digit 1 corresponds to an even RGB value of the image.
If binary value of the message is 1 then the sum of R, G and B values will be an even integer otherwise it will be odd.
"""
from PIL import Image
from ... | [
"numpy.array",
"numpy.shape",
"PIL.Image.open",
"PIL.Image.fromarray"
] | [((638, 660), 'PIL.Image.open', 'Image.open', (['"""test.jpg"""'], {}), "('test.jpg')\n", (648, 660), False, 'from PIL import Image\n'), ((735, 748), 'numpy.shape', 'np.shape', (['img'], {}), '(img)\n', (743, 748), True, 'import numpy as np\n'), ((755, 765), 'numpy.array', 'array', (['img'], {}), '(img)\n', (760, 765),... |
import os
import sys
import argparse
import torch
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel
from torch.utils.data import DataLoader, DistributedSampler
from torchvision.transforms import functional as tfms
# import wandb
from apex import amp
import numpy as np
from nump... | [
"torch.utils.data.DistributedSampler",
"apex.amp.scale_loss",
"numpy.random.rand",
"photobooth.transforms.rot_90",
"ignite.engine.Engine",
"apex.amp.initialize",
"torch.distributed.get_rank",
"argparse.ArgumentParser",
"photobooth.transforms.crop_bounding_box",
"ignite.engine._prepare_batch",
"i... | [((907, 944), 'torch.tensor', 'torch.tensor', (['[0.4488, 0.4371, 0.404]'], {}), '([0.4488, 0.4371, 0.404])\n', (919, 944), False, 'import torch\n'), ((2348, 2373), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2371, 2373), False, 'import argparse\n'), ((3355, 3388), 'torch.cuda.set_device', ... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
import numpy.testing as npt
from reinforceflow.core import SumTree, MinTree
def test_sumtree_sum():
capacity = 100000
dataset = list(range(capacity))
dataset_actual = list(range... | [
"reinforceflow.core.MinTree",
"numpy.array",
"numpy.testing.assert_almost_equal",
"numpy.sum",
"numpy.zeros_like",
"reinforceflow.core.SumTree"
] | [((355, 372), 'reinforceflow.core.SumTree', 'SumTree', (['capacity'], {}), '(capacity)\n', (362, 372), False, 'from reinforceflow.core import SumTree, MinTree\n'), ((575, 588), 'reinforceflow.core.SumTree', 'SumTree', (['size'], {}), '(size)\n', (582, 588), False, 'from reinforceflow.core import SumTree, MinTree\n'), (... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 18})
pol_thres=0.7
xlsx_filename='Data_1_5.83.xlsx'
table=pd.read_excel(xlsx_filename, index_col=None, header=None)
Ex, Ey, Ez, h, X, T, n2, labs =[],[],[],[],[],[],[],[]
for i in range(9):
Ex.append(table[0... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axes",
"numpy.cos",
"pandas.read_excel",
"numpy.sin",
"matplotlib.pyplot.legend"
] | [((72, 110), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 18}"], {}), "({'font.size': 18})\n", (91, 110), True, 'import matplotlib.pyplot as plt\n'), ((165, 222), 'pandas.read_excel', 'pd.read_excel', (['xlsx_filename'], {'index_col': 'None', 'header': 'None'}), '(xlsx_filename, index_co... |
'''Functions to calculate substrate thermal noise
'''
from __future__ import division, print_function
import numpy as np
from numpy import exp, inf, pi, sqrt
import scipy.special
import scipy.integrate
from .. import const
from ..const import BESSEL_ZEROS as zeta
from ..const import J0M as j0m
def substrate_thermor... | [
"numpy.exp",
"numpy.sqrt"
] | [((3510, 3526), 'numpy.exp', 'exp', (['(-2 * km * h)'], {}), '(-2 * km * h)\n', (3513, 3526), False, 'from numpy import exp, inf, pi, sqrt\n'), ((3649, 3679), 'numpy.exp', 'exp', (['(-(zeta * r0 / a) ** 2 / 4)'], {}), '(-(zeta * r0 / a) ** 2 / 4)\n', (3652, 3679), False, 'from numpy import exp, inf, pi, sqrt\n'), ((595... |
# Sample code from the TorchVision 0.3 Object Detection Finetuning Tutorial
# http://pytorch.org/tutorials/intermediate/torchvision_tutorial.html
import os
import numpy as np
import torch
import random
import json
import argparse
from PIL import Image
import cv2
from alfworld.agents.detector.engine import train_one_... | [
"cv2.rectangle",
"numpy.uint8",
"torch.as_tensor",
"alfworld.agents.detector.transforms.ToTensor",
"cv2.imshow",
"alfworld.agents.detector.transforms.RandomHorizontalFlip",
"numpy.array",
"alfworld.agents.detector.transforms.Compose",
"torch.cuda.is_available",
"os.listdir",
"argparse.ArgumentPa... | [((6642, 6663), 'alfworld.agents.detector.transforms.Compose', 'T.Compose', (['transforms'], {}), '(transforms)\n', (6651, 6663), True, 'import alfworld.agents.detector.transforms as T\n'), ((7326, 7375), 'torch.utils.data.Subset', 'torch.utils.data.Subset', (['dataset', 'indices[:-4000]'], {}), '(dataset, indices[:-40... |
from __future__ import division
from past.utils import old_div
#===============================================================================
# SCG Scaled conjugate gradient optimization.
#
# Copyright (c) <NAME> (1996-2001)
# updates by <NAME> 2013
#
# Permission is granted for anyone to copy, use, or modif... | [
"logging.getLogger",
"numpy.dot",
"math.sqrt",
"past.utils.old_div"
] | [((3475, 3494), 'past.utils.old_div', 'old_div', (['(-mu)', 'delta'], {}), '(-mu, delta)\n', (3482, 3494), False, 'from past.utils import old_div\n'), ((2600, 2618), 'numpy.dot', 'np.dot', (['d', 'gradnew'], {}), '(d, gradnew)\n', (2606, 2618), True, 'import numpy as np\n'), ((2735, 2747), 'numpy.dot', 'np.dot', (['d',... |
import arabic_reshaper
import itertools
import math
import matplotlib.pyplot as plt
import numpy as np
import os
import seaborn as sns
import sys
import warnings
from bidi.algorithm import get_display
from matplotlib import rc
from matplotlib.backends import backend_gtk3
from iran_stock import get_iran_stock_network
... | [
"numpy.column_stack",
"numpy.count_nonzero",
"matplotlib.rc",
"numpy.save",
"numpy.mean",
"os.path.exists",
"numpy.max",
"matplotlib.pyplot.close",
"numpy.matmul",
"numpy.linalg.lstsq",
"numpy.min",
"sys.stdout.flush",
"arabic_reshaper.reshape",
"numpy.abs",
"numpy.ones",
"numpy.square... | [((354, 417), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'module': 'backend_gtk3.__name__'}), "('ignore', module=backend_gtk3.__name__)\n", (377, 417), False, 'import warnings\n'), ((446, 480), 'os.path.join', 'os.path.join', (['OUTPUT_DIR', '"""xi.npy"""'], {}), "(OUTPUT_DIR, 'xi.npy')\n... |
# -*- coding: utf-8 -*-
# test_mapQtoR.py
# This module provides the tests for the mapQtoR function.
# Copyright 2014 <NAME>
# This file is part of python-deltasigma.
#
# python-deltasigma is a 1:1 Python replacement of Richard Schreier's
# MATLAB delta sigma toolbox (aka "delsigma"), upon which it is heavily based.
# ... | [
"numpy.array",
"numpy.allclose",
"deltasigma.mapQtoR",
"numpy.arange"
] | [((992, 1767), 'numpy.array', 'np.array', (['[[1, -1, 7, -7, 13, -13, 19, -19, 25, -25, 31, -31, 37, -37], [1, 1, 7, 7, \n 13, 13, 19, 19, 25, 25, 31, 31, 37, 37], [2, -2, 8, -8, 14, -14, 20, -\n 20, 26, -26, 32, -32, 38, -38], [2, 2, 8, 8, 14, 14, 20, 20, 26, 26, 32,\n 32, 38, 38], [3, -3, 9, -9, 15, -15, 21,... |
import torch
import numpy as np
from dltranz.seq_encoder.utils import NormEncoder
def test_norm_encoder():
x = torch.tensor([
[1.0, 0.0],
[0.0, 2.0],
[3.0, 4.0],
], dtype=torch.float64)
f = NormEncoder()
out = f(x).numpy()
exp = np.array([
[1.0, 0.0],
[0.0... | [
"torch.tensor",
"numpy.array",
"numpy.testing.assert_array_almost_equal",
"dltranz.seq_encoder.utils.NormEncoder"
] | [((118, 189), 'torch.tensor', 'torch.tensor', (['[[1.0, 0.0], [0.0, 2.0], [3.0, 4.0]]'], {'dtype': 'torch.float64'}), '([[1.0, 0.0], [0.0, 2.0], [3.0, 4.0]], dtype=torch.float64)\n', (130, 189), False, 'import torch\n'), ((230, 243), 'dltranz.seq_encoder.utils.NormEncoder', 'NormEncoder', ([], {}), '()\n', (241, 243), ... |
import numpy as np
from adaptive_baselines.samplers.svgd import BandwidthHeuristic, OptimizationSVGDSampler, VanillaSVGDSampler
from scipy.stats import multivariate_normal
from sprl.distributions.kl_joint import KLGaussian, KLJoint, KLPolicy
class SVGDKLGaussian(KLGaussian):
def __init__(self, lower_bounds, uppe... | [
"scipy.stats.multivariate_normal",
"sprl.distributions.kl_joint.KLGaussian",
"numpy.any",
"numpy.squeeze",
"adaptive_baselines.samplers.svgd.VanillaSVGDSampler",
"numpy.full",
"adaptive_baselines.samplers.svgd.OptimizationSVGDSampler",
"sprl.distributions.kl_joint.KLPolicy"
] | [((524, 585), 'adaptive_baselines.samplers.svgd.VanillaSVGDSampler', 'VanillaSVGDSampler', (['BandwidthHeuristic.HEMETHOD'], {'stepsize': '(0.1)'}), '(BandwidthHeuristic.HEMETHOD, stepsize=0.1)\n', (542, 585), False, 'from adaptive_baselines.samplers.svgd import BandwidthHeuristic, OptimizationSVGDSampler, VanillaSVGDS... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from queue import Queue
from pathlib2 import Path
from threading import Thread
from functools import partial
import cv2
import numpy as np
from data.augmentations import AugmentationBase, Resize
class Prod... | [
"data.iamdb.IamDataset",
"numpy.ones",
"cv2.copyMakeBorder",
"queue.Queue",
"numpy.array",
"pathlib2.Path",
"functools.partial",
"numpy.vstack",
"cv2.resize",
"cv2.imread",
"numpy.arange"
] | [((14266, 14296), 'cv2.resize', 'cv2.resize', (['image'], {'dsize': 'dsize'}), '(image, dsize=dsize)\n', (14276, 14296), False, 'import cv2\n'), ((14318, 14462), 'cv2.copyMakeBorder', 'cv2.copyMakeBorder', (['image'], {'top': '(0)', 'left': '(0)', 'right': '(target_x - image.shape[1])', 'bottom': '(target_y - image.sha... |
#!/usr/bin/python3
# coding=utf8
# Date:2021/05/04
# Author:Aiden
import sys
import cv2
import math
import time
import rospy
import threading
import numpy as np
from threading import Timer
from std_msgs.msg import *
from std_srvs.srv import *
from sensor_msgs.msg import Image
from sensor.msg import Led
from warehouse... | [
"rospy.init_node",
"numpy.array",
"armpi_fpv.apriltag._get_demo_searchpath",
"rospy.Service",
"threading.RLock",
"rospy.ServiceProxy",
"cv2.contourArea",
"cv2.minAreaRect",
"armpi_fpv.PID.PID",
"numpy.rint",
"rospy.spin",
"armpi_fpv.Misc.map",
"rospy.sleep",
"rospy.Subscriber",
"warehous... | [((808, 825), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (823, 825), False, 'import threading\n'), ((831, 851), 'kinematics.ik_transform.ArmIK', 'ik_transform.ArmIK', ([], {}), '()\n', (849, 851), False, 'from kinematics import ik_transform\n'), ((861, 937), 'cv2.imread', 'cv2.imread', (['"""/home/ubuntu/a... |
import numpy as np
import time
import ray
FREE_DELAY_S = 10.0
MAX_FREE_QUEUE_SIZE = 100
_last_free_time = 0.0
_to_free = []
def ray_get_and_free(object_ids):
"""Call ray.get and then queue the object ids for deletion.
This function should be used whenever possible in RLlib, to optimize
memory usage. Th... | [
"ray.get",
"ray.internal.free",
"numpy.empty",
"numpy.concatenate",
"time.time"
] | [((610, 629), 'ray.get', 'ray.get', (['object_ids'], {}), '(object_ids)\n', (617, 629), False, 'import ray\n'), ((790, 801), 'time.time', 'time.time', ([], {}), '()\n', (799, 801), False, 'import time\n'), ((1248, 1289), 'numpy.empty', 'np.empty', (['(n + (align - 1))'], {'dtype': 'np.uint8'}), '(n + (align - 1), dtype... |
#%% Importing dependencies
import numpy as np
from PIL import Image
import glob
import cv2
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
#%% Defining functions
#%% Camera callibration
# Load images and concvert to grayscale
ny = 6
nx = 9
imgpoints = [] # Ima... | [
"matplotlib.pyplot.imshow",
"cv2.imread",
"cv2.undistort",
"numpy.zeros",
"cv2.cvtColor",
"cv2.calibrateCamera",
"cv2.findChessboardCorners",
"matplotlib.pyplot.subplot",
"glob.glob",
"matplotlib.pyplot.show"
] | [((358, 392), 'numpy.zeros', 'np.zeros', (['(ny * nx, 3)', 'np.float32'], {}), '((ny * nx, 3), np.float32)\n', (366, 392), True, 'import numpy as np\n'), ((406, 437), 'glob.glob', 'glob.glob', (['"""./camera_cal/*.jpg"""'], {}), "('./camera_cal/*.jpg')\n", (415, 437), False, 'import glob\n'), ((1000, 1060), 'cv2.calibr... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"numpy.testing.assert_almost_equal",
"numpy.asarray",
"mindspore.Tensor",
"numpy.testing.assert_equal"
] | [((869, 880), 'mindspore.Tensor', 'Tensor', (['obj'], {}), '(obj)\n', (875, 880), False, 'from mindspore import Tensor\n'), ((1059, 1077), 'mindspore.Tensor', 'Tensor', (['obj', 'dtype'], {}), '(obj, dtype)\n', (1065, 1077), False, 'from mindspore import Tensor\n'), ((1188, 1207), 'numpy.asarray', 'onp.asarray', (['act... |
#!/usr/bin/env python
import sys, os
import pandas as pd
import numpy as np
from scipy import stats as sts
import statsmodels.api as sm
import statsmodels.formula.api as smf
from statsmodels.stats.multitest import fdrcorrection
def paule_mandel_tau(eff, var_eff, tau2_start=0, atol=1e-5, maxiter=50):
tau2 = tau2_s... | [
"numpy.abs",
"numpy.allclose",
"numpy.sqrt",
"numpy.tanh",
"numpy.array",
"numpy.sum",
"pandas.DataFrame"
] | [((678, 707), 'numpy.allclose', 'np.allclose', (['ee', '(0)'], {'atol': 'atol'}), '(ee, 0, atol=atol)\n', (689, 707), True, 'import numpy as np\n'), ((1728, 1763), 'numpy.array', 'np.array', (['effects'], {'dtype': 'np.float64'}), '(effects, dtype=np.float64)\n', (1736, 1763), True, 'import numpy as np\n'), ((3467, 349... |
import numpy as np
import pandas as pd
import pickle
## plot conf
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 7})
width = 8.5/2.54
height = width*(3/4)
###
import os
script_dir = os.path.dirname(os.path.abspath(__file__))
plot_path = './'
male_rarity, female_rarity = pickle.load(open(script_dir... | [
"numpy.mean",
"numpy.median",
"numpy.sqrt",
"pandas.read_csv",
"numpy.sort",
"matplotlib.pyplot.close",
"matplotlib.pyplot.rcParams.update",
"numpy.array",
"numpy.argsort",
"numpy.concatenate",
"numpy.min",
"pandas.DataFrame",
"os.path.abspath",
"matplotlib.pyplot.subplots"
] | [((99, 136), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 7}"], {}), "({'font.size': 7})\n", (118, 136), True, 'import matplotlib.pyplot as plt\n'), ((390, 449), 'pandas.read_csv', 'pd.read_csv', (["(script_dir + '/plot_pickles/real_male_fit.csv')"], {}), "(script_dir + '/plot_pickles/re... |
import argparse
import time
import numpy as np
import networkx as nx
import json
from sklearn.utils import check_random_state
import zmq
from . import agglo, agglo2, features, classify, evaluate as ev
# constants
# labels for machine learning libs
MERGE_LABEL = 0
SEPAR_LABEL = 1
class Solver:
"""ZMQ-based inter... | [
"sklearn.utils.check_random_state",
"numpy.unique",
"argparse.ArgumentParser",
"zmq.Context",
"time.sleep",
"networkx.subgraph",
"numpy.max",
"numpy.array",
"json.load",
"time.time"
] | [((11729, 11744), 'numpy.unique', 'np.unique', (['true'], {}), '(true)\n', (11738, 11744), True, 'import numpy as np\n'), ((11758, 11790), 'sklearn.utils.check_random_state', 'check_random_state', (['random_state'], {}), '(random_state)\n', (11776, 11790), False, 'from sklearn.utils import check_random_state\n'), ((131... |
import codecs
from os import replace
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
import numpy as np
import pandas as pd
from scipy import sparse, stats
from sklearn.model_selection import train_test_split
def create_validation_dataset(test: np.ndarray, val_size: float, random_sta... | [
"numpy.ones",
"pandas.read_csv",
"pathlib.Path",
"numpy.array",
"numpy.zeros",
"numpy.setdiff1d",
"numpy.random.RandomState",
"codecs.open",
"numpy.save"
] | [((1168, 1181), 'numpy.array', 'np.array', (['val'], {}), '(val)\n', (1176, 1181), True, 'import numpy as np\n'), ((1193, 1207), 'numpy.array', 'np.array', (['test'], {}), '(test)\n', (1201, 1207), True, 'import numpy as np\n'), ((3506, 3536), 'numpy.zeros', 'np.zeros', (['num_items'], {'dtype': 'int'}), '(num_items, d... |
import numpy as np
class Conv1D():
def __init__(self, in_channel, out_channel, kernel_size, stride,
weight_init_fn=None, bias_init_fn=None):
self.in_channel = in_channel
self.out_channel = out_channel
self.kernel_size = kernel_size
self.stride = stride
i... | [
"numpy.random.normal",
"numpy.zeros",
"numpy.tensordot",
"numpy.empty"
] | [((685, 707), 'numpy.zeros', 'np.zeros', (['self.W.shape'], {}), '(self.W.shape)\n', (693, 707), True, 'import numpy as np\n'), ((726, 748), 'numpy.zeros', 'np.zeros', (['self.b.shape'], {}), '(self.b.shape)\n', (734, 748), True, 'import numpy as np\n'), ((915, 1023), 'numpy.empty', 'np.empty', (['(x.shape[0], self.out... |
import argparse
import cv2
import json
import numpy as np
import os
import pickle
import torch
from argparse import Namespace
from scipy.special import softmax
from sklearn.externals import joblib
from pyquaternion import Quaternion
from tqdm import tqdm
from network import CameraBranch
class Camera_Branch_Inferenc... | [
"numpy.hstack",
"sklearn.externals.joblib.load",
"network.CameraBranch",
"torch.cuda.is_available",
"argparse.ArgumentParser",
"numpy.dot",
"numpy.argmax",
"cv2.resize",
"numpy.transpose",
"pyquaternion.Quaternion",
"cv2.imread",
"pickle.dump",
"os.makedirs",
"torch.load",
"tqdm.tqdm",
... | [((2453, 2474), 'pyquaternion.Quaternion', 'Quaternion', (['pose[3:7]'], {}), '(pose[3:7])\n', (2463, 2474), False, 'from pyquaternion import Quaternion\n'), ((2484, 2507), 'pyquaternion.Quaternion', 'Quaternion', (['pose[10:14]'], {}), '(pose[10:14])\n', (2494, 2507), False, 'from pyquaternion import Quaternion\n'), (... |
#
# Created on 2020/08/25
#
import os
import yaml
from pathlib import Path
import argparse
import torch
import numpy as np
from utils.logger import get_logger
from trainers import get_trainer
def setup_seed():
# make the result reproducible
torch.manual_seed(3928)
torch.cuda.manual_s... | [
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"trainers.get_trainer",
"argparse.ArgumentParser",
"pathlib.Path",
"yaml.load",
"numpy.random.seed"
] | [((272, 295), 'torch.manual_seed', 'torch.manual_seed', (['(3928)'], {}), '(3928)\n', (289, 295), False, 'import torch\n'), ((301, 333), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_all', (['(2342)'], {}), '(2342)\n', (327, 333), False, 'import torch\n'), ((430, 450), 'numpy.random.seed', 'np.random.seed', (['... |
"""
Basic two sided matching markets.
"""
import numpy as np
from MatchingMarkets.util import InvalidPrefsError, InvalidCapsError, MaxHeap, \
generate_prefs_from_random_scores, generate_caps_given_sum, round_caps_to_meet_sum
from MatchingMarkets.matching_alg import deferred_acceptance
class ManyToOneMarket(objec... | [
"numpy.copy",
"numpy.random.default_rng",
"numpy.ones",
"MatchingMarkets.util.InvalidCapsError",
"MatchingMarkets.util.MaxHeap",
"MatchingMarkets.matching_alg.deferred_acceptance",
"MatchingMarkets.util.generate_prefs_from_random_scores",
"numpy.any",
"numpy.max",
"datetime.datetime.now",
"numpy... | [((23591, 23614), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (23612, 23614), False, 'import datetime\n'), ((23774, 23797), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (23795, 23797), False, 'import datetime\n'), ((2097, 2192), 'numpy.full', 'np.full', (['(self.num_doctor... |
# License: BSD 3 clause
# -*- coding: utf8 -*-
import unittest
from tick.base.build.base import standard_normal_cdf, \
standard_normal_inv_cdf
from scipy.stats import norm
import numpy as np
from numpy.random import normal, uniform
class Test(unittest.TestCase):
def setUp(self):
self.size = 10
... | [
"numpy.random.normal",
"tick.base.build.base.standard_normal_cdf",
"scipy.stats.norm.ppf",
"tick.base.build.base.standard_normal_inv_cdf",
"numpy.testing.assert_almost_equal",
"numpy.empty",
"numpy.random.uniform",
"scipy.stats.norm.cdf"
] | [((452, 474), 'numpy.random.normal', 'normal', ([], {'size': 'self.size'}), '(size=self.size)\n', (458, 474), False, 'from numpy.random import normal, uniform\n'), ((569, 592), 'scipy.stats.norm.cdf', 'norm.cdf', (['tested_sample'], {}), '(tested_sample)\n', (577, 592), False, 'from scipy.stats import norm\n'), ((602, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Deals with kpoints.
"""
from typing import Union
import numpy as np
from twinpy.properties.hexagonal import check_hexagonal_lattice
from twinpy.structure.lattice import CrystalLattice
class Kpoints():
"""
This class deals with kpoints.
"""
def __ini... | [
"numpy.ceil",
"numpy.where",
"numpy.round",
"numpy.floor",
"numpy.array",
"twinpy.structure.lattice.CrystalLattice",
"twinpy.properties.hexagonal.check_hexagonal_lattice"
] | [((771, 808), 'twinpy.structure.lattice.CrystalLattice', 'CrystalLattice', ([], {'lattice': 'self._lattice'}), '(lattice=self._lattice)\n', (785, 808), False, 'from twinpy.structure.lattice import CrystalLattice\n'), ((895, 943), 'twinpy.structure.lattice.CrystalLattice', 'CrystalLattice', ([], {'lattice': 'self._recip... |
import numpy.testing as npt
import sys
from dipy.workflows.base import IntrospectiveArgumentParser
from dipy.workflows.flow_runner import run_flow
from dipy.workflows.tests.workflow_tests_utils import TestFlow, \
DummyCombinedWorkflow
def test_iap():
sys.argv = [sys.argv[0]]
pos_keys = ['positional_str',... | [
"dipy.workflows.base.IntrospectiveArgumentParser",
"numpy.testing.assert_equal",
"dipy.workflows.tests.workflow_tests_utils.TestFlow",
"dipy.workflows.tests.workflow_tests_utils.DummyCombinedWorkflow",
"sys.argv.extend",
"dipy.workflows.flow_runner.run_flow",
"numpy.testing.assert_array_equal"
] | [((711, 734), 'sys.argv.extend', 'sys.argv.extend', (['inputs'], {}), '(inputs)\n', (726, 734), False, 'import sys\n'), ((748, 777), 'dipy.workflows.base.IntrospectiveArgumentParser', 'IntrospectiveArgumentParser', ([], {}), '()\n', (775, 777), False, 'from dipy.workflows.base import IntrospectiveArgumentParser\n'), ((... |
from skimage import io
import pyopencl as cl
import numpy as np
import sys
# VISIONGL IMPORTS
from vglShape import *
from vglStrEl import *
import vglConst as vc
"""
img:
is the input image
cl_shape:
3D Images:
The OpenCL's default is to be (img_width, img_height, img_depht)
2D Images:
The The OpenCL's ... | [
"pyopencl.enqueue_copy",
"vglConst.VGL_IMAGE_2D_IMAGE",
"skimage.io.imread",
"numpy.zeros",
"vglConst.VGL_IMAGE_3D_IMAGE",
"skimage.io.imsave",
"numpy.frombuffer",
"pyopencl.Image"
] | [((943, 966), 'vglConst.VGL_IMAGE_2D_IMAGE', 'vc.VGL_IMAGE_2D_IMAGE', ([], {}), '()\n', (964, 966), True, 'import vglConst as vc\n'), ((5103, 5209), 'pyopencl.enqueue_copy', 'cl.enqueue_copy', (['queue', 'self.img_device', 'self.img_host'], {'origin': 'origin', 'region': 'region', 'is_blocking': '(True)'}), '(queue, se... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: Yizhong
# created_at: 10/27/2016 下午8:34
import numpy
class Performance(object):
def __init__(self, percision, recall, hit_num):
self.percision = percision
self.recall = recall
self.hit_num = hit_num
class Metrics(object):
def _... | [
"numpy.array"
] | [((4236, 4273), 'numpy.array', 'numpy.array', (['self.span_perf.percision'], {}), '(self.span_perf.percision)\n', (4247, 4273), False, 'import numpy\n'), ((4301, 4335), 'numpy.array', 'numpy.array', (['self.span_perf.recall'], {}), '(self.span_perf.recall)\n', (4312, 4335), False, 'import numpy\n'), ((4779, 4815), 'num... |
import tensorflow as tf
import numpy as np
import random
class GaussianNoise():
def __init__(self,action_dimension,epsilon_init = 0.7, epsilon_end = 0.3,mu=0, theta =0.15, sigma = 0.25):
self.action_dimension = action_dimension
self.mu = mu
self.theta = theta
self.sigma = sigma
... | [
"tensorflow.reduce_sum",
"tensorflow.reduce_mean",
"tensorflow.log",
"numpy.arange",
"tensorflow.placeholder",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.concat",
"numpy.concatenate",
"tensorflow.trainable_variables",
"numpy.maximum",
"tensorflow.train.AdamOptimizer",
"numpy.rand... | [((591, 646), 'numpy.maximum', 'np.maximum', (['(self.epsilon - self.decay)', 'self.epsilon_end'], {}), '(self.epsilon - self.decay, self.epsilon_end)\n', (601, 646), True, 'import numpy as np\n'), ((5112, 5245), 'tensorflow.reshape', 'tf.reshape', (['(self.renew * (0.01 + 0.69 * (action + 1) / 2) + (1 - self.renew) * ... |
"""
Welcome to your first Halite-II bot!
This bot's name is Settler. It's purpose is simple (don't expect it to win complex games :) ):
1. Initialize game
2. If a ship is not docked and there are unowned planets
2.a. Try to Dock in the planet if close enough
2.b If not, go towards the planet
Note: Please do not place... | [
"numpy.mean",
"numpy.sqrt",
"numpy.minimum",
"hlt.Game",
"math.radians",
"numpy.array",
"numpy.sum",
"hlt.entity.Position",
"numpy.min",
"numpy.argmin",
"numpy.maximum",
"time.time"
] | [((811, 830), 'hlt.Game', 'hlt.Game', (['"""MyBot16"""'], {}), "('MyBot16')\n", (819, 830), False, 'import hlt\n'), ((1017, 1046), 'numpy.sqrt', 'numpy.sqrt', (['(dx * dx + dy * dy)'], {}), '(dx * dx + dy * dy)\n', (1027, 1046), False, 'import numpy\n'), ((5262, 5333), 'hlt.entity.Position', 'hlt.entity.Position', (['(... |
from sumo.constants import RUN_DEFAULTS
from sumo.modes.run.run import SumoRun
from sumo.utils import save_arrays_to_npz
import numpy as np
import os
import pytest
def _get_args(infile: str, k: list, outdir: str):
args = RUN_DEFAULTS.copy()
args['outdir'] = outdir
args['k'] = k
args["infile"] = infile... | [
"sumo.constants.RUN_DEFAULTS.copy",
"numpy.random.random",
"os.path.join",
"sumo.modes.run.run.SumoRun",
"numpy.array",
"pytest.raises",
"sumo.utils.save_arrays_to_npz"
] | [((227, 246), 'sumo.constants.RUN_DEFAULTS.copy', 'RUN_DEFAULTS.copy', ([], {}), '()\n', (244, 246), False, 'from sumo.constants import RUN_DEFAULTS\n'), ((460, 492), 'os.path.join', 'os.path.join', (['tmpdir', '"""data.npz"""'], {}), "(tmpdir, 'data.npz')\n", (472, 492), False, 'import os\n'), ((506, 536), 'os.path.jo... |
import argparse
import math
import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as Data
from torch.autograd import Variable
from torch.utils.data import Dataset
import math
from model import HierachyVAE
from read_data import *
from util... | [
"numpy.clip",
"torch.nn.CrossEntropyLoss",
"numpy.random.rand",
"math.floor",
"torch.max",
"torch.cuda.device_count",
"torch.cuda.is_available",
"torch.sum",
"model.HierachyVAE",
"argparse.ArgumentParser",
"numpy.exp",
"torch.nn.functional.log_softmax",
"torch.save",
"torch.cat",
"torch.... | [((341, 392), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Hierachy VAE"""'}), "(description='Hierachy VAE')\n", (364, 392), False, 'import argparse\n'), ((2749, 2774), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2772, 2774), False, 'import torch\n'), ((285... |
import argparse
import collections
import time
import numpy as np
import torch as th
import torch.nn.functional as F
import torch.nn.init as INIT
import torch.optim as optim
from torch.utils.data import DataLoader
from gene_dataset import Datagenerator
import torch
# from sklearn.decomposition import PCA
from sklearn.f... | [
"numpy.sqrt",
"math.sqrt",
"numpy.column_stack",
"dgl.data.tree.SST",
"torch.from_numpy",
"sklearn.feature_selection.SelectKBest",
"numpy.array",
"networkx.shortest_path",
"numpy.linalg.norm",
"operator.itemgetter",
"gene_dataset.Datagenerator",
"argparse.ArgumentParser",
"spacy.load",
"nu... | [((440, 456), 'spacy.load', 'spacy.load', (['"""en"""'], {}), "('en')\n", (450, 456), False, 'import spacy\n'), ((866, 884), 'numpy.square', 'np.square', (['(v1 - v2)'], {}), '(v1 - v2)\n', (875, 884), True, 'import numpy as np\n'), ((890, 900), 'numpy.sum', 'np.sum', (['sq'], {}), '(sq)\n', (896, 900), True, 'import n... |
#! /usr/bin/env python
#
from __future__ import print_function
import time
import os
import numpy as np
import logging
import subprocess
# For some variations on this theme, e.g. time.time vs. time.clock, see
# http://stackoverflow.com/questions/7370801/measure-time-elapsed-in-python
ostype = None
class DtimeSi... | [
"logging.basicConfig",
"time.clock",
"numpy.append",
"numpy.array",
"os.getpid",
"time.time",
"logging.info",
"os.uname"
] | [((6345, 6384), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (6364, 6384), False, 'import logging\n'), ((2293, 2305), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (2301, 2305), True, 'import numpy as np\n'), ((6260, 6299), 'numpy.array', 'np.array', (["[... |
import os
from os import path
from glob import glob
import json
import re
import pickle
import argparse
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from textwrap import wrap
from scipy import ndimage, misc
import config
from type import RecipeContainer, DataContainer
fro... | [
"scipy.ndimage.imread",
"numpy.array",
"textwrap.wrap",
"scipy.misc.imresize",
"os.walk",
"re.search",
"os.path.exists",
"argparse.ArgumentParser",
"numpy.random.random",
"type.DataContainer",
"matplotlib.use",
"numpy.fliplr",
"pickle.load",
"pickle.dump",
"os.path.join",
"utils.URL_to... | [((149, 163), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (156, 163), True, 'import matplotlib as mpl\n'), ((527, 550), 'numpy.random.shuffle', 'np.random.shuffle', (['keys'], {}), '(keys)\n', (544, 550), True, 'import numpy as np\n'), ((819, 859), 'numpy.array', 'np.array', (['[image_list[f] for f i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""examples/tests for peakfit"""
# Fix Python 2.x
from __future__ import print_function
try:
input = raw_input
except NameError:
pass
import os, sys
import numpy as np
try:
from PyMca5.PyMcaIO import specfilewrapper as specfile
except Exception:
try:
... | [
"os.path.join",
"sloth.fit.peakfit.fit_splitpvoigt",
"os.path.realpath",
"PyMca.specfile.Specfile",
"numpy.linspace",
"PyMca.SpecfitFuns.splitpvoigt"
] | [((515, 541), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (531, 541), False, 'import os, sys\n'), ((743, 766), 'numpy.linspace', 'np.linspace', (['(0)', '(50)', '(200)'], {}), '(0, 50, 200)\n', (754, 766), True, 'import numpy as np\n'), ((940, 987), 'sloth.fit.peakfit.fit_splitpvoigt', '... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import brew, core, workspace
from functools import reduce
from hypothesis import given
from operator import mul
import caffe2.python.hypothesis_test_ut... | [
"numpy.mean",
"caffe2.python.workspace.FeedBlob",
"numpy.reshape",
"caffe2.python.model_helper.ModelHelper",
"numpy.power",
"functools.reduce",
"caffe2.python.hypothesis_test_util.tensors",
"caffe2.python.workspace.RunNetOnce",
"numpy.sum",
"numpy.expand_dims",
"caffe2.python.core.CreateOperator... | [((712, 833), 'caffe2.python.core.CreateOperator', 'core.CreateOperator', (['"""LayerNormGradient"""', "['gout', 'out', 'mean', 'stdev', 'in']", "['gin']"], {'axis': 'axis', 'epsilon': 'epsilon'}), "('LayerNormGradient', ['gout', 'out', 'mean', 'stdev',\n 'in'], ['gin'], axis=axis, epsilon=epsilon)\n", (731, 833), F... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"paddle.fluid.core.supports_bfloat16",
"numpy.add",
"paddle.fluid.tests.unittests.op_test.convert_float_to_uint16",
"numpy.random.random",
"paddle.enable_static",
"unittest.main",
"paddle.fluid.core.CPUPlace"
] | [((2685, 2700), 'paddle.enable_static', 'enable_static', ([], {}), '()\n', (2698, 2700), False, 'from paddle import enable_static\n'), ((2705, 2720), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2718, 2720), False, 'import unittest\n'), ((1196, 1227), 'paddle.fluid.tests.unittests.op_test.convert_float_to_uint1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.