code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
''' @FileName : data_parser.py @EditTime : 2021-11-29 13:59:47 @Author : <NAME> @Email : <EMAIL> @Description : ''' from __future__ import absolute_import from __future__ import print_function from __future__ import division import sys import os import os.path as osp import platform import json...
[ "os.path.exists", "collections.namedtuple", "os.listdir", "numpy.ones", "os.path.join", "numpy.max", "numpy.array", "numpy.zeros", "torch.tensor", "platform.system", "numpy.concatenate", "json.load" ]
[((452, 516), 'collections.namedtuple', 'namedtuple', (['"""Keypoints"""', "['keypoints', 'gender_gt', 'gender_pd']"], {}), "('Keypoints', ['keypoints', 'gender_gt', 'gender_pd'])\n", (462, 516), False, 'from collections import namedtuple\n'), ((676, 703), 'os.path.exists', 'os.path.exists', (['keypoint_fn'], {}), '(ke...
import numpy as np import matplotlib.pyplot as plt import math def log(list_name): for i in range(len(list_name)): list_name[i] = math.log10(list_name[i]) print(list_name[i]) return list_name size = 4 x = np.arange(size) video_file = [11132, 21164, 34452, 45208] # 每帧视频文件大小(byte) video_file ...
[ "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.bar", "matplotlib.pyplot.yticks", "math.log10", "numpy.arange", "matplotlib.pyplot.show" ]
[((232, 247), 'numpy.arange', 'np.arange', (['size'], {}), '(size)\n', (241, 247), True, 'import numpy as np\n'), ((533, 580), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Total Camera Numbers"""'], {'fontsize': '(20)'}), "('Total Camera Numbers', fontsize=20)\n", (543, 580), True, 'import matplotlib.pyplot as plt\n...
import numpy from chainer import cuda import chainer.serializers as S import chainer.links as L from nltk.corpus import stopwords from context_models import CbowContext, BiLstmContext from defs import IN_TO_OUT_UNITS_RATIO, NEGATIVE_SAMPLING_NUM class ModelReader(object): ''' Reads a pre-trained model using ...
[ "nltk.corpus.stopwords.words", "context_models.CbowContext", "numpy.empty", "context_models.BiLstmContext", "chainer.links.NegativeSampling", "chainer.serializers.load_npz" ]
[((2480, 2544), 'chainer.links.NegativeSampling', 'L.NegativeSampling', (['target_word_units', 'cs', 'NEGATIVE_SAMPLING_NUM'], {}), '(target_word_units, cs, NEGATIVE_SAMPLING_NUM)\n', (2498, 2544), True, 'import chainer.links as L\n'), ((2608, 2741), 'context_models.BiLstmContext', 'BiLstmContext', (['deep', 'self.gpu'...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012-2016 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...
[ "numpy.sqrt", "numpy.log", "numpy.exp", "openquake.hazardlib.gsim.base.CoeffsTable", "numpy.zeros", "copy.deepcopy" ]
[((23450, 23869), 'openquake.hazardlib.gsim.base.CoeffsTable', 'CoeffsTable', ([], {'sa_damping': '(5)', 'table': '""" IMT MF\n pga 0.50\n pgv 1.00\n 0.05 0.44\n 0.10 0.44\n 0.15 0.53\n 0.20 0.60\n 0.25 0.72\n 0.30 0.81\n 0.40 1.00\n 0.50 1.01\n 0.60 1.02\n...
# PRISM CONVERSION FROM ASCII GRIDS -- TASMIN / TASMAX # header info # ncols 2015 # nrows 1320 # xllcorner -2301787.7731349 # yllcorner 108069.7858797 # cellsize 2000 # NODATA_value -9999 import rasterio, glob, os from rasterio import Affine import numpy as np from pathos import multipro...
[ "os.path.exists", "os.makedirs", "pathos.multiprocessing.Pool", "numpy.flipud", "rasterio.open", "scipy.interpolate.griddata", "os.path.join", "os.path.dirname", "affine.Affine.translation", "os.path.basename", "pyproj.Proj", "os.system", "numpy.vectorize", "numpy.arange" ]
[((7696, 7722), 'rasterio.open', 'rasterio.open', (['template_fn'], {}), '(template_fn)\n', (7709, 7722), False, 'import rasterio\n'), ((7764, 7883), 'os.path.join', 'os.path.join', (['"""/workspace/Shared/Tech_Projects/EPSCoR_Southcentral/project_data/prism_v2"""', 'variable', '"""merged"""'], {}), "(\n '/workspace...
#!/usr/bin/py2 import cv2 import imutils import numpy as np from solver import Solver from Recognizer import OCR from skimage.segmentation import clear_border from imutils.perspective import four_point_transform class Sudoku(object): def __init__(self, image): self.image = image self.gray = None def initia...
[ "Recognizer.OCR", "cv2.drawContours", "cv2.countNonZero", "cv2.threshold", "solver.Solver", "cv2.arcLength", "cv2.bitwise_and", "skimage.segmentation.clear_border", "imutils.resize", "cv2.adaptiveThreshold", "imutils.grab_contours", "numpy.zeros", "cv2.approxPolyDP", "cv2.cvtColor", "cv2...
[((354, 376), 'cv2.imread', 'cv2.imread', (['self.image'], {}), '(self.image)\n', (364, 376), False, 'import cv2\n'), ((392, 429), 'imutils.resize', 'imutils.resize', (['self.image'], {'width': '(600)'}), '(self.image, width=600)\n', (406, 429), False, 'import imutils\n'), ((486, 530), 'cv2.cvtColor', 'cv2.cvtColor', (...
import numpy as np from public_tool.form_index import form_index from XGB_HMM.form_B_matrix_by_XGB import form_B_matrix_by_XGB from XGB_HMM.predict import self_pred def pred_proba_XGB(A, model, pi, O, allow_flag, lengths): # 对dataset形成pred_proba,注意这里的dataset是solve_on_raw_data后的结果,即附带allow_flag的数据 # ou...
[ "XGB_HMM.form_B_matrix_by_XGB.form_B_matrix_by_XGB", "numpy.zeros", "XGB_HMM.predict.self_pred", "public_tool.form_index.form_index" ]
[((397, 429), 'numpy.zeros', 'np.zeros', (['(O.shape[0], n_states)'], {}), '((O.shape[0], n_states))\n', (405, 429), True, 'import numpy as np\n'), ((501, 523), 'public_tool.form_index.form_index', 'form_index', (['lengths', 'i'], {}), '(lengths, i)\n', (511, 523), False, 'from public_tool.form_index import form_index\...
""" Software that detects each of the yellow shapes on the video frames and classifies the shapes into classes: circle, rectangle, triangle. USAGE: python3 shape_detection.py <video path> <output video path> """ import sys import cv2 import imutils import numpy as np from tqdm import tqdm BOX_COLORS = { "trian...
[ "numpy.array", "cv2.approxPolyDP", "sys.exit", "cv2.threshold", "cv2.arcLength", "numpy.zeros_like", "cv2.VideoWriter", "cv2.contourArea", "imutils.grab_contours", "cv2.drawContours", "cv2.putText", "cv2.morphologyEx", "cv2.cvtColor", "cv2.moments", "cv2.Canny", "cv2.GaussianBlur", "...
[((821, 846), 'cv2.Canny', 'cv2.Canny', (['image', '(10)', '(255)'], {}), '(image, 10, 255)\n', (830, 846), False, 'import cv2\n'), ((860, 912), 'cv2.getStructuringElement', 'cv2.getStructuringElement', (['cv2.MORPH_ELLIPSE', '(3, 3)'], {}), '(cv2.MORPH_ELLIPSE, (3, 3))\n', (885, 912), False, 'import cv2\n'), ((932, 98...
# -*- coding: utf-8 -*- # Copyright 2017, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. # pylint: disable=invalid-name,missing-docstring from test.python.common import QiskitTestCase import json import unittest ...
[ "numpy.trace", "numpy.sqrt", "numpy.array", "qiskit.qasm.Qasm", "numpy.linalg.norm", "unittest.main", "qiskit.QuantumJob", "qiskit.backends.local.qasm_simulator_cpp.x90_error_matrix", "qiskit.QuantumCircuit", "qiskit.backends.local.qasm_simulator_cpp.cx_error_matrix", "numpy.eye", "qiskit._com...
[((22521, 22547), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (22534, 22547), False, 'import unittest\n'), ((1345, 1368), 'qiskit.QuantumRegister', 'QuantumRegister', (['(2)', '"""q"""'], {}), "(2, 'q')\n", (1360, 1368), False, 'from qiskit import QuantumRegister\n'), ((1382, 1407),...
import json import random from typing import NamedTuple, Any import numpy from numpy.testing import assert_array_almost_equal, assert_almost_equal import torch import pytest from flaky import flaky from allennlp.common.checks import ConfigurationError from allennlp.common.testing import AllenNlpTestCase from allennlp...
[ "allennlp.nn.util.bucket_values", "allennlp.nn.util.masked_topk", "numpy.random.rand", "torch.LongTensor", "allennlp.nn.util.get_text_field_mask", "torch.max", "allennlp.nn.util.get_combined_dim", "torch.from_numpy", "allennlp.nn.util.add_sentence_boundary_token_ids", "numpy.array", "allennlp.nn...
[((40211, 40242), 'flaky.flaky', 'flaky', ([], {'max_runs': '(3)', 'min_passes': '(1)'}), '(max_runs=3, min_passes=1)\n', (40216, 40242), False, 'from flaky import flaky\n'), ((537, 725), 'torch.tensor', 'torch.tensor', (['[[True, True, True, False, False, False], [True, True, False, False, False,\n False], [True, T...
"""PyMC3-ArviZ conversion code.""" import logging import warnings from typing import ( # pylint: disable=unused-import TYPE_CHECKING, Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union, ) import numpy as np import xarray as xr from aesara.graph.basic import Constant from ...
[ "logging.getLogger", "xarray.IndexVariable", "arviz.data.base.dict_to_dataset", "numpy.array", "pymc3.aesaraf.extract_obs_data", "numpy.where", "numpy.ndim", "numpy.stack", "warnings.warn", "pymc3.util.get_default_varnames", "numpy.any", "numpy.shape", "arviz.data.base.generate_dims_coords",...
[((1054, 1080), 'logging.getLogger', 'logging.getLogger', (['"""pymc3"""'], {}), "('pymc3')\n", (1071, 1080), False, 'import logging\n'), ((11415, 11432), 'arviz.data.base.requires', 'requires', (['"""trace"""'], {}), "('trace')\n", (11423, 11432), False, 'from arviz.data.base import generate_dims_coords, make_attrs, r...
from __future__ import print_function import json import os import requests from datetime import datetime import pandas as pd import numpy as np import matplotlib.pyplot as plt DEMO_UID = 0 PREDICTION_RESPONSE_KEY_QUERY_ID = "query_id" PREDICTION_RESPONSE_KEY_OUTPUT = "output" PREDICTION_RESPONSE_KEY_USED_DEFAULT = "...
[ "numpy.mean", "json.loads", "requests.post", "numpy.sqrt", "pandas.read_csv", "os.path.join", "numpy.array", "datetime.datetime.now", "matplotlib.pyplot.subplots", "numpy.var" ]
[((883, 981), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': 'num_rows', 'ncols': 'imgs_per_row', 'figsize': '(1.5 * imgs_per_row, 1.5 * num_rows)'}), '(nrows=num_rows, ncols=imgs_per_row, figsize=(1.5 *\n imgs_per_row, 1.5 * num_rows))\n', (895, 981), True, 'import matplotlib.pyplot as plt\n'), ((1542...
""" Module contains tools for processing files into DataFrames or other objects """ from __future__ import annotations from collections import abc import csv import sys from textwrap import fill from typing import Any import warnings import numpy as np import pandas._libs.lib as lib from pandas._libs.parsers import ...
[ "csv.get_dialect", "pandas.errors.AbstractMethodError", "pandas.io.common.validate_header_arg", "pandas.core.dtypes.common.is_file_like", "pandas.core.dtypes.common.is_list_like", "sys.getfilesystemencoding", "pandas.io.parsers.base_parser.is_index_col", "pandas.core.dtypes.common.is_float", "csv.li...
[((20583, 20683), 'pandas.util._decorators.deprecate_nonkeyword_arguments', 'deprecate_nonkeyword_arguments', ([], {'version': 'None', 'allowed_args': "['filepath_or_buffer']", 'stacklevel': '(3)'}), "(version=None, allowed_args=[\n 'filepath_or_buffer'], stacklevel=3)\n", (20613, 20683), False, 'from pandas.util._d...
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2019 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) import numpy as np import scipy.linalg as spla from pymor.algorithms.arnoldi import arnoldi from ...
[ "pymor.algorithms.gram_schmidt.gram_schmidt_biorth", "pymor.algorithms.gram_schmidt.gram_schmidt", "numpy.ones", "numpy.exp", "numpy.zeros", "numpy.empty", "scipy.linalg.norm", "pymor.algorithms.arnoldi.arnoldi", "pymor.models.iosys.LTIModel.from_matrices" ]
[((7315, 7350), 'pymor.algorithms.arnoldi.arnoldi', 'arnoldi', (['fom.A', 'fom.E', 'fom.B', 'sigma'], {}), '(fom.A, fom.E, fom.B, sigma)\n', (7322, 7350), False, 'from pymor.algorithms.arnoldi import arnoldi\n'), ((7368, 7415), 'pymor.algorithms.arnoldi.arnoldi', 'arnoldi', (['fom.A', 'fom.E', 'fom.C', 'sigma'], {'tran...
#!/usr/bin/env python import random import numpy as np import tensorflow as tf import cv2 import matplotlib.pyplot as plt seed = 0 random.seed(seed) np.random.seed(seed) tf.random.set_seed(seed) (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data() x_train = x_train[..., None] x_test = x_test[...
[ "matplotlib.pyplot.imshow", "tensorflow.random.set_seed", "matplotlib.pyplot.xticks", "tensorflow.keras.datasets.mnist.load_data", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "random.seed", "matplotlib.pyplot.figure", "matplotlib.pyplot.yticks", "numpy.random.seed", "matplotlib.pypl...
[((135, 152), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (146, 152), False, 'import random\n'), ((153, 173), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (167, 173), True, 'import numpy as np\n'), ((174, 198), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['seed'], {}), '(see...
import os, sys import numpy as np from sklearn.cluster import KMeans import matplotlib.pyplot as plt percentages = [0.01, 0.1, 0.2, 0.4, 0.5, 0.6] for percentage in percentages: data = [] save_path = '../logs/SOM_weights_MNIST_noise_{}.npy'.format(percentage) wts = np.load(save_path).reshape(-1, 784) print ("===...
[ "sklearn.cluster.KMeans", "numpy.load", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show" ]
[((647, 657), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (655, 657), True, 'import matplotlib.pyplot as plt\n'), ((272, 290), 'numpy.load', 'np.load', (['save_path'], {}), '(save_path)\n', (279, 290), True, 'import numpy as np\n'), ((374, 395), 'sklearn.cluster.KMeans', 'KMeans', ([], {'n_clusters': '(10)'...
import matplotlib matplotlib.use('Agg') from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.pyplot import gcf from flask import Flask, render_template, request, flash, redirect import pandas as pd import librosa import ffmpeg import librosa....
[ "keras.preprocessing.image.img_to_array", "numpy.argsort", "numpy.array", "tensorflow.keras.layers.Dense", "pandas.read_excel", "librosa.load", "tensorflow.keras.models.Model", "tensorflow.keras.applications.MobileNetV2", "matplotlib.use", "matplotlib.pyplot.gcf", "tensorflow.keras.layers.Dropou...
[((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((767, 807), 'os.path.join', 'os.path.join', (['THIS_DIR', '"""bird_data.xlsx"""'], {}), "(THIS_DIR, 'bird_data.xlsx')\n", (779, 807), False, 'import os\n'), ((727, 753), 'os.path.realpath', 'os.pa...
import os from pathlib import Path import cv2 import numpy as np import pandas as pd from pandas import DataFrame from sklearn.model_selection import train_test_split def create_info_csv(mvtec_dir: Path) -> DataFrame: df = pd.DataFrame({}) for data_type in ["train", "test"]: for p in mvtec_dir.glob...
[ "os.path.exists", "cv2.imwrite", "os.makedirs", "pathlib.Path", "os.rename", "numpy.zeros", "pandas.DataFrame", "cv2.imread" ]
[((231, 247), 'pandas.DataFrame', 'pd.DataFrame', (['{}'], {}), '({})\n', (243, 247), True, 'import pandas as pd\n'), ((1542, 1584), 'os.makedirs', 'os.makedirs', (['"""/data/images"""'], {'exist_ok': '(True)'}), "('/data/images', exist_ok=True)\n", (1553, 1584), False, 'import os\n'), ((1589, 1630), 'os.makedirs', 'os...
import tensorflow as tf # numpy 是个科学计算的工具包,这里通过Numpy生成模拟数据 from numpy.random import RandomState # 训练数据batch的大小 batch_size = 8 # 定义神经网络的参数,这里还是沿用3.4.2 小结中给出的神经网络结构 w1 = tf.Variable(tf.random_normal([2, 3], stddev=1, seed=1)) w2 = tf.Variable(tf.random_normal([3, 1], stddev=1, seed=1)) # 在shape的维度上使用None可以方便使用不打的batch...
[ "tensorflow.random_normal", "tensorflow.Session", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.matmul", "tensorflow.clip_by_value", "tensorflow.train.AdamOptimizer", "numpy.random.RandomState" ]
[((416, 475), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(None, 2)', 'name': '"""x-input"""'}), "(tf.float32, shape=(None, 2), name='x-input')\n", (430, 475), True, 'import tensorflow as tf\n'), ((481, 540), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(None, 1)',...
"""Retokenization helpers This module provides helpers for projecting span annotations from one tokenization to another. Notes: * Code is ported from https://github.com/nyu-mll/jiant/blob/master/jiant/utils/retokenize.py * Please keep this code as a standalone utility; don't make this module depend on jiant m...
[ "numpy.identity", "numpy.zeros", "Levenshtein.StringMatcher.StringMatcher", "nltk.tokenize.util.string_span_tokenize" ]
[((597, 647), 'numpy.zeros', 'np.zeros', (['(n_chars_src, n_chars_tgt)'], {'dtype': '_DTYPE'}), '((n_chars_src, n_chars_tgt), dtype=_DTYPE)\n', (605, 647), True, 'import numpy as np\n'), ((2133, 2168), 'nltk.tokenize.util.string_span_tokenize', 'string_span_tokenize', (['text'], {'sep': 'sep'}), '(text, sep=sep)\n', (2...
# -*- coding: utf-8 -*- """ :math:`IC_TC_P` Colour Encoding =============================== Defines the :math:`IC_TC_P` colour encoding related transformations: - :func:`colour.RGB_to_ICtCp` - :func:`colour.ICtCp_to_RGB` - :func:`colour.XYZ_to_ICtCp` - :func:`colour.ICtCp_to_XYZ` References ---------- - :c...
[ "colour.algebra.vector_dot", "colour.utilities.to_domain_1", "colour.utilities.from_range_1", "colour.models.rgb.RGB_to_XYZ", "colour.models.rgb.transfer_functions.oetf_HLG_BT2100", "colour.models.rgb.XYZ_to_RGB", "colour.utilities.domain_range_scale", "colour.models.rgb.transfer_functions.eotf_invers...
[((2348, 2386), 'numpy.linalg.inv', 'np.linalg.inv', (['MATRIX_ICTCP_RGB_TO_LMS'], {}), '(MATRIX_ICTCP_RGB_TO_LMS)\n', (2361, 2386), True, 'import numpy as np\n'), ((2861, 2903), 'numpy.linalg.inv', 'np.linalg.inv', (['MATRIX_ICTCP_LMS_P_TO_ICTCP'], {}), '(MATRIX_ICTCP_LMS_P_TO_ICTCP)\n', (2874, 2903), True, 'import nu...
#!/usr/bin/env python3 import csv import numpy thr_sig=5.0 def sigmoid(x): return 1.0/(1.0+numpy.exp(-(x-thr_sig))) if __name__=="__main__": #parameters time_pitch=1.0 #ms save_pitch=10 save_pitch_weight=1000 simlen_sec=900.0 simlen=int(simlen_sec*1000.0/time_pitch) tauL=10.0 #ms ...
[ "numpy.sqrt", "numpy.random.rand", "numpy.hstack", "csv.writer", "numpy.exp", "numpy.zeros", "numpy.random.randn" ]
[((917, 943), 'numpy.zeros', 'numpy.zeros', (['input_src_num'], {}), '(input_src_num)\n', (928, 943), False, 'import numpy\n'), ((966, 992), 'numpy.zeros', 'numpy.zeros', (['som_input_num'], {}), '(som_input_num)\n', (977, 992), False, 'import numpy\n'), ((1015, 1041), 'numpy.zeros', 'numpy.zeros', (['dnd_input_num'], ...
# Copyright 2020 Makani Technologies LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "logging.Error", "re.compile", "makani.lib.python.debug_util.FormatTraceback", "makani.gs.monitor2.apps.layout.autogen.GenerateScenario", "django.core.urlresolvers.reverse", "makani.analysis.checks.log_util.GetOrderedDedupDataAndTimeByField", "makani.lib.python.c_helpers.EnumHelper", "os.listdir", "...
[((1826, 1879), 'makani.lib.python.c_helpers.EnumHelper', 'c_helpers.EnumHelper', (['"""MessageType"""', 'aio_message_type'], {}), "('MessageType', aio_message_type)\n", (1846, 1879), False, 'from makani.lib.python import c_helpers\n'), ((1915, 1976), 'os.path.join', 'os.path.join', (['settings.MONITOR_PATH', '"""confi...
# coding=utf-8 # Copyright 2018 The TF-Agents 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...
[ "tensorflow.train.Checkpoint", "tensorflow.shape", "tensorflow.compat.v1.train.AdamOptimizer", "tf_agents.specs.tensor_spec.BoundedTensorSpec", "numpy.array", "tf_agents.trajectories.time_step.time_step_spec", "tensorflow.cast", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.eye", ...
[((2541, 2735), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["{'testcase_name': '_batch1_contextdim10', 'batch_size': 1, 'context_dim': 10}", "{'testcase_name': '_batch4_contextdim5', 'batch_size': 4, 'context_dim': 5}"], {}), "({'testcase_name': '_batch1_contextdim10',\n 'batch...
from __future__ import print_function, absolute_import from distutils import sysconfig from distutils import version from distutils.core import Extension import glob import io import multiprocessing import os import re import subprocess import sys import warnings from textwrap import fill PY3 = (sys.version_info[0] ...
[ "io.BytesIO", "sys.platform.startswith", "gi.repository.Gtk.get_micro_version", "re.search", "os.path.exists", "os.listdir", "sys.getfilesystemencoding", "pyparsing.Forward", "CXX", "subprocess.Popen", "subprocess.CalledProcessError", "os.path.split", "os.path.isdir", "os.popen", "numpy....
[((1564, 1606), 'os.environ.get', 'os.environ.get', (['"""MPLSETUPCFG"""', '"""setup.cfg"""'], {}), "('MPLSETUPCFG', 'setup.cfg')\n", (1578, 1606), False, 'import os\n'), ((1610, 1635), 'os.path.exists', 'os.path.exists', (['setup_cfg'], {}), '(setup_cfg)\n', (1624, 1635), False, 'import os\n'), ((1650, 1681), 'ConfigP...
# Copyright 2021 Sony Group 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 ...
[ "numpy.flip", "random.uniform", "random.choice", "numpy.arange", "random.seed", "numpy.stack", "musdb.DB", "numpy.sum", "random.random", "numpy.random.RandomState" ]
[((1174, 1199), 'random.uniform', 'random.uniform', (['low', 'high'], {}), '(low, high)\n', (1188, 1199), False, 'import random\n'), ((1395, 1412), 'numpy.flip', 'np.flip', (['audio', '(0)'], {}), '(audio, 0)\n', (1402, 1412), True, 'import numpy as np\n'), ((3811, 3828), 'random.seed', 'random.seed', (['seed'], {}), '...
import unittest import numpy as np from revpy import fare_transformation class FareTransformationTest(unittest.TestCase): def setUp(self): # example data from page 13 of research paper # "Optimization of Mixed Fare Structures: Theory and Applications" # by <NAME> al. (2010) self...
[ "revpy.fare_transformation.calc_fare_transformation", "revpy.fare_transformation.efficient_strategies", "numpy.testing.assert_equal", "numpy.array", "numpy.zeros", "numpy.testing.assert_almost_equal" ]
[((329, 371), 'numpy.array', 'np.array', (['[1200, 1000, 800, 600, 400, 200]'], {}), '([1200, 1000, 800, 600, 400, 200])\n', (337, 371), True, 'import numpy as np\n'), ((395, 441), 'numpy.array', 'np.array', (['[31.2, 10.9, 14.8, 19.9, 26.9, 36.3]'], {}), '([31.2, 10.9, 14.8, 19.9, 26.9, 36.3])\n', (403, 441), True, 'i...
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six from matplotlib.tri import Triangulation import _tri as _tri import numpy as np class TriFinder(object): """ Abstract base class for classes used to find the tria...
[ "numpy.asarray" ]
[((2063, 2094), 'numpy.asarray', 'np.asarray', (['x'], {'dtype': 'np.float64'}), '(x, dtype=np.float64)\n', (2073, 2094), True, 'import numpy as np\n'), ((2107, 2138), 'numpy.asarray', 'np.asarray', (['y'], {'dtype': 'np.float64'}), '(y, dtype=np.float64)\n', (2117, 2138), True, 'import numpy as np\n')]
""" Generate BpForms for all of the proteins in PRO, verify them, and calculate their properties :Author: <NAME> <<EMAIL>> :Date: 2019-06-24 :Copyright: 2019, Karr Lab :License: MIT """ from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from matplotlib import pyplot from xml.etree impor...
[ "csv.DictReader", "Bio.Seq.Seq", "numpy.array", "bpforms.protein_alphabet.monomers.values", "copy.deepcopy", "requests_cache.core.CachedSession", "matplotlib.pyplot.style.use", "bpforms.protein_alphabet.monomers.items", "matplotlib.pyplot.close", "os.path.isdir", "os.mkdir", "Bio.SeqIO.write",...
[((568, 615), 'os.path.join', 'os.path.join', (['"""examples"""', '"""pro_nonreasoned.obo"""'], {}), "('examples', 'pro_nonreasoned.obo')\n", (580, 615), False, 'import os\n'), ((634, 681), 'os.path.join', 'os.path.join', (['"""examples"""', '"""pro_nonreasoned.pkl"""'], {}), "('examples', 'pro_nonreasoned.pkl')\n", (6...
import argparse import contextlib import csv import logging import os import random import subprocess import tempfile from typing import Callable, Dict, Iterable, List import numpy as np import ray from ray.experimental.raysort import constants from ray.experimental.raysort import logging_utils from ray.experimental....
[ "numpy.fromfile", "numpy.random.bytes", "ray.cluster_resources", "ray.experimental.raysort.types.PartInfo", "os.cpu_count", "ray.init", "logging.info", "os.path.exists", "os.listdir", "argparse.ArgumentParser", "ray.experimental.raysort.logging_utils.init", "subprocess.run", "ray.util.remove...
[((6260, 6287), 'ray.experimental.raysort.tracing_utils.timeit', 'tracing_utils.timeit', (['"""map"""'], {}), "('map')\n", (6280, 6287), False, 'from ray.experimental.raysort import tracing_utils\n'), ((7656, 7703), 'ray.remote', 'ray.remote', ([], {'num_cpus': '(0)', 'resources': "{'worker': 1}"}), "(num_cpus=0, resou...
__author__ = 'sibirrer' from lenstronomy.LensModel.Profiles.flexion import Flexion from lenstronomy.LensModel.lens_model import LensModel import numpy as np import numpy.testing as npt import pytest class TestExternalShear(object): """ tests the Gaussian methods """ def setup(self): self.fl...
[ "lenstronomy.LensModel.lens_model.LensModel", "pytest.main", "numpy.testing.assert_almost_equal", "numpy.array", "lenstronomy.LensModel.Profiles.flexion.Flexion" ]
[((3229, 3242), 'pytest.main', 'pytest.main', ([], {}), '()\n', (3240, 3242), False, 'import pytest\n'), ((325, 334), 'lenstronomy.LensModel.Profiles.flexion.Flexion', 'Flexion', ([], {}), '()\n', (332, 334), False, 'from lenstronomy.LensModel.Profiles.flexion import Flexion\n'), ((494, 507), 'numpy.array', 'np.array',...
from unittest.mock import Mock, PropertyMock, MagicMock, patch import numpy as np import gym_connect4 from test_fixtures import Connect4Task import regym from regym.environments import EnvType from regym.rl_algorithms import build_MCTS_Agent from regym.rl_algorithms.agents import Agent, build_Deterministic_Agent, De...
[ "unittest.mock.Mock", "regym.rl_algorithms.build_Deterministic_Agent", "regym.rl_loops.Trajectory", "test_fixtures.Connect4Task.run_episodes", "regym.rl_loops.multiagent_loops.sequential_action_rl_loop.propagate_last_experience", "regym.rl_loops.multiagent_loops.sequential_action_rl_loop.propagate_experie...
[((771, 857), 'regym.rl_algorithms.build_Deterministic_Agent', 'build_Deterministic_Agent', (['Connect4Task', "{'action': 0}", '"""Col-0-DeterministicAgent"""'], {}), "(Connect4Task, {'action': 0},\n 'Col-0-DeterministicAgent')\n", (796, 857), False, 'from regym.rl_algorithms import build_Deterministic_Agent, build_...
import numpy as np # import os # current_directory = os.path.dirname(os.path.abspath(__file__)).replace('\\','/') # from ctypes import * # bro = cdll.LoadLibrary(current_directory+"/broken.so") # bro.broken_frame.argtypes = [np.ctypeslib.ndpointer(dtype=np.int16, ndim=1, flags="C_CONTIGUOUS"), # c_int, # ...
[ "numpy.abs", "numpy.log10" ]
[((1532, 1564), 'numpy.abs', 'np.abs', (['wdata[i * w:(i + 1) * w]'], {}), '(wdata[i * w:(i + 1) * w])\n', (1538, 1564), True, 'import numpy as np\n'), ((1584, 1597), 'numpy.log10', 'np.log10', (['tem'], {}), '(tem)\n', (1592, 1597), True, 'import numpy as np\n')]
from os import listdir from os.path import isfile from PIL import Image from tqdm import tqdm import numpy as np import imgaug.augmenters as iaa import os import random from os.path import join import matplotlib.pyplot as plt DATA_DIR = 'DATA DIR' os.chdir(DATA_DIR) IMAGE_DIR = join(DATA_DIR, 'dat...
[ "matplotlib.pyplot.imshow", "PIL.Image.fromarray", "os.listdir", "tqdm.tqdm", "os.path.join", "numpy.asarray", "numpy.squeeze", "os.chdir", "numpy.expand_dims", "imgaug.augmenters.JpegCompression", "matplotlib.pyplot.subplot", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((265, 283), 'os.chdir', 'os.chdir', (['DATA_DIR'], {}), '(DATA_DIR)\n', (273, 283), False, 'import os\n'), ((301, 360), 'os.path.join', 'join', (['DATA_DIR', '"""dataset\\\\PascalVOC-OG-flipped\\\\JPEGImages"""'], {}), "(DATA_DIR, 'dataset\\\\PascalVOC-OG-flipped\\\\JPEGImages')\n", (305, 360), False, 'from os.path i...
from typing import Dict import numpy as np def buffer_from_example(example: Dict[str, np.ndarray], leading_dims) -> Dict[str, np.ndarray]: buf = {} for key, value in example.items(): buf[key] = np.zeros(leading_dims + value.shape, dtype=value.dtype) return buf def get_l...
[ "numpy.zeros" ]
[((237, 292), 'numpy.zeros', 'np.zeros', (['(leading_dims + value.shape)'], {'dtype': 'value.dtype'}), '(leading_dims + value.shape, dtype=value.dtype)\n', (245, 292), True, 'import numpy as np\n')]
import numpy as np import cv2 image = cv2.imread('images/unsharp_bird.jpg') kernel = np.array([ [0, -1, 0], [-1, 5, -1], [0, -1, 0] ]) sharpen_iamge = cv2.filter2D(image, -1, kernel) cv2.imshow("original image", image) cv2.imshow("sharpen image", sharpen_iamge) cv2.wait...
[ "cv2.filter2D", "cv2.imshow", "numpy.array", "cv2.destroyAllWindows", "cv2.waitKey", "cv2.imread" ]
[((39, 76), 'cv2.imread', 'cv2.imread', (['"""images/unsharp_bird.jpg"""'], {}), "('images/unsharp_bird.jpg')\n", (49, 76), False, 'import cv2\n'), ((87, 134), 'numpy.array', 'np.array', (['[[0, -1, 0], [-1, 5, -1], [0, -1, 0]]'], {}), '([[0, -1, 0], [-1, 5, -1], [0, -1, 0]])\n', (95, 134), True, 'import numpy as np\n'...
# -*- coding: utf-8 -*- import csv import logging import math import multiprocessing import os import shutil import time from concurrent.futures import ThreadPoolExecutor from pathlib import Path from typing import Dict, List, Tuple from django.utils import timezone import numpy as np import pandas as pd import psut...
[ "csv.DictWriter", "rpy2.robjects.pandas2ri.activate", "pandas.read_csv", "data_refinery_common.logging.get_and_configure_logger", "multiprocessing.cpu_count", "numpy.array", "rpy2.robjects.r", "os.path.exists", "pathlib.Path", "rpy2.robjects.packages.importr", "django.utils.timezone.now", "os....
[((811, 881), 'data_refinery_common.utils.get_env_variable', 'get_env_variable', (['"""S3_RESULTS_BUCKET_NAME"""', '"""refinebio-results-bucket"""'], {}), "('S3_RESULTS_BUCKET_NAME', 'refinebio-results-bucket')\n", (827, 881), False, 'from data_refinery_common.utils import get_env_variable\n'), ((899, 950), 'data_refin...
from __future__ import absolute_import from __future__ import division from __future__ import print_function # from smac.env.multiagentenv import MultiAgentEnv # from smac.env.starcraft2.maps import get_map_params from ..multiagentenv import MultiAgentEnv from ..starcraft2.maps import get_map_params import atexit fro...
[ "operator.attrgetter", "numpy.eye", "s2clientprotocol.raw_pb2.ActionRawUnitCommand", "copy.deepcopy", "s2clientprotocol.sc2api_pb2.InterfaceOptions", "s2clientprotocol.sc2api_pb2.RequestJoinGame", "absl.logging.info", "time.sleep", "s2clientprotocol.raw_pb2.ActionRaw", "numpy.append", "numpy.arr...
[((7454, 7469), 'time.sleep', 'time.sleep', (['(100)'], {}), '(100)\n', (7464, 7469), False, 'import math, time\n'), ((10200, 10223), 'numpy.zeros', 'np.zeros', (['self.n_agents'], {}), '(self.n_agents)\n', (10208, 10223), True, 'import numpy as np\n'), ((10259, 10283), 'numpy.zeros', 'np.zeros', (['self.n_enemies'], {...
import numbers from typing import Any, Dict, List, Optional, Sequence, Tuple, Union import numpy as np import torch from PIL import Image, ImageOps, ImageEnhance from typing_extensions import Literal try: import accimage except ImportError: accimage = None @torch.jit.unused def _is_pil_image(img: Any) -> bo...
[ "numpy.uint8", "PIL.ImageEnhance.Contrast", "numpy.array", "PIL.ImageOps.posterize", "PIL.ImageOps.autocontrast", "PIL.ImageOps.expand", "numpy.asarray", "PIL.ImageEnhance.Sharpness", "PIL.ImageEnhance.Color", "PIL.ImageOps.invert", "numpy.maximum", "PIL.ImageOps.equalize", "PIL.ImageOps.sol...
[((1472, 1500), 'PIL.ImageEnhance.Brightness', 'ImageEnhance.Brightness', (['img'], {}), '(img)\n', (1495, 1500), False, 'from PIL import Image, ImageOps, ImageEnhance\n'), ((1776, 1802), 'PIL.ImageEnhance.Contrast', 'ImageEnhance.Contrast', (['img'], {}), '(img)\n', (1797, 1802), False, 'from PIL import Image, ImageOp...
import numpy as np from pyray.shapes.twod.paraboloid import * from pyray.shapes.twod.functional import * from pyray.rotation import * from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter import matplotlib as mpl...
[ "numpy.eye", "numpy.sqrt", "numpy.array", "matplotlib.pyplot.figure", "numpy.linspace", "numpy.dot", "numpy.cos", "numpy.sin", "numpy.meshgrid", "numpy.arange", "matplotlib.pyplot.show" ]
[((1463, 1475), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1473, 1475), True, 'import matplotlib.pyplot as plt\n'), ((1514, 1544), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(100)'], {}), '(0, 2 * np.pi, 100)\n', (1525, 1544), True, 'import numpy as np\n'), ((1555, 1579), 'numpy.arange'...
import os import numpy as np from vmaf import plt from vmaf.core.cross_validation import ModelCrossValidation from vmaf.core.feature_assembler import FeatureAssembler from vmaf.core.quality_runner import VmafQualityRunner from vmaf.core.result_store import FileSystemResultStore from vmaf.tools.misc import indices, get...
[ "vmaf.core.train_test_model.TrainTestModel.find_subclass", "vmaf.core.quality_runner.VmafQualityRunner.predict_with_model", "numpy.array", "vmaf.core.local_explainer.LocalExplainer", "vmaf.config.VmafConfig.file_result_store_path", "vmaf.config.VmafConfig.workspace_path", "vmaf.plt.subplots", "vmaf.co...
[((19415, 19682), 'vmaf.core.feature_assembler.FeatureAssembler', 'FeatureAssembler', ([], {'feature_dict': 'feature_param.feature_dict', 'feature_option_dict': 'None', 'assets': 'train_assets', 'logger': 'logger', 'fifo_mode': 'fifo_mode', 'delete_workdir': '(True)', 'result_store': 'result_store', 'optional_dict': 'N...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[ "paddle.fluid.dygraph.guard", "paddle.fluid.dygraph.Embedding", "paddle.fluid.layers.split", "paddle.fluid.layers.piecewise_decay", "unittest.main", "paddle.fluid.layers.transpose", "paddle.fluid.layers.matmul", "numpy.arange", "paddle.fluid.layers.reshape", "paddle.fluid.save_dygraph", "paddle....
[((34298, 34313), 'unittest.main', 'unittest.main', ([], {}), '()\n', (34311, 34313), False, 'import unittest\n'), ((5049, 5076), 'paddle.fluid.layers.concat', 'fluid.layers.concat', (['res', '(0)'], {}), '(res, 0)\n', (5068, 5076), True, 'import paddle.fluid as fluid\n'), ((5096, 5146), 'paddle.fluid.layers.transpose'...
# Copyright (c) 2016 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 applic...
[ "image_util.expand_image", "PIL.Image.fromarray", "PIL.Image.open", "random.uniform", "random.shuffle", "image_util.sampler", "image_util.generate_batch_samples", "image_util.distort_image", "os.path.join", "numpy.swapaxes", "numpy.array", "image_util.crop_image" ]
[((996, 1030), 'os.path.join', 'os.path.join', (['data_dir', 'label_file'], {}), '(data_dir, label_file)\n', (1008, 1030), False, 'import os\n'), ((2454, 2475), 'random.shuffle', 'random.shuffle', (['lines'], {}), '(lines)\n', (2468, 2475), False, 'import random\n'), ((2897, 2917), 'PIL.Image.open', 'Image.open', (['im...
import torch import unittest import numpy as np from torch.autograd import Variable from losses.svm import SmoothTop1SVM, SmoothTopkSVM, MaxTop1SVM, MaxTopkSVM from losses.functional import Topk_Smooth_SVM from tests.utils import assert_all_close, V from tests.py_ref import svm_topk_smooth_py_1, svm_topk_smooth_py_2,\...
[ "torch.manual_seed", "numpy.arange", "losses.svm.MaxTopkSVM", "tests.utils.assert_all_close", "losses.functional.Topk_Smooth_SVM", "numpy.random.randint", "tests.utils.V", "numpy.random.seed", "losses.svm.MaxTop1SVM", "torch.autograd.Variable", "torch.randn", "losses.svm.SmoothTop1SVM", "los...
[((486, 509), 'torch.manual_seed', 'torch.manual_seed', (['(1234)'], {}), '(1234)\n', (503, 509), False, 'import torch\n'), ((518, 538), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (532, 538), True, 'import numpy as np\n'), ((636, 679), 'torch.randn', 'torch.randn', (['self.n_samples', 'self.n_...
# pylint: disable=g-bad-file-header # Copyright 2019 DeepMind Technologies Limited. 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/...
[ "bsuite.experiments.mnist.mnist.MNISTBandit", "absl.testing.absltest.main", "numpy.random.RandomState" ]
[((1312, 1327), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (1325, 1327), False, 'from absl.testing import absltest\n'), ((1060, 1087), 'bsuite.experiments.mnist.mnist.MNISTBandit', 'mnist.MNISTBandit', ([], {'seed': '(101)'}), '(seed=101)\n', (1077, 1087), False, 'from bsuite.experiments.mnist imp...
# Copyright 2018 The TensorFlow 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 applica...
[ "tensorflow_estimator.python.estimator.run_config.RunConfig", "tensorflow.python.keras.metrics.Mean", "numpy.ones", "tensorflow.compat.v1.data.make_one_shot_iterator", "tensorflow.test.main", "tensorflow.feature_column.numeric_column", "tensorflow.compat.v1.data.Dataset.from_tensor_slices", "tensorflo...
[((5382, 5396), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (5394, 5396), True, 'import tensorflow as tf\n'), ((1391, 1453), 'tensorflow.compat.v1.data.Dataset.from_tensor_slices', 'tf.compat.v1.data.Dataset.from_tensor_slices', (["{'x': x, 'y': y}"], {}), "({'x': x, 'y': y})\n", (1435, 1453), True, 'impo...
import numpy as np from scipy.sparse import csc_matrix, save_npz, hstack import time import argparse import gzip from pysam import VariantFile, TabixFile import json import os import itertools parser = argparse.ArgumentParser(description='Pull genotypes.') parser.add_argument('vcf_file', type=str, help='VCF file to p...
[ "pysam.VariantFile", "argparse.ArgumentParser", "gzip.open", "numpy.asarray", "os.path.isfile", "numpy.zeros", "pysam.TabixFile", "json.load", "scipy.sparse.save_npz", "time.time", "json.dump" ]
[((204, 258), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Pull genotypes."""'}), "(description='Pull genotypes.')\n", (227, 258), False, 'import argparse\n'), ((1546, 1557), 'time.time', 'time.time', ([], {}), '()\n', (1555, 1557), False, 'import time\n'), ((4632, 4658), 'pysam.Varian...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "parakeet.data.datacargo.DataCargo", "parakeet.data.dataset.TransformDataset", "parakeet.audio.AudioProcessor", "pandas.read_csv", "pathlib.Path", "paddle.fluid.io.DataLoader.from_generator", "parakeet.g2p.en.text_to_sequence", "paddle.fluid.CPUPlace", "numpy.array", "parakeet.data.batch.TextIDBat...
[((1375, 1395), 'pathlib.Path', 'Path', (['args.data_path'], {}), '(args.data_path)\n', (1379, 1395), False, 'from pathlib import Path\n'), ((1504, 1543), 'parakeet.data.dataset.TransformDataset', 'TransformDataset', (['metadata', 'transformer'], {}), '(metadata, transformer)\n', (1520, 1543), False, 'from parakeet.dat...
import numpy as np import geocoder def process_df(df): """ df: pd.DataFrame """ df.dropna(subset=['lat', 'lon'], axis=0, inplace=True) df.reset_index(drop=True, inplace=True) # Add new column to hold the years df["year"] = [int(x.split("-")[0]) for x in df['date']] # Convert coo...
[ "geocoder.google", "numpy.logical_and" ]
[((409, 461), 'numpy.logical_and', 'np.logical_and', (["(df['lat-dir'] == 'S')", "(df['lat'] >= 0)"], {}), "(df['lat-dir'] == 'S', df['lat'] >= 0)\n", (423, 461), True, 'import numpy as np\n'), ((511, 563), 'numpy.logical_and', 'np.logical_and', (["(df['lon-dir'] == 'W')", "(df['lon'] >= 0)"], {}), "(df['lon-dir'] == '...
""" Offset Mirror Classes. This module contains all the classes relating to the offset mirrors used in the FEE and XRT. Each offset mirror contains a stepper motor and piezo motor to control the pitch, and two pairs of motors to control the horizontal and vertical gantries. """ import logging import numpy as np from ...
[ "logging.getLogger", "ophyd.Component", "numpy.isnan", "numpy.isinf", "ophyd.FormattedComponent" ]
[((810, 837), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (827, 837), False, 'import logging\n'), ((1023, 1083), 'ophyd.Component', 'Cpt', (['EpicsSignalRO', '""":RBV"""'], {'auto_monitor': '(True)', 'kind': '"""hinted"""'}), "(EpicsSignalRO, ':RBV', auto_monitor=True, kind='hinted')\n...
# Copyright (c) 2020 <NAME> from baselines.common import Dataset, explained_variance, fmt_row, zipsame from baselines import logger import baselines.common.tf_util as U import tensorflow as tf, numpy as np import time from baselines.common.mpi_adam import MpiAdam from baselines.common.mpi_moments import mpi_moments fr...
[ "baselines.common.tf_util.get_session", "baselines.common.mpi_adam.MpiAdam", "tensorflow.transpose", "tensorflow.reduce_sum", "mpi4py.MPI.COMM_WORLD.allgather", "numpy.array", "baselines.logger.log", "tensorflow.set_random_seed", "baselines.common.tf_util.get_placeholder_cached", "baselines.common...
[((895, 907), 'numpy.shape', 'np.shape', (['ob'], {}), '(ob)\n', (903, 907), True, 'import tensorflow as tf, numpy as np\n'), ((927, 939), 'numpy.shape', 'np.shape', (['ac'], {}), '(ac)\n', (935, 939), True, 'import tensorflow as tf, numpy as np\n'), ((987, 1011), 'numpy.concatenate', 'np.concatenate', (['(ob, ac)'], {...
import time from unittest.case import SkipTest from ddtrace.context import Context from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY from ddtrace.span import Span from ddtrace.ext import errors def test_ids(): s = Span(tracer=None, name='span.test') assert s.trace_id assert s.span_id assert no...
[ "ddtrace.span.Span", "numpy.int64", "unittest.case.SkipTest", "time.sleep", "ddtrace.context.Context" ]
[((228, 263), 'ddtrace.span.Span', 'Span', ([], {'tracer': 'None', 'name': '"""span.test"""'}), "(tracer=None, name='span.test')\n", (232, 263), False, 'from ddtrace.span import Span\n'), ((344, 407), 'ddtrace.span.Span', 'Span', ([], {'tracer': 'None', 'name': '"""t"""', 'trace_id': '(1)', 'span_id': '(2)', 'parent_id...
from gzip import ( compress, GzipFile ) import numpy as np from .record import Record UNK = '<unk>' PAD = '<pad>' class Vocab(Record): __attributes__ = ['words', 'counts'] def __init__(self, words, counts): self.words = words self.counts = counts self.word_ids = { ...
[ "gzip.GzipFile", "numpy.array", "numpy.frombuffer", "gzip.compress" ]
[((2259, 2290), 'gzip.compress', 'compress', (['(meta + counts + words)'], {}), '(meta + counts + words)\n', (2267, 2290), False, 'from gzip import compress, GzipFile\n'), ((2354, 2387), 'gzip.GzipFile', 'GzipFile', ([], {'mode': '"""rb"""', 'fileobj': 'file'}), "(mode='rb', fileobj=file)\n", (2362, 2387), False, 'from...
# -*- coding: utf-8 -*- from EXOSIMS.Prototypes.OpticalSystem import OpticalSystem import astropy.units as u import numpy as np import scipy.stats as st import scipy.optimize as opt class Nemati(OpticalSystem): """Nemati Optical System class This class contains all variables and methods necessar...
[ "numpy.sqrt", "numpy.log", "EXOSIMS.Prototypes.OpticalSystem.OpticalSystem.__init__", "numpy.array", "numpy.errstate", "numpy.isnan", "numpy.true_divide", "numpy.isinf" ]
[((590, 627), 'EXOSIMS.Prototypes.OpticalSystem.OpticalSystem.__init__', 'OpticalSystem.__init__', (['self'], {}), '(self, **specs)\n', (612, 627), False, 'from EXOSIMS.Prototypes.OpticalSystem import OpticalSystem\n'), ((3905, 3941), 'numpy.array', 'np.array', (['sInds'], {'ndmin': '(1)', 'copy': '(False)'}), '(sInds,...
#!/usr/bin/env python import numpy as np from olympus.surfaces import AbstractSurface class AckleyPath(AbstractSurface): def __init__(self, param_dim=2, noise=None): """Ackley path function. Args: param_dim (int): Number of input dimensions. Default is 2. noise (Noise): ...
[ "numpy.exp", "numpy.array", "numpy.sum", "numpy.cos" ]
[((761, 777), 'numpy.array', 'np.array', (['params'], {}), '(params)\n', (769, 777), True, 'import numpy as np\n'), ((950, 966), 'numpy.array', 'np.array', (['params'], {}), '(params)\n', (958, 966), True, 'import numpy as np\n'), ((1084, 1095), 'numpy.exp', 'np.exp', (['(1.0)'], {}), '(1.0)\n', (1090, 1095), True, 'im...
import random import numpy as np import cv2 from utils.transforms.transforms import CustomTransform class RandomFlip(CustomTransform): def __init__(self, prob_x=0, prob_y=0): """ Arguments: ---------- prob_x: range [0, 1], probability to use horizontal flip, setting to 0 means dis...
[ "numpy.random.choice", "numpy.flip", "numpy.random.uniform" ]
[((675, 740), 'numpy.random.choice', 'np.random.choice', (['[False, True]'], {'p': '(1 - self.prob_x, self.prob_x)'}), '([False, True], p=(1 - self.prob_x, self.prob_x))\n', (691, 740), True, 'import numpy as np\n'), ((758, 823), 'numpy.random.choice', 'np.random.choice', (['[False, True]'], {'p': '(1 - self.prob_y, se...
'''Utility functions and classes for handling image datasets.''' import cPickle import cv2 import os.path as osp import numpy as np import tensorflow as tf from config_tfvgg import cfg FLAGS = tf.app.flags.FLAGS def get_facebox_dims(img_shape,face_bbox,target_size,crop_size,spec,crop_ind): face_bbox = np.zeros_li...
[ "tensorflow.image.resize_images", "tensorflow.shape", "tensorflow.read_file", "numpy.array", "tensorflow.FIFOQueue", "numpy.min", "numpy.ceil", "tensorflow.reverse", "os.path.splitext", "tensorflow.to_int32", "tensorflow.range", "cv2.imread", "tensorflow.minimum", "tensorflow.image.decode_...
[((309, 333), 'numpy.zeros_like', 'np.zeros_like', (['face_bbox'], {}), '(face_bbox)\n', (322, 333), True, 'import numpy as np\n'), ((925, 1001), 'numpy.array', 'np.array', (['(face_bbox[3] - face_bbox[1] + 1, face_bbox[2] - face_bbox[0] + 1)'], {}), '((face_bbox[3] - face_bbox[1] + 1, face_bbox[2] - face_bbox[0] + 1))...
import spartan from spartan import core, expr, util, blob_ctx import numpy as np from .qr import qr def svd(A, k=None): """ Stochastic SVD. Parameters ---------- A : spartan matrix Array to compute the SVD on, of shape (M, N) k : int, optional Number of singular values and vectors to compute....
[ "spartan.expr.randn", "spartan.expr.dot", "numpy.sqrt", "numpy.linalg.eig", "numpy.ones", "spartan.expr.transpose", "numpy.argsort" ]
[((594, 619), 'spartan.expr.randn', 'expr.randn', (['A.shape[1]', 'k'], {}), '(A.shape[1], k)\n', (604, 619), False, 'from spartan import core, expr, util, blob_ctx\n'), ((627, 645), 'spartan.expr.dot', 'expr.dot', (['A', 'Omega'], {}), '(A, Omega)\n', (635, 645), False, 'from spartan import core, expr, util, blob_ctx\...
from collections import namedtuple import tensorflow as tf import numpy as np from rl.agents.a2c.agent import A2CAgent TestArgType = namedtuple('ArgType', ['name']) arg_type = TestArgType('arg') A = np.array class A2CAgentTest(tf.test.TestCase): def test_compute_policy_log_probs(self): from rl.agents.a2c.a...
[ "collections.namedtuple", "rl.agents.a2c.agent.compute_policy_entropy", "numpy.log", "tensorflow.test.main", "rl.agents.a2c.agent.compute_policy_log_probs" ]
[((137, 168), 'collections.namedtuple', 'namedtuple', (['"""ArgType"""', "['name']"], {}), "('ArgType', ['name'])\n", (147, 168), False, 'from collections import namedtuple\n'), ((2115, 2129), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (2127, 2129), True, 'import tensorflow as tf\n'), ((862, 941), 'rl.ag...
# -*- coding: utf-8 -*- import pandas as pd import numpy as np def rescale(data, to=[0, 1]): """Rescale data. Rescale a numeric variable to a new range. Parameters ---------- data : list, array or Series Raw data. to : list New range of values of the data after rescaling. ...
[ "numpy.nanmin", "numpy.array", "numpy.nanmax" ]
[((623, 637), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (631, 637), True, 'import numpy as np\n'), ((821, 836), 'numpy.nanmin', 'np.nanmin', (['data'], {}), '(data)\n', (830, 836), True, 'import numpy as np\n'), ((776, 791), 'numpy.nanmax', 'np.nanmax', (['data'], {}), '(data)\n', (785, 791), True, 'import...
#!/usr/bin/env python # coding: utf-8 # In[1]: #Libraries import cv2 import numpy as np import pyautogui import keyboard # In[2]: #Color to detect BGR l = [17, 15, 100] #lower u = [80, 76, 220] #upper # In[3]: #region coordinates k_left, k_top, k_right, k_bottom = 640, 30, 440, 130 h_left, h_top, h_right, h...
[ "cv2.rectangle", "cv2.imshow", "numpy.array", "cv2.destroyAllWindows", "cv2.threshold", "cv2.erode", "cv2.waitKey", "pyautogui.keyDown", "cv2.putText", "cv2.cvtColor", "cv2.resize", "cv2.GaussianBlur", "cv2.namedWindow", "cv2.flip", "cv2.inRange", "cv2.bitwise_and", "cv2.VideoCapture...
[((566, 589), 'pyautogui.keyDown', 'pyautogui.keyDown', (['"""up"""'], {}), "('up')\n", (583, 589), False, 'import pyautogui\n'), ((685, 711), 'pyautogui.keyDown', 'pyautogui.keyDown', (['"""right"""'], {}), "('right')\n", (702, 711), False, 'import pyautogui\n'), ((805, 830), 'pyautogui.keyDown', 'pyautogui.keyDown', ...
# Copyright 2018 The TensorFlow Probability 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 o...
[ "tensorflow.compat.v2.nest.map_structure", "numpy.log", "tensorflow.compat.v2.einsum", "tensorflow_probability.python.internal.test_util.jax_disable_test_missing_functionality", "tensorflow.compat.v2.cast", "tensorflow.compat.v2.nest.pack_sequence_as", "tensorflow.compat.v2.nest.assert_same_structure", ...
[((1233, 1535), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["{'testcase_name': 'coroutine', 'jd_class': tfd.\n JointDistributionCoroutineAutoBatched}", "{'testcase_name': 'sequential', 'jd_class': tfd.\n JointDistributionSequentialAutoBatched}", "{'testcase_name': 'named', '...
import numpy as np from sklearn.decomposition import PCA import pandas as pd import matplotlib.pyplot as plt import random import seaborn as sns from sklearn.cluster import KMeans from sklearn.metrics import confusion_matrix from sklearn.metrics.cluster import adjusted_rand_score from sklearn.datasets import fetch_open...
[ "numpy.trace", "pandas.read_csv", "matplotlib.pyplot.ylabel", "sklearn.neighbors.kneighbors_graph", "random.choices", "numpy.linalg.norm", "sklearn.decomposition.sparse_encode", "numpy.arange", "sklearn.cluster.k_means", "seaborn.distplot", "sklearn.decomposition.PCA", "matplotlib.pyplot.xlabe...
[((15196, 15201), 'sklearn.decomposition.PCA', 'PCA', ([], {}), '()\n', (15199, 15201), False, 'from sklearn.decomposition import PCA\n'), ((16649, 16657), 'sklearn.decomposition.PCA', 'PCA', (['(0.9)'], {}), '(0.9)\n', (16652, 16657), False, 'from sklearn.decomposition import PCA\n'), ((17838, 17857), 'sklearn.decompo...
#!/usr/bin/env python3 # class file uppergeodesic.py # started as a script to visualize what happens to hyperbolic plane # if different isometries act on it import geodesic as gd import numpy as np import numpy.linalg as lina import matplotlib.pyplot as plt # upper half space as the basic model class UpperGeodesic...
[ "numpy.sin", "numpy.matrix", "numpy.linspace", "numpy.cos" ]
[((4613, 4650), 'numpy.matrix', 'np.matrix', (['[[diag, off], [off, diag]]'], {}), '([[diag, off], [off, diag]])\n', (4622, 4650), True, 'import numpy as np\n'), ((2161, 2192), 'numpy.linspace', 'np.linspace', (['(0)', 'np.pi', 'self.res'], {}), '(0, np.pi, self.res)\n', (2172, 2192), True, 'import numpy as np\n'), ((2...
""" Created on Thu Sept 24 2020- @author: <NAME> GitHub username: esgomezm """ import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.losses import binary_crossentropy import numpy as np from tensorflow.keras import losses # -------------------------------- # ## Unet with tf 2.0.0 # h...
[ "tensorflow.keras.backend.log", "tensorflow.shape", "tensorflow.keras.backend.floatx", "tensorflow.keras.backend.greater", "tensorflow.keras.backend.ones_like", "tensorflow.keras.losses.binary_crossentropy", "tensorflow.cast", "tensorflow.keras.backend.conv2d", "tensorflow.keras.backend.conv3d", "...
[((1129, 1167), 'tensorflow.keras.backend.clip', 'K.clip', (['y_pred', 'epsilon', '(1.0 - epsilon)'], {}), '(y_pred, epsilon, 1.0 - epsilon)\n', (1135, 1167), True, 'from tensorflow.keras import backend as K\n'), ((1186, 1216), 'tensorflow.keras.backend.log', 'K.log', (['(y_pred / (1.0 - y_pred))'], {}), '(y_pred / (1....
import json import bz2 import gzip import _pickle as cPickle import gym import numpy as np import quaternion import skimage.morphology import habitat from envs.utils.fmm_planner import FMMPlanner from constants import coco_categories import envs.utils.pose as pu class ObjectGoal_Env(habitat.RLEnv): """The Object...
[ "quaternion.as_rotation_vector", "quaternion.as_float_array", "envs.utils.fmm_planner.FMMPlanner", "numpy.random.rand", "gzip.open", "envs.utils.pose.get_l2_distance", "numpy.arange", "_pickle.load", "bz2.BZ2File", "numpy.concatenate", "constants.coco_categories.items", "numpy.rad2deg", "qua...
[((1554, 1576), 'gym.spaces.Discrete', 'gym.spaces.Discrete', (['(3)'], {}), '(3)\n', (1573, 1576), False, 'import gym\n'), ((1611, 1690), 'gym.spaces.Box', 'gym.spaces.Box', (['(0)', '(255)', '(3, args.frame_height, args.frame_width)'], {'dtype': '"""uint8"""'}), "(0, 255, (3, args.frame_height, args.frame_width), dty...
import math import re import matplotlib.pyplot as plt import numpy as np import pandas as pd from go_utils.cleanup import ( # isort: skip rename_latlon_cols, replace_column_prefix, round_cols, standardize_null_vals, ) from go_utils.plot import ( # isort: skip completeness_histogram, plot_fr...
[ "go_utils.plot.completeness_histogram", "go_utils.plot.plot_int_distribution", "matplotlib.pyplot.ylabel", "go_utils.cleanup.round_cols", "matplotlib.pyplot.xlabel", "go_utils.cleanup.rename_latlon_cols", "matplotlib.pyplot.figure", "matplotlib.pyplot.bar", "re.sub", "go_utils.cleanup.standardize_...
[((2550, 2624), 'go_utils.cleanup.replace_column_prefix', 'replace_column_prefix', (['df', '"""mosquitohabitatmapper"""', '"""mhm"""'], {'inplace': 'inplace'}), "(df, 'mosquitohabitatmapper', 'mhm', inplace=inplace)\n", (2571, 2624), False, 'from go_utils.cleanup import rename_latlon_cols, replace_column_prefix, round_...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
[ "itertools.permutations", "itertools.product", "numpy.isclose" ]
[((3021, 3053), 'itertools.product', 'itertools.product', (['mos'], {'repeat': '(2)'}), '(mos, repeat=2)\n', (3038, 3053), False, 'import itertools\n'), ((3677, 3709), 'itertools.product', 'itertools.product', (['mos'], {'repeat': '(4)'}), '(mos, repeat=4)\n', (3694, 3709), False, 'import itertools\n'), ((3722, 3762), ...
from flask import Flask, flash, request, redirect, url_for, render_template from werkzeug.utils import secure_filename import os from keras.models import load_model from keras.applications.inception_resnet_v2 import InceptionResNetV2 import tensorflow as tf from skimage.io import imsave from skimage.transform import re...
[ "flask.render_template", "flask.Flask", "PIL.Image.new", "logging.exception", "numpy.array", "werkzeug.utils.secure_filename", "os.listdir", "skimage.color.rgb2lab", "flask.flash", "keras.applications.inception_resnet_v2.preprocess_input", "skimage.color.lab2rgb", "keras.applications.inception...
[((642, 664), 'tensorflow.get_default_graph', 'tf.get_default_graph', ([], {}), '()\n', (662, 664), True, 'import tensorflow as tf\n'), ((671, 686), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (676, 686), False, 'from flask import Flask, flash, request, redirect, url_for, render_template\n'), ((769, 799...
from collections import ChainMap from collections.abc import Mapping, Iterable from itertools import groupby from operator import itemgetter import numpy as np from probability import RowKey from probability import TableColumns # from probability.core_1 import RowKey # from probability.core_1 import TableColumns def...
[ "probability.RowKey", "numpy.max", "operator.itemgetter", "numpy.all", "probability.TableColumns" ]
[((14467, 14529), 'numpy.all', 'np.all', (['(arr_counter[:, columns_info.indices] == values)'], {'axis': '(1)'}), '(arr_counter[:, columns_info.indices] == values, axis=1)\n', (14473, 14529), True, 'import numpy as np\n'), ((16044, 16075), 'numpy.max', 'np.max', (['arr_len[:, :-1]'], {'axis': '(0)'}), '(arr_len[:, :-1]...
# Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from copy import deepcopy from functools import partial import numpy as np import scipy from addict import Dict from ....algorithms.quantization import utils as eu from ....engines.ac_engine import ACEngine from ....graph.model_utils i...
[ "addict.Dict", "numpy.mean", "numpy.flip", "numpy.asarray", "numpy.argsort", "numpy.nanmean", "functools.partial", "copy.deepcopy", "scipy.special.softmax" ]
[((5558, 5564), 'addict.Dict', 'Dict', ([], {}), '()\n', (5562, 5564), False, 'from addict import Dict\n'), ((7929, 7965), 'numpy.argsort', 'np.argsort', (['distance_between_samples'], {}), '(distance_between_samples)\n', (7939, 7965), True, 'import numpy as np\n'), ((8299, 8312), 'numpy.asarray', 'np.asarray', (['u'],...
from collections import defaultdict import time from joblib import Parallel, delayed from multiprocessing import cpu_count from math import ceil import torch from torch import nn import torch.multiprocessing as mp import torch.distributed as dist from torch.nn.parallel import DistributedDataParallel as DDP from torch.u...
[ "torch.nn.CrossEntropyLoss", "multiprocessing.cpu_count", "numpy.array", "torch.utils.data.distributed.DistributedSampler", "torch.sum", "sys.exit", "joblib.delayed", "torch.arange", "os.path.exists", "numpy.mean", "os.listdir", "nltk.corpus.stopwords.words", "numpy.delete", "numpy.max", ...
[((970, 1003), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (993, 1003), False, 'import warnings\n'), ((1868, 1937), 'transformers.BertTokenizer.from_pretrained', 'BertTokenizer.from_pretrained', (['self.pretrained_lm'], {'do_lower_case': '(True)'}), '(self.pretrained_lm...
#!/usr/bin/env python import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = '2' import sys import csv import numpy as np import pandas as pd import random from time import time, strftime, gmtime, sleep from optparse import OptionParser from pylsl import StreamInlet, resolve_byprop from sklearn.linear_model import LinearRegre...
[ "subprocess.check_output", "numpy.abs", "os.listdir", "random.choice", "pylsl.StreamInlet", "subprocess.Popen", "os.path.join", "optparse.OptionParser", "pylsl.resolve_byprop", "time.sleep", "os.path.realpath", "numpy.array", "time.gmtime", "numpy.concatenate", "sys.exit", "pandas.Data...
[((531, 545), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (543, 545), False, 'from optparse import OptionParser\n'), ((2457, 2497), 'pylsl.resolve_byprop', 'resolve_byprop', (['"""type"""', '"""EEG"""'], {'timeout': '(2)'}), "('type', 'EEG', timeout=2)\n", (2471, 2497), False, 'from pylsl import StreamIn...
# Hungarian algorithm (Kuhn-Munkres) for solving the linear sum assignment # problem. Taken from scikit-learn. Based on original code by <NAME>, # adapted to NumPy by <NAME>. # Further improvements by <NAME>, <NAME> and <NAME>. # # Copyright (c) 2008 <NAME> <<EMAIL>>, <NAME> # Author: <NAME>, <NAME> # License: 3...
[ "numpy.ones", "numpy.where", "numpy.asarray", "numpy.argmax", "numpy.any", "numpy.zeros", "numpy.min" ]
[((2927, 2950), 'numpy.asarray', 'np.asarray', (['cost_matrix'], {}), '(cost_matrix)\n', (2937, 2950), True, 'import numpy as np\n'), ((3713, 3734), 'numpy.where', 'np.where', (['(marked == 1)'], {}), '(marked == 1)\n', (3721, 3734), True, 'import numpy as np\n'), ((6247, 6289), 'numpy.asarray', 'np.asarray', (['state....
from abc import ABC, abstractmethod import numpy as np import pandas as pd from pvrpm.core.enums import ConfigKeys as ck from pvrpm.core.case import SamCase from pvrpm.core.utils import sample, get_higher_components from pvrpm.core.modules.monitor import IndepMonitor class Failure(ABC): """ This abstract cl...
[ "numpy.random.random_sample", "numpy.amin", "pvrpm.core.utils.sample", "numpy.array", "numpy.zeros", "numpy.finfo", "numpy.argmin" ]
[((4175, 4216), 'numpy.argmin', 'np.argmin', (['possible_failure_times'], {'axis': '(1)'}), '(possible_failure_times, axis=1)\n', (4184, 4216), True, 'import numpy as np\n'), ((4249, 4288), 'numpy.amin', 'np.amin', (['possible_failure_times'], {'axis': '(1)'}), '(possible_failure_times, axis=1)\n', (4256, 4288), True, ...
''' load lottery tickets and evaluation support datasets: cifar10, Fashionmnist, cifar100 ''' import os import time import random import shutil import argparse import numpy as np from copy import deepcopy import matplotlib.pyplot as plt import torch import torch.optim import torch.nn as nn import torch.utils.data...
[ "torch.cuda.manual_seed_all", "torch.manual_seed", "torch.optim.lr_scheduler.MultiStepLR", "os.makedirs", "torch.nn.CrossEntropyLoss", "argparse.ArgumentParser", "torch.load", "matplotlib.pyplot.plot", "os.path.join", "random.seed", "matplotlib.pyplot.close", "numpy.array", "numpy.random.see...
[((719, 784), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Evaluation Tickets"""'}), "(description='PyTorch Evaluation Tickets')\n", (742, 784), False, 'import argparse\n'), ((3787, 3828), 'os.makedirs', 'os.makedirs', (['args.save_dir'], {'exist_ok': '(True)'}), '(args.save_di...
import time from absl import app, flags, logging from absl.flags import FLAGS import cv2 import numpy as np import tensorflow as tf from yolov3_tf2.models import ( YoloV3, YoloV3Tiny ) from yolov3_tf2.dataset import transform_images, load_tfrecord_dataset from yolov3_tf2.utils import draw_outputs flags.DEFINE_stri...
[ "cv2.imwrite", "yolov3_tf2.dataset.transform_images", "tensorflow.config.experimental.set_memory_growth", "absl.flags.DEFINE_integer", "absl.logging.info", "absl.flags.DEFINE_boolean", "absl.app.run", "numpy.array", "yolov3_tf2.dataset.load_tfrecord_dataset", "yolov3_tf2.utils.draw_outputs", "ti...
[((303, 381), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""classes"""', '"""./data/vocmine.names"""', '"""path to classes file"""'], {}), "('classes', './data/vocmine.names', 'path to classes file')\n", (322, 381), False, 'from absl import app, flags, logging\n'), ((382, 475), 'absl.flags.DEFINE_string', 'f...
import matplotlib.pyplot as plt from time import time import numpy as np from .plotter_utils import figure_ratio, xarray_set_axes_labels, retrieve_or_create_fig_ax # Change the bands (RGB) here if you want other false color combinations def rgb(dataset, at_index=0, x_coord='longitude', y_coord='latitude', ban...
[ "numpy.stack", "numpy.array", "numpy.nanmax", "numpy.interp", "numpy.nanmin" ]
[((2732, 2808), 'numpy.stack', 'np.stack', (['[dataset[bands[0]], dataset[bands[1]], dataset[bands[2]]]'], {'axis': '(-1)'}), '([dataset[bands[0]], dataset[bands[1]], dataset[bands[2]]], axis=-1)\n', (2740, 2808), True, 'import numpy as np\n'), ((3061, 3119), 'numpy.interp', 'np.interp', (['rgb', '(min_rgb, max_rgb)', ...
import logging import os import numpy as np import xml.etree.ElementTree as ET from PIL import Image from paths import DATASETS_ROOT log = logging.getLogger() VOC_CATS = ['__background__', 'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable', 'dog', 'hors...
[ "logging.getLogger", "PIL.Image.open", "xml.etree.ElementTree.parse", "os.path.join", "numpy.array", "numpy.zeros" ]
[((143, 162), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (160, 162), False, 'import logging\n'), ((634, 690), 'os.path.join', 'os.path.join', (['DATASETS_ROOT', "('VOCdevkit/VOC20%s/' % year)"], {}), "(DATASETS_ROOT, 'VOCdevkit/VOC20%s/' % year)\n", (646, 690), False, 'import os\n'), ((1978, 2030), 'xm...
import numpy as np from skmultiflow.drift_detection import ADWIN def demo(): """ _test_adwin In this demo, an ADWIN object evaluates a sequence of numbers corresponding to 2 distributions. The ADWIN object indicates the indices where change is detected. The first half of the data is a sequence ...
[ "skmultiflow.drift_detection.ADWIN", "numpy.random.randint", "numpy.random.seed" ]
[((463, 470), 'skmultiflow.drift_detection.ADWIN', 'ADWIN', ([], {}), '()\n', (468, 470), False, 'from skmultiflow.drift_detection import ADWIN\n'), ((514, 531), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (528, 531), True, 'import numpy as np\n'), ((550, 581), 'numpy.random.randint', 'np.random.rand...
# ========================================================================== # # Copyright NumFOCUS # # 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/...
[ "itk.PyBuffer.keys", "re.compile", "itk.down_cast", "itk.output", "numpy.array", "numpy.moveaxis", "numpy.arange", "itk.array_from_matrix", "numpy.flip", "itk.origin", "numpy.asarray", "itk.ImageIOFactory.CreateImageIO", "itk.MeshIOFactory.CreateMeshIO", "numpy.issubdtype", "numpy.linspa...
[((3438, 3529), 'warnings.warn', 'warnings.warn', (['"""WrapITK warning: itk.image() is deprecated. Use itk.output() instead."""'], {}), "(\n 'WrapITK warning: itk.image() is deprecated. Use itk.output() instead.')\n", (3451, 3529), False, 'import warnings\n'), ((3940, 3967), 'itk.MultiThreaderBase.New', 'itk.MultiT...
import pandas as pd from scipy.stats import t import numpy as np import requests def make_dataframe(r): rows = [] for item in r['data']: rows.append([item['lat'], item['lon'], item['aqi'], item['station']['name']]) df = pd.DataFrame(rows, columns=['lat', 'lon', 'aqi', 'name']) df['aqi'] = pd.t...
[ "numpy.abs", "requests.get", "pandas.to_numeric", "numpy.isnan", "pandas.DataFrame" ]
[((242, 299), 'pandas.DataFrame', 'pd.DataFrame', (['rows'], {'columns': "['lat', 'lon', 'aqi', 'name']"}), "(rows, columns=['lat', 'lon', 'aqi', 'name'])\n", (254, 299), True, 'import pandas as pd\n'), ((316, 354), 'pandas.to_numeric', 'pd.to_numeric', (['df.aqi'], {'errors': '"""coerce"""'}), "(df.aqi, errors='coerce...
# Copyright 2017 The TensorFlow 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 applica...
[ "tensorflow.shape", "tensorflow.split", "tensorflow.multiply", "numpy.array", "object_detection.tensorflow_detect.core.preprocessor.resize_image", "object_detection.tensorflow_detect.core.preprocessor.get_default_func_arg_map", "object_detection.tensorflow_detect.core.preprocessor.scale_boxes_to_pixel_c...
[((125987, 126001), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (125999, 126001), True, 'import tensorflow as tf\n'), ((1360, 1391), 'tensorflow.concat', 'tf.concat', (['[ch255, ch0, ch0]', '(3)'], {}), '([ch255, ch0, ch0], 3)\n', (1369, 1391), True, 'import tensorflow as tf\n'), ((1402, 1435), 'tensorflo...
# -*- coding: utf-8 -*- import logging import utool as ut import numpy as np import vtool as vt import pandas as pd from wbia.algo.graph.nx_utils import ensure_multi_index from wbia.algo.graph.state import POSTV, NEGTV, INCMP print, rrr, profile = ut.inject2(__name__) logger = logging.getLogger('wbia') class Groundt...
[ "logging.getLogger", "utool.inject2", "utool.itake_column", "wbia.algo.graph.nx_utils.ensure_multi_index", "numpy.asarray", "numpy.equal", "numpy.array", "utool.take_column", "vtool.ensure_shape", "utool.nx_node_dict", "pandas.MultiIndex.from_tuples", "utool.aslist", "pandas.Series.from_arra...
[((249, 269), 'utool.inject2', 'ut.inject2', (['__name__'], {}), '(__name__)\n', (259, 269), True, 'import utool as ut\n'), ((279, 304), 'logging.getLogger', 'logging.getLogger', (['"""wbia"""'], {}), "('wbia')\n", (296, 304), False, 'import logging\n'), ((776, 793), 'numpy.array', 'np.array', (['is_comp'], {}), '(is_c...
from collections import OrderedDict import numpy as np from pypospack.qoi import Qoi class ThermalExpansion(Qoi): """ Args: temperature_min (float,int): beginning of the temperature range in Kelvin temperature_max (float,int): end of the temperature range in Kelvin temperature_step (f...
[ "numpy.array", "collections.OrderedDict", "pypospack.qoi.Qoi.__init__", "numpy.linalg.lstsq" ]
[((819, 832), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (830, 832), False, 'from collections import OrderedDict\n'), ((893, 980), 'pypospack.qoi.Qoi.__init__', 'Qoi.__init__', (['self'], {'qoi_name': '_qoi_name', 'qoi_type': '_qoi_type', 'structures': '_structures'}), '(self, qoi_name=_qoi_name, qoi_t...
import sys import math import random from collections import namedtuple import time from pyrf.util import (compute_usable_bins, adjust_usable_fstart_fstop, trim_to_usable_fstart_fstop, find_saturation) import numpy as np from twisted.internet import defer from pyrf.numpy_util import compute_fft import struct MAXI...
[ "numpy.log10", "numpy.arange", "pyrf.util.compute_usable_bins", "numpy.where", "numpy.flipud", "pyrf.util.trim_to_usable_fstart_fstop", "pyrf.numpy_util.compute_fft", "numpy.linspace", "struct.unpack", "numpy.zeros", "numpy.interp", "numpy.frombuffer", "numpy.dtype", "twisted.internet.defe...
[((2239, 2255), 'twisted.internet.defer.Deferred', 'defer.Deferred', ([], {}), '()\n', (2253, 2255), False, 'from twisted.internet import defer\n'), ((2682, 2700), 'numpy.dtype', 'np.dtype', (['np.int32'], {}), '(np.int32)\n', (2690, 2700), True, 'import numpy as np\n'), ((3283, 3320), 'numpy.arange', 'np.arange', (['(...
# Import libraries and set random seeds for reproducibility random_seed = 1237 import random random.seed( random_seed ) import numpy as np np.random.seed( random_seed ) import tensorflow as tf tf.set_random_seed( random_seed ) # Import model and instance loader import model from instance_loader import InstanceLoader im...
[ "instance_loader.InstanceLoader", "util.sparse_to_dense", "random.Random", "model.separate_batch", "tensorflow.Session", "random.seed", "util.save_weights", "tensorflow.global_variables_initializer", "model.model_builder", "numpy.random.seed", "scipy.stats.pearsonr", "tensorflow.set_random_see...
[((93, 117), 'random.seed', 'random.seed', (['random_seed'], {}), '(random_seed)\n', (104, 117), False, 'import random\n'), ((139, 166), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (153, 166), True, 'import numpy as np\n'), ((193, 224), 'tensorflow.set_random_seed', 'tf.set_random_s...
#!/usr/bin/env python import rospy import math import numpy as np from sensor_msgs.msg import LaserScan ####################################### # Laser Scan: # Header: Seq, Stamp, frame_id # Angle_min, Angle_max, Angle_Increment, Time_Increment # Scan time, range_min, range_max, ranges, intensities ###############...
[ "sensor_msgs.msg.LaserScan", "rospy.Subscriber", "rospy.init_node", "rospy.get_param", "numpy.array", "rospy.spin", "rospy.Publisher" ]
[((1698, 1739), 'rospy.init_node', 'rospy.init_node', (['"""noiser"""'], {'anonymous': '(True)'}), "('noiser', anonymous=True)\n", (1713, 1739), False, 'import rospy\n'), ((441, 503), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/base_scan"""', 'LaserScan', 'self.laser_callback'], {}), "('/base_scan', LaserScan, self....
#!/usr/bin/env python3 import sys import numpy as np from example import AmiciExample class ExampleCalvetti(AmiciExample): def __init__(self): AmiciExample.__init__( self ) self.numX = 6 self.numP = 0 self.numK = 6 self.modelOptions['theta'] = [] self.modelOption...
[ "numpy.linspace", "example.AmiciExample.__init__", "sys.exit" ]
[((158, 185), 'example.AmiciExample.__init__', 'AmiciExample.__init__', (['self'], {}), '(self)\n', (179, 185), False, 'from example import AmiciExample\n'), ((404, 427), 'numpy.linspace', 'np.linspace', (['(0)', '(20)', '(201)'], {}), '(0, 20, 201)\n', (415, 427), True, 'import numpy as np\n'), ((922, 933), 'sys.exit'...
from PIL import Image from tflite_runtime.interpreter import Interpreter from tflite_runtime.interpreter import load_delegate from video import create_capture import numpy as np import cv2 as cv import io import picamera import simpleaudio as sa # tf model upload def load_label...
[ "simpleaudio.WaveObject.from_wave_file", "getopt.getopt", "PIL.Image.open", "numpy.argpartition", "cv2.samples.findFile", "io.BytesIO", "picamera.PiCamera", "cv2.equalizeHist", "tflite_runtime.interpreter.load_delegate", "cv2.destroyAllWindows", "cv2.cvtColor" ]
[((1193, 1224), 'numpy.argpartition', 'np.argpartition', (['(-output)', 'top_k'], {}), '(-output, top_k)\n', (1208, 1224), True, 'import numpy as np\n'), ((5829, 5851), 'cv2.destroyAllWindows', 'cv.destroyAllWindows', ([], {}), '()\n', (5849, 5851), True, 'import cv2 as cv\n'), ((1887, 1952), 'getopt.getopt', 'getopt.g...
""" tellotracker: Allows manual operation of the drone and demo tracking mode. Requires mplayer to record/save video. Controls: - tab to lift off - WASD to move the drone - space/shift to ascend/escent slowly - Q/E to yaw slowly - arrow keys to ascend, descend, or yaw quickly - backspace to land, or P to palm-land - en...
[ "time.sleep", "cv2.imshow", "sys.exc_info", "av.open", "cv2.destroyAllWindows", "math.exp", "traceback.print_exception", "tracker.Tracker", "cv2.waitKey", "cv2.getTickFrequency", "numpy.float32", "cv2.putText", "cv2.cvtColor", "threading.Thread", "cv2.resize", "time.time", "numpy.vec...
[((2062, 2073), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2071, 2073), False, 'import os\n'), ((2173, 2219), 'os.path.join', 'os.path.join', (['CWD_PATH', 'MODEL_NAME', 'GRAPH_NAME'], {}), '(CWD_PATH, MODEL_NAME, GRAPH_NAME)\n', (2185, 2219), False, 'import os\n'), ((2261, 2310), 'os.path.join', 'os.path.join', (['C...
# 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...
[ "numpy.prod", "hypothesis.strategies.integers", "program_config.TensorConfig", "hypothesis.strategies.booleans", "unittest.main", "program_config.OpConfig" ]
[((7681, 7696), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7694, 7696), False, 'import unittest\n'), ((6363, 6516), 'program_config.OpConfig', 'OpConfig', (['"""mul"""'], {'inputs': "{'X': ['mul_x'], 'Y': ['mul_y']}", 'outputs': "{'Out': ['mul_out']}", 'x_num_col_dims': 'x_num_col_dims', 'y_num_col_dims': 'y_...
import cv2 from tkinter import Tk from tkinter.filedialog import askopenfilename import numpy as np import imutils import threading def main(): cap = cv2.VideoCapture(vid_path) status1, previous_frame = cap.read() total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) copy_frame ...
[ "cv2.createBackgroundSubtractorMOG2", "imutils.is_cv2", "cv2.imshow", "cv2.destroyAllWindows", "cv2.threshold", "cv2.waitKey", "tkinter.filedialog.askopenfilename", "cv2.putText", "cv2.circle", "cv2.cvtColor", "cv2.GaussianBlur", "cv2.bitwise_and", "numpy.zeros", "cv2.connectedComponentsWi...
[((3251, 3404), 'tkinter.filedialog.askopenfilename', 'askopenfilename', ([], {'filetypes': "(('Video File', '*.mp4'), ('Video File', '*.avi'), ('Video File', '*.flv'),\n ('All Files', '*.*'))", 'title': '"""Choose a video."""'}), "(filetypes=(('Video File', '*.mp4'), ('Video File', '*.avi'),\n ('Video File', '*....
import numpy as np import scipy.stats as stats import scipy.special as spec import util class HMCParams: def __init__(self, tau, tau_g, L, eta, mass, r_clip, grad_clip): self.tau = tau self.tau_g = tau_g self.L = L self.eta = eta self.mass = mass self.r_clip = r_...
[ "numpy.clip", "numpy.abs", "numpy.sqrt", "numpy.random.rand", "numpy.log", "scipy.stats.norm.rvs", "numpy.exp", "numpy.sum", "numpy.zeros" ]
[((2760, 2786), 'numpy.zeros', 'np.zeros', (['(iters + 1, dim)'], {}), '((iters + 1, dim))\n', (2768, 2786), True, 'import numpy as np\n'), ((2833, 2859), 'numpy.zeros', 'np.zeros', (['(iters * L, dim)'], {}), '((iters * L, dim))\n', (2841, 2859), True, 'import numpy as np\n'), ((2876, 2891), 'numpy.zeros', 'np.zeros',...
# -*- coding: utf-8 -*- import numpy from simmate.toolkit import Structure from pymatgen.analysis.diffusion.neb.pathfinder import ( DistinctPathFinder, MigrationHop as PymatgenMigrationHop, IDPPSolver, ) from typing import List class MigrationImages(list): """ This class is just a list of stru...
[ "simmate.toolkit.Structure", "numpy.isclose", "pymatgen.analysis.diffusion.neb.pathfinder.MigrationHop", "pymatgen.analysis.diffusion.neb.pathfinder.IDPPSolver.from_endpoints", "pymatgen.analysis.diffusion.neb.pathfinder.DistinctPathFinder" ]
[((3195, 3280), 'simmate.toolkit.Structure', 'Structure', ([], {'lattice': 'structure.lattice', 'species': 'final_species', 'coords': 'final_coords'}), '(lattice=structure.lattice, species=final_species, coords=final_coords\n )\n', (3204, 3280), False, 'from simmate.toolkit import Structure\n'), ((7774, 7864), 'pyma...
# Copyright 2020 LMNT, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
[ "wavegrad.model.WaveGrad", "torch.nn.L1Loss", "numpy.array", "wavegrad.dataset.from_path", "os.path.islink", "torch.isnan", "torch.utils.tensorboard.SummaryWriter", "torch.randint", "os.unlink", "numpy.concatenate", "torch.nn.parallel.DistributedDataParallel", "torch.randn_like", "torch.cuda...
[((6383, 6424), 'wavegrad.dataset.from_path', 'dataset_from_path', (['args.data_dirs', 'params'], {}), '(args.data_dirs, params)\n', (6400, 6424), True, 'from wavegrad.dataset import from_path as dataset_from_path\n'), ((6662, 6754), 'torch.distributed.init_process_group', 'torch.distributed.init_process_group', (['"""...
# Import necessary packages here from typing import List import warnings from datetime import datetime import pandas as pd import numpy as np import matplotlib.dates as mdates from matplotlib import rc, pyplot as plt # ============================================================================ # ======================...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel", "matplotlib.rc", "matplotlib.dates.DayLocator", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.style.use", "matplotlib.pyplot.close", "warnings.warn", "matplotlib.pyplot.savefig", "matplotlib.pyplot.MaxNLocator", "...
[((5218, 5232), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (5230, 5232), True, 'from matplotlib import rc, pyplot as plt\n'), ((5237, 5285), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'figure.autolayout': True}"], {}), "({'figure.autolayout': True})\n", (5256, 5285), True, 'fro...
import tempfile from concurrent.futures import ProcessPoolExecutor, as_completed import numpy as np import pytest import zarr from dask.distributed import LocalCluster from swyft import Dataset, DirectoryStore, Prior, Simulator from swyft.store.simulator import SimulationStatus PARAMS = ["z1", "z2"] PRIOR = Prior.fr...
[ "tempfile.TemporaryDirectory", "dask.distributed.LocalCluster", "numpy.random.random", "swyft.Simulator", "numpy.any", "swyft.Dataset", "concurrent.futures.as_completed", "numpy.array", "zarr.open", "swyft.DirectoryStore", "zarr.open_group", "pytest.fixture", "concurrent.futures.ProcessPoolE...
[((700, 732), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (714, 732), False, 'import pytest\n'), ((969, 999), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (983, 999), False, 'import pytest\n'), ((762, 801), 'swyft.Simulator...
# @Author: <NAME> # @Date: 2021-03-22 09:43:07 # @Last Modified by: <NAME> # @Last Modified time: 2021-11-08 15:09:29 #!/usr/bin/env python ## based on: detectron2.modeling.roi_heads.box_head ## based on: detectron2.modeling.roi_heads.fast_rcnn import torch from torch import nn import numpy as np import logging ...
[ "numpy.prod", "torch.nn.ReLU", "torch.nn.Dropout", "detectron2.modeling.roi_heads.fast_rcnn._log_classification_stats", "torch.nn.init.constant_", "detectron2.layers.cross_entropy", "fvcore.nn.smooth_l1_loss", "torch.nn.functional.softmax", "torch.arange", "detectron2.layers.ShapeSpec", "torch.n...
[((1340, 1372), 'detectron2.modeling.roi_heads.box_head.ROI_BOX_HEAD_REGISTRY.register', 'ROI_BOX_HEAD_REGISTRY.register', ([], {}), '()\n', (1370, 1372), False, 'from detectron2.modeling.roi_heads.box_head import ROI_BOX_HEAD_REGISTRY\n'), ((18533, 18562), 'detectron2.modeling.roi_heads.ROI_HEADS_REGISTRY.register', '...
#thomas feiring model import math import numpy as np import pandas as pd #enter the year for which you need prediction starting 2019 year=2019 number_of_days=365 day=0 df = pd.read_csv('groundtruth.csv') u=df['Mean'] X_t= u[0] sd=df['St dev'] print("Month,Year,Inflow") #lag -1 correlation lag=df['co relation'] np.rand...
[ "numpy.random.normal", "math.sqrt", "numpy.random.seed", "pandas.read_csv" ]
[((174, 204), 'pandas.read_csv', 'pd.read_csv', (['"""groundtruth.csv"""'], {}), "('groundtruth.csv')\n", (185, 204), True, 'import pandas as pd\n'), ((313, 333), 'numpy.random.seed', 'np.random.seed', (['(9001)'], {}), '(9001)\n', (327, 333), True, 'import numpy as np\n'), ((373, 398), 'numpy.random.normal', 'np.rando...