code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
================================
Experiments on MEG Phantom data
================================
"""
# Authors: <NAME>, <NAME>
# License: BSD 3 clause
import os.path as op
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne import find_events
from mne.datasets.brainstorm import bst_phantom... | [
"matplotlib.pyplot.title",
"mne.preprocessing.maxwell_filter",
"numpy.abs",
"mne.pick_types",
"mne.find_events",
"matplotlib.pyplot.figure",
"numpy.tile",
"os.path.join",
"numpy.std",
"numpy.linspace",
"matplotlib.pyplot.show",
"multiviewica.groupica",
"matplotlib.pyplot.legend",
"multivie... | [((432, 462), 'mne.datasets.brainstorm.bst_phantom_elekta.data_path', 'bst_phantom_elekta.data_path', ([], {}), '()\n', (460, 462), False, 'from mne.datasets.brainstorm import bst_phantom_elekta\n'), ((476, 539), 'os.path.join', 'op.join', (['data_path', '"""kojak_all_200nAm_pp_no_chpi_no_ms_raw.fif"""'], {}), "(data_p... |
import numpy as np
import os
from glob import glob
from skimage.io import imread, imsave
from skimage.transform import resize
from keras.preprocessing.image import ImageDataGenerator
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--path', type=str, default='./banque_tableaux_par_artiste_resi... | [
"keras.preprocessing.image.ImageDataGenerator",
"argparse.ArgumentParser",
"numpy.zeros",
"os.path.join",
"skimage.io.imread"
] | [((211, 236), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (234, 236), False, 'import argparse\n'), ((742, 807), 'numpy.zeros', 'np.zeros', ([], {'shape': '(n_samples, size[0], size[1], 3)', 'dtype': '"""float32"""'}), "(shape=(n_samples, size[0], size[1], 3), dtype='float32')\n", (750, 807),... |
# pylint: skip-file
# flake8: noqa
"""Create plots for channel occlusion data."""
import numpy as np
import matplotlib as mpl
mpl.use("Agg")
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
sns.set_style("white")
from flowcat import io_functions, utils, mappings
data = utils.URLPath("output/0-final/mod... | [
"seaborn.set_style",
"matplotlib.pyplot.close",
"flowcat.mappings.GROUPS.index",
"flowcat.io_functions.load_json",
"numpy.power",
"matplotlib.pyplot.subplots",
"matplotlib.use",
"numpy.mean",
"seaborn.color_palette",
"matplotlib.patches.Patch",
"flowcat.utils.URLPath",
"seaborn.set"
] | [((126, 140), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (133, 140), True, 'import matplotlib as mpl\n'), ((195, 204), 'seaborn.set', 'sns.set', ([], {}), '()\n', (202, 204), True, 'import seaborn as sns\n'), ((205, 227), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('white')\n", (2... |
import pytest
import numpy as np
from numpy.testing import assert_array_almost_equal
from pylops.basicoperators import MatrixMult, Diagonal, Smoothing1D, \
HStack, Identity
from pylops.optimization.leastsquares import NormalEquationsInversion, \
RegularizedInversion, PreconditionedInversion
par1 = {'ny': 11,... | [
"numpy.random.seed",
"numpy.eye",
"pylops.optimization.leastsquares.RegularizedInversion",
"numpy.ones",
"pylops.optimization.leastsquares.NormalEquationsInversion",
"pylops.basicoperators.Smoothing1D",
"numpy.arange",
"numpy.random.normal",
"pylops.basicoperators.Diagonal",
"pytest.mark.parametri... | [((1350, 1438), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""par"""', '[par1, par2, par3, par4, par1j, par2j, par3j, par4j]'], {}), "('par', [par1, par2, par3, par4, par1j, par2j, par3j,\n par4j])\n", (1373, 1438), False, 'import pytest\n'), ((3571, 3659), 'pytest.mark.parametrize', 'pytest.mark.param... |
#!/usr/bin/env python
# coding=utf8
import inspect
import logging
import pprint
import time
import warnings
from collections import namedtuple
from uuid import uuid1
import pendulum
import streamz
import tqdm
from numpy import isclose
from . import schemes
from ..plugins.container import TriflowContainer
logging.ge... | [
"pprint.pformat",
"tqdm",
"time.process_time",
"streamz.Stream",
"pendulum.now",
"uuid.uuid1",
"numpy.isclose",
"inspect.signature",
"collections.namedtuple",
"logging.NullHandler",
"warnings.warn",
"inspect.getsource",
"logging.getLogger"
] | [((382, 409), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (399, 409), False, 'import logging\n'), ((1088, 1150), 'collections.namedtuple', 'namedtuple', (['"""PostProcess"""', "['name', 'function', 'description']"], {}), "('PostProcess', ['name', 'function', 'description'])\n", (1098, ... |
__author__ = "<NAME>"
#encoding="utf-8"
# !/usr/bin/env python
# coding: utf-8
# ### 1. 定义训练过程中将要使用到的常量。
# **因为GitHub无法保存大于100M的文件,所以在运行时需要先自行从Google下载inception_v3.ckpt文件。**
# In[1]:
import glob
import os.path
import numpy as np
import tensorflow as tf
from tensorflow.python.platform import gfile
import tensorflow.... | [
"numpy.load",
"tensorflow.one_hot",
"tensorflow.contrib.slim.python.slim.nets.inception_v3.inception_v3_arg_scope",
"tensorflow.train.Saver",
"tensorflow.get_collection",
"tensorflow.global_variables_initializer",
"tensorflow.argmax",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.Session",
"ten... | [((1229, 1255), 'tensorflow.contrib.slim.get_model_variables', 'slim.get_model_variables', ([], {}), '()\n', (1253, 1255), True, 'import tensorflow.contrib.slim as slim\n'), ((1993, 2012), 'numpy.load', 'np.load', (['INPUT_DATA'], {}), '(INPUT_DATA)\n', (2000, 2012), True, 'import numpy as np\n'), ((2532, 2600), 'tenso... |
from tensorflow.keras import backend as K
from ge import LINE
from ge import Struc2Vec
from ge import Node2Vec
from ge import DeepWalk
import pandas as pd
import networkx as nx
import numpy as np
from scipy.spatial.distance import cosine
import numpy as np
import pickle5 as pickle
import tensorflow.compat.v1 as tf
tf.d... | [
"tensorflow.compat.v1.keras.callbacks.EarlyStopping",
"trenchant_utils.metapath2vec",
"trenchant_utils.type_code_graph",
"ge.Node2Vec",
"trenchant_utils.next_labels_cut",
"trenchant_utils.get_lstm",
"tensorflow.compat.v1.config.experimental.set_memory_growth",
"trenchant_utils.prepare_train_test",
"... | [((316, 340), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (338, 340), True, 'import tensorflow.compat.v1 as tf\n'), ((706, 744), 'tensorflow.compat.v1.config.list_physical_devices', 'tf.config.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (737, 744), True, 'import... |
"""Compressed Sparse Row matrix format"""
__docformat__ = "restructuredtext en"
__all__ = ['csr_matrix', 'isspmatrix_csr']
import numpy as np
from .base import spmatrix
from ._sparsetools import (csr_tocsc, csr_tobsr, csr_count_blocks,
get_csr_submatrix)
from .sputils import upcast, get_i... | [
"numpy.empty",
"numpy.zeros"
] | [((5229, 5273), 'numpy.empty', 'np.empty', (['(self.shape[1] + 1)'], {'dtype': 'idx_dtype'}), '(self.shape[1] + 1, dtype=idx_dtype)\n', (5237, 5273), True, 'import numpy as np\n'), ((5292, 5327), 'numpy.empty', 'np.empty', (['self.nnz'], {'dtype': 'idx_dtype'}), '(self.nnz, dtype=idx_dtype)\n', (5300, 5327), True, 'imp... |
#############################################
# Object detection - YOLO - OpenCV
# Author : <NAME> (July 16, 2018)
# Website : http://www.arunponnusamy.com
############################################
import cv2
import argparse
import numpy as np
import os
import sys
from PIL import Image
'''
ap = argparse.Argume... | [
"cv2.putText",
"cv2.dnn.NMSBoxes",
"numpy.argmax",
"cv2.dnn.blobFromImage",
"cv2.dnn.readNet",
"cv2.rectangle"
] | [((2744, 2776), 'cv2.dnn.readNet', 'cv2.dnn.readNet', (['weights', 'config'], {}), '(weights, config)\n', (2759, 2776), False, 'import cv2\n'), ((2789, 2865), 'cv2.dnn.blobFromImage', 'cv2.dnn.blobFromImage', (['image', 'scale', '(416, 416)', '(0, 0, 0)', '(True)'], {'crop': '(False)'}), '(image, scale, (416, 416), (0,... |
"""Defines PedestriansManager class
----------------------------------------------------------------------------------------------------------
This file is part of Sim-ATAV project and licensed under MIT license.
Copyright (c) 2018 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
For questions please contact:
<NAME> (etuncali [... | [
"numpy.array",
"math.sqrt",
"Sim_ATAV.simulation_control.pedestrian_walker.PedestrianWalker"
] | [((3456, 3583), 'math.sqrt', 'math.sqrt', (['(pedestrian.current_velocity[0] ** 2 + pedestrian.current_velocity[1] ** 2 +\n pedestrian.current_velocity[2] ** 2)'], {}), '(pedestrian.current_velocity[0] ** 2 + pedestrian.current_velocity\n [1] ** 2 + pedestrian.current_velocity[2] ** 2)\n', (3465, 3583), False, 'i... |
import numpy as np
from scipy.ndimage.filters import gaussian_filter1d
import config
import dsp
class VEnergy():
def __init__(self):
self._gain = dsp.ExpFilter(np.tile(0.01, config.N_FFT_BINS),
alpha_decay=0.001, alpha_rise=0.99)
self._p = np.tile(1.0, (3, config.N_PIXE... | [
"scipy.ndimage.filters.gaussian_filter1d",
"numpy.copy",
"numpy.tile",
"numpy.round",
"numpy.concatenate"
] | [((290, 329), 'numpy.tile', 'np.tile', (['(1.0)', '(3, config.N_PIXELS // 2)'], {}), '(1.0, (3, config.N_PIXELS // 2))\n', (297, 329), True, 'import numpy as np\n'), ((620, 630), 'numpy.copy', 'np.copy', (['y'], {}), '(y)\n', (627, 630), True, 'import numpy as np\n'), ((1350, 1378), 'numpy.round', 'np.round', (['self._... |
import numpy as np
from src import celery_app
from src.apps.runs.models import Run
from src.apps.startposes.models import StartPos, StartPosCumWeightOnly
@celery_app.task()
def recompute_startpos_cumulative_weights():
"""
Periodically recompute the cumulative weights of all startposes
:return:
"""
... | [
"src.apps.startposes.models.StartPos.objects.order_by",
"src.apps.startposes.models.StartPosCumWeightOnly.objects.bulk_update",
"src.celery_app.task",
"numpy.cumsum",
"src.apps.runs.models.Run.objects.select_current",
"src.apps.startposes.models.StartPosCumWeightOnly"
] | [((158, 175), 'src.celery_app.task', 'celery_app.task', ([], {}), '()\n', (173, 175), False, 'from src import celery_app\n'), ((336, 364), 'src.apps.runs.models.Run.objects.select_current', 'Run.objects.select_current', ([], {}), '()\n', (362, 364), False, 'from src.apps.runs.models import Run\n'), ((703, 746), 'numpy.... |
import numpy as np
from numpy.linalg import norm
import abc
import logging
from crowd_sim.envs.policy.policy_factory import policy_factory
from crowd_sim.envs.utils.action import ActionXY, ActionRot
from crowd_sim.envs.utils.state import ObservableState, FullState
class Agent(object):
def __init__(self, config, s... | [
"numpy.random.uniform",
"crowd_sim.envs.utils.state.FullState",
"numpy.sin",
"crowd_sim.envs.utils.state.ObservableState",
"numpy.cos"
] | [((1476, 1503), 'numpy.random.uniform', 'np.random.uniform', (['(0.5)', '(1.5)'], {}), '(0.5, 1.5)\n', (1493, 1503), True, 'import numpy as np\n'), ((1526, 1553), 'numpy.random.uniform', 'np.random.uniform', (['(0.3)', '(0.5)'], {}), '(0.3, 0.5)\n', (1543, 1553), True, 'import numpy as np\n'), ((1964, 2028), 'crowd_sim... |
# The following code is used to watch a video stream, detect Aruco markers, and use
# a set of markers to determine the posture of the camera in relation to the plane
# of markers.
import pyrealsense2 as rs
import numpy as np
import sys
#sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
import ... | [
"numpy.load",
"cv2.aruco.drawDetectedMarkers",
"pyrealsense2.pipeline",
"pyrealsense2.config",
"cv2.aruco.detectMarkers",
"cv2.imshow",
"cv2.cvtColor",
"cv2.aruco.drawAxis",
"cv2.convertScaleAbs",
"numpy.int32",
"cv2.drawContours",
"cv2.destroyAllWindows",
"cv2.aruco.estimatePoseSingleMarker... | [((438, 456), 'numpy.load', 'np.load', (['"""mtx.npy"""'], {}), "('mtx.npy')\n", (445, 456), True, 'import numpy as np\n'), ((470, 489), 'numpy.load', 'np.load', (['"""dist.npy"""'], {}), "('dist.npy')\n", (477, 489), True, 'import numpy as np\n'), ((1973, 2006), 'cv2.aruco.DetectorParameters_create', 'aruco.DetectorPa... |
from torch import feature_alpha_dropout
import tqdm
import argparse
from torch.autograd import Variable
import torch
import numpy as np
import sys
sys.path.insert(0, "/home/ubuntu/nas/projects/RDA")
from utils.config import Config
class INVScheduler(object):
def __init__(self, gamma, decay_rate, init_lr=0.001):
... | [
"torch.logsumexp",
"tqdm.tqdm",
"argparse.ArgumentParser",
"torch.autograd.Variable",
"sys.path.insert",
"torch.cat",
"utils.config.Config",
"numpy.sort",
"model.Resnet.ResNetModel",
"torch.squeeze",
"torch.max",
"preprocess.data_provider.load_images",
"torch.optim.SGD"
] | [((147, 198), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/home/ubuntu/nas/projects/RDA"""'], {}), "(0, '/home/ubuntu/nas/projects/RDA')\n", (162, 198), False, 'import sys\n'), ((2222, 2245), 'torch.max', 'torch.max', (['all_probs', '(1)'], {}), '(all_probs, 1)\n', (2231, 2245), False, 'import torch\n'), ((2884,... |
"""
Wrap the internal caffe C++ module (_caffe.so) with a clean, Pythonic
interface.
"""
from collections import OrderedDict
from itertools import zip_longest
import numpy as np
from ._caffe import Net, SGDSolver
import caffe.io
# We directly update methods from Net here (rather than using composition or... | [
"numpy.asarray",
"numpy.zeros",
"itertools.zip_longest",
"numpy.ascontiguousarray",
"numpy.concatenate"
] | [((6486, 6546), 'itertools.zip_longest', 'zip_longest', (['forward_batches', 'backward_batches'], {'fillvalue': '{}'}), '(forward_batches, backward_batches, fillvalue={})\n', (6497, 6546), False, 'from itertools import zip_longest\n'), ((5107, 5132), 'numpy.asarray', 'np.asarray', (['all_outs[out]'], {}), '(all_outs[ou... |
import math
import unittest
import numpy as np
def det(mat):
""" det(a) --> d """
assert isinstance(mat, np.ndarray)
assert len(mat.shape) == 2
assert mat.shape[0] == mat.shape[1]
val_a, val_b, val_c, val_d = mat.reshape((-1,))
return val_a * val_d - val_b * val_c
def det_recursive(mat):
... | [
"unittest.main",
"numpy.triu",
"numpy.eye",
"numpy.tril",
"numpy.zeros",
"numpy.random.randint",
"numpy.array",
"math.factorial",
"numpy.linalg.det",
"numpy.diag"
] | [((1199, 1225), 'numpy.array', 'np.array', (['[[1, 2], [3, 4]]'], {}), '([[1, 2], [3, 4]])\n', (1207, 1225), True, 'import numpy as np\n'), ((1261, 1278), 'numpy.array', 'np.array', (['[[789]]'], {}), '([[789]])\n', (1269, 1278), True, 'import numpy as np\n'), ((1493, 1527), 'numpy.array', 'np.array', (['det_num_ops'],... |
#!/usr/bin/env python3.7
"""
The copyrights of this software are owned by Duke University.
Please refer to the LICENSE.txt and README.txt files for licensing instructions.
The source code can be found on the following GitHub repository: https://github.com/wmglab-duke/ascent
"""
# builtins
import itertools
from typing... | [
"copy.deepcopy",
"matplotlib.pyplot.show",
"os.makedirs",
"os.getcwd",
"matplotlib.pyplot.axes",
"os.path.exists",
"cv2.imread",
"numpy.min",
"numpy.where",
"numpy.array",
"matplotlib.pyplot.gca",
"src.utils.Exceptionable.__init__",
"os.chdir",
"cv2.findContours"
] | [((1334, 1395), 'src.utils.Exceptionable.__init__', 'Exceptionable.__init__', (['self', 'SetupMode.OLD', 'exception_config'], {}), '(self, SetupMode.OLD, exception_config)\n', (1356, 1395), False, 'from src.utils import Exceptionable, SetupMode, WriteMode\n'), ((6142, 6156), 'copy.deepcopy', 'deepcopy', (['self'], {}),... |
import numpy as np
import colorFinder
import myLogger as log
def hue_array_to_string_array(hue_arr):
"""
Converts an array of OpenCV hues (0..180; as well as -1 and -2) to the name of colors
"""
hue_names = ["red ", "orange", "yellow", "lime ", "green ", "teal ", "cyan ", "lblue ", "dblue ", "pur... | [
"numpy.core.defchararray.add",
"numpy.empty",
"numpy.array",
"colorFinder.find_dominant_hue_colors_for_each_mask"
] | [((1391, 1444), 'numpy.core.defchararray.add', 'np.core.defchararray.add', (['string_array', 'hue_array_360'], {}), '(string_array, hue_array_360)\n', (1415, 1444), True, 'import numpy as np\n'), ((2681, 2730), 'numpy.empty', 'np.empty', (['all_dominant_colors.shape[0]'], {'dtype': 'int'}), '(all_dominant_colors.shape[... |
import collections
import itertools
import operator
from typing import Collection, Dict, Iterable, Tuple, Type, TypeVar
import numpy as np
from pddlenv.base import ArityObject, PDDLObject
LiteralIndices = Dict[int, Tuple[np.array, ...]]
LiteralShapes = Dict[int, Tuple[int, ...]]
P = TypeVar("P", bound=ArityObject)
... | [
"numpy.pad",
"numpy.subtract",
"numpy.prod",
"collections.defaultdict",
"operator.attrgetter",
"numpy.array",
"numpy.ravel_multi_index",
"typing.TypeVar",
"numpy.digitize",
"numpy.concatenate"
] | [((287, 318), 'typing.TypeVar', 'TypeVar', (['"""P"""'], {'bound': 'ArityObject'}), "('P', bound=ArityObject)\n", (294, 318), False, 'from typing import Collection, Dict, Iterable, Tuple, Type, TypeVar\n'), ((1851, 1880), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (1874, 1880), Fa... |
from __future__ import division
import numpy as np
from six.moves import zip
from bokeh.plotting import *
from bokeh.objects import Range1d
# Recreate the Fermat spiral from the last exercise, with some different scalings
# and number of turnings
theta1 = np.linspace(0, 256*np.pi, 500)[1:]
f1 = theta1**(1/2)
x1 = 0.5... | [
"bokeh.objects.Range1d",
"numpy.floor",
"numpy.sin",
"numpy.random.random",
"numpy.cos",
"numpy.linspace"
] | [((847, 873), 'bokeh.objects.Range1d', 'Range1d', ([], {'start': '(-20)', 'end': '(20)'}), '(start=-20, end=20)\n', (854, 873), False, 'from bokeh.objects import Range1d\n'), ((879, 905), 'bokeh.objects.Range1d', 'Range1d', ([], {'start': '(-20)', 'end': '(20)'}), '(start=-20, end=20)\n', (886, 905), False, 'from bokeh... |
from __future__ import absolute_import
import hashlib
import inspect
import os
import re
import sys
from distutils.core import Distribution, Extension
from distutils.command.build_ext import build_ext
import Cython
from ..Compiler.Main import Context
from ..Compiler.Options import default_options
from ..Compiler.Pa... | [
"os.makedirs",
"importlib.util.module_from_spec",
"os.path.dirname",
"distutils.core.Distribution",
"inspect.getcallargs",
"os.path.exists",
"distutils.core.Extension",
"imp.load_dynamic",
"importlib.util.spec_from_file_location",
"inspect.getargspec",
"os.path.isfile",
"numpy.get_include",
... | [((11272, 11369), 're.compile', 're.compile', (['"""^((cdef +(extern|class))|cimport|(from .+ cimport)|(from .+ import +[*]))"""'], {}), "(\n '^((cdef +(extern|class))|cimport|(from .+ cimport)|(from .+ import +[*]))'\n )\n", (11282, 11369), False, 'import re\n'), ((3600, 3614), 'distutils.core.Distribution', 'Di... |
import allel
import gzip
import numpy as np
import pandas as pd
from scipy import stats
"""
Pre-processing pipeline.
Functions to load data, generate labels based on window size.
"""
def load_np_data(files, verb=False):
data = []
for f in files:
if verb:
print("Reading " + f + " ...")
... | [
"numpy.load",
"scipy.stats.mode",
"pandas.read_csv",
"numpy.zeros",
"allel.read_vcf",
"numpy.apply_along_axis",
"numpy.where",
"numpy.array",
"numpy.concatenate"
] | [((377, 405), 'numpy.concatenate', 'np.concatenate', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (391, 405), True, 'import numpy as np\n'), ((460, 484), 'allel.read_vcf', 'allel.read_vcf', (['vcf_file'], {}), '(vcf_file)\n', (474, 484), False, 'import allel\n'), ((702, 746), 'pandas.read_csv', 'pd.read_csv', (['ma... |
#!/usr/bin/env python
"""Additional wrappers around apriltag to interact with OpenCV and matplotlib.
Author: <NAME>, 2017
"""
import apriltag
#from apriltag import *
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import os
import math
plt.style.use('seabor... | [
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.gray",
"argparse.ArgumentParser",
"apriltag.add_arguments",
"apriltag.Detector",
"json.dumps",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure",
"numpy.mean",
"matplotlib.pyplot.tight_layout",
"cv2.line",
"cv2.cvtColor",
... | [((299, 329), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-paper"""'], {}), "('seaborn-paper')\n", (312, 329), True, 'import matplotlib.pyplot as plt\n'), ((1116, 1142), 'apriltag.Detector', 'apriltag.Detector', (['options'], {}), '(options)\n', (1133, 1142), False, 'import apriltag\n'), ((1800, 1830),... |
# -*- coding: utf-8 -*-
# Author: <NAME> and <NAME> <<EMAIL>>
"""Miscellaneous WCS utilities"""
import re
from copy import deepcopy
from collections import UserDict
import numpy as np
from astropy import wcs
from astropy.wcs._wcs import InconsistentAxisTypesError
from ndcube.utils import cube as utils_cube
__all__... | [
"copy.deepcopy",
"numpy.invert",
"ndcube.utils.cube.data_axis_to_wcs_axis",
"ndcube.utils.cube.wcs_axis_to_data_axis",
"numpy.ones",
"numpy.nonzero",
"astropy.wcs.WCS",
"astropy.wcs.slice",
"numpy.eye"
] | [((11348, 11405), 'ndcube.utils.cube.data_axis_to_wcs_axis', 'utils_cube.data_axis_to_wcs_axis', (['data_axis', 'missing_axis'], {}), '(data_axis, missing_axis)\n', (11380, 11405), True, 'from ndcube.utils import cube as utils_cube\n'), ((3074, 3090), 'copy.deepcopy', 'deepcopy', (['header'], {}), '(header)\n', (3082, ... |
import os
import numpy
import pandas
import pytest
from rdkit import Chem
import six
from chainer_chemistry.dataset.parsers import CSVFileParser
from chainer_chemistry.dataset.preprocessors import NFPPreprocessor
@pytest.fixture
def mol_smiles():
mol_smiles1 = 'CN=C=O'
mol_smiles2 = 'Cc1ccccc1'
return [m... | [
"pandas.DataFrame",
"chainer_chemistry.dataset.preprocessors.NFPPreprocessor",
"numpy.testing.assert_array_equal",
"chainer_chemistry.dataset.parsers.CSVFileParser",
"pytest.fixture",
"pytest.main",
"six.moves.zip",
"rdkit.Chem.MolFromSmiles"
] | [((453, 469), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (467, 469), False, 'import pytest\n'), ((510, 526), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (524, 526), False, 'import pytest\n'), ((629, 688), 'pandas.DataFrame', 'pandas.DataFrame', (["{'smiles': mol_smiles, 'labelA': label_a}"], {}), "... |
# === Start Python 2/3 compatibility
from __future__ import absolute_import, division, print_function, unicode_literals
from future.builtins import * # noqa pylint: disable=W0401, W0614
from future.builtins.disabled import * # noqa pylint: disable=W0401, W0614
# === End Python 2/3 compatibility
import pytest
impo... | [
"pytest.fixture",
"kotekan.visutil.icmap",
"numpy.array",
"numpy.arange",
"kotekan.runner.FakeVisBuffer",
"kotekan.runner.KotekanStageTester"
] | [((708, 738), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (722, 738), False, 'import pytest\n'), ((840, 943), 'kotekan.runner.FakeVisBuffer', 'runner.FakeVisBuffer', ([], {'freq_ids': "subset_params['freq_ids']", 'num_frames': "subset_params['total_frames']"}), "(freq_ids=... |
import abc
from collections import OrderedDict
from contextlib import contextmanager
import json
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
import tree
from softlearning.models.utils import create_inputs
from softlearning.utils.tensorflow import cast_and_concat, apply_preprocessor... | [
"json.dump",
"softlearning.utils.tensorflow.apply_preprocessors",
"numpy.power",
"numpy.zeros",
"tensorflow_probability.bijectors.Tanh",
"json.dumps",
"softlearning.models.utils.create_inputs",
"tree.map_structure_up_to",
"tensorflow_probability.bijectors.Identity",
"numpy.array",
"collections.O... | [((1045, 1133), 'tree.map_structure_up_to', 'tree.map_structure_up_to', (['input_shapes', 'preprocessors_lib.deserialize', 'preprocessors'], {}), '(input_shapes, preprocessors_lib.deserialize,\n preprocessors)\n', (1069, 1133), False, 'import tree\n'), ((1314, 1341), 'softlearning.models.utils.create_inputs', 'creat... |
"""
================================================================
Symbolic Aggregate approXimation in Vector Space Model (SAX-VSM)
================================================================
This example shows how the SAX-VSM algorithm transforms a dataset
consisting of time series and their corresponding labe... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.vectorize",
"matplotlib.pyplot.ylim",
"pyts.classification.SAXVSM",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.legend",
"pyts.datasets.load_gunpoint",
"matplotlib.pyplot.figure",
"numpy.arange",
"mat... | [((885, 915), 'pyts.datasets.load_gunpoint', 'load_gunpoint', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (898, 915), False, 'from pyts.datasets import load_gunpoint\n'), ((950, 1015), 'pyts.classification.SAXVSM', 'SAXVSM', ([], {'window_size': '(15)', 'word_size': '(3)', 'n_bins': '(2)', 'strategy': '"""un... |
# Copyright 2020 . All Rights Reserved.
# Author : <NAME>
import functools
print = functools.partial(print, flush=True)
import argparse
import os
from textdata_Wikibio import TextData as td_wiki
from textdata_Wikibio import Batch
import time, sys
import torch
import torch.autograd as autograd
import torch.nn as nn
imp... | [
"functools.partial",
"tqdm.tqdm",
"argparse.ArgumentParser",
"kenlmWrapper.LMEvaluator",
"torch.sum",
"torch.load",
"nltk.translate.bleu_score.corpus_bleu",
"math.floor",
"torch.FloatTensor",
"time.time",
"textdata_Wikibio.TextData",
"os.path.isfile",
"numpy.mean",
"torch.exp",
"inspect.... | [((83, 119), 'functools.partial', 'functools.partial', (['print'], {'flush': '(True)'}), '(print, flush=True)\n', (100, 119), False, 'import functools\n'), ((874, 899), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (897, 899), False, 'import argparse\n'), ((1678, 1696), 'math.floor', 'math.flo... |
import collections
import itertools
import random
import gym_kilobots
import numpy as np
from cycler import cycler
from gym import spaces
from gym_kilobots.envs import DirectControlKilobotsEnv, YamlKilobotsEnv
from gym_kilobots.kb_plotting import get_body_from_shape
import yaml
from copy import deepcopy
class Targe... | [
"numpy.sum",
"numpy.arctan2",
"numpy.abs",
"numpy.maximum",
"numpy.ones",
"numpy.argsort",
"numpy.mean",
"numpy.linalg.norm",
"numpy.tile",
"scipy.spatial.distance.pdist",
"numpy.sin",
"itertools.cycle",
"numpy.zeros_like",
"numpy.transpose",
"copy.deepcopy",
"numpy.minimum",
"numpy.... | [((513, 531), 'numpy.asarray', 'np.asarray', (['center'], {}), '(center)\n', (523, 531), True, 'import numpy as np\n'), ((622, 657), 'numpy.array', 'np.array', (['(-width / 2, -height / 2)'], {}), '((-width / 2, -height / 2))\n', (630, 657), True, 'import numpy as np\n'), ((1466, 1482), 'numpy.asarray', 'np.asarray', (... |
from __future__ import print_function
from setuptools import setup, Extension
import numpy
import subprocess
import sys
import os
try:
from Cython.Distutils import build_ext
except ImportError:
raise Exception("*** cython is needed to build this extension.")
cmdclass = {}
ext_modules = []
def getstatusoutpu... | [
"os.path.isdir",
"subprocess.Popen",
"os.path.isfile",
"numpy.get_include"
] | [((346, 395), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stdout': 'subprocess.PIPE'}), '(command, stdout=subprocess.PIPE)\n', (362, 395), False, 'import subprocess\n'), ((1303, 1346), 'os.path.isfile', 'os.path.isfile', (["('%s/libatlas.so.3' % libdir)"], {}), "('%s/libatlas.so.3' % libdir)\n", (1317, 1346... |
"""
Theano is an optimizing compiler in Python, built to evaluate
complicated expressions (especially matrix-valued ones) as quickly as
possible. Theano compiles expression graphs (see :doc:`graph` ) that
are built by Python code. The expressions in these graphs are called
`Apply` nodes and the variables in these grap... | [
"theano.configdefaults.config.init_gpu_device.startswith",
"numpy.seterr",
"logging.StreamHandler",
"logging.Formatter",
"theano.configdefaults.config.device.startswith",
"logging.getLogger"
] | [((1107, 1134), 'logging.getLogger', 'logging.getLogger', (['"""theano"""'], {}), "('theano')\n", (1124, 1134), False, 'import logging\n'), ((1161, 1184), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (1182, 1184), False, 'import logging\n'), ((1213, 1275), 'logging.Formatter', 'logging.Formatter'... |
import os
import sys
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
import h5py
import matplotlib as mpl
from datetime import datetime
plt.close('all')
mpl.rcParams['pdf.fonttype'] = 42
mpl.rcParams['font.size'] = 12
mpl.rcParams['axes.linewidth'] = 2
mpl.rcParams['xtick.major.width'] = 2
mpl... | [
"h5py.File",
"numpy.meshgrid",
"matplotlib.pyplot.show",
"numpy.log",
"numpy.logical_and",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.colorbar.make_axes",
"numpy.diff",
"numpy.where",
"matplotlib.colorbar.ColorbarBase",
"os.path.join"
] | [((162, 178), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (171, 178), True, 'import matplotlib.pyplot as plt\n'), ((854, 923), 'os.path.join', 'os.path.join', (['datapath', '"""alpha200.33680997479286_nSim50"""', '"""data.hdf5"""'], {}), "(datapath, 'alpha200.33680997479286_nSim50', 'data.... |
#!/usr/bin/env python
"""
ROS based interface for the Course Robotics Specialization Capstone Autonomous Rover.
"""
# ROS imports
import roslib
import rospy
from std_msgs.msg import (
Header,
)
from apriltags_ros.msg import (
AprilTagDetectionArray,
AprilTagDetection,
)
from sensor_msgs.msg import Imu
f... | [
"rospy.Subscriber",
"rospy.Publisher",
"geometry_msgs.msg.Twist",
"numpy.array",
"numpy.dot",
"numpy.sqrt"
] | [((1036, 1102), 'numpy.array', 'np.array', (['[[0, 0, 1, 0], [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1]]'], {}), '([[0, 0, 1, 0], [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1]])\n', (1044, 1102), True, 'import numpy as np\n'), ((1154, 1222), 'numpy.array', 'np.array', (['[[0, -1, 0, 0], [0, 0, 1, 0], [-1, 0, 0, 0], [0, 0, 0, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/9/26 14:41
# @Author : ganliang
# @File : modelevaluation.py
# @Desc : 模型选择和验证 https://scikit-learn.org/stable/model_selection.html#model-selection
import numpy as np
from sklearn.model_selection import LeaveOneOut, LeavePOut, KFold, GroupKFold
fro... | [
"src.config.logger.info",
"sklearn.model_selection.KFold",
"sklearn.model_selection.LeaveOneOut",
"numpy.array",
"sklearn.model_selection.GroupKFold",
"sklearn.model_selection.LeavePOut"
] | [((456, 534), 'numpy.array', 'np.array', (['[[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34]]'], {}), '([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34]])\n', (464, 534), True, 'import numpy as np\n'), ((597, 619), 'numpy.array', 'np.array', (['[1, 5, 0, 0]'], {}), '([1, 5, 0, 0])\... |
import random
try:
from transformers import (
ConstantLRSchedule,
WarmupLinearSchedule,
WarmupConstantSchedule,
)
except:
from transformers import (
get_constant_schedule,
get_constant_schedule_with_warmup,
get_linear_schedule_with_warmup,
)
from modelin... | [
"transformers.WarmupLinearSchedule",
"numpy.load",
"os.getpid",
"numpy.random.seed",
"datetime.datetime.today",
"transformers.get_constant_schedule_with_warmup",
"transformers.get_constant_schedule",
"subprocess.check_output",
"socket.gethostname",
"transformers.ConstantLRSchedule",
"transformer... | [((614, 634), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (632, 634), False, 'import socket, os, subprocess, datetime\n'), ((650, 661), 'os.getpid', 'os.getpid', ([], {}), '()\n', (659, 661), False, 'import socket, os, subprocess, datetime\n'), ((4868, 4890), 'random.seed', 'random.seed', (['args.seed... |
__author__ = 'aymgal'
import numpy as np
from scipy import signal
from slitronomy.Util import util
from skimage import filters
class NoiseLevels(object):
"""
Handle noise properties and compute noise levels in wavelets space,
taking into account lensing and optionally blurring and regridding error for ... | [
"slitronomy.Util.util.dirac_impulse",
"numpy.zeros_like",
"numpy.sum",
"numpy.abs",
"numpy.zeros",
"slitronomy.Util.util.regridding_error_map_squared",
"scipy.signal.fftconvolve",
"skimage.filters.gaussian",
"numpy.sqrt"
] | [((1110, 1133), 'numpy.sqrt', 'np.sqrt', (['data_class.C_D'], {}), '(data_class.C_D)\n', (1117, 1133), True, 'import numpy as np\n'), ((2043, 2104), 'numpy.sqrt', 'np.sqrt', (['(self.noise_map ** 2 + self.regridding_error_map ** 2)'], {}), '(self.noise_map ** 2 + self.regridding_error_map ** 2)\n', (2050, 2104), True, ... |
"""
This module contains a transformer that applies capping to numeric columns.
"""
import datetime
import warnings
import numpy as np
import pandas as pd
from tubular.base import BaseTransformer
class DateDiffLeapYearTransformer(BaseTransformer):
"""Transformer to calculate the number of years between two date... | [
"pandas.isnull",
"datetime.datetime",
"numpy.timedelta64",
"pandas.to_datetime",
"pandas.api.types.is_datetime64_dtype",
"warnings.warn"
] | [((9089, 9150), 'pandas.to_datetime', 'pd.to_datetime', (['X[self.columns[0]]'], {}), '(X[self.columns[0]], **self.to_datetime_kwargs)\n', (9103, 9150), True, 'import pandas as pd\n'), ((2869, 2900), 'pandas.isnull', 'pd.isnull', (['row[self.columns[0]]'], {}), '(row[self.columns[0]])\n', (2878, 2900), True, 'import pa... |
#!/usr/bin/env python3
"""
Copyright 2017-2018 Deutsche Telekom AG, Technische Universität Berlin, Technische
Universität Ilmenau, LM Ericsson
Permission is hereby granted, free of charge, to use the software for research
purposes.
Any other use of the software, including commercial use, merging, publishing,
distribu... | [
"math.exp",
"numpy.sum",
"numpy.log",
"numpy.mean",
"numpy.exp",
"numpy.log10"
] | [((1831, 1872), 'numpy.log10', 'np.log10', (['(u2 * (scale_factor - 1.0) + 1.0)'], {}), '(u2 * (scale_factor - 1.0) + 1.0)\n', (1839, 1872), True, 'import numpy as np\n'), ((14526, 14565), 'numpy.mean', 'np.mean', (["[f['bitrate'] for f in frames]"], {}), "([f['bitrate'] for f in frames])\n", (14533, 14565), True, 'imp... |
import numpy as np
from rlgym.utils import math
from rlgym.utils.common_values import BLUE_TEAM, BLUE_GOAL_BACK, ORANGE_GOAL_BACK, ORANGE_TEAM, BALL_MAX_SPEED, \
CAR_MAX_SPEED
from rlgym.utils.gamestates import GameState, PlayerData
from rlgym.utils.reward_functions import RewardFunction
class EventReward(Reward... | [
"rlgym.utils.math.cosine_similarity",
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.sqrt"
] | [((1117, 1192), 'numpy.array', 'np.array', (['[goal, team_goal, concede, touch, shot, save, demo, boost_pickup]'], {}), '([goal, team_goal, concede, touch, shot, save, demo, boost_pickup])\n', (1125, 1192), True, 'import numpy as np\n'), ((1592, 1755), 'numpy.array', 'np.array', (['[player.match_goals, team, opponent, ... |
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import random
import time
import tensorflow as tf
import argparse
import tf_utils.provider as provider
#import models.pointSIFT_pointnet_age as AGE_MODEL
#import models.pointSIFT_pointnet_age_dense as AGE_MODEL
import mo... | [
"numpy.load",
"numpy.sum",
"argparse.ArgumentParser",
"tensorflow.maximum",
"tensorflow.get_variable_scope",
"tensorflow.summary.Summary.Value",
"tensorflow.ConfigProto",
"tensorflow.Variable",
"numpy.arange",
"models.pointSIFT_pointnet_age_dense_rgb.get_model",
"models.pointSIFT_pointnet_age_de... | [((381, 406), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (404, 406), False, 'import argparse\n'), ((3919, 3936), 'numpy.load', 'np.load', (['npz_path'], {}), '(npz_path)\n', (3926, 3936), True, 'import numpy as np\n'), ((4421, 4454), 'numpy.arange', 'np.arange', (['train_data[0].shape[0]'],... |
import torch
import torchvision
import torch.nn as nn
import torchvision.transforms as transforms
from torch.utils.data import DataLoader, random_split
from torch.autograd import Variable
import numpy as np
class CustomDataset:
def __init__(self,args,graph,vec):
self.args = args
self.data = ve... | [
"torch.from_numpy",
"numpy.asarray",
"torchvision.transforms.ToTensor"
] | [((345, 366), 'torchvision.transforms.ToTensor', 'transforms.ToTensor', ([], {}), '()\n', (364, 366), True, 'import torchvision.transforms as transforms\n'), ((533, 578), 'numpy.asarray', 'np.asarray', (['self.data.iloc[index][0:self.num]'], {}), '(self.data.iloc[index][0:self.num])\n', (543, 578), True, 'import numpy ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 12 10:10:34 2016
@author: agirard
"""
from AlexRobotics.dynamic import Hybrid_Manipulator as HM
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
class BoeingArm( HM.HybridThreeLinkManipulator ) :
""" 3DOF Manipulator Cl... | [
"numpy.eye",
"matplotlib.pyplot.plot",
"numpy.zeros",
"numpy.arcsin",
"scipy.interpolate.interp1d",
"numpy.sin",
"numpy.array",
"numpy.arange",
"numpy.cos",
"numpy.arctan",
"AlexRobotics.dynamic.Hybrid_Manipulator.HybridThreeLinkManipulator.__init__",
"matplotlib.pyplot.subplots",
"numpy.dia... | [((428, 478), 'AlexRobotics.dynamic.Hybrid_Manipulator.HybridThreeLinkManipulator.__init__', 'HM.HybridThreeLinkManipulator.__init__', (['self', 'n', 'm'], {}), '(self, n, m)\n', (466, 478), True, 'from AlexRobotics.dynamic import Hybrid_Manipulator as HM\n'), ((1527, 1553), 'numpy.sqrt', 'np.sqrt', (['(b1 ** 2 + b2 **... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy.wcs.utils import skycoord_to_pixel, pixel_to_skycoord
from ..core import PixelRegion, SkyRegion, RegionMask, BoundingBox, PixCoord
from .._geometry import polygonal_overlap_grid
from .._geometry.pnpoly import points_in_pol... | [
"numpy.abs",
"astropy.wcs.utils.skycoord_to_pixel",
"numpy.asarray",
"numpy.logical_not",
"matplotlib.patches.Polygon",
"numpy.dot",
"astropy.wcs.utils.pixel_to_skycoord",
"numpy.vstack"
] | [((2572, 2612), 'numpy.asarray', 'np.asarray', (['self.vertices.x'], {'dtype': 'float'}), '(self.vertices.x, dtype=float)\n', (2582, 2612), True, 'import numpy as np\n'), ((2626, 2666), 'numpy.asarray', 'np.asarray', (['self.vertices.y'], {'dtype': 'float'}), '(self.vertices.y, dtype=float)\n', (2636, 2666), True, 'imp... |
"""
Constructing and loading dictionaries
"""
import six
from six.moves import cPickle as pkl
import numpy
from collections import OrderedDict
def build_dictionary(text):
"""
Build a dictionary
text: list of sentences (pre-tokenized)
"""
wordcount = OrderedDict()
for cc in text:
words =... | [
"collections.OrderedDict",
"numpy.argsort",
"six.moves.cPickle.dump",
"six.moves.cPickle.load"
] | [((271, 284), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (282, 284), False, 'from collections import OrderedDict\n'), ((574, 587), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (585, 587), False, 'from collections import OrderedDict\n'), ((531, 551), 'numpy.argsort', 'numpy.argsort', (['f... |
from abc import ABC, abstractmethod
from collections import defaultdict
import pickle
import os
import numpy as np
from tqdm import tqdm
from .utils import raml_tqdm
class Model:
def __init__(self):
pass
def compile(self, cost, optimizer = None, metrics=[]):
self.cost = cost
self.o... | [
"pickle.dump",
"numpy.argmax",
"collections.defaultdict",
"pickle.load",
"numpy.arange",
"os.path.join",
"numpy.random.shuffle"
] | [((3538, 3555), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (3549, 3555), False, 'from collections import defaultdict\n'), ((835, 856), 'numpy.arange', 'np.arange', (['X.shape[1]'], {}), '(X.shape[1])\n', (844, 856), True, 'import numpy as np\n'), ((869, 895), 'numpy.random.shuffle', 'np.rando... |
import pandas as pd
import numpy as np
import numpy.random as nrnd
import os as os
import functools as functools
class GloveReader:
# GloveReader manages the glove embeddings.
def __init__(self, base_dir='data'):
self.base_dir = base_dir
self.model = None
self.model_size = 0
model... | [
"numpy.nan_to_num",
"pandas.read_csv",
"numpy.zeros",
"numpy.random.multivariate_normal",
"pandas.Series",
"functools.reduce",
"numpy.cov",
"os.path.join"
] | [((350, 391), 'os.path.join', 'os.path.join', (['"""glove"""', '"""glove.6B.50d.txt"""'], {}), "('glove', 'glove.6B.50d.txt')\n", (362, 391), True, 'import os as os\n'), ((413, 455), 'os.path.join', 'os.path.join', (['"""glove"""', '"""glove.6B.100d.txt"""'], {}), "('glove', 'glove.6B.100d.txt')\n", (425, 455), True, '... |
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib import patches
import matplotlib.patches as mpatches
import scipy.io as sio
# plotting configuration
ratio = 1.5
figure_len, figure_width = 15*ratio, 12*ratio
font_size_1, font_size_2 = 36*ratio, 36*ratio
legend_size = 18*ratio
li... | [
"matplotlib.pyplot.yscale",
"numpy.clip",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tick_params",
"numpy.power",
"matplotlib.pyplot.yticks",
"numpy.max",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legen... | [((474, 499), 'seaborn.color_palette', 'sns.color_palette', (['"""deep"""'], {}), "('deep')\n", (491, 499), True, 'import seaborn as sns\n'), ((946, 979), 'numpy.arange', 'np.arange', (['(1.6)', '(2.4 + 0.005)', '(0.05)'], {}), '(1.6, 2.4 + 0.005, 0.05)\n', (955, 979), True, 'import numpy as np\n'), ((2162, 2208), 'mat... |
"""
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | [
"oneflow.nn.Softplus",
"numpy.abs",
"oneflow.unittest.skip_unless_1n1d",
"numpy.exp",
"oneflow.nn.LogSoftmax",
"oneflow.device",
"unittest.main",
"numpy.random.randn",
"numpy.max",
"oneflow.nn.Softsign",
"numpy.minimum",
"oneflow.nn.Softmax",
"test_util.GenArgList",
"numpy.zeros",
"unitt... | [((807, 839), 'oneflow.unittest.skip_unless_1n1d', 'flow.unittest.skip_unless_1n1d', ([], {}), '()\n', (837, 839), True, 'import oneflow as flow\n'), ((1440, 1472), 'oneflow.unittest.skip_unless_1n1d', 'flow.unittest.skip_unless_1n1d', ([], {}), '()\n', (1470, 1472), True, 'import oneflow as flow\n'), ((2078, 2110), 'o... |
from brainiak.matnormal.utils import (pack_trainable_vars,
unpack_trainable_vars,
flatten_cholesky_unique,
unflatten_cholesky_unique)
import tensorflow as tf
import numpy as np
import numpy.testing as npt
... | [
"brainiak.matnormal.utils.unflatten_cholesky_unique",
"brainiak.matnormal.utils.flatten_cholesky_unique",
"tensorflow.random.stateless_normal",
"numpy.testing.assert_equal",
"numpy.random.normal",
"brainiak.matnormal.utils.unpack_trainable_vars",
"numpy.testing.assert_allclose",
"brainiak.matnormal.ut... | [((512, 537), 'brainiak.matnormal.utils.pack_trainable_vars', 'pack_trainable_vars', (['mats'], {}), '(mats)\n', (531, 537), False, 'from brainiak.matnormal.utils import pack_trainable_vars, unpack_trainable_vars, flatten_cholesky_unique, unflatten_cholesky_unique\n'), ((555, 592), 'brainiak.matnormal.utils.unpack_trai... |
# Copyright 2019 ZTE corporation. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Constructed model by cfg file"""
import os
import argparse
import logging
from pathlib import Path
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from torch_utils import fuse_conv_and... | [
"argparse.ArgumentParser",
"torch.cat",
"pathlib.Path",
"torch.arange",
"torch.device",
"torch.exp",
"torch.nn.functional.interpolate",
"torch.Tensor",
"torch.nn.ModuleList",
"os.path.basename",
"torch.nn.Conv2d",
"torch_utils.model_info",
"torch.nn.ZeroPad2d",
"torch.nn.BatchNorm2d",
"t... | [((346, 373), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (363, 373), False, 'import logging\n'), ((5541, 5556), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (5554, 5556), False, 'from torch import nn\n'), ((20406, 20431), 'argparse.ArgumentParser', 'argparse.ArgumentParse... |
"""
- Person class definition.
A person with maternal and paternal sequence information.
Has an admix method to create next generation admixed individual.
- create_new function
Takes 2 Person datatypes and returns an admixed Person
"""
import numpy as np
class Person():
def __init__(self,chm,chm_length_m... | [
"numpy.zeros_like",
"numpy.sort",
"numpy.arange",
"numpy.random.poisson",
"numpy.random.rand",
"numpy.concatenate"
] | [((4929, 4969), 'numpy.zeros_like', 'np.zeros_like', (['founders[0].maternal[key]'], {}), '(founders[0].maternal[key])\n', (4942, 4969), True, 'import numpy as np\n'), ((5683, 5703), 'numpy.sort', 'np.sort', (['breakpoints'], {}), '(breakpoints)\n', (5690, 5703), True, 'import numpy as np\n'), ((5735, 5788), 'numpy.con... |
import os
import tempfile
import dask.dataframe as dd
import numpy as np
import pandas as pd
import pytest
from dask.datasets import timeseries
from dask.distributed import Client, LocalCluster
from dask.distributed.utils_test import loop # noqa: F401
from pandas.testing import assert_frame_equal
try:
import cud... | [
"dask.dataframe.from_pandas",
"numpy.random.seed",
"os.unlink",
"dask_cuda.LocalCUDACluster",
"numpy.random.randint",
"pandas.DataFrame",
"dask.distributed.Client",
"dask.distributed.LocalCluster",
"os.path.exists",
"pandas.read_sql_query",
"numpy.random.choice",
"os.urandom",
"pandas.testin... | [((524, 540), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (538, 540), False, 'import pytest\n'), ((956, 972), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (970, 972), False, 'import pytest\n'), ((1057, 1073), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1071, 1073), False, 'import pytest\n'... |
import numpy as np
from scipy import optimize
from numpy.testing import assert_allclose
from itertools import product
import pytest
from sklearn.utils._testing import assert_almost_equal
from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing import assert_array_almost_equal
from sklearn.dumm... | [
"numpy.sum",
"sklearn.metrics.mean_tweedie_deviance",
"sklearn.metrics.r2_score",
"sklearn.metrics.mean_absolute_error",
"numpy.isnan",
"sklearn.metrics.max_error",
"numpy.arange",
"numpy.mean",
"pytest.mark.parametrize",
"sklearn.metrics.mean_pinball_loss",
"numpy.full",
"sklearn.utils._testi... | [((13587, 13632), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""metric"""', '[r2_score]'], {}), "('metric', [r2_score])\n", (13610, 13632), False, 'import pytest\n'), ((15264, 15358), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""distribution"""', "['normal', 'lognormal', 'exponential', 'uni... |
import numpy as np
from scipy import stats
from statsmodels.regression.linear_model import OLS
from statsmodels.tools import tools
from statsmodels.sandbox.regression.gmm import IV2SLS, IVGMM, DistQuantilesGMM, spec_hausman
from statsmodels.sandbox.regression import gmm
if __name__ == '__main__':
import stats... | [
"numpy.diag",
"statsmodels.sandbox.regression.gmm.IVGMM",
"scipy.stats.genpareto.rvs",
"numpy.ones",
"statsmodels.regression.linear_model.OLS",
"numpy.array",
"numpy.linspace",
"numpy.column_stack",
"numpy.random.normal",
"numpy.dot",
"statsmodels.sandbox.regression.gmm.DistQuantilesGMM",
"sta... | [((543, 567), 'numpy.linspace', 'np.linspace', (['(0)', '(10)', 'nobs'], {}), '(0, 10, nobs)\n', (554, 567), True, 'import numpy as np\n'), ((656, 678), 'numpy.array', 'np.array', (['[1, 0.1, 10]'], {}), '([1, 0.1, 10])\n', (664, 678), True, 'import numpy as np\n'), ((2416, 2477), 'statsmodels.sandbox.regression.gmm.IV... |
from ase.units import kB
import copy
import numpy as np
class LinearVibCorrection(object):
def __init__(self, eci_per_kbT):
self.eci_per_kbT = eci_per_kbT
self.orig_eci = None
self.current_eci = None
self.vibs_included = False
self.temperature = 0.0
def check_provided_... | [
"copy.deepcopy",
"numpy.isclose"
] | [((1804, 1835), 'copy.deepcopy', 'copy.deepcopy', (['eci_with_out_vib'], {}), '(eci_with_out_vib)\n', (1817, 1835), False, 'import copy\n'), ((2222, 2250), 'copy.deepcopy', 'copy.deepcopy', (['eci_with_vibs'], {}), '(eci_with_vibs)\n', (2235, 2250), False, 'import copy\n'), ((909, 961), 'numpy.isclose', 'np.isclose', (... |
import math
import tensorflow as tf
import numpy as np
def hw_flatten(x):
return tf.reshape(x, shape=[-1, x.shape[1] * x.shape[2], x.shape[-1]])
def l2_norm(v, eps=1e-12):
return v / (tf.reduce_sum(v ** 2) ** 0.5 + eps)
def lrelu(x, alpha=0.2):
return tf.nn.leaky_relu(x, alpha)
def create_linear_ini... | [
"tensorflow.reduce_sum",
"tensorflow.constant_initializer",
"tensorflow.reshape",
"tensorflow.matmul",
"tensorflow.nn.conv2d",
"numpy.random.normal",
"tensorflow.nn.leaky_relu",
"tensorflow.get_variable",
"tensorflow.nn.softmax",
"tensorflow.variable_scope",
"tensorflow.exp",
"tensorflow.gradi... | [((87, 150), 'tensorflow.reshape', 'tf.reshape', (['x'], {'shape': '[-1, x.shape[1] * x.shape[2], x.shape[-1]]'}), '(x, shape=[-1, x.shape[1] * x.shape[2], x.shape[-1]])\n', (97, 150), True, 'import tensorflow as tf\n'), ((270, 296), 'tensorflow.nn.leaky_relu', 'tf.nn.leaky_relu', (['x', 'alpha'], {}), '(x, alpha)\n', ... |
import streamlit as st
import pandas as pd
import plotly.express as px
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
import numpy as np
def pca_maker(data_import):
numerical_columns_list = []
categorical_columns_list = []
for i in data_import.columns:
if da... | [
"pandas.DataFrame",
"sklearn.preprocessing.StandardScaler",
"numpy.dtype",
"numpy.mean",
"sklearn.decomposition.PCA",
"pandas.concat"
] | [((562, 603), 'pandas.concat', 'pd.concat', (['numerical_columns_list'], {'axis': '(1)'}), '(numerical_columns_list, axis=1)\n', (571, 603), True, 'import pandas as pd\n'), ((627, 670), 'pandas.concat', 'pd.concat', (['categorical_columns_list'], {'axis': '(1)'}), '(categorical_columns_list, axis=1)\n', (636, 670), Tru... |
import numpy as np
from scipy.stats import wasserstein_distance
import gpflow
from gpflow.utilities.ops import square_distance
import tensorflow as tf
tf.config.run_functions_eagerly(True)
class WassersteinStationary(gpflow.kernels.Stationary):
" Matern32 with wasserstein distance"
def K(self, X, X2=None):
... | [
"tensorflow.config.run_functions_eagerly",
"tensorflow.convert_to_tensor",
"tensorflow.maximum",
"tensorflow.exp",
"tensorflow.where",
"numpy.sqrt"
] | [((153, 190), 'tensorflow.config.run_functions_eagerly', 'tf.config.run_functions_eagerly', (['(True)'], {}), '(True)\n', (184, 190), True, 'import tensorflow as tf\n'), ((619, 631), 'numpy.sqrt', 'np.sqrt', (['(3.0)'], {}), '(3.0)\n', (626, 631), True, 'import numpy as np\n'), ((1143, 1170), 'tensorflow.convert_to_ten... |
from torch.utils.data import Dataset, DataLoader
from transformers import BartTokenizer, T5Tokenizer
from tqdm import tqdm
import pytorch_lightning as pl
import torch
import numpy as np
from utils.utils import pad_sents, get_mask
class OurDataset(Dataset):
"""Summarization dataset"""
def __init__(self, args, m... | [
"tqdm.tqdm",
"numpy.load",
"utils.utils.pad_sents",
"torch.utils.data.DataLoader",
"transformers.BartTokenizer.from_pretrained",
"transformers.T5Tokenizer.from_pretrained",
"torch.tensor",
"utils.utils.get_mask"
] | [((8532, 8655), 'torch.utils.data.DataLoader', 'DataLoader', ([], {'dataset': 'train_set', 'batch_size': 'args.batch_size', 'num_workers': '(3)', 'shuffle': '(True)', 'collate_fn': 'train_set.collate_fn'}), '(dataset=train_set, batch_size=args.batch_size, num_workers=3,\n shuffle=True, collate_fn=train_set.collate_f... |
#! /usr/bin/env python3
import numpy as np
from sigmoid import sigmoid_
def log_gradient_(x, y_true, y_pred):
x = np.array(x)
y_true = np.array(y_true)
y_pred = np.array(y_pred)
sigma = []
if y_true.size > 1:
x = np.transpose(x)
for i, row in enumerate(x):
... | [
"numpy.transpose",
"numpy.array",
"numpy.sum",
"sigmoid.sigmoid_"
] | [((126, 137), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (134, 137), True, 'import numpy as np\n'), ((152, 168), 'numpy.array', 'np.array', (['y_true'], {}), '(y_true)\n', (160, 168), True, 'import numpy as np\n'), ((183, 199), 'numpy.array', 'np.array', (['y_pred'], {}), '(y_pred)\n', (191, 199), True, 'import n... |
import numpy as np
import pytest
from fiberpy.mechanics import A2Eij, FiberComposite
# RVE data for Moldflow A218V50
rve_data = {
"rho0": 1.14e-9,
"E0": 631.66,
"nu0": 0.42925,
"alpha0": 5.86e-5,
"rho1": 2.55e-9,
"E1": 72000,
"nu1": 0.22,
"alpha1": 5e-6,
"mf": 0.5,
... | [
"pytest.mark.parametrize",
"numpy.allclose",
"fiberpy.mechanics.FiberComposite",
"numpy.array"
] | [((360, 384), 'fiberpy.mechanics.FiberComposite', 'FiberComposite', (['rve_data'], {}), '(rve_data)\n', (374, 384), False, 'from fiberpy.mechanics import A2Eij, FiberComposite\n'), ((444, 1414), 'numpy.array', 'np.array', (['[[3927.35, 3927.35, 1889.93, 1453.1, 405.54, 405.54, 0.351416, 0.452022, \n 0.217523], [4307... |
"""Custom Traits."""
import datetime
import numpy as np
from traitlets import TraitType
def date_to_json(value, obj):
"""Serialize a Date value."""
if value is None:
return value
else:
return value.strftime('%Y-%m-%dT%H:%M:%S.%f')
def date_from_json(value, obj):
"""Deserialize a Dat... | [
"datetime.datetime.today",
"numpy.datetime64",
"numpy.dtype",
"datetime.datetime",
"datetime.datetime.strptime"
] | [((361, 418), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['value', '"""%Y-%m-%dT%H:%M:%S.%f"""'], {}), "(value, '%Y-%m-%dT%H:%M:%S.%f')\n", (387, 418), False, 'import datetime\n'), ((1538, 1563), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (1561, 1563), False, 'import datet... |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"pandas.read_csv",
"numpy.ones",
"pytest.mark.skipif",
"numpy.arange",
"numpy.random.randint",
"sqlalchemy.Table",
"os.path.join",
"pandas.DataFrame",
"pandas.RangeIndex",
"tempfile.TemporaryDirectory",
"pytest.warns",
"numpy.random.RandomState",
"pandas.IntervalIndex.from_tuples",
"sqlalc... | [((21482, 21544), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(pa is None)'], {'reason': '"""pyarrow not installed"""'}), "(pa is None, reason='pyarrow not installed')\n", (21500, 21544), False, 'import pytest\n'), ((25820, 25893), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(sqlalchemy is None)'], {'reason': '""... |
import pandas as pd
import numpy as np
import pickle
import torch
from models.BiLSTM_ATT import BiLSTM_ATT
from models.PCNN_ATT import PCNN_ATT
from sklearn.model_selection import train_test_split
import lightgbm as lgb
# Data Directory
origin_data_dir = 'datasets/test/'
file_list = os.listdir(origin_data_dir)
file_na... | [
"numpy.stack",
"numpy.argmax",
"pandas.read_csv",
"torch.load",
"numpy.zeros",
"lightgbm.Booster",
"pickle.load",
"numpy.array",
"numpy.reshape",
"torch.cuda.LongTensor",
"numpy.concatenate"
] | [((550, 582), 'torch.load', 'torch.load', (['"""models/pcnn_att.pt"""'], {}), "('models/pcnn_att.pt')\n", (560, 582), False, 'import torch\n'), ((596, 630), 'torch.load', 'torch.load', (['"""models/bilstm_att.pt"""'], {}), "('models/bilstm_att.pt')\n", (606, 630), False, 'import torch\n'), ((644, 690), 'lightgbm.Booste... |
# coding=utf-8
from __future__ import print_function
import logging, os, numbers, six, numpy, threading, inspect, time
from os.path import isfile
import phi.fluidformat, phi.math.nd
from phi.viz.plot import PlotlyFigureBuilder
def synchronized_method(method):
outer_lock = threading.Lock()
lock_name = "__" + m... | [
"threading.Thread",
"phi.viz.plot.PlotlyFigureBuilder",
"os.path.join",
"logging.basicConfig",
"os.makedirs",
"os.path.isdir",
"inspect.getabsfile",
"time.time",
"threading.Lock",
"logging.info",
"inspect.getfile",
"os.path.isfile",
"time.sleep",
"numpy.log10",
"phi.viz.dash_gui.DashFiel... | [((279, 295), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (293, 295), False, 'import logging, os, numbers, six, numpy, threading, inspect, time\n'), ((2398, 2426), 'os.path.expanduser', 'os.path.expanduser', (['base_dir'], {}), '(base_dir)\n', (2416, 2426), False, 'import logging, os, numbers, six, numpy, thr... |
# Copyright (c) 2016, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... | [
"tempfile.NamedTemporaryFile",
"PIL.Image.new",
"os.path.isabs",
"pynq.Overlay",
"cffi.FFI",
"os.path.isdir",
"numpy.frombuffer",
"os.path.realpath",
"numpy.identity",
"PIL.Image.open",
"numpy.array",
"os.path.join",
"os.listdir"
] | [((2198, 2247), 'os.path.join', 'os.path.join', (['BNN_ROOT_DIR', '"""libraries"""', 'PLATFORM'], {}), "(BNN_ROOT_DIR, 'libraries', PLATFORM)\n", (2210, 2247), False, 'import os\n'), ((2262, 2312), 'os.path.join', 'os.path.join', (['BNN_ROOT_DIR', '"""bitstreams"""', 'PLATFORM'], {}), "(BNN_ROOT_DIR, 'bitstreams', PLAT... |
import os
import numpy as n
import idlsave
import glob
import astropy.io.fits as fits
spm_dir = os.path.join(os.environ['DATA_DIR'], "spm")
gama_dir = os.path.join(spm_dir, "GAMAmock")
input_dir = os.path.join(gama_dir, "inputs")
RecycleFraction = 0.43
h0 = 0.693
mass_factor = 1. #/(h0*(1.-RecycleFraction))
cat = fi... | [
"os.remove",
"numpy.sum",
"os.path.basename",
"astropy.io.fits.BinTableHDU.from_columns",
"numpy.isnan",
"os.path.isfile",
"astropy.io.fits.open",
"idlsave.read",
"astropy.io.fits.Column",
"numpy.log10",
"os.path.join"
] | [((97, 140), 'os.path.join', 'os.path.join', (["os.environ['DATA_DIR']", '"""spm"""'], {}), "(os.environ['DATA_DIR'], 'spm')\n", (109, 140), False, 'import os\n'), ((152, 185), 'os.path.join', 'os.path.join', (['spm_dir', '"""GAMAmock"""'], {}), "(spm_dir, 'GAMAmock')\n", (164, 185), False, 'import os\n'), ((198, 230),... |
import math as ma
import pyHiChi as hichi
import hichi_primitives as hp
from numba import cfunc, float64, jit, njit, jitclass, types, carray
import numpy as np
# Spherical wave can be created by two ways: with Python and with C++
# C++ is faster
# --------- creating spherical pulse with python -------------------
... | [
"numba.carray",
"hichi_primitives.block",
"hichi_primitives.cross",
"hichi_primitives.Vector3d",
"numpy.sin",
"numpy.cos",
"numpy.arctan",
"pyHiChi.TightFocusingField",
"numba.cfunc",
"numpy.sqrt"
] | [((885, 918), 'numpy.arctan', 'np.arctan', (['(1.0 / (2.0 * f_number))'], {}), '(1.0 / (2.0 * f_number))\n', (894, 918), True, 'import numpy as np\n'), ((2321, 2398), 'numba.cfunc', 'cfunc', (['"""void(float64,float64,float64,types.CPointer(float64))"""'], {'nopython': '(True)'}), "('void(float64,float64,float64,types.... |
# coding=utf-8
'''
周诗蕙 2018.12.2
'''
from matplotlib import pyplot as plt
import cv2
import numpy as np
import dlib
import time
import math
from mpl_toolkits.mplot3d import Axes3D
import scipy
from scipy.optimize import *
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("shap... | [
"numpy.sum",
"cv2.imshow",
"dlib.shape_predictor",
"cv2.line",
"cv2.solve",
"numpy.copy",
"math.cos",
"cv2.circle",
"cv2.waitKey",
"numpy.cross",
"math.sin",
"dlib.get_frontal_face_detector",
"numpy.dot",
"math.atan",
"cv2.putText",
"numpy.zeros",
"scipy.optimize.fmin_cg",
"time.ti... | [((248, 280), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (278, 280), False, 'import dlib\n'), ((294, 355), 'dlib.shape_predictor', 'dlib.shape_predictor', (['"""shape_predictor_68_face_landmarks.dat"""'], {}), "('shape_predictor_68_face_landmarks.dat')\n", (314, 355), False, '... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"mindspore.ops.operations.LayerNorm",
"mindspore.ops.operations.Mul",
"mindspore.context.reset_auto_parallel_context",
"mindspore.common.api._executor.compile",
"mindspore.context.set_auto_parallel_context",
"numpy.ones",
"mindspore.nn.TrainOneStepCell",
"pytest.raises",
"mindspore.Parameter",
"mi... | [((1857, 1883), 'numpy.ones', 'np.ones', (['[128, 64, 32, 16]'], {}), '([128, 64, 32, 16])\n', (1864, 1883), True, 'import numpy as np\n'), ((1915, 1941), 'numpy.ones', 'np.ones', (['[128, 64, 32, 16]'], {}), '([128, 64, 32, 16])\n', (1922, 1941), True, 'import numpy as np\n'), ((1973, 1999), 'numpy.ones', 'np.ones', (... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
from imutils import face_utils
import imutils
import numpy as np
import dlib
import cv2
def rect_to_bb(rect):
# take a bounding predicted by dlib and convert it
# to the format (x, y, w, h) as we would normally do
# with OpenCV
x = rect.left()
y = re... | [
"cv2.circle",
"cv2.cvtColor",
"cv2.waitKey",
"numpy.zeros",
"cv2.imshow",
"cv2.VideoCapture",
"imutils.face_utils.shape_to_np",
"imutils.face_utils.rect_to_bb",
"dlib.get_frontal_face_detector",
"cv2.rectangle",
"dlib.shape_predictor"
] | [((919, 951), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (949, 951), False, 'import dlib\n'), ((964, 1007), 'dlib.shape_predictor', 'dlib.shape_predictor', (['"""shape_68_lmarks.dat"""'], {}), "('shape_68_lmarks.dat')\n", (984, 1007), False, 'import dlib\n'), ((1043, 1062), 'c... |
import numpy as np
import matplotlib.pyplot as plt
import pickle
def pickle_dump(obj, file):
with open(file, 'wb') as f:
pickle.dump(obj, f)
def create_train_set(obs_train, descriptions_ids_train, id2description, size_state):
state_train_idx = 0
state_train_list = []
state_idx_buffer = dict(... | [
"pickle.dump",
"numpy.array"
] | [((135, 154), 'pickle.dump', 'pickle.dump', (['obj', 'f'], {}), '(obj, f)\n', (146, 154), False, 'import pickle\n'), ((6508, 6524), 'numpy.array', 'np.array', (['s_test'], {}), '(s_test)\n', (6516, 6524), True, 'import numpy as np\n'), ((6542, 6558), 'numpy.array', 'np.array', (['r_test'], {}), '(r_test)\n', (6550, 655... |
import os
import time
import typing as T
import numpy as np
from envyaml import EnvYAML
from rembrain_robot_framework import RobotDispatcher, RobotProcess
class P1(RobotProcess):
def run(self) -> None:
for i in range(10000):
if i % 1000 == 0:
print(i)
self.shared... | [
"rembrain_robot_framework.RobotDispatcher",
"numpy.random.random",
"os.path.dirname",
"time.sleep"
] | [((2057, 2091), 'rembrain_robot_framework.RobotDispatcher', 'RobotDispatcher', (['config', 'processes'], {}), '(config, processes)\n', (2072, 2091), False, 'from rembrain_robot_framework import RobotDispatcher, RobotProcess\n'), ((2263, 2278), 'time.sleep', 'time.sleep', (['(5.0)'], {}), '(5.0)\n', (2273, 2278), False,... |
#! /usr/bin/env python
"""
specpolfilter
get filter values from stokes.fits data
"""
import os, sys, glob, inspect
import numpy as np
import pyfits
from scipy.interpolate import interp1d
from pyraf import iraf
from iraf import pysalt
from saltobslog import obslog
def specpolfilter(filter, infilelist):
if fil... | [
"pyfits.open",
"numpy.isnan",
"numpy.arange",
"numpy.loadtxt",
"pyraf.iraf.osfn",
"scipy.interpolate.interp1d",
"numpy.sqrt",
"numpy.vstack",
"saltobslog.obslog"
] | [((605, 653), 'numpy.loadtxt', 'np.loadtxt', (['filterfile'], {'dtype': 'float', 'unpack': '(True)'}), '(filterfile, dtype=float, unpack=True)\n', (615, 653), True, 'import numpy as np\n'), ((692, 710), 'saltobslog.obslog', 'obslog', (['infilelist'], {}), '(infilelist)\n', (698, 710), False, 'from saltobslog import obs... |
import numpy as np
def metric_rms_contrast(rfi, distance, roi=None, **kwargs):
"""Compute RMS contrast of the phase
Notes
-----
The negative angle of the field is used for contrast estimation.
"""
data = -np.anlge(rfi.propagate(distance))
av = np.average(data, *kwargs)
mal = 1 / (data... | [
"numpy.average",
"numpy.sum"
] | [((275, 300), 'numpy.average', 'np.average', (['data', '*kwargs'], {}), '(data, *kwargs)\n', (285, 300), True, 'import numpy as np\n'), ((421, 445), 'numpy.sum', 'np.sum', (['((data - av) ** 2)'], {}), '((data - av) ** 2)\n', (427, 445), True, 'import numpy as np\n')] |
'''
from pystatsmodels mailinglist 20100524
Notes:
- unfinished, unverified, but most parts seem to work in MonteCarlo
- one example taken from lecture notes looks ok
- needs cases with non-monotonic inequality for test to see difference between
one-step, step-up and step-down procedures
- FDR does not look re... | [
"scipy.stats.norm.isf",
"statsmodels.graphics.utils.create_mpl_ax",
"numpy.sum",
"numpy.abs",
"scipy.stats.ttest_1samp",
"numpy.ones",
"numpy.argsort",
"numpy.mean",
"numpy.arange",
"scipy.interpolate.interp1d",
"numpy.round",
"numpy.unique",
"numpy.meshgrid",
"math.pow",
"statsmodels.st... | [((5514, 5530), 'numpy.arange', 'np.arange', (['(2)', '(11)'], {}), '(2, 11)\n', (5523, 5530), True, 'import numpy as np\n'), ((6627, 6652), 'statsmodels.stats.libqsturng.qsturng', 'qsturng', (['(1 - alpha)', 'k', 'df'], {}), '(1 - alpha, k, df)\n', (6634, 6652), False, 'from statsmodels.stats.libqsturng import qsturng... |
"""
Module containing the base object for multivariate kernel density and
regression, plus some utilities.
"""
import copy
import numpy as np
from scipy import optimize
from scipy.stats.mstats import mquantiles
try:
import joblib
has_joblib = True
except ImportError:
has_joblib = False
from . import kern... | [
"scipy.optimize.fmin",
"copy.deepcopy",
"numpy.minimum",
"numpy.std",
"numpy.empty",
"numpy.asarray",
"numpy.median",
"numpy.ones",
"numpy.prod",
"numpy.shape",
"numpy.array",
"numpy.reshape",
"scipy.stats.mstats.mquantiles",
"joblib.Parallel",
"numpy.squeeze",
"joblib.delayed",
"num... | [((1215, 1235), 'numpy.std', 'np.std', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (1221, 1235), True, 'import numpy as np\n'), ((1387, 1405), 'numpy.minimum', 'np.minimum', (['s1', 's2'], {}), '(s1, s2)\n', (1397, 1405), True, 'import numpy as np\n'), ((15411, 15451), 'numpy.array', 'np.array', (["[(c == 'c') for... |
import unittest
import numpy as np
import copy
import ase
from chemiscope import create_input
TEST_FRAMES = [ase.Atoms("CO2")]
class TestCreateInputMeta(unittest.TestCase):
def test_meta(self):
meta = {}
data = create_input(frames=TEST_FRAMES, meta=meta)
self.assertEqual(data["meta"]["na... | [
"unittest.main",
"copy.deepcopy",
"chemiscope.create_input",
"numpy.array",
"ase.Atoms"
] | [((111, 127), 'ase.Atoms', 'ase.Atoms', (['"""CO2"""'], {}), "('CO2')\n", (120, 127), False, 'import ase\n'), ((16405, 16420), 'unittest.main', 'unittest.main', ([], {}), '()\n', (16418, 16420), False, 'import unittest\n'), ((235, 278), 'chemiscope.create_input', 'create_input', ([], {'frames': 'TEST_FRAMES', 'meta': '... |
"""Tests for Statistics Utilities."""
from common_python.statistics import empirical_distribution_generator
import common_python.constants as cn
from common_python.testing import helpers
import numpy as np
import pandas as pd
import unittest
def makeData(size):
return pd.DataFrame({
COLA: range(size),
... | [
"unittest.main",
"common_python.testing.helpers.isValidDataFrame",
"numpy.abs"
] | [((1649, 1664), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1662, 1664), False, 'import unittest\n'), ((914, 935), 'numpy.abs', 'np.abs', (['(frac - frac_0)'], {}), '(frac - frac_0)\n', (920, 935), True, 'import numpy as np\n'), ((972, 1012), 'common_python.testing.helpers.isValidDataFrame', 'helpers.isValidDa... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
"numpy.sum",
"argparse.ArgumentParser",
"tensorflow.contrib.tpu.CrossShardOptimizer",
"tensorflow.contrib.tpu.TPUEstimatorSpec",
"tensorflow.estimator.EstimatorSpec",
"tensorflow.contrib.tpu.TPUConfig",
"tensorflow.layers.dense",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.contrib.tpu.RunConfig... | [((974, 1000), 'tensorflow.train.get_global_step', 'tf.train.get_global_step', ([], {}), '()\n', (998, 1000), True, 'import tensorflow as tf\n'), ((1014, 1066), 'tensorflow.layers.dense', 'tf.layers.dense', (['features', '(10)'], {'activation': 'tf.nn.relu'}), '(features, 10, activation=tf.nn.relu)\n', (1029, 1066), Tr... |
#!/usr/bin/env python
#1)run 2)B0 3)betai 4)betae 5)Z0 6)L 7)runtime 8)lambda_c 9)T_p(0) 10)T_p(final) 11)T_e(0) 12)T_e(final) 13)Qi/Qe 14)tci/tnl 15) deltaE/deltaT
def msparams(rc,it,ft):
import numpy as np
from Codes.lccor import lccor
rc.loadenergies()
idxi = np.argmin(np.abs(rc.ta-it)); idxf=np.argmin(... | [
"numpy.abs",
"subs.create_object",
"Codes.lccor.lccor",
"numpy.sqrt"
] | [((448, 487), 'Codes.lccor.lccor', 'lccor', (['rc'], {'bs': 'idxm', 'fs': '(idxm + 1)', 'step': '(1)'}), '(rc, bs=idxm, fs=idxm + 1, step=1)\n', (453, 487), False, 'from Codes.lccor import lccor\n'), ((489, 537), 'numpy.sqrt', 'np.sqrt', (['(rc.b0x ** 2 + rc.b0y ** 2 + rc.b0z ** 2)'], {}), '(rc.b0x ** 2 + rc.b0y ** 2 +... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
import pandas as pd
import os
import sys
import math
#import numpy as np
#from matplotlib import pyplot as plt
import numpy as np
import pathlib
import glob
import PIL
import ... | [
"matplotlib.pyplot.title",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Dense",
"tensorflow.distribute.get_strategy",
"tensorflow.losses.SparseCategoricalCrossentropy",
"tensorflow.reshape",
"tensorflow.keras.applications.Xception",
"tensorflow.data.experimental.cardinality",
"te... | [((422, 474), 'configargparse.ArgParser', 'configargparse.ArgParser', ([], {'description': '"""myTFClassify"""'}), "(description='myTFClassify')\n", (446, 474), False, 'import configargparse\n'), ((2555, 2600), 'tensorflow.io.parse_single_example', 'tf.io.parse_single_example', (['example', 'features'], {}), '(example,... |
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
from functools import wraps
def init_params(params, dataset):
"""Initlaize the parameters with a dataset
For potential models, generate the atomic dress from the dataset.
For BPNN, generate the range of fingerprints (to be used with `fp... | [
"sys.stdout.write",
"tensorflow.reduce_sum",
"tensorflow.identity",
"tensorflow.zeros_like",
"tensorflow.math.segment_sum",
"tensorflow.logging.set_verbosity",
"numpy.mean",
"tensorflow.reduce_max",
"os.path.join",
"tensorflow.stack",
"tensorflow.cast",
"numpy.max",
"tensorflow.gradients",
... | [((2964, 2990), 'tensorflow.zeros_like', 'tf.zeros_like', (['elem', 'dtype'], {}), '(elem, dtype)\n', (2977, 2990), True, 'import tensorflow as tf\n'), ((3187, 3257), 'tensorflow.math.unsorted_segment_sum', 'tf.math.unsorted_segment_sum', (['e_dress', "tensors['ind_1'][:, 0]", 'n_batch'], {}), "(e_dress, tensors['ind_1... |
from waveorder.waveorder_reconstructor import waveorder_microscopy
import numpy as np
import time
def initialize_reconstructor(pipeline, image_dim=None, wavelength_nm=None, swing=None, calibration_scheme=None,
NA_obj=None, NA_illu=None, mag=None, n_slices=None, z_step_um=None,
... | [
"numpy.copy",
"numpy.transpose",
"waveorder.waveorder_reconstructor.waveorder_microscopy",
"time.time",
"numpy.shape",
"numpy.sin",
"numpy.cos",
"numpy.sqrt"
] | [((6010, 6021), 'time.time', 'time.time', ([], {}), '()\n', (6019, 6021), False, 'import time\n'), ((6034, 6385), 'waveorder.waveorder_reconstructor.waveorder_microscopy', 'waveorder_microscopy', ([], {'img_dim': 'image_dim', 'lambda_illu': 'lambda_illu', 'ps': 'ps', 'NA_obj': 'NA_obj', 'NA_illu': 'NA_illu', 'z_defocus... |
# -*- coding: utf-8 -*-
"""
Package: iads
Fichier: utils.py
Année: semestre 2 - 2018-2019, Sorbonne Université
"""
# ---------------------------
# Fonctions utiles pour les TDTME de 3i026
# import externe
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# importation de LabeledSet
from . impor... | [
"matplotlib.pyplot.scatter",
"numpy.where",
"matplotlib.pyplot.contourf",
"numpy.linspace"
] | [((735, 784), 'matplotlib.pyplot.scatter', 'plt.scatter', (['S_pos[:, 0]', 'S_pos[:, 1]'], {'marker': '"""o"""'}), "(S_pos[:, 0], S_pos[:, 1], marker='o')\n", (746, 784), True, 'import matplotlib.pyplot as plt\n'), ((809, 858), 'matplotlib.pyplot.scatter', 'plt.scatter', (['S_neg[:, 0]', 'S_neg[:, 1]'], {'marker': '"""... |
from igibson.envs.igibson_env import iGibsonEnv
import numpy as np
from igibson.objects.ycb_object import YCBObject
from igibson.objects.articulated_object import ArticulatedObject
import math
import pybullet as p
import torch
import random
from gym import spaces
def quaternion_from_euler(ai, aj, ak, axes='sxyz'):
... | [
"pybullet.createVisualShape",
"numpy.empty",
"torch.cat",
"numpy.clip",
"pybullet.createCollisionShape",
"pybullet.getQuaternionFromEuler",
"pybullet.getLinkState",
"pybullet.createConstraint",
"igibson.objects.articulated_object.ArticulatedObject",
"math.cos",
"numpy.linspace",
"pybullet.getJ... | [((1450, 1462), 'math.cos', 'math.cos', (['ai'], {}), '(ai)\n', (1458, 1462), False, 'import math\n'), ((1472, 1484), 'math.sin', 'math.sin', (['ai'], {}), '(ai)\n', (1480, 1484), False, 'import math\n'), ((1494, 1506), 'math.cos', 'math.cos', (['aj'], {}), '(aj)\n', (1502, 1506), False, 'import math\n'), ((1516, 1528)... |
# Copyright 2019-2022 Cambridge Quantum Computing
#
# 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... | [
"pytket.passes.auto_rebase_pass",
"pytket.passes.CliffordSimp",
"typing.cast",
"pytket.passes.FullPeepholeOptimise",
"collections.defaultdict",
"pytket.backends.ResultHandle",
"pytket.passes.DecomposeBoxes",
"pytket.predicates.ConnectivityPredicate",
"pytket.architecture.Architecture",
"qiskit.Aer... | [((23248, 23265), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (23259, 23265), False, 'from collections import defaultdict\n'), ((23290, 23307), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (23301, 23307), False, 'from collections import defaultdict\n'), ((23379, 23396)... |
# -*- coding: utf-8 -*-
from hello_cnn.vectorizer import Vectorizer, build_vectorizer
from unittest.mock import MagicMock, patch
import numpy as np
class TestVectorizer(object):
def test__to_alphabet_word_list(self):
vec = Vectorizer(MagicMock())
words = vec._to_alphabet_word_list(
'T... | [
"hello_cnn.vectorizer.build_vectorizer",
"unittest.mock.MagicMock",
"hello_cnn.vectorizer.Vectorizer",
"unittest.mock.patch",
"numpy.array"
] | [((2262, 2318), 'unittest.mock.patch', 'patch', (['"""gensim.models.KeyedVectors.load_word2vec_format"""'], {}), "('gensim.models.KeyedVectors.load_word2vec_format')\n", (2267, 2318), False, 'from unittest.mock import MagicMock, patch\n'), ((2353, 2383), 'hello_cnn.vectorizer.build_vectorizer', 'build_vectorizer', (['"... |
import numpy as np
import unittest as ut
from qfast.utils import is_skew_hermitian, dot_product
from qfast.pauli import get_norder_paulis
class TestIsSkewHermitian ( ut.TestCase ):
def test_is_skew_hermitian ( self ):
paulis = get_norder_paulis( 3 )
for i in range( 10 ):
alpha... | [
"unittest.main",
"qfast.pauli.get_norder_paulis",
"numpy.ones",
"qfast.utils.dot_product",
"numpy.random.random",
"qfast.utils.is_skew_hermitian"
] | [((831, 840), 'unittest.main', 'ut.main', ([], {}), '()\n', (838, 840), True, 'import unittest as ut\n'), ((249, 269), 'qfast.pauli.get_norder_paulis', 'get_norder_paulis', (['(3)'], {}), '(3)\n', (266, 269), False, 'from qfast.pauli import get_norder_paulis\n'), ((721, 741), 'qfast.utils.is_skew_hermitian', 'is_skew_h... |
import os, cv2, math
import numpy as np
from scipy import ndimage
from scipy.ndimage import convolve
from scipy.signal import medfilt2d
from skimage import color, io, segmentation
from skimage import color
import matplotlib.pyplot as plt
import networkx as nx
from scipy.spatial import distance
from skimage im... | [
"numpy.sum",
"numpy.argmax",
"numpy.floor",
"scipy.ndimage.binary_fill_holes",
"numpy.mean",
"numpy.arange",
"skimage.img_as_float",
"numpy.exp",
"numpy.sin",
"cv2.normalize",
"numpy.linalg.solve",
"cv2.inRange",
"numpy.unique",
"skimage.color.rgb2lab",
"cv2.contourArea",
"numpy.meshgr... | [((416, 475), 'cv2.resize', 'cv2.resize', (['image', '(640, 480)'], {'interpolation': 'cv2.INTER_AREA'}), '(image, (640, 480), interpolation=cv2.INTER_AREA)\n', (426, 475), False, 'import os, cv2, math\n'), ((1140, 1163), 'numpy.floor', 'np.floor', (['(8 / 2 * sigma)'], {}), '(8 / 2 * sigma)\n', (1148, 1163), True, 'im... |
#
# Copyright 2018 Analytics Zoo 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 agreed to... | [
"numpy.random.seed",
"numpy.average",
"tensorflow.keras.layers.Dense",
"zoo.pipeline.api.net.TFOptimizer.from_keras",
"tensorflow.keras.backend.clear_session",
"numpy.square",
"pytest.main",
"tensorflow.keras.models.Model",
"zoo.tfpark.TFDataset.from_rdd",
"tensorflow.keras.layers.Embedding",
"n... | [((10656, 10679), 'pytest.main', 'pytest.main', (['[__file__]'], {}), '([__file__])\n', (10667, 10679), False, 'import pytest\n'), ((934, 957), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (947, 957), False, 'import os\n'), ((1061, 1093), 'tensorflow.keras.backend.clear_session', 'tf.keras.back... |
# Copyright 2014-2018 The PySCF Developers. 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 appl... | [
"unittest.main",
"numpy.float32",
"numpy.zeros",
"scipy.linalg.inv",
"scipy.sparse.linalg.LinearOperator",
"numpy.array",
"numpy.linspace",
"scipy.sparse.linalg.lgmres",
"numpy.dot"
] | [((956, 1045), 'numpy.array', 'np.array', (['[1.0 + 1.0j * 0.2, 2.5 + 1.0j * 0.2, 4.0 + 1.0j * 0.2]'], {'dtype': 'np.complex64'}), '([1.0 + 1.0j * 0.2, 2.5 + 1.0j * 0.2, 4.0 + 1.0j * 0.2], dtype=np.\n complex64)\n', (964, 1045), True, 'import os, unittest, numpy as np\n'), ((1038, 1044), 'scipy.linalg.inv', 'inv', (... |
#! /usr/bin/env python
"""Run a YOLO_v2 style detection model on test images."""
import cv2
import os
import time
import numpy as np
import csv
from keras import backend as K
from keras.models import load_model
from yad2k.models.keras_yolo import yolo_eval, yolo_head
class YOLO(object):
def __init__(self):
... | [
"keras.models.load_model",
"numpy.floor",
"yad2k.models.keras_yolo.yolo_eval",
"cv2.rectangle",
"cv2.normalize",
"cv2.imshow",
"keras.backend.placeholder",
"os.path.exists",
"numpy.save",
"csv.writer",
"keras.backend.learning_phase",
"cv2.waitKey",
"cv2.calcHist",
"os.makedirs",
"keras.b... | [((4789, 4817), 'cv2.VideoCapture', 'cv2.VideoCapture', (['video_name'], {}), '(video_name)\n', (4805, 4817), False, 'import cv2\n'), ((7899, 7914), 'cv2.imread', 'cv2.imread', (['img'], {}), '(img)\n', (7909, 7914), False, 'import cv2\n'), ((7958, 7986), 'cv2.namedWindow', 'cv2.namedWindow', (['"""detection"""'], {}),... |
from .base_activation import BaseActivation
import numpy as np
class Sigmoid(BaseActivation):
@staticmethod
def forward(value):
"""
return forward calculation of Sigmoid
"""
return 1. / (1. + np.exp(-value))
@staticmethod
def backward(value):
"""
return... | [
"numpy.exp"
] | [((234, 248), 'numpy.exp', 'np.exp', (['(-value)'], {}), '(-value)\n', (240, 248), True, 'import numpy as np\n')] |
#!/usr/bin/env python
import os
import io
import glob
import numpy
import re
import shutil
import sys
from setuptools import setup, find_packages
from distutils.core import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
def read(*names, **kwargs):
with io.open(os.path.join(os.p... | [
"Cython.Build.cythonize",
"os.path.dirname",
"pypandoc.convert",
"distutils.core.Extension",
"numpy.get_include",
"glob.glob",
"re.search",
"setuptools.find_packages"
] | [((2334, 2355), 'Cython.Build.cythonize', 'cythonize', (['extensions'], {}), '(extensions)\n', (2343, 2355), False, 'from Cython.Build import cythonize\n'), ((531, 604), 're.search', 're.search', (['"""^__version__ = [\'\\\\"]([^\'\\\\"]*)[\'\\\\"]"""', 'version_file', 're.M'], {}), '(\'^__version__ = [\\\'\\\\"]([^\\\... |
from distutils.core import Extension,setup
from Cython.Build import cythonize
import numpy
ext_modules = [
Extension(
"julia",
["julia.pyx"],
include_dirs=[numpy.get_include()],
)
]
setup(
ext_modules=cythonize(ext_modules)
) | [
"Cython.Build.cythonize",
"numpy.get_include"
] | [((238, 260), 'Cython.Build.cythonize', 'cythonize', (['ext_modules'], {}), '(ext_modules)\n', (247, 260), False, 'from Cython.Build import cythonize\n'), ((184, 203), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (201, 203), False, 'import numpy\n')] |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 13 13:12:55 2020
@author: <NAME>
"""
import streamlit as st
import numpy as np
import matplotlib.pyplot as plt
import PIL
isotropic_templates = np.zeros(256, dtype = np.uint8)
with open('minkowsky_templates.csv', mode = 'r') as file:
for line in file:
index,... | [
"streamlit.checkbox",
"numpy.zeros",
"streamlit.file_uploader",
"streamlit.write",
"streamlit.title",
"matplotlib.pyplot.subplots",
"streamlit.text",
"numpy.histogram",
"numpy.array",
"streamlit.button",
"numpy.random.randint",
"streamlit.selectbox",
"streamlit.number_input"
] | [((194, 223), 'numpy.zeros', 'np.zeros', (['(256)'], {'dtype': 'np.uint8'}), '(256, dtype=np.uint8)\n', (202, 223), True, 'import numpy as np\n'), ((493, 528), 'numpy.zeros', 'np.zeros', (['(2, 2, 2)'], {'dtype': 'np.uint8'}), '((2, 2, 2), dtype=np.uint8)\n', (501, 528), True, 'import numpy as np\n'), ((3215, 3262), 's... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import numpy as np
import math
import tensorflow as tf
def forward_convert(coordinate, with_label=True):
"""
:param coordinate: format [x_c, y_c, w, h, theta]
:... | [
"tensorflow.reshape",
"numpy.greater",
"cv2.boxPoints",
"numpy.sin",
"cv2.minAreaRect",
"tensorflow.reduce_max",
"tensorflow.greater",
"tensorflow.sin",
"numpy.logical_not",
"tensorflow.stack",
"tensorflow.cast",
"numpy.reshape",
"numpy.less",
"tensorflow.reduce_min",
"numpy.stack",
"n... | [((938, 971), 'numpy.array', 'np.array', (['boxes'], {'dtype': 'np.float32'}), '(boxes, dtype=np.float32)\n', (946, 971), True, 'import numpy as np\n'), ((2011, 2044), 'numpy.array', 'np.array', (['boxes'], {'dtype': 'np.float32'}), '(boxes, dtype=np.float32)\n', (2019, 2044), True, 'import numpy as np\n'), ((6007, 604... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.