code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
from traitlets import Unicode
from traitlets.config import Configurable
from event import util
import sys
import numpy as np
from scipy.spatial.distance import cosine
import heapq
from collections import defaultdict
from gensim.models import KeyedVectors
def load_embedding(vocab_path, wv_path):
vocab = {}
in... | [
"scipy.spatial.distance.cosine",
"numpy.load",
"heapq.heappush",
"heapq.heappop",
"collections.defaultdict",
"event.util.load_command_line_config",
"traitlets.Unicode",
"gensim.models.KeyedVectors.load_word2vec_format"
] | [((2103, 2120), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2114, 2120), False, 'from collections import defaultdict\n'), ((2645, 2662), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2656, 2662), False, 'from collections import defaultdict\n'), ((3083, 3126), 'event.u... |
import sys
import numpy as np
import tqdm
def _run_boostrap(x1, y1, x2, y2, wgts, silent):
rng = np.random.RandomState(seed=100)
mvals = []
cvals = []
if silent:
itrl = range(500)
else:
itrl = tqdm.trange(
500, leave=False, desc='running bootstrap', ncols=79,
... | [
"numpy.sum",
"numpy.ones_like",
"tqdm.trange",
"numpy.std",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.mean",
"numpy.delete",
"numpy.sqrt"
] | [((103, 134), 'numpy.random.RandomState', 'np.random.RandomState', ([], {'seed': '(100)'}), '(seed=100)\n', (124, 134), True, 'import numpy as np\n'), ((920, 939), 'numpy.zeros', 'np.zeros', (['jackknife'], {}), '(jackknife)\n', (928, 939), True, 'import numpy as np\n'), ((950, 969), 'numpy.zeros', 'np.zeros', (['jackk... |
import argparse
import gzip
import pickle
import itertools
import time
import numpy as np
import torch
import torch.nn as nn
from torch.distributions import Categorical
from tqdm import tqdm
from lib.acquisition_fn import get_acq_fn
from lib.dataset import get_dataset
from lib.generator import get_generator
from lib.... | [
"lib.generator.get_generator",
"numpy.random.seed",
"argparse.ArgumentParser",
"lib.oracle_wrapper.get_oracle",
"torch.distributions.Categorical",
"lib.utils.env.get_tokenizer",
"numpy.argsort",
"numpy.mean",
"numpy.random.randint",
"torch.device",
"torch.no_grad",
"lib.acquisition_fn.get_acq_... | [((529, 554), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (552, 554), False, 'import argparse\n'), ((12805, 12837), 'lib.proxy.get_proxy_model', 'get_proxy_model', (['args', 'tokenizer'], {}), '(args, tokenizer)\n', (12820, 12837), False, 'from lib.proxy import get_proxy_model\n'), ((12852, ... |
import numpy as np
import xarray as xr
from functools import wraps
def _rle_filter_extreme_durations(mask, min_duration=5, max_gap=2, n_jobs=36):
"""
Allow only extreme events that meet a minimum duration requirement, allowing
for gaps.
Uses run length encoding to ensure that events meet the req... | [
"numpy.full",
"numpy.asarray",
"numpy.zeros",
"scipy.ndimage.binary_closing",
"dask.diagnostics.ProgressBar",
"numpy.isnan",
"scipy.ndimage.binary_opening",
"numpy.diff",
"numpy.array",
"xarray.DataArray",
"functools.wraps",
"numpy.isclose"
] | [((8695, 8731), 'functools.wraps', 'wraps', (['_rle_filter_extreme_durations'], {}), '(_rle_filter_extreme_durations)\n', (8700, 8731), False, 'from functools import wraps\n'), ((9021, 9061), 'functools.wraps', 'wraps', (['_ndimage_filter_extreme_durations'], {}), '(_ndimage_filter_extreme_durations)\n', (9026, 9061), ... |
import unittest
import os
from dotenv import load_dotenv
import numpy as np
from nlpaug.util.file.load import LoadUtil
from nlpaug.augmenter.spectrogram import TimeMaskingAug
class TestTimeMasking(unittest.TestCase):
@classmethod
def setUpClass(cls):
env_config_path = os.path.abspath(os.path.join(
... | [
"numpy.count_nonzero",
"nlpaug.util.file.load.LoadUtil.load_mel_spectrogram",
"os.path.dirname",
"dotenv.load_dotenv",
"os.environ.get",
"nlpaug.augmenter.spectrogram.TimeMaskingAug"
] | [((392, 420), 'dotenv.load_dotenv', 'load_dotenv', (['env_config_path'], {}), '(env_config_path)\n', (403, 420), False, 'from dotenv import load_dotenv\n'), ((706, 795), 'nlpaug.util.file.load.LoadUtil.load_mel_spectrogram', 'LoadUtil.load_mel_spectrogram', (['self.sample_wav_file'], {'n_mels': 'self.num_of_freq_channe... |
import random
import gym
import numpy as np
import tensorflow as tf
import os
from tensorflow import keras
from collections import deque
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.optimizers import Adam
from datetime import datetime
import time
# Note... | [
"tensorflow.keras.models.load_model",
"gym.make",
"tensorflow.keras.losses.MeanSquaredError",
"numpy.argmax",
"random.sample",
"tensorflow.keras.layers.Dense",
"time.time",
"random.randrange",
"tensorflow.keras.models.Sequential",
"tensorflow.keras.optimizers.Adam",
"numpy.random.rand",
"colle... | [((648, 666), 'gym.make', 'gym.make', (['ENV_NAME'], {}), '(ENV_NAME)\n', (656, 666), False, 'import gym\n'), ((3319, 3330), 'time.time', 'time.time', ([], {}), '()\n', (3328, 3330), False, 'import time\n'), ((3352, 3443), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (['"""/Users/groverj/AdvInq/C... |
#!/usr/bin/env python
'''
mcu: Modeling and Crystallographic Utilities
Copyright (C) 2019 <NAME>. All Rights Reserved.
Licensed under the Apache License, Versmiscn 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/li... | [
"spglib.get_symmetry_dataset",
"spglib.get_symmetry_from_database",
"spglib.get_spacegroup_type",
"numpy.linalg.det",
"spglib.standardize_cell",
"numpy.unique"
] | [((1099, 1123), 'numpy.linalg.det', 'np.linalg.det', (['lattice_1'], {}), '(lattice_1)\n', (1112, 1123), True, 'import numpy as np\n'), ((1139, 1163), 'numpy.linalg.det', 'np.linalg.det', (['lattice_2'], {}), '(lattice_2)\n', (1152, 1163), True, 'import numpy as np\n'), ((1583, 1696), 'spglib.get_symmetry_dataset', 'sp... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2018 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | [
"openquake.baselib.python3compat.raise_",
"numpy.random.seed",
"numpy.dtype",
"numpy.zeros",
"time.time",
"collections.defaultdict",
"operator.attrgetter",
"numpy.random.random",
"numpy.array",
"numpy.arange",
"sys.exc_info",
"openquake.hazardlib.contexts.ContextMaker",
"openquake.baselib.pe... | [((1363, 1438), 'numpy.dtype', 'numpy.dtype', (["[('eid', U64), ('grp_id', U16), ('ses', U32), ('sample', U32)]"], {}), "([('eid', U64), ('grp_id', U16), ('ses', U32), ('sample', U32)])\n", (1374, 1438), False, 'import numpy\n'), ((3876, 3897), 'numpy.array', 'numpy.array', (['all_eids'], {}), '(all_eids)\n', (3887, 38... |
import numpy as np
from pprint import pprint as pp
import matplotlib.pyplot as plt
from classes.controls import controls
class ctrs():
def __init__(self):
self.applied = []
self.last = None
self.strg = None
self.res = None
class ctr_sys():
def __init__(self,A,B,C,D=0,type='LTI... | [
"numpy.zeros",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.figure",
"numpy.array",
"pprint.pprint",
"numpy.linspace",
"numpy.matmul",
"matplotlib.pyplot.subplots_adjust",
"classes.controls.controls.obsv",
"classes.controls.controls.ctrb",
"classes.controls.controls.stbly"
] | [((341, 352), 'numpy.array', 'np.array', (['A'], {}), '(A)\n', (349, 352), True, 'import numpy as np\n'), ((370, 381), 'numpy.array', 'np.array', (['B'], {}), '(B)\n', (378, 381), True, 'import numpy as np\n'), ((399, 410), 'numpy.array', 'np.array', (['C'], {}), '(C)\n', (407, 410), True, 'import numpy as np\n'), ((42... |
import numpy as np
import random
import math
import matplotlib.pyplot as plt
class KMeans:
k = 0
x_train = np.array([])
mean_vec = np.array([])
z = np.array([])
N_z = np.array([])
vec_dim = 0
total_size = 0
def __init__ (self, k, x_train):
self.k = k
self.x... | [
"numpy.size",
"numpy.sum",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"numpy.zeros",
"numpy.array",
"numpy.dot",
"numpy.random.shuffle"
] | [((116, 128), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (124, 128), True, 'import numpy as np\n'), ((144, 156), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (152, 156), True, 'import numpy as np\n'), ((165, 177), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (173, 177), True, 'import numpy as np\n')... |
import pytorch_lightning as pl
import torch
from xmuda.models.modules import Net2DFeat, Net3DFeat, FuseNet
# from xmuda.models.lmscnet_SS import LMSCNet_SS
# from xmuda.models.lmscnet_lite import LMSCNet_SS_lite
from xmuda.models.LMSCNet import LMSCNet
from xmuda.common.utils.metrics import Metrics
import pickle
impor... | [
"xmuda.models.modules.Net3DFeat",
"xmuda.models.LMSCNet.LMSCNet",
"xmuda.common.utils.metrics.Metrics",
"numpy.array",
"xmuda.models.modules.FuseNet",
"xmuda.models.modules.Net2DFeat"
] | [((456, 467), 'xmuda.models.modules.Net2DFeat', 'Net2DFeat', ([], {}), '()\n', (465, 467), False, 'from xmuda.models.modules import Net2DFeat, Net3DFeat, FuseNet\n'), ((491, 539), 'xmuda.models.modules.Net3DFeat', 'Net3DFeat', ([], {'backbone_3d_kwargs': "{'in_channels': 1}"}), "(backbone_3d_kwargs={'in_channels': 1})\... |
# 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... | [
"delta.data.frontend.pitch.Pitch.params",
"delta.compat.rank",
"delta.compat.test.main",
"pathlib.Path",
"numpy.array",
"delta.data.frontend.read_wav.ReadWav.params"
] | [((2004, 2018), 'delta.compat.test.main', 'tf.test.main', ([], {}), '()\n', (2016, 2018), True, 'import delta.compat as tf\n'), ((1540, 1792), 'numpy.array', 'np.array', (['[[0.03881124, 0.3000031, -0.02324523], [0.006756478, 0.3000097, 0.01047742],\n [0.02455365, 0.3000154, 0.00695902], [0.02453586, 0.3000221, \n ... |
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | [
"ctypes.c_float",
"numpy.zeros",
"ctypes.c_longlong"
] | [((1571, 1605), 'numpy.zeros', 'np.zeros', (['(1, 52)'], {'dtype': 'np.uint64'}), '((1, 52), dtype=np.uint64)\n', (1579, 1605), True, 'import numpy as np\n'), ((2734, 2776), 'ctypes.c_longlong', 'c_longlong', (['self.dnnPrimitives.ctypes.data'], {}), '(self.dnnPrimitives.ctypes.data)\n', (2744, 2776), False, 'from ctyp... |
# pylint: disable=redefined-outer-name
import pytest
from numpy import testing
from stadfangaskra import lookup
my_text = """
N<NAME>i er að Háaleitisbraut 68, 103 Reykjavík en ég bý á Laugavegi 11, 101 Reykjavík
""".strip()
def test_edge_cases() -> None:
res = lookup.query("Hagasmári 1, 201 Kópavogi")
ass... | [
"stadfangaskra.lookup.query",
"numpy.testing.assert_array_equal",
"stadfangaskra.lookup.query_text_body",
"stadfangaskra.lookup.query_dataframe",
"pytest.mark.parametrize"
] | [((1206, 1344), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""query,postcode,municipality,house_nr"""', "[('Lindarbraut 25, Seltjarnarnesbær', '170', 'Seltjarnarnes', '25')]"], {}), "('query,postcode,municipality,house_nr', [(\n 'Lindarbraut 25, Seltjarnarnesbær', '170', 'Seltjarnarnes', '25')])\n", (1... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Implements the global import of all data
Created on Mon Dec 26 20:51:08 2016
@author: rwilson
"""
import numpy as np
import glob
import re
import os
import csv
from itertools import repeat
import pandas as pd
import h5py
from dateutil.parser import parse
import codec... | [
"pandas.HDFStore",
"csv.reader",
"pandas.read_csv",
"pickle.load",
"glob.glob",
"pandas.DataFrame",
"pandas.read_hdf",
"pandas.merge",
"os.path.exists",
"re.findall",
"shutil.copyfile",
"pandas.concat",
"h5py.File",
"pandas.timedelta_range",
"re.split",
"numpy.float",
"pandas.read_ex... | [((13331, 13394), 'pandas.MultiIndex.from_tuples', 'pd.MultiIndex.from_tuples', (['col_list_int'], {'names': 'DF.columns.names'}), '(col_list_int, names=DF.columns.names)\n', (13356, 13394), True, 'import pandas as pd\n'), ((13412, 13458), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'colIndex', 'index': 'DF.in... |
#!/usr/bin/python
#
# Copyright 2017 Google 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 applicable law or a... | [
"unittest.main",
"tensorflow.train.Example",
"os.path.dirname",
"numpy.zeros",
"nli.tfrecord_creator.convert_to_tfrecord",
"numpy.isclose",
"numpy.random.randint",
"numpy.random.normal",
"tensorflow.python_io.tf_record_iterator"
] | [((1805, 1820), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1818, 1820), False, 'import unittest\n'), ((1057, 1086), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(3, 3)'}), '(size=(3, 3))\n', (1073, 1086), True, 'import numpy as np\n'), ((1100, 1128), 'numpy.random.randint', 'np.random.randint', (... |
import random
from PIL import Image
from datetime import datetime
import os
import imageio
import numpy
import sys
import getopt
class Cell:
def __init__(self, x, y):
self.x = x
self.y = y
self.visited = False
self.walls = [True, True, True, True]
self.neighbours = []
... | [
"os.mkdir",
"PIL.Image.new",
"getopt.getopt",
"PIL.Image.open",
"numpy.array",
"imageio.get_writer",
"datetime.datetime.now",
"sys.exit"
] | [((2679, 2693), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (2691, 2693), False, 'from datetime import datetime\n'), ((2749, 2763), 'os.mkdir', 'os.mkdir', (['PATH'], {}), '(PATH)\n', (2757, 2763), False, 'import os\n'), ((2803, 2835), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(img_w, img_h)'], {}), ... |
import numpy as np
#import yt.mods as yt
import yt
from galaxy_analysis.static_data import \
MOLECULAR_WEIGHT, \
AMU, \
SOLAR_ABUNDANCE
from onezone import data_tables as DT
SN_YIELD_TABLE = DT.StellarYieldsTable('SNII')
WIND_YIELD_TABLE = DT.StellarYieldsTable('wind')
MASSIVE_STAR_Y... | [
"numpy.log10",
"numpy.size",
"onezone.data_tables.StellarYieldsTable"
] | [((219, 248), 'onezone.data_tables.StellarYieldsTable', 'DT.StellarYieldsTable', (['"""SNII"""'], {}), "('SNII')\n", (240, 248), True, 'from onezone import data_tables as DT\n'), ((276, 305), 'onezone.data_tables.StellarYieldsTable', 'DT.StellarYieldsTable', (['"""wind"""'], {}), "('wind')\n", (297, 305), True, 'from o... |
# Author: <NAME>
from copy import deepcopy
import numpy as np
from collections import defaultdict
from sklearn.linear_model import LinearRegression
from agent import *
from mdp import policyIteration
# Escolhe próximo estado dado uma ação
def performAction(pi, P):
def nextState(s):
ps = P[(s, pi[s]... | [
"copy.deepcopy",
"collections.defaultdict",
"sklearn.linear_model.LinearRegression",
"numpy.random.choice",
"mdp.policyIteration"
] | [((1136, 1166), 'collections.defaultdict', 'defaultdict', (['(lambda : (0.0, 0))'], {}), '(lambda : (0.0, 0))\n', (1147, 1166), False, 'from collections import defaultdict\n'), ((3590, 3608), 'collections.defaultdict', 'defaultdict', (['float'], {}), '(float)\n', (3601, 3608), False, 'from collections import defaultdic... |
# -*- coding:utf-8 -*-
#
# Provide a class to convert values to pseudo-colors
#
# External dependencies
import math
import numpy as np
# Class to map values to RGB colors
class Colormap( object ) :
# Initialization
def __init__ ( self, palette='CubeHelix' ) :
if palette == 'Jet' :
self.colormap = self.Colorma... | [
"math.sin",
"math.cos",
"numpy.clip"
] | [((2999, 3027), 'numpy.clip', 'np.clip', (['[r, g, b]', '(0.0)', '(1.0)'], {}), '([r, g, b], 0.0, 1.0)\n', (3006, 3027), True, 'import numpy as np\n'), ((2970, 2985), 'math.cos', 'math.cos', (['angle'], {}), '(angle)\n', (2978, 2985), False, 'import math\n'), ((2804, 2819), 'math.cos', 'math.cos', (['angle'], {}), '(an... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code mus... | [
"torch.mean",
"numpy.argmax",
"pyrado.utils.input_output.print_cbt",
"pyrado.exploration.stochastic_params.HyperSphereParamNoise",
"pyrado.exploration.stochastic_params.NormalParamNoise",
"numpy.max",
"pyrado.ValueErr",
"torch.max",
"torch.abs",
"torch.min"
] | [((6315, 6454), 'pyrado.exploration.stochastic_params.NormalParamNoise', 'NormalParamNoise', ([], {'param_dim': 'self._policy.num_param', 'std_init': 'expl_std_init', 'std_min': 'expl_std_min', 'use_cuda': "(self._policy.device != 'cpu')"}), "(param_dim=self._policy.num_param, std_init=expl_std_init,\n std_min=expl_... |
# Create your views here.
import docx
import json
import gensim
import numpy as np
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import render
from docx.shared import RGBColor, Inches, Pt
from nltk.tokenize import sent_tokenize, word_tokenize
from django.utils.translation i... | [
"dynamic_preferences.registries.global_preferences_registry.manager",
"django.contrib.messages.success",
"json.load",
"numpy.sum",
"django.http.HttpResponse",
"django.utils.translation.gettext",
"gensim.models.TfidfModel",
"gensim.corpora.Dictionary",
"django.contrib.auth.decorators.user_passes_test... | [((679, 716), 'dynamic_preferences.registries.global_preferences_registry.manager', 'global_preferences_registry.manager', ([], {}), '()\n', (714, 716), False, 'from dynamic_preferences.registries import global_preferences_registry\n'), ((4987, 5029), 'django.contrib.auth.decorators.user_passes_test', 'user_passes_test... |
import numpy as np
class RandomHorizontalFlip:
def __init__(self, p:float) -> None:
self.p = p
def transform(self, matrix: np.ndarray) -> np.ndarray:
matrix = matrix.transpose(2,0,1)
if np.random.rand() >= self.p:
matrix = matrix[:,:,::-1]
return matrix.transpose(1,... | [
"numpy.random.rand"
] | [((220, 236), 'numpy.random.rand', 'np.random.rand', ([], {}), '()\n', (234, 236), True, 'import numpy as np\n'), ((524, 540), 'numpy.random.rand', 'np.random.rand', ([], {}), '()\n', (538, 540), True, 'import numpy as np\n')] |
# read the detections.pkl and convert it to txt file
import os
import pickle, cPickle
import numpy as np
import math
def save_detection(filename,det_m):
"""save the detections in txt file,
as the standard format: all detections in a file,
imagename score x1 y1 x2 y2"""
fid_all= open(... | [
"math.isnan",
"numpy.square",
"numpy.zeros",
"cPickle.load",
"numpy.argmin",
"numpy.argsort",
"numpy.sort",
"numpy.cumsum",
"numpy.max",
"numpy.min",
"numpy.finfo",
"numpy.array",
"os.path.join"
] | [((2225, 2269), 'os.path.join', 'os.path.join', (['dir_det', '"""detections_2012.pkl"""'], {}), "(dir_det, 'detections_2012.pkl')\n", (2237, 2269), False, 'import os\n'), ((2314, 2335), 'cPickle.load', 'cPickle.load', (['pkl_det'], {}), '(pkl_det)\n', (2326, 2335), False, 'import pickle, cPickle\n'), ((2986, 3009), 'nu... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Test the functions in pydl.pydlutils.image.
"""
import numpy as np
from astropy.tests.helper import raises
from ..image import djs_maskinterp1, djs_maskinterp
def test_djs_maskinterp1():
y = np.array([0.0, 1.0, 2.0, 3.0, 4.... | [
"numpy.dstack",
"numpy.allclose",
"astropy.tests.helper.raises",
"numpy.zeros",
"numpy.ones",
"numpy.random.random",
"numpy.array",
"numpy.vstack"
] | [((288, 341), 'numpy.array', 'np.array', (['[0.0, 1.0, 2.0, 3.0, 4.0]'], {'dtype': 'np.float64'}), '([0.0, 1.0, 2.0, 3.0, 4.0], dtype=np.float64)\n', (296, 341), True, 'import numpy as np\n'), ((802, 820), 'numpy.allclose', 'np.allclose', (['y', 'yi'], {}), '(y, yi)\n', (813, 820), True, 'import numpy as np\n'), ((1069... |
import os
import utils
import numpy as np
import nibabel as nib
import xlrd
from xlutils.copy import copy
import tensorflow as tf
from os import scandir
import nibabel as nib
import numpy as np
input_dir = 'data/cbct2sct/trainB3'
file_paths = []
for img_file in scandir(input_dir):
if img_file.name.endswith('.nii.gz')... | [
"nibabel.Nifti1Image",
"numpy.flip",
"nibabel.load",
"os.path.basename",
"os.scandir"
] | [((263, 281), 'os.scandir', 'scandir', (['input_dir'], {}), '(input_dir)\n', (270, 281), False, 'from os import scandir\n'), ((453, 472), 'nibabel.load', 'nib.load', (['file_path'], {}), '(file_path)\n', (461, 472), True, 'import nibabel as nib\n'), ((530, 551), 'numpy.flip', 'np.flip', (['data'], {'axis': '(2)'}), '(d... |
"""
Usage:
from viscid_test_common import test_dir, plot_dir, get_test_name
test_name = get_test_name(__file__)
"""
from __future__ import print_function
import os
import sys
import numpy as np
CODE_XFAIL = 0xf0
# handle making unique plot filenames
NPLOT = {}
# useful paths
test_dir = os.path.dirname(__file__)
#... | [
"sys.path.append",
"os.mkdir",
"matplotlib.style.use",
"os.path.basename",
"os.path.isdir",
"os.path.dirname",
"os.path.realpath",
"numpy.allclose",
"sys.path.insert",
"sys.exit"
] | [((293, 318), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (308, 318), False, 'import os\n'), ((530, 565), 'os.path.realpath', 'os.path.realpath', (["(test_dir + '/../')"], {}), "(test_dir + '/../')\n", (546, 565), False, 'import os\n'), ((1217, 1242), 'matplotlib.style.use', 'style.use', (... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 21 12:53:41 2020
@author: dirk
"""
import numpy as np
def fit(X, k, alpha):
# Set some samples as original means
number_of_samples = X.shape[0]
idxs = np.random.randint(0, number_of_samples, k)
mu_start = X[idxs]
# Set two ... | [
"numpy.multiply",
"numpy.asarray",
"numpy.argmin",
"numpy.random.randint",
"numpy.mean",
"numpy.swapaxes",
"numpy.all",
"numpy.repeat"
] | [((235, 277), 'numpy.random.randint', 'np.random.randint', (['(0)', 'number_of_samples', 'k'], {}), '(0, number_of_samples, k)\n', (252, 277), True, 'import numpy as np\n'), ((374, 410), 'numpy.asarray', 'np.asarray', (['[[0, 0], [0, 0], [0, 0]]'], {}), '([[0, 0], [0, 0], [0, 0]])\n', (384, 410), True, 'import numpy as... |
#!/usr/bin/env python
# coding: utf-8
#
# Author: <NAME>
# URL: http://kazuto1011.github.io
# Created: 2017-05-18
from __future__ import print_function
import copy
import os
import sys
import json
import click
import cv2
import matplotlib
matplotlib.use('Agg')
import matplotlib.cm as cm
import numpy as np
import to... | [
"sys.path.append",
"matplotlib.colors.LinearSegmentedColormap.from_list",
"os.path.abspath",
"numpy.random.seed",
"os.getcwd",
"torch.manual_seed",
"os.path.dirname",
"torch.load",
"torchvision.transforms.ToTensor",
"PIL.Image.open",
"matplotlib.use",
"model.cc_resnet.resnet34",
"torch.devic... | [((243, 264), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (257, 264), False, 'import matplotlib\n'), ((723, 743), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (738, 743), False, 'import os\n'), ((788, 817), 'os.path.dirname', 'os.path.dirname', (['current_path'], {}), '(... |
import numpy as np
import pybullet as p
import time
import gym, gym.utils.seeding
import math
from my_pybullet_envs.inmoov_shadow_hand import InmoovShadowHand
import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
Traj = [[ 0., 0., 0., 0., 0., 0., 0., 0., 0.,... | [
"pybullet.resetJointState",
"pybullet.stepSimulation",
"my_pybullet_envs.inmoov_shadow_hand.InmoovShadowHand",
"pybullet.changeDynamics",
"pybullet.setJointMotorControl2",
"pybullet.disconnect",
"pybullet.setTimeStep",
"numpy.array",
"inspect.currentframe",
"pybullet.connect",
"os.path.join"
] | [((4430, 4446), 'pybullet.connect', 'p.connect', (['p.GUI'], {}), '(p.GUI)\n', (4439, 4446), True, 'import pybullet as p\n'), ((4448, 4474), 'pybullet.setTimeStep', 'p.setTimeStep', (['(1.0 / 480.0)'], {}), '(1.0 / 480.0)\n', (4461, 4474), True, 'import pybullet as p\n'), ((4630, 4683), 'pybullet.changeDynamics', 'p.ch... |
# sears_haack.py
#
# Created: Feb 2021, <NAME>
# Modified:
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
import SUAVE
from SUAVE.Core import Units
from SUAVE.Core import Data
import numpy as np
import ... | [
"sys.path.append",
"numpy.abs",
"SUAVE.Attributes.Gases.Air.Air",
"SUAVE.Core.Data",
"SUAVE.Input_Output.SUAVE.load",
"SUAVE.Input_Output.SUAVE.archive",
"SUAVE.Analyses.Aerodynamics.Supersonic_Zero",
"numpy.array",
"numpy.linspace",
"Concorde.vehicle_setup",
"SUAVE.Analyses.Mission.Segments.Con... | [((441, 471), 'sys.path.append', 'sys.path.append', (['"""../Vehicles"""'], {}), "('../Vehicles')\n", (456, 471), False, 'import sys\n'), ((584, 599), 'Concorde.vehicle_setup', 'vehicle_setup', ([], {}), '()\n', (597, 599), False, 'from Concorde import vehicle_setup, configs_setup\n'), ((669, 714), 'SUAVE.Analyses.Aero... |
"""
Tests for the user-facing choice model constructor.
"""
import unittest
from collections import OrderedDict
import numpy as np
import numpy.testing as npt
import pandas as pd
import pylogit
import pylogit.display_names as display_names
# Get the dictionary that maps the model type to the names of the model that... | [
"collections.OrderedDict",
"numpy.array",
"pylogit.create_choice_model"
] | [((1059, 1075), 'numpy.array', 'np.array', (['[-0.6]'], {}), '([-0.6])\n', (1067, 1075), True, 'import numpy as np\n'), ((1181, 1199), 'numpy.array', 'np.array', (['[1, 0.5]'], {}), '([1, 0.5])\n', (1189, 1199), True, 'import numpy as np\n'), ((1678, 1698), 'numpy.array', 'np.array', (['[-1, 0, 1]'], {}), '([-1, 0, 1])... |
import pytest
import numpy as np
from snc.agents.hedgehog.hh_agents.big_step_hedgehog_agent import BigStepHedgehogAgent
from snc.agents.hedgehog.hh_agents.big_step_hedgehog_gto_agent import BigStepHedgehogGTOAgent
import snc.environments.scenarios as scenarios
import snc.simulation.snc_simulator as ps
import snc.simul... | [
"snc.simulation.snc_simulator.SncSimulator",
"numpy.random.seed",
"snc.environments.scenarios.load_scenario",
"pytest.skip",
"pytest.mark.parametrize",
"snc.simulation.utils.load_agents.get_hedgehog_hyperparams"
] | [((1324, 1415), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""agent_class"""', '[BigStepHedgehogAgent, BigStepHedgehogGTOAgent]'], {}), "('agent_class', [BigStepHedgehogAgent,\n BigStepHedgehogGTOAgent])\n", (1347, 1415), False, 'import pytest\n'), ((1651, 1674), 'numpy.random.seed', 'np.random.seed', ... |
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import matplotlib.pyplot as plt
from model import BeamModel
# disable GPU because this is too small to benefit
import os
os.environ["CUDA_VISIBLE_DEVICES"]="-1"
if __name__ == '__main__':
E = 10.0e3 # 10,000 ... | [
"numpy.linspace",
"matplotlib.pyplot.subplots",
"model.BeamModel",
"matplotlib.pyplot.show"
] | [((453, 496), 'model.BeamModel', 'BeamModel', (['E', 'I', 'L', 'q', 'xLeft', 'xLeft', 'xRight'], {}), '(E, I, L, q, xLeft, xLeft, xRight)\n', (462, 496), False, 'from model import BeamModel\n'), ((607, 625), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(3)', '(1)'], {}), '(3, 1)\n', (619, 625), True, 'import matplo... |
# -*- coding: utf-8 -*-
"""
Author: <NAME>
Date: Tue Nov 16 00:33:26 2021
Convolutional Neural Network Example with TorchEnsemble
Input images are 28 x 28 x 1 (1 channel) from MNIST dataset. Output is mapped
to 10 classes (numbers 0 to 9).
https://github.com/TorchEnsemble-Community/Ensemble-Pytorch/blob/mast... | [
"torch.nn.Dropout",
"numpy.random.seed",
"torch.nn.ReLU",
"torch.utils.data.DataLoader",
"torch.manual_seed",
"torch.nn.init.xavier_uniform_",
"torch.nn.Conv2d",
"torch.nn.CrossEntropyLoss",
"torchensemble.voting.VotingClassifier",
"torch.nn.functional.softmax",
"torch.nn.BatchNorm2d",
"torch.... | [((885, 902), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (899, 902), True, 'import numpy as np\n'), ((904, 924), 'torch.manual_seed', 'torch.manual_seed', (['(1)'], {}), '(1)\n', (921, 924), False, 'import torch\n'), ((3075, 3170), 'torchensemble.voting.VotingClassifier', 'VotingClassifier', ([], {'... |
''' Author: <NAME>
Credit: <NAME>
'''
import pandas as pd
import numpy as np
import json, sys
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import cm
import seaborn as sns
class PltAnalytics(object):
@staticmethod
def plt_corr(corr_obj):
fig = plt.figure(figsize=(8,6))
... | [
"json.load",
"matplotlib.pyplot.show",
"numpy.zeros_like",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"pandas.to_datetime",
"matplotlib.pyplot.subplots_adjust",
"seaborn.diverging_palette"
] | [((4326, 4370), 'pandas.read_csv', 'pd.read_csv', (['file_name'], {'index_col': '"""video_id"""'}), "(file_name, index_col='video_id')\n", (4337, 4370), True, 'import pandas as pd\n'), ((4473, 4530), 'pandas.to_datetime', 'pd.to_datetime', (["my_df['trending_date']"], {'format': '"""%y.%d.%m"""'}), "(my_df['trending_da... |
"""style a frame using magenta_image_style_v1-256_2 model from tf hub"""
import os
import time
import matplotlib.pyplot as plt
import numpy as np
import tensorflow_hub as thub
import tensorflow as tf
from effects.base_effect import Effect
from logger import logger
EFFECT_MODEL = {
"stylize": {
"path": "... | [
"tensorflow.image.crop_to_bounding_box",
"tensorflow_hub.load",
"time.perf_counter",
"tensorflow.constant",
"time.time",
"numpy.expand_dims",
"tensorflow.nn.avg_pool",
"numpy.interp",
"tensorflow.image.resize",
"matplotlib.pyplot.imread"
] | [((1012, 1090), 'tensorflow.image.crop_to_bounding_box', 'tf.image.crop_to_bounding_box', (['image', 'offset_y', 'offset_x', 'new_shape', 'new_shape'], {}), '(image, offset_y, offset_x, new_shape, new_shape)\n', (1041, 1090), True, 'import tensorflow as tf\n'), ((1343, 1403), 'tensorflow.image.resize', 'tf.image.resize... |
import numpy as np
from tqdm import tqdm
import miepy
from functools import partial
def cluster_microscope(cluster, medium=None, orientation=None, focal_img=100, focal_obj=1, theta_obj=np.pi/2, sampling=30, source=False):
"""
Arguments:
cluster miepy cluster
medium the outer medi... | [
"miepy.coordinates.rotate_vec",
"functools.partial",
"numpy.moveaxis",
"numpy.meshgrid",
"numpy.arctan2",
"miepy.vsh.misc.trapz_2d",
"numpy.empty",
"numpy.zeros",
"miepy.coordinates.rotate_sph",
"numpy.insert",
"numpy.sin",
"numpy.exp",
"numpy.linspace",
"numpy.cos",
"numpy.sqrt",
"mie... | [((863, 904), 'functools.partial', 'partial', (['cluster.E_angular'], {'source': 'source'}), '(cluster.E_angular, source=source)\n', (870, 904), False, 'from functools import partial\n'), ((824, 845), 'miepy.materials.air', 'miepy.materials.air', ([], {}), '()\n', (843, 845), False, 'import miepy\n'), ((2241, 2281), 'n... |
"""
A module to run search algorithms on a game of tic tac toe.
"""
from functools import lru_cache
import tictactoe
from tictactoedata import X_TAKEN_CENTER_CENTER_3D, OUTSIDE_CENTER, OUTSIDE_CENTER2
import numpy as np
from hashlib import sha1
class TicTacToeWrapper:
"""
A lite wrapper class to define hasha... | [
"tictactoe.has_won_3d",
"numpy.copy",
"tictactoe.game_over_3d",
"tictactoe.available_spots",
"functools.lru_cache",
"numpy.all"
] | [((2445, 2468), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (2454, 2468), False, 'from functools import lru_cache\n'), ((914, 951), 'tictactoe.has_won_3d', 'tictactoe.has_won_3d', (['wrapper.data[0]'], {}), '(wrapper.data[0])\n', (934, 951), False, 'import tictactoe\n'), ((1535, 1... |
"""
Author: <NAME>
"""
from itertools import product
import json
import pathlib
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
import pandas as pd
import pytest
import scipy.stats
from statsmodels.tsa.exponential_smoothing.ets import ETSModel
from statsmodels.tsa.holtwinters import ... | [
"statsmodels.tsa.holtwinters.ExponentialSmoothing",
"json.load",
"pandas.date_range",
"numpy.log",
"numpy.random.randn",
"numpy.testing.assert_almost_equal",
"numpy.asarray",
"pytest.fixture",
"pytest.skip",
"numpy.random.RandomState",
"pathlib.Path",
"statsmodels.tsa.exponential_smoothing.ets... | [((2265, 2307), 'pytest.fixture', 'pytest.fixture', ([], {'params': 'ALL_MODELS_AND_DATA'}), '(params=ALL_MODELS_AND_DATA)\n', (2279, 2307), False, 'import pytest\n'), ((1745, 1810), 'itertools.product', 'product', (['ERRORS', 'TRENDS', "('add', 'mul')", 'DAMPED', "('austourists',)"], {}), "(ERRORS, TRENDS, ('add', 'mu... |
from os.path import exists
import numpy as np
from numpy.random import randn, randint, seed
from scipy.stats import norm, exponweib
from modules.experiment import *
from modules.scipy.stats import empiric
from modules.tensorflow.keras.datasets import gaussian_mixture_generate
from tensorboard import program
import webb... | [
"modules.scipy.stats.empiric",
"numpy.outer",
"numpy.abs",
"os.path.exists",
"scipy.stats.norm.pdf",
"scipy.stats.exponweib.pdf",
"numpy.random.randint",
"numpy.arange",
"modules.tensorflow.keras.datasets.gaussian_mixture_generate"
] | [((741, 762), 'numpy.arange', 'np.arange', (['(0)', '(3)', '(0.01)'], {}), '(0, 3, 0.01)\n', (750, 762), True, 'import numpy as np\n'), ((771, 793), 'numpy.arange', 'np.arange', (['(-3)', '(3)', '(0.01)'], {}), '(-3, 3, 0.01)\n', (780, 793), True, 'import numpy as np\n'), ((949, 992), 'modules.scipy.stats.empiric', 'em... |
# Copyright (c) 2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import matplotlib.pyplot as plt
import numpy
import pandas
import pickle
import sympy
import sklearn.metrics as metrics
import xgboost
import json
import os
import sys
import zipfile
# Define the an... | [
"matplotlib.pyplot.title",
"pickle.dump",
"numpy.maximum",
"pandas.read_csv",
"matplotlib.pyplot.suptitle",
"sklearn.metrics.accuracy_score",
"sympy.Matrix",
"matplotlib.pyplot.figure",
"numpy.mean",
"pandas.DataFrame.merge",
"numpy.arange",
"numpy.unique",
"pandas.DataFrame",
"xgboost.XGB... | [((3909, 4005), 'pandas.read_csv', 'pandas.read_csv', (["(dataFolder + 'hmeq_train.csv')"], {'sep': '""","""', 'usecols': '([yName] + catName + intName)'}), "(dataFolder + 'hmeq_train.csv', sep=',', usecols=[yName] +\n catName + intName)\n", (3924, 4005), False, 'import pandas\n'), ((4816, 4844), 'numpy.mean', 'nump... |
import nltk
from nltk.stem.lancaster import LancasterStemmer
from nltk.stem import PorterStemmer
from nltk.corpus import stopwords
import sys
import random
import unicodedata
import csv
import re
import numpy as np
import tensorflow as tf
import tflearn
# version 2
bullish = []
bearish = []
words = []
docs = []
train... | [
"csv.reader",
"nltk.stem.PorterStemmer",
"tflearn.fully_connected",
"random.shuffle",
"tensorflow.reset_default_graph",
"tflearn.regression",
"tflearn.DNN",
"numpy.array",
"nltk.corpus.stopwords.words",
"re.sub",
"nltk.word_tokenize"
] | [((608, 623), 'nltk.stem.PorterStemmer', 'PorterStemmer', ([], {}), '()\n', (621, 623), False, 'from nltk.stem import PorterStemmer\n'), ((642, 668), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""english"""'], {}), "('english')\n", (657, 668), False, 'from nltk.corpus import stopwords\n'), ((921, 953), 're.su... |
from abc import ABCMeta, abstractproperty
from functools import reduce
import numpy
import gem
from gem.utils import cached_property
from FIAT.reference_element import LINE, QUADRILATERAL, TENSORPRODUCT
from FIAT.quadrature import GaussLegendreQuadratureLineRule
from FIAT.quadrature_schemes import create_quadrature ... | [
"FIAT.quadrature.GaussLegendreQuadratureLineRule",
"FIAT.quadrature_schemes.create_quadrature",
"numpy.asarray",
"finat.point_set.TensorPointSet",
"functools.reduce",
"gem.Literal"
] | [((2170, 2205), 'FIAT.quadrature_schemes.create_quadrature', 'fiat_scheme', (['ref_el', 'degree', 'scheme'], {}), '(ref_el, degree, scheme)\n', (2181, 2205), True, 'from FIAT.quadrature_schemes import create_quadrature as fiat_scheme\n'), ((1969, 2020), 'FIAT.quadrature.GaussLegendreQuadratureLineRule', 'GaussLegendreQ... |
import os
import numpy as np
from numpy import random
import scipy
import copy
import matplotlib
import mnist
import pickle
import time
matplotlib.use("agg")
from matplotlib import pyplot as plt
from scipy.special import softmax
mnist_data_directory = os.path.join(os.path.dirname(__file__), "data")
# TODO add any ad... | [
"numpy.argmax",
"os.path.isfile",
"numpy.random.randint",
"numpy.arange",
"matplotlib.pyplot.gca",
"os.path.join",
"matplotlib.pyplot.close",
"os.path.dirname",
"matplotlib.use",
"mnist.MNIST",
"numpy.dot",
"os.makedirs",
"os.path.isdir",
"copy.copy",
"numpy.zeros",
"time.time",
"num... | [((137, 158), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (151, 158), False, 'import matplotlib\n'), ((267, 292), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (282, 292), False, 'import os\n'), ((404, 454), 'os.path.join', 'os.path.join', (['mnist_data_directory', ... |
# coding: utf-8
# In[1]:
# Imports
from OverwatchProcessData import get_vector_herostats
from OverwatchProcessData import get_competitive_rank, hero_stats
from OverwatchGatherData import Player, find_usernames
import numpy as np
import os
np.random.seed(3)
from sklearn.preprocessing import StandardScaler
from sk... | [
"numpy.random.seed",
"sklearn.preprocessing.StandardScaler",
"OverwatchProcessData.get_competitive_rank",
"keras.backend.abs",
"OverwatchGatherData.Player.from_web_battletag",
"numpy.mean",
"os.path.join",
"OverwatchProcessData.get_vector_herostats",
"keras.callbacks.ReduceLROnPlateau",
"matplotli... | [((245, 262), 'numpy.random.seed', 'np.random.seed', (['(3)'], {}), '(3)\n', (259, 262), True, 'import numpy as np\n'), ((2945, 2961), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (2959, 2961), False, 'from sklearn.preprocessing import StandardScaler\n'), ((3203, 3224), 'keras.backend.mea... |
#config :utf-8
import cv2
import numpy as np
img = cv2.imread("neko.jpg")
img2= cv2.imread("neko.jpg",0)#グレースケールで読み込む
min = 100
max = 250
table = np.arange(256, dtype = np.uint8)
for i in range(0,min):
table[i] = 0
for i in range(min,max):
table[i] = 255 * (i - min) / (max - min)
for... | [
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.imread",
"cv2.LUT",
"numpy.arange",
"cv2.imshow"
] | [((56, 78), 'cv2.imread', 'cv2.imread', (['"""neko.jpg"""'], {}), "('neko.jpg')\n", (66, 78), False, 'import cv2\n'), ((86, 111), 'cv2.imread', 'cv2.imread', (['"""neko.jpg"""', '(0)'], {}), "('neko.jpg', 0)\n", (96, 111), False, 'import cv2\n'), ((157, 187), 'numpy.arange', 'np.arange', (['(256)'], {'dtype': 'np.uint8... |
###############################################################################################################################
# This script implements our Prior-guided Bayesian Optimization method, presented in: https://arxiv.org/abs/1805.12168. #
################################################################... | [
"numpy.quantile",
"numpy.log",
"local_search.local_search",
"numpy.errstate",
"models.model_probabilities",
"scipy.stats.norm.cdf",
"numpy.array",
"models.compute_model_mean_and_uncertainty",
"datetime.datetime.now"
] | [((6996, 7019), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (7017, 7019), False, 'import datetime\n'), ((7930, 7968), 'numpy.array', 'np.array', (['prior_good'], {'dtype': 'np.float64'}), '(prior_good, dtype=np.float64)\n', (7938, 7968), True, 'import numpy as np\n'), ((7985, 8027), 'numpy.array... |
import time
import torch
import numpy as np
import matplotlib.pyplot as plt
def test_model(episode, agent, horizon=None):
"""
Test the agent's model by predicting future states and rewards and comparing
with those from the environment.
Args:
episode (dict): a collected episode
agent (... | [
"matplotlib.pyplot.subplot",
"util.plot_util.load_checkpoint",
"argparse.ArgumentParser",
"torch.stack",
"ipdb.set_trace",
"time.time",
"matplotlib.pyplot.figure",
"numpy.arange",
"util.env_util.create_env",
"lib.create_agent"
] | [((1100, 1111), 'time.time', 'time.time', ([], {}), '()\n', (1109, 1111), False, 'import time\n'), ((5704, 5716), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (5714, 5716), True, 'import matplotlib.pyplot as plt\n'), ((6342, 6354), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (6352, 6354),... |
import logging
from typing import Union
import numpy as np
import tensorflow as tf
from .external import AbstractEstimator, EstimatorAll, ESTIMATOR_PARAMS, InputData, Model
from .external import data_utils
from .external import closedform_nb_glm_logmu, closedform_nb_glm_logphi
from .estimator_graph import EstimatorGr... | [
"numpy.log",
"numpy.zeros",
"numpy.expand_dims",
"numpy.all",
"numpy.where",
"numpy.broadcast_to",
"logging.getLogger"
] | [((418, 445), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (435, 445), False, 'import logging\n'), ((2546, 2587), 'numpy.expand_dims', 'np.expand_dims', (['size_factors_init'], {'axis': '(1)'}), '(size_factors_init, axis=1)\n', (2560, 2587), True, 'import numpy as np\n'), ((2620, 2737),... |
from setuptools import setup, find_packages
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy
extensions = [
Extension(
"piqmc.sa", ["src/sa.pyx"],
include_dirs=[numpy.get_include()],
extra_compile_args=['-fopenmp'],
extra_link_args=['-fop... | [
"numpy.get_include",
"setuptools.find_packages"
] | [((688, 703), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (701, 703), False, 'from setuptools import setup, find_packages\n'), ((227, 246), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (244, 246), False, 'import numpy\n'), ((409, 428), 'numpy.get_include', 'numpy.get_include', ([], {})... |
import pandas as pd
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from pressing_scales_common_tones import scale_dict
def is_brighter(a, b):
assert(len(a) == len(b))
a_only = set(a).difference(set(b))
b_only = set(b).difference(set(a))
assert(len(a_only) == len(b_only) == 1)
... | [
"pressing_scales_common_tones.scale_dict.items",
"matplotlib.pyplot.show",
"pandas.MultiIndex.from_tuples",
"networkx.from_pandas_adjacency",
"numpy.zeros",
"networkx.draw_kamada_kawai"
] | [((507, 525), 'pressing_scales_common_tones.scale_dict.items', 'scale_dict.items', ([], {}), '()\n', (523, 525), False, 'from pressing_scales_common_tones import scale_dict\n'), ((2252, 2276), 'numpy.zeros', 'np.zeros', (['(n_row, n_row)'], {}), '((n_row, n_row))\n', (2260, 2276), True, 'import numpy as np\n'), ((2290,... |
import os, glob, numpy as np
from mcni.utils import conversion
Mn=1.67e-27 #Mass of Neutrons (kg)
h=6.60e-34 #Planck's const (Js)
CF=(h*1e7)/Mn #(3.952) time should be in milisecond and wavelength should be in angstrom
def tof_from_d( d, angle, l1=14.699, l2=0.3, l3=0.5, xA=0.0, yA=0.0,zA=0.0):
"angle: in degre... | [
"numpy.deg2rad",
"numpy.sin",
"numpy.linalg.norm",
"numpy.array",
"numpy.cos",
"numpy.sqrt"
] | [((399, 422), 'numpy.deg2rad', 'np.deg2rad', (['(angle * 1.0)'], {}), '(angle * 1.0)\n', (409, 422), True, 'import os, glob, numpy as np\n'), ((753, 781), 'numpy.sqrt', 'np.sqrt', (['((1 - cos2theta) / 2)'], {}), '((1 - cos2theta) / 2)\n', (760, 781), True, 'import os, glob, numpy as np\n'), ((343, 386), 'numpy.sqrt', ... |
from tensorflow.keras.datasets import mnist #Библиотека с базой Mnist
from tensorflow.keras.models import Sequential, model_from_json # Подлючаем класс создания модели Sequential
from tensorflow.keras.layers import Dense # Подключаем класс Dense - полносвязный слой
from tensorflow.keras.optimizers import Adam # Подключ... | [
"numpy.argmax",
"numpy.expand_dims",
"tensorflow.keras.preprocessing.image.load_img",
"numpy.append",
"numpy.array",
"tensorflow.keras.models.model_from_json"
] | [((727, 761), 'tensorflow.keras.models.model_from_json', 'model_from_json', (['loaded_model_json'], {}), '(loaded_model_json)\n', (742, 761), False, 'from tensorflow.keras.models import Sequential, model_from_json\n'), ((1087, 1108), 'numpy.argmax', 'np.argmax', (['prediction'], {}), '(prediction)\n', (1096, 1108), Tru... |
"Test functions."
import warnings
import numpy as np
from numpy.testing import assert_equal
import bottleneck as bn # noqa
from .functions import all_functions
DTYPES = [np.float64, np.float32, np.int64, np.int32]
nan = np.nan
def arrays(dtypes=DTYPES, nans=True):
"Iterator that yield arrays to use for unit t... | [
"warnings.simplefilter",
"numpy.errstate",
"numpy.arange",
"warnings.catch_warnings",
"numpy.testing.assert_equal"
] | [((610, 638), 'numpy.arange', 'np.arange', (['size'], {'dtype': 'dtype'}), '(size, dtype=dtype)\n', (619, 638), True, 'import numpy as np\n'), ((1352, 1381), 'numpy.errstate', 'np.errstate', ([], {'invalid': '"""ignore"""'}), "(invalid='ignore')\n", (1363, 1381), True, 'import numpy as np\n'), ((2044, 2103), 'numpy.tes... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__copyright__ = "Copyright 2019-, Anal Kumar"
__version__ = "0.0.3"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.ravel",
"matplotlib.pyplot.legend",
"scipy.optimize.curve_fit",
"numpy.argsort",
"numpy.min",
"numpy.max",
"numpy.array",
"numpy.arange",
"numpy.linspace",
"numpy.exp",
"numpy.random.rand"
] | [((1129, 1147), 'numpy.array', 'np.array', (['restrict'], {}), '(restrict)\n', (1137, 1147), True, 'import numpy as np\n'), ((1198, 1207), 'numpy.min', 'np.min', (['y'], {}), '(y)\n', (1204, 1207), True, 'import numpy as np\n'), ((1219, 1228), 'numpy.max', 'np.max', (['y'], {}), '(y)\n', (1225, 1228), True, 'import num... |
# USAGE
# python /home/nmorales/cxgn/DroneImageScripts/CNN/PredictKerasCNN.py --input_image_label_file /folder/myimagesandlabels.csv --output_model_file_path /folder/mymodel.h5 --outfile_path /export/myresults.csv
# import the necessary packages
import sys
import argparse
import csv
import imutils
import cv2
import n... | [
"matplotlib.pyplot.title",
"argparse.ArgumentParser",
"pandas.read_csv",
"numpy.ones",
"numpy.clip",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.zeros_like",
"matplotlib.pyplot.imshow",
"cv2.resize",
"tensorflow.keras.models.load_model",
"csv.writer",
"CNNProcessData.CNNProcessData",
... | [((2534, 2559), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2557, 2559), False, 'import argparse\n'), ((6049, 6207), 'pandas.read_csv', 'pd.read_csv', (['input_file'], {'sep': '""","""', 'header': '(0)', 'index_col': '(False)', 'usecols': "['stock_id', 'image_path', 'image_type', 'day', 'dr... |
import numpy as np
from math import gamma
import scipy.stats as ss
from copy import deepcopy
from includes.utils import *
from blockchain_network.simulation import Simulator
class NroEngine:
ID_POS = 0
ID_FIT = 1
def __init__(self, population_size=None, epochs=None, num_simulation_each_solution=None, n_... | [
"numpy.random.uniform",
"copy.deepcopy",
"numpy.subtract",
"numpy.log",
"numpy.random.rand",
"blockchain_network.simulation.Simulator",
"math.gamma",
"numpy.sin",
"numpy.array",
"numpy.random.normal",
"numpy.random.choice",
"numpy.linalg.norm"
] | [((3262, 3292), 'copy.deepcopy', 'deepcopy', (['sorted_pop[id_worst]'], {}), '(sorted_pop[id_worst])\n', (3270, 3292), False, 'from copy import deepcopy\n'), ((4060, 4079), 'numpy.random.uniform', 'np.random.uniform', ([], {}), '()\n', (4077, 4079), True, 'import numpy as np\n'), ((4098, 4117), 'numpy.random.uniform', ... |
import cv2
import sys
import math
import numpy as np
from scipy.linalg import null_space
from numpy.linalg import cholesky, inv, svd
# TEMP GLOBALS:
points = []
def get_point(event, x, y, flags, params):
global points
if event == cv2.EVENT_LBUTTONDOWN:
points.append([x, y, 1])
def get_points(img, threshold,... | [
"numpy.linalg.svd",
"numpy.linalg.norm",
"cv2.imshow",
"numpy.copy",
"numpy.genfromtxt",
"cv2.setMouseCallback",
"cv2.destroyAllWindows",
"numpy.linalg.cholesky",
"math.ceil",
"cv2.waitKey",
"numpy.cross",
"numpy.linalg.inv",
"numpy.linalg.lstsq",
"numpy.float32",
"math.floor",
"numpy.... | [((785, 833), 'cv2.perspectiveTransform', 'cv2.perspectiveTransform', (['corners_bef', 'transform'], {}), '(corners_bef, transform)\n', (809, 833), False, 'import cv2\n'), ((1029, 1068), 'math.floor', 'math.floor', (['(xmin - corners_aft[0, 0, 0])'], {}), '(xmin - corners_aft[0, 0, 0])\n', (1039, 1068), False, 'import ... |
"""Functions for extraction the features of the caricature image or visual face image for t-sne visualisation.
"""
# MIT License
#
# Copyright (c) 2019 <NAME>
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
import ... | [
"matplotlib.pyplot.title",
"argparse.ArgumentParser",
"matplotlib.pyplot.figure",
"facenet_ext.get_image_paths_and_labels_cavi",
"tensorflow.get_default_graph",
"os.path.join",
"sys.path.append",
"datetime.datetime.now",
"facenet_ext.load_model",
"matplotlib.pyplot.show",
"math.ceil",
"matplot... | [((638, 663), 'sys.path.append', 'sys.path.append', (['"""./util"""'], {}), "('./util')\n", (653, 663), False, 'import sys\n'), ((6993, 7005), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (7003, 7005), True, 'import matplotlib.pyplot as plt\n'), ((7010, 7041), 'matplotlib.pyplot.plot', 'plt.plot', (['fpr... |
import cv2
import csv
import random
import numpy as np
import tensorflow as tf
encoding = '123456789'
labels_file = 'labels.csv'
img_list = []
label_list = []
with open(labels_file, newline='') as csvfile:
reader = csv.DictReader(csvfile)
fieldnames = reader.fieldnames
for row in reader:
img_list... | [
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"csv.DictReader",
"tensorflow.keras.preprocessing.image.i... | [((767, 788), 'tensorflow.keras.Sequential', 'tf.keras.Sequential', ([], {}), '()\n', (786, 788), True, 'import tensorflow as tf\n'), ((1592, 1701), 'tensorflow.keras.optimizers.schedules.ExponentialDecay', 'tf.keras.optimizers.schedules.ExponentialDecay', (['initial_learning_rate'], {'decay_steps': '(100000)', 'decay_... |
from __future__ import annotations
import qimpy as qp
import numpy as np
import torch
from ._read_upf import _read_upf
from typing import Optional
class Pseudopotential:
"""Specification of electron-ion interactions. Contains
for local potential, nonlocal projectors and atomic orbitals.
Currently supports... | [
"torch.erf",
"qimpy.ions.RadialFunction.transform",
"qimpy.ions.PseudoQuantumNumbers",
"numpy.sqrt"
] | [((2662, 2716), 'qimpy.ions.PseudoQuantumNumbers', 'qp.ions.PseudoQuantumNumbers', (['self.beta.l', 'self.j_beta'], {}), '(self.beta.l, self.j_beta)\n', (2690, 2716), True, 'import qimpy as qp\n'), ((2740, 2792), 'qimpy.ions.PseudoQuantumNumbers', 'qp.ions.PseudoQuantumNumbers', (['self.psi.l', 'self.j_psi'], {}), '(se... |
import numpy as np
from scipy import sparse as sp
from tensorly.decomposition import parafac
from sklearn.cluster import KMeans
import timeit
user_tfidf = None #tfidf values per user
user_id_dict = None #numeric_index->id eg. 0->10117222@N04
user_col_dict = None #term->numeric_index eg. argentina->3
user_row_dict = No... | [
"numpy.load",
"scipy.sparse.load_npz",
"timeit.default_timer",
"sklearn.cluster.KMeans",
"numpy.zeros",
"tensorly.decomposition.parafac",
"numpy.argwhere"
] | [((1419, 1456), 'scipy.sparse.load_npz', 'sp.load_npz', (['"""users/tfidf_sparse.npz"""'], {}), "('users/tfidf_sparse.npz')\n", (1430, 1456), True, 'from scipy import sparse as sp\n'), ((1644, 1682), 'scipy.sparse.load_npz', 'sp.load_npz', (['"""images/tfidf_sparse.npz"""'], {}), "('images/tfidf_sparse.npz')\n", (1655,... |
"""Skeleton of a handler."""
from typing import Tuple
import os
import numpy
from rasterio.io import MemoryFile
from rio_tiler import main
from rio_tiler_mvt.mvt import encoder as mvtEncoder
from urllib.request import urlopen
from lambda_proxy.proxy import API
APP = API(name="satellite-3d")
@APP.route(
"/<... | [
"lambda_proxy.proxy.API",
"rio_tiler.main.tile",
"rasterio.io.MemoryFile",
"rio_tiler_mvt.mvt.encoder",
"urllib.request.urlopen",
"numpy.concatenate"
] | [((274, 298), 'lambda_proxy.proxy.API', 'API', ([], {'name': '"""satellite-3d"""'}), "(name='satellite-3d')\n", (277, 298), False, 'from lambda_proxy.proxy import API\n'), ((775, 821), 'rio_tiler.main.tile', 'main.tile', (['address', 'x', 'y', 'z'], {'tilesize': 'tilesize'}), '(address, x, y, z, tilesize=tilesize)\n', ... |
import numpy as np
import regreg.api as rr
import nose.tools as nt
def test_lasso_path():
X = np.random.standard_normal((100,5))
Z = np.zeros((100,10))
Y = np.random.standard_normal(100)
Z[:,5:] = -X
Z[:,:5] = X
lasso1 = rr.lasso.squared_error(X,Y, nstep=12)
lasso2 = rr.lasso.squared_erro... | [
"numpy.zeros_like",
"regreg.api.lasso.squared_error",
"numpy.zeros",
"numpy.random.standard_normal",
"numpy.arange",
"numpy.linalg.norm",
"regreg.api.nesta_path.squared_error",
"regreg.api.nonnegative.linear",
"numpy.testing.dec.skipif"
] | [((1049, 1076), 'numpy.testing.dec.skipif', 'np.testing.dec.skipif', (['(True)'], {}), '(True)\n', (1070, 1076), True, 'import numpy as np\n'), ((100, 135), 'numpy.random.standard_normal', 'np.random.standard_normal', (['(100, 5)'], {}), '((100, 5))\n', (125, 135), True, 'import numpy as np\n'), ((143, 162), 'numpy.zer... |
from unittest import TestCase
import numpy as np
import pyroland.cmd
class CmdTests(TestCase):
def test_basic(self):
cmd = pyroland.cmd.RMDCommander()
def test_normal(self):
cmd = pyroland.cmd.RMDCommander()
d = 10
cmd.set_feed(15)
cmd.relXYZ(d, 0, 0)
cm... | [
"numpy.sin",
"numpy.cos",
"numpy.linspace"
] | [((1024, 1053), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(93)'], {}), '(0, 2 * np.pi, 93)\n', (1035, 1053), True, 'import numpy as np\n'), ((1401, 1430), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(93)'], {}), '(0, 2 * np.pi, 93)\n', (1412, 1430), True, 'import numpy as np\n'), ((1449, 1... |
from __future__ import print_function
import os
import torch
import torch.backends.cudnn as cudnn
import numpy as np
from utils.timer import Timer
import glob
import PIL.Image as Image
import random
from interface import compare_vector, Detect, Reid
import cv2
import multiprocessing
from multiprocessing import Process,... | [
"multiprocessing.Queue",
"torch.device",
"glob.glob",
"zmq.Context",
"cv2.cvtColor",
"configparser.ConfigParser",
"interface.compare_vector",
"numpy.asarray",
"time.sleep",
"torch.set_grad_enabled",
"signal.signal",
"interface.Reid",
"sys.exit",
"time.time",
"os.kill",
"cv2.VideoCaptur... | [((526, 533), 'utils.timer.Timer', 'Timer', ([], {}), '()\n', (531, 533), False, 'from utils.timer import Timer\n'), ((543, 550), 'utils.timer.Timer', 'Timer', ([], {}), '()\n', (548, 550), False, 'from utils.timer import Timer\n'), ((823, 833), 'sys.exit', 'sys.exit', ([], {}), '()\n', (831, 833), False, 'import sys\n... |
## Standard Library Imports
## Library Imports
import numpy as np
import scipy
from scipy import signal
from IPython.core import debugger
breakpoint = debugger.set_trace
## Local Imports
from .np_utils import vectorize_tensor, unvectorize_tensor, to_nparray, get_extended_domain, extend_tensor_circularly
from .shared_... | [
"numpy.fft.rfft",
"numpy.abs",
"numpy.sum",
"numpy.argmax",
"numpy.random.randint",
"numpy.arange",
"numpy.exp",
"numpy.sin",
"numpy.round",
"numpy.fft.irfft",
"numpy.power",
"numpy.fft.fft",
"scipy.special.erfc",
"numpy.ones_like",
"numpy.ceil",
"numpy.roll",
"numpy.median",
"nump... | [((1573, 1600), 'numpy.argmax', 'np.argmax', (['corrf'], {'axis': 'axis'}), '(corrf, axis=axis)\n', (1582, 1600), True, 'import numpy as np\n'), ((2012, 2026), 'numpy.zeros', 'np.zeros', (['(N,)'], {}), '((N,))\n', (2020, 2026), True, 'import numpy as np\n'), ((2234, 2246), 'numpy.argmax', 'np.argmax', (['w'], {}), '(w... |
"""
Created on Feb 27, 2017
@author: <NAME>
Training and Testing Code for Subactivity LSTM
"""
from __future__ import print_function
import numpy as np
import json
import h5py
import glob
import scipy.io
import os
from keras.preprocessing import sequence
from keras.preprocessing.image import ImageDataGenerator
from... | [
"keras.models.load_model",
"keras.utils.visualize_util.plot",
"json.dump",
"json.load",
"numpy.random.seed",
"os.mkdir",
"keras.layers.Activation",
"keras.preprocessing.sequence.pad_sequences",
"keras.layers.LSTM",
"numpy.transpose",
"os.path.exists",
"keras.layers.Dense",
"numpy.array",
"... | [((1005, 1039), 'glob.glob', 'glob.glob', (["(path_skeleton + '*.mat')"], {}), "(path_skeleton + '*.mat')\n", (1014, 1039), False, 'import glob\n'), ((2857, 2891), 'glob.glob', 'glob.glob', (["(path_skeleton + '*.mat')"], {}), "(path_skeleton + '*.mat')\n", (2866, 2891), False, 'import glob\n'), ((3965, 3997), 'numpy.r... |
import numpy as np
from PuzzleLib import Config
from PuzzleLib.Backend import gpuarray
from PuzzleLib.Modules.Module import ModuleError
from PuzzleLib.Modules.ConvND import ConvND
class Conv3D(ConvND):
def __init__(self, inmaps, outmaps, size, stride=1, pad=0, dilation=1, wscale=1.0, useBias=True,
name=None, ... | [
"numpy.sum",
"PuzzleLib.Backend.gpuarray.to_gpu",
"numpy.random.randn",
"numpy.empty",
"numpy.zeros",
"numpy.random.normal",
"PuzzleLib.Modules.Module.ModuleError",
"PuzzleLib.Cost.MSE.MSE"
] | [((3031, 3056), 'PuzzleLib.Backend.gpuarray.to_gpu', 'gpuarray.to_gpu', (['hostData'], {}), '(hostData)\n', (3046, 3056), False, 'from PuzzleLib.Backend import gpuarray\n'), ((3257, 3331), 'numpy.zeros', 'np.zeros', ([], {'shape': '(batchsize, inmaps, d + 2 * pad, h + 2 * pad, w + 2 * pad)'}), '(shape=(batchsize, inmap... |
import argparse
import six
import chainer
from chainer import training
from chainer.training import extensions
import net
import utils
import os
import json
import datetime
import random
import numpy as np
def main():
current_datetime = '{}'.format(datetime.datetime.today())
parser = argparse.ArgumentPar... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"six.moves.zip",
"chainer.iterators.SerialIterator",
"os.path.join",
"chainer.training.extensions.LogReport",
"os.path.abspath",
"chainer.cuda.cupy.random.seed",
"chainer.training.extensions.Evaluator",
"random.seed",
"utils.get_vocab",
"chainer.... | [((300, 325), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (323, 325), False, 'import argparse\n'), ((1601, 1623), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (1612, 1623), False, 'import random\n'), ((1628, 1653), 'numpy.random.seed', 'np.random.seed', (['args.seed'],... |
# Timesheet generation script for Hiwis.
###
### Use following section to set your personal default values!
###
default_name = '<<NAME>>'
default_unit_of_organisation = '<your organisation>'
default_hours = 23
default_days_of_week = [0, 1, 2, 3, 4]
default_start_hour = 8
default_end_hour = 18
default_max_hours = 6
def... | [
"os.remove",
"argparse.ArgumentParser",
"random.uniform",
"random.shuffle",
"datetime.date",
"datetime.date.today",
"random.choice",
"numpy.arange",
"datetime.timedelta",
"calendar.monthrange",
"datetime.time",
"base64.decodebytes",
"holidays.DE"
] | [((777, 907), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate University Timesheets."""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Generate University Timesheets.',\n formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n", (800, 907), F... |
import numpy as np
import pandas as pd
import tqdm
def classifier_outperformance(a_metric_samples, b_metric_samples, margin=0.):
"""calculate the chance that a outperforms b by a given margin.
Input: samples from the metrics for classifiers a and b"""
greater = (a_metric_samples - margin) > b_metric_sampl... | [
"pandas.DataFrame",
"numpy.arange"
] | [((932, 955), 'pandas.DataFrame', 'pd.DataFrame', (['positions'], {}), '(positions)\n', (944, 955), True, 'import pandas as pd\n'), ((813, 840), 'numpy.arange', 'np.arange', (['(1)', '(no_models + 1)'], {}), '(1, no_models + 1)\n', (822, 840), True, 'import numpy as np\n'), ((728, 749), 'pandas.DataFrame', 'pd.DataFram... |
# Standard imports:
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import random_split
from torch_geometric.data import DataLoader
from torch_geometric.transforms import Compose
from pathlib import Path
# Custom data loader and model:
from data import ProteinPai... | [
"numpy.random.seed",
"data.RandomRotationPairAtoms",
"torch.manual_seed",
"data_iteration.iterate_surface_precompute",
"torch.load",
"Arguments.parser.parse_args",
"data_iteration.iterate",
"model.dMaSIF",
"data.ProteinPairsSurfaces",
"torch_geometric.data.DataLoader",
"torch.cuda.manual_seed_al... | [((643, 662), 'Arguments.parser.parse_args', 'parser.parse_args', ([], {}), '()\n', (660, 662), False, 'from Arguments import parser\n'), ((917, 945), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (934, 945), False, 'import torch\n'), ((946, 983), 'torch.cuda.manual_seed_all', 'torch.c... |
#!/usr/bin/env python3
"""Contains the Car class.
License:
BSD 3-Clause License
Copyright (c) 2021, Autonomous Robotics Club of Purdue (Purdue ARC)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are m... | [
"pybullet.getQuaternionFromEuler",
"math.tan",
"pybullet.getBasePositionAndOrientation",
"pybullet.createConstraint",
"numpy.zeros",
"math.sin",
"numpy.array",
"pybullet.changeConstraint",
"pybullet.getBaseVelocity",
"math.cos",
"pybullet.getEulerFromQuaternion"
] | [((2186, 2216), 'numpy.zeros', 'np.zeros', (['(2,)'], {'dtype': 'np.float'}), '((2,), dtype=np.float)\n', (2194, 2216), True, 'import numpy as np\n'), ((2235, 2273), 'numpy.array', 'np.array', (['[[-8.0, -4.199], [8.0, 0.0]]'], {}), '([[-8.0, -4.199], [8.0, 0.0]])\n', (2243, 2273), True, 'import numpy as np\n'), ((2289... |
'''
Camscanner with python
code contributed by <NAME>
'''
import cv2
import numpy as np
import mapper
image=cv2.imread("IMG-20200421-WA0017.jpg")
image=cv2.resize(image,(1300,800))
orig=image.copy()
cv2.imshow("Actual image",image)
gray=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
b... | [
"cv2.GaussianBlur",
"cv2.Canny",
"cv2.findContours",
"cv2.warpPerspective",
"cv2.approxPolyDP",
"cv2.cvtColor",
"cv2.getPerspectiveTransform",
"numpy.float32",
"cv2.arcLength",
"cv2.imread",
"mapper.mapp",
"cv2.imshow",
"cv2.resize"
] | [((143, 180), 'cv2.imread', 'cv2.imread', (['"""IMG-20200421-WA0017.jpg"""'], {}), "('IMG-20200421-WA0017.jpg')\n", (153, 180), False, 'import cv2\n'), ((191, 221), 'cv2.resize', 'cv2.resize', (['image', '(1300, 800)'], {}), '(image, (1300, 800))\n', (201, 221), False, 'import cv2\n'), ((240, 273), 'cv2.imshow', 'cv2.i... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import nose.tools
from nose.tools import assert_raises
from numpy.testing import assert_almost_equal
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
imp... | [
"matplotlib.ticker.LogFormatterExponent",
"nose.tools.assert_true",
"numpy.arange",
"matplotlib.ticker.SymmetricalLogLocator",
"matplotlib.ticker.ScalarFormatter",
"matplotlib.ticker.LogitLocator",
"matplotlib.ticker.MaxNLocator",
"matplotlib.ticker.IndexLocator",
"warnings.catch_warnings",
"matpl... | [((456, 484), 'matplotlib.ticker.MaxNLocator', 'mticker.MaxNLocator', ([], {'nbins': '(5)'}), '(nbins=5)\n', (475, 484), True, 'import matplotlib.ticker as mticker\n'), ((502, 543), 'numpy.array', 'np.array', (['[20.0, 40.0, 60.0, 80.0, 100.0]'], {}), '([20.0, 40.0, 60.0, 80.0, 100.0])\n', (510, 543), True, 'import num... |
# -*- coding: utf-8 -*-
# Copyright (c) St. Anne's University Hospital in Brno. International Clinical
# Research Center, Biomedical Engineering. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# Std imports
# Third pary imports
import numpy as np
from scipy.signal impo... | [
"scipy.signal.coherence",
"numpy.max",
"numpy.mean"
] | [((2264, 2312), 'scipy.signal.coherence', 'coherence', (['sig1_wl', 'sig2_wl', 'fs'], {'nperseg': 'fft_win'}), '(sig1_wl, sig2_wl, fs, nperseg=fft_win)\n', (2273, 2312), False, 'from scipy.signal import coherence\n'), ((2371, 2386), 'numpy.max', 'np.max', (['coh_win'], {}), '(coh_win)\n', (2377, 2386), True, 'import nu... |
#!/usr/bin/env python
# Copyright 2017 <NAME>, ASL, ETH Zurich, Switzerland
# Copyright 2017 <NAME>, ASL, ETH Zurich, Switzerland
# Copyright 2017 <NAME>, ASL, ETH Zurich, Switzerland
# A good introduction to TensorFlow layers and CNN can be found here: https://www.tensorflow.org/tutorials/layers
# This exercise has ... | [
"batchmaker.Batchmaker",
"argparse.ArgumentParser",
"numpy.asarray",
"utilities.load_dataset",
"time.time",
"numpy.eye",
"cnn_model.CNNModel"
] | [((768, 794), 'utilities.load_dataset', 'load_dataset', (['DATASET_PATH'], {}), '(DATASET_PATH)\n', (780, 794), False, 'from utilities import load_dataset, plot_images\n'), ((889, 914), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (912, 914), False, 'import argparse\n'), ((1323, 1333), 'cnn_m... |
import matplotlib.pyplot as plt
import seaborn as sns
import os
import numpy as np
import pandas as pd
sns.set()
sns.set_context('paper', font_scale=1.5)
ENVS = [
"push-v1",
"stick-pull-v1",
"sweep-v1",
"pick-place-v1",
]
horizons = [
200,
320,
200,
200
]
ALGOS = [
"sac_full", ... | [
"pandas.DataFrame",
"seaborn.set",
"numpy.std",
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.array",
"numpy.arange",
"os.path.join",
"seaborn.set_context"
] | [((103, 112), 'seaborn.set', 'sns.set', ([], {}), '()\n', (110, 112), True, 'import seaborn as sns\n'), ((113, 153), 'seaborn.set_context', 'sns.set_context', (['"""paper"""'], {'font_scale': '(1.5)'}), "('paper', font_scale=1.5)\n", (128, 153), True, 'import seaborn as sns\n'), ((920, 938), 'matplotlib.pyplot.subplots... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 13 18:23:08 2019
This scrip is for training the experiement end2end
@author: li
"""
import tensorflow as tf
import models.AE as AE
from data import read_frame_temporal as rft
import numpy as np
import os
import evaluate as ev
import cv2
import optimi... | [
"data.read_frame_temporal.dataset_input",
"optimization.loss_tf.calculate_cosine_dist",
"numpy.sum",
"tensorflow.trainable_variables",
"numpy.argmax",
"numpy.empty",
"tensorflow.reset_default_graph",
"tensorflow.reshape",
"data.read_frame_temporal.read_frame_interval_by_dataset",
"numpy.argmin",
... | [((996, 1019), 'numpy.array', 'np.array', (['auc_score_tot'], {}), '(auc_score_tot)\n', (1004, 1019), True, 'import numpy as np\n'), ((1036, 1055), 'numpy.array', 'np.array', (['error_tot'], {}), '(error_tot)\n', (1044, 1055), True, 'import numpy as np\n'), ((3977, 4025), 'evaluate.read_test_index', 'ev.read_test_index... |
import numpy as np
import matplotlib.pylab as plt
import pmcm
mp = pmcm.ModelParams(
Em=25e3, # [MPa] matrix modulus
Ef=180e3, # [MPa] fiber modulus
vf=0.01, # [-] reinforcement ratio
T=12., # [N/mm^3] bond intensity
sig_cu=10.0, # [MPa] composite strength
sig_mu=3.0, # [MPa] matrix strengt... | [
"pmcm.PMCM",
"pmcm.CrackBridgeRespSurface",
"matplotlib.pylab.plot",
"pmcm.ModelParams",
"numpy.linspace",
"matplotlib.pylab.subplots",
"matplotlib.pylab.show"
] | [((68, 164), 'pmcm.ModelParams', 'pmcm.ModelParams', ([], {'Em': '(25000.0)', 'Ef': '(180000.0)', 'vf': '(0.01)', 'T': '(12.0)', 'sig_cu': '(10.0)', 'sig_mu': '(3.0)', 'm': '(10000)'}), '(Em=25000.0, Ef=180000.0, vf=0.01, T=12.0, sig_cu=10.0,\n sig_mu=3.0, m=10000)\n', (84, 164), False, 'import pmcm\n'), ((366, 400)... |
import xarray as xr
import numpy as np
import pandas as pd
import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import cartopy.crs as ccrs # import projections
import cartopy.feature as cf # import features
import cmocean.cm as cmo
from glob import glob
fr... | [
"mpl_toolkits.axes_grid1.inset_locator.inset_axes",
"glob.glob",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.gca",
"numpy.unique",
"numpy.power",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.colorbar",
"matplotlib.dates.DateFormatter",
"datetime.timedelta",
"matplotlib.ticker.FormatStr... | [((1951, 1982), 'glob.glob', 'glob', (["(sat_dir + 'saildrone*.nc')"], {}), "(sat_dir + 'saildrone*.nc')\n", (1955, 1982), False, 'from glob import glob\n'), ((1994, 2025), 'glob.glob', 'glob', (["(adcp_dir + 'combined*.nc')"], {}), "(adcp_dir + 'combined*.nc')\n", (1998, 2025), False, 'from glob import glob\n'), ((203... |
import numpy as np
import tensorflow as tf
import math
import random
from config import config
from model import createModel
from data import UnclassifiedGenome
# Generate a GFF file from the model output
genome = UnclassifiedGenome(input_file=config["files"]["evaluate"])
model = createModel(output_nodes=14)
cluste... | [
"numpy.swapaxes",
"data.UnclassifiedGenome",
"model.createModel"
] | [((217, 275), 'data.UnclassifiedGenome', 'UnclassifiedGenome', ([], {'input_file': "config['files']['evaluate']"}), "(input_file=config['files']['evaluate'])\n", (235, 275), False, 'from data import UnclassifiedGenome\n'), ((284, 312), 'model.createModel', 'createModel', ([], {'output_nodes': '(14)'}), '(output_nodes=1... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=no-member
""" Functions
__author__: <NAME>, <NAME>, <NAME>
"""
import numpy as np
from pymdp.core import utils
import copy
def update_likelihood_dirichlet(pA, A, obs, qs, lr=1.0, modalities="all", return_numpy=True):
""" Update Dirichlet parameters... | [
"copy.deepcopy",
"pymdp.core.utils.is_distribution",
"pymdp.core.utils.to_categorical",
"pymdp.core.utils.is_arr_of_arr",
"numpy.eye",
"pymdp.core.utils.to_numpy"
] | [((1666, 1684), 'pymdp.core.utils.to_numpy', 'utils.to_numpy', (['pA'], {}), '(pA)\n', (1680, 1684), False, 'from pymdp.core import utils\n'), ((1693, 1710), 'pymdp.core.utils.to_numpy', 'utils.to_numpy', (['A'], {}), '(A)\n', (1707, 1710), False, 'from pymdp.core import utils\n'), ((1719, 1742), 'pymdp.core.utils.is_a... |
import os
import cv2
import numpy as np
from PIL import Image
import torch
from torch.utils import data
import random
def load_image_with_cache(path, cache=None, lock=None):
if cache is not None:
if path not in cache:
cache[path] = Image.open(path)
# with open(path, 'rb') as f:
# cache[path] = f.read()
... | [
"random.randint",
"random.shuffle",
"os.path.exists",
"PIL.Image.open",
"numpy.array",
"os.path.join",
"cv2.resize"
] | [((507, 523), 'PIL.Image.open', 'Image.open', (['path'], {}), '(path)\n', (517, 523), False, 'from PIL import Image\n'), ((658, 701), 'numpy.array', 'np.array', (['[104.00699, 116.66877, 122.67892]'], {}), '([104.00699, 116.66877, 122.67892])\n', (666, 701), True, 'import numpy as np\n'), ((1041, 1074), 'os.path.join',... |
'''
synbiochem (c) University of Manchester 2016
synbiochem is licensed under the MIT License.
To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.
@author: neilswainston
'''
# pylint: disable=invalid-name
import math
from sklearn.preprocessing.data import scale
import numpy as np
def de... | [
"numpy.shape",
"sklearn.preprocessing.data.scale"
] | [((376, 387), 'numpy.shape', 'np.shape', (['A'], {}), '(A)\n', (384, 387), True, 'import numpy as np\n'), ((410, 418), 'sklearn.preprocessing.data.scale', 'scale', (['A'], {}), '(A)\n', (415, 418), False, 'from sklearn.preprocessing.data import scale\n')] |
# Source: https://github.com/seungeunrho/minimalRL/blob/master/ppo.py
import os, sys
sys.path.append(os.path.dirname(sys.path[0]))
project_dir = os.path.dirname(os.path.dirname(sys.path[0]))
sys.path.append(project_dir)
sys.path.append(os.path.join(project_dir, 'gym_multi_car_racing'))
import gym
import torch
imp... | [
"sys.path.append",
"matplotlib.pyplot.show",
"gym.make",
"numpy.log",
"torch.distributions.Categorical",
"os.path.dirname",
"torch.load",
"numpy.zeros",
"torch.nn.functional.softmax",
"torch.clamp",
"torch.nn.Linear",
"torch.min",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"... | [((194, 222), 'sys.path.append', 'sys.path.append', (['project_dir'], {}), '(project_dir)\n', (209, 222), False, 'import os, sys\n'), ((102, 130), 'os.path.dirname', 'os.path.dirname', (['sys.path[0]'], {}), '(sys.path[0])\n', (117, 130), False, 'import os, sys\n'), ((163, 191), 'os.path.dirname', 'os.path.dirname', ([... |
""" Functions to create binned vector from spectrum using fixed width bins.
"""
from typing import List
import numpy as np
from tqdm import tqdm
from matchms import Spectrum
def create_peak_list_fixed(spectrums, peaks_vocab, d_bins,
mz_max=1000.0, mz_min=10.0, peak_scaling=0.5,
... | [
"tqdm.tqdm",
"numpy.sum"
] | [((1020, 1086), 'tqdm.tqdm', 'tqdm', (['spectrums'], {'desc': '"""Spectrum binning"""', 'disable': '(not progress_bar)'}), "(spectrums, desc='Spectrum binning', disable=not progress_bar)\n", (1024, 1086), False, 'from tqdm import tqdm\n'), ((1822, 1855), 'numpy.sum', 'np.sum', (['weights[idx_not_in_vocab]'], {}), '(wei... |
import os
import time
import numpy as np
from matplotlib import pyplot as plt
from sklearn.metrics import confusion_matrix
import nemo
def _is_whitespace(c):
if c == " " or c == "\t" or c == "\r" or c == "\n" or ord(c) == 0x202F:
return True
return False
def mask_padded_tokens(tokens, pad_id):
... | [
"os.makedirs",
"numpy.argmax",
"nemo.logging.info",
"time.strftime",
"matplotlib.pyplot.figure",
"numpy.where",
"sklearn.metrics.confusion_matrix"
] | [((596, 623), 'numpy.argmax', 'np.argmax', (['intent_logits', '(1)'], {}), '(intent_logits, 1)\n', (605, 623), True, 'import numpy as np\n'), ((641, 671), 'numpy.argmax', 'np.argmax', (['slot_logits'], {'axis': '(2)'}), '(slot_logits, axis=2)\n', (650, 671), True, 'import numpy as np\n'), ((3102, 3133), 'sklearn.metric... |
from bs4 import BeautifulSoup
import datetime
import json
import lxml
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from serpapi import GoogleSearch
import re
import requests
import time
from a0001_admin import clean_dataframe
from a0001_admin import name_paths
from ... | [
"pandas.DataFrame",
"pandas.read_csv",
"a0001_admin.retrieve_path",
"a0001_admin.retrieve_format",
"numpy.arange",
"a0001_admin.write_paths",
"a0001_admin.retrieve_list",
"a0001_admin.clean_dataframe",
"os.listdir"
] | [((662, 675), 'a0001_admin.write_paths', 'write_paths', ([], {}), '()\n', (673, 675), False, 'from a0001_admin import write_paths\n'), ((1033, 1062), 'a0001_admin.retrieve_list', 'retrieve_list', (['"""type_article"""'], {}), "('type_article')\n", (1046, 1062), False, 'from a0001_admin import retrieve_list\n'), ((3566,... |
# -*- coding: utf-8 -*-
"""
Esercizio 2
Freq. basse -> grana grossa
Freq. alte -> dettaglio
"""
from scipy.fft import fft
import math
import numpy as np
import matplotlib.pyplot as plt
def gradino(x):
if x<-1 or x>1:
f=1
else:
f=0
return f
A = -3
B = 3
l = 0
r = ... | [
"scipy.fft.fft",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.zeros",
"numpy.ones",
"numpy.sin",
"numpy.arange",
"numpy.linspace",
"numpy.cos"
] | [((416, 437), 'numpy.arange', 'np.arange', (['A', 'B', 'step'], {}), '(A, B, step)\n', (425, 437), True, 'import numpy as np\n'), ((496, 502), 'scipy.fft.fft', 'fft', (['y'], {}), '(y)\n', (499, 502), False, 'from scipy.fft import fft\n'), ((590, 608), 'numpy.zeros', 'np.zeros', (['(m + 2,)'], {}), '((m + 2,))\n', (598... |
from My_Classification_Class import MyClassificationClass
from sklearn.datasets import load_iris,load_breast_cancer
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix,accuracy_score,... | [
"sklearn.datasets.load_iris",
"sklearn.metrics.accuracy_score",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.ensemble.VotingClassifier",
"sklearn.metrics.f1_score",
"numpy.arange",
"numpy.mean",
"sklearn.svm.SVC",
"pandas.DataFrame",
"xgboost.XGBClassifier",
"sklearn.ensemble.RandomForestClas... | [((970, 990), 'sklearn.datasets.load_breast_cancer', 'load_breast_cancer', ([], {}), '()\n', (988, 990), False, 'from sklearn.datasets import load_iris, load_breast_cancer\n'), ((1011, 1072), 'pandas.DataFrame', 'pd.DataFrame', (["cancer['data']"], {'columns': "cancer['feature_names']"}), "(cancer['data'], columns=canc... |
import numpy as np
import pandas as pd
from sklearn.preprocessing import PowerTransformer
# categorize features into dense or categorical
def categorize_features(df, target, cat_threshold=12):
cat_features = []
dense_features = []
for f in df.columns.values.tolist():
if f != target:
if ... | [
"numpy.corrcoef",
"sklearn.preprocessing.PowerTransformer"
] | [((1431, 1462), 'sklearn.preprocessing.PowerTransformer', 'PowerTransformer', ([], {'method': 'method'}), '(method=method)\n', (1447, 1462), False, 'from sklearn.preprocessing import PowerTransformer\n'), ((1889, 1924), 'numpy.corrcoef', 'np.corrcoef', (['df[feat_a]', 'df[feat_b]'], {}), '(df[feat_a], df[feat_b])\n', (... |
#%%
import json
import pandas as p
import re
import numpy as np
# Read Cross Reference File
with open('./PERFILES_WEB/PER2_TITLEDAT.DAT','r') as crfile:
pairs = {}
for line in crfile:
pair = line.strip().split()
if len(pair) == 2:
pair[0] = pair[0].strip("PER3_")
pairs[p... | [
"numpy.full",
"json.dump",
"json.load",
"pandas.read_excel",
"numpy.mean",
"numpy.array"
] | [((499, 565), 'pandas.read_excel', 'p.read_excel', (['"""APC_Technical_Data.xlsx"""'], {'sheet_name': '"""PRODUCT LIST"""'}), "('APC_Technical_Data.xlsx', sheet_name='PRODUCT LIST')\n", (511, 565), True, 'import pandas as p\n'), ((2180, 2203), 'numpy.full', 'np.full', (['[N, 1]', 'np.nan'], {}), '([N, 1], np.nan)\n', (... |
'''
Copyright (c) 2021 <NAME>
Standard 60N parallel method
'''
import numpy as np
def standard(arr, nc_lat_data):
idx = find_nearest(nc_lat_data, 60)
u = np.average(arr[idx, :])
return u
def find_nearest(array, value):
array = np.asarray(array)
idx = (np.abs(array - value)).argmin()
retur... | [
"numpy.abs",
"numpy.asarray",
"numpy.average"
] | [((166, 189), 'numpy.average', 'np.average', (['arr[idx, :]'], {}), '(arr[idx, :])\n', (176, 189), True, 'import numpy as np\n'), ((250, 267), 'numpy.asarray', 'np.asarray', (['array'], {}), '(array)\n', (260, 267), True, 'import numpy as np\n'), ((279, 300), 'numpy.abs', 'np.abs', (['(array - value)'], {}), '(array - ... |
'''
implement truncated normal distribution based on the wiki page:
https://en.wikipedia.org/wiki/Truncated_normal_distribution
'''
import numpy as np
from scipy.special import erf, erfinv
# truely truncated norm
def norm_pdf(x):
return 1 / np.sqrt(2 * np.pi) * np.exp(-1 / 2 * x * x)
def norm_cdf(x):
... | [
"numpy.random.uniform",
"numpy.std",
"scipy.special.erfinv",
"numpy.mean",
"numpy.exp",
"numpy.sqrt"
] | [((848, 867), 'numpy.random.uniform', 'np.random.uniform', ([], {}), '()\n', (865, 867), True, 'import numpy as np\n'), ((276, 298), 'numpy.exp', 'np.exp', (['(-1 / 2 * x * x)'], {}), '(-1 / 2 * x * x)\n', (282, 298), True, 'import numpy as np\n'), ((418, 428), 'numpy.sqrt', 'np.sqrt', (['(2)'], {}), '(2)\n', (425, 428... |
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt
import pylab as plb
import numpy as np
import importlib
from sys import exit
import pltaux; importlib.reload(pltaux)
import sysaux; importlib.reload(sysaux)
import paths; importlib.reload(paths)
import oper_file; ... | [
"pltaux.figpar",
"oper_file.read3",
"importlib.reload",
"matplotlib.ticker.AutoMinorLocator",
"pltaux.savepdf",
"numpy.loadtxt",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots",
"pylab.setp"
] | [((190, 214), 'importlib.reload', 'importlib.reload', (['pltaux'], {}), '(pltaux)\n', (206, 214), False, 'import importlib\n'), ((234, 258), 'importlib.reload', 'importlib.reload', (['sysaux'], {}), '(sysaux)\n', (250, 258), False, 'import importlib\n'), ((278, 301), 'importlib.reload', 'importlib.reload', (['paths'], ... |
import cv2
import numpy as np
import torch
from l5kit.configs import load_config_data
from l5kit.data import ChunkedDataset, LocalDataManager
from l5kit.dataset import AgentDataset
from l5kit.rasterization.rasterizer_builder import (_load_metadata, get_hardcoded_world_to_ecef)
from OpenGL.GLUT import *
from opengl_ras... | [
"l5kit.dataset.AgentDataset",
"l5kit.configs.load_config_data",
"torch.utils.data.DataLoader",
"opengl_rasterizer.OpenGLSemanticRasterizer",
"l5kit.data.ChunkedDataset",
"cv2.cvtColor",
"l5kit.rasterization.rasterizer_builder._load_metadata",
"l5kit.rasterization.rasterizer_builder.get_hardcoded_world... | [((556, 600), 'l5kit.configs.load_config_data', 'load_config_data', (['f"""./configs/{config_file}"""'], {}), "(f'./configs/{config_file}')\n", (572, 600), False, 'from l5kit.configs import load_config_data\n'), ((688, 706), 'l5kit.data.LocalDataManager', 'LocalDataManager', ([], {}), '()\n', (704, 706), False, 'from l... |
from typing import Optional, Sequence, Tuple
import numpy as np
import zarr
from arbol.arbol import aprint, asection
from joblib import Parallel, delayed
from numpy.typing import ArrayLike
from scipy import ndimage as ndi
from dexp.datasets import BaseDataset
from dexp.processing.filters.fft_convolve import fft_convo... | [
"traceback.print_exc",
"arbol.arbol.asection",
"scipy.ndimage.find_objects",
"dexp.utils.backends.Backend.to_numpy",
"joblib.Parallel",
"numpy.min",
"numpy.max",
"dexp.processing.filters.fft_convolve.fft_convolve",
"dexp.datasets.ZDataset",
"dexp.utils.backends.Backend.to_backend",
"dexp.utils.b... | [((1927, 1957), 'numpy.min', 'np.min', (['ranges[..., 0]'], {'axis': '(0)'}), '(ranges[..., 0], axis=0)\n', (1933, 1957), True, 'import numpy as np\n'), ((1970, 2000), 'numpy.max', 'np.max', (['ranges[..., 1]'], {'axis': '(0)'}), '(ranges[..., 1], axis=0)\n', (1976, 2000), True, 'import numpy as np\n'), ((2598, 2646), ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.