code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
Original Source: https://github.com/fizyr/keras-retinanet
"""
import numpy as np
from .anchor_parameters import AnchorParameters
from .anchor_calc import compute_overlap
#from keras.utils.generic_utils import to_list
from tensorflow.python.keras.utils.generic_utils import to_list
def layer_shapes(image_shape, m... | [
"numpy.stack",
"numpy.meshgrid",
"numpy.argmax",
"numpy.zeros",
"tensorflow.python.keras.utils.generic_utils.to_list",
"numpy.append",
"numpy.array",
"numpy.tile",
"numpy.arange"
] | [((660, 686), 'tensorflow.python.keras.utils.generic_utils.to_list', 'to_list', (['model.input_shape'], {}), '(model.input_shape)\n', (667, 686), False, 'from tensorflow.python.keras.utils.generic_utils import to_list\n'), ((2101, 2126), 'numpy.array', 'np.array', (['image_shape[:2]'], {}), '(image_shape[:2])\n', (2109... |
'''
Theano utility functions
'''
import sys
import json
import cPickle as pkl
import numpy
from collections import OrderedDict
import theano
import theano.tensor as tensor
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
floatX = theano.config.floatX
numpy_floatX = numpy.typeDict[floatX]
# floa... | [
"theano.tensor.tanh",
"numpy.load",
"numpy.zeros_like",
"theano.version.short_version.split",
"theano.tensor.set_subtensor",
"theano.tensor.zeros",
"theano.shared",
"collections.OrderedDict",
"numpy.savez"
] | [((977, 990), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (988, 990), False, 'from collections import OrderedDict\n'), ((1521, 1534), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1532, 1534), False, 'from collections import OrderedDict\n'), ((1831, 1844), 'collections.OrderedDict', 'Orde... |
"""
===============================================
vidgear library source-code is deployed under the Apache 2.0 License:
Copyright (c) 2019-2020 <NAME>(@abhiTronix) <<EMAIL>>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You m... | [
"threading.Thread",
"cv2.cvtColor",
"numpy.shape",
"mss.mss",
"threading.Event",
"collections.OrderedDict",
"queue.Queue",
"logging.getLogger"
] | [((1231, 1258), 'logging.getLogger', 'log.getLogger', (['"""ScreenGear"""'], {}), "('ScreenGear')\n", (1244, 1258), True, 'import logging as log\n'), ((3944, 3967), 'queue.Queue', 'queue.Queue', ([], {'maxsize': '(96)'}), '(maxsize=96)\n', (3955, 3967), False, 'import queue\n'), ((8039, 8046), 'threading.Event', 'Event... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 28 21:59:47 2019
@author: krups
"""
from keras.preprocessing.sequence import pad_sequences
from keras.utils import to_categorical
from keras import layers,models
import numpy as np
import time
def split_test_train_function(texts_data,test_n,val_n):
return(texts_data[... | [
"keras.preprocessing.sequence.pad_sequences",
"keras.layers.LSTM",
"keras.layers.add",
"keras.models.Model",
"time.time",
"keras.layers.Dense",
"numpy.array",
"keras.layers.Embedding",
"keras.layers.Input",
"keras.utils.to_categorical"
] | [((997, 1013), 'numpy.array', 'np.array', (['X_text'], {}), '(X_text)\n', (1005, 1013), True, 'import numpy as np\n'), ((1028, 1045), 'numpy.array', 'np.array', (['X_image'], {}), '(X_image)\n', (1036, 1045), True, 'import numpy as np\n'), ((1060, 1076), 'numpy.array', 'np.array', (['y_text'], {}), '(y_text)\n', (1068,... |
"""Test state_distinguishability."""
import numpy as np
from toqito.state_opt import state_distinguishability
from toqito.states import basis, bell
def test_state_distinguishability_one_state():
"""State distinguishability for single state."""
rho = bell(0) * bell(0).conj().T
states = [rho]
res = st... | [
"toqito.states.basis",
"numpy.testing.run_module_suite",
"numpy.testing.assert_raises",
"numpy.isclose",
"toqito.state_opt.state_distinguishability",
"toqito.states.bell",
"numpy.kron"
] | [((318, 350), 'toqito.state_opt.state_distinguishability', 'state_distinguishability', (['states'], {}), '(states)\n', (342, 350), False, 'from toqito.state_opt import state_distinguishability\n'), ((528, 535), 'toqito.states.bell', 'bell', (['(0)'], {}), '(0)\n', (532, 535), False, 'from toqito.states import basis, be... |
r"""
Solve Helmholtz equation in 2D with periodic bcs in one direction
and Dirichlet in the other
alpha u - \nabla^2 u = f,
Use Fourier basis for the periodic direction and Shen's Dirichlet basis for the
non-periodic direction.
The equation to solve is
alpha (u, v) - (\nabla^2 u, v) = (f, v)
"""
import sys... | [
"matplotlib.pyplot.title",
"sympy.symbols",
"matplotlib.pyplot.show",
"sympy.sin",
"shenfun.inner",
"numpy.allclose",
"shenfun.Array",
"sympy.cos",
"shenfun.TrialFunction",
"matplotlib.pyplot.colorbar",
"shenfun.grad",
"matplotlib.pyplot.figure",
"shenfun.Function",
"matplotlib.pyplot.cont... | [((1015, 1040), 'sympy.symbols', 'symbols', (['"""x,y"""'], {'real': '(True)'}), "('x,y', real=True)\n", (1022, 1040), False, 'from sympy import symbols, cos, sin\n'), ((1188, 1239), 'shenfun.FunctionSpace', 'FunctionSpace', (['N[0]', 'family'], {'bc': '(0, 0)', 'scaled': '(True)'}), '(N[0], family, bc=(0, 0), scaled=T... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import csv
import six
import zipfile
import numpy as np
GAZETTEER_FORMAT = "2s 1s 5s 2s 3s"
GAZETTEER_COLUMNS = ['country_code', 'feature_class', 'feature_code',
'admin1_code', 'admin2_code']
_GEONAMES_COLUMNS = ['geonameid'... | [
"zipfile.ZipFile",
"pandas.read_csv",
"six.text_type",
"pandas.Series",
"os.path.split",
"numpy.concatenate",
"numpy.repeat"
] | [((2210, 2258), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename, **_GEONAMES_PANDAS_PARAMS)\n', (2221, 2258), True, 'import pandas as pd\n'), ((3584, 3634), 'numpy.repeat', 'np.repeat', (['name_lenghts.index', 'name_lenghts.values'], {}), '(name_lenghts.index, name_lenghts.values)\n', (3593, 3634), Tru... |
import os
import time
import numpy as np
import pandas as pd
from preprocessing.clean import CleanData
from svd.svd_algorithm import SVDAlgorithm
from error_measures.measures import *
from cur.cur_algorithm import *
from collaborative_filtering.collaborate import *
'''
Download Dataset, if already avaialble, th... | [
"numpy.load",
"time.time",
"svd.svd_algorithm.SVDAlgorithm",
"preprocessing.clean.CleanData",
"numpy.dot",
"os.listdir"
] | [((386, 414), 'os.listdir', 'os.listdir', (['"""preprocessing/"""'], {}), "('preprocessing/')\n", (396, 414), False, 'import os\n'), ((962, 973), 'time.time', 'time.time', ([], {}), '()\n', (971, 973), False, 'import time\n'), ((1579, 1590), 'time.time', 'time.time', ([], {}), '()\n', (1588, 1590), False, 'import time\... |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 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... | [
"numpy.minimum",
"numpy.ascontiguousarray",
"numpy.maximum"
] | [((437, 469), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['dets[:, 0]'], {}), '(dets[:, 0])\n', (457, 469), True, 'import numpy as np\n'), ((479, 511), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['dets[:, 1]'], {}), '(dets[:, 1])\n', (499, 511), True, 'import numpy as np\n'), ((521, 553), 'numpy.ascon... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""!
Author: <NAME> - ASCEE
Description: Designs octave band FIR filters from 16Hz to 16 kHz for a sampling
frequency of 48 kHz.
"""
# from asceefigs.plot import Bode, close, Figure
__all__ = ['freqResponse', 'bandpass_fir_design', 'lowpass_fir_design',
'arbitr... | [
"numpy.sin",
"numpy.empty",
"scipy.signal.freqz",
"scipy.signal.firwin2"
] | [((892, 925), 'scipy.signal.freqz', 'freqz', (['coefs_b', 'coefs_a'], {'worN': 'Omg'}), '(coefs_b, coefs_a, worN=Omg)\n', (897, 925), False, 'from scipy.signal import freqz, hann, firwin2\n'), ((1250, 1274), 'numpy.empty', 'np.empty', (['L'], {'dtype': 'float'}), '(L, dtype=float)\n', (1258, 1274), True, 'import numpy ... |
import numpy as np
import matplotlib.pyplot as plt
import math
def autolabel_user_1(rects):
for i, rect in enumerate(rects):
height = rect.get_height()
if i == 0:
plt.text(rect.get_x() + rect.get_width() / 2., 1.08 * height, "%s" % round(height, 3), ha='center')
elif i == 1:
... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.legend",
"math.log10",
"numpy.arange",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid"
] | [((1634, 1649), 'numpy.arange', 'np.arange', (['size'], {}), '(size)\n', (1643, 1649), True, 'import numpy as np\n'), ((2434, 2481), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Total Camera Numbers"""'], {'fontsize': '(16)'}), "('Total Camera Numbers', fontsize=16)\n", (2444, 2481), True, 'import matplotlib.pyplot ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 04 11:12:45 2016
@author: <NAME>
"""
from __future__ import division, print_function, absolute_import, unicode_literals
from os import path, remove # File Path formatting
import numpy as np # For array operations
from scipy.io.matlab import loadmat # To load paramet... | [
"sidpy.hdf.hdf_utils.write_simple_attrs",
"os.path.abspath",
"h5py.File",
"os.remove",
"numpy.fft.ifftshift",
"scipy.io.matlab.loadmat",
"sidpy.hdf.hdf_utils.link_h5_objects_as_attrs",
"pyUSID.io.hdf_utils.write_main_dataset",
"numpy.float32",
"pyUSID.io.write_utils.Dimension",
"os.path.exists",... | [((1305, 1328), 'os.path.abspath', 'path.abspath', (['parm_path'], {}), '(parm_path)\n', (1317, 1328), False, 'from os import path, remove\n'), ((1364, 1385), 'os.path.split', 'path.split', (['parm_path'], {}), '(parm_path)\n', (1374, 1385), False, 'from os import path, remove\n'), ((1419, 1442), 'os.path.split', 'path... |
import functools
import io
import warnings
from operator import attrgetter
import numpy as np
import pytest
import torch
from torch import nn
from torch.distributions import constraints
import pyro
import pyro.distributions as dist
import pyro.poutine as poutine
from pyro.infer import SVI, Trace_ELBO, TraceEnum_ELBO... | [
"torch.eye",
"pyro.plate",
"pyro.distributions.Beta",
"torch.jit.trace_module",
"torch.randn",
"pyro.infer.autoguide.AutoGuideList",
"pyro.infer.Predictive",
"pyro.factor",
"torch.arange",
"pytest.mark.parametrize",
"pyro.poutine.block",
"pyro.poutine.trace",
"torch.ones",
"pyro.distributi... | [((981, 1114), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""auto_class"""', '[AutoDiagonalNormal, AutoMultivariateNormal, AutoLowRankMultivariateNormal,\n AutoIAFNormal]'], {}), "('auto_class', [AutoDiagonalNormal,\n AutoMultivariateNormal, AutoLowRankMultivariateNormal, AutoIAFNormal])\n", (1004, ... |
__author__ = "<NAME>"
__credits__ = ["<NAME>"]
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
__date__ = "05/2019"
__license__ = "MIT"
import cv2, pytesseract, imutils, logging
import numpy as np
from skimage.measure import compare_ssim as ssim
from consts import *
logger = logging.getLo... | [
"cv2.resize",
"cv2.GaussianBlur",
"skimage.measure.compare_ssim",
"cv2.dilate",
"cv2.cvtColor",
"cv2.imwrite",
"cv2.threshold",
"cv2.copyMakeBorder",
"numpy.ones",
"pytesseract.image_to_string",
"cv2.VideoCapture",
"cv2.rectangle",
"imutils.grab_contours",
"cv2.boundingRect",
"logging.ge... | [((307, 328), 'logging.getLogger', 'logging.getLogger', (['""""""'], {}), "('')\n", (324, 328), False, 'import cv2, pytesseract, imutils, logging\n'), ((1341, 1384), 'cv2.cvtColor', 'cv2.cvtColor', (['new_image', 'cv2.COLOR_BGR2GRAY'], {}), '(new_image, cv2.COLOR_BGR2GRAY)\n', (1353, 1384), False, 'import cv2, pytesser... |
from kernel_tuner import tune_kernel
import numpy
import argparse
import json
def generate_code(tuning_parameters):
code = \
"__global__ void fct_ale_b1_vertical(const int maxLevels, const int * __restrict__ nLevels, const <%REAL_TYPE%> * __restrict__ fct_adf_v, <%REAL_TYPE%> * __restrict__ fct_plus, <%RE... | [
"json.dump",
"numpy.zeros_like",
"argparse.ArgumentParser",
"numpy.random.randn",
"numpy.dtype",
"numpy.zeros",
"numpy.random.randint",
"numpy.int32"
] | [((8833, 8898), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""FESOM2 FCT ALE B1 VERTICAL"""'}), "(description='FESOM2 FCT ALE B1 VERTICAL')\n", (8856, 8898), False, 'import argparse\n'), ((7261, 7296), 'numpy.random.randint', 'numpy.random.randint', (['(3)', 'max_levels'], {}), '(3, max... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import numpy as np
import pandas as pd
from . import select_descriptor
from ..IO import pkl_data
from ..IO import read_input as rin
def initialize(stat, init_struc_data, rslt_data):
# ---------- log
print('\n# ---------- In... | [
"numpy.array",
"pandas.Series"
] | [((662, 685), 'numpy.array', 'np.array', (['[]'], {'dtype': 'int'}), '([], dtype=int)\n', (670, 685), True, 'import numpy as np\n'), ((700, 725), 'numpy.array', 'np.array', (['[]'], {'dtype': 'float'}), '([], dtype=float)\n', (708, 725), True, 'import numpy as np\n'), ((828, 848), 'pandas.Series', 'pd.Series', ([], {'d... |
# Copyright (c) 2019 <NAME> <<EMAIL>>
# Copyright (c) 2020 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVID... | [
"numpy.random.rand",
"numpy.linalg.norm",
"numpy.zeros"
] | [((1749, 1769), 'numpy.zeros', 'np.zeros', (['D.shape[0]'], {}), '(D.shape[0])\n', (1757, 1769), True, 'import numpy as np\n'), ((1865, 1891), 'numpy.random.rand', 'np.random.rand', (['D.shape[0]'], {}), '(D.shape[0])\n', (1879, 1891), True, 'import numpy as np\n'), ((1914, 1934), 'numpy.linalg.norm', 'np.linalg.norm',... |
# Copyright <NAME> 2012-2020.
# Copyright <NAME> 2020. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt)
## @package testdriver
# This is the Python testdriver for the \ref testsuite.
#
# It is intended to be used with the CMake CTest utility.
# When called with the paramet... | [
"matplotlib.pyplot.title",
"os.remove",
"numpy.abs",
"optparse.OptionParser",
"os.environ.copy",
"numpy.allclose",
"subprocess.list2cmdline",
"cpypyqed_d.read",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.exp",
"numpy.diag",
"os.path.join",
"matplotlib.font_manager.FontProperties",
... | [((934, 1027), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(asctime)s %(levelname)s %(message)s"""'}), "(level=logging.DEBUG, format=\n '%(asctime)s %(levelname)s %(message)s')\n", (953, 1027), False, 'import logging\n'), ((723, 744), 'matplotlib.use', 'matplotlib.use... |
import os
import numpy as np
from collections import Counter
from typing import List, Tuple
DIRNAME = os.path.dirname(__file__)
class Board:
def __init__(self, grid:List[List[int]]):
self.size = len(grid)
self.numbers = np.array(grid)
self.crossed = np.array([[0 for _ in range(self.size)]... | [
"os.path.dirname",
"numpy.array",
"os.path.join"
] | [((103, 128), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (118, 128), False, 'import os\n'), ((243, 257), 'numpy.array', 'np.array', (['grid'], {}), '(grid)\n', (251, 257), True, 'import numpy as np\n'), ((1259, 1286), 'os.path.join', 'os.path.join', (['DIRNAME', 'path'], {}), '(DIRNAME, p... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 18 18:19:09 2020
@author: RobertTeresi
"""
import os
import io
import sys
import re
from subprocess import call
from functools import partial
from csv import reader, writer
from pathlib import Path
import shutil # Copy files to another directory
#f... | [
"pandas.DataFrame",
"functools.partial",
"os.path.join",
"numpy.concatenate",
"os.getcwd",
"os.walk",
"datetime.datetime.now",
"re.findall",
"subprocess.call",
"pubmed_parser.medline_parser.parse_medline_xml",
"numpy.round",
"pathos.multiprocessing.ProcessingPool",
"os.chdir",
"re.sub"
] | [((7000, 7014), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (7012, 7014), False, 'from datetime import datetime\n'), ((7069, 7111), 'pubmed_parser.medline_parser.parse_medline_xml', 'medline_parser.parse_medline_xml', (['filepath'], {}), '(filepath)\n', (7101, 7111), False, 'from pubmed_parser import med... |
# Written by i3s
import os
import numpy as np
from sklearn.preprocessing import OneHotEncoder
import pandas as pd
import seaborn as sns
import time
from sklearn.model_selection import KFold
from matplotlib import pyplot as plt
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier, AdaBoostC... | [
"matplotlib.pyplot.title",
"numpy.absolute",
"sklearn.model_selection.GridSearchCV",
"numpy.sum",
"numpy.abs",
"numpy.random.seed",
"numpy.argmax",
"seaborn.heatmap",
"numpy.logspace",
"numpy.ones",
"numpy.argmin",
"numpy.argsort",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange"... | [((1465, 1482), 'numpy.reshape', 'np.reshape', (['Y', '(-1)'], {}), '(Y, -1)\n', (1475, 1482), True, 'import numpy as np\n'), ((1512, 1528), 'numpy.zeros', 'np.zeros', (['(k, d)'], {}), '((k, d))\n', (1520, 1528), True, 'import numpy as np\n'), ((2178, 2194), 'numpy.zeros', 'np.zeros', (['(n, k)'], {}), '((n, k))\n', (... |
import numpy
from scipy.optimize import curve_fit, fsolve
import os, os.path
import matplotlib.pyplot as plt
from scipy.constants import pi
plt.style.use("science")
def fit_para(L, d, eps_2D):
return (eps_2D - 1) * d / L + 1
def fit_vert(L, d, eps_2D):
return 1 / (d / L * (1 / eps_2D - 1) + 1)
root = "../..... | [
"os.path.join",
"os.walk",
"numpy.genfromtxt",
"scipy.optimize.curve_fit",
"matplotlib.pyplot.style.use",
"numpy.where",
"numpy.linspace",
"matplotlib.pyplot.subplots"
] | [((140, 164), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""science"""'], {}), "('science')\n", (153, 164), True, 'import matplotlib.pyplot as plt\n'), ((341, 354), 'os.walk', 'os.walk', (['root'], {}), '(root)\n', (348, 354), False, 'import os, os.path\n'), ((2402, 2440), 'matplotlib.pyplot.subplots', 'plt.sub... |
from nose.tools import raises
import os
import shutil
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import flopy
pthtest = os.path.join("..", "examples", "data", "mfgrd_test")
flowpth = os.path.join("..", "examples", "data", "mf6-freyberg")
tpth = os.path.join("temp", "t029")
# remove the dir... | [
"matplotlib.pyplot.title",
"flopy.mf6.utils.MfGrdFile",
"matplotlib.pyplot.figure",
"shutil.rmtree",
"os.path.join",
"flopy.mf6.MFSimulation.load",
"nose.tools.raises",
"flopy.mf6.utils.get_structured_faceflows",
"matplotlib.pyplot.close",
"matplotlib.pyplot.colorbar",
"flopy.discretization.Stru... | [((149, 201), 'os.path.join', 'os.path.join', (['""".."""', '"""examples"""', '"""data"""', '"""mfgrd_test"""'], {}), "('..', 'examples', 'data', 'mfgrd_test')\n", (161, 201), False, 'import os\n'), ((212, 266), 'os.path.join', 'os.path.join', (['""".."""', '"""examples"""', '"""data"""', '"""mf6-freyberg"""'], {}), "(... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
## Copyright 2015-2021 PyPSA Developers
## You can find the list of PyPSA Developers at
## https://pypsa.readthedocs.io/en/latest/developers.html
## PyPSA is released under the open source MIT License, see
## https://github.com/PyPSA/PyPSA/blob/master/LICENSE.txt
"""
T... | [
"cplex.Cplex",
"os.remove",
"numpy.nan_to_num",
"pandas.read_csv",
"numpy.isnan",
"numpy.arange",
"gurobipy.read",
"xpress.problem",
"numpy.prod",
"pandas.DataFrame",
"os.path.exists",
"re.sub",
"io.BytesIO",
"os.mknod",
"numpy.vectorize",
"distutils.version.LooseVersion",
"numpy.asa... | [((1209, 1236), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1226, 1236), False, 'import logging, re, io, subprocess\n'), ((16209, 16253), 'numpy.vectorize', 'np.vectorize', (['_to_float_str'], {'otypes': '[object]'}), '(_to_float_str, otypes=[object])\n', (16221, 16253), True, 'import... |
import cv2
import numpy as np
from utils import Util
import pyttsx3 as p
engine = p.init()
class Lane:
def __init__(self, path):
self.path = path
self.util = Util()
def run_img(self, path):
img = cv2.imread(path)
img = cv2.resize(img, (800, 600))
#self.detect(img... | [
"cv2.line",
"pyttsx3.init",
"cv2.waitKey",
"cv2.destroyAllWindows",
"utils.Util",
"cv2.VideoCapture",
"cv2.imread",
"numpy.array",
"cv2.VideoWriter",
"cv2.HoughLinesP",
"cv2.imshow",
"cv2.resize"
] | [((84, 92), 'pyttsx3.init', 'p.init', ([], {}), '()\n', (90, 92), True, 'import pyttsx3 as p\n'), ((182, 188), 'utils.Util', 'Util', ([], {}), '()\n', (186, 188), False, 'from utils import Util\n'), ((237, 253), 'cv2.imread', 'cv2.imread', (['path'], {}), '(path)\n', (247, 253), False, 'import cv2\n'), ((268, 295), 'cv... |
# coding=utf-8
# Copyright 2022 The ML Fairness Gym Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"absl.testing.absltest.main",
"environments.lending.DelayedImpactEnv",
"rewards.NullReward",
"numpy.argmax",
"metrics.lending_metrics.CreditDistribution",
"numpy.asarray",
"environments.lending_params._credit_cluster_builder",
"metrics.lending_metrics.CumulativeLoans",
"environments.lending_params.D... | [((4025, 4040), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (4038, 4040), False, 'from absl.testing import absltest\n'), ((1072, 1098), 'environments.lending.DelayedImpactEnv', 'lending.DelayedImpactEnv', ([], {}), '()\n', (1096, 1098), False, 'from environments import lending\n'), ((1228, 1276), '... |
import numpy as np
#import h5py
from keras.models import Sequential
from keras.layers import LSTM, Dense
if __name__ == '__main__':
print('why is this so hard')
# generate and shape data
data = [[i for i in range(100)]]
data = np.array(data, dtype=float).reshape(1,1,100)
target = [[i for i in range(1, 1... | [
"keras.models.Sequential",
"keras.layers.Dense",
"numpy.array",
"keras.layers.LSTM"
] | [((582, 594), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (592, 594), False, 'from keras.models import Sequential\n'), ((606, 682), 'keras.layers.LSTM', 'LSTM', (['(100)'], {'input_shape': '(1, 100)', 'return_sequences': '(True)', 'activation': '"""sigmoid"""'}), "(100, input_shape=(1, 100), return_seque... |
"""Plotting module for elements.
This modules provides functions to plot the elements statistic data.
"""
import numpy as np
from bokeh.layouts import gridplot
from bokeh.plotting import figure
from scipy.stats import gaussian_kde
def plot_histogram(attribute_dict, label={}, var_list=[], **kwargs):
"""Plot histo... | [
"numpy.histogram",
"scipy.stats.gaussian_kde",
"bokeh.layouts.gridplot"
] | [((2506, 2551), 'bokeh.layouts.gridplot', 'gridplot', (['[figures]'], {'toolbar_location': '"""right"""'}), "([figures], toolbar_location='right')\n", (2514, 2551), False, 'from bokeh.layouts import gridplot\n'), ((1174, 1217), 'numpy.histogram', 'np.histogram', (['attribute_dict[var]'], {}), '(attribute_dict[var], **k... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"tvm.testing.device_enabled",
"tvm.te.placeholder",
"tvm.te.reduce_axis",
"numpy.random.uniform",
"tvm.nd.array",
"tvm.context",
"numpy.zeros",
"tvm.build",
"tvm.topi.x86.tensor_intrin.dot_16x1x16_uint8_int8_int32_cascadelake",
"tvm.te.create_schedule",
"numpy.dot",
"pytest.mark.skip"
] | [((1141, 1193), 'pytest.mark.skip', 'pytest.mark.skip', (['"""skip because feature not enabled"""'], {}), "('skip because feature not enabled')\n", (1157, 1193), False, 'import pytest\n'), ((1268, 1315), 'tvm.te.placeholder', 'te.placeholder', (['(m, k)'], {'name': '"""X"""', 'dtype': '"""uint8"""'}), "((m, k), name='X... |
import logging
import os
from typing import Dict, List, Optional
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib import ticker
from matplotlib.ticker import MaxNLocator, ScalarFormatter
from tess_atlas.data import TICEntry
from tess_atlas.utils import NOTEBOOK_LOGGER_NAME
from ... | [
"matplotlib.pyplot.tight_layout",
"numpy.quantile",
"matplotlib.ticker.MaxNLocator",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.draw",
"os.path.join",
"logging.getLogger"
] | [((510, 549), 'logging.getLogger', 'logging.getLogger', (['NOTEBOOK_LOGGER_NAME'], {}), '(NOTEBOOK_LOGGER_NAME)\n', (527, 549), False, 'import logging\n'), ((2826, 2844), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (2842, 2844), True, 'import matplotlib.pyplot as plt\n'), ((2955, 2983), 'num... |
'''
This is a plain consensus version modification on trainer.py
'''
import argparse
import asyncio
import os
import pickle
import sys
import time
import numpy as np
import resnet
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data... | [
"argparse.ArgumentParser",
"os.path.isfile",
"torch.optim.lr_scheduler.LambdaLR",
"torch.no_grad",
"os.path.join",
"sys.path.append",
"model_statistics.ModelStatistics",
"numpy.power",
"torch.load",
"os.path.exists",
"torch.Tensor",
"pickle.dumps",
"pickle.loads",
"prepare_agent_datasets.g... | [((406, 448), 'sys.path.append', 'sys.path.append', (['"""./distributed-learning/"""'], {}), "('./distributed-learning/')\n", (421, 448), False, 'import sys\n'), ((977, 1053), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Proper ResNets for CIFAR10 in pytorch"""'}), "(description='Prope... |
# -*- coding: utf-8 -*-
"""emnist_training.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1zOA0BJRrcOszo9kkTx5WIME5Ka7DfW0u
"""
from torchvision import datasets, transforms
import torch
import torch.nn as nn
import torch.nn.functional as F
from to... | [
"numpy.random.seed",
"torch.eye",
"torch.utils.data.DataLoader",
"torch.nn.functional.relu",
"torch.nn.Linear",
"numpy.random.shuffle",
"matplotlib.pyplot.show",
"torch.manual_seed",
"matplotlib.pyplot.legend",
"torch.nn.Conv2d",
"numpy.asarray",
"torch.cuda.is_available",
"torch.nn.MaxPool2... | [((1796, 1816), 'torch.manual_seed', 'torch.manual_seed', (['(1)'], {}), '(1)\n', (1813, 1816), False, 'import torch\n'), ((2109, 2129), 'numpy.random.seed', 'np.random.seed', (['(1000)'], {}), '(1000)\n', (2123, 2129), True, 'import numpy as np\n'), ((2171, 2196), 'numpy.random.shuffle', 'np.random.shuffle', (['indice... |
from csaf.utils.app import CsafApp
from csaf_examples.rejoin import generate_dubins_system, plot_aircrafts
from csaf_examples.cansat import generate_cansat_system, plot_sats
import numpy as np
if __name__ == '__main__':
descr = f"CSAF Examples Systems Viewer"
# chaser initial states (pos + vel)
sat_states... | [
"csaf_examples.rejoin.generate_dubins_system",
"csaf_examples.cansat.generate_cansat_system",
"numpy.deg2rad",
"csaf.utils.app.CsafApp"
] | [((540, 574), 'csaf_examples.cansat.generate_cansat_system', 'generate_cansat_system', (['sat_states'], {}), '(sat_states)\n', (562, 574), False, 'from csaf_examples.cansat import generate_cansat_system, plot_sats\n'), ((753, 785), 'csaf_examples.rejoin.generate_dubins_system', 'generate_dubins_system', (['j_states'], ... |
# -*- coding: utf-8 -*-
""" Animations of the form z = f(x, y, t).
"""
import time
import numpy as np
from ..engine import Animation
from ..engine import Sprite
def frange(x=(0, 1), y=(0, 1), z=(0, 1)):
""" Apply range attributes to a function. """
def decorator(f):
f.range_x = x
f.range_y... | [
"numpy.floor",
"time.time",
"numpy.sin",
"numpy.cos",
"numpy.sqrt"
] | [((890, 901), 'time.time', 'time.time', ([], {}), '()\n', (899, 901), False, 'import time\n'), ((1652, 1671), 'numpy.sin', 'np.sin', (['(y + 1.5 * t)'], {}), '(y + 1.5 * t)\n', (1658, 1671), True, 'import numpy as np\n'), ((1384, 1408), 'numpy.sqrt', 'np.sqrt', (['(x ** 2 + y ** 2)'], {}), '(x ** 2 + y ** 2)\n', (1391,... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : inference.py
@Contact : <EMAIL>
@License : (C)Copyright UCSD & Xing
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
03/03/2021 10:18 Xing 1.0 Initial Framework Generation
03/03... | [
"numpy.sum",
"argparse.ArgumentParser",
"numpy.clip",
"torch.cuda.device_count",
"numpy.mean",
"os.path.join",
"cv2.contourArea",
"skimage.filters.threshold_otsu",
"numpy.std",
"torch.load",
"cv2.morphologyEx",
"torch.manual_seed",
"torch.cuda.manual_seed",
"numpy.percentile",
"torch.ran... | [((695, 752), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""UCSD ImageClef2020"""'}), "(description='UCSD ImageClef2020')\n", (718, 752), False, 'import argparse\n'), ((2437, 2464), 'skimage.filters.threshold_otsu', 'threshold_otsu', (['image_array'], {}), '(image_array)\n', (2451, 2464... |
"""a series of useful pytorch operations related to bbox transformation."""
import torch
import numpy as np
def torch_to_np_dtype(ttype):
type_map = {
torch.float16: np.dtype(np.float16),
torch.float32: np.dtype(np.float32),
torch.float16: np.dtype(np.float64),
torch.int32: np.dty... | [
"torch.ones_like",
"torch.eye",
"numpy.concatenate",
"torch.zeros_like",
"torch.stack",
"numpy.dtype",
"torch.cat",
"torch.cos",
"torch.einsum",
"numpy.array",
"numpy.arange",
"torch.zeros",
"torch.inverse",
"torch.sin",
"torch.tensor",
"torch.from_numpy"
] | [((2240, 2257), 'torch.sin', 'torch.sin', (['angles'], {}), '(angles)\n', (2249, 2257), False, 'import torch\n'), ((2272, 2289), 'torch.cos', 'torch.cos', (['angles'], {}), '(angles)\n', (2281, 2289), False, 'import torch\n'), ((2301, 2325), 'torch.ones_like', 'torch.ones_like', (['rot_cos'], {}), '(rot_cos)\n', (2316,... |
# -*- coding: utf-8 -*-
import base64
import cv2
from flask import Flask, render_template
from flask_socketio import SocketIO, emit
import multiprocessing
import numpy as np
import os
# logging
from logging import getLogger, NullHandler, CRITICAL
logger = getLogger(__name__)
logger.addHandler(NullHandler())
# disabl... | [
"flask.Flask",
"cv2.imdecode",
"cv2.warpAffine",
"numpy.fromstring",
"cv2.imencode",
"flask_socketio.emit",
"logging.NullHandler",
"flask_socketio.SocketIO",
"base64.encodestring",
"flask.render_template",
"multiprocessing.Process",
"os.urandom",
"cv2.getRotationMatrix2D",
"logging.getLogg... | [((258, 277), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (267, 277), False, 'from logging import getLogger, NullHandler, CRITICAL\n'), ((356, 377), 'logging.getLogger', 'getLogger', (['"""werkzeug"""'], {}), "('werkzeug')\n", (365, 377), False, 'from logging import getLogger, NullHandler, CRI... |
from abc import ABCMeta
from abc import abstractmethod
import numpy as np
import torch
from disprcnn.modeling.sassd_module.core.bbox3d.geometry import center_to_corner_box3d
def second_box_encode(boxes, anchors, encode_angle_to_vector=False, smooth_dim=False):
"""box encode for VoxelNet in lidar
Args:
... | [
"numpy.full",
"numpy.arctan2",
"numpy.log",
"torch.sqrt",
"torch.split",
"torch.atan2",
"torch.cat",
"numpy.split",
"torch.cos",
"torch.exp",
"numpy.sin",
"numpy.exp",
"numpy.cos",
"disprcnn.modeling.sassd_module.core.bbox3d.geometry.center_to_corner_box3d",
"torch.sin",
"numpy.concate... | [((610, 639), 'numpy.split', 'np.split', (['anchors', '(7)'], {'axis': '(-1)'}), '(anchors, 7, axis=-1)\n', (618, 639), True, 'import numpy as np\n'), ((673, 700), 'numpy.split', 'np.split', (['boxes', '(7)'], {'axis': '(-1)'}), '(boxes, 7, axis=-1)\n', (681, 700), True, 'import numpy as np\n'), ((758, 784), 'numpy.sqr... |
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import spsolve
from Test2 import localmatrix2
import StiffnessNewCyth
def DisplacementCy2(NM, Modules, TransT, Transmatrix, NDOF, MemberCOORDNum, L, Pf,
MemberProp, Local_Matrix, COORDNum, x, AgrD, DNumber, A... | [
"Test2.localmatrix2",
"numpy.zeros",
"numpy.einsum",
"StiffnessNewCyth.NewStiff",
"scipy.sparse.csr_matrix",
"scipy.sparse.linalg.spsolve"
] | [((384, 519), 'Test2.localmatrix2', 'localmatrix2', (['Local_Matrix', 'MemberProp[:, 0]', 'MemberProp[:, 1]', 'MemberProp[:, 2]', 'MemberProp[:, 3]', 'Modules[:, 0]', 'Modules[:, 1]', 'L'], {}), '(Local_Matrix, MemberProp[:, 0], MemberProp[:, 1], MemberProp[:,\n 2], MemberProp[:, 3], Modules[:, 0], Modules[:, 1], L)... |
# Author: <NAME>
# https://sites.google.com/site/professorlucianodaniel
from scipy.io import savemat
from numpy import random
from numpy import linalg
import time
def pause():
input("Press the <ENTER> key to continue...")
dim = int(input('Dimension of the square random matrix:'))
A = random.rand(... | [
"numpy.random.rand",
"numpy.linalg.eigvals",
"scipy.io.savemat",
"time.time"
] | [((308, 329), 'numpy.random.rand', 'random.rand', (['dim', 'dim'], {}), '(dim, dim)\n', (319, 329), False, 'from numpy import random\n'), ((356, 400), 'scipy.io.savemat', 'savemat', (['"""calc_autovalores_01.mat"""', "{'A': A}"], {}), "('calc_autovalores_01.mat', {'A': A})\n", (363, 400), False, 'from scipy.io import s... |
import numpy as np
import matplotlib.cbook as cbook
import matplotlib.docstring as docstring
import matplotlib.ticker as mticker
import matplotlib.transforms as mtransforms
from matplotlib.axes._base import _AxesBase
def _make_secondary_locator(rect, parent):
"""
Helper function to locate the secondary axes.... | [
"matplotlib.cbook._make_keyword_only",
"matplotlib.transforms.TransformedBbox",
"matplotlib.transforms.Bbox.from_bounds",
"matplotlib.ticker.FixedLocator",
"matplotlib.cbook._warn_external",
"numpy.array",
"matplotlib.docstring.interpd.update",
"matplotlib.ticker.NullLocator"
] | [((14292, 14351), 'matplotlib.docstring.interpd.update', 'docstring.interpd.update', ([], {'_secax_docstring': '_secax_docstring'}), '(_secax_docstring=_secax_docstring)\n', (14316, 14351), True, 'import matplotlib.docstring as docstring\n'), ((830, 865), 'matplotlib.transforms.Bbox.from_bounds', 'mtransforms.Bbox.from... |
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
def _split_cols(mat, lengths):
"""Split a 2D matrix to variable length columns."""
assert mat.size()[1] == sum(lengths), "Lengths must be summed to num columns"
l = np.cumsum([0] + lengths)
results = []
for s, e ... | [
"torch.randn",
"torch.nn.functional.softmax",
"torch.nn.init.xavier_uniform",
"numpy.cumsum",
"torch.nn.init.normal",
"torch.nn.functional.sigmoid",
"torch.zeros",
"torch.nn.functional.softplus"
] | [((265, 289), 'numpy.cumsum', 'np.cumsum', (['([0] + lengths)'], {}), '([0] + lengths)\n', (274, 289), True, 'import numpy as np\n'), ((1426, 1490), 'torch.nn.init.xavier_uniform', 'nn.init.xavier_uniform', (['self.fc_read_parameters.weight'], {'gain': '(1.4)'}), '(self.fc_read_parameters.weight, gain=1.4)\n', (1448, 1... |
#######################f###########################################################
#
# apogee.tools.read: read various APOGEE data files
#
# contains:
#
# - allStar: read the allStar.fits file
# - apogeeDesign: read the apogeeDesign file
# - apogeeField: read the apogeeField fil... | [
"sys.stdout.write",
"apogee.tools.path.rcsamplePath",
"apogee.tools.path.allVisitPath",
"apogee.tools.download.astroNNAges",
"apogee.tools.path._redux_dr",
"numpy.argmax",
"apogee.tools.download.apogeeField",
"apogee.tools.path.distPath",
"numpy.isnan",
"numpy.argsort",
"numpy.lib.recfunctions.a... | [((1809, 1820), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (1814, 1820), False, 'from functools import wraps\n'), ((3027, 3038), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (3032, 3038), False, 'from functools import wraps\n'), ((19071, 19097), 'apogee.tools.path.allVisitPath', 'path.allVisitPa... |
# -*- coding: utf-8 -*-
import matplotlib
import matplotlib.gridspec
import matplotlib.pyplot as plt
import numpy as np
def microstates_plot(microstates, segmentation=None, gfp=None, info=None, epoch=None):
"""**Visualize Microstates**
Plots the clustered microstates.
Parameters
----------
micro... | [
"matplotlib.colors.Normalize",
"matplotlib.pyplot.cm.ScalarMappable",
"numpy.arange",
"matplotlib.pyplot.cm.get_cmap",
"mne.viz.plot_topomap"
] | [((3211, 3239), 'matplotlib.pyplot.cm.get_cmap', 'plt.cm.get_cmap', (['"""plasma"""', 'n'], {}), "('plasma', n)\n", (3226, 3239), True, 'import matplotlib.pyplot as plt\n'), ((3705, 3757), 'matplotlib.colors.Normalize', 'matplotlib.colors.Normalize', ([], {'vmin': '(-0.5)', 'vmax': '(n - 0.5)'}), '(vmin=-0.5, vmax=n - ... |
"""
The purpose of this file is to demonstrate how one might write
naive code to do k-nearest neighbors by manually computing the
distances from a point to a collection of points and then using
argsort to find the indices of the closest points in the collection
"""
import matplotlib.pyplot as plt
import numpy as np
... | [
"matplotlib.pyplot.show",
"numpy.sum",
"numpy.random.randn",
"matplotlib.pyplot.scatter",
"numpy.zeros",
"numpy.argsort",
"matplotlib.pyplot.figure",
"numpy.array"
] | [((477, 502), 'numpy.random.randn', 'np.random.randn', (['(N * 2)', '(2)'], {}), '(N * 2, 2)\n', (492, 502), True, 'import numpy as np\n'), ((516, 534), 'numpy.array', 'np.array', (['[10, 10]'], {}), '([10, 10])\n', (524, 534), True, 'import numpy as np\n'), ((543, 559), 'numpy.array', 'np.array', (['[3, 3]'], {}), '([... |
import numpy as np
import matplotlib.pyplot as plt
import math
x = np.arange(0, np.pi*2, 0.1)
y = np.sin(x)
yHalf = y/2
def rms(array):
sumOfSquares = 0.0
for val in array:
sumOfSquares += val**2.0
meanSquare = sumOfSquares / array.size
return meanSquare ** 0.5
combinedRMS = ((rms(y)**2.0 + rms(yH... | [
"numpy.sin",
"numpy.arange",
"numpy.concatenate"
] | [((68, 96), 'numpy.arange', 'np.arange', (['(0)', '(np.pi * 2)', '(0.1)'], {}), '(0, np.pi * 2, 0.1)\n', (77, 96), True, 'import numpy as np\n'), ((100, 109), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (106, 109), True, 'import numpy as np\n'), ((360, 397), 'numpy.concatenate', 'np.concatenate', (['(y, yHalf)'], {'ax... |
"""Genetic Algorithm.
"""
import copy
import numpy as np
import opytimizer.math.distribution as d
import opytimizer.math.general as g
import opytimizer.math.random as r
import opytimizer.utils.constant as c
import opytimizer.utils.exception as e
import opytimizer.utils.logging as l
from opytimizer.core import Optimi... | [
"opytimizer.math.random.generate_uniform_random_number",
"copy.deepcopy",
"numpy.sum",
"numpy.max",
"opytimizer.utils.logging.get_logger",
"opytimizer.math.random.generate_gaussian_random_number",
"opytimizer.utils.exception.ValueError",
"opytimizer.math.distribution.generate_choice_distribution",
"... | [((334, 356), 'opytimizer.utils.logging.get_logger', 'l.get_logger', (['__name__'], {}), '(__name__)\n', (346, 356), True, 'import opytimizer.utils.logging as l\n'), ((3345, 3360), 'numpy.max', 'np.max', (['fitness'], {}), '(fitness)\n', (3351, 3360), True, 'import numpy as np\n'), ((3675, 3694), 'numpy.sum', 'np.sum',... |
import os
import time
import can
import math
import numpy as np
from constants import *
bus_filters = [{"can_id": CAN_DRIVERLESS_ID, "can_mask": 0xfff, "extended": False}]
bus = can.interface.Bus(bustype='socketcan', channel='vcan0', bitrate=500000, receive_own_messages=False)
bus.set_filters(bus_filters)
steering_ta... | [
"math.radians",
"math.tan",
"math.sin",
"time.time",
"can.interface.Bus",
"can.Message",
"math.cos",
"numpy.random.normal"
] | [((178, 281), 'can.interface.Bus', 'can.interface.Bus', ([], {'bustype': '"""socketcan"""', 'channel': '"""vcan0"""', 'bitrate': '(500000)', 'receive_own_messages': '(False)'}), "(bustype='socketcan', channel='vcan0', bitrate=500000,\n receive_own_messages=False)\n", (195, 281), False, 'import can\n'), ((465, 476), ... |
# -*- coding: utf-8 -*-
"""
This example demonstrates some of the plotting items available in pyqtgraph.
"""
import initExample ## Add path to library (just for examples; you do not need this)
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import pyqtgraph as pg
app = pg.mkQApp("InfiniteLine Example")
win... | [
"pyqtgraph.TargetItem",
"pyqtgraph.mkQApp",
"pyqtgraph.Qt.QtCore.QPoint",
"numpy.random.normal",
"pyqtgraph.LinearRegionItem",
"pyqtgraph.setConfigOptions",
"pyqtgraph.InfLineLabel",
"pyqtgraph.Qt.QtCore.QPointF",
"pyqtgraph.InfiniteLine",
"pyqtgraph.GraphicsLayoutWidget"
] | [((283, 316), 'pyqtgraph.mkQApp', 'pg.mkQApp', (['"""InfiniteLine Example"""'], {}), "('InfiniteLine Example')\n", (292, 316), True, 'import pyqtgraph as pg\n'), ((323, 390), 'pyqtgraph.GraphicsLayoutWidget', 'pg.GraphicsLayoutWidget', ([], {'show': '(True)', 'title': '"""Plotting items examples"""'}), "(show=True, tit... |
import numpy as np
grid = [['X', 'X', '?'], ['X', '?', 'X'], ['X', '?', '?']]
# Convert list of lists to a numpy array
arr = np.array(grid)
# Pad the array
arr_pad = np.pad(arr, ((1, 1), (1, 1)), 'constant')
arr_pad[arr_pad == '?'] = 0
count = 0
for i in range(1, len(grid) + 1):
for j in range(1, len(grid) + 1):... | [
"numpy.pad",
"numpy.array"
] | [((127, 141), 'numpy.array', 'np.array', (['grid'], {}), '(grid)\n', (135, 141), True, 'import numpy as np\n'), ((168, 209), 'numpy.pad', 'np.pad', (['arr', '((1, 1), (1, 1))', '"""constant"""'], {}), "(arr, ((1, 1), (1, 1)), 'constant')\n", (174, 209), True, 'import numpy as np\n')] |
from cmath import exp
import numpy as np
import pandas as pd
from itertools import product
from sklearn.model_selection import train_test_split
def eta_sample(n):
return np.random.uniform(-1, 1, size=n)
def epsilon_sample(n):
return np.random.uniform(-1, 1, size=n)
def exp_te(x):
return np.exp(2*x[0... | [
"numpy.random.seed",
"numpy.random.random_sample",
"sklearn.model_selection.train_test_split",
"numpy.random.multinomial",
"numpy.random.randint",
"numpy.arange",
"numpy.exp",
"numpy.random.normal",
"numpy.round",
"pandas.DataFrame",
"numpy.random.randn",
"numpy.linspace",
"numpy.random.shuf... | [((178, 210), 'numpy.random.uniform', 'np.random.uniform', (['(-1)', '(1)'], {'size': 'n'}), '(-1, 1, size=n)\n', (195, 210), True, 'import numpy as np\n'), ((247, 279), 'numpy.random.uniform', 'np.random.uniform', (['(-1)', '(1)'], {'size': 'n'}), '(-1, 1, size=n)\n', (264, 279), True, 'import numpy as np\n'), ((308, ... |
from __future__ import division
import numpy as np
import logging
import os
from copy import deepcopy
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
# viridis = cm.get_cmap('viridis', lut=10)
# magma = cm.get_cmap('magma')
# hot = cm.get... | [
"copy.deepcopy",
"numpy.zeros_like",
"numpy.abs",
"os.makedirs",
"matplotlib.cm.get_cmap",
"numpy.std",
"logging.warning",
"numpy.floor",
"numpy.percentile",
"numpy.array",
"numpy.arange"
] | [((1426, 1463), 'numpy.array', 'np.array', (['[cmp_rgb]'], {'dtype': 'np.float32'}), '([cmp_rgb], dtype=np.float32)\n', (1434, 1463), True, 'import numpy as np\n'), ((1808, 1832), 'numpy.arange', 'np.arange', (['(0.0)', '(1.1)', '(0.1)'], {}), '(0.0, 1.1, 0.1)\n', (1817, 1832), True, 'import numpy as np\n'), ((1899, 19... |
import os
import warnings
from math import ceil
import numpy as np
import cutde.backend as backend
source_dir = os.path.dirname(os.path.realpath(__file__))
DISP_FS = ("disp_fs", 3)
STRAIN_FS = ("strain_fs", 6)
DISP_HS = ("disp_hs", 3)
STRAIN_HS = ("strain_hs", 6)
class Placeholder:
pass
placeholder = Placeh... | [
"numpy.ceil",
"cutde.backend.get",
"math.ceil",
"cutde.backend.load_module",
"os.path.realpath",
"cutde.backend.max_block_size",
"cutde.backend.to",
"numpy.zeros",
"numpy.empty",
"numpy.ascontiguousarray",
"numpy.dtype",
"numpy.cumsum",
"cutde.backend.np_to_c_type",
"cutde.backend.zeros",
... | [((131, 157), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (147, 157), False, 'import os\n'), ((4062, 4088), 'cutde.backend.max_block_size', 'backend.max_block_size', (['(16)'], {}), '(16)\n', (4084, 4088), True, 'import cutde.backend as backend\n'), ((4250, 4324), 'cutde.backend.load_mod... |
import os
import numpy as np
from dipy.data import get_data
from dipy.reconst.gqi import GeneralizedQSampling
from dipy.reconst.dti import Tensor
from dipy.tracking.propagation import EuDX
from dipy.tracking.propspeed import ndarray_offset
from dipy.tracking.metrics import length
import nibabel as ni
from nose.tools... | [
"numpy.load",
"dipy.tracking.metrics.length",
"nibabel.load",
"numpy.zeros",
"dipy.data.get_data",
"numpy.ones",
"numpy.arange",
"numpy.loadtxt",
"numpy.array",
"dipy.tracking.propagation.EuDX",
"numpy.random.rand",
"dipy.reconst.gqi.GeneralizedQSampling",
"dipy.reconst.dti.Tensor",
"numpy... | [((568, 589), 'dipy.data.get_data', 'get_data', (['"""small_64D"""'], {}), "('small_64D')\n", (576, 589), False, 'from dipy.data import get_data\n'), ((604, 619), 'numpy.load', 'np.load', (['fbvals'], {}), '(fbvals)\n', (611, 619), True, 'import numpy as np\n'), ((634, 649), 'numpy.load', 'np.load', (['fbvecs'], {}), '... |
"""feature_importance.py
Computes feature contribution scores via DeepLIFT (Shrikumar et al., 2016) &
determines most important features via paired t-test with adjustment
for multiple comparisons (Bonferroni correction) using said scores.
Requires: NumPy, SciPy, DeepLIFT (and their dependencies)
Author: <NAME>... | [
"os.path.abspath",
"numpy.abs",
"numpy.subtract",
"numpy.sum",
"numpy.seterr",
"numpy.empty",
"numpy.square",
"numpy.zeros",
"numpy.isnan",
"time.time",
"deeplift.conversion.kerasapi_conversion.convert_model_from_saved_files",
"collections.OrderedDict",
"numpy.add",
"numpy.sqrt"
] | [((898, 953), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""', 'over': '"""raise"""', 'under': '"""raise"""'}), "(divide='ignore', over='raise', under='raise')\n", (907, 953), True, 'import numpy as np\n'), ((6294, 6395), 'deeplift.conversion.kerasapi_conversion.convert_model_from_saved_files', 'kc.convert_... |
"""Unit tests for prediction_io.py."""
import copy
import unittest
import numpy
from gewittergefahr.gg_utils import time_conversion
from ml4tc.io import prediction_io
TOLERANCE = 1e-6
# The following constants are used to test subset*.
TARGET_CLASSES = numpy.array([0, 1, 2, 2, 1, 0, 0, 2, 1, 1, 0, 2], dtype=int)
FOR... | [
"numpy.full",
"unittest.main",
"copy.deepcopy",
"numpy.allclose",
"numpy.array",
"ml4tc.io.prediction_io.find_file",
"numpy.array_equal",
"ml4tc.io.prediction_io.file_name_to_metadata",
"gewittergefahr.gg_utils.time_conversion.string_to_unix_sec"
] | [((256, 316), 'numpy.array', 'numpy.array', (['[0, 1, 2, 2, 1, 0, 0, 2, 1, 1, 0, 2]'], {'dtype': 'int'}), '([0, 1, 2, 2, 1, 0, 0, 2, 1, 1, 0, 2], dtype=int)\n', (267, 316), False, 'import numpy\n'), ((340, 562), 'numpy.array', 'numpy.array', (['[[1, 0, 0], [0, 1, 0], [0, 0, 1], [1.0 / 3, 1.0 / 3, 1.0 / 3], [0.5, 0.25, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import numpy as np
import pandas as pd
import datetime as dt
from scipy import stats
import pymannkendall as mk
from Modules import Read
from Modules.Utils import Listador, FindOutlier, FindOutlierMAD, Cycles
from Modules.Graphs import GraphSerieOutliers, Graph... | [
"pandas.DataFrame",
"scipy.stats.norm.ppf",
"pymannkendall.hamed_rao_modification_test",
"numpy.sum",
"numpy.median",
"Modules.Utils.Listador",
"os.path.dirname",
"Modules.ENSO.ONIdata",
"numpy.where",
"numpy.nanmean",
"Modules.Read.EstacionCSV_pd",
"numpy.array",
"pandas.Series",
"scipy.s... | [((395, 404), 'Modules.ENSO.ONIdata', 'ONIdata', ([], {}), '()\n', (402, 404), False, 'from Modules.ENSO import ONIdata, OuliersENSOjust\n'), ((5833, 5865), 'Modules.Utils.Listador', 'Listador', (['Est_path'], {'final': '""".csv"""'}), "(Est_path, final='.csv')\n", (5841, 5865), False, 'from Modules.Utils import Listad... |
import numpy as np
import psyneulink as pnl
import psyneulink.core.components.functions.transferfunctions
from psyneulink.core.components.functions.statefulfunctions.integratorfunctions import AccumulatorIntegrator
from psyneulink.core.components.functions.transferfunctions import Logistic
from psyneulink.core.compone... | [
"psyneulink.core.components.mechanisms.modulatory.control.gating.gatingmechanism.GatingMechanism",
"psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism",
"numpy.allclose",
"numpy.zeros",
"psyneulink.GatingMechanism",
"numpy.sin",
"numpy.array",
"psyneulink.core.compone... | [((976, 1040), 'psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism', 'TransferMechanism', ([], {'name': '"""Input Layer"""', 'function': 'Logistic', 'size': '(2)'}), "(name='Input Layer', function=Logistic, size=2)\n", (993, 1040), False, 'from psyneulink.core.components.mechanisms.pro... |
# Author: <NAME> <<EMAIL>>
# License: BSD
import numpy as np
from scipy import sparse
from ..graph import graph_laplacian
def test_graph_laplacian():
for mat in (np.arange(10) * np.arange(10)[:, np.newaxis],
np.ones((7, 7)),
np.eye(19),
np.vander(np.arange(4)) + n... | [
"numpy.zeros",
"numpy.ones",
"scipy.sparse.csr_matrix",
"numpy.arange",
"numpy.eye",
"numpy.testing.assert_array_almost_equal"
] | [((232, 247), 'numpy.ones', 'np.ones', (['(7, 7)'], {}), '((7, 7))\n', (239, 247), True, 'import numpy as np\n'), ((265, 275), 'numpy.eye', 'np.eye', (['(19)'], {}), '(19)\n', (271, 275), True, 'import numpy as np\n'), ((381, 403), 'scipy.sparse.csr_matrix', 'sparse.csr_matrix', (['mat'], {}), '(mat)\n', (398, 403), Fa... |
"""
Script that trains Tensorflow Progressive Multitask models on UV datasets.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import tempfile
import shutil
import numpy as np
import deepchem as dc
from MERCK_datasets import load_uv
# Set nu... | [
"MERCK_datasets.load_uv",
"numpy.random.seed",
"deepchem.metrics.Metric"
] | [((329, 348), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (343, 348), True, 'import numpy as np\n'), ((479, 552), 'MERCK_datasets.load_uv', 'load_uv', ([], {'shard_size': 'shard_size', 'num_shards_per_batch': 'num_shards_per_batch'}), '(shard_size=shard_size, num_shards_per_batch=num_shards_per_b... |
import os
import copy
from enum import Enum
import mujoco_py
import numpy as np
from gym.utils import EzPickle, transformations as tf
from gym.envs.robotics.robot_env import RobotEnv
from gym.envs.robotics.utils import reset_mocap2body_xpos, reset_mocap_welds
def _check_range(a, a_min, a_max, include_bounds=True):
... | [
"gym.envs.robotics.utils.reset_mocap_welds",
"gym.utils.EzPickle.__init__",
"os.path.dirname",
"numpy.zeros",
"numpy.all",
"numpy.clip",
"numpy.linalg.norm",
"gym.envs.robotics.utils.reset_mocap2body_xpos",
"mujoco_py.MjSimState",
"os.path.join",
"mujoco_py.functions.mj_contactForce",
"numpy.c... | [((357, 392), 'numpy.all', 'np.all', (['((a_min <= a) & (a <= a_max))'], {}), '((a_min <= a) & (a <= a_max))\n', (363, 392), True, 'import numpy as np\n'), ((418, 451), 'numpy.all', 'np.all', (['((a_min < a) & (a < a_max))'], {}), '((a_min < a) & (a < a_max))\n', (424, 451), True, 'import numpy as np\n'), ((1057, 1083)... |
import bert_pytorch
import numpy as np
import sys,os
import json
from transformers import AutoTokenizer, AutoModel
import torch
import ijson
import torch.nn as nn
from tqdm import tqdm
import random
from multiprocessing import set_start_method
try:
set_start_method('spawn')
except RuntimeError:
pass
part_li... | [
"tqdm.tqdm",
"json.loads",
"numpy.asarray",
"multiprocessing.set_start_method",
"json.dumps",
"transformers.AutoModel.from_pretrained",
"transformers.AutoTokenizer.from_pretrained",
"numpy.array",
"torch.cuda.is_available",
"numpy.savez",
"torch.no_grad",
"os.path.join",
"torch.tensor"
] | [((255, 280), 'multiprocessing.set_start_method', 'set_start_method', (['"""spawn"""'], {}), "('spawn')\n", (271, 280), False, 'from multiprocessing import set_start_method\n'), ((4898, 4909), 'tqdm.tqdm', 'tqdm', (['da_js'], {}), '(da_js)\n', (4902, 4909), False, 'from tqdm import tqdm\n'), ((8515, 8543), 'numpy.array... |
#!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2015, <NAME> <<EMAIL>>
# Copyright (c) 2021 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA_MCCNN
#
# https://github.com/CNES/Pandora_MCCNN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... | [
"numpy.stack",
"numpy.random.uniform",
"h5py.File",
"math.sin",
"cv2.warpAffine",
"numpy.array",
"math.cos",
"numpy.matmul",
"numpy.concatenate"
] | [((1465, 1491), 'h5py.File', 'h5py.File', (['sample_hdf', '"""r"""'], {}), "(sample_hdf, 'r')\n", (1474, 1491), False, 'import h5py\n'), ((1513, 1538), 'h5py.File', 'h5py.File', (['image_hdf', '"""r"""'], {}), "(image_hdf, 'r')\n", (1522, 1538), False, 'import h5py\n'), ((6502, 6548), 'numpy.stack', 'np.stack', (['(lef... |
#coding:utf-8
import cv2
import json
import requests
import numpy as np
import time
import threading
import subprocess
import re
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
def get_ping_result(ip_address):
p = subprocess.Popen(["ping.exe", ip_address], stdin=subprocess.PIPE,... | [
"subprocess.Popen",
"json.loads",
"json.dumps",
"time.time",
"cv2.imread",
"numpy.array",
"cv2.imencode",
"re.search"
] | [((3096, 3115), 'cv2.imread', 'cv2.imread', (['"""1.jpg"""'], {}), "('1.jpg')\n", (3106, 3115), False, 'import cv2\n'), ((255, 385), 'subprocess.Popen', 'subprocess.Popen', (["['ping.exe', ip_address]"], {'stdin': 'subprocess.PIPE', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE', 'shell': '(True)'}), "(['ping... |
# import gym
import numpy as np
import random
import tensorflow as tf
import tensorflow.contrib.slim as slim
import matplotlib.pyplot as plt
import scipy.misc
import os
import time
from gridmap import Map
env = Map(7)
class Qnetwork():
def __init__(self, h_size, rnn_cell, myScope, lr):
self.scalarInput = ... | [
"tensorflow.trainable_variables",
"random.sample",
"tensorflow.reset_default_graph",
"tensorflow.reshape",
"tensorflow.matmul",
"tensorflow.multiply",
"numpy.random.randint",
"numpy.mean",
"tensorflow.split",
"numpy.zeros_like",
"tensorflow.one_hot",
"os.path.exists",
"tensorflow.concat",
... | [((212, 218), 'gridmap.Map', 'Map', (['(7)'], {}), '(7)\n', (215, 218), False, 'from gridmap import Map\n'), ((6475, 6499), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (6497, 6499), True, 'import tensorflow as tf\n'), ((6566, 6633), 'tensorflow.contrib.rnn.BasicLSTMCell', 'tf.contrib.r... |
import numpy as np
from sys import stdin
import functools as fntls
import operator as op
def step(g, alg, stepnum):
h = len(g)
w = len(g[0])
res = g.copy()
for i in range(1, h - 1):
for j in range(1, w - 1):
lookup = int(''.join(
map(str, map(int, g[i - 1:i + 2, j... | [
"numpy.pad",
"functools.partial",
"sys.stdin.read"
] | [((452, 500), 'numpy.pad', 'np.pad', (['res', '(2)'], {'constant_values': '(stepnum % 2 == 0)'}), '(res, 2, constant_values=stepnum % 2 == 0)\n', (458, 500), True, 'import numpy as np\n'), ((692, 704), 'numpy.pad', 'np.pad', (['g', '(2)'], {}), '(g, 2)\n', (698, 704), True, 'import numpy as np\n'), ((570, 595), 'functo... |
'print the most likely path of all the utterances of a dataset'
import argparse
import os
import pickle
import sys
import numpy as np
import beer
EPS = 1e-5
def setup(parser):
parser.add_argument('-S', '--state', action='store_true',
help='state level posteriors')
parser.add_argum... | [
"numpy.save",
"numpy.log",
"pickle.load",
"sys.stdin.readlines",
"os.path.join"
] | [((1219, 1233), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1230, 1233), False, 'import pickle\n'), ((1330, 1344), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1341, 1344), False, 'import pickle\n'), ((2242, 2285), 'os.path.join', 'os.path.join', (['args.outdir', 'f"""{uttname}.npy"""'], {}), "(args.ou... |
# here i take all walkers and do trace plots, corner plots and histograms
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import poisson, norm, bernoulli, expon, uniform, beta, gamma, multinomial, multivariate_normal
from scipy.stats import rv_histogram
from scipy.special import... | [
"matplotlib.pyplot.loglog",
"necessary_functions.thin_a_sample",
"numpy.sum",
"numpy.log",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"numpy.zeros",
"sklearn.preprocessing.OneHotEncoder",
"numpy.ones",
"scipy.stats.dirichlet.rvs",
"numpy.max",
"numpy.mean... | [((936, 980), 'numpy.loadtxt', 'np.loadtxt', (["(data_dir + '/processed_data.dat')"], {}), "(data_dir + '/processed_data.dat')\n", (946, 980), True, 'import numpy as np\n'), ((994, 1046), 'numpy.loadtxt', 'np.loadtxt', (["(data_dir + '/processed_data_smeared.dat')"], {}), "(data_dir + '/processed_data_smeared.dat')\n",... |
#!/usr/bin/env python
# coding: utf8
import numpy as np
from forecaster.engine.engine import *
class MovingAverage(Engine):
def __init__(self, preprocessed_data, window):
super().__init__(preprocessed_data)
self.window = window
def predict(self):
for i in range(len(self.validation.c... | [
"numpy.mean"
] | [((393, 468), 'numpy.mean', 'np.mean', (['self.training[self.training.columns[-self.window:]].values'], {'axis': '(1)'}), '(self.training[self.training.columns[-self.window:]].values, axis=1)\n', (400, 468), True, 'import numpy as np\n'), ((810, 849), 'numpy.mean', 'np.mean', (['[self.predictions[:i]]'], {'axis': '(1)'... |
import tensorflow as tf
import numpy as np
import random
def create_patches(image, patch_size, overlap_horizontal, overlap_vertical, n_patches=0, order='ranked'):
"""
This function takes an image (whole spot of prostate cancer biopsy for example) and cuts it into a variable number
of patches, which may or... | [
"numpy.pad",
"numpy.ceil",
"random.shuffle",
"numpy.floor",
"tensorflow.reshape",
"numpy.ones",
"numpy.argsort",
"numpy.arange",
"numpy.tile",
"numpy.array",
"tensorflow.numpy_function"
] | [((1937, 2047), 'numpy.pad', 'np.pad', (['image', '[[pad0 // 2, pad0 - pad0 // 2], [pad1 // 2, pad1 - pad1 // 2], [0, 0]]'], {'constant_values': '(255)'}), '(image, [[pad0 // 2, pad0 - pad0 // 2], [pad1 // 2, pad1 - pad1 // 2],\n [0, 0]], constant_values=255)\n', (1943, 2047), True, 'import numpy as np\n'), ((2890, ... |
import numpy as np
import logging
logger = logging.getLogger(__name__)
class Grid(object):
"""
Class to manage the retiling of large-scale point-cloud data to a regular
grid. Tools allow to verify whether points belong to a given tile, and to
generate target points for feature extraction
"""
... | [
"numpy.meshgrid",
"numpy.logical_and",
"numpy.floor",
"logging.getLogger",
"numpy.isclose",
"numpy.rint",
"numpy.array",
"numpy.logical_or",
"numpy.arange",
"numpy.all"
] | [((45, 72), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (62, 72), False, 'import logging\n'), ((1700, 1750), 'numpy.array', 'np.array', (['[self.min_x, self.min_y]'], {'dtype': 'np.float'}), '([self.min_x, self.min_y], dtype=np.float)\n', (1708, 1750), True, 'import numpy as np\n'), ((... |
################################################################################
# Copyright (C) 2013 <NAME>
#
# This file is licensed under the MIT License.
################################################################################
"""
Unit tests for bayespy.utils.linalg module.
"""
import numpy as np
from .... | [
"numpy.sum",
"numpy.random.randn",
"numpy.asarray",
"numpy.allclose",
"numpy.ones",
"numpy.linalg.inv",
"numpy.reshape",
"numpy.linalg.slogdet",
"numpy.dot"
] | [((4931, 4948), 'numpy.dot', 'np.dot', (['C', 'x_true'], {}), '(C, x_true)\n', (4937, 4948), True, 'import numpy as np\n'), ((4966, 4993), 'numpy.reshape', 'np.reshape', (['x_true', '(N, -1)'], {}), '(x_true, (N, -1))\n', (4976, 4993), True, 'import numpy as np\n'), ((5006, 5028), 'numpy.reshape', 'np.reshape', (['y', ... |
"""Deep Dreaming using Caffe and Google's Inception convolutional neural network."""
# pylint: disable=invalid-name, wrong-import-position
from collections import namedtuple, OrderedDict
import logging
import multiprocessing as mp
import os
from pathlib import Path
import queue
import re
import sys
os.environ['GLOG_... | [
"numpy.sum",
"numpy.random.seed",
"numpy.abs",
"multiprocessing.get_context",
"pathlib.Path",
"numpy.random.randint",
"numpy.round",
"numpy.prod",
"numpy.zeros_like",
"re.fullmatch",
"OpenEXR.Header",
"numpy.finfo",
"numpy.dstack",
"tqdm.tqdm",
"numpy.roll",
"scipy.ndimage.convolve1d",... | [((886, 913), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (903, 913), False, 'import logging\n'), ((953, 976), 'multiprocessing.get_context', 'mp.get_context', (['"""spawn"""'], {}), "('spawn')\n", (967, 976), True, 'import multiprocessing as mp\n'), ((1077, 1130), 'collections.namedtu... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"tqdm.tqdm",
"numpy.sum",
"numpy.zeros",
"numpy.isnan",
"time.time",
"sklearn.metrics.roc_auc_score",
"numpy.random.randint",
"numpy.array",
"numpy.arange",
"numpy.random.shuffle"
] | [((1042, 1048), 'time.time', 'time', ([], {}), '()\n', (1046, 1048), False, 'from time import time\n'), ((1124, 1171), 'numpy.random.randint', 'np.random.randint', (['(0)', 'dataset.n_users', 'user_num'], {}), '(0, dataset.n_users, user_num)\n', (1141, 1171), True, 'import numpy as np\n'), ((1872, 1883), 'numpy.array',... |
# coding=utf-8
# Copyright 2022 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"absl.testing.absltest.main",
"gin.bind_parameter",
"trax.shapes.signature",
"numpy.ones",
"jax.random.PRNGKey",
"jax.random.randint",
"trax.models.research.hourglass.HourglassLM",
"trax.models.research.hourglass._parse_hierarchy",
"numpy.testing.assert_array_almost_equal",
"trax.fastmath.use_back... | [((4766, 4781), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (4779, 4781), False, 'from absl.testing import absltest\n'), ((1327, 1455), 'trax.models.research.hourglass.HourglassLM', 'hourglass.HourglassLM', (['vocab_size'], {'hierarchy': '"""2@3 2@6 2@3"""', 'vanilla_layers': '(1, 1)', 'd_model': '... |
import numpy as np
import matplotlib.pyplot as plt
from kernels import GaussianKernel
# generate the center of the gaussian and the grid
x_q = np.random.uniform(-1,1,2)
x_p = np.meshgrid(np.linspace(-5,5,100),np.linspace(-5,5,100))
x_p_0 = np.reshape(x_p[0],(-1,1))
x_p_1 = np.reshape(x_p[1],(-1,1))
# generate a rando... | [
"matplotlib.pyplot.pcolor",
"numpy.random.uniform",
"numpy.outer",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"kernels.GaussianKernel",
"numpy.hstack",
"numpy.random.random",
"numpy.linalg.norm",
"numpy.reshape",
"numpy.linspace"
] | [((144, 171), 'numpy.random.uniform', 'np.random.uniform', (['(-1)', '(1)', '(2)'], {}), '(-1, 1, 2)\n', (161, 171), True, 'import numpy as np\n'), ((241, 268), 'numpy.reshape', 'np.reshape', (['x_p[0]', '(-1, 1)'], {}), '(x_p[0], (-1, 1))\n', (251, 268), True, 'import numpy as np\n'), ((275, 302), 'numpy.reshape', 'np... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2018 <NAME> <<EMAIL>>
# Distributed under terms of the MIT license.
"""
Apply final FILTER cleanup and QUAL score recalibration
"""
import argparse
import sys
import pysam
import csv
from numpy import median
# Define global variables
filts_for_info = 'P... | [
"pysam.VariantFile",
"csv.reader",
"argparse.ArgumentParser",
"numpy.median"
] | [((4102, 4205), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=__doc__, formatter_class=argparse.\n RawDescriptionHelpFormatter)\n', (4125, 4205), False, 'import argparse\n'), ((872, 907), 'csv.reader', ... |
import numpy as np
import torch
from .layers import PeriodicConv2D
class CircUNet(torch.nn.Module):
""" Simple UNet module for image-to-image regression
Assumes image height and width are the same for input and output.
Note that default constructor uses PeriodicConv2D layers !
"""
def __in... | [
"torch.nn.ConvTranspose2d",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.cat",
"numpy.any",
"torch.nn.BatchNorm2d",
"torch.nn.MaxPool2d"
] | [((2419, 2451), 'torch.nn.ModuleList', 'torch.nn.ModuleList', (['self.layers'], {}), '(self.layers)\n', (2438, 2451), False, 'import torch\n'), ((2475, 2502), 'torch.nn.MaxPool2d', 'torch.nn.MaxPool2d', (['pooling'], {}), '(pooling)\n', (2493, 2502), False, 'import torch\n'), ((3352, 3384), 'torch.nn.ModuleList', 'torc... |
import os
gpuNo=os.environ["CUDA_VISIBLE_DEVICES"] = "0"
severNo='gpu'
import tensorflow as tf
from tflearn.layers.conv import global_avg_pool
from tensorflow.examples.tutorials.mnist import input_data
from tensorflow.contrib.layers import batch_norm, flatten
from tensorflow.contrib.framework import arg_scope
import op... | [
"numpy.load",
"numpy.random.seed",
"argparse.ArgumentParser",
"tensorflow.contrib.layers.flatten",
"tensorflow.reshape",
"tensorflow.ConfigProto",
"tensorflow.global_variables",
"tensorflow.layers.max_pooling2d",
"tensorflow.nn.relu",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"os.path.e... | [((395, 420), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (418, 420), False, 'import argparse\n'), ((1932, 1985), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""MNIST_data"""'], {'one_hot': '(True)'}), "('MNIST_data', one_hot=True)\n", (19... |
import numpy as np
class AutoDiff():
"""
Forward Mode Implementation of Automatic Differentiation
The class overloads the basic operations, including the unary operation,
and contains some elemental functions
"""
def __init__(self, val, der=1, name="not_specified"):
"""
constr... | [
"numpy.greater",
"numpy.ones",
"numpy.sin",
"numpy.exp",
"numpy.arcsin",
"numpy.tan",
"numpy.less",
"numpy.arccos",
"numpy.less_equal",
"numpy.tanh",
"numpy.cos",
"numpy.cosh",
"numpy.arctan",
"numpy.greater_equal",
"numpy.log",
"numpy.array",
"numpy.array_equal",
"numpy.sinh",
"... | [((22182, 22198), 'numpy.sin', 'np.sin', (['self.val'], {}), '(self.val)\n', (22188, 22198), True, 'import numpy as np\n'), ((22884, 22901), 'numpy.sinh', 'np.sinh', (['self.val'], {}), '(self.val)\n', (22891, 22901), True, 'import numpy as np\n'), ((23585, 23601), 'numpy.cos', 'np.cos', (['self.val'], {}), '(self.val)... |
import os.path as osp
import sys
import torch
import torch.utils.data as data
import cv2
import random
import numpy as np
from utils.util import gaussian2D, HRSC_CLASSES, DOTA_CLASSES, tricube_kernel
if sys.version_info[0] == 2:
import xml.etree.cElementTree as ET
else:
import xml.etree.ElementTree as ET
def... | [
"xml.etree.ElementTree.parse",
"cv2.warpPerspective",
"numpy.maximum",
"cv2.cvtColor",
"numpy.float32",
"utils.util.DOTA_CLASSES.index",
"numpy.zeros",
"numpy.ones",
"cv2.imread",
"numpy.array",
"numpy.tile",
"cv2.setNumThreads",
"utils.util.tricube_kernel",
"numpy.dot",
"os.path.join",
... | [((451, 478), 'utils.util.tricube_kernel', 'tricube_kernel', (['diameter', '(7)'], {}), '(diameter, 7)\n', (465, 478), False, 'from utils.util import gaussian2D, HRSC_CLASSES, DOTA_CLASSES, tricube_kernel\n'), ((495, 567), 'numpy.float32', 'np.float32', (['[[0, 0], [0, diameter], [diameter, diameter], [diameter, 0]]'],... |
#!/usr/bin/env python3
import numpy
size = 1000
randf = lambda n: numpy.random.randint(100, size=n)
x = randf(size).astype(numpy.float64)
y = randf(size).astype(numpy.float64)
result = x + y
def print_array(name, data, data_type='data_t', data_fmt='{}', fold=10):
print('static {} {}[DATA_SIZE] = {{'.format(dat... | [
"numpy.random.randint"
] | [((69, 102), 'numpy.random.randint', 'numpy.random.randint', (['(100)'], {'size': 'n'}), '(100, size=n)\n', (89, 102), False, 'import numpy\n')] |
import os
import tensorflow as tf
import numpy as np
from PIL import Image
tf.compat.v1.enable_eager_execution()
class Layers:
def __init__(self, num_classes, learning_rate, save_model_name='weights.npy', weights_file=None):
self.initializer = tf.initializers.glorot_uniform()
self.num_classes = nu... | [
"os.mkdir",
"tensorflow.compat.v1.losses.mean_squared_error",
"tensorflow.compat.v1.keras.initializers.glorot_uniform",
"numpy.argmax",
"tensorflow.nn.max_pool2d",
"tensorflow.matmul",
"tensorflow.initializers.glorot_uniform",
"tensorflow.nn.conv2d",
"tensorflow.nn.leaky_relu",
"os.path.join",
"... | [((76, 113), 'tensorflow.compat.v1.enable_eager_execution', 'tf.compat.v1.enable_eager_execution', ([], {}), '()\n', (111, 113), True, 'import tensorflow as tf\n'), ((8840, 8872), 'PIL.Image.open', 'Image.open', (['"""reference/test.png"""'], {}), "('reference/test.png')\n", (8850, 8872), False, 'from PIL import Image\... |
import functools
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import arviz as az
import natsort
from autocorr import AutoCorrTime
def _subset_quantile(dataset: az.InferenceData, q) -> az.InferenceData:
"""Get q'th quantile of the datas... | [
"matplotlib.pyplot.figaspect",
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.cm.get_cmap",
"numpy.argsort",
"numpy.arange",
"arviz.plot_autocorr",
"matplotlib.cm.ScalarMappable",
"matplotlib.pyplot.close",
"arviz.from_netcdf",
"numpy.max",
"autocorr.AutoCorrTime",
"functools.partial"... | [((592, 630), 'arviz.convert_to_inference_data', 'az.convert_to_inference_data', (['datadict'], {}), '(datadict)\n', (620, 630), True, 'import arviz as az\n'), ((979, 1017), 'arviz.convert_to_inference_data', 'az.convert_to_inference_data', (['datadict'], {}), '(datadict)\n', (1007, 1017), True, 'import arviz as az\n')... |
"""
Copyright (c) 2018-2022 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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | [
"numpy.array"
] | [((5980, 6011), 'numpy.array', 'np.array', (['valid_ids'], {'dtype': 'bool'}), '(valid_ids, dtype=bool)\n', (5988, 6011), True, 'import numpy as np\n'), ((6078, 6110), 'numpy.array', 'np.array', (['label_mask'], {'dtype': 'bool'}), '(label_mask, dtype=bool)\n', (6086, 6110), True, 'import numpy as np\n')] |
from IPython.core.error import UsageError
from mock import MagicMock
import numpy as np
from nose.tools import assert_equals, assert_is
import pandas as pd
from pandas.util.testing import assert_frame_equal
from sparkmagic.livyclientlib.exceptions import BadUserDataException
from sparkmagic.utils.utils import parse_ar... | [
"pandas.DataFrame",
"pandas.util.testing.assert_frame_equal",
"numpy.datetime64",
"sparkmagic.utils.utils.records_to_dataframe",
"nose.tools.assert_is",
"mock.MagicMock",
"IPython.core.error.UsageError"
] | [((1178, 1234), 'sparkmagic.utils.utils.records_to_dataframe', 'records_to_dataframe', (['result', 'SESSION_KIND_PYSPARK', '(True)'], {}), '(result, SESSION_KIND_PYSPARK, True)\n', (1198, 1234), False, 'from sparkmagic.utils.utils import parse_argstring_or_throw, records_to_dataframe\n'), ((1250, 1365), 'pandas.DataFra... |
""" Unit test for the Scipy GMRES linear solver. """
import unittest
import numpy as np
from openmdao.api import Group, Problem, IndepVarComp, ScipyGMRES, \
DirectSolver, ExecComp, LinearGaussSeidel, AnalysisError
from openmdao.test.converge_diverge import ConvergeDiverge, SingleDiamond, \
... | [
"openmdao.api.ExecComp",
"openmdao.test.simple_comps.DoubleArrayComp",
"openmdao.test.converge_diverge.ConvergeDiverge",
"openmdao.test.simple_comps.FanInGrouped",
"numpy.ones",
"numpy.linalg.norm",
"openmdao.api.Group",
"unittest.main",
"openmdao.api.IndepVarComp",
"openmdao.test.simple_comps.Sim... | [((19143, 19158), 'unittest.main', 'unittest.main', ([], {}), '()\n', (19156, 19158), False, 'import unittest\n'), ((871, 878), 'openmdao.api.Group', 'Group', ([], {}), '()\n', (876, 878), False, 'from openmdao.api import Group, Problem, IndepVarComp, ScipyGMRES, DirectSolver, ExecComp, LinearGaussSeidel, AnalysisError... |
from npnlp import minimize
import numpy as np
tol = 1e-6
def test_sqp1():
def J(x):
return np.array([x[0] ** 4 + x[1] ** 2 - x[0] ** 2 * x[1]])
x0 = np.array([0.5, 3.0])
nil = np.array([])
out = minimize(J, x0, Aeq=np.array([[1,0]]), beq=np.array([1]), method='SQP')
assert abs(out['x'][0]... | [
"numpy.array",
"npnlp.minimize"
] | [((168, 188), 'numpy.array', 'np.array', (['[0.5, 3.0]'], {}), '([0.5, 3.0])\n', (176, 188), True, 'import numpy as np\n'), ((199, 211), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (207, 211), True, 'import numpy as np\n'), ((620, 640), 'numpy.array', 'np.array', (['[0.5, 3.0]'], {}), '([0.5, 3.0])\n', (628, 640... |
import numpy as np
from simba.similarities import dynamax_jaccard, avg_cosine
from simba.evaluation import evaluate, evaluate_multiple
from simba.core import embed
EMBED_PATH_LARGE = "tests/fixtures/test_embed_large.txt"
SENTENCES1 = ["In the jungle the mighty jungle",
"The lion sleeps tonight",
... | [
"simba.similarities.dynamax_jaccard",
"numpy.allclose",
"simba.evaluation.evaluate_multiple",
"simba.evaluation.evaluate"
] | [((1392, 1443), 'simba.evaluation.evaluate', 'evaluate', (['embeddings1', 'embeddings2', 'dynamax_jaccard'], {}), '(embeddings1, embeddings2, dynamax_jaccard)\n', (1400, 1443), False, 'from simba.evaluation import evaluate, evaluate_multiple\n'), ((1455, 1485), 'numpy.allclose', 'np.allclose', (['expected', 'output_'],... |
import numpy as np
betas = np.array([[0.3,0.2,0.5],[0.4,0.2,0.4],[0.3,0.6,0.1]])
size_vocab = betas.shape[1]
print(betas.T)
ntopics = betas.shape[0]
print(ntopics)
print("> 1")
print(betas)
print("> 2")
print(np.log(betas))
print("> 3")
print(sum(np.log(betas)))
print("> 4")
print(sum(np.log(betas))/ntopics)
#betas... | [
"numpy.log",
"numpy.copy",
"numpy.ones",
"numpy.min",
"numpy.array"
] | [((28, 89), 'numpy.array', 'np.array', (['[[0.3, 0.2, 0.5], [0.4, 0.2, 0.4], [0.3, 0.6, 0.1]]'], {}), '([[0.3, 0.2, 0.5], [0.4, 0.2, 0.4], [0.3, 0.6, 0.1]])\n', (36, 89), True, 'import numpy as np\n'), ((650, 664), 'numpy.copy', 'np.copy', (['betas'], {}), '(betas)\n', (657, 664), True, 'import numpy as np\n'), ((213, ... |
from size_color import change_size_color
from skimage import io,transform,color
import numpy as np
import os
import cv2
folderList =os.listdir('J:\\gt_db')
#把存放数据文件的目录J:\\gt_db下的所有文件夹名的信息存放到一个变量folderlist中
#folderlist 是一个结构体变量数组
length=len(folderList)
AuImage_data={}
for i in range(length):
folderName = 'J:\\gt_db\... | [
"cv2.imwrite",
"numpy.zeros",
"os.listdir",
"size_color.change_size_color"
] | [((132, 155), 'os.listdir', 'os.listdir', (['"""J:\\\\gt_db"""'], {}), "('J:\\\\gt_db')\n", (142, 155), False, 'import os\n'), ((353, 375), 'os.listdir', 'os.listdir', (['folderName'], {}), '(folderName)\n', (363, 375), False, 'import os\n'), ((530, 557), 'size_color.change_size_color', 'change_size_color', (['fileName... |
import pytest
from .utils import digit_float
import numpy as np
vowel_data_y_dimension = 11
@pytest.fixture
def vowel_data():
from esl_model.datasets import VowelDataSet
data = VowelDataSet()
return data.return_all()
@pytest.fixture
def SAHeart_data():
from esl_model.datasets import SAHeartDataSet... | [
"esl_model.datasets.SAHeartDataSet",
"esl_model.ch4.models.LinearRegressionIndicatorMatrix",
"numpy.allclose",
"esl_model.ch4.models.RDAModel",
"esl_model.datasets.VowelDataSet",
"esl_model.ch4.models.QDAModel",
"numpy.isclose",
"esl_model.ch4.models.LDAForComputation",
"numpy.array",
"numpy.array... | [((189, 203), 'esl_model.datasets.VowelDataSet', 'VowelDataSet', ([], {}), '()\n', (201, 203), False, 'from esl_model.datasets import VowelDataSet\n'), ((332, 348), 'esl_model.datasets.SAHeartDataSet', 'SAHeartDataSet', ([], {}), '()\n', (346, 348), False, 'from esl_model.datasets import SAHeartDataSet\n'), ((462, 476)... |
import numpy as np
white = 0
black = 1
def other(color):
return not color
west = 2
east = 3
north = 4
south = 5
num_channels = 6
boardsize = 13
padding = 2
input_size = boardsize+2*padding
neighbor_patterns = ((-1,0), (0,-1), (-1,1), (0,1), (1,0), (1,-1))
input_shape = (num_channels,input_size,input_size)
def cell... | [
"numpy.transpose",
"numpy.rot90",
"numpy.zeros"
] | [((817, 850), 'numpy.zeros', 'np.zeros', (['input_shape'], {'dtype': 'bool'}), '(input_shape, dtype=bool)\n', (825, 850), True, 'import numpy as np\n'), ((866, 891), 'numpy.transpose', 'np.transpose', (['game[black]'], {}), '(game[black])\n', (878, 891), True, 'import numpy as np\n'), ((907, 932), 'numpy.transpose', 'n... |
#!/usr/bin/env python
"""
This module is contains all the relevant classes that form the second layer
between the SELMA GUI and the data objects. It contains the following classes:
+ :class: `SDMSignals`
+ :class: `SelmaDataModel`
"""
# ====================================================================
import os... | [
"PyQt5.QtCore.pyqtSignal",
"threading.Thread",
"SELMABatchAnalysis.ClassicBatchAnalysis",
"os.path.isdir",
"SELMADataIO.saveMask",
"SELMAData.SELMADataObject",
"SELMADataIO.loadMask",
"SELMABatchAnalysis.EnhancedBatchAnalysis",
"SELMADataIO.writeVesselDict",
"os.listdir",
"numpy.unique"
] | [((769, 798), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', (['np.ndarray'], {}), '(np.ndarray)\n', (786, 798), False, 'from PyQt5 import QtCore\n'), ((830, 859), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', (['np.ndarray'], {}), '(np.ndarray)\n', (847, 859), False, 'from PyQt5 import QtCore\n'), ((891, 920), 'PyQ... |
"""test masks."""
import os
import mercantile
import numpy
import pytest
import rasterio
from rasterio.coords import BoundingBox
from rasterio.crs import CRS
from rio_tiler import reader
tiles = {
"masked": mercantile.Tile(x=535, y=498, z=10),
"boundless": mercantile.Tile(x=540, y=497, z=10),
}
equator = {
... | [
"rasterio.open",
"mercantile.Tile",
"rasterio.coords.BoundingBox",
"numpy.testing.assert_array_equal",
"os.path.dirname",
"rio_tiler.reader.tile",
"numpy.array_equal",
"pytest.mark.parametrize",
"rasterio.crs.CRS.from_epsg"
] | [((2174, 2236), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""resampling"""', "['bilinear', 'nearest']"], {}), "('resampling', ['bilinear', 'nearest'])\n", (2197, 2236), False, 'import pytest\n'), ((2238, 2286), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""tile_name"""', "['masked']"], {}),... |
import numpy as np
import statsmodels.api as sm
import pandas as pd
from ..mixins import Preprocessor, AlwaysPredictPlotter, AdvantageEstimator
def _year_to_decade(yr):
"""
A simple function so I don't mess this up later, this constructs the *redistricting*
decade of a district. This is offset from the re... | [
"numpy.average",
"numpy.asarray",
"numpy.isnan",
"numpy.random.normal",
"statsmodels.api.GLS",
"statsmodels.api.add_constant",
"pandas.concat"
] | [((3249, 3307), 'pandas.concat', 'pd.concat', (['[model.params for model in self.models]'], {'axis': '(1)'}), '([model.params for model in self.models], axis=1)\n', (3258, 3307), True, 'import pandas as pd\n'), ((3828, 3874), 'numpy.asarray', 'np.asarray', (['self.wide[t][self._covariate_cols]'], {}), '(self.wide[t][se... |
import numpy as np
import librosa
import torch
import os
from librosa import amplitude_to_db
from math import floor
from models import modifyresnet18, UNet, Synthesizer
from util.validation import spec2wave
from image2instru import Instru_from_image
import soundfile as sf
import cv2
os.environ["CUDA_VISIBL... | [
"numpy.absolute",
"numpy.abs",
"librosa.resample",
"os.path.join",
"models.Synthesizer",
"numpy.multiply",
"numpy.transpose",
"numpy.reshape",
"numpy.linspace",
"soundfile.write",
"util.validation.spec2wave",
"numpy.log10",
"librosa.stft",
"cv2.resize",
"torch.cuda.is_available",
"torc... | [((460, 516), 'numpy.linspace', 'np.linspace', (['(SAMPLE_RATE / 2 / 512)', '(SAMPLE_RATE / 2)', '(512)'], {}), '(SAMPLE_RATE / 2 / 512, SAMPLE_RATE / 2, 512)\n', (471, 516), True, 'import numpy as np\n'), ((521, 542), 'numpy.log10', 'np.log10', (['frequencies'], {}), '(frequencies)\n', (529, 542), True, 'import numpy ... |
# 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.
"""Integrations tests for the LLVM CompilerGym environments."""
import gym
import numpy as np
import pytest
import compiler_gym # Register en... | [
"gym.make",
"tests.test_main.main",
"pytest.fixture",
"compiler_gym.service.connection.CompilerGymServiceConnection",
"numpy.zeros",
"compiler_gym.envs.llvm.llvm_env.LlvmEnv"
] | [((588, 649), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""', 'params': "['local', 'service']"}), "(scope='function', params=['local', 'service'])\n", (602, 649), False, 'import pytest\n'), ((1985, 1991), 'tests.test_main.main', 'main', ([], {}), '()\n', (1989, 1991), False, 'from tests.test_main i... |
from __future__ import print_function, division
import os
import sys
root = os.path.join(os.getcwd().split('src')[0], 'src')
if root not in sys.path:
sys.path.append(root)
from oracle.models import rf_model
from metrics.abcd import abcd
from pdb import set_trace
import numpy as np
import pandas
from tabulate imp... | [
"sys.path.append",
"datasets.handler2.get_all_datasets",
"pandas.read_csv",
"os.getcwd",
"metrics.abcd.abcd",
"numpy.mean",
"tabulate.tabulate",
"oracle.models.rf_model"
] | [((156, 177), 'sys.path.append', 'sys.path.append', (['root'], {}), '(root)\n', (171, 177), False, 'import sys\n'), ((1320, 1341), 'oracle.models.rf_model', 'rf_model', (['train', 'test'], {}), '(train, test)\n', (1328, 1341), False, 'from oracle.models import rf_model\n'), ((3294, 3312), 'datasets.handler2.get_all_dat... |
# Copyright (c) 2020, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... | [
"numpy.random.uniform",
"os.remove",
"finn.core.modelwrapper.ModelWrapper",
"finn.transformation.infer_shapes.InferShapes",
"finn.core.onnx_exec.execute_onnx",
"numpy.isclose",
"pytest.mark.parametrize",
"brevitas.nn.QuantHardTanh",
"brevitas.onnx.export_finn_onnx",
"torch.from_numpy"
] | [((2023, 2069), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""abits"""', '[1, 2, 4, 8]'], {}), "('abits', [1, 2, 4, 8])\n", (2046, 2069), False, 'import pytest\n'), ((2071, 2125), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""narrow_range"""', '[False, True]'], {}), "('narrow_range', [False,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.