code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#%%
import os
os.chdir("../../")
import pandas as pd
import numpy as np
import json
from src.dataprep.WriteDfToJsonVar import WriteDfToJsonVar, WriteScatter
#%%
# Create data for arrow in mwe_path.html
df = pd.DataFrame({'x':[100,900,1000,1000], 'y':[100,900,900,300]})
WriteDfToJsonVar(df,'mwes/data/path_data_pathmwe.... | [
"pandas.DataFrame",
"numpy.random.randint",
"pandas.to_datetime",
"src.dataprep.WriteDfToJsonVar.WriteScatter",
"src.dataprep.WriteDfToJsonVar.WriteDfToJsonVar",
"os.chdir"
] | [((14, 32), 'os.chdir', 'os.chdir', (['"""../../"""'], {}), "('../../')\n", (22, 32), False, 'import os\n'), ((208, 278), 'pandas.DataFrame', 'pd.DataFrame', (["{'x': [100, 900, 1000, 1000], 'y': [100, 900, 900, 300]}"], {}), "({'x': [100, 900, 1000, 1000], 'y': [100, 900, 900, 300]})\n", (220, 278), True, 'import pand... |
import numpy as np
from preprocessing.pitch_class_profiling import LongFileProfiler, PitchClassProfiler
from neural_network.train import Trainer
from util import config
class Spliter():
def __init__(self, song_file):
self.song_file = song_file
def split_song(self):
trainer = Trainer()
... | [
"preprocessing.pitch_class_profiling.LongFileProfiler",
"numpy.argmax",
"numpy.array",
"util.config",
"neural_network.train.Trainer"
] | [((303, 312), 'neural_network.train.Trainer', 'Trainer', ([], {}), '()\n', (310, 312), False, 'from neural_network.train import Trainer\n'), ((364, 396), 'preprocessing.pitch_class_profiling.LongFileProfiler', 'LongFileProfiler', (['self.song_file'], {}), '(self.song_file)\n', (380, 396), False, 'from preprocessing.pit... |
from arc.utils import TaskSolver
import numpy as np
import copy
class TaskSolverColor(TaskSolver):
def __init__(self, logger):
super(TaskSolverColor, self).__init__(logger)
self.train_task = None
def train(self, task_train, params=None):
self.train_task = task_train
return Tr... | [
"copy.deepcopy",
"numpy.zeros"
] | [((4009, 4036), 'numpy.zeros', 'np.zeros', (['(n, k)'], {'dtype': 'int'}), '((n, k), dtype=int)\n', (4017, 4036), True, 'import numpy as np\n'), ((469, 497), 'copy.deepcopy', 'copy.deepcopy', (["task['input']"], {}), "(task['input'])\n", (482, 497), False, 'import copy\n'), ((545, 574), 'copy.deepcopy', 'copy.deepcopy'... |
"""
myDatasetEvaluator.py
Extensions for evaluations.
Copyright (C) 2016 <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at you... | [
"numpy.array",
"logging.getLogger",
"time.time"
] | [((1187, 1214), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1204, 1214), False, 'import logging\n'), ((1412, 1453), 'numpy.array', 'np.array', (['(0.0)'], {'dtype': 'theano.config.floatX'}), '(0.0, dtype=theano.config.floatX)\n', (1420, 1453), True, 'import numpy as np\n'), ((1868, 18... |
"""
Plot gas, tar, char from primary and secondary reactions as determined by the
Papadikis 2010 kinetic scheme for biomass pyrolysis.
Reference:
Papadikis, <NAME>, 2010. Fuel Processing Technology, 91, pp 68–79.
"""
import numpy as np
import matplotlib.pyplot as py
# Parameters
# -----------------------------------... | [
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"numpy.zeros",
"numpy.ones",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.figure",
"numpy.exp",
"numpy.linspace",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.ylabel",
"matplotlib.... | [((530, 565), 'numpy.linspace', 'np.linspace', (['(0)', 'tmax'], {'num': '(tmax / dt)'}), '(0, tmax, num=tmax / dt)\n', (541, 565), True, 'import numpy as np\n'), ((3447, 3458), 'numpy.ones', 'np.ones', (['nt'], {}), '(nt)\n', (3454, 3458), True, 'import numpy as np\n'), ((3494, 3506), 'numpy.zeros', 'np.zeros', (['nt'... |
import cv2
import numpy as np
class RoverMode:
STOP = 'stop'
FORWARD = 'forward'
APPROACH_SAMPLE = 'approach_sample'
STUCK = 'stuck'
# Identify pixels above the threshold
# Threshold of RGB > 160 does a nice job of identifying ground pixels only
def color_thresh(img, rgb_thresh=(160, 160, 160)):
... | [
"cv2.warpPerspective",
"numpy.zeros_like",
"numpy.arctan2",
"numpy.int_",
"numpy.ones_like",
"numpy.count_nonzero",
"cv2.getPerspectiveTransform",
"numpy.float32",
"numpy.sin",
"numpy.cos",
"numpy.sqrt"
] | [((407, 434), 'numpy.zeros_like', 'np.zeros_like', (['img[:, :, 0]'], {}), '(img[:, :, 0])\n', (420, 434), True, 'import numpy as np\n'), ((1104, 1131), 'numpy.zeros_like', 'np.zeros_like', (['img[:, :, 0]'], {}), '(img[:, :, 0])\n', (1117, 1131), True, 'import numpy as np\n'), ((2491, 2527), 'numpy.sqrt', 'np.sqrt', (... |
# Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.
# 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/LI... | [
"numpy.divide",
"numpy.multiply",
"numpy.subtract",
"numpy.isscalar",
"delta.utils.hparam.HParams",
"kaldiio.load_mat",
"io.open",
"numpy.add",
"kaldiio.load_ark",
"numpy.sqrt"
] | [((1918, 1934), 'delta.utils.hparam.HParams', 'HParams', ([], {'cls': 'cls'}), '(cls=cls)\n', (1925, 1934), False, 'from delta.utils.hparam import HParams\n'), ((2889, 2930), 'io.open', 'io.open', (['p.utt2spk', '"""r"""'], {'encoding': '"""utf-8"""'}), "(p.utt2spk, 'r', encoding='utf-8')\n", (2896, 2930), False, 'impo... |
# Copyright (c) 2019 Horizon Robotics. 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 applicab... | [
"subprocess.Popen",
"absl.logging.debug",
"social_bot.pygazebo.world_sdf",
"lxml.etree.tostring",
"time.sleep",
"lxml.etree.SubElement",
"social_bot.pygazebo.new_world_from_string",
"social_bot.get_world_dir",
"random.seed",
"numpy.array",
"social_bot.pygazebo.close_without_model_base_fini",
"... | [((9812, 9826), 'lxml.etree.XML', 'etree.XML', (['xml'], {}), '(xml)\n', (9821, 9826), False, 'from lxml import etree\n'), ((10903, 10943), 'lxml.etree.tostring', 'etree.tostring', (['tree'], {'encoding': '"""unicode"""'}), "(tree, encoding='unicode')\n", (10917, 10943), False, 'from lxml import etree\n'), ((10948, 109... |
import pytest
import numpy as np
from scipy import sparse
from sklearn.preprocessing import FunctionTransformer
from sklearn.utils.testing import (assert_equal, assert_array_equal,
assert_allclose_dense_sparse)
from sklearn.utils.testing import assert_warns_message, assert_no_warning... | [
"pytest.importorskip",
"sklearn.preprocessing.FunctionTransformer",
"sklearn.utils.testing.ignore_warnings",
"numpy.random.randn",
"scipy.sparse.issparse",
"pytest.warns",
"sklearn.utils.testing.assert_no_warnings",
"numpy.around",
"scipy.sparse.csc_matrix",
"sklearn.utils.testing.assert_array_equ... | [((2342, 2381), 'sklearn.utils.testing.ignore_warnings', 'ignore_warnings', ([], {'category': 'FutureWarning'}), '(category=FutureWarning)\n', (2357, 2381), False, 'from sklearn.utils.testing import ignore_warnings\n'), ((2638, 2677), 'sklearn.utils.testing.ignore_warnings', 'ignore_warnings', ([], {'category': 'Future... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 26 19:57:32 2016
@author: ORCHISAMA
"""
from __future__ import division
import numpy as np
from scipy.io.wavfile import read
from LBG import lbg
from mel_coefficients import mfcc
from LPC import lpc
import matplotlib.pyplot as plt
import os
def training(nfiltbank, orde... | [
"LBG.lbg",
"matplotlib.pyplot.subplot",
"os.getcwd",
"numpy.empty",
"mel_coefficients.mfcc",
"matplotlib.pyplot.stem",
"matplotlib.pyplot.setp",
"scipy.io.wavfile.read",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"LPC.lpc"
] | [((384, 426), 'numpy.empty', 'np.empty', (['(nSpeaker, nfiltbank, nCentroid)'], {}), '((nSpeaker, nfiltbank, nCentroid))\n', (392, 426), True, 'import numpy as np\n'), ((445, 486), 'numpy.empty', 'np.empty', (['(nSpeaker, orderLPC, nCentroid)'], {}), '((nSpeaker, orderLPC, nCentroid))\n', (453, 486), True, 'import nump... |
import matplotlib.pyplot as plt
import matplotlib.gridspec as mgridspec
import matplotlib.ticker as mticker
import matplotlib
import mpl_toolkits.mplot3d as mplot3d
import numpy
import math
import itertools
import multiprocessing
import pysb.integrate
__all__ = ['scatter', 'surf', 'sample']
def scatter(mcmc, mask=T... | [
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.meshgrid",
"matplotlib.ticker.MaxNLocator",
"numpy.empty_like",
"numpy.max",
"numpy.linspace",
"itertools.product",
"numpy.log10",
"matplotlib.pyplot.show",
"math.ceil",
"numpy.median",
"numpy.isinf",
"multiprocessing.Pool",
"numpy.nanmax"... | [((1817, 1829), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1827, 1829), True, 'import matplotlib.pyplot as plt\n'), ((1906, 2002), 'matplotlib.gridspec.GridSpec', 'mgridspec.GridSpec', (['ndims', 'ndims'], {'width_ratios': 'lim_ranges', 'height_ratios': 'lim_ranges[-1::-1]'}), '(ndims, ndims, width_ra... |
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Model
from keras.layers import Dense, Input, Lambda, Reshape, Flatten
from keras.layers import Conv2D, Conv2DTranspose, UpSampling2D, MaxPooling2D
import keras.backend as K
from keras import initializers
class MotionBlur():
def __init__(se... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"keras.initializers.he_normal",
"matplotlib.pyplot.imshow",
"keras.backend.exp",
"keras.layers.Flatten",
"keras.layers.Conv2DTranspose",
"keras.models.Model",
"matplotlib.pyplot.axis",
"keras.layers.Conv2D",
"keras.layers.Lambda",
"numpy.r... | [((4000, 4059), 'numpy.random.normal', 'np.random.normal', (['(0)', '(1)'], {'size': '(n_samples * n_samples, len_z)'}), '(0, 1, size=(n_samples * n_samples, len_z))\n', (4016, 4059), True, 'import numpy as np\n'), ((4412, 4422), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (4420, 4422), True, 'import matplo... |
"""
github.com/gauzias/slam
----------------------------
definition of the Texture class
"""
import numpy as np
from scipy import stats as sps
class TextureND:
def __init__(self,
darray=None,
process=True,
metadata=None,
**kwargs):
"""... | [
"scipy.stats.zscore",
"numpy.asanyarray",
"numpy.isfinite",
"numpy.max",
"numpy.min"
] | [((2917, 2938), 'numpy.asanyarray', 'np.asanyarray', (['darray'], {}), '(darray)\n', (2930, 2938), True, 'import numpy as np\n'), ((923, 944), 'numpy.asanyarray', 'np.asanyarray', (['darray'], {}), '(darray)\n', (936, 944), True, 'import numpy as np\n'), ((2593, 2617), 'numpy.isfinite', 'np.isfinite', (['self.darray'],... |
import numpy as np
from numpy import power
# from powerlaw import plot_pdf, Fit, pdf
# from networkx.utils import powerlaw_sequence
def power_law(self, N, e, xmin, xmax):
'''
generate a power law distribution of integers from uniform distribution
:param N: [int] number of data in powerlaw distribution (... | [
"numpy.sum",
"numpy.power",
"numpy.zeros",
"numpy.random.randint",
"numpy.random.rand"
] | [((749, 771), 'numpy.zeros', 'np.zeros', (['N'], {'dtype': 'int'}), '(N, dtype=int)\n', (757, 771), True, 'import numpy as np\n'), ((782, 802), 'numpy.power', 'power', (['xmax', '(e + 1.0)'], {}), '(xmax, e + 1.0)\n', (787, 802), False, 'from numpy import power\n'), ((813, 833), 'numpy.power', 'power', (['xmin', '(e + ... |
#!/usr/local/bin/python3
# -*- coding:utf-8 -*-
import __future__
import numpy as np
import sys
import os
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from script.rio import read_quantity, read_converter
from timeit import default_timer as timer
def compare_data(input_path1, input_path2, quantityNameList, prec... | [
"timeit.default_timer",
"numpy.zeros",
"script.rio.read_converter",
"numpy.array_equal",
"script.rio.read_quantity",
"os.path.join"
] | [((126, 157), 'os.path.join', 'os.path.join', (['sys.path[0]', '""".."""'], {}), "(sys.path[0], '..')\n", (138, 157), False, 'import os\n'), ((480, 524), 'script.rio.read_converter', 'read_converter', (['input_path1', 'uid_to_coords_1'], {}), '(input_path1, uid_to_coords_1)\n', (494, 524), False, 'from script.rio impor... |
import numpy as np
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
import itertools
class LocalCluster(object):
def __init__(self, config, kmeans_init):
self.embedding_dimension = config.embedding_dimension
self.windows_per_sample = config.windows_per_sample
self.f... | [
"sklearn.cluster.KMeans",
"numpy.zeros"
] | [((723, 791), 'sklearn.cluster.KMeans', 'KMeans', (['k'], {'random_state': '(0)', 'n_init': 'self.n_init', 'init': 'self.kmeans_init'}), '(k, random_state=0, n_init=self.n_init, init=self.kmeans_init)\n', (729, 791), False, 'from sklearn.cluster import KMeans\n'), ((927, 975), 'numpy.zeros', 'np.zeros', (['(k, windows_... |
import unittest
from setup.settings import *
from numpy.testing import *
import numpy as np
import dolphindb_numpy as dnp
import pandas as pd
import orca
class FunctionReshapeTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
# connect to a DolphinDB server
orca.connect(HOST, PORT, "a... | [
"unittest.main",
"dolphindb_numpy.arange",
"numpy.arange",
"orca.connect"
] | [((696, 711), 'unittest.main', 'unittest.main', ([], {}), '()\n', (709, 711), False, 'import unittest\n'), ((293, 336), 'orca.connect', 'orca.connect', (['HOST', 'PORT', '"""admin"""', '"""123456"""'], {}), "(HOST, PORT, 'admin', '123456')\n", (305, 336), False, 'import orca\n'), ((389, 402), 'numpy.arange', 'np.arange... |
from BirdSongToolbox.file_utility_functions import _save_numpy_data, _save_pckl_data
import numpy as np
import os
import h5py
# TODO: Switch modular functions to Pathlib
# TODO: Write Test Scripts for these Functions
def ask_data_path(start_path, focus: str):
""" Asks the User to select data they wish to selec... | [
"h5py.File",
"numpy.logical_and",
"numpy.floor",
"numpy.zeros",
"BirdSongToolbox.file_utility_functions._save_numpy_data",
"BirdSongToolbox.file_utility_functions._save_pckl_data",
"numpy.where",
"numpy.array",
"os.path.join",
"os.listdir",
"numpy.unique"
] | [((705, 727), 'os.listdir', 'os.listdir', (['start_path'], {}), '(start_path)\n', (715, 727), False, 'import os\n'), ((3658, 3683), 'h5py.File', 'h5py.File', (['kwik_path', '"""r"""'], {}), "(kwik_path, 'r')\n", (3667, 3683), False, 'import h5py\n'), ((5256, 5280), 'h5py.File', 'h5py.File', (['kwe_path', '"""r"""'], {}... |
import numpy as np
import pandas as pd
from flask import Flask, request, jsonify, render_template
import pickle
from sklearn.preprocessing import PowerTransformer
from sklearn.model_selection import train_test_split
TEMPLATES_AUTO_RELOAD=True
app = Flask(__name__)
model = pickle.load(open('model.pkl', 'rb'))
... | [
"sklearn.preprocessing.PowerTransformer",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"flask.request.form.values",
"flask.Flask",
"flask.jsonify",
"numpy.array",
"flask.render_template",
"flask.request.get_json"
] | [((258, 273), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (263, 273), False, 'from flask import Flask, request, jsonify, render_template\n'), ((327, 351), 'pandas.read_csv', 'pd.read_csv', (['"""file2.csv"""'], {}), "('file2.csv')\n", (338, 351), True, 'import pandas as pd\n'), ((613, 668), 'sklearn.mod... |
import pygame
import random
import numpy as np
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 800
GRID_SIZE = 20
red = (255, 0, 0)
green = (0, 255, 0)
blue = (0, 0, 255)
class Snake:
def __init__(self):
'''Initialise the snake, food and grid attributes
0 -> empty cell
1 -> snake body
2 -> food'''
self.grid = np.zeros... | [
"pygame.quit",
"pygame.font.SysFont",
"pygame.draw.rect",
"pygame.display.set_mode",
"pygame.event.get",
"numpy.zeros",
"pygame.init",
"pygame.display.flip",
"random.randrange",
"numpy.arange",
"pygame.display.quit",
"pygame.display.set_caption",
"pygame.time.Clock"
] | [((312, 359), 'numpy.zeros', 'np.zeros', (['(GRID_SIZE, GRID_SIZE)'], {'dtype': '"""int32"""'}), "((GRID_SIZE, GRID_SIZE), dtype='int32')\n", (320, 359), True, 'import numpy as np\n'), ((750, 769), 'random.randrange', 'random.randrange', (['(4)'], {}), '(4)\n', (766, 769), False, 'import random\n'), ((2670, 2783), 'pyg... |
# -*- coding: utf-8 -*-
"""Fixtures."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import os.path as op
import numpy as np
from pytest import fixture
from klusta.kwik.mea import staggered_... | [
"numpy.dstack",
"klusta.utils._spikes_per_cluster",
"klusta.kwik.mock.artificial_spike_clusters",
"klusta.utils.Bunch",
"klusta.kwik.mock.artificial_features",
"klusta.kwik.mea.staggered_positions",
"klusta.kwik.mock.artificial_masks",
"klusta.kwik.mock.artificial_waveforms",
"klusta.kwik.mock.artif... | [((942, 949), 'klusta.utils.Bunch', 'Bunch', ([], {}), '()\n', (947, 949), False, 'from klusta.utils import Bunch, _spikes_per_cluster\n'), ((1090, 1114), 'os.path.join', 'op.join', (['tempdir', '"""test"""'], {}), "(tempdir, 'test')\n", (1097, 1114), True, 'import os.path as op\n'), ((1491, 1538), 'klusta.kwik.mock.ar... |
import numpy as np
import boto3
import segyio
import subprocess
import os
from scipy import interpolate
from devito import Eq, Operator
client = boto3.client('s3')
####################################################################################################
# array put and get
# write array
def array_put(body... | [
"numpy.abs",
"boto3.client",
"numpy.ones",
"segyio.dt",
"numpy.arange",
"segyio.create",
"numpy.max",
"numpy.linspace",
"scipy.interpolate.splrep",
"numpy.fromstring",
"segyio.open",
"devito.Operator",
"segyio.spec",
"numpy.min",
"numpy.concatenate",
"subprocess.run",
"devito.Eq",
... | [((146, 164), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (158, 164), False, 'import boto3\n'), ((3016, 3050), 'numpy.fromstring', 'np.fromstring', (['string'], {'dtype': 'dtype'}), '(string, dtype=dtype)\n', (3029, 3050), True, 'import numpy as np\n'), ((3313, 3399), 'subprocess.run', 'subprocess.r... |
import numpy as np
import pandas as pd
from src.d00_utils.data_utils import import_treated_csv_data, save_data_frame
from src.d02_extraction.extract_least_sq_fit import *
def create_ordinary_least_squares_data(experiments_dict, experiment, x_col_name, y_col_name, subset_col_name=None,
... | [
"pandas.DataFrame",
"numpy.full",
"src.d00_utils.data_utils.save_data_frame",
"numpy.log",
"numpy.exp",
"src.d00_utils.data_utils.import_treated_csv_data"
] | [((1337, 1410), 'src.d00_utils.data_utils.import_treated_csv_data', 'import_treated_csv_data', ([], {'file_name': 'file_name', 'experiment_label': 'experiment'}), '(file_name=file_name, experiment_label=experiment)\n', (1360, 1410), False, 'from src.d00_utils.data_utils import import_treated_csv_data, save_data_frame\n... |
__author__ = 'maximmillen'
from collections import OrderedDict
import numpy as np
from eqsig.single import Signal, AccSignal
class Cluster(object):
"""
This object represents a group of Signals or AccSignals that have the same time step
Parameters
----------
values: 2d_array_like
An arr... | [
"numpy.radians",
"eqsig.single.Signal",
"numpy.sum",
"numpy.logspace",
"eqsig.single.AccSignal",
"numpy.mod",
"numpy.sin",
"numpy.array",
"numpy.linspace",
"numpy.cos",
"collections.OrderedDict",
"numpy.log10"
] | [((9349, 9366), 'numpy.radians', 'np.radians', (['angle'], {}), '(angle)\n', (9359, 9366), True, 'import numpy as np\n'), ((9467, 9498), 'eqsig.single.AccSignal', 'AccSignal', (['combo', 'acc_sig_ns.dt'], {}), '(combo, acc_sig_ns.dt)\n', (9476, 9498), False, 'from eqsig.single import Signal, AccSignal\n'), ((10084, 101... |
import torch
import torch.nn as nn
from torchvision import transforms
from torch.utils.data.dataset import Dataset # For custom datasets
import skimage.io as sio
import pickle
import numpy as np
import cv2
import os
from PIL import Image
class NYUD_Dataset(Dataset):
def __init__(self, usage='test'):
self.t... | [
"skimage.io.imread",
"numpy.asarray",
"PIL.Image.open",
"os.path.join",
"cv2.resize",
"torchvision.transforms.ToTensor"
] | [((331, 352), 'torchvision.transforms.ToTensor', 'transforms.ToTensor', ([], {}), '()\n', (350, 352), False, 'from torchvision import transforms\n'), ((1522, 1580), 'os.path.join', 'os.path.join', (['self.root', '"""test"""', "('%05d-rgb.jpg' % image_id)"], {}), "(self.root, 'test', '%05d-rgb.jpg' % image_id)\n", (1534... |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | [
"megengine.autodiff.GradManager",
"megengine.module.Conv2d",
"pytest.mark.require_ngpu",
"megengine.module.AvgPool2d",
"megengine.functional.nn.cross_entropy",
"megengine.functional.debug_param.set_conv_execution_strategy",
"os.path.dirname",
"megengine.distributed.make_allreduce_cb",
"numpy.testing... | [((5688, 5715), 'pytest.mark.require_ngpu', 'pytest.mark.require_ngpu', (['(2)'], {}), '(2)\n', (5712, 5715), False, 'import pytest\n'), ((1564, 1587), 'megengine.is_cuda_available', 'mge.is_cuda_available', ([], {}), '()\n', (1585, 1587), True, 'import megengine as mge\n'), ((3294, 3314), 'megengine.load', 'mge.load',... |
import warnings
warnings.filterwarnings('ignore')
import os
import sys
import argparse
from pathlib import Path
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from sklearn.impute import SimpleImputer, KNNImputer
# Utils
from utils import plot_pca, src_norm_rna, combat_norm... | [
"sklearn.impute.SimpleImputer",
"utils.combat_norm",
"argparse.ArgumentParser",
"os.makedirs",
"ipdb.set_trace",
"warnings.filterwarnings",
"pandas.read_csv",
"pathlib.Path",
"utils.src_norm_rna",
"numpy.array",
"pandas.concat",
"matplotlib.pyplot.savefig"
] | [((16, 49), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (39, 49), False, 'import warnings\n'), ((360, 414), 'pathlib.Path', 'Path', (['"""./data/July2020/combined_rnaseq_data_lincs1000"""'], {}), "('./data/July2020/combined_rnaseq_data_lincs1000')\n", (364, 414), False,... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2019 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | [
"numpy.min",
"numpy.max",
"numpy.clip"
] | [((2724, 2736), 'numpy.min', 'np.min', (['data'], {}), '(data)\n', (2730, 2736), True, 'import numpy as np\n'), ((2793, 2805), 'numpy.max', 'np.max', (['data'], {}), '(data)\n', (2799, 2805), True, 'import numpy as np\n'), ((3391, 3428), 'numpy.clip', 'np.clip', (['result', 'scale_min', 'scale_max'], {}), '(result, sca... |
"""
Copyright 2020 The OneFlow 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 applicable law or agr... | [
"oneflow.experimental.rsqrt",
"oneflow.experimental.pow",
"unittest.main",
"numpy.full",
"numpy.random.randn",
"numpy.std",
"oneflow.experimental.sin",
"numpy.var",
"oneflow.experimental.unittest.env.eager_execution_enabled",
"numpy.square",
"oneflow.experimental.cos",
"numpy.cos",
"oneflow.... | [((7824, 7839), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7837, 7839), False, 'import unittest\n'), ((946, 973), 'numpy.random.randn', 'np.random.randn', (['(2)', '(3)', '(4)', '(5)'], {}), '(2, 3, 4, 5)\n', (961, 973), True, 'import numpy as np\n'), ((1044, 1079), 'numpy.var', 'np.var', (['input_arr', '(1)'... |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 5 13:24:18 2020
@author: earne
"""
from collections import defaultdict
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import stats
import seaborn as sns
from sipperplots import (
get_any_idi,
get_side_idi,
get_content_idi,... | [
"pandas.DataFrame",
"sipperplots.get_side_idi",
"pandas.isna",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.close",
"numpy.nanstd",
"sipperplots.get_any_idi",
"collections.defaultdict",
"sipperplots.preproc_averaging",
"matplotlib.pyplot.figure",
"numpy.arange",
"seaborn.distplot",
"numpy.lin... | [((1028, 1042), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1040, 1042), True, 'import pandas as pd\n'), ((1930, 1944), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1942, 1944), True, 'import pandas as pd\n'), ((3066, 3080), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (3078, 3080), True, ... |
r"""
.. warning:: This model and this model description are under review following
concerns raised by SasView users. If you need to use this model,
please email <EMAIL> for the latest situation. *The
SasView Developers. September 2018.*
Definition
----------
Calculates the scatt... | [
"numpy.random.beta",
"numpy.random.uniform",
"numpy.sqrt"
] | [((6113, 6138), 'numpy.random.beta', 'np.random.beta', ([], {'a': '(10)', 'b': '(1)'}), '(a=10, b=1)\n', (6127, 6138), True, 'import numpy as np\n'), ((5998, 6023), 'numpy.random.uniform', 'np.random.uniform', (['(1.3)', '(4)'], {}), '(1.3, 4)\n', (6015, 6023), True, 'import numpy as np\n'), ((6043, 6070), 'numpy.rando... |
from itertools import repeat, product
import numpy as np
from parma import (polyharmonic_interpolator, polyharmonic_hermite_interpolator,
multiquadric_hermite_interpolator)
from parma.utils import polynomial_powers
def test_interp_1D():
def f(x):
return np.tanh(x)
data_locs = np.... | [
"parma.polyharmonic_interpolator",
"numpy.tanh",
"parma.polyharmonic_hermite_interpolator",
"parma.multiquadric_hermite_interpolator",
"parma.utils.polynomial_powers",
"numpy.array",
"numpy.linspace",
"numpy.cosh",
"numpy.broadcast_arrays",
"numpy.sinh"
] | [((317, 352), 'numpy.array', 'np.array', (['[0.1, 0.3, 0.5, 0.7, 0.9]'], {}), '([0.1, 0.3, 0.5, 0.7, 0.9])\n', (325, 352), True, 'import numpy as np\n'), ((401, 422), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(20)'], {}), '(0, 1, 20)\n', (412, 422), True, 'import numpy as np\n'), ((442, 500), 'parma.polyharmoni... |
# 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 app... | [
"unittest.main",
"textwrap.dedent",
"paddle.utils.gast.parse",
"paddle.fluid.layers.relu",
"paddle.fluid.program_guard",
"paddle.fluid.layers.assign",
"paddle.fluid.dygraph.guard",
"numpy.random.random",
"paddle.fluid.dygraph.to_variable",
"paddle.fluid.CPUPlace",
"paddle.fluid.dygraph.dygraph_t... | [((2873, 2888), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2886, 2888), False, 'import unittest\n'), ((1122, 1145), 'inspect.getsource', 'inspect.getsource', (['func'], {}), '(func)\n', (1139, 1145), False, 'import inspect\n'), ((1163, 1186), 'textwrap.dedent', 'textwrap.dedent', (['source'], {}), '(source)\n... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | [
"argparse.ArgumentParser",
"sklearn.model_selection.train_test_split",
"pathlib.Path",
"health_azure.submit_to_azure_if_needed",
"numpy.loadtxt",
"sklearn.svm.SVC",
"sklearn.metrics.confusion_matrix"
] | [((771, 982), 'health_azure.submit_to_azure_if_needed', 'submit_to_azure_if_needed', ([], {'compute_cluster_name': '"""lite-testing-ds2"""', 'default_datastore': '"""himldatasets"""', 'input_datasets': "['himl_sample7_input']", 'wait_for_completion': '(True)', 'wait_for_completion_show_output': '(True)'}), "(compute_cl... |
from math import floor
import numpy as np
import scipy.stats as st
from scipy.signal import savgol_filter
import matplotlib.pyplot as plt
import warnings
def savgol(x, window_size=100, polyorder=1):
"""
Perform Savitzky-Golay filtration of 1-D array.
Args:
x (np.ndarray) - ordered samples
... | [
"scipy.signal.savgol_filter",
"scipy.stats.norm",
"warnings.simplefilter",
"warnings.filterwarnings",
"math.floor",
"numpy.insert",
"numpy.percentile",
"numpy.apply_along_axis",
"numpy.lib.stride_tricks.as_strided",
"warnings.catch_warnings"
] | [((2106, 2170), 'numpy.lib.stride_tricks.as_strided', 'np.lib.stride_tricks.as_strided', (['x'], {'shape': 'shape', 'strides': 'strides'}), '(x, shape=shape, strides=strides)\n', (2137, 2170), True, 'import numpy as np\n'), ((3474, 3521), 'numpy.apply_along_axis', 'np.apply_along_axis', (['func'], {'axis': '(-1)', 'arr... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# Essentials
import os, sys, glob
import pandas as pd
import numpy as np
import nibabel as nib
import scipy.io as sio
# Stats
import scipy as sp
from scipy import stats
import statsmodels.api as sm
import pingouin as pg
# Plotting
import seaborn as sns
import matplotl... | [
"numpy.sum",
"seaborn.kdeplot",
"numpy.argsort",
"numpy.mean",
"numpy.arange",
"os.path.join",
"os.chdir",
"sys.path.append",
"pandas.DataFrame",
"func.run_pheno_correlations",
"func.set_proj_env",
"numpy.zeros_like",
"os.path.exists",
"brain_plot_func.brain_plot",
"func.my_get_cmap",
... | [((456, 574), 'sys.path.append', 'sys.path.append', (['"""/Users/lindenmp/Google-Drive-Penn/work/research_projects/normative_neurodev_cs_t1/1_code/"""'], {}), "(\n '/Users/lindenmp/Google-Drive-Penn/work/research_projects/normative_neurodev_cs_t1/1_code/'\n )\n", (471, 574), False, 'import os, sys, glob\n'), ((98... |
import os
from keras.models import Model
from keras.layers import Reshape, Activation, Conv2D, Input, MaxPooling2D, BatchNormalization, Flatten, Dense, Lambda
from keras.layers.advanced_activations import LeakyReLU
import tensorflow as tf
import numpy as np
import cv2
from utils import decode_netout, compute_overlap,... | [
"backend.TinyYoloFeature",
"numpy.zeros",
"numpy.expand_dims",
"numpy.ones",
"keras.models.Model",
"keras.layers.Conv2D",
"keras.layers.Lambda",
"numpy.random.normal",
"keras.layers.Input",
"utils.decode_netout",
"keras.layers.Reshape",
"cv2.resize"
] | [((823, 862), 'numpy.ones', 'np.ones', (['self.nb_class'], {'dtype': '"""float32"""'}), "(self.nb_class, dtype='float32')\n", (830, 862), True, 'import numpy as np\n'), ((1109, 1159), 'keras.layers.Input', 'Input', ([], {'shape': '(self.input_size, self.input_size, 3)'}), '(shape=(self.input_size, self.input_size, 3))\... |
#import libraries
import numpy as np
import scipy as sp
#import data
x = np.array(([3,5],[5,1],[10,2]) , dtype='float')
y = np.array(([0.66],[0.85],[0.94]) , dtype='float')
#New complete class, with changes:
class Neural_Network:
def __init__(self, Lambda=0):
#Define Hyperparameters
se... | [
"numpy.sum",
"scipy.optimize.fmin_tnc",
"numpy.random.randn",
"numpy.array",
"numpy.reshape",
"numpy.exp",
"numpy.dot"
] | [((79, 129), 'numpy.array', 'np.array', (['([3, 5], [5, 1], [10, 2])'], {'dtype': '"""float"""'}), "(([3, 5], [5, 1], [10, 2]), dtype='float')\n", (87, 129), True, 'import numpy as np\n'), ((131, 180), 'numpy.array', 'np.array', (['([0.66], [0.85], [0.94])'], {'dtype': '"""float"""'}), "(([0.66], [0.85], [0.94]), dtype... |
"""Linearised UVLM 2D tests
Test linear UVLM solver against analytical results for 2D wing
Author: <NAME>, Dec 2018
Modified: <NAME>, Sep 2019
"""
import sharpy.utils.sharpydir as sharpydir
import unittest
import os
# import matplotlib.pyplot as plt
import numpy as np
import shutil
import sharpy.sharpy_main
import ... | [
"numpy.abs",
"sharpy.utils.algebra.crv2rotation",
"numpy.sin",
"numpy.linalg.norm",
"shutil.rmtree",
"numpy.round",
"unittest.main",
"os.path.exists",
"numpy.max",
"numpy.linspace",
"os.path.realpath",
"numpy.cross",
"sharpy.utils.analytical.wagner_imp_start",
"numpy.cos",
"numpy.dot",
... | [((18312, 18350), 'os.path.exists', 'os.path.exists', (['"""./figs/infinite_span"""'], {}), "('./figs/infinite_span')\n", (18326, 18350), False, 'import os\n'), ((18402, 18417), 'unittest.main', 'unittest.main', ([], {}), '()\n', (18415, 18417), False, 'import unittest\n'), ((2007, 2033), 'os.path.exists', 'os.path.exi... |
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# Name: BayesianTracker
# Purpose: A multi object tracking library, specifically used to reconstruct
# tracks in crowded fields. Here we use a probabilistic network of
# information to perform... | [
"numpy.matrix",
"json.load",
"os.path.exists",
"os.path.split",
"os.path.join",
"logging.getLogger"
] | [((931, 966), 'logging.getLogger', 'logging.getLogger', (['"""worker_process"""'], {}), "('worker_process')\n", (948, 966), False, 'import logging\n'), ((1054, 1078), 'os.path.exists', 'os.path.exists', (['filename'], {}), '(filename)\n', (1068, 1078), False, 'import os\n'), ((1158, 1181), 'os.path.split', 'os.path.spl... |
import os
import numpy as np
import json
import time
from PIL import Image
def compute_convolution(I, T, stride=1):
'''
This function takes an image <I> and a template <T> (both numpy arrays)
and returns a heatmap where each grid represents the output produced by
convolution at each location. You can... | [
"json.dump",
"numpy.sum",
"os.makedirs",
"numpy.argmax",
"numpy.asarray",
"numpy.ones",
"time.time",
"numpy.shape",
"numpy.amax",
"numpy.argsort",
"numpy.mean",
"numpy.array",
"numpy.exp",
"os.path.join"
] | [((3865, 3903), 'os.makedirs', 'os.makedirs', (['preds_path'], {'exist_ok': '(True)'}), '(preds_path, exist_ok=True)\n', (3876, 3903), False, 'import os\n'), ((4749, 4760), 'time.time', 'time.time', ([], {}), '()\n', (4758, 4760), False, 'import time\n'), ((466, 477), 'numpy.shape', 'np.shape', (['I'], {}), '(I)\n', (4... |
__all__ = ['to_dt', 'Config']
import argparse
from dataclasses import dataclass
import datetime as dt
import json
import os
from pathlib import Path
from typing import Tuple, Dict, Optional, TYPE_CHECKING
import jsonschema
import numpy as np
from slim.types.TreatmentTypes import Treatment, TreatmentParams, GeneticMe... | [
"jsonschema.validate",
"slim.types.TreatmentTypes.EMB",
"json.load",
"argparse.ArgumentParser",
"numpy.random.default_rng",
"datetime.datetime.strptime",
"pathlib.Path",
"slim.types.TreatmentTypes.Money",
"slim.types.TreatmentTypes.Thermolicer",
"os.path.join"
] | [((719, 763), 'datetime.datetime.strptime', 'dt.datetime.strptime', (['string_date', 'dt_format'], {}), '(string_date, dt_format)\n', (739, 763), True, 'import datetime as dt\n'), ((1325, 1358), 'jsonschema.validate', 'jsonschema.validate', (['data', 'schema'], {}), '(data, schema)\n', (1344, 1358), False, 'import json... |
from rllab.misc import logger
from rllab.misc import ext
from rllab.misc.overrides import overrides
from sandbox.rocky.tf.algos.batch_bmaml_polopt import BatchBMAMLPolopt
from sandbox.rocky.tf.optimizers.first_order_optimizer import FirstOrderOptimizer
from sandbox.rocky.tf.misc import tensor_utils, svpg_tf_utils
from ... | [
"rllab.misc.logger.record_tabular",
"sandbox.rocky.tf.misc.svpg_tf_utils.pdist",
"tensorflow.reduce_sum",
"tensorflow.reshape",
"tensorflow.matmul",
"sandbox.rocky.tf.misc.svpg_tf_utils.squareform",
"sandbox.rocky.tf.optimizers.first_order_optimizer.FirstOrderOptimizer",
"tensorflow.stack",
"tensorf... | [((2487, 2516), 'tensorflow.stack', 'tf.stack', (['a_flat_list'], {'axis': '(0)'}), '(a_flat_list, axis=0)\n', (2495, 2516), True, 'import tensorflow as tf\n'), ((2615, 2651), 'sandbox.rocky.tf.misc.svpg_tf_utils.pdist', 'svpg_tf_utils.pdist', (['particle_tensor'], {}), '(particle_tensor)\n', (2634, 2651), False, 'from... |
#! /usr/bin/env python
# /***************************************************************************
#
# @package: panda_robot
# @author: <NAME> <<EMAIL>>
#
# **************************************************************************/
# /***************************************************************************
... | [
"numpy.quaternion",
"franka_interface.GripperInterface",
"copy.deepcopy",
"panda_kinematics.PandaKinematics",
"rospy.Time.now",
"argparse.ArgumentParser",
"quaternion.as_rotation_matrix",
"franka_interface.ArmInterface._on_joint_states",
"franka_interface.RobotEnable",
"numpy.asarray",
"franka_i... | [((1596, 1612), 'rospy.Time.now', 'rospy.Time.now', ([], {}), '()\n', (1610, 1612), False, 'import rospy\n'), ((22463, 22498), 'rospy.init_node', 'rospy.init_node', (['"""panda_arm_untuck"""'], {}), "('panda_arm_untuck')\n", (22478, 22498), False, 'import rospy\n'), ((22555, 22580), 'argparse.ArgumentParser', 'argparse... |
import math
import sys
import time
import matplotlib.pyplot as plt
import numpy as np
class Config():
# simulation parameters
def __init__(self):
# robot parameter
self.max_speed = 1.0 # [m/s]
self.min_speed = -1.0 # [m/s]
self.max_yawrate = 180 * math.pi / 180... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"math.sin",
"numpy.array",
"matplotlib.pyplot.cla",
"math.cos",
"numpy.vstack"
] | [((1473, 1523), 'numpy.array', 'np.array', (['[0.5, 0.5, math.pi / 2.0, 0.0, 0.0, 0.0]'], {}), '([0.5, 0.5, math.pi / 2.0, 0.0, 0.0, 0.0])\n', (1481, 1523), True, 'import numpy as np\n'), ((1582, 1591), 'matplotlib.pyplot.cla', 'plt.cla', ([], {}), '()\n', (1589, 1591), True, 'import matplotlib.pyplot as plt\n'), ((159... |
#
# Copyright 2018, 2020-2021 <NAME>
# 2019 <NAME>
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights... | [
"numpy.ones_like",
"numpy.log",
"numpy.ravel",
"numpy.searchsorted",
"numpy.append",
"numpy.max",
"numpy.where",
"numpy.arange",
"numpy.linspace"
] | [((3213, 3226), 'numpy.arange', 'np.arange', (['nx'], {}), '(nx)\n', (3222, 3226), True, 'import numpy as np\n'), ((3235, 3248), 'numpy.arange', 'np.arange', (['ny'], {}), '(ny)\n', (3244, 3248), True, 'import numpy as np\n'), ((4657, 4672), 'numpy.ravel', 'np.ravel', (['dr_xy'], {}), '(dr_xy)\n', (4665, 4672), True, '... |
# -*- coding: utf-8 -*-
#
# Copyright 2018 Quantopian, Inc.
#
# 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 applicabl... | [
"pandas.tseries.holiday.sunday_to_monday",
"pandas.Timestamp",
"datetime.time",
"pandas.tseries.offsets.LastWeekOfMonth",
"numpy.timedelta64",
"datetime.timedelta",
"pytz.timezone",
"pandas.tseries.holiday.EasterMonday.dates",
"pandas.Timedelta",
"pandas.tseries.offsets.WeekOfMonth",
"pandas.Dat... | [((2059, 2089), 'pandas.tseries.offsets.WeekOfMonth', 'WeekOfMonth', ([], {'week': '(2)', 'weekday': '(0)'}), '(week=2, weekday=0)\n', (2070, 2089), False, 'from pandas.tseries.offsets import LastWeekOfMonth, WeekOfMonth\n'), ((3746, 3758), 'datetime.timedelta', 'timedelta', (['(1)'], {}), '(1)\n', (3755, 3758), False,... |
# -*- coding: utf-8 -*-
from sklearn.base import TransformerMixin
#from category_encoders.ordinal import OrdinalEncoder
#import numpy as np
import pandas as pd
import copy
from pandas.api.types import is_numeric_dtype,is_string_dtype
from joblib import Parallel,delayed,effective_n_jobs
import numpy as np
from BDMLtools... | [
"copy.deepcopy",
"numpy.float32",
"numpy.finfo",
"pandas.cut",
"joblib.effective_n_jobs",
"pandas.api.types.is_string_dtype",
"pandas.api.types.is_numeric_dtype",
"joblib.Parallel",
"joblib.delayed",
"pandas.concat"
] | [((2931, 2957), 'copy.deepcopy', 'copy.deepcopy', (['self.varbin'], {}), '(self.varbin)\n', (2944, 2957), False, 'import copy\n'), ((4107, 4136), 'joblib.effective_n_jobs', 'effective_n_jobs', (['self.n_jobs'], {}), '(self.n_jobs)\n', (4123, 4136), False, 'from joblib import Parallel, delayed, effective_n_jobs\n'), ((4... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
import numpy as np
import faiss
from commo... | [
"numpy.abs",
"numpy.empty",
"numpy.allclose",
"faiss.StandardGpuResources",
"faiss.PCAMatrix",
"numpy.arange",
"numpy.random.randint",
"unittest.main",
"faiss.IndexIDMap",
"faiss.GpuProgressiveDimIndexFactory",
"faiss.Kmeans",
"numpy.random.RandomState",
"faiss.IndexReplicas",
"faiss.GpuIn... | [((12958, 12973), 'unittest.main', 'unittest.main', ([], {}), '()\n', (12971, 12973), False, 'import unittest\n'), ((680, 701), 'faiss.IndexReplicas', 'faiss.IndexReplicas', ([], {}), '()\n', (699, 701), False, 'import faiss\n'), ((1981, 2014), 'faiss.IndexBinaryFlat', 'faiss.IndexBinaryFlat', (['self.d_bin'], {}), '(s... |
import torch
import torchvision
import numpy as np
import torch.nn as nn
from torch.utils.data import TensorDataset, DataLoader
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
device = 'cuda' if torch.cuda.is_available() else 'cpu'
transform = transforms.Compose([transforms.ToTensor(),tra... | [
"torch.utils.data.DataLoader",
"matplotlib.pyplot.plot",
"torch.nn.Conv2d",
"torchvision.datasets.CIFAR100",
"torch.nn.CrossEntropyLoss",
"numpy.ones",
"torchvision.datasets.CIFAR10",
"torch.cuda.is_available",
"torch.utils.data.TensorDataset",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"matplot... | [((388, 474), 'torchvision.datasets.CIFAR10', 'torchvision.datasets.CIFAR10', (['"""."""'], {'train': '(True)', 'transform': 'transform', 'download': '(True)'}), "('.', train=True, transform=transform, download\n =True)\n", (416, 474), False, 'import torchvision\n'), ((510, 596), 'torchvision.datasets.CIFAR10', 'tor... |
import numpy as np
from causaldag import DAG
from sparse_shift.utils import dag2cpdag, cpdag2dags
from sparse_shift.testing import test_dag_shifts
class FullPC:
"""
Pools all the data and computes the oracle PC algorithm result.
"""
def __init__(self, dag):
self.domains_ = []
self.inte... | [
"numpy.sum",
"sparse_shift.testing.test_dag_shifts",
"numpy.abs",
"numpy.ones",
"causaldag.DAG",
"causallearn.utils.PCUtils.Meek.meek",
"numpy.max",
"numpy.reshape",
"sparse_shift.utils.create_causal_learn_cpdag",
"causallearn.graph.Edge.Edge",
"numpy.asarray",
"sparse_shift.causal_learn.Graph... | [((11189, 11221), 'sparse_shift.utils.create_causal_learn_cpdag', 'create_causal_learn_cpdag', (['cpdag'], {}), '(cpdag)\n', (11214, 11221), False, 'from sparse_shift.utils import create_causal_learn_cpdag\n'), ((11432, 11455), 'sparse_shift.causal_learn.GraphClass.CausalGraph', 'CausalGraph', ([], {'G': 'cl_cpdag'}), ... |
# -*- coding: utf-8 -*-
"""
SMPTE 240M Colourspace
======================
Defines the *SMPTE 240M* colourspace:
- :attr:`colour.models.SMPTE_240M_COLOURSPACE`.
References
----------
- :cite:`SocietyofMotionPictureandTelevisionEngineers1999b` : Society of
Motion Picture and Television Engineers. (1999). ANSI/... | [
"colour.models.rgb.RGB_Colourspace",
"colour.models.rgb.normalised_primary_matrix",
"numpy.linalg.inv",
"numpy.array"
] | [((1239, 1293), 'numpy.array', 'np.array', (['[[0.63, 0.34], [0.31, 0.595], [0.155, 0.07]]'], {}), '([[0.63, 0.34], [0.31, 0.595], [0.155, 0.07]])\n', (1247, 1293), True, 'import numpy as np\n'), ((1744, 1814), 'colour.models.rgb.normalised_primary_matrix', 'normalised_primary_matrix', (['SMPTE_240M_PRIMARIES', 'SMPTE_... |
import numpy as np
import sys
import subprocess
import RPG_Position
import shutil
import random
import RPG_Buffer
import time
import colorama
def clear_screen():
OS=sys.platform
RPG_Position.pos(1,1)
if OS=="win32":
colorama.winterm.WinTerm().erase_screen()
else:
sys.stdout.write("\033[... | [
"sys.stdout.write",
"RPG_main.main",
"numpy.pad",
"random.randint",
"shutil.get_terminal_size",
"numpy.zeros",
"time.sleep",
"colorama.winterm.WinTerm",
"numpy.array",
"random.randrange",
"RPG_Position.pos"
] | [((187, 209), 'RPG_Position.pos', 'RPG_Position.pos', (['(1)', '(1)'], {}), '(1, 1)\n', (203, 209), False, 'import RPG_Position\n'), ((334, 356), 'RPG_Position.pos', 'RPG_Position.pos', (['(1)', '(1)'], {}), '(1, 1)\n', (350, 356), False, 'import RPG_Position\n'), ((13277, 13292), 'RPG_main.main', 'RPG_main.main', ([],... |
# -*- encoding: utf-8 -*-
from datetime import datetime
import tensorflow as tf
import pickle
import class_texte
import numpy as np
# unpickle liste_de_docment_traites
# unpickle vocabulaire mot --> indices
liste_docments_traités = pickle.load(open("docment_traites.p", 'rb'))
test_2 = pickle.load(open("dico_mot_index.p... | [
"tensorflow.keras.layers.Dot",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.Input",
"tensorflow.keras.Model",
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"datetime.datetime.utcnow",
"tensorflow.keras.preprocessing.sequence.make_sampling_table",
"tensorflow.compat.v1.keras.callback... | [((1357, 1453), 'tensorflow.keras.preprocessing.sequence.pad_sequences', 'tf.keras.preprocessing.sequence.pad_sequences', (['liste_oh'], {'maxlen': 'max_longueur', 'padding': '"""post"""'}), "(liste_oh, maxlen=max_longueur,\n padding='post')\n", (1402, 1453), True, 'import tensorflow as tf\n'), ((1472, 1535), 'tenso... |
# 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... | [
"os.makedirs",
"cv2.cvtColor",
"os.path.isdir",
"src.ETSNET.pse.pse",
"cv2.imread",
"numpy.max",
"numpy.mean",
"cv2.boxPoints",
"os.path.splitext",
"numpy.where",
"cv2.minAreaRect",
"numpy.squeeze",
"cv2.drawContours",
"os.path.split",
"os.path.join",
"os.listdir"
] | [((1842, 1864), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (1852, 1864), False, 'import cv2\n'), ((1877, 1915), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2RGB'], {}), '(image, cv2.COLOR_BGR2RGB)\n', (1889, 1915), False, 'import cv2\n'), ((2153, 2180), 'os.listdir', 'os.listdir', ... |
import numpy as np
import numpy.random as npr
import pandas as pd
from rta.array_operations.functional import act
from rta.stats.random import runif
pi = np.pi
def array2df(x, stack=True):
x = pd.DataFrame(x)
x.index = ["p{}".format(i) for i in range(x.shape[0])]
if stack:
x = x.stack()
x... | [
"pandas.DataFrame",
"matplotlib.pyplot.show",
"numpy.random.binomial",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.scatter",
"rta.stats.random.runif",
"numpy.random.random",
"numpy.sin",
"numpy.cos",
"rta.array_operations.functional.act"
] | [((200, 215), 'pandas.DataFrame', 'pd.DataFrame', (['x'], {}), '(x)\n', (212, 215), True, 'import pandas as pd\n'), ((1567, 1583), 'rta.array_operations.functional.act', 'act', (['shifts', 'rts'], {}), '(shifts, rts)\n', (1570, 1583), False, 'from rta.array_operations.functional import act\n'), ((1626, 1661), 'matplotl... |
from dataclasses import dataclass
import cbor2
from typing import Optional
import numpy as np
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec, utils
from common.stereotype_tags import StereotypeTags
@dataclass(init=False)
class TBSCertificate:
serial_num... | [
"cryptography.hazmat.primitives.hashes.SHA256",
"cryptography.hazmat.primitives.asymmetric.utils.decode_dss_signature",
"cbor2.loads",
"numpy.iinfo",
"cbor2.dumps",
"common.stereotype_tags.StereotypeTags.decode",
"dataclasses.dataclass"
] | [((262, 283), 'dataclasses.dataclass', 'dataclass', ([], {'init': '(False)'}), '(init=False)\n', (271, 283), False, 'from dataclasses import dataclass\n'), ((2211, 2232), 'dataclasses.dataclass', 'dataclass', ([], {'init': '(False)'}), '(init=False)\n', (2220, 2232), False, 'from dataclasses import dataclass\n'), ((159... |
'''
Description:
version:
Author: chenhao
Date: 2021-06-09 14:17:37
'''
import copy
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from tree import head_to_tree, tree_to_adj
class DualGCNClassifier(nn.Module):
def __init__(se... | [
"torch.nn.Dropout",
"torch.bmm",
"tree.tree_to_adj",
"torch.nn.Embedding",
"torch.cat",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.diag",
"torch.Tensor",
"torch.nn.Linear",
"torch.zeros",
"torch.nn.functional.relu",
"torch.nn.LSTM",
"torch.m... | [((8939, 8964), 'torch.nn.functional.softmax', 'F.softmax', (['scores'], {'dim': '(-1)'}), '(scores, dim=-1)\n', (8948, 8964), True, 'import torch.nn.functional as F\n'), ((538, 579), 'torch.nn.Linear', 'nn.Linear', (['(in_dim * 2)', 'opt.polarities_dim'], {}), '(in_dim * 2, opt.polarities_dim)\n', (547, 579), True, 'i... |
import numpy as np
def vr_pca(X, m, eta, rate=1e-5):
n, d = X.shape
w_t = np.random.rand(d) - 0.5
w_t = w_t / np.linalg.norm(w_t)
for s in range(10):
u_t = X.T.dot(X.dot(w_t)) / n
w = w_t
for t in range(m):
i = np.random.randint(n)
_w = w + eta * (X[i... | [
"numpy.random.rand",
"numpy.random.randint",
"numpy.linalg.norm"
] | [((84, 101), 'numpy.random.rand', 'np.random.rand', (['d'], {}), '(d)\n', (98, 101), True, 'import numpy as np\n'), ((124, 143), 'numpy.linalg.norm', 'np.linalg.norm', (['w_t'], {}), '(w_t)\n', (138, 143), True, 'import numpy as np\n'), ((438, 461), 'numpy.linalg.norm', 'np.linalg.norm', (['(w_t - w)'], {}), '(w_t - w)... |
# Copyright (c) 2018, TU Wien, Department of Geodesy and Geoinformation
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# ... | [
"numpy.double",
"numpy.argsort",
"numpy.arange",
"numpy.unique",
"numpy.meshgrid",
"numpy.empty_like",
"numpy.max",
"numpy.reshape",
"numpy.int32",
"osgeo.ogr.Geometry",
"numpy.testing.assert_allclose",
"numpy.hstack",
"numpy.all",
"pygeogrids.nearest_neighbor.findGeoNN",
"numpy.asanyarr... | [((35686, 35743), 'numpy.where', 'np.where', (['(cells > max_cells - 1)', '(cells - max_cells)', 'cells'], {}), '(cells > max_cells - 1, cells - max_cells, cells)\n', (35694, 35743), True, 'import numpy as np\n'), ((35755, 35770), 'numpy.int32', 'np.int32', (['cells'], {}), '(cells)\n', (35763, 35770), True, 'import nu... |
from tensorflow.keras.callbacks import TensorBoard, ReduceLROnPlateau, EarlyStopping
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam
from nets.ssd_training import MultiboxLoss,Generator
from nets.dssd import DSSD320
from utils.utils import BBoxUtility, ModelCheckpoint
from u... | [
"matplotlib.pyplot.switch_backend",
"numpy.random.seed",
"nets.dssd.DSSD320",
"tensorflow.keras.callbacks.ReduceLROnPlateau",
"utils.anchors.get_anchors",
"utils.utils.BBoxUtility",
"tensorflow.config.experimental.set_memory_growth",
"nets.ssd_training.MultiboxLoss",
"utils.utils.ModelCheckpoint",
... | [((425, 450), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (443, 450), True, 'import matplotlib.pyplot as plt\n'), ((578, 641), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', ([], {'device_type': '"""GPU"""'}), "(dev... |
import os
import numpy as np
import torch
import torch.nn as nn
from manopth import rodrigues_layer, rotproj, rot6d
from manopth.tensutils import (th_posemap_axisang, th_with_zeros, th_pack,
subtract_flat_id, make_list)
from mano.webuser.smpl_handpca_wrapper_HAND_only import ready_argumen... | [
"torch.ones",
"mano.webuser.smpl_handpca_wrapper_HAND_only.ready_arguments",
"manopth.tensutils.th_posemap_axisang",
"numpy.zeros",
"torch.cat",
"torch.Tensor",
"torch.matmul",
"os.path.join"
] | [((1787, 1818), 'mano.webuser.smpl_handpca_wrapper_HAND_only.ready_arguments', 'ready_arguments', (['self.mano_path'], {}), '(self.mano_path)\n', (1802, 1818), False, 'from mano.webuser.smpl_handpca_wrapper_HAND_only import ready_arguments\n'), ((4333, 4425), 'torch.cat', 'torch.cat', (['[th_pose_coeffs[:, :self.rot], ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# # standardise data
import pickle
import numpy as np
from sklearn.preprocessing import StandardScaler
with open('../../dataset/05_split_xtr.p', 'rb') as f:
xtr = pickle.load(f)
# print("loaded xtr, type is {} \n and shape is {}".format(type(xtr), xtr.shape))
print... | [
"pickle.dump",
"pickle.load",
"sklearn.preprocessing.StandardScaler",
"numpy.column_stack"
] | [((458, 506), 'numpy.column_stack', 'np.column_stack', (['(xscaler.mean_, xscaler.scale_)'], {}), '((xscaler.mean_, xscaler.scale_))\n', (473, 506), True, 'import numpy as np\n'), ((217, 231), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (228, 231), False, 'import pickle\n'), ((894, 917), 'pickle.dump', 'pickle.... |
"""faster rcnn pytorch train and evaluate."""
import copy
import logging
import math
from typing import Dict, List, Tuple
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.distributed as dist
import torchvision
from codetiming import Timer
import datasetinsights.constants as const
from dat... | [
"matplotlib.pyplot.title",
"datasetinsights.evaluation_metrics.base.EvaluationMetric.create",
"torch.optim.lr_scheduler.StepLR",
"torchvision.transforms.functional.to_tensor",
"torch.utils.data.RandomSampler",
"matplotlib.pyplot.margins",
"matplotlib.pyplot.bar",
"numpy.isnan",
"numpy.random.default... | [((654, 681), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (671, 681), False, 'import logging\n'), ((10544, 10559), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (10557, 10559), False, 'import torch\n'), ((20185, 20208), 'numpy.random.default_rng', 'np.random.default_rng', ([], {}... |
#***********************************************************************#
# Copyright (C) 2010-2012 <NAME> #
# #
# This file is part of CVXPY #
# ... | [
"numpy.array"
] | [((3456, 3470), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (3464, 3470), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 23 15:56:03 2020
@author: theimovaara
"""
import numpy as np
#import scipy.integrate as spi
import scipy.stats as stats
import pandas as pd
import scipy.special as spspec
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
b1 = 10
b2 ... | [
"seaborn.set",
"numpy.arange",
"matplotlib.pyplot.plot"
] | [((297, 306), 'seaborn.set', 'sns.set', ([], {}), '()\n', (304, 306), True, 'import seaborn as sns\n'), ((337, 351), 'numpy.arange', 'np.arange', (['(100)'], {}), '(100)\n', (346, 351), True, 'import numpy as np\n'), ((415, 429), 'matplotlib.pyplot.plot', 'plt.plot', (['V', 'L'], {}), '(V, L)\n', (423, 429), True, 'imp... |
import tensorflow as tf
import numpy as np
#############################################################################################################
# Convolution Layer methods
def conv2d(name, inputs, kernel_size, padding, strides, out_channels, initializer):
layer = tf.layers.Conv2D(
out_channels,
... | [
"tensorflow.reduce_sum",
"tensorflow.nn.tanh",
"tensorflow.constant_initializer",
"tensorflow.reshape",
"tensorflow.get_variable_scope",
"numpy.linalg.svd",
"numpy.random.normal",
"tensorflow.reduce_max",
"numpy.prod",
"tensorflow.get_variable",
"tensorflow.nn.relu",
"tensorflow.summary.histog... | [((570, 596), 'tensorflow.nn.relu', 'tf.nn.relu', (['preactivations'], {}), '(preactivations)\n', (580, 596), True, 'import tensorflow as tf\n'), ((935, 961), 'tensorflow.nn.tanh', 'tf.nn.tanh', (['preactivations'], {}), '(preactivations)\n', (945, 961), True, 'import tensorflow as tf\n'), ((1323, 1362), 'tensorflow.re... |
import numpy as np
import xgboost as xgb
from sklearn.model_selection import train_test_split, GridSearchCV, RandomizedSearchCV, StratifiedKFold
from sklearn.metrics import accuracy_score
# define baseline model
def model_xgboost(layers, dropout=0.1, layer_number=None):
seed = 10
cv = StratifiedKFold(n_splits... | [
"sklearn.model_selection.StratifiedKFold",
"numpy.linspace",
"xgboost.XGBClassifier"
] | [((296, 357), 'sklearn.model_selection.StratifiedKFold', 'StratifiedKFold', ([], {'n_splits': '(10)', 'shuffle': '(True)', 'random_state': 'seed'}), '(n_splits=10, shuffle=True, random_state=seed)\n', (311, 357), False, 'from sklearn.model_selection import train_test_split, GridSearchCV, RandomizedSearchCV, StratifiedK... |
import os
import shutil
import random
import numpy as np
def set_seed(seed=None):
"""
Sets the see for all possible random state libraries
:param seed:
:return:
"""
np.random.seed(seed)
random.seed(seed)
def delete_folder(path):
"""
Deletes the folder, if exists
:param path:... | [
"os.remove",
"numpy.random.seed",
"os.path.exists",
"random.choice",
"random.random",
"random.seed",
"shutil.rmtree",
"os.listdir"
] | [((192, 212), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (206, 212), True, 'import numpy as np\n'), ((217, 234), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (228, 234), False, 'import random\n'), ((420, 440), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (434, 440... |
#!/usr/bin/env python
'''
@package ion.services.dm.ingestion
@file ion/services/dm/inventory/hdf_array_iterator.py
@author <NAME>
@brief HDFArrayIterator. Used in replay. Accepts a certain number of hdf files. Extracts the arrays out of them. Uses the ArrayIterator to
resize the arrays into blocks that are of the righ... | [
"h5py.File",
"pyon.core.exception.BadRequest",
"numpy.concatenate",
"pyon.public.log.debug",
"itertools.izip_longest",
"pyon.core.exception.NotFound",
"numpy.nanmin",
"pyon.public.log.warn",
"itertools.izip",
"pyon.public.log.exception",
"numpy.nanmax"
] | [((6854, 6887), 'pyon.public.log.warn', 'log.warn', (['array_iterators_by_name'], {}), '(array_iterators_by_name)\n', (6862, 6887), False, 'from pyon.public import log\n'), ((7081, 7113), 'itertools.izip_longest', 'itertools.izip_longest', (['*iarrays'], {}), '(*iarrays)\n', (7103, 7113), False, 'import itertools\n'), ... |
import numpy as np
def is_uniq_np1darr(x):
"""Test whether x is a 1D np array that only contains unique values."""
if not isinstance(x, np.ndarray):
return False
if not x.ndim == 1:
return False
uniqx = np.unique(x)
if not uniqx.shape[0] == x.shape[0]:
return False
r... | [
"numpy.array",
"numpy.unique"
] | [((239, 251), 'numpy.unique', 'np.unique', (['x'], {}), '(x)\n', (248, 251), True, 'import numpy as np\n'), ((1295, 1309), 'numpy.array', 'np.array', (['labs'], {}), '(labs)\n', (1303, 1309), True, 'import numpy as np\n'), ((2018, 2033), 'numpy.array', 'np.array', (['sfids'], {}), '(sfids)\n', (2026, 2033), True, 'impo... |
import numpy as np
from collections import namedtuple
def lammps_writedatafile(grid,a0,t_mag):
"""
Create a string which will be written out to the LAMMPS atom data input file.
The format is as follows (<> indicate values to be filled in):
Position data for bcc Fe edge dislocation
<#atoms> ... | [
"numpy.min",
"numpy.max"
] | [((1064, 1079), 'numpy.min', 'np.min', (['mcoords'], {}), '(mcoords)\n', (1070, 1079), True, 'import numpy as np\n'), ((1160, 1175), 'numpy.max', 'np.max', (['mcoords'], {}), '(mcoords)\n', (1166, 1175), True, 'import numpy as np\n'), ((1194, 1209), 'numpy.min', 'np.min', (['ncoords'], {}), '(ncoords)\n', (1200, 1209),... |
import torch
from torch.nn import functional as F
import numpy as np
eps = 1e-5
import torch.nn as nn
def bboxes_expand(batch, bboxes):
bboxes_next = []
for i in range(batch):
box = bboxes[i, :]
boxes = box.expand(5 * 17 * 17, 4)
bboxes_next.append(boxes)
bboxes_next = torch.cat(b... | [
"torch.ones_like",
"numpy.concatenate",
"torch.zeros_like",
"torch.min",
"torch.cat",
"torch.nn.functional.softmax",
"torch.exp",
"numpy.arange",
"torch.max",
"torch.zeros",
"torch.log",
"numpy.random.shuffle"
] | [((309, 338), 'torch.cat', 'torch.cat', (['bboxes_next'], {'dim': '(0)'}), '(bboxes_next, dim=0)\n', (318, 338), False, 'import torch\n'), ((470, 496), 'torch.nn.functional.softmax', 'F.softmax', (['pred_cls'], {'dim': '(1)'}), '(pred_cls, dim=1)\n', (479, 496), True, 'from torch.nn import functional as F\n'), ((546, 5... |
# -*- coding: utf-8 -*-
"""
SICD ortho-rectification methodology.
Examples
--------
An basic example.
.. code-block:: python
import os
from matplotlib import pyplot
from sarpy.io.complex.converter import open_complex
from sarpy.processing.ortho_rectify import NearestNeighborMethod
reader = open_... | [
"numpy.abs",
"numpy.sum",
"numpy.floor",
"numpy.linalg.norm",
"numpy.arange",
"sarpy.geometry.geocoords.wgs_84_norm",
"sarpy.io.general.slice_parsing.validate_slice_int",
"numpy.full",
"os.path.abspath",
"numpy.meshgrid",
"numpy.copy",
"logging.warning",
"numpy.isfinite",
"numpy.reshape",
... | [((5370, 5392), 'numpy.vstack', 'numpy.vstack', (['segments'], {}), '(segments)\n', (5382, 5392), False, 'import numpy\n'), ((73241, 73314), 'numpy.arange', 'numpy.arange', (['the_range[0]', 'the_range[1]', 'the_range[2]'], {'dtype': 'numpy.int64'}), '(the_range[0], the_range[1], the_range[2], dtype=numpy.int64)\n', (7... |
import mxnet as mx
import os
import sys
import subprocess
import numpy as np
import matplotlib.pyplot as plt
import tarfile
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
import numpy as np
# fix the seed
np.random.seed(42)
mx.random.seed(42)
data = np.random.rand(100,3)
label = np.r... | [
"numpy.random.seed",
"mxnet.random.seed",
"warnings.filterwarnings",
"numpy.random.randint",
"mxnet.io.NDArrayIter",
"numpy.random.rand"
] | [((141, 203), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', category=DeprecationWarning)\n", (164, 203), False, 'import warnings\n'), ((240, 258), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (254, 258), True, 'import numpy ... |
import matplotlib
matplotlib.use('Agg')
import sample_utils
import config
import parse_midas_data
import os.path
import pylab
import sys
import numpy
import sfs_utils
import diversity_utils
import gene_diversity_utils
import core_gene_utils
import gzip
import os
temporal_change_directory = '%stemporal_cha... | [
"diversity_utils.calculate_snp_differences_between",
"argparse.ArgumentParser",
"os.path.isfile",
"parse_midas_data.parse_sample_coverage_map",
"sample_utils.parse_subject_sample_map",
"numpy.zeros_like",
"sample_utils.parse_sample_order_map",
"diversity_utils.calculate_fixation_error_rate",
"calcul... | [((20, 41), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (34, 41), False, 'import matplotlib\n'), ((842, 879), 'gzip.open', 'gzip.open', (['intermediate_filename', '"""r"""'], {}), "(intermediate_filename, 'r')\n", (851, 879), False, 'import gzip\n'), ((6671, 6696), 'argparse.ArgumentParser', '... |
# -*- coding: utf-8 -*-
"""
Name : tide.py
Created on : 2018/11/03 17:00
Author : <NAME> <<EMAIL>>
Affiliation : Institute of Geophysics, CEA.
Version : 0.1.0
Copyright : Copyright (C) 2018-2020 GEOIST Development Team. All Rights Reserved.
License : Distributed under the MIT License. See ... | [
"datetime.datetime.strftime",
"matplotlib.pyplot.subplot",
"math.atan",
"matplotlib.pyplot.show",
"math.radians",
"math.sin",
"datetime.datetime",
"matplotlib.pyplot.figure",
"numpy.arange",
"collections.namedtuple",
"math.cos",
"datetime.timedelta"
] | [((11212, 11244), 'datetime.datetime', 'datetime', (['(2019)', '(11)', '(10)', '(10)', '(0)', '(0)'], {}), '(2019, 11, 10, 10, 0, 0)\n', (11220, 11244), False, 'from datetime import datetime, timedelta\n'), ((949, 1038), 'collections.namedtuple', 'namedtuple', (['"""results"""', "['model_time', 'gravity_moon', 'gravity... |
import argparse
from sklearn.externals import joblib
from src.model.nn_model_fner import Model
from src.batcher import Batcher
from src.hook import acc_hook, save_predictions
import numpy as np
from sklearn.utils import shuffle
import tensorflow as tf
import pandas as pd
from collections import defaultdict
im... | [
"sklearn.externals.joblib.dump",
"argparse.ArgumentParser",
"src.model.nn_model_fner.Model.predict",
"warnings.simplefilter",
"os.path.exists",
"tensorflow.python.keras.preprocessing.sequence.pad_sequences",
"src.batcher.Batcher",
"src.model.nn_model_fner.Model.error",
"src.hook.acc_hook",
"src.mo... | [((695, 800), 'tensorflow.python.keras.preprocessing.sequence.pad_sequences', 'pad_sequences', (['sequence'], {'maxlen': 'max_length', 'dtype': '"""int64"""', 'padding': '"""post"""', 'truncating': '"""post"""', 'value': '(0)'}), "(sequence, maxlen=max_length, dtype='int64', padding='post',\n truncating='post', valu... |
#!/usr/bin/env python
# Detección del marcador de 4 círculos
# pruébalo con:
# ./elipses0a.py --dev=dir:*.png
from umucv.stream import autoStream
import cv2 as cv
import numpy as np
from umucv.util import mkParam, putText
# Toda la maquinaria anterior de detección de elipses está disponible en umucv
from umucv.c... | [
"umucv.stream.autoStream",
"cv2.cvtColor",
"umucv.util.mkParam",
"umucv.util.putText",
"cv2.ellipse",
"numpy.arange",
"umucv.contours.detectEllipses",
"numpy.array",
"umucv.contours.extractContours",
"cv2.imshow",
"cv2.namedWindow"
] | [((368, 393), 'cv2.namedWindow', 'cv.namedWindow', (['"""elipses"""'], {}), "('elipses')\n", (382, 393), True, 'import cv2 as cv\n'), ((402, 420), 'umucv.util.mkParam', 'mkParam', (['"""elipses"""'], {}), "('elipses')\n", (409, 420), False, 'from umucv.util import mkParam, putText\n'), ((468, 480), 'umucv.stream.autoSt... |
import h5py
import numpy as np
import pyarrow.parquet as pq
import pyarrow as pa
import pandas as pd
class ParquetGenerator:
GEN_KDE_PQ_CALLED = False
GEN_PQ_TEST_CALLED = False
@classmethod
def gen_kde_pq(cls, file_name='kde.parquet', N=101):
if not cls.GEN_KDE_PQ_CALLED:
df = pd... | [
"pandas.DataFrame",
"h5py.File",
"os.path.abspath",
"os.path.exists",
"pandas.DatetimeIndex",
"pyarrow.Table.from_pandas",
"numpy.random.random",
"numpy.arange",
"tarfile.open",
"shutil.rmtree",
"pyarrow.parquet.write_table"
] | [((1425, 1500), 'pandas.DatetimeIndex', 'pd.DatetimeIndex', (["['2017-03-03 03:23', '1990-10-23', '1993-07-02 10:33:01']"], {}), "(['2017-03-03 03:23', '1990-10-23', '1993-07-02 10:33:01'])\n", (1441, 1500), True, 'import pandas as pd\n'), ((1680, 1707), 'os.path.exists', 'os.path.exists', (['"""sdf_dt.pq"""'], {}), "(... |
# Copyright 2019-2020 the ProGraML authors.
#
# Contact <NAME> <<EMAIL>>.
#
# 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... | [
"labm8.py.app.DEFINE_integer",
"labm8.py.viz.SummarizeFloats",
"labm8.py.bazelutil.DataPath",
"time.time",
"labm8.py.app.Run",
"numpy.array",
"sys.stdout.flush",
"subprocess.call"
] | [((800, 894), 'labm8.py.app.DEFINE_integer', 'app.DEFINE_integer', (['"""graph_count"""', '(100)', '"""If > 0, limit the number of graphs to benchmark."""'], {}), "('graph_count', 100,\n 'If > 0, limit the number of graphs to benchmark.')\n", (818, 894), False, 'from labm8.py import app\n'), ((931, 990), 'labm8.py.b... |
import numpy as SP
import subprocess, sys, os.path
from itertools import *
from fastlmmhpc.pyplink.snpset import *
from fastlmmhpc.pyplink.altset_list import *
import pandas as pd
import fastlmmhpc.util.preprocess as util
import logging
class Dat(object):
'''
This is a class that reads into memory from DAT/FAM... | [
"pandas.read_csv",
"logging.info",
"numpy.zeros",
"numpy.loadtxt"
] | [((1302, 1365), 'numpy.loadtxt', 'SP.loadtxt', (['famfile'], {'dtype': '"""str"""', 'usecols': '(0, 1)', 'comments': 'None'}), "(famfile, dtype='str', usecols=(0, 1), comments=None)\n", (1312, 1365), True, 'import numpy as SP\n'), ((1489, 1599), 'pandas.read_csv', 'pd.read_csv', (['mapfile'], {'delimiter': '"""\\\\s"""... |
#-*-coding:utf-8-*-
'''
DpCas-Light
|||| ||||| |||| || |||||||
|| || || || || || |||| || ||
|| || || || || || || || ||
|| || || || || ||====|| ||||||
|| || ||||| || || ||======|| ||
|| || || ... | [
"cv2.line",
"numpy.float32",
"cv2.solvePnP",
"numpy.zeros",
"cv2.projectPoints",
"cv2.Rodrigues",
"numpy.array",
"cv2.hconcat",
"cv2.decomposeProjectionMatrix"
] | [((1365, 1488), 'numpy.float32', 'np.float32', (['[[0.0, 0.4, 0.0], [0.0, 5.0, 0.0], [-2.7, -4.5, 0.0], [0.0, -5.0, 0.0], [\n 2.6, -4.0, 0.0], [5.2, -3.0, 0.0]]'], {}), '([[0.0, 0.4, 0.0], [0.0, 5.0, 0.0], [-2.7, -4.5, 0.0], [0.0, -5.0,\n 0.0], [2.6, -4.0, 0.0], [5.2, -3.0, 0.0]])\n', (1375, 1488), True, 'import ... |
import numpy as np
from probflow.applications import LinearRegression
def test_LinearRegression():
"""Tests probflow.applications.LinearRegression"""
# Data
x = np.random.randn(100, 5).astype("float32")
w = np.random.randn(5, 1).astype("float32")
y = x @ w + 1
# Create the model
model =... | [
"probflow.applications.LinearRegression",
"numpy.exp",
"numpy.random.randn"
] | [((321, 340), 'probflow.applications.LinearRegression', 'LinearRegression', (['(5)'], {}), '(5)\n', (337, 340), False, 'from probflow.applications import LinearRegression\n'), ((1277, 1318), 'probflow.applications.LinearRegression', 'LinearRegression', (['(5)'], {'heteroscedastic': '(True)'}), '(5, heteroscedastic=True... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | [
"numpy.stack",
"numpy.divide",
"numpy.load",
"numpy.minimum",
"numpy.maximum",
"numpy.transpose",
"numpy.max",
"numpy.array",
"numpy.reshape",
"os.path.join"
] | [((965, 1004), 'os.path.join', 'os.path.join', (['self.feat_path', 'file_name'], {}), '(self.feat_path, file_name)\n', (977, 1004), False, 'import os\n'), ((1052, 1070), 'numpy.load', 'np.load', (['file_path'], {}), '(file_path)\n', (1059, 1070), True, 'import numpy as np\n'), ((1793, 1812), 'numpy.array', 'np.array', ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# read initial state from Noah-MP output and write them to wrfinput
# author: <NAME>
from __future__ import absolute_import, unicode_literals, division
import numpy as np
import netCDF4 as nc
nmp2wrf_3d = {'SOIL_T':'TSLB',
'SNOW_T':'TSNO',
'... | [
"netCDF4.Dataset",
"argparse.ArgumentParser",
"numpy.errstate",
"numpy.isnan",
"numpy.where",
"numpy.swapaxes"
] | [((2385, 2472), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Copy land state from Noah-MP output to WRF."""'}), "(description=\n 'Copy land state from Noah-MP output to WRF.')\n", (2408, 2472), False, 'import argparse\n'), ((1402, 1426), 'netCDF4.Dataset', 'nc.Dataset', (['nmpfile',... |
#!/usr/bin/env python
import os, sys, time
import numpy as np
from keras import Input, models, layers, optimizers, callbacks, regularizers, initializers
from utils import split_data, calc_class_weights, to_one_hot, config_tf, net_saver, net_predictor, test_score
os.environ['MKL_NUM_THREADS'] = '3'
os.environ['OPENBLAS... | [
"keras.regularizers.l2",
"numpy.load",
"utils.test_score",
"keras.initializers.lecun_uniform",
"keras.models.Model",
"utils.to_one_hot",
"utils.net_predictor",
"numpy.set_printoptions",
"keras.optimizers.SGD",
"keras.layers.Flatten",
"keras.layers.MaxPooling1D",
"keras.callbacks.ReduceLROnPlat... | [((341, 378), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': 'np.inf'}), '(linewidth=np.inf)\n', (360, 378), True, 'import numpy as np\n'), ((2335, 2371), 'os.makedirs', 'os.makedirs', (['modeldir'], {'exist_ok': '(True)'}), '(modeldir, exist_ok=True)\n', (2346, 2371), False, 'import os, sys, time\... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Models for general analytical geometry transformations.
"""
import numbers
import numpy as np
from astropy.modeling.core import Model
from astropy import units as u
__all__ = ['ToDirectionCosines', 'FromDirectionCosines',
'SphericalToCart... | [
"numpy.arctan2",
"numpy.deg2rad",
"numpy.isfinite",
"numpy.hypot",
"numpy.sin",
"numpy.cos",
"numpy.sqrt"
] | [((722, 752), 'numpy.sqrt', 'np.sqrt', (['(1.0 + x ** 2 + y ** 2)'], {}), '(1.0 + x ** 2 + y ** 2)\n', (729, 752), True, 'import numpy as np\n'), ((3521, 3536), 'numpy.deg2rad', 'np.deg2rad', (['lon'], {}), '(lon)\n', (3531, 3536), True, 'import numpy as np\n'), ((3551, 3566), 'numpy.deg2rad', 'np.deg2rad', (['lat'], {... |
import cv2
import numpy as np
# create a blank image, black background
blank_image = np.zeros((500,1000,3), np.uint8)
text_to_show = "The quick brown fox jumps over the lazy dog"
cv2.putText(blank_image,
"<NAME> : " + text_to_show,
(20, 40),
fontFace=cv2.FONT_HERSHEY_SIMPLEX,
... | [
"cv2.putText",
"cv2.waitKey",
"cv2.imshow",
"numpy.zeros",
"cv2.destroyAllWindows"
] | [((92, 126), 'numpy.zeros', 'np.zeros', (['(500, 1000, 3)', 'np.uint8'], {}), '((500, 1000, 3), np.uint8)\n', (100, 126), True, 'import numpy as np\n'), ((192, 330), 'cv2.putText', 'cv2.putText', (['blank_image', "('<NAME> : ' + text_to_show)", '(20, 40)'], {'fontFace': 'cv2.FONT_HERSHEY_SIMPLEX', 'fontScale': '(1)', '... |
import os
from skimage import io
import glob
import cv2
from tqdm import tqdm
import os
import shutil
import numpy as np
import h5py
import sys
import pandas as pd
_ = (sys.path.append("/usr/local/lib/python3.6/site-packages"))
sys.path.insert(0,'/content/DAIN/load_functions')
from prepare_split_images import make_fol... | [
"os.mkdir",
"pandas.read_csv",
"os.walk",
"os.path.join",
"sys.path.append",
"os.path.exists",
"cv2.copyMakeBorder",
"numpy.append",
"numpy.swapaxes",
"skimage.io.imsave",
"skimage.io.imread",
"tqdm.tqdm",
"h5py.File",
"os.listdir",
"numpy.zeros",
"prepare_dataset_train_test_folders.ma... | [((170, 227), 'sys.path.append', 'sys.path.append', (['"""/usr/local/lib/python3.6/site-packages"""'], {}), "('/usr/local/lib/python3.6/site-packages')\n", (185, 227), False, 'import sys\n'), ((229, 279), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/content/DAIN/load_functions"""'], {}), "(0, '/content/DAIN/load... |
#!/usr/bin/env python
import wx
from wx import EVT_CLOSE
import wx.grid as gridlib
EVEN_ROW_COLOUR = '#CCE6FF'
GRID_LINE_COLOUR = '#ccc'
class PandasTable(wx.Frame):
def __init__(self, parent, title, df):
super(PandasTable, self).__init__(parent, title=title)
panel = wx.Panel(self, -1)
se... | [
"wx.BoxSizer",
"numpy.random.randn",
"wx.Panel",
"wx.grid.GridCellAttr",
"wx.EVT_CLOSE",
"wx.App",
"wx.Size",
"wx.grid.Grid.__init__",
"wx.grid.PyGridTableBase.__init__"
] | [((2207, 2215), 'wx.App', 'wx.App', ([], {}), '()\n', (2213, 2215), False, 'import wx\n'), ((291, 309), 'wx.Panel', 'wx.Panel', (['self', '(-1)'], {}), '(self, -1)\n', (299, 309), False, 'import wx\n'), ((399, 423), 'wx.BoxSizer', 'wx.BoxSizer', (['wx.VERTICAL'], {}), '(wx.VERTICAL)\n', (410, 423), False, 'import wx\n'... |
import os
import cly_dcgan as GAN
import numpy as np
import cv2
import tensorflow as tf
import image_util
import configparser as cfg_parser
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
cp = cfg_parser.ConfigParser()
cp.read('net.cfg')
epochs = cp.getint('repair', 'epochs')
learning_rate = cp.getfloat('repair', 'learning... | [
"numpy.random.uniform",
"image_util.get_target_img",
"tensorflow.abs",
"tensorflow.train.Saver",
"tensorflow.get_collection",
"tensorflow.global_variables_initializer",
"tensorflow.constant_initializer",
"cv2.imwrite",
"tensorflow.add",
"tensorflow.variable_scope",
"numpy.zeros",
"tensorflow.c... | [((188, 213), 'configparser.ConfigParser', 'cfg_parser.ConfigParser', ([], {}), '()\n', (211, 213), True, 'import configparser as cfg_parser\n'), ((2917, 2962), 'cly_dcgan.get_generator', 'GAN.get_generator', (['inputs_noise', '(False)', 'reuse'], {}), '(inputs_noise, False, reuse)\n', (2934, 2962), True, 'import cly_d... |
"""
Author: <NAME>
Date: 30/04/21
Copyright: This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
Dependencies: Ubuntu 18.04, Olympe, Python, OpenCV... | [
"cv2.resize",
"tensorflow.keras.models.load_model",
"cv2.putText",
"cv2.VideoWriter_fourcc",
"numpy.argmax",
"cv2.cvtColor",
"cv2.waitKey",
"numpy.expand_dims",
"cv2.VideoCapture",
"olympe.messages.ardrone3.Piloting.moveBy",
"olympe.Drone",
"numpy.array",
"olympe.messages.ardrone3.Piloting.L... | [((3148, 3177), 'tensorflow.keras.models.load_model', 'load_model', (['"""MODELS/Spear.h5"""'], {}), "('MODELS/Spear.h5')\n", (3158, 3177), False, 'from tensorflow.keras.models import load_model\n'), ((3287, 3302), 'collections.deque', 'deque', ([], {'maxlen': '(2)'}), '(maxlen=2)\n', (3292, 3302), False, 'from collect... |
import argparse
import fnmatch
import os
import re
from argparse import ArgumentParser
from pathlib import Path
import torch
from torch import nn
import numpy as np
import pandas as pd
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
from typing import Tup... | [
"argparse.ArgumentParser",
"utils.visualization.visualize_distances",
"utils.nets.MultiHeadResNet",
"utils.mmd.mmd_soft",
"utils.data.get_datamodule",
"torch.cat",
"numpy.argsort",
"pathlib.Path",
"torch.device",
"utils.visualization.visualize_labeled_vs_unlabeled",
"torch.no_grad",
"pandas.Da... | [((752, 805), 'os.environ.get', 'os.environ.get', (['"""REMOTE_PYCHARM_DEBUG_SESSION"""', '(False)'], {}), "('REMOTE_PYCHARM_DEBUG_SESSION', False)\n", (766, 805), False, 'import os\n'), ((953, 969), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (967, 969), False, 'from argparse import ArgumentParser\n... |
r"""@package motsfinder.axisym.curve.stabcalc
Compute quantities needed for the stability operator.
This is used by the ExpansionCurve to compute the stability operator in order
to evaluate its spectrum.
"""
import math
import numpy as np
__all__ = [
"StabilityCalc",
]
# Pylint incorrectly infers the return... | [
"numpy.linalg.eigvals",
"numpy.outer",
"math.pow",
"numpy.asarray",
"numpy.allclose",
"numpy.zeros",
"numpy.einsum",
"sympy.Matrix",
"numpy.array",
"numpy.matrix.transpose",
"numpy.linalg.inv",
"numpy.concatenate",
"numpy.sqrt"
] | [((4274, 4288), 'numpy.asarray', 'np.asarray', (['op'], {}), '(op)\n', (4284, 4288), True, 'import numpy as np\n'), ((5628, 5642), 'numpy.asarray', 'np.asarray', (['op'], {}), '(op)\n', (5638, 5642), True, 'import numpy as np\n'), ((7969, 7983), 'numpy.zeros', 'np.zeros', (['(4,)'], {}), '((4,))\n', (7977, 7983), True,... |
import os
import time
import numpy as np
import tifffile as tif
from scipy import stats
import matplotlib.pyplot as plt
from skimage.filters import threshold_otsu
from mpl_toolkits.axes_grid1.inset_locator import (InsetPosition)
import SimpleITK as sitk
from rivuletpy.utils.io import loadtiff3d
from rivuletpy.utils.p... | [
"matplotlib.pyplot.axes",
"SimpleITK.BinaryFillhole",
"matplotlib.pyplot.style.use",
"SimpleITK.LabelImageToLabelMapFilter",
"os.path.join",
"SimpleITK.ConnectedComponent",
"scipy.stats.Execute",
"skimage.filters.threshold_otsu",
"SimpleITK.ReadImage",
"SimpleITK.GetArrayFromImage",
"matplotlib.... | [((378, 410), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""dark_background"""'], {}), "('dark_background')\n", (391, 410), True, 'import matplotlib.pyplot as plt\n'), ((601, 628), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)', '(4)'], {'dpi': '(300)'}), '(2, 4, dpi=300)\n', (613, 628), True, 'import ma... |
import pandas as pd
import tracklib as tl
import tracklib
import numpy as np
import pandas as pd
# identify sample group
group = snakemake.wildcards.sample_group
data_groups = [group] # dummy variable
fx = snakemake.config['pixel_size_X_microns']
fy = snakemake.config['pixel_size_Y_microns']
fz = snakemake.config['p... | [
"pandas.read_csv",
"pandas.read_excel",
"numpy.where",
"numpy.intersect1d",
"pandas.concat",
"numpy.sqrt"
] | [((4872, 4894), 'pandas.concat', 'pd.concat', (['new_df_list'], {}), '(new_df_list)\n', (4881, 4894), True, 'import pandas as pd\n'), ((964, 989), 'pandas.read_csv', 'pd.read_csv', (['summary_file'], {}), '(summary_file)\n', (975, 989), True, 'import pandas as pd\n'), ((1021, 1087), 'pandas.read_excel', 'pd.read_excel'... |
import scipy.signal
import signal
import numpy as np
import rl_utils
"""
"""
class Agent(object):
def __init__(self, arch, policy, val_func, model, env, logger, policy_episodes=20, policy_steps=10, gamma1=0.0, gamma2=9.995, lam=0.98,
use_timestep=False, monitor=None, recurrent_steps=1, seg_... | [
"rl_utils.add_padding",
"numpy.zeros_like",
"numpy.sum",
"numpy.hstack",
"numpy.min",
"numpy.mean",
"numpy.max",
"numpy.var",
"numpy.concatenate"
] | [((2433, 2484), 'rl_utils.add_padding', 'rl_utils.add_padding', (['traj[k]', 'self.recurrent_steps'], {}), '(traj[k], self.recurrent_steps)\n', (2453, 2484), False, 'import rl_utils\n'), ((3976, 4020), 'numpy.concatenate', 'np.concatenate', (['[t[k] for t in trajectories]'], {}), '([t[k] for t in trajectories])\n', (39... |
import numpy as np
# setting for subplot
NUM_PLOTS = 7
FIGURE_SIZE = (12, 8)
W_SPACE = 0.01
H_SPACE = 0.01
# parameter for Gaussian smoothing
KERNEL_SIZE = 5
# parameters for Canny transform
LOW_THRESHOLD = 20
HIGH_THRESHOLD = 200
# parameters for mask (img size = 960 x 540)
VERTICES = np.array([[(0, 540), (460, 32... | [
"numpy.array"
] | [((291, 365), 'numpy.array', 'np.array', (['[[(0, 540), (460, 320), (500, 320), (960, 540)]]'], {'dtype': 'np.int32'}), '([[(0, 540), (460, 320), (500, 320), (960, 540)]], dtype=np.int32)\n', (299, 365), True, 'import numpy as np\n')] |
import cv2
from math import sqrt
import numpy as np
from parser import get
def pose_parse(file_path):
MODE = "COCO"
protoFile = "./pose_deploy_linevec.prototxt"
weightsFile = "./pose_iter_440000.caffemodel"
nPoints = 18
POSE_PAIRS = [ [1,0],[1,2],[1,5],[2,3],[3,4],[5,6],[6,7],[1,8],[8,9],[9,10],[1,... | [
"numpy.copy",
"math.sqrt",
"cv2.cvtColor",
"cv2.dnn.blobFromImage",
"cv2.imread",
"numpy.array",
"cv2.dnn.readNetFromCaffe",
"cv2.minMaxLoc",
"cv2.resize"
] | [((384, 405), 'cv2.imread', 'cv2.imread', (['file_path'], {}), '(file_path)\n', (394, 405), False, 'import cv2\n'), ((487, 501), 'numpy.copy', 'np.copy', (['frame'], {}), '(frame)\n', (494, 501), True, 'import numpy as np\n'), ((611, 659), 'cv2.dnn.readNetFromCaffe', 'cv2.dnn.readNetFromCaffe', (['protoFile', 'weightsF... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.