code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
# -*- coding: utf-8 -*-
import os
import numpy as np
import subprocess as subp
from sklearn.datasets import load_iris
from sklearn.datasets import load_breast_cancer
from sklearn.datasets import load_digits
from sklearn.utils import shuffle
from tests.utils.Timer import Timer
from tests.estimator.classifier.Separate... | [
"sklearn.datasets.load_iris",
"sklearn.datasets.load_digits",
"numpy.random.seed",
"sklearn.datasets.load_breast_cancer",
"os.environ.get",
"subprocess.call",
"sklearn.utils.shuffle"
] | [((484, 501), 'numpy.random.seed', 'np.random.seed', (['(5)'], {}), '(5)\n', (498, 501), True, 'import numpy as np\n'), ((1007, 1027), 'sklearn.datasets.load_breast_cancer', 'load_breast_cancer', ([], {}), '()\n', (1025, 1027), False, 'from sklearn.datasets import load_breast_cancer\n'), ((1275, 1286), 'sklearn.dataset... |
"""
###########################################################################
# @file optimization_utils.py
# @brief Functions for optimizing transformations and parameters.
#
# @author <NAME>
#
# @Link: https://www.cbica.upenn.edu/sbia/software/
#
# @Contact: <EMAIL>
#################################################... | [
"numpy.random.uniform",
"Mstep_trans.solve_delta",
"numpy.random.seed",
"numpy.log",
"numpy.eye",
"Mstep_trans.solve_T",
"numpy.sum",
"Mstep_trans.solve_sigsq",
"numpy.power",
"numpy.zeros",
"numpy.ones",
"numpy.transpose",
"numpy.finfo",
"numpy.linalg.norm",
"numpy.exp",
"Mstep_trans.... | [((435, 451), 'numpy.random.seed', 'np.random.seed', ([], {}), '()\n', (449, 451), True, 'import numpy as np\n'), ((832, 862), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(D, K)'}), '(size=(D, K))\n', (849, 862), True, 'import numpy as np\n'), ((1040, 1056), 'numpy.zeros', 'np.zeros', (['(D, M)'], {}), ... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
m = 1e-3
i_load = np.logspace(-5,-3)
i_load = np.linspace(1e-5,1e-3,200)
i_s = 1e-12
i_ph = 1e-3
V_T = 1.38e-23*300/1.6e-19
V_D = V_T*np.log((i_ph - i_load)/(i_s) + 1)
P_load = V_D*i_load
plt.subplot(2,1,1)
plt.plot(i_load/m,V_D)
plt.yl... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.log",
"matplotlib.pyplot.plot",
"numpy.logspace",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig"
] | [((94, 113), 'numpy.logspace', 'np.logspace', (['(-5)', '(-3)'], {}), '(-5, -3)\n', (105, 113), True, 'import numpy as np\n'), ((122, 152), 'numpy.linspace', 'np.linspace', (['(1e-05)', '(0.001)', '(200)'], {}), '(1e-05, 0.001, 200)\n', (133, 152), True, 'import numpy as np\n'), ((271, 291), 'matplotlib.pyplot.subplot'... |
# Modified based on the HRNet repo.
from __future__ import absolute_import, division, print_function
import logging
import os
import time
from pathlib import Path
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
class FullModel(nn.Module):
"""
Distribute the loss on multi-g... | [
"torch.distributed.is_initialized",
"numpy.argmax",
"torch.distributed.get_rank",
"os.path.basename",
"logging.StreamHandler",
"numpy.zeros",
"time.strftime",
"pathlib.Path",
"torch.arange",
"torch.distributed.get_world_size",
"numpy.bincount",
"os.path.join",
"logging.getLogger"
] | [((1003, 1037), 'torch.distributed.get_world_size', 'torch.distributed.get_world_size', ([], {}), '()\n', (1035, 1037), False, 'import torch\n'), ((1131, 1159), 'torch.distributed.get_rank', 'torch.distributed.get_rank', ([], {}), '()\n', (1157, 1159), False, 'import torch\n'), ((2058, 2078), 'pathlib.Path', 'Path', ([... |
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 14 10:40:39 2016
Converting reflectance spectrum to a CIE coordinate
@author: Bonan
"""
import numpy as np
from scipy import interpolate
import os
# Adobe RGB (1998) D65 as reference white
# http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_RGB.html
_RGB_to_XYZ = np.arra... | [
"matplotlib.pyplot.title",
"numpy.sum",
"os.path.join",
"os.path.dirname",
"matplotlib.pyplot.legend",
"numpy.sin",
"numpy.array",
"numpy.loadtxt",
"numpy.linspace",
"scipy.interpolate.splev",
"numpy.dot",
"scipy.interpolate.splrep"
] | [((313, 432), 'numpy.array', 'np.array', (['[[0.5767309, 0.185554, 0.1881852], [0.2973769, 0.6273491, 0.0752741], [\n 0.0270343, 0.0706872, 0.9911085]]'], {}), '([[0.5767309, 0.185554, 0.1881852], [0.2973769, 0.6273491, \n 0.0752741], [0.0270343, 0.0706872, 0.9911085]])\n', (321, 432), True, 'import numpy as np\n... |
import h5py
import tables
import numpy as np
import sys
args=int(sys.argv[1])
# Read hdf5 file
h5file = tables.open_file(f"./data/atraining-{args}.h5", "r")
WaveformTable = h5file.root.Waveform
GroundTruthTable = h5file.root.GroundTruth
sinevet,sinchan,sintime=[],[],[]
#根据groundtruth找出只有单光子的事例
i=1
while i <100000:
... | [
"h5py.File",
"numpy.average",
"numpy.zeros",
"numpy.append",
"numpy.array",
"tables.open_file"
] | [((105, 157), 'tables.open_file', 'tables.open_file', (['f"""./data/atraining-{args}.h5"""', '"""r"""'], {}), "(f'./data/atraining-{args}.h5', 'r')\n", (121, 157), False, 'import tables\n'), ((665, 695), 'numpy.zeros', 'np.zeros', (['(1029)'], {'dtype': 'np.int32'}), '(1029, dtype=np.int32)\n', (673, 695), True, 'impor... |
import tensorflow as tf
import dataIO
import numpy as np
from datetime import datetime
from model import model
from parameters import *
# preprocess input data
def prepareDataTraining(seg_data, somae_data_raw):
somae_data = seg_data.copy()
somae_data[somae_data_raw==0]=0
seg_data = seg_data[:,:network_si... | [
"tensorflow.keras.metrics.FalseNegatives",
"numpy.arange",
"numpy.unique",
"tensorflow.math.log",
"tensorflow.keras.metrics.TrueNegatives",
"tensorflow.keras.metrics.FalsePositives",
"model.model",
"numpy.max",
"numpy.random.choice",
"datetime.datetime.now",
"tensorflow.initializers.RandomNormal... | [((486, 589), 'numpy.zeros', 'np.zeros', (['(seg_data.shape[0], seg_data.shape[1], seg_data.shape[2], depth * 2 + 1)'], {'dtype': 'np.uint8'}), '((seg_data.shape[0], seg_data.shape[1], seg_data.shape[2], depth * \n 2 + 1), dtype=np.uint8)\n', (494, 589), True, 'import numpy as np\n'), ((1085, 1126), 'numpy.random.pe... |
import numpy as np
# Select dataset
dataset = ['A', 'B', 'C']
dataset_id = 0
print(dataset[dataset_id])
# Select model
models = ['fNIRS-T', 'fNIRS-PreT']
models_id = 0
print(models[models_id])
test_acc = []
for tr in range(1, 26):
path = 'save/' + dataset[dataset_id] + '/KFold/' + models[models_id] + '/' + str(... | [
"numpy.std",
"numpy.mean",
"numpy.array"
] | [((511, 529), 'numpy.array', 'np.array', (['test_acc'], {}), '(test_acc)\n', (519, 529), True, 'import numpy as np\n'), ((552, 569), 'numpy.mean', 'np.mean', (['test_acc'], {}), '(test_acc)\n', (559, 569), True, 'import numpy as np\n'), ((592, 608), 'numpy.std', 'np.std', (['test_acc'], {}), '(test_acc)\n', (598, 608),... |
from os.path import join
import cv2
import numpy as np
from numpy.random import uniform
from sys import exit
import tensorflow as tf
model_path = join('models', 'symbol_classifier', 'model.h5')
model = tf.keras.models.load_model(model_path)
path = join('data', 'raw', 'n', '1.jpeg')
image_name = "data"
drawing = Fal... | [
"cv2.line",
"numpy.random.uniform",
"tensorflow.keras.models.load_model",
"cv2.waitKey",
"tensorflow.io.encode_jpeg",
"numpy.asarray",
"tensorflow.reshape",
"cv2.imshow",
"numpy.ones",
"tensorflow.io.decode_jpeg",
"cv2.setMouseCallback",
"tensorflow.image.resize",
"cv2.destroyAllWindows",
... | [((148, 195), 'os.path.join', 'join', (['"""models"""', '"""symbol_classifier"""', '"""model.h5"""'], {}), "('models', 'symbol_classifier', 'model.h5')\n", (152, 195), False, 'from os.path import join\n'), ((204, 242), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (['model_path'], {}), '(model_pat... |
import numpy as np
import g2o
class MotionModel(object):
def __init__(self,
timestamp=None,
initial_position=np.zeros(3),
initial_orientation=g2o.Quaternion(),
initial_covariance=None):
self.timestamp = timestamp
self.position = initial_positi... | [
"g2o.Quaternion",
"g2o.AngleAxis",
"g2o.Isometry3d",
"numpy.zeros",
"numpy.array"
] | [((143, 154), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (151, 154), True, 'import numpy as np\n'), ((189, 205), 'g2o.Quaternion', 'g2o.Quaternion', ([], {}), '()\n', (203, 205), False, 'import g2o\n'), ((461, 472), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (469, 472), True, 'import numpy as np\n'), ((... |
import numpy as np
import string
import pandas as pd
from keras.preprocessing.sequence import pad_sequences
char_limit = 1014
def get_data(path):
labels = []
inputs = []
df = pd.read_csv(path, names=['one','second','third'])
df = df.drop('second', axis=1)
data = df.values
for label,text in da... | [
"pandas.read_csv",
"keras.preprocessing.sequence.pad_sequences",
"numpy.array"
] | [((190, 241), 'pandas.read_csv', 'pd.read_csv', (['path'], {'names': "['one', 'second', 'third']"}), "(path, names=['one', 'second', 'third'])\n", (201, 241), True, 'import pandas as pd\n'), ((1047, 1060), 'numpy.array', 'np.array', (['vec'], {}), '(vec)\n', (1055, 1060), True, 'import numpy as np\n'), ((1248, 1305), '... |
#%%
import matplotlib.pyplot as plt
import numpy as np
Rload = 3300
R_25 = 10000
T_25 = 25 + 273.15 #Kelvin
Beta = 3434
Tmin = 0
Tmax = 140
temps = np.linspace(Tmin, Tmax, 1000)
tempsK = temps + 273.15
# https://en.wikipedia.org/wiki/Thermistor#B_or_%CE%B2_parameter_equation
r_inf = R_25 * np.exp(-Beta/T_25)
R_temps... | [
"numpy.poly1d",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.polyfit",
"matplotlib.pyplot.legend",
"numpy.exp",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((150, 179), 'numpy.linspace', 'np.linspace', (['Tmin', 'Tmax', '(1000)'], {}), '(Tmin, Tmax, 1000)\n', (161, 179), True, 'import numpy as np\n'), ((388, 411), 'numpy.polyfit', 'np.polyfit', (['V', 'temps', '(3)'], {}), '(V, temps, 3)\n', (398, 411), True, 'import numpy as np\n'), ((417, 431), 'numpy.poly1d', 'np.poly... |
# -*- coding: utf-8 -*-
# @Date : 2020/5/24
# @Author: Luokun
# @Email : <EMAIL>
import sys
from os.path import dirname, abspath
import matplotlib.pyplot as plt
import numpy as np
sys.path.append(dirname(dirname(abspath(__file__))))
def test_knn():
from models.knn import KNN
x, y = np.random.randn(3, 200... | [
"matplotlib.pyplot.title",
"os.path.abspath",
"matplotlib.pyplot.show",
"numpy.sum",
"numpy.random.randn",
"matplotlib.pyplot.scatter",
"numpy.zeros",
"models.knn.KNN",
"matplotlib.pyplot.figure",
"numpy.array"
] | [((357, 373), 'numpy.array', 'np.array', (['[2, 2]'], {}), '([2, 2])\n', (365, 373), True, 'import numpy as np\n'), ((399, 416), 'numpy.array', 'np.array', (['[2, -2]'], {}), '([2, -2])\n', (407, 416), True, 'import numpy as np\n'), ((553, 559), 'models.knn.KNN', 'KNN', (['(3)'], {}), '(3)\n', (556, 559), False, 'from ... |
from dataclasses import dataclass
import numpy as np
@dataclass
class ObjectTrackingResult:
frame_index: int
tracking_id: int
class_id: int
class_name: str
xmin: int
ymin: int
xmax: int
ymax: int
confidence: float
is_active: bool
def to_txt(self):
return "{} {} {} ... | [
"numpy.array"
] | [((718, 789), 'numpy.array', 'np.array', (['[self.xmin, self.ymin, self.xmax, self.ymax, self.confidence]'], {}), '([self.xmin, self.ymin, self.xmax, self.ymax, self.confidence])\n', (726, 789), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
import numpy as np
#%%
def tol2side_x_eq_y(x, y, tol_below=0.0, tol_above=0.0):
'''在上界误差tol_above和下界误差tol_below范围内判断x是否等于y'''
return y - tol_below <= x <= y + tol_above
def tol_eq(x, y, tol=0.0):
'''在绝对误差tol范围内判断x和y相等'''
return abs(x - y) <= tol
def tol_x_big_y(x, y, tol=0.... | [
"numpy.cumsum"
] | [((1570, 1585), 'numpy.cumsum', 'np.cumsum', (['alts'], {}), '(alts)\n', (1579, 1585), True, 'import numpy as np\n')] |
import numpy as np
import cv2
from poisson_disk import PoissonDiskSampler
import skimage.morphology
import skimage.measure
import scipy.stats
class Box(object):
"""
This class represents a box in an image. This could be a bounding box of an object or part.
Internally each box is represented by a tuple of ... | [
"numpy.zeros",
"poisson_disk.PoissonDiskSampler",
"numpy.where",
"numpy.array",
"cv2.rectangle"
] | [((2542, 2630), 'cv2.rectangle', 'cv2.rectangle', (['new_img', '(self.ymin, self.xmin)', '(self.ymax, self.xmax)', 'color', 'width'], {}), '(new_img, (self.ymin, self.xmin), (self.ymax, self.xmax),\n color, width)\n', (2555, 2630), False, 'import cv2\n'), ((3701, 3736), 'numpy.zeros', 'np.zeros', (['(height, width)'... |
import numpy as np
# direct cluster
class FCM(object):
def __init__(self, data):
self.lambd = 0
self.data = data
self.cluster = []
self.F_S = []
def standard(self):
data_min, data_max = np.min(self.data, axis=0), np.max(self.data, axis=0)
num_sampl... | [
"numpy.square",
"numpy.zeros",
"numpy.shape",
"numpy.min",
"numpy.mean",
"numpy.array",
"numpy.max",
"numpy.unique"
] | [((4941, 5072), 'numpy.array', 'np.array', (['[[80.0, 10.0, 6.0, 2.0], [50.0, 1.0, 6.0, 4.0], [90.0, 6.0, 4.0, 6.0], [\n 40.0, 5.0, 7.0, 3.0], [10.0, 1.0, 2.0, 4.0]]'], {}), '([[80.0, 10.0, 6.0, 2.0], [50.0, 1.0, 6.0, 4.0], [90.0, 6.0, 4.0, \n 6.0], [40.0, 5.0, 7.0, 3.0], [10.0, 1.0, 2.0, 4.0]])\n', (4949, 5072),... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"numpy.einsum",
"numpy.einsum_path"
] | [((1342, 1368), 'numpy.einsum', 'np.einsum', (['*args'], {}), '(*args, **kwargs)\n', (1351, 1368), True, 'import numpy as np\n'), ((1140, 1191), 'numpy.einsum_path', 'np.einsum_path', (['*args'], {'optimize': '"""optimal"""'}), "(*args, **kwargs, optimize='optimal')\n", (1154, 1191), True, 'import numpy as np\n')] |
# # -*- coding: utf-8 -*-
# from chatterbot import ChatBot
# bot = ChatBot(
# "Math & Time Bot",
# logic_adapters=[
# "chatterbot.logic.MathematicalEvaluation",
# "chatterbot.logic.TimeLogicAdapter"
# ],
# input_adapter="chatterbot.input.VariableInputTypeAdapter",
# output_adapter=... | [
"numpy.fft.rfft",
"numpy.abs",
"matplotlib.pyplot.plot",
"numpy.median",
"numpy.floor",
"numpy.zeros",
"scipy.io.wavfile.read",
"numpy.shape",
"numpy.fft.fftfreq",
"pickle.load",
"numpy.array",
"numpy.linspace",
"numpy.round",
"os.listdir"
] | [((4136, 4157), 'os.listdir', 'os.listdir', (['"""./songs"""'], {}), "('./songs')\n", (4146, 4157), False, 'import os\n'), ((4281, 4308), 'numpy.array', 'np.array', (['fingerprint1[20:]'], {}), '(fingerprint1[20:])\n', (4289, 4308), True, 'import numpy as np\n'), ((1324, 1343), 'numpy.fft.rfft', 'np.fft.rfft', (['frame... |
import loaders
import xarray as xr
import numpy as np
from loaders._utils import SAMPLE_DIM_NAME
import pytest
def test_multiple_unstacked_dims():
na, nb, nc, nd = 2, 3, 4, 5
ds = xr.Dataset(
data_vars={
"var1": xr.DataArray(
np.zeros([na, nb, nc, nd]), dims=["a", "b", "c",... | [
"loaders.stack",
"pytest.mark.parametrize",
"numpy.zeros",
"xarray.Dataset"
] | [((1424, 1521), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""gridded_dataset"""', '[(0, 1, 10, 10), (0, 10, 10, 10)]'], {'indirect': '(True)'}), "('gridded_dataset', [(0, 1, 10, 10), (0, 10, 10, 10)\n ], indirect=True)\n", (1447, 1521), False, 'import pytest\n'), ((764, 815), 'loaders.stack', 'loaders... |
# type: ignore
"""
A Tensor module on top of Numpy arrays.
TODO: Implement the reverse mode autodiff to compute gradients. It will have
to go backward through the computation graph.
"""
from __future__ import annotations
from typing import Union
import os
import pkgutil
import numpy as np
import pyopencl as ... | [
"pyopencl.array.sum",
"numpy.sum",
"numpy.maximum",
"pyopencl.clmath.exp",
"pyopencl.enqueue_copy",
"pyopencl.array.transpose",
"numpy.empty",
"pyopencl.array.empty",
"pyopencl.array.minimum",
"pyopencl.Buffer",
"numpy.mean",
"numpy.exp",
"numpy.random.normal",
"pyopencl.array.reshape",
... | [((521, 559), 'pyopencl.create_some_context', 'cl.create_some_context', ([], {'answers': '[0, 1]'}), '(answers=[0, 1])\n', (543, 559), True, 'import pyopencl as cl\n'), ((608, 632), 'pyopencl.CommandQueue', 'cl.CommandQueue', (['CONTEXT'], {}), '(CONTEXT)\n', (623, 632), True, 'import pyopencl as cl\n'), ((20996, 21011... |
# -*- coding: utf-8 -*-
"""SPARC4 spectral response tests.
This script tests the operation of the SPARC4 spectral response classes.
"""
import os
import numpy as np
import pandas as pd
import pytest
from AIS.SPARC4_Spectral_Response import (
Abstract_SPARC4_Spectral_Response,
Concrete_SPARC4_Spectral_Respons... | [
"AIS.SPARC4_Spectral_Response.Concrete_SPARC4_Spectral_Response_3",
"AIS.SPARC4_Spectral_Response.Concrete_SPARC4_Spectral_Response_4",
"numpy.allclose",
"numpy.asanyarray",
"numpy.ones",
"AIS.SPARC4_Spectral_Response.Concrete_SPARC4_Spectral_Response_1",
"AIS.SPARC4_Spectral_Response.Concrete_SPARC4_Sp... | [((539, 554), 'numpy.ones', 'np.ones', (['(4, n)'], {}), '((4, n))\n', (546, 554), True, 'import numpy as np\n'), ((1556, 1591), 'AIS.SPARC4_Spectral_Response.Abstract_SPARC4_Spectral_Response', 'Abstract_SPARC4_Spectral_Response', ([], {}), '()\n', (1589, 1591), False, 'from AIS.SPARC4_Spectral_Response import Abstrac... |
import numpy
import pandas
import requests
from bs4 import BeautifulSoup as bsoup
from time import sleep
from random import randint
# start and end of urls for imbd top 1000 movies site
URL_START = "https://www.imdb.com/search/title/?groups=top_1000&start="
URL_END = "&ref_=adv_nxt"
# data for each movie
titles = []
... | [
"pandas.DataFrame",
"random.randint",
"numpy.arange",
"bs4.BeautifulSoup",
"pandas.to_numeric"
] | [((456, 481), 'numpy.arange', 'numpy.arange', (['(1)', '(1001)', '(50)'], {}), '(1, 1001, 50)\n', (468, 481), False, 'import numpy\n'), ((1634, 1797), 'pandas.DataFrame', 'pandas.DataFrame', (["{'movie': titles, 'year': years, 'runtime': runtimes, 'imdb': ratings,\n 'metascore': metascores, 'votes': votes, 'grossMil... |
#########################################################################
### Program clean tweets ###
### 1. spaCy POS tagging for relevant tweets (apple fruit vs iphone) ###
### 2. Sentiment analysis of tweets ###
### 3. Group tweets by d... | [
"pandas.DataFrame",
"nltk.stem.WordNetLemmatizer",
"nltk.sentiment.vader.SentimentIntensityAnalyzer",
"pandas.read_csv",
"numpy.where",
"pandas.to_datetime",
"pandas.to_timedelta",
"nltk.corpus.stopwords.words",
"en_core_web_sm.load",
"pandas.concat",
"nltk.word_tokenize"
] | [((1269, 1295), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""english"""'], {}), "('english')\n", (1284, 1295), False, 'from nltk.corpus import stopwords\n'), ((1460, 1479), 'nltk.stem.WordNetLemmatizer', 'WordNetLemmatizer', ([], {}), '()\n', (1477, 1479), False, 'from nltk.stem import WordNetLemmatizer\n'),... |
# <Copyright 2022, Argo AI, LLC. Released under the MIT license.>
"""Generate MP4 videos with map entities rendered on top of sensor imagery, for all cameras, for a single log.
We use a inferred depth map from LiDAR to render only visible map entities (lanes and pedestrian crossings).
"""
import logging
import os
im... | [
"av2.map.map_api.ArgoverseStaticMap.from_map_dir",
"av2.utils.io.read_img",
"av2.utils.io.write_img",
"av2.geometry.interpolate.interp_arc",
"click.option",
"av2.rendering.video.write_video",
"pathlib.Path",
"click.Path",
"numpy.full",
"click.command",
"av2.rendering.map.EgoViewMapRenderer",
"... | [((950, 977), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (967, 977), False, 'import logging\n'), ((9898, 10022), 'click.command', 'click.command', ([], {'help': '"""Generate map visualizations on ego-view imagery from the Argoverse 2 Sensor or TbV Datasets."""'}), "(help=\n 'Genera... |
# -*- coding: utf-8 -*-
import os, sys
import shutil
import tissueloc as tl
from tissueloc.load_slide import load_slide_img, select_slide_level
import numpy as np
from skimage import io, color
import cv2
if __name__ == "__main__":
slide_dir = "../data/TestSlides/Malignant"
save_dir = "../data/TestSlides/Mal... | [
"os.makedirs",
"tissueloc.load_slide.load_slide_img",
"numpy.ascontiguousarray",
"os.path.exists",
"cv2.drawContours",
"os.path.splitext",
"tissueloc.load_slide.select_slide_level",
"shutil.rmtree",
"os.path.join",
"os.listdir",
"tissueloc.locate_tissue_cnts"
] | [((342, 366), 'os.path.exists', 'os.path.exists', (['save_dir'], {}), '(save_dir)\n', (356, 366), False, 'import os, sys\n'), ((404, 425), 'os.makedirs', 'os.makedirs', (['save_dir'], {}), '(save_dir)\n', (415, 425), False, 'import os, sys\n'), ((376, 399), 'shutil.rmtree', 'shutil.rmtree', (['save_dir'], {}), '(save_d... |
#! /usr/bin/env python
"""Run a YOLO_v2 style detection model on test images."""
import argparse
import colorsys
import imghdr
import os
import random
import numpy as np
from keras import backend as K
from keras.models import load_model
from PIL import Image, ImageDraw, ImageFont
from yad2k.models.keras_yolo import y... | [
"keras.models.load_model",
"keras.backend.placeholder",
"os.mkdir",
"os.makedirs",
"colorsys.hsv_to_rgb",
"keras.backend.learning_phase",
"keras.backend.get_session",
"random.shuffle",
"numpy.floor",
"os.path.exists",
"numpy.expand_dims",
"yad2k.models.keras_yolo.yolo_eval",
"random.seed",
... | [((1317, 1339), 'keras.models.load_model', 'load_model', (['model_path'], {}), '(model_path)\n', (1327, 1339), False, 'from keras.models import load_model\n'), ((2427, 2445), 'random.seed', 'random.seed', (['(10101)'], {}), '(10101)\n', (2438, 2445), False, 'import random\n'), ((2499, 2521), 'random.shuffle', 'random.s... |
import random
from collections import deque
import numpy as np
from keras.layers import Dense
from keras.models import Sequential
from keras.optimizers import Adam
class DQNAgent:
def __init__(self, state_size,
action_size,
memory_size,
hidden_layers_number,
... | [
"numpy.argmax",
"random.sample",
"keras.optimizers.Adam",
"keras.layers.Dense",
"numpy.array",
"random.randrange",
"numpy.random.rand",
"keras.models.Sequential",
"collections.deque"
] | [((721, 746), 'collections.deque', 'deque', ([], {'maxlen': 'memory_size'}), '(maxlen=memory_size)\n', (726, 746), False, 'from collections import deque\n'), ((1271, 1283), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1281, 1283), False, 'from keras.models import Sequential\n'), ((2019, 2069), 'random.sa... |
import os
import json
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
# t_stat, p_val = stats.ttest_ind(sample1, sample2, equal_var=False)
test_result_dir = "utils/testresults"
all_results = {}
aggregate_terms = [
"count", "valid", "missing", "distinct", "sum", "mean", "average",
... | [
"numpy.mean"
] | [((3168, 3193), 'numpy.mean', 'np.mean', (['valid_json_array'], {}), '(valid_json_array)\n', (3175, 3193), True, 'import numpy as np\n'), ((3221, 3246), 'numpy.mean', 'np.mean', (['valid_vega_array'], {}), '(valid_vega_array)\n', (3228, 3246), True, 'import numpy as np\n'), ((3284, 3312), 'numpy.mean', 'np.mean', (['ph... |
import numpy as np
import torch
from PIL import Image
import torchvision.transforms as T
from infer import Inference
from utils.nms import nms
torch.set_grad_enabled(False)
def class_agnostic_nms(boxes, scores, iou=0.5):
if len(boxes) > 1:
boxes, scores = nms(np.array(boxes), np.array(scores), iou)
... | [
"torch.stack",
"torchvision.transforms.Normalize",
"torch.cat",
"PIL.Image.open",
"torchvision.transforms.ToTensor",
"numpy.array",
"numpy.linspace",
"torch.set_grad_enabled",
"torch.tensor",
"infer.Inference.__init__",
"torchvision.transforms.Resize"
] | [((144, 173), 'torch.set_grad_enabled', 'torch.set_grad_enabled', (['(False)'], {}), '(False)\n', (166, 173), False, 'import torch\n'), ((926, 970), 'numpy.linspace', 'np.linspace', (['(0)', '(img_w - x_inc)', 'crop_chunks_y'], {}), '(0, img_w - x_inc, crop_chunks_y)\n', (937, 970), True, 'import numpy as np\n'), ((194... |
# -*- coding: utf-8 -*-
import hashlib
import logging
import os
import tempfile
import time
import cv2
import numpy as np
WIDTH_HEIGHT_LIMIT = 1600 # in pixel
def resize_large_image(image_data):
img_array = np.fromstring(image_data, dtype=np.uint8)
image = cv2.imdecode(img_array, 1)
height, width = ima... | [
"tempfile.NamedTemporaryFile",
"os.remove",
"os.stat",
"cv2.imwrite",
"cv2.imdecode",
"time.time",
"hashlib.sha256",
"cv2.imread",
"numpy.fromstring",
"os.path.isfile",
"os.path.join",
"os.listdir",
"cv2.resize"
] | [((216, 257), 'numpy.fromstring', 'np.fromstring', (['image_data'], {'dtype': 'np.uint8'}), '(image_data, dtype=np.uint8)\n', (229, 257), True, 'import numpy as np\n'), ((270, 296), 'cv2.imdecode', 'cv2.imdecode', (['img_array', '(1)'], {}), '(img_array, 1)\n', (282, 296), False, 'import cv2\n'), ((1407, 1418), 'time.t... |
import importlib
from hydroDL.master import basins
from hydroDL.app import waterQuality, wqLinear
from hydroDL import kPath
from hydroDL.model import trainTS
from hydroDL.data import gageII, usgs
from hydroDL.post import axplot, figplot
import torch
import os
import json
import numpy as np
import pandas as pd
import m... | [
"hydroDL.post.axplot.plotTS",
"hydroDL.app.waterQuality.calErrSeq",
"hydroDL.post.figplot.clickMap",
"numpy.datetime64",
"matplotlib.pyplot.subplots",
"hydroDL.app.waterQuality.DataModelWQ",
"hydroDL.master.basins.loadSeq",
"importlib.reload",
"hydroDL.master.basins.loadMaster",
"hydroDL.post.axpl... | [((400, 436), 'hydroDL.app.waterQuality.DataModelWQ', 'waterQuality.DataModelWQ', (['"""Silica64"""'], {}), "('Silica64')\n", (424, 436), False, 'from hydroDL.app import waterQuality, wqLinear\n'), ((555, 581), 'hydroDL.master.basins.loadMaster', 'basins.loadMaster', (['outName'], {}), '(outName)\n', (572, 581), False,... |
import vne
from vne.constants import nfeat, nsensors
from vne.model import simpleModel, init_weights_simple
from vne.persist import save_model, load_model
import numpy as np
import torch
import os
def encode_save(sig=np.random.random([1, nfeat, nsensors]), name='simpleModel_ini', dir_path="../src/vne/models"):
""... | [
"vne.persist.save_model",
"torch.onnx.export",
"vne.model.simpleModel",
"torch.randn",
"vne.persist.load_model",
"numpy.random.random",
"os.path.join"
] | [((219, 257), 'numpy.random.random', 'np.random.random', (['[1, nfeat, nsensors]'], {}), '([1, nfeat, nsensors])\n', (235, 257), True, 'import numpy as np\n'), ((1351, 1406), 'vne.persist.save_model', 'save_model', ([], {'encoder': 'model', 'name': 'name', 'dir_path': 'dir_path'}), '(encoder=model, name=name, dir_path=... |
import os
import argparse
import configargparse
import time
import glob
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision.transforms import functional as VF
from torch.nn import functional as F
import cv2
import model
import data
from eval.kitti_depth_eval_utils import ... | [
"torchvision.transforms.functional.normalize",
"model.to",
"os.makedirs",
"torch.utils.data.DataLoader",
"torchvision.transforms.functional.to_tensor",
"os.path.join",
"torch.load",
"cv2.imwrite",
"numpy.savez",
"numpy.percentile",
"numpy.min",
"model.eval",
"numpy.squeeze",
"model.depth_n... | [((1346, 1363), 'opts.parse_args', 'opts.parse_args', ([], {}), '()\n', (1361, 1363), False, 'import opts\n'), ((1425, 1452), 'torch.load', 'torch.load', (['args.checkpoint'], {}), '(args.checkpoint)\n', (1435, 1452), False, 'import torch\n'), ((1458, 1501), 'os.makedirs', 'os.makedirs', (['args.output_dir'], {'exist_o... |
"""Armijo rule."""
import numpy as np
from optimus.types import LRMethod, Function
class Armijo(LRMethod):
"""Armijo method for finding Learning Rate.
This method successively reduces the learning rate until it finds the
resulting change to be as good as a linear approximation of the function.
"""
... | [
"numpy.dot"
] | [((1071, 1098), 'numpy.dot', 'np.dot', (['gradient', 'direction'], {}), '(gradient, direction)\n', (1077, 1098), True, 'import numpy as np\n')] |
from astropy.cosmology.funcs import z_at_value
import numpy as np
from pyHalo.single_realization import SingleHalo
import numpy.testing as npt
import numpy as np
from pyHalo.Halos.HaloModels.ULDM import ULDMFieldHalo, ULDMSubhalo
from pyHalo.Halos.lens_cosmo import LensCosmo
from pyHalo.Cosmology.cosmology import Cosmo... | [
"pyHalo.Cosmology.cosmology.Cosmology",
"lenstronomy.LensModel.Profiles.uldm.Uldm",
"lenstronomy.LensModel.Profiles.cnfw.CNFW",
"numpy.testing.assert_almost_equal",
"pyHalo.single_realization.SingleHalo",
"pytest.main",
"numpy.testing.assert_string_equal",
"numpy.array",
"numpy.testing.assert_equal"... | [((5016, 5029), 'pytest.main', 'pytest.main', ([], {}), '()\n', (5027, 5029), False, 'import pytest\n'), ((613, 644), 'numpy.sqrt', 'np.sqrt', (['(1 + 0.5 ** 2 + 70 ** 2)'], {}), '(1 + 0.5 ** 2 + 70 ** 2)\n', (620, 644), True, 'import numpy as np\n'), ((1168, 1204), 'pyHalo.Cosmology.cosmology.Cosmology', 'Cosmology', ... |
from generator import Generator
import numpy as np, random
np.set_printoptions(precision=4, suppress=True, linewidth=132)
from tensorflow import keras
from tensorflow.keras.layers import LSTM, Dense, Input
from tensorflow.keras import Model
from tensorflow.keras.optimizers import Adagrad
def create_net(nwords, batch... | [
"numpy.set_printoptions",
"numpy.sum",
"random.randint",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Model",
"numpy.array",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.LSTM",
"numpy.random.choice",
"generator.Generator",
"tensorflow.keras.optimizers.Adagrad"
] | [((60, 122), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(4)', 'suppress': '(True)', 'linewidth': '(132)'}), '(precision=4, suppress=True, linewidth=132)\n', (79, 122), True, 'import numpy as np, random\n'), ((350, 394), 'tensorflow.keras.layers.Input', 'Input', (['(None, nwords)'], {'batch_siz... |
import numpy as np
import matplotlib.pyplot as plt
import os
import cv2
from scipy.ndimage import gaussian_filter, median_filter
from matplotlib.animation import FuncAnimation
from perlin_noise import PerlinNoise
##########################################################################################
# FUNCTIONS FOR... | [
"perlin_noise.PerlinNoise",
"numpy.sum",
"matplotlib.pyplot.figure",
"numpy.linalg.norm",
"numpy.random.normal",
"matplotlib.pyplot.gca",
"cv2.VideoWriter",
"scipy.ndimage.median_filter",
"os.path.join",
"scipy.ndimage.gaussian_filter",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.close",
... | [((2777, 2799), 'numpy.zeros', 'np.zeros', (['matrix.shape'], {}), '(matrix.shape)\n', (2785, 2799), True, 'import numpy as np\n'), ((2812, 2834), 'numpy.zeros', 'np.zeros', (['matrix.shape'], {}), '(matrix.shape)\n', (2820, 2834), True, 'import numpy as np\n'), ((2847, 2869), 'numpy.zeros', 'np.zeros', (['matrix.shape... |
_url = 'https://raw.githubusercontent.com/mikkokotila/version-controlled-data/master/data/polymod_social_contact_data.csv'
class Polymod:
def __init__(self, data=None):
import pandas as _pd
self.data = _pd.read_csv(_url)
def country_data(self, country_code='fi'):
... | [
"pandas.read_csv",
"numpy.array"
] | [((246, 264), 'pandas.read_csv', '_pd.read_csv', (['_url'], {}), '(_url)\n', (258, 264), True, 'import pandas as _pd\n'), ((3351, 3373), 'numpy.array', 'np.array', (['restrictions'], {}), '(restrictions)\n', (3359, 3373), True, 'import numpy as np\n'), ((953, 979), 'numpy.array', 'np.array', (['age_distribution'], {}),... |
# -*- coding: utf-8 -*-
# @Time : 2019/1/8 下午8:20
# @Author : yidxue
from __future__ import division
import numpy
import datetime
import pandas as pd
def get_all_file_path(path):
"""
循环遍历,得到一个文件夹第一层下的文件路径
"""
import os
file_name_list = os.listdir(path)
return [path + os.sep + file_name for... | [
"pandas.Series",
"datetime.datetime.strptime",
"os.listdir",
"numpy.sqrt"
] | [((262, 278), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (272, 278), False, 'import os\n'), ((1673, 1693), 'numpy.sqrt', 'numpy.sqrt', (['variance'], {}), '(variance)\n', (1683, 1693), False, 'import numpy\n'), ((2234, 2290), 'pandas.Series', 'pd.Series', (['{item[0]: item[1] for item in data_sort[key]}'],... |
"""
This is a sample stub of loadgen with multiple processes support.
Each process sets its affinity by a proc list.
Loadgen is a producer, which calls issue_queries(). issue_queries() gets query
from loadgen and puts query id/sample indices into an input queue.
Each Consumer(process)'s run() reads input queue, calls... | [
"argparse.ArgumentParser",
"multiprocessing.Lock",
"mlperf_loadgen.TestSettings",
"multiprocessing.Value",
"collections.defaultdict",
"numpy.mean",
"multiprocessing.Queue",
"multiprocessing.Process.__init__",
"subprocess.check_call",
"os.path.exists",
"gluonnlp.data.SQuAD",
"mlperf_loadgen.Log... | [((1116, 1155), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (1135, 1155), False, 'import logging\n'), ((1162, 1193), 'logging.getLogger', 'logging.getLogger', (['"""MXNet-BERT"""'], {}), "('MXNet-BERT')\n", (1179, 1193), False, 'import logging\n'), ((1333, 13... |
# Author: <NAME> (<EMAIL>)
# Center for Machine Perception, Czech Technical University in Prague
"""Evaluation script for the BOP Challenge 2019."""
import os
import time
import argparse
import subprocess
import numpy as np
from bop_toolkit_lib import config
from bop_toolkit_lib import inout
from bop_toolkit_lib imp... | [
"argparse.ArgumentParser",
"os.path.basename",
"bop_toolkit_lib.misc.log",
"time.time",
"bop_toolkit_lib.misc.get_score_signature",
"numpy.mean",
"subprocess.call",
"numpy.arange",
"bop_toolkit_lib.inout.load_json",
"os.path.join",
"bop_toolkit_lib.misc.get_error_signature"
] | [((2255, 2280), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2278, 2280), False, 'import argparse\n'), ((7234, 7251), 'bop_toolkit_lib.misc.log', 'misc.log', (['"""Done."""'], {}), "('Done.')\n", (7242, 7251), False, 'from bop_toolkit_lib import misc\n'), ((3163, 3186), 'bop_toolkit_lib.misc... |
# ---
# jupyter:
# kernelspec:
# display_name: Python 3
# name: python3
# ---
# %% [markdown]
# # The bike rides dataset
#
# In this notebook, we will present the "Bike Ride" dataset. This dataset is
# located in the directory `datasets` in a comma separated values (CSV) format.
#
# We open this dataset usin... | [
"matplotlib.pyplot.title",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"numpy.random.RandomState",
"numpy.arange",
"seaborn.pairplot",
"matplotlib.pyplot.subplots_adjust",
"pandas.qcut",
"matplotlib.pyplot.xlabel"
] | [((367, 408), 'pandas.read_csv', 'pd.read_csv', (['"""../datasets/bike_rides.csv"""'], {}), "('../datasets/bike_rides.csv')\n", (378, 408), True, 'import pandas as pd\n'), ((1387, 1459), 'pandas.read_csv', 'pd.read_csv', (['"""../datasets/bike_rides.csv"""'], {'index_col': '(0)', 'parse_dates': '(True)'}), "('../datase... |
import logging
import random
import numpy as np
# imports for deformed slice
from skimage.draw import line
from scipy.ndimage.measurements import label
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.morphology import binary_dilation
from gunpowder.batch_request import BatchRequest
from gun... | [
"numpy.zeros_like",
"gunpowder.batch_request.BatchRequest",
"scipy.ndimage.morphology.binary_dilation",
"numpy.logical_not",
"numpy.zeros",
"skimage.draw.line",
"numpy.clip",
"scipy.ndimage.interpolation.map_coordinates",
"random.random",
"gunpowder.coordinate.Coordinate",
"numpy.random.randint"... | [((404, 431), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (421, 431), False, 'import logging\n'), ((3550, 3582), 'random.seed', 'random.seed', (['request.random_seed'], {}), '(request.random_seed)\n', (3561, 3582), False, 'import random\n'), ((3598, 3612), 'gunpowder.batch_request.Batc... |
import numpy as np
import scipy.ndimage as ndimage
import matplotlib.pyplot as plt
from skimage import data, color, img_as_float
from tkinter import *
from PIL import Image
from graph_cut import GraphCut
from graph_cut_gui import GraphCutGui
class GraphCutController:
def __init__(self):
self.__init_view... | [
"numpy.empty",
"numpy.floor",
"numpy.histogramdd",
"numpy.shape",
"numpy.linalg.norm",
"PIL.Image.blend",
"numpy.copy",
"scipy.ndimage.gaussian_filter",
"matplotlib.pyplot.imshow",
"numpy.logical_not",
"numpy.reshape",
"numpy.bool",
"numpy.size",
"matplotlib.pyplot.show",
"numpy.asarray"... | [((425, 448), 'graph_cut_gui.GraphCutGui', 'GraphCutGui', (['self', 'root'], {}), '(self, root)\n', (436, 448), False, 'from graph_cut_gui import GraphCutGui\n'), ((1178, 1246), 'numpy.histogramdd', 'np.histogramdd', (['data', 'hist_res'], {'range': '[(0, 255), (0, 255), (0, 255)]'}), '(data, hist_res, range=[(0, 255),... |
# superpixels.py Performs SLIC algorithm #
# Authors: <NAME>, <NAME>, <NAME>, <NAME>``
# import the necessary packages
from skimage.segmentation import slic
from skimage.segmentation import mark_boundaries
from skimage.util import img_as_float
from skimage.util import img_as_ubyte
from skimage import data, io, segment... | [
"numpy.dstack",
"skimage.color.label2rgb",
"skimage.util.img_as_ubyte",
"skimage.future.graph.merge_hierarchical",
"numpy.linalg.norm",
"skimage.future.graph.rag_mean_color",
"skimage.segmentation.slic",
"skimage.util.img_as_float",
"os.listdir",
"skimage.io.imread"
] | [((668, 688), 'numpy.linalg.norm', 'np.linalg.norm', (['diff'], {}), '(diff)\n', (682, 688), True, 'import numpy as np\n'), ((1187, 1208), 'skimage.io.imread', 'io.imread', (['sourcePath'], {}), '(sourcePath)\n', (1196, 1208), False, 'from skimage import data, io, segmentation, color\n'), ((1282, 1329), 'numpy.dstack',... |
from src.slu.datareader import domain_set, y1_set, y2_set
from preprocess.gen_embeddings_for_slu import domain2slot
import torch
import torch.nn as nn
import os
from tqdm import tqdm
import numpy as np
import logging
logger = logging.getLogger()
from src.conll2002_metrics import *
class SLUTrainer(object):
def ... | [
"torch.nn.MSELoss",
"torch.argmax",
"torch.nn.CrossEntropyLoss",
"logging.getLogger",
"torch.save",
"src.slu.datareader.y2_set.index",
"torch.optim.Adam",
"torch.autograd.set_detect_anomaly",
"os.path.join",
"numpy.concatenate"
] | [((228, 247), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (245, 247), False, 'import logging\n'), ((1284, 1330), 'torch.optim.Adam', 'torch.optim.Adam', (['model_parameters'], {'lr': 'self.lr'}), '(model_parameters, lr=self.lr)\n', (1300, 1330), False, 'import torch\n'), ((1363, 1384), 'torch.nn.CrossEn... |
import random
import numpy as np
import tensorflow as tf
class Reproducibility:
"""
Singleton class for ensure reproducibility.
You indicates the seed and the execution is the same. The server initialice this class and the clients only
call/get a seed.
Server initialize it with Reproducibility(se... | [
"tensorflow.random.set_seed",
"random.seed",
"numpy.random.randint",
"numpy.random.seed"
] | [((1806, 1838), 'numpy.random.seed', 'np.random.seed', (['self.__seeds[id]'], {}), '(self.__seeds[id])\n', (1820, 1838), True, 'import numpy as np\n'), ((1847, 1876), 'random.seed', 'random.seed', (['self.__seeds[id]'], {}), '(self.__seeds[id])\n', (1858, 1876), False, 'import random\n'), ((1885, 1921), 'tensorflow.ran... |
import os
import numpy as np
import json
import torch
from .utils import skeleton
class SkeletonDataset(torch.utils.data.Dataset):
""" Feeder for skeleton-based action recognition
Arguments:
data_path: the path to data folder
random_choose: If true, randomly choose a portion of the input seque... | [
"json.load",
"numpy.zeros",
"numpy.einsum",
"numpy.array",
"os.path.join",
"os.listdir"
] | [((1924, 2012), 'numpy.zeros', 'np.zeros', (['(num_channel, num_keypoints, num_frame, self.num_track)'], {'dtype': 'np.float32'}), '((num_channel, num_keypoints, num_frame, self.num_track), dtype=np.\n float32)\n', (1932, 2012), True, 'import numpy as np\n'), ((1556, 1568), 'json.load', 'json.load', (['f'], {}), '(f... |
import sys
import uncertainty_rfr
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestRegressor
import pandas.api.types as ptypes
sys.path.append("../")
df_test = pd.read_csv('./xiaofeng_lasso/unittest_dummy.csv', nrows=5)
X_test, y_test = uncertainty_rfr.descriptors_outputs(df_test, d_st... | [
"sys.path.append",
"pandas.DataFrame",
"uncertainty_rfr.traintest",
"pandas.read_csv",
"uncertainty_rfr.predict_append",
"uncertainty_rfr.descriptors_outputs",
"sklearn.ensemble.RandomForestRegressor",
"uncertainty_rfr.uncertainty_rfr_cv",
"uncertainty_rfr.largest_uncertainty",
"numpy.array",
"u... | [((159, 181), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (174, 181), False, 'import sys\n'), ((194, 253), 'pandas.read_csv', 'pd.read_csv', (['"""./xiaofeng_lasso/unittest_dummy.csv"""'], {'nrows': '(5)'}), "('./xiaofeng_lasso/unittest_dummy.csv', nrows=5)\n", (205, 253), True, 'import pand... |
# MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2018
#
# 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
# r... | [
"scipy.stats.entropy",
"numpy.split",
"numpy.array",
"numpy.squeeze",
"art.utils.clip_and_round",
"logging.getLogger",
"numpy.repeat"
] | [((1598, 1625), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1615, 1625), False, 'import logging\n'), ((6455, 6527), 'art.utils.clip_and_round', 'clip_and_round', (['(x - epsilon_map[i])', 'self.clip_values', 'self.round_samples'], {}), '(x - epsilon_map[i], self.clip_values, self.roun... |
import numpy as np
import straxen
import tempfile
import os
import unittest
import shutil
import uuid
test_run_id_1T = '180423_1021'
class TestBasics(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
temp_folder = uuid.uuid4().hex
# Keep one temp dir because we don't want to down... | [
"uuid.uuid4",
"straxen.contexts.demo",
"tempfile.gettempdir",
"os.path.exists",
"numpy.isnan",
"straxen.get_livetime_sec",
"straxen.mini_analysis",
"shutil.rmtree"
] | [((529, 552), 'straxen.contexts.demo', 'straxen.contexts.demo', ([], {}), '()\n', (550, 552), False, 'import straxen\n'), ((744, 771), 'os.path.exists', 'os.path.exists', (['cls.tempdir'], {}), '(cls.tempdir)\n', (758, 771), False, 'import os\n'), ((1514, 1573), 'straxen.get_livetime_sec', 'straxen.get_livetime_sec', (... |
from __future__ import annotations
from asyncio.events import AbstractEventLoop, TimerHandle
from asyncio.futures import Future
from typing import Mapping
from safe_set_result import safe_set_result
import scrypted_sdk
import numpy as np
import re
import tflite_runtime.interpreter as tflite
from pycoral.utils.edgetpu i... | [
"pycoral.utils.edgetpu.make_interpreter",
"multiprocessing.Lock",
"pycoral.utils.edgetpu.run_inference",
"urllib.parse.urlparse",
"safe_set_result.safe_set_result",
"scrypted_sdk.mediaManager.convertMediaObjectToBuffer",
"json.loads",
"pycoral.adapters.common.input_size",
"asyncio.ensure_future",
... | [((2148, 2170), 'multiprocessing.Lock', 'multiprocessing.Lock', ([], {}), '()\n', (2168, 2170), False, 'import multiprocessing\n'), ((1611, 1619), 'asyncio.futures.Future', 'Future', ([], {}), '()\n', (1617, 1619), False, 'from asyncio.futures import Future\n'), ((1643, 1649), 'third_party.sort.Sort', 'Sort', ([], {}),... |
r"""
Monte Carlo vs Black-Scholes-Merton
===========================================
Time values of options and guarantees for various in-the-moneyness
are calculated using Monte Carlo simulations and the Black-Scholes-Merton
pricing formula for European put options.
The Black-Scholes-Merton pricing formula for Europ... | [
"numpy.average",
"matplotlib.pyplot.subplots",
"modelx.read_model"
] | [((1161, 1194), 'modelx.read_model', 'mx.read_model', (['"""CashValue_ME_EX1"""'], {}), "('CashValue_ME_EX1')\n", (1174, 1194), True, 'import modelx as mx\n'), ((1531, 1545), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1543, 1545), True, 'import matplotlib.pyplot as plt\n'), ((1382, 1408), 'numpy.a... |
import os
import numpy as np
from sst import Fisher
from sst import camb_tools as ct
from sst import plot_tools
opj = os.path.join
def get_cls(cls_path, lmax, A_lens=1):
'''
returns
-------
cls : array-like
Lensed Cls (shape (4,lmax-1) with BB lensing power
reduced depending on A_len... | [
"sst.camb_tools.get_so_noise",
"sst.plot_tools.cls_matrix",
"numpy.zeros",
"sst.Fisher",
"numpy.ones",
"numpy.einsum",
"numpy.where",
"numpy.arange",
"numpy.loadtxt",
"numpy.interp",
"sst.camb_tools.get_spectra",
"numpy.sqrt"
] | [((387, 452), 'sst.camb_tools.get_spectra', 'ct.get_spectra', (['cls_path'], {'tag': '"""r0"""', 'lensed': '(False)', 'prim_type': '"""tot"""'}), "(cls_path, tag='r0', lensed=False, prim_type='tot')\n", (401, 452), True, 'from sst import camb_tools as ct\n'), ((502, 566), 'sst.camb_tools.get_spectra', 'ct.get_spectra',... |
import weakref
import numpy as np
class Tree:
'''
Implementation of Nary-tree.
The source code is modified based on https://github.com/lianemeth/forest/blob/master/forest/NaryTree.py
Parameters
----------
key: object
key of the node
num_branch: int
how many branches in e... | [
"numpy.full",
"numpy.lexsort",
"numpy.any",
"numpy.argsort",
"weakref.ref"
] | [((1995, 2016), 'numpy.lexsort', 'np.lexsort', (['F.T[::-1]'], {}), '(F.T[::-1])\n', (2005, 2016), True, 'import numpy as np\n'), ((2127, 2143), 'numpy.full', 'np.full', (['N', '(True)'], {}), '(N, True)\n', (2134, 2143), True, 'import numpy as np\n'), ((2154, 2166), 'numpy.any', 'np.any', (['left'], {}), '(left)\n', (... |
import sys
import pickle
import numpy as np
sys.path.append('./../')
sys.path.append('./../../')
from src.LocalGlobalAttentionModel.model import Model as parent_model
from .vel_param import VelParam as vel_param
from src.HMC.hmc import HMC
class Model(parent_model):
"""
This class describes a model where fi... | [
"sys.path.append",
"pickle.dump",
"numpy.zeros",
"numpy.unravel_index",
"numpy.array",
"numpy.exp",
"numpy.sqrt",
"src.HMC.hmc.HMC"
] | [((46, 70), 'sys.path.append', 'sys.path.append', (['"""./../"""'], {}), "('./../')\n", (61, 70), False, 'import sys\n'), ((71, 98), 'sys.path.append', 'sys.path.append', (['"""./../../"""'], {}), "('./../../')\n", (86, 98), False, 'import sys\n'), ((1755, 1808), 'numpy.unravel_index', 'np.unravel_index', (['inds', 'se... |
import torch
import torch.nn as nn
import numpy as np
from itertools import combinations
import torch.nn.functional as F
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def cal_l2(x, y):
return torch.pow((x - y), 2).sum(-1).sum()
class ContrastiveLoss(nn.Module):
"""
Contrastive loss
Takes embedding... | [
"itertools.combinations",
"torch.cuda.is_available",
"numpy.exp",
"torch.pow",
"torch.nn.functional.relu",
"torch.zeros"
] | [((159, 169), 'numpy.exp', 'np.exp', (['(-x)'], {}), '(-x)\n', (165, 169), True, 'import numpy as np\n'), ((607, 632), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (630, 632), False, 'import torch\n'), ((724, 738), 'torch.zeros', 'torch.zeros', (['(1)'], {}), '(1)\n', (735, 738), False, 'impo... |
from ..testutils import BaseTestCase, compare_files, temp_files, regenerate_references
import unittest
import numpy as np
import pickle
import time
import warnings
import pygsti
from pygsti.extras import idletomography as idt
#Helper functions
#Global dicts describing how to prep and measure in various bases
prepDict... | [
"pygsti.obj.Circuit",
"numpy.abs",
"pygsti.do_long_sequence_gst",
"pygsti.construction.build_cloudnoise_model_from_hops_and_weights",
"pygsti.construction.filter_dataset",
"unittest.main",
"pygsti.extras.idletomography.predicted_intrinsic_rates",
"pygsti.do_long_sequence_gst_base",
"pygsti.modelpack... | [((1386, 1764), 'pygsti.construction.build_cloudnoise_model_from_hops_and_weights', 'pygsti.construction.build_cloudnoise_model_from_hops_and_weights', (['nQubits', "['Gx', 'Gy', 'Gcnot']", 'nonstd_gate_unitaries', 'None', 'availability', 'None', 'geometry', 'maxIdleWeight', 'maxSpamWeight', 'maxhops', 'extraWeight1Hop... |
#
# Author : <NAME>
# Copyright (c) 2020 <NAME>. All rights reserved.
# Licensed under the MIT License. See LICENSE file in the project root for full license information.
#
#
# Test function helpers.
#
import numpy as np
def constantode(t,x):
"""Function containing a constant ODE x' = 1.
"""
xprime = np.empty... | [
"numpy.empty",
"numpy.sin",
"numpy.cos"
] | [((312, 332), 'numpy.empty', 'np.empty', (['[1]', 'float'], {}), '([1], float)\n', (320, 332), True, 'import numpy as np\n'), ((456, 479), 'numpy.empty', 'np.empty', (['[1, 1]', 'float'], {}), '([1, 1], float)\n', (464, 479), True, 'import numpy as np\n'), ((587, 607), 'numpy.empty', 'np.empty', (['[1]', 'float'], {}),... |
from sklearn import datasets
import numpy as np
def get_info():
return {
'name': 'sklearn_iris',
'description': 'ScikitLearn | Iris',
'class_names': ['Iris Setosa', 'Iris Versicolor', 'Iris Virginica']
}
def get_data(datasets_path):
data = datasets.load_iris()
return {
... | [
"sklearn.datasets.load_iris",
"numpy.array"
] | [((280, 300), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (298, 300), False, 'from sklearn import datasets\n'), ((334, 353), 'numpy.array', 'np.array', (['data.data'], {}), '(data.data)\n', (342, 353), True, 'import numpy as np\n'), ((374, 395), 'numpy.array', 'np.array', (['data.target'], {})... |
import numpy as np
import pandas as pd
import WindFarmGenetic # wind farm layout optimization using genetic algorithms classes
from datetime import datetime
import os
from sklearn.svm import SVR
import pickle
# Wind farm settings and algorithm settings
# parameters for the genetic algorithm
elite_rate = 0.2... | [
"sklearn.svm.SVR",
"os.makedirs",
"numpy.savetxt",
"numpy.zeros",
"os.path.exists",
"numpy.arange",
"WindFarmGenetic.WindFarmGenetic",
"datetime.datetime.now"
] | [((581, 603), 'numpy.arange', 'np.arange', (['(121)', '(145)', '(1)'], {}), '(121, 145, 1)\n', (590, 603), True, 'import numpy as np\n'), ((2996, 3268), 'WindFarmGenetic.WindFarmGenetic', 'WindFarmGenetic.WindFarmGenetic', ([], {'rows': 'rows_cells', 'cols': 'cols_cells', 'N': 'wt_N', 'NA_loc': 'NA_loc', 'pop_size': 'p... |
# -*- coding: utf-8 -*-
"""
目的
- アノテーション作業の前の一番最初の画像データの前処理
- 画像サイズを小さくする & 画像サイズを揃える
"""
import os
import glob
import numpy as np
from PIL import Image
import argparse
def main(args):
img_files = glob.glob(os.path.join(args.img_dir, args.img_filter))
print('image_dir : ', args.img_dir, ', filter : ', args... | [
"numpy.array",
"os.path.join",
"argparse.ArgumentParser",
"PIL.Image.open"
] | [((1035, 1083), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""argparser"""'}), "(description='argparser')\n", (1058, 1083), False, 'import argparse\n'), ((216, 259), 'os.path.join', 'os.path.join', (['args.img_dir', 'args.img_filter'], {}), '(args.img_dir, args.img_filter)\n', (228, 259... |
# Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"numpy.random.seed",
"tensorflow.compat.v1.train.SummarySaverHook",
"tensorflow_graphics.projects.cvxnet.lib.utils.define_flags",
"tensorflow.compat.v1.data.make_one_shot_iterator",
"tensorflow.compat.v1.disable_eager_execution",
"tensorflow.compat.v1.set_random_seed",
"tensorflow.compat.v1.train.AdamOp... | [((951, 979), 'tensorflow.compat.v1.disable_eager_execution', 'tf.disable_eager_execution', ([], {}), '()\n', (977, 979), True, 'import tensorflow.compat.v1 as tf\n'), ((1023, 1064), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.INFO'], {}), '(tf.logging.INFO)\n', (1047, 1064),... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import numpy as np
import sys
import tensorflow as tf
from tensorflow.python.client import timeline
from tensorflow.python.... | [
"tensorflow.GraphOptions",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"numpy.ones",
"time.time",
"tensorflow.RunOptions",
"tensorflow.placeholder",
"tensorflow.python.client.timeline.Timeline",
"ctypes.CDLL",
"tensorflow.RunMetadata",
"seq2seq_model.Seq2SeqModel",
"tensor... | [((1369, 1396), 'ctypes.CDLL', 'ctypes.CDLL', (['"""libcudart.so"""'], {}), "('libcudart.so')\n", (1380, 1396), False, 'import ctypes\n'), ((5180, 5192), 'tensorflow.app.run', 'tf.app.run', ([], {}), '()\n', (5190, 5192), True, 'import tensorflow as tf\n'), ((2080, 2111), 'tensorflow.Session', 'tf.Session', ([], {'conf... |
#!/usr/bin/env python3
import numpy as np
import sys
def make_instance():
# normal、fire、water、electric、grass、ice、fighting, poison, ground,
# flying, psychic, bug, rock, ghost, dragon, dark, steel, fairy
type_matrix = np.array([[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.0, 1.0, 1.... | [
"numpy.where",
"numpy.array"
] | [((232, 1995), 'numpy.array', 'np.array', (['[[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 0.0, 1.0,\n 1.0, 0.5, 1.0], [1.0, 0.5, 0.5, 1.0, 2.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0,\n 2.0, 0.5, 1.0, 0.5, 1.0, 2.0, 1.0], [1.0, 2.0, 0.5, 1.0, 0.5, 1.0, 1.0,\n 1.0, 2.0, 1.0, 1.0, 1.0, 2.0, 1.0, 0.5,... |
import logging
import matplotlib.pyplot as plt
import numpy as np
import pytest
from shapely.affinity import rotate
from pyroll.core import SquareGroove, Profile
groove = SquareGroove(0, 3, tip_depth=20, tip_angle=91 / 180 * np.pi)
def test_from_groove():
Profile.from_groove(groove, width=45, height=50)
Pr... | [
"pyroll.core.Profile.from_groove",
"pyroll.core.Profile.round",
"pyroll.core.Profile.diamond",
"pytest.raises",
"pytest.xfail",
"shapely.affinity.rotate",
"pyroll.core.Profile.square",
"pyroll.core.SquareGroove",
"pyroll.core.Profile.box",
"logging.getLogger",
"numpy.sqrt"
] | [((174, 234), 'pyroll.core.SquareGroove', 'SquareGroove', (['(0)', '(3)'], {'tip_depth': '(20)', 'tip_angle': '(91 / 180 * np.pi)'}), '(0, 3, tip_depth=20, tip_angle=91 / 180 * np.pi)\n', (186, 234), False, 'from pyroll.core import SquareGroove, Profile\n'), ((265, 313), 'pyroll.core.Profile.from_groove', 'Profile.from... |
import numpy as np
from matplotlib import pyplot
try:
import ConfigParser
except ModuleNotFoundError:
import configparser as ConfigParser
import argparse
import h5py
from scipy.signal import savgol_filter
import Pointing
from os import listdir, getcwd
from os.path import isfile, join
import Mapping
import Point... | [
"numpy.abs",
"argparse.ArgumentParser",
"numpy.sum",
"numpy.argmax",
"matplotlib.pyplot.clf",
"EphemNew.rdplan",
"numpy.mean",
"numpy.arange",
"Pointing.GetPixelOffsets",
"numpy.nanmean",
"matplotlib.pyplot.imshow",
"healpy.Rotator",
"numpy.max",
"numpy.loadtxt",
"Pointing.GetPointing",
... | [((706, 746), 'numpy.abs', 'np.abs', (['(az[:az.size - 1] - az[1:az.size])'], {}), '(az[:az.size - 1] - az[1:az.size])\n', (712, 746), True, 'import numpy as np\n'), ((785, 799), 'numpy.argmax', 'np.argmax', (['daz'], {}), '(daz)\n', (794, 799), True, 'import numpy as np\n'), ((1321, 1395), 'numpy.abs', 'np.abs', (['(p... |
#///////////////////////////////////////////////////////////////////////////////
#// BSD 3-Clause License
#//
#// Copyright (C) 2018-2019, New York University , Max Planck Gesellschaft
#// Copyright note valid unless otherwise stated in individual files.
#// All rights reserved.
#///////////////////////////////////////... | [
"pybullet.getQuaternionFromEuler",
"pybullet.connect",
"numpy.set_printoptions",
"pybullet.stepSimulation",
"pybullet.setGravity",
"pybullet.changeDynamics",
"pybullet.getBasePositionAndOrientation",
"rospkg.RosPack",
"os.path.dirname",
"time.sleep",
"pybullet.setPhysicsEngineParameter",
"robo... | [((2638, 2685), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(2)', 'suppress': '(True)'}), '(precision=2, suppress=True)\n', (2657, 2685), True, 'import numpy as np\n'), ((1220, 1242), 'pybullet.loadURDF', 'p.loadURDF', (['plain_urdf'], {}), '(plain_urdf)\n', (1230, 1242), True, 'import pybullet... |
import numpy as np
def clamp(value, min, max):
return np.clip(value, min, max)
def lerp(a, b, fraction):
fraction = clamp(fraction, 0, 1)
return a * (1 - fraction) + b * fraction
def fit(value, omin, omax, nmin, nmax):
v = (value - omin) / (omax - omin)
return v * (nmax - nmin) + nmin
def fi... | [
"numpy.clip"
] | [((60, 84), 'numpy.clip', 'np.clip', (['value', 'min', 'max'], {}), '(value, min, max)\n', (67, 84), True, 'import numpy as np\n')] |
"""
Run few-shot learning on FashionProductImaes dataset using code from github
repo https://github.com/oscarknagg/few-shot under
MIT License
Copyright (c) 2019 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to... | [
"few_shot.metrics.categorical_accuracy",
"numpy.random.choice",
"few_shot.core.NShotTaskSampler",
"torch.utils.data.DataLoader",
"torchvision.transforms.RandomHorizontalFlip",
"few_shot.core.create_nshot_task_label",
"few_shot_learning.models.Identity",
"torchvision.transforms.RandomPerspective",
"t... | [((2831, 2843), 'few_shot.utils.setup_dirs', 'setup_dirs', ([], {}), '()\n', (2841, 2843), False, 'from few_shot.utils import setup_dirs\n'), ((5978, 6053), 'few_shot.core.NShotTaskSampler', 'NShotTaskSampler', (['background', 'episodes_per_epoch', 'n_train', 'k_train', 'q_train'], {}), '(background, episodes_per_epoch... |
import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_series_equal
from visions import StandardSet
from compressio.compress import compress_func
from compressio.type_compressor import DefaultCompressor
bool_dtype = "boolean" if int(pd.__version__.split(".")[0]) >= 1 else "Bool"
@pyt... | [
"pandas.__version__.split",
"numpy.iinfo",
"visions.StandardSet",
"pandas.Series",
"compressio.type_compressor.DefaultCompressor",
"pandas.testing.assert_series_equal"
] | [((1089, 1154), 'pandas.testing.assert_series_equal', 'assert_series_equal', (['series', 'compressed_series'], {'check_dtype': '(False)'}), '(series, compressed_series, check_dtype=False)\n', (1108, 1154), False, 'from pandas.testing import assert_series_equal\n'), ((918, 931), 'visions.StandardSet', 'StandardSet', ([]... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
plt.rc('text', usetex=True)
plt.rc('text.latex', preamble=r'\usepackage{amsmath}\usepackage{amssymb}\usepackage{siunitx}')
# Colours
col_b16agss09 = '#A50026'
col_b16gs98 = '#D73027'
col_agss09 = '#F46D43'
col_agss09ph = '#FDAE61'
col_a... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"numpy.genfromtxt",
"mat... | [((83, 110), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (89, 110), True, 'import matplotlib.pyplot as plt\n'), ((111, 212), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text.latex"""'], {'preamble': '"""\\\\usepackage{amsmath}\\\\usepackage{amssymb}\\\\usepackage{siu... |
#!/usr/bin/env python
# Copyright (C) 2014 Open Data ("Open Data" refers to
# one or more of the following companies: Open Data Partners LLC,
# Open Data Research LLC, or Open Data Capital LLC.)
#
# This file is part of Hadrian.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... | [
"unittest.main",
"random.uniform",
"numpy.seterr",
"random.seed",
"random.gauss",
"titus.genpy.PFAEngine.fromJson"
] | [((10616, 10631), 'unittest.main', 'unittest.main', ([], {}), '()\n', (10629, 10631), False, 'import unittest\n'), ((1732, 1750), 'random.seed', 'random.seed', (['(12345)'], {}), '(12345)\n', (1743, 1750), False, 'import random\n'), ((1759, 1806), 'numpy.seterr', 'numpy.seterr', ([], {'divide': '"""ignore"""', 'invalid... |
import os
import unittest
import numpy
import moments
import time
class ResultsTestCase(unittest.TestCase):
def setUp(self):
self.startTime = time.time()
def tearDown(self):
t = time.time() - self.startTime
print("%s: %.3f seconds" % (self.id(), t))
def test_1d_ic(self):
... | [
"unittest.main",
"numpy.ma.allclose",
"moments.Spectrum.from_file",
"moments.Demographics2D.IM",
"moments.Inference.Anscombe_Poisson_residual",
"numpy.allclose",
"numpy.zeros",
"numpy.ones",
"time.time",
"numpy.array",
"unittest.TestLoader",
"numpy.arange"
] | [((2626, 2641), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2639, 2641), False, 'import unittest\n'), ((156, 167), 'time.time', 'time.time', ([], {}), '()\n', (165, 167), False, 'import time\n'), ((794, 843), 'moments.Spectrum.from_file', 'moments.Spectrum.from_file', (['"""test_files/1_pop.fs"""'], {}), "('te... |
import torch
import math
import numpy as np
def convert_locations_to_boxes(locations, priors, center_variance,
size_variance):
"""Convert regressional location results of SSD into boxes in the form of (center_x, center_y, h, w).
The conversion:
$$predicted\_center * cent... | [
"shapely.geometry.MultiPoint",
"numpy.power",
"numpy.argmin",
"time.time",
"numpy.shape",
"numpy.min",
"torch.clamp",
"numpy.array",
"numpy.reshape",
"numpy.concatenate",
"torch.from_numpy"
] | [((2362, 2407), 'torch.clamp', 'torch.clamp', (['(right_bottom - left_top)'], {'min': '(0.0)'}), '(right_bottom - left_top, min=0.0)\n', (2373, 2407), False, 'import torch\n'), ((4727, 4738), 'time.time', 'time.time', ([], {}), '()\n', (4736, 4738), False, 'import time\n'), ((4842, 4872), 'numpy.reshape', 'np.reshape',... |
# import Libraries of other lib packages
import numpy
import bob.core
# import our own Library
import bob.extension
bob.extension.load_bob_library('bob.io.base', __file__)
from ._library import File as _File_C, HDF5File as _HDF5File_C, extensions
from . import version
from .version import module as __version__
from .... | [
"os.makedirs",
"os.path.dirname",
"os.path.exists",
"numpy.require",
"numpy.prod",
"bob.extension.utils.find_header",
"bob.extension.pkgconfig",
"numpy.reshape",
"numpy.fromiter",
"numpy.deprecate",
"numpy.ascontiguousarray",
"numpy.vstack"
] | [((1860, 1925), 'numpy.deprecate', 'numpy.deprecate', ([], {'new_name': '"""os.makedirs(directory, exist_ok=True)"""'}), "(new_name='os.makedirs(directory, exist_ok=True)')\n", (1875, 1925), False, 'import numpy\n'), ((6421, 6483), 'numpy.require', 'numpy.require', (['array'], {'requirements': "('C_CONTIGUOUS', 'ALIGNE... |
from __future__ import print_function
import os
import argparse
import numpy as np
from dcase_task2.lasagne_wrapper.network import Network
from utils.data_tut18_task2 import load_data as load_data_tut18_task2
from utils.data_tut18_task2 import ID_CLASS_MAPPING as id_class_mapping_tut18_task2
from config.settings i... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"os.path.basename",
"utils.data_tut18_task2.load_data",
"os.path.join",
"dcase_task2.lasagne_wrapper.network.Network"
] | [((368, 388), 'numpy.random.seed', 'np.random.seed', (['(4711)'], {}), '(4711)\n', (382, 388), True, 'import numpy as np\n'), ((463, 491), 'os.path.basename', 'os.path.basename', (['model_path'], {}), '(model_path)\n', (479, 491), False, 'import os\n'), ((2947, 2974), 'os.path.join', 'os.path.join', (['out_path', 'par'... |
import sys
import numpy
from scipy import special
import statsmodels.api as sm
from galpy.util import bovy_plot
import define_rcsample
def plot_rcdistancecomparison(plotfilename):
# Get the sample
rcdata= define_rcsample.get_rcsample()
# Now plot the differece
bovy_plot.bovy_print()
levels= special.... | [
"galpy.util.bovy_plot.bovy_plot",
"define_rcsample.get_rcsample",
"galpy.util.bovy_plot.bovy_end_print",
"galpy.util.bovy_plot.bovy_print",
"galpy.util.bovy_plot.scatterplot",
"numpy.arange",
"numpy.sqrt"
] | [((213, 243), 'define_rcsample.get_rcsample', 'define_rcsample.get_rcsample', ([], {}), '()\n', (241, 243), False, 'import define_rcsample\n'), ((277, 299), 'galpy.util.bovy_plot.bovy_print', 'bovy_plot.bovy_print', ([], {}), '()\n', (297, 299), False, 'from galpy.util import bovy_plot\n'), ((362, 780), 'galpy.util.bov... |
#!/usr/bin/env python
"""
Given the output of fconv_slopes, plot the thermodynamic
gradients corresponding to an initial model.
<NAME>
"""
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('infile', type=str... | [
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"numpy.amin",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"numpy.amax",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.loadtxt",
"matplotlib.pyplot.savefig"
] | [((256, 281), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (279, 281), False, 'import argparse\n'), ((1303, 1315), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1313, 1315), True, 'import matplotlib.pyplot as plt\n'), ((3213, 3256), 'matplotlib.pyplot.yscale', 'plt.yscale', (['... |
from __future__ import print_function
import random
import nltk
from nltk.corpus import treebank
import numpy as np
from sklearn.feature_extraction import DictVectorizer
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import classification_report
from keras.layers import Dense, Dropout, ... | [
"nltk.corpus.treebank.tagged_sents",
"keras.wrappers.scikit_learn.KerasClassifier",
"numpy.random.seed",
"matplotlib.pyplot.show",
"keras.layers.Activation",
"keras.layers.Dropout",
"random.choice",
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.s... | [((4196, 4214), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (4212, 4214), True, 'import matplotlib.pyplot as plt\n'), ((4220, 4230), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (4228, 4230), True, 'import matplotlib.pyplot as plt\n'), ((4322, 4349), 'numpy.random.seed', 'np.rando... |
import pandas as pd
import numpy as np
from .QCBase import VarNames
class Exporter(object):
""" Export class which writes parsed data to a certain format"""
valid_formats = ["pdf", "xlsx", "txt", "csv", "dataframe"]
def __init__(self, data=None):
self.data = data
# for later: add pand... | [
"pandas.DataFrame",
"pandas.MultiIndex.from_tuples",
"numpy.linalg.inv",
"pandas.Series",
"re.search",
"pandas.ExcelWriter",
"pandas.concat"
] | [((2617, 2632), 'pandas.DataFrame', 'pd.DataFrame', (['d'], {}), '(d)\n', (2629, 2632), True, 'import pandas as pd\n'), ((2653, 2713), 'pandas.MultiIndex.from_tuples', 'pd.MultiIndex.from_tuples', (['tuples'], {'names': "['State', 'Row ID']"}), "(tuples, names=['State', 'Row ID'])\n", (2678, 2713), True, 'import pandas... |
"""
4) Sinkhorn vs. blurred Wasserstein distances
==========================================================
Sinkhorn divergences rely on a simple idea:
by **blurring** the transport plan through the addition of
an entropic penalty, we can reduce the effective dimensionality
of the transportation problem and compute *... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"geomloss.SamplesLoss",
"sklearn.neighbors.KernelDensity",
"matplotlib.pyplot.axis",
"torch.cat",
"torch.randn",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"numpy.linspace",
"torch.rand",
"matplotlib... | [((3677, 3702), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (3700, 3702), False, 'import torch\n'), ((3923, 3951), 'numpy.linspace', 'np.linspace', (['(-0.5)', '(1.5)', '(1000)'], {}), '(-0.5, 1.5, 1000)\n', (3934, 3951), True, 'import numpy as np\n'), ((6170, 6197), 'matplotlib.pyplot.figur... |
#!/usr/bin/env python3
import cv2 as cv
import json
import math
import numpy as np
import os
import sys
from requests.utils import requote_uri
from geojson import FeatureCollection, Feature, Polygon, dumps
config = json.load(open("config.json","r"))
target = config.get('target')
tilesize = config.get('tilesize')
ma... | [
"cv2.resize",
"geojson.Polygon",
"os.makedirs",
"math.pow",
"geojson.dumps",
"math.ceil",
"cv2.cvtColor",
"cv2.imwrite",
"math.floor",
"geojson.Feature",
"numpy.zeros",
"cv2.imread",
"geojson.FeatureCollection",
"requests.utils.requote_uri"
] | [((6720, 6747), 'geojson.FeatureCollection', 'FeatureCollection', (['features'], {}), '(features)\n', (6737, 6747), False, 'from geojson import FeatureCollection, Feature, Polygon, dumps\n'), ((1462, 1502), 'cv2.imread', 'cv.imread', (['filename', 'cv.IMREAD_UNCHANGED'], {}), '(filename, cv.IMREAD_UNCHANGED)\n', (1471,... |
import math
import numpy as np
import basis.robot_math as rm
import visualization.panda.world as wd
import modeling.geometric_model as gm
import modeling.collision_model as cm
import robot_sim.end_effectors.gripper.robotiq85.robotiq85 as rtq85
import grasping.annotation.utils as gu
import pickle
base = wd.World(cam_po... | [
"modeling.geometric_model.gen_arrow",
"math.radians",
"modeling.collision_model.CollisionModel",
"basis.robot_math.orthogonal_vector",
"modeling.geometric_model.gen_frame",
"robot_sim.end_effectors.gripper.robotiq85.robotiq85.Robotiq85",
"modeling.geometric_model.gen_sphere",
"numpy.linalg.norm",
"v... | [((305, 360), 'visualization.panda.world.World', 'wd.World', ([], {'cam_pos': '[0.3, 0.3, 0.3]', 'lookat_pos': '[0, 0, 0]'}), '(cam_pos=[0.3, 0.3, 0.3], lookat_pos=[0, 0, 0])\n', (313, 360), True, 'import visualization.panda.world as wd\n'), ((440, 481), 'modeling.collision_model.CollisionModel', 'cm.CollisionModel', (... |
# Copyright 2021 Adobe
# All Rights Reserved.
# NOTICE: Adobe permits you to use, modify, and distribute this file in
# accordance with the terms of the Adobe license agreement accompanying
# it.
import random
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib
# matplotlib.use('TkAgg')
im... | [
"skimage.data.astronaut",
"os.path.isfile",
"matplotlib.pyplot.imsave",
"cv2.rectangle",
"os.path.join",
"albumentations.RGBShift",
"albumentations.from_dict",
"cv2.cvtColor",
"matplotlib.pyplot.subplots",
"albumentations.to_dict",
"copy.deepcopy",
"numpy.hstack",
"os.makedirs",
"skimage.c... | [((1124, 1146), 'albumentations.to_dict', 'A.to_dict', (['augPipeline'], {}), '(augPipeline)\n', (1133, 1146), True, 'import albumentations as A\n'), ((1672, 1765), 'matplotlib.pyplot.subplots', 'plt.subplots', (['numOfOperation', '(3)'], {'figsize': '(6, 2 * numOfOperation)', 'constrained_layout': '(True)'}), '(numOfO... |
import streamlit as st
import numpy as np
from tensorflow.keras.models import load_model
import librosa
import time
import matplotlib.pyplot as plt
def wav2mfcc(wave, sr=22050,n_mfcc=20, max_len=170):
'''wave is a np array'''
wave = np.asfortranarray(wave)
mfcc = librosa.feature.mfcc(wave, sr=sr, n_mfcc=... | [
"streamlit.title",
"numpy.arange",
"streamlit.sidebar.radio",
"librosa.feature.mfcc",
"librosa.get_duration",
"numpy.pad",
"streamlit.audio",
"streamlit.spinner",
"streamlit.text",
"streamlit.sidebar.markdown",
"streamlit.button",
"numpy.reshape",
"matplotlib.pyplot.subplots",
"streamlit.s... | [((889, 959), 'tensorflow.keras.models.load_model', 'load_model', (["(model_path + 'bal_cnn_model_accuracy_98.2_alpha_0.0001.h5')"], {}), "(model_path + 'bal_cnn_model_accuracy_98.2_alpha_0.0001.h5')\n", (899, 959), False, 'from tensorflow.keras.models import load_model\n'), ((1011, 1036), 'streamlit.title', 'st.title'... |
"""
Extract MNI coordinates for all brain maps.
Created on Fri May 24 11:26:07 2019
@author: <NAME> <<EMAIL>>
"""
import mne
import numpy as np
from summarize_clusters_stc_AT import summarize_clusters_stc_AT
import csv
#%% for one-sample T-test whether ISCs are significant
results_path = '/media/cbru/SMEDY/results/I... | [
"numpy.isin",
"numpy.load",
"numpy.absolute",
"csv.writer",
"summarize_clusters_stc_AT.summarize_clusters_stc_AT",
"mne.vertex_to_mni",
"numpy.where",
"numpy.arange"
] | [((524, 540), 'numpy.arange', 'np.arange', (['(10242)'], {}), '(10242)\n', (533, 540), True, 'import numpy as np\n'), ((542, 558), 'numpy.arange', 'np.arange', (['(10242)'], {}), '(10242)\n', (551, 558), True, 'import numpy as np\n'), ((2864, 2941), 'csv.writer', 'csv.writer', (['file_out'], {'delimiter': '""","""', 'q... |
from .dot_product import DotProduct
import os
from numpy import log2
filedir = os.path.dirname(os.path.realpath(__file__))
dot_product_tb_module_path = os.path.join(filedir, '..', 'src')
dot_product_module_path = os.path.join(filedir, '..', 'src', 'dot_prod_pip.v')
class DotProdPip(DotProduct):
"""
"""
... | [
"numpy.log2",
"os.path.realpath",
"os.path.join"
] | [((153, 187), 'os.path.join', 'os.path.join', (['filedir', '""".."""', '"""src"""'], {}), "(filedir, '..', 'src')\n", (165, 187), False, 'import os\n'), ((214, 266), 'os.path.join', 'os.path.join', (['filedir', '""".."""', '"""src"""', '"""dot_prod_pip.v"""'], {}), "(filedir, '..', 'src', 'dot_prod_pip.v')\n", (226, 26... |
#%%
import numpy as np
import pandas as pd
import pickle
import matplotlib.pyplot as plt
TRAIN_UPDATE_FILE = "C:/kaggle/kaggle_keypoints/pickle/cleandata_updates_augment.pkl"
train = pickle.load(open(TRAIN_UPDATE_FILE, "rb")).reset_index()
print("Size of 'augmentation' set: %d" % train.shape[0])
# %%
fig = plt.fi... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis",
"numpy.clip",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout"
] | [((314, 342), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20, 20)'}), '(figsize=(20, 20))\n', (324, 342), True, 'import matplotlib.pyplot as plt\n'), ((411, 441), 'numpy.clip', 'np.clip', (['train.shape[0]', '(0)', '(60)'], {}), '(train.shape[0], 0, 60)\n', (418, 441), True, 'import numpy as np\n'), ((... |
# Separate script, to use python multiprocessing, that utilizes pickle #
import sys
from multiprocessing import Pool, cpu_count
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
from scipy import optimize
from python.util import get_model_params, model_path, model_epoch
from python.model.... | [
"numpy.load",
"numpy.save",
"scipy.optimize.minimize",
"python.util.model_path",
"theano.function",
"multiprocessing.cpu_count",
"python.util.get_model_params",
"lasagne.layers.get_output",
"numpy.linalg.norm",
"python.model.vae.build_vae",
"theano.tensor.vector",
"python.util.model_epoch",
... | [((491, 514), 'python.util.get_model_params', 'get_model_params', (['model'], {}), '(model)\n', (507, 514), False, 'from python.util import get_model_params, model_path, model_epoch\n'), ((527, 550), 'numpy.load', 'np.load', (['test_data_path'], {}), '(test_data_path)\n', (534, 550), True, 'import numpy as np\n'), ((58... |
#
# Created by: <NAME>, September 2002
#
from __future__ import division, print_function, absolute_import
import sys
import subprocess
import time
from numpy.testing import (assert_equal, assert_array_almost_equal, assert_,
assert_allclose, assert_almost_equal,
a... | [
"numpy.random.seed",
"numpy.triu",
"numpy.abs",
"numpy.ones",
"numpy.isnan",
"numpy.linalg.cond",
"scipy.linalg.svd",
"numpy.linalg.norm",
"scipy.linalg.blas.get_blas_funcs",
"numpy.arange",
"numpy.random.normal",
"numpy.diag",
"numpy.testing.assert_array_almost_equal",
"numpy.zeros_like",... | [((18500, 18520), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (18514, 18520), True, 'import numpy as np\n'), ((18530, 18554), 'numpy.random.random', 'np.random.random', (['(4, 4)'], {}), '((4, 4))\n', (18546, 18554), True, 'import numpy as np\n'), ((19988, 20193), 'subprocess.Popen', 'subproces... |
import os
from os.path import expanduser
import altair as alt
import numpy as np
import pandas as pd
from scipy.stats.stats import pearsonr
import sqlite3
from util import to_day, to_month, to_year, to_local, allocate_ys, save_plot
from config import dummy_start_date, dummy_end_date, cutoff_date
# %matplotlib inline... | [
"pandas.DataFrame",
"os.makedirs",
"altair.Y",
"scipy.stats.stats.pearsonr",
"util.save_plot",
"altair.Chart",
"altair.Axis",
"altair.X",
"numpy.timedelta64",
"sqlite3.connect",
"pandas.read_sql_query",
"altair.Scale",
"os.path.expanduser",
"pandas.to_numeric",
"altair.Color"
] | [((458, 480), 'numpy.timedelta64', 'np.timedelta64', (['(1)', '"""D"""'], {}), "(1, 'D')\n", (472, 480), True, 'import numpy as np\n'), ((497, 528), 'altair.Scale', 'alt.Scale', ([], {'domain': '[True, False]'}), '(domain=[True, False])\n', (506, 528), True, 'import altair as alt\n'), ((10515, 10551), 'os.makedirs', 'o... |
#!/usr/bin/env python
"""
Aiida interface for twinpy.
"""
import warnings
import numpy as np
from aiida.cmdline.utils.decorators import with_dbenv
from aiida.orm import (load_node,
Node,
QueryBuilder,
)
from aiida.plugins import WorkflowFactory
from... | [
"aiida.orm.QueryBuilder",
"twinpy.interfaces.aiida.base.check_process_class",
"aiida.orm.load_node",
"aiida.plugins.WorkflowFactory",
"twinpy.interfaces.aiida.twinboundary.AiidaTwinBoudnaryRelaxWorkChain",
"numpy.argsort",
"aiida_twinpy.common.utils.get_create_node",
"warnings.warn",
"aiida.cmdline.... | [((646, 658), 'aiida.cmdline.utils.decorators.with_dbenv', 'with_dbenv', ([], {}), '()\n', (656, 658), False, 'from aiida.cmdline.utils.decorators import with_dbenv\n'), ((991, 1031), 'twinpy.interfaces.aiida.base.check_process_class', 'check_process_class', (['node', 'process_class'], {}), '(node, process_class)\n', (... |
import gym
import pybullet as p
import numpy as np
from gym_delta_robot_trampoline.resources.delta_robot_trampoline import Omnid_Simulator
import matplotlib.pyplot as plt
import os
import pybullet_data
"""
Action space (1,3) : [theta_1_torque, theta_2_torque, theta_3_torque]
Observation space (1,18) : [3 joint_positio... | [
"pybullet.setRealTimeSimulation",
"pybullet.resetSimulation",
"pybullet.stepSimulation",
"pybullet.setGravity",
"pybullet.configureDebugVisualizer",
"gym_delta_robot_trampoline.resources.delta_robot_trampoline.Omnid_Simulator",
"pybullet.resetDebugVisualizerCamera",
"pybullet.disconnect",
"numpy.arr... | [((716, 732), 'pybullet.connect', 'p.connect', (['p.GUI'], {}), '(p.GUI)\n', (725, 732), True, 'import pybullet as p\n'), ((741, 865), 'pybullet.resetDebugVisualizerCamera', 'p.resetDebugVisualizerCamera', ([], {'cameraDistance': '(1.5)', 'cameraYaw': '(0)', 'cameraPitch': '(-40)', 'cameraTargetPosition': '[0.05, -0.35... |
""" Default Runner & Worker components
Local Runner
Memmap Interface (numpy)
Template Preprocessor
JSON Postprocessor
NumpytxtPostprocessor
HDF5Postprocessor
"""
from .runner import Runner, RunnerInterface
from .worker import Interface, Preprocessor, Postprocessor, Worker
import subprocess
from multiprocessing impor... | [
"os.listdir",
"subprocess.Popen",
"numpy.save",
"numpy.load",
"os.remove",
"json.load",
"h5py.File",
"profit.pre.fill_run_dir_single",
"os.getcwd",
"os.path.dirname",
"numpy.zeros",
"os.path.exists",
"numpy.genfromtxt",
"time.sleep",
"shutil.rmtree",
"multiprocessing.Process",
"os.ch... | [((4409, 4486), 'numpy.zeros', 'np.zeros', (['size'], {'dtype': '(self.input_vars + self.internal_vars + self.output_vars)'}), '(size, dtype=self.input_vars + self.internal_vars + self.output_vars)\n', (4417, 4486), True, 'import numpy as np\n'), ((4495, 4534), 'numpy.save', 'np.save', (["self.config['path']", 'init_da... |
import numpy as np
import tensorflow as tf
from tools.tf_tools import binary_entropy, repeat_axis
class EntropyTest(tf.test.TestCase):
def test_binary_entropy_logits(self):
H1 = binary_entropy(logits=[0., 0.]) # i.e. sigmoid(logits) = 0.5
H0 = binary_entropy(logits=[100., -100.])
with s... | [
"tensorflow.test.main",
"numpy.random.rand",
"tensorflow.constant",
"tools.tf_tools.binary_entropy",
"numpy.repeat"
] | [((1072, 1086), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (1084, 1086), True, 'import tensorflow as tf\n'), ((193, 226), 'tools.tf_tools.binary_entropy', 'binary_entropy', ([], {'logits': '[0.0, 0.0]'}), '(logits=[0.0, 0.0])\n', (207, 226), False, 'from tools.tf_tools import binary_entropy, repeat_axis\... |
# -*- coding: utf-8 -*-
"""fileio module."""
import pandas as pd # create_conf_file
import csv # write_conf_header, create_conf_file
import json # create_conf_file
import os # read_c3d_file
import btk # C3D class
import bmch # C3D class
import numpy as np # C3D class
def write_conf_header(metadata_path):
"... | [
"json.load",
"json.dumps",
"bmch.util.GuiC3D",
"btk.btkAcquisitionFileReader",
"numpy.squeeze",
"os.path.join",
"os.listdir",
"csv.DictWriter"
] | [((2284, 2304), 'json.load', 'json.load', (['json_data'], {}), '(json_data)\n', (2293, 2304), False, 'import json\n'), ((4011, 4041), 'btk.btkAcquisitionFileReader', 'btk.btkAcquisitionFileReader', ([], {}), '()\n', (4039, 4041), False, 'import btk\n'), ((5891, 5924), 'bmch.util.GuiC3D', 'bmch.util.GuiC3D', (['targets'... |
# #################################################################
# Python codes PENN for caching
# Codes have been tested successfully on Python 3.6.0 with TensorFlow 1.14.0.
# #################################################################
import scipy.io as sio
import numpy as np ... | [
"math.ceil",
"runner.run",
"numpy.sort",
"numpy.mean",
"numpy.reshape"
] | [((538, 560), 'math.ceil', 'math.ceil', (['(0.1 * num_H)'], {}), '(0.1 * num_H)\n', (547, 560), False, 'import math\n'), ((1300, 1340), 'numpy.reshape', 'np.reshape', (['Xtrain', '(d_past * K, num_tr)'], {}), '(Xtrain, (d_past * K, num_tr))\n', (1310, 1340), True, 'import numpy as np\n'), ((1341, 1376), 'numpy.reshape'... |
# -*- coding: utf-8 -*-
__author__ = "Yuchen"
__aim__ = 'rank top sentences in one topic'
__testCase__ = "../test/test_rankingTFIDF.py"
from sklearn.feature_extraction.text import CountVectorizer,TfidfTransformer
import sys
import argparse
import numpy as np
from termcolor import colored
from sklearn.metrics.pairwise ... | [
"sys.path.append",
"pushkin_gs.sum.tfidf_contentWords.main",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.metrics.pairwise.cosine_similarity",
"argparse.ArgumentParser",
"numpy.argsort",
"numpy.array",
"operator.itemgetter",
"sklearn.feature_extraction.text.TfidfTransformer"
] | [((361, 385), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (376, 385), False, 'import sys\n'), ((6010, 6035), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (6033, 6035), False, 'import argparse\n'), ((6357, 6382), 'pushkin_gs.sum.tfidf_contentWords.main', 'tfidf_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.