code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import os
import sys
import time
import glob
import shutil
import argparse
import cv2
import numpy as np
sys.path.insert(0, '..')
import plantid
def imread_ex(filename, flags=-1):
try:
return cv2.imdecode(np.fromfile(filename, dtype=np.uint8), flags)
except Exception as e:
return None
... | [
"os.path.exists",
"numpy.fromfile",
"sys.path.insert",
"argparse.ArgumentParser",
"os.makedirs",
"shutil.move",
"os.path.join",
"plantid.PlantIdentifier",
"os.path.basename",
"time.time"
] | [((107, 131), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (122, 131), False, 'import sys\n'), ((403, 428), 'plantid.PlantIdentifier', 'plantid.PlantIdentifier', ([], {}), '()\n', (426, 428), False, 'import plantid\n'), ((505, 516), 'time.time', 'time.time', ([], {}), '()\n', (514, 51... |
"""
drift/continuous.py
===================
GSadjust code for calculating continuous-model drift correction.
--------------------------------------------------------------------------------
This software is preliminary, provisional, and is subject to revision. It is
being provided to meet the need for timely best sci... | [
"numpy.sqrt",
"numpy.ones",
"numpy.polyfit",
"scipy.interpolate.UnivariateSpline",
"numpy.min",
"numpy.append",
"numpy.sum",
"numpy.zeros",
"numpy.linspace",
"numpy.std",
"numpy.poly1d"
] | [((6783, 6804), 'numpy.append', 'np.append', (['new_xp', 'xp'], {}), '(new_xp, xp)\n', (6792, 6804), True, 'import numpy as np\n'), ((6957, 6978), 'numpy.append', 'np.append', (['new_yp', 'yp'], {}), '(new_yp, yp)\n', (6966, 6978), True, 'import numpy as np\n'), ((7209, 7228), 'numpy.polyfit', 'np.polyfit', (['x', 'y',... |
import argparse
import logging
import pickle
import time
from pathlib import Path
#
# Configure the path
ROOT_PATH = Path(__file__).resolve().parent.parent
DATA_PATH = ROOT_PATH / 'data'
MODELS_PATH = ROOT_PATH / 'models'
UTILS_PATH = ROOT_PATH / 'utils'
import numpy as np
import pandas as pd
import yaml
from sklearn.... | [
"logging.basicConfig",
"logging.getLogger",
"fastai.text.TextClasDataBunch.from_df",
"fastai.text.text_classifier_learner",
"sklearn.model_selection.train_test_split",
"pathlib.Path",
"numpy.argmax",
"numpy.array",
"fastai.text.TextLMDataBunch.from_df",
"fastai.text.language_model_learner",
"skl... | [((632, 671), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (651, 671), False, 'import logging\n'), ((681, 718), 'logging.getLogger', 'logging.getLogger', (['"""party prediction"""'], {}), "('party prediction')\n", (698, 718), False, 'import logging\n'), ((853,... |
import numpy as np
import scipy
from ... import operators
from ... import utilits as ut
from . _ar_yule_walker import ar_yule_walker
__all__ = ['arma_hannan_rissanen']
#------------------------------------------------------------------
def arma_hannan_rissanen(x, poles_order=0, zeros_order=0, unbias = True):
'... | [
"numpy.append",
"scipy.linalg.lstsq",
"numpy.asarray"
] | [((1493, 1506), 'numpy.asarray', 'np.asarray', (['x'], {}), '(x)\n', (1503, 1506), True, 'import numpy as np\n'), ((2073, 2141), 'numpy.append', 'np.append', (['r[zeros_order:, 1:]', 'rresid[2 * zeros_order:, 1:]'], {'axis': '(1)'}), '(r[zeros_order:, 1:], rresid[2 * zeros_order:, 1:], axis=1)\n', (2082, 2141), True, '... |
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"numpy.random.normal",
"numpy.abs",
"numpy.power",
"numpy.where",
"numpy.exp",
"numpy.zeros",
"numpy.random.seed"
] | [((1207, 1227), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1221, 1227), True, 'import numpy as np\n'), ((1239, 1280), 'numpy.random.normal', 'np.random.normal', (['(0)', '(1)', '[2 * data_no, 11]'], {}), '(0, 1, [2 * data_no, 11])\n', (1255, 1280), True, 'import numpy as np\n'), ((1350, 1373), ... |
# This code is the nmf_imaging.py adjusted for pyKLIP at https://bitbucket.org/pyKLIP/pyklip/src/master/pyklip/nmf_imaging.py
# Another version is kept at https://github.com/seawander/nmf_imaging/blob/master/nmf_imaging_for_pyKLIP.py
# Data imputation is not supported due to the input data structure of pyKLIP, since a ... | [
"os.path.exists",
"numpy.copy",
"numpy.nanstd",
"numpy.sqrt",
"numpy.nanpercentile",
"numpy.random.rand",
"numpy.nanmedian",
"astropy.io.fits.writeto",
"numpy.asarray",
"NonnegMFPy.nmf.NMF",
"numpy.array",
"numpy.zeros",
"numpy.dot",
"numpy.isnan",
"astropy.io.fits.getdata",
"numpy.nan... | [((9410, 9437), 'numpy.zeros', 'np.zeros', (['(trg.shape[0], 1)'], {}), '((trg.shape[0], 1))\n', (9418, 9437), True, 'import numpy as np\n'), ((9486, 9517), 'numpy.zeros', 'np.zeros', (['(trg_err.shape[0], 1)'], {}), '((trg_err.shape[0], 1))\n', (9494, 9517), True, 'import numpy as np\n'), ((11382, 11403), 'numpy.zeros... |
import sys
import os
import numpy as np
import glob
import matplotlib.pyplot as plt
from matplotlib import cm
import cv2
import pickle
import pyqtgraph as pg
from moviepy.editor import VideoFileClip
import lane
import car
def process_frame(img):
global car
# update frame_number (for debug), clear internal sta... | [
"car.Car",
"numpy.dstack",
"car.newframe",
"car.left_lane.lost",
"car.search_around_poly",
"numpy.hstack",
"car.calc_car_position",
"cv2.addWeighted",
"car.process_frame_binary",
"car.find_lanes",
"cv2.warpPerspective",
"numpy.int_",
"numpy.vstack",
"car.right_lane.lost",
"numpy.zeros_li... | [((357, 371), 'car.newframe', 'car.newframe', ([], {}), '()\n', (369, 371), False, 'import car\n'), ((415, 444), 'car.process_frame_binary', 'car.process_frame_binary', (['img'], {}), '(img)\n', (439, 444), False, 'import car\n'), ((477, 505), 'car.warper', 'car.warper', (['car.binary_image'], {}), '(car.binary_image)\... |
import pickle
import warnings
from copy import deepcopy
from typing import Iterable, Optional, Union
import numpy as np
import pandas as pd
from copulae.core import is_psd, near_psd
from copulae.types import Array
from muarch.calibrate import calibrate_data
from muarch.funcs import get_annualized_kurtosis, get_annuali... | [
"muarch.calibrate.calibrate_data",
"copy.deepcopy",
"copulae.core.near_psd",
"numpy.cov",
"numpy.arange",
"numpy.asarray",
"copulae.core.is_psd",
"numpy.concatenate",
"warnings.warn",
"muarch.funcs.get_annualized_sd",
"muarch.funcs.get_annualized_mean",
"numpy.abs",
"numpy.eye",
"numpy.sig... | [((25934, 25947), 'numpy.asarray', 'np.asarray', (['w'], {}), '(w)\n', (25944, 25947), True, 'import numpy as np\n'), ((25958, 25973), 'numpy.asarray', 'np.asarray', (['cov'], {}), '(cov)\n', (25968, 25973), True, 'import numpy as np\n'), ((26320, 26344), 'numpy.zeros', 'np.zeros', (['(a - n + 1, a)'], {}), '((a - n + ... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
import seaborn as sns
from global_vars import path_data
sns.set_style({'axes.grid' : False})
sns.set_context('paper')
pd.set_option("display.precision", 2)
#### load original data
data = pd.read_csv(os.path.join(path_data,r'Tarifierung_... | [
"numpy.unique",
"seaborn.set_context",
"os.path.join",
"pandas.set_option",
"seaborn.set_style",
"matplotlib.pyplot.close",
"numpy.zeros",
"matplotlib.pyplot.tight_layout",
"pandas.DataFrame",
"matplotlib.pyplot.subplots"
] | [((138, 173), 'seaborn.set_style', 'sns.set_style', (["{'axes.grid': False}"], {}), "({'axes.grid': False})\n", (151, 173), True, 'import seaborn as sns\n'), ((175, 199), 'seaborn.set_context', 'sns.set_context', (['"""paper"""'], {}), "('paper')\n", (190, 199), True, 'import seaborn as sns\n'), ((200, 237), 'pandas.se... |
import numpy as np
from astropy.nddata import CCDData
import ccdproc as ccdp
from pathlib import Path
import matplotlib.pyplot as plt
import matplotlib.colors as clr
from scipy.optimize import curve_fit as cft
import utils as utl
def flux_extraction(file_name, file_err_name, path, path_err, out_path, images=True):
... | [
"matplotlib.pyplot.grid",
"numpy.hstack",
"matplotlib.pyplot.ylabel",
"numpy.log",
"utils.inv_line",
"numpy.array",
"matplotlib.pyplot.errorbar",
"numpy.arange",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.close",
"numpy.vstack",
"ccdproc.trim_image",
"utils.special_maxim... | [((1166, 1196), 'astropy.nddata.CCDData.read', 'CCDData.read', (['(path + file_name)'], {}), '(path + file_name)\n', (1178, 1196), False, 'from astropy.nddata import CCDData\n'), ((1253, 1307), 'ccdproc.trim_image', 'ccdp.trim_image', (['ccd'], {'fits_section': '"""[1:256, 100:1000]"""'}), "(ccd, fits_section='[1:256, ... |
import numpy as np
from wtm_envs.mujoco import robot_env, utils
import mujoco_py
from queue import deque
from mujoco_py import modder
import matplotlib.pyplot as plt
from matplotlib.backends.backend_agg import FigureCanvasAgg
import platform
import os
def goal_distance(goal_a, goal_b):
assert goal_a.shape == goal_... | [
"mujoco_py.MjViewer",
"mujoco_py.modder.TextureModder",
"numpy.max",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.zeros",
"wtm_envs.mujoco.utils.mocap_set_action",
"matplotlib.pyplot.figure",
"numpy.percentile",
"numpy.concatenate",
"numpy.linalg.norm",
"matplotlib.backends.backend_agg.Fig... | [((344, 384), 'numpy.linalg.norm', 'np.linalg.norm', (['(goal_a - goal_b)'], {'axis': '(-1)'}), '(goal_a - goal_b, axis=-1)\n', (358, 384), True, 'import numpy as np\n'), ((480, 505), 'numpy.zeros', 'np.zeros', (['norm_dist.shape'], {}), '(norm_dist.shape)\n', (488, 505), True, 'import numpy as np\n'), ((3649, 3679), '... |
# A simple script to generate a set of students
from generator.factory import Factory
from generator.strategy import DemoStrategy
from generator.constants import DEMO
import numpy as np
# Choices
n = 100000 # Number of students desired
pov_cost = 0.05 # mean drop for student in poverty
ell_cost = 0.05 # mean drop ... | [
"generator.strategy.DemoStrategy",
"generator.factory.Factory",
"numpy.random.choice"
] | [((449, 491), 'generator.strategy.DemoStrategy', 'DemoStrategy', (['pov_cost', 'ell_cost', 'dis_cost'], {}), '(pov_cost, ell_cost, dis_cost)\n', (461, 491), False, 'from generator.strategy import DemoStrategy\n'), ((504, 527), 'generator.factory.Factory', 'Factory', (['n', 'DEMO', 'strat'], {}), '(n, DEMO, strat)\n', (... |
import warnings
import numpy as np
from scipy import linalg
class Model(object):
name = 'Model'
status_need_for_eval = 0
""" Base class for a model. Actual models should inherit from this class.
In this class the functions that should be implemented by each model are
defined.
Attributes
... | [
"numpy.histogram",
"numpy.ones",
"numpy.sum",
"numpy.dot",
"numpy.linspace",
"scipy.linalg.svd",
"numpy.histogram2d"
] | [((5615, 5637), 'numpy.dot', 'np.dot', (['self.A', 'M_norm'], {}), '(self.A, M_norm)\n', (5621, 5637), True, 'import numpy as np\n'), ((6431, 6454), 'numpy.dot', 'np.dot', (['self.A', 'vec_fit'], {}), '(self.A, vec_fit)\n', (6437, 6454), True, 'import numpy as np\n'), ((9114, 9132), 'scipy.linalg.svd', 'linalg.svd', ([... |
import numpy as np
import os
import pickle as p
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--result_dir', type=str,required=True)
args = parser.parse_args()
def compute_iou(pred_box, ref_bbox):
N=pred_box.shape[0]
pred_box_rb = pred_box[:,0:3] - pred_box[:,3:6] / 2.0
ref_bb... | [
"os.listdir",
"numpy.repeat",
"argparse.ArgumentParser",
"os.path.join",
"pickle.load",
"numpy.max",
"numpy.argsort"
] | [((74, 99), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (97, 99), False, 'import argparse\n'), ((1462, 1484), 'os.listdir', 'os.listdir', (['result_dir'], {}), '(result_dir)\n', (1472, 1484), False, 'import os\n'), ((1578, 1613), 'os.path.join', 'os.path.join', (['result_dir', 'scan_file'], ... |
import numpy as np
import matplotlib.pyplot as plt
import cv2
fig,ax = plt.subplots()
x,y = np.loadtxt('resultcv.csv', delimiter=',', unpack=True)
x2,y2 = np.loadtxt('result.csv', delimiter=',', unpack=True)
cap = cv2.VideoCapture('../input/inputVideo.avi')
i = 0
while(cap.isOpened()):
_,frame = cap.read()
... | [
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"matplotlib.pyplot.pause",
"numpy.loadtxt",
"cv2.waitKey",
"matplotlib.pyplot.subplots"
] | [((74, 88), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (86, 88), True, 'import matplotlib.pyplot as plt\n'), ((95, 149), 'numpy.loadtxt', 'np.loadtxt', (['"""resultcv.csv"""'], {'delimiter': '""","""', 'unpack': '(True)'}), "('resultcv.csv', delimiter=',', unpack=True)\n", (105, 149), True, 'import... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 15 14:59:18 2019
@author: m2
"""
import numpy as np
from math import hypot, atan2
from config import grndstep, grndstart, grndlen
from rectools import uv2xy, fitRecToMold, uvBound2xyNormal
series_distance_cutoff = .45 ** 2 # m
min_points_in_segment... | [
"rectools.uv2xy",
"numpy.array",
"numpy.arctan2",
"numpy.sin",
"math.hypot",
"numpy.arange",
"numpy.mean",
"numpy.searchsorted",
"numpy.where",
"numpy.delete",
"numpy.diff",
"numpy.maximum",
"rectools.uvBound2xyNormal",
"numpy.argmax",
"numpy.cos",
"math.atan2",
"numpy.sign",
"nump... | [((3772, 3814), 'numpy.arange', 'np.arange', (['(0)', 'halfpi', 'shrinksearch_initres'], {}), '(0, halfpi, shrinksearch_initres)\n', (3781, 3814), True, 'import numpy as np\n'), ((5644, 5670), 'numpy.arange', 'np.arange', (['(-1.35)', '(1.4)', '(0.1)'], {}), '(-1.35, 1.4, 0.1)\n', (5653, 5670), True, 'import numpy as n... |
from .temporal import *
import numpy as np
defaults = dict(
ydeg=15,
udeg=2,
r=20.0,
dr=None,
a=0.40,
b=0.27,
c=0.1,
n=10.0,
p=1.0,
i=60.0,
u=np.zeros(30),
tau=None,
temporal_kernel=Matern32Kernel,
normalized=True,
normalization_order=20,
normalization_zm... | [
"numpy.zeros"
] | [((187, 199), 'numpy.zeros', 'np.zeros', (['(30)'], {}), '(30)\n', (195, 199), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
"""
Workflow functions for bulding tasks
"""
import numpy
import pandas
import pandas_flavor
def split_three_ways(array):
"""
Does not perform statisfied sampling
Assumes shuffled
Splits into 3:1:1 ratio
"""
percent_60 = int(.6*array.shape[0])
percent_80 = int(.8*arr... | [
"pandas.DataFrame",
"numpy.split"
] | [((362, 406), 'numpy.split', 'numpy.split', (['array', '[percent_60, percent_80]'], {}), '(array, [percent_60, percent_80])\n', (373, 406), False, 'import numpy\n'), ((698, 728), 'numpy.split', 'numpy.split', (['array', 'percentage'], {}), '(array, percentage)\n', (709, 728), False, 'import numpy\n'), ((1173, 1225), 'p... |
import numpy as np
import pytest
import math
from sklearn.base import clone
from sklearn.linear_model import Lasso, ElasticNet
import doubleml as dml
from ._utils import draw_smpls
from ._utils_plr_manual import fit_plr, boot_plr, tune_nuisance_plr
@pytest.fixture(scope='module',
params=[Lasso(),
... | [
"numpy.allclose",
"sklearn.linear_model.ElasticNet",
"math.isclose",
"sklearn.linear_model.Lasso",
"sklearn.base.clone",
"doubleml.DoubleMLPLR",
"numpy.array",
"numpy.linspace",
"numpy.random.seed",
"pytest.fixture"
] | [((566, 624), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'params': "['partialling out']"}), "(scope='module', params=['partialling out'])\n", (580, 624), False, 'import pytest\n'), ((689, 736), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'params': "['dml2']"}), "(scope='mo... |
# Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | [
"mindspore.ops.operations.Squeeze",
"mindspore.ops.operations.Round",
"mindspore.ops.operations.RandomChoiceWithMask",
"mindspore.ops.operations.Concat",
"mindspore.ops.operations.ReduceSum",
"mindspore.ops.operations.GatherNd",
"mindspore.ops.operations.Reshape",
"mindspore.ops.operations.GreaterEqua... | [((2544, 2560), 'mindspore.ops.operations.Concat', 'P.Concat', ([], {'axis': '(0)'}), '(axis=0)\n', (2552, 2560), True, 'from mindspore.ops import operations as P\n'), ((2583, 2608), 'mindspore.ops.operations.ArgMaxWithValue', 'P.ArgMaxWithValue', ([], {'axis': '(0)'}), '(axis=0)\n', (2600, 2608), True, 'from mindspore... |
#!/usr/bin/env python
u"""
MPI_ICESat2_ATL03.py (05/2021)
Read ICESat-2 ATL03 and ATL09 data files to calculate average segment surfaces
ATL03 datasets: Global Geolocated Photons
ATL09 datasets: Atmospheric Characteristics
CALLING SEQUENCE:
mpiexec -np 6 python MPI_ICESat2_ATL03.py ATL03_file ATL09_file
C... | [
"numpy.sqrt",
"re.compile",
"numpy.count_nonzero",
"numpy.array",
"datetime.datetime.today",
"numpy.arange",
"numpy.mean",
"argparse.ArgumentParser",
"os.chmod",
"numpy.max",
"os.getpid",
"os.path.expanduser",
"numpy.abs",
"numpy.ones",
"numpy.ma.array",
"numpy.ma.zeros",
"re.match",... | [((3996, 4152), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Read ICESat-2 ATL03 and ATL09 data files to calculate\n average segment surfaces\n """'}), '(description=\n """Read ICESat-2 ATL03 and ATL09 data files to calculate\n average segment surfac... |
import os, gzip, pickle, numpy as np
from variational import mean_field_vso, marginal_approx, get_semfunc
from __config__.filepath import AUX_DIR
def get_scoring_fn(pred_wei, pred_bias, C, meanfield_vecs):
"""
Get a scoring function for the relpron dataset
:param pred_wei: weights of semantic functions
... | [
"variational.marginal_approx",
"variational.get_semfunc",
"random.shuffle",
"numpy.ones",
"variational.mean_field_vso",
"pickle.dump",
"testing.get_GS2011_indexed",
"itertools.product",
"pickle.load",
"os.path.join",
"numpy.zeros",
"testing.load_freq_lookup_dicts",
"multiprocessing.Pool"
] | [((8629, 8649), 'testing.get_GS2011_indexed', 'get_GS2011_indexed', ([], {}), '()\n', (8647, 8649), False, 'from testing import get_relpron_separated, get_GS2011_indexed, load_freq_lookup_dicts\n'), ((8697, 8721), 'testing.load_freq_lookup_dicts', 'load_freq_lookup_dicts', ([], {}), '()\n', (8719, 8721), False, 'from t... |
from __future__ import print_function
import os
import argparse
import torch
import torch.backends.cudnn as cudnn
import numpy as np
from prior_box import PriorBox
import cv2
from models.retinaface import RetinaFace
from utils.box_utils import *
import time
import sys
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
sys.path.... | [
"cv2.rectangle",
"prior_box.PriorBox",
"torch.from_numpy",
"numpy.argsort",
"models.retinaface.RetinaFace",
"os.listdir",
"argparse.ArgumentParser",
"numpy.where",
"numpy.delete",
"numpy.max",
"numpy.maximum",
"torch.cuda.current_device",
"torch.Tensor",
"numpy.argmax",
"cv2.putText",
... | [((387, 436), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Retinaface"""'}), "(description='Retinaface')\n", (410, 436), False, 'import argparse\n'), ((3994, 4017), 'numpy.argsort', 'np.argsort', (['confidences'], {}), '(confidences)\n', (4004, 4017), True, 'import numpy as np\n'), ((4... |
from __future__ import print_function
import sys
import torch
import torch.optim as optim
import numpy as np
from torchvision import datasets, transforms
from absl import app
from absl import flags
import copy
import torch.nn.functional as F
from load_data import MNIST_data, Covertype_data
from model import ConvNet... | [
"torch.mul",
"numpy.sqrt",
"numpy.random.rand",
"torch.sqrt",
"model.Logistic",
"numpy.array",
"torch.cuda.is_available",
"torch.normal",
"copy.deepcopy",
"load_data.Covertype_data.test",
"numpy.arange",
"absl.flags.DEFINE_float",
"torch.nn.functional.nll_loss",
"absl.app.run",
"get_step... | [((472, 559), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""dataset"""', '"""mnist"""', '"""which dataset to run, [mnist, covertype]"""'], {}), "('dataset', 'mnist',\n 'which dataset to run, [mnist, covertype]')\n", (491, 559), False, 'from absl import flags\n'), ((556, 622), 'absl.flags.DEFINE_integer', ... |
import numpy as np
import pytest
import pandas as pd
from pandas.core.sorting import nargsort
import pandas.util.testing as tm
from .base import BaseExtensionTests
class BaseMethodsTests(BaseExtensionTests):
"""Various Series and DataFrame methods."""
@pytest.mark.parametrize('dropna', [True, False])
d... | [
"pandas.Series",
"pandas.util.testing.assert_numpy_array_equal",
"pandas.factorize",
"numpy.repeat",
"pandas.util.hash_pandas_object",
"pytest.mark.parametrize",
"numpy.array",
"numpy.errstate",
"pandas.core.sorting.nargsort",
"pytest.raises",
"pandas.DataFrame",
"numpy.dtype"
] | [((266, 314), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dropna"""', '[True, False]'], {}), "('dropna', [True, False])\n", (289, 314), False, 'import pytest\n'), ((2168, 2219), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ascending"""', '[True, False]'], {}), "('ascending', [True, False]... |
# 唐诗生成
import collections
import os
import sys
import time
import numpy as np
import tensorflow as tf
# 这里引入可能出错
from models.model import rnn_model
# 句子预处理 产生batch函数
from dataset.fiction import process_poems, generate_batch
import heapq
# 后面那个是说明
tf.flags.DEFINE_integer('batch_size', 64, 'batch size.')
tf.flags.DEFINE... | [
"tensorflow.local_variables_initializer",
"numpy.random.rand",
"tensorflow.app.run",
"tensorflow.flags.DEFINE_string",
"os.path.exists",
"tensorflow.placeholder",
"tensorflow.flags.DEFINE_float",
"tensorflow.Session",
"os.mkdir",
"dataset.fiction.process_poems",
"time.localtime",
"tensorflow.g... | [((248, 304), 'tensorflow.flags.DEFINE_integer', 'tf.flags.DEFINE_integer', (['"""batch_size"""', '(64)', '"""batch size."""'], {}), "('batch_size', 64, 'batch size.')\n", (271, 304), True, 'import tensorflow as tf\n'), ((305, 367), 'tensorflow.flags.DEFINE_float', 'tf.flags.DEFINE_float', (['"""learning_rate"""', '(0.... |
# Zipline API
from zipline.api import attach_pipeline, pipeline_output, schedule_function, get_open_orders, order_target_percent
from zipline.pipeline import Pipeline
from zipline.utils.events import date_rules, time_rules
from zipline.pipeline.factors import AverageDollarVolume
from zipline import run_algorithm
# Dat... | [
"zipline.pipeline.Pipeline",
"zipline.api.get_open_orders",
"numpy.argmax",
"zipline.utils.events.date_rules.every_day",
"zipline.utils.events.time_rules.market_open",
"statsmodels.api.add_constant",
"zipline.api.pipeline_output",
"zipline.api.order_target_percent",
"zipline.pipeline.factors.Average... | [((607, 685), 'websocket.create_connection', 'create_connection', (["('ws://alpharithmic.herokuapp.com/ws/logs/%s/' % log_channel)"], {}), "('ws://alpharithmic.herokuapp.com/ws/logs/%s/' % log_channel)\n", (624, 685), False, 'from websocket import create_connection\n'), ((10095, 10235), 'zipline.run_algorithm', 'run_al... |
import configparser
import re
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import tweepy
from textblob import TextBlob, Word
from textblob.sentiments import NaiveBayesAnalyzer
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from wordcloud import ... | [
"matplotlib.pyplot.imshow",
"vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer",
"matplotlib.pyplot.savefig",
"configparser.ConfigParser",
"pandas.DataFrame",
"pathlib.Path",
"tweepy.Cursor",
"matplotlib.pyplot.axis",
"wordcloud.WordCloud",
"numpy.core.defchararray.replace",
"matplotlib.p... | [((353, 381), 'vaderSentiment.vaderSentiment.SentimentIntensityAnalyzer', 'SentimentIntensityAnalyzer', ([], {}), '()\n', (379, 381), False, 'from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer\n'), ((391, 418), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (416, 418), Fal... |
import numpy as np
import tensorflow as tf
from ammf.utils.wavedata.tools.core import geometry_utils
from ammf.core import box_3d_encoder
from ammf.core import format_checker
"""Box4c Encoder
Converts boxes between the box_3d and box_4c formats.
- box_4c format: [x1, x2, x3, x4, z1, z2, z3, z4, h1, h2]
- corners are... | [
"tensorflow.round",
"tensorflow.atan2",
"ammf.core.format_checker.check_box_3d_format",
"tensorflow.logical_not",
"tensorflow.multiply",
"numpy.array",
"numpy.arctan2",
"numpy.linalg.norm",
"tensorflow.ones_like",
"ammf.utils.wavedata.tools.core.geometry_utils.calculate_plane_point",
"ammf.core.... | [((748, 790), 'ammf.core.format_checker.check_box_3d_format', 'format_checker.check_box_3d_format', (['box_3d'], {}), '(box_3d)\n', (782, 790), False, 'from ammf.core import format_checker\n'), ((1155, 1217), 'numpy.asarray', 'np.asarray', (['[half_dim_x, half_dim_x, -half_dim_x, -half_dim_x]'], {}), '([half_dim_x, hal... |
# Copyright (C) 2020 Zurich Instruments
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
import numpy as np
import matplotlib.pyplot as plt
import textwrap
import time
def write_crosstalk_matrix(daq, device, matrix):
"""
Writes the give... | [
"textwrap.dedent",
"numpy.abs",
"numpy.ones",
"matplotlib.pyplot.cm.tab20",
"time.sleep",
"numpy.array",
"numpy.zeros",
"numpy.concatenate",
"numpy.sin",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((1822, 1834), 'numpy.zeros', 'np.zeros', (['(10)'], {}), '(10)\n', (1830, 1834), True, 'import numpy as np\n'), ((1858, 1932), 'numpy.array', 'np.array', (['[0.02, 0.01, -0.01, 0.02, -0.012, 0.0, 0.02, -0.012, 0.06, 0.03]'], {}), '([0.02, 0.01, -0.01, 0.02, -0.012, 0.0, 0.02, -0.012, 0.06, 0.03])\n', (1866, 1932), Tr... |
import cv2 as cv
import math
import numpy as np
import os
from src import variables
from src.depth_parser import DepthParser
from src.disparity_calculator import DisparityCalculator
from src.image_matcher import ImageMatcher
from src.point_cloud_builder import PointCloudBuilder
from src.point_cloud_merger import Point... | [
"os.listdir",
"numpy.hstack",
"src.image_matcher.ImageMatcher",
"src.point_cloud_builder.PointCloudBuilder",
"src.point_cloud_merger.PointCloudMerger",
"src.disparity_calculator.DisparityCalculator",
"src.depth_parser.DepthParser",
"numpy.empty",
"numpy.concatenate",
"numpy.savetxt",
"cv2.imread... | [((953, 974), 'src.disparity_calculator.DisparityCalculator', 'DisparityCalculator', ([], {}), '()\n', (972, 974), False, 'from src.disparity_calculator import DisparityCalculator\n'), ((990, 1003), 'src.depth_parser.DepthParser', 'DepthParser', ([], {}), '()\n', (1001, 1003), False, 'from src.depth_parser import Depth... |
from copy import deepcopy
from typing import List
import numpy as np
import pandas as pd
import pytest
from xarray import DataArray, Dataset, Variable, concat
from xarray.core import dtypes, merge
from . import (
InaccessibleArray,
assert_array_equal,
assert_equal,
assert_identical,
requires_dask... | [
"pandas.MultiIndex.from_product",
"xarray.Variable",
"numpy.random.random",
"xarray.Dataset",
"xarray.concat",
"pytest.mark.parametrize",
"numpy.zeros",
"numpy.issubdtype",
"pytest.raises",
"numpy.array",
"xarray.DataArray",
"copy.deepcopy",
"pandas.Index",
"numpy.random.randn",
"numpy.a... | [((27055, 27147), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""attr1"""', "({'a': {'meta': [10, 20, 30]}}, {'a': [1, 2, 3]}, {})"], {}), "('attr1', ({'a': {'meta': [10, 20, 30]}}, {'a': [1, \n 2, 3]}, {}))\n", (27078, 27147), False, 'import pytest\n'), ((27144, 27200), 'pytest.mark.parametrize', 'pyte... |
"""Script to compare the sensitivity and discovery potential for the LLAGN sample (15887 sources)
as a function of injected spectral index for energy decades between 100 GeV and 10 PeV.
"""
from __future__ import print_function
from __future__ import division
import numpy as np
from flarestack.core.results import Resul... | [
"logging.getLogger",
"flarestack.cluster.analyse",
"flarestack.data.icecube.diffuse_8_year.get_seasons",
"flarestack.utils.catalogue_loader.load_catalogue",
"flarestack.analyses.agn_cores.shared_agncores.agn_subset_catalogue",
"flarestack.shared.plot_output_dir",
"flarestack.core.results.ResultsHandler"... | [((2018, 2038), 'numpy.logspace', 'np.logspace', (['(2)', '(7)', '(6)'], {}), '(2, 7, 6)\n', (2029, 2038), True, 'import numpy as np\n'), ((5824, 5855), 'numpy.sum', 'np.sum', (["full_cat['base_weight']"], {}), "(full_cat['base_weight'])\n", (5830, 5855), True, 'import numpy as np\n'), ((5522, 5541), 'logging.getLogger... |
"""
refenrence from: https://learnopencv.com/video-stabilization-using-point-feature-matching-in-opencv/
"""
import cv2
import numpy as np
from scipy.signal import savgol_filter
fname = "./deep-stabilization/dvs/video/s_114_outdoor_running_trail_daytime/ControlCam_20200930_104820.mp4"
# fname = "./deep-stabilization/d... | [
"numpy.convolve",
"scipy.signal.savgol_filter",
"numpy.lib.pad",
"numpy.arctan2",
"numpy.sin",
"numpy.where",
"cv2.estimateAffine2D",
"cv2.VideoWriter",
"cv2.VideoWriter_fourcc",
"cv2.warpAffine",
"numpy.ones",
"numpy.cos",
"cv2.cvtColor",
"cv2.getRotationMatrix2D",
"cv2.resize",
"nump... | [((393, 416), 'cv2.VideoCapture', 'cv2.VideoCapture', (['fname'], {}), '(fname)\n', (409, 416), False, 'import cv2\n'), ((664, 702), 'cv2.cvtColor', 'cv2.cvtColor', (['prev', 'cv2.COLOR_BGR2GRAY'], {}), '(prev, cv2.COLOR_BGR2GRAY)\n', (676, 702), False, 'import cv2\n'), ((807, 846), 'numpy.zeros', 'np.zeros', (['(n_fra... |
import numpy as np
import gdal
def create_mask_from_vector(vector_data_path, cols, rows, geo_transform,
projection, target_value=1):
"""Rasterize the given vector (wrapper for gdal.RasterizeLayer)."""
data_source = gdal.OpenEx(vector_data_path, gdal.OF_VECTOR)
layer = data_sou... | [
"numpy.zeros",
"gdal.OpenEx",
"gdal.RasterizeLayer",
"gdal.GetDriverByName"
] | [((254, 299), 'gdal.OpenEx', 'gdal.OpenEx', (['vector_data_path', 'gdal.OF_VECTOR'], {}), '(vector_data_path, gdal.OF_VECTOR)\n', (265, 299), False, 'import gdal\n'), ((349, 376), 'gdal.GetDriverByName', 'gdal.GetDriverByName', (['"""MEM"""'], {}), "('MEM')\n", (369, 376), False, 'import gdal\n'), ((553, 623), 'gdal.Ra... |
# Copyright 2016 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... | [
"numpy.ones",
"numpy.random.random",
"tensorflow.python.ops.math_ops.bincount",
"numpy.random.randint",
"tensorflow.python.platform.googletest.main",
"numpy.zeros",
"numpy.random.seed",
"numpy.bincount",
"numpy.arange"
] | [((4133, 4150), 'tensorflow.python.platform.googletest.main', 'googletest.main', ([], {}), '()\n', (4148, 4150), False, 'from tensorflow.python.platform import googletest\n'), ((2826, 2844), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (2840, 2844), True, 'import numpy as np\n'), ((3387, 3405), 'num... |
import torch
from torch.utils.data.dataset import Dataset
import numpy as np
import pandas as pd
import cv2
from albumentations import Compose, Flip, RandomScale, ShiftScaleRotate, RandomBrightnessContrast, Rotate, RandomCrop, CenterCrop, Resize, Blur, CLAHE, Equalize, Normalize, OneOf, IAASharpen, IAAEmboss
from sklea... | [
"albumentations.ShiftScaleRotate",
"sklearn.model_selection.train_test_split",
"albumentations.RandomBrightnessContrast",
"albumentations.IAAEmboss",
"albumentations.Flip",
"numpy.argmax",
"albumentations.RandomCrop",
"torch.from_numpy",
"torch.is_tensor",
"albumentations.Resize",
"albumentation... | [((2951, 3052), 'sklearn.model_selection.train_test_split', 'train_test_split', (['df', 'df[label_cols]'], {'test_size': 'test_size', 'stratify': 'df[label_cols]', 'shuffle': '(True)'}), '(df, df[label_cols], test_size=test_size, stratify=df[\n label_cols], shuffle=True)\n', (2967, 3052), False, 'from sklearn.model_... |
# Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved.
import dace
from dace.transformation.dataflow import GPUTransformMap
import numpy as np
import pytest
# Symbols
N = dace.symbol('N')
M = dace.symbol('M')
K = dace.symbol('K')
L = dace.symbol('L')
X = dace.symbol('X')
Y = dace.symbol('Y')
Z = ... | [
"dace.symbol",
"numpy.zeros",
"numpy.random.randint",
"numpy.linalg.norm",
"dace.ndarray"
] | [((193, 209), 'dace.symbol', 'dace.symbol', (['"""N"""'], {}), "('N')\n", (204, 209), False, 'import dace\n'), ((214, 230), 'dace.symbol', 'dace.symbol', (['"""M"""'], {}), "('M')\n", (225, 230), False, 'import dace\n'), ((235, 251), 'dace.symbol', 'dace.symbol', (['"""K"""'], {}), "('K')\n", (246, 251), False, 'import... |
import numpy as np
from numpy import log as ln
from numpy import log10 as log
from numpy import exp
from numba import jit
@jit(nopython=True)
def model_LogicGate_OR_Double_Delay_Delay_ResCompete(y, t, params):
Inde1 = y[0]
Indi1 = y[1]
Inde2 = y[2]
Indi2 = y[3]
mRNA1 = y[4]
Pep1 = y[5]
mRNA2 = y[6]
Pep2 = ... | [
"numpy.array",
"numba.jit"
] | [((126, 144), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (129, 144), False, 'from numba import jit\n'), ((1114, 1205), 'numpy.array', 'np.array', (['[dInde1, dIndi1, dInde2, dIndi2, dmRNA1, dPep1, dmRNA2, dPep2, dmRNA3, dPep3]'], {}), '([dInde1, dIndi1, dInde2, dIndi2, dmRNA1, dPep1, dmRNA2,... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"numpy.allclose",
"paddle_fl.mpc.data_utils.data_utils.get_datautils",
"paddle.fluid.CPUPlace",
"unittest.main",
"numpy.array",
"paddle_fl.mpc.layers.pool2d",
"paddle_fl.mpc.data",
"multiprocessing.Manager"
] | [((870, 891), 'paddle_fl.mpc.data_utils.data_utils.get_datautils', 'get_datautils', (['"""aby3"""'], {}), "('aby3')\n", (883, 891), False, 'from paddle_fl.mpc.data_utils.data_utils import get_datautils\n'), ((2780, 2795), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2793, 2795), False, 'import unittest\n'), ((1... |
import argparse
import os
import sys
from glob import glob
from os.path import basename, join, splitext
import librosa
import numpy as np
import pysinsy
import soundfile as sf
from nnmnkwii.io import hts
from nnsvs.io.hts import get_note_indices
def _is_silence(label):
is_full_context = "@" in label
if is_fu... | [
"numpy.abs",
"pysinsy.sinsy.Sinsy",
"argparse.ArgumentParser",
"os.makedirs",
"nnmnkwii.io.hts.load",
"ipdb.set_trace",
"os.path.join",
"numpy.asarray",
"nnmnkwii.io.hts.HTSLabelFile",
"soundfile.write",
"nnsvs.io.hts.get_note_indices",
"os.path.basename",
"sys.exit",
"pysinsy.get_default_... | [((1400, 1434), 'os.path.join', 'join', (['out_dir', '"""label_phone_align"""'], {}), "(out_dir, 'label_phone_align')\n", (1404, 1434), False, 'from os.path import basename, join, splitext\n'), ((1452, 1486), 'os.path.join', 'join', (['out_dir', '"""label_phone_score"""'], {}), "(out_dir, 'label_phone_score')\n", (1456... |
'''
More factorization code, courtesy of <NAME>.
'''
import numpy as np
import dataclasses
def moments(muhat_row,Sighat_row,muhat_col,Sighat_col,**kwargs):
row_m2 = Sighat_row + np.einsum('ij,ik->ijk',muhat_row,muhat_row)
col_m2 = Sighat_col + np.einsum('ij,ik->ijk',muhat_col,muhat_col)
mn= muhat_row @ mu... | [
"numpy.prod",
"numpy.mean",
"numpy.abs",
"numpy.sqrt",
"numpy.ones",
"numpy.where",
"numpy.log",
"numpy.tanh",
"numpy.linalg.slogdet",
"numpy.linalg.inv",
"numpy.einsum",
"numpy.cosh"
] | [((339, 381), 'numpy.einsum', 'np.einsum', (['"""ajk,bjk -> ab"""', 'row_m2', 'col_m2'], {}), "('ajk,bjk -> ab', row_m2, col_m2)\n", (348, 381), True, 'import numpy as np\n'), ((609, 629), 'numpy.prod', 'np.prod', (['muhat.shape'], {}), '(muhat.shape)\n', (616, 629), True, 'import numpy as np\n'), ((1518, 1557), 'numpy... |
"""
Example for BatchIntrinsicPlasticity
"""
import os
import numpy as np
from pyrcn.base.blocks import BatchIntrinsicPlasticity
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_theme()
tud_colors = {
'darkblue': (0 / 255., 48 / 255., 94 / 255.),
'gray': (114 / 255., 120 / 255., 121 / 255.),
... | [
"os.path.exists",
"numpy.sqrt",
"os.makedirs",
"numpy.power",
"seaborn.set_theme",
"seaborn.histplot",
"os.getcwd",
"numpy.exp",
"matplotlib.pyplot.tight_layout",
"pyrcn.base.blocks.BatchIntrinsicPlasticity",
"matplotlib.pyplot.subplots",
"numpy.random.RandomState",
"matplotlib.pyplot.show"
... | [((184, 199), 'seaborn.set_theme', 'sns.set_theme', ([], {}), '()\n', (197, 199), True, 'import seaborn as sns\n'), ((712, 723), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (721, 723), False, 'import os\n'), ((825, 850), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (846, 850), True, 'i... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,.pct.py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
... | [
"tensorflow.random.uniform",
"gpflow.optimizers.natgrad.XiSqrtMeanVar",
"gpflow.ci_utils.ci_niter",
"gpflow.kernels.Matern52",
"tensorflow.random.set_seed",
"tensorflow.data.Dataset.from_tensor_slices",
"numpy.random.choice",
"tensorflow.print",
"gpflow.likelihoods.Bernoulli",
"gpflow.optimizers.N... | [((817, 834), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (831, 834), True, 'import numpy as np\n'), ((835, 856), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(0)'], {}), '(0)\n', (853, 856), True, 'import tensorflow as tf\n'), ((919, 949), 'numpy.random.uniform', 'np.random.uniform', ([], ... |
import numpy as np
import matplotlib.pyplot as plt
train_historys1 = np.load("data/useful/train_historys_map7_GA_3(9, 15,8, 3).npy")
train_historys2 = np.load("data/useful/train_historys_map7_GA_4(9, 15,8, 3).npy")
train_historys3 = np.load("data/useful/train_historys_map7_GA_5(9, 15,8, 3).npy")
train_historys4 = np... | [
"numpy.dstack",
"numpy.mean",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis",
"numpy.load",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((72, 135), 'numpy.load', 'np.load', (['"""data/useful/train_historys_map7_GA_3(9, 15,8, 3).npy"""'], {}), "('data/useful/train_historys_map7_GA_3(9, 15,8, 3).npy')\n", (79, 135), True, 'import numpy as np\n'), ((154, 217), 'numpy.load', 'np.load', (['"""data/useful/train_historys_map7_GA_4(9, 15,8, 3).npy"""'], {}), ... |
import os
import cv2
import dlib
import json
import yaml
import numpy as np
from time import monotonic as now
from datetime import timedelta
from age_gender.preprocess.face_aligner import FaceAligner
from concurrent.futures import ProcessPoolExecutor, as_completed
def get_area(rect):
left = rect.left()
top =... | [
"os.path.exists",
"cv2.imwrite",
"age_gender.preprocess.face_aligner.FaceAligner",
"os.makedirs",
"yaml.dump",
"time.monotonic",
"os.path.join",
"dlib.shape_predictor",
"os.path.abspath",
"concurrent.futures.as_completed",
"os.path.dirname",
"dlib.get_frontal_face_detector",
"numpy.linspace"... | [((665, 697), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (695, 697), False, 'import dlib\n'), ((723, 765), 'dlib.shape_predictor', 'dlib.shape_predictor', (['self.shape_predictor'], {}), '(self.shape_predictor)\n', (743, 765), False, 'import dlib\n'), ((794, 838), 'age_gender.... |
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.sparse.sputils import isshape, isintlike
from scipy.sparse import isspmatrix
__all__ = ['LinearOperator', 'aslinearoperator']
class LinearOperator(object):
"""Common interface for performing matrix vector products
... | [
"scipy.sparse.isspmatrix",
"numpy.isscalar",
"numpy.conj",
"numpy.asmatrix",
"numpy.asarray",
"scipy.sparse.sputils.isshape",
"numpy.asanyarray",
"numpy.find_common_type",
"numpy.array",
"scipy.sparse.sputils.isintlike",
"numpy.dtype"
] | [((6786, 6817), 'numpy.find_common_type', 'np.find_common_type', (['dtypes', '[]'], {}), '(dtypes, [])\n', (6805, 6817), True, 'import numpy as np\n'), ((3651, 3667), 'numpy.asanyarray', 'np.asanyarray', (['x'], {}), '(x)\n', (3664, 3667), True, 'import numpy as np\n'), ((4776, 4792), 'numpy.asanyarray', 'np.asanyarray... |
"""
Various density standards.
"""
from numpy import array
# Visual density is typically used on grey patches. Take a reading and get
# the density values of the Red, Green, and Blue filters. If the difference
# between the highest and lowest value is less than or equal to the value
# below, return the densi... | [
"numpy.array"
] | [((523, 811), 'numpy.array', 'array', (['(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.37, 43.45, \n 100.0, 74.3, 40.18, 19.32, 7.94, 3.56, 1.46, 0.6, 0.24, 0.09, 0.04, \n 0.01, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2011, <NAME>, Inc.
# Copyright (c) 2016, <NAME>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source cod... | [
"cv2.imencode",
"cv_bridge.boost.cv_bridge_boost.cvtColor2",
"numpy.ndarray",
"cv2.imdecode",
"numpy.dtype"
] | [((5776, 5814), 'cv2.imdecode', 'cv2.imdecode', (['buf', 'cv2.IMREAD_ANYCOLOR'], {}), '(buf, cv2.IMREAD_ANYCOLOR)\n', (5788, 5814), False, 'import cv2\n'), ((7204, 7219), 'numpy.dtype', 'np.dtype', (['dtype'], {}), '(dtype)\n', (7212, 7219), True, 'import numpy as np\n'), ((5979, 6018), 'cv_bridge.boost.cv_bridge_boost... |
#!/usr/bin/env python
import numpy
from geoh5 import kea
def main():
# create some data
data = numpy.random.randint(0, 256, (6, 100, 100)).astype('uint8')
count, height, width = data.shape
kwargs = {'width': width,
'height': height,
'count': count,
'dtyp... | [
"numpy.random.randint",
"geoh5.kea.open"
] | [((500, 537), 'geoh5.kea.open', 'kea.open', (['"""file-1.kea"""', '"""w"""'], {}), "('file-1.kea', 'w', **kwargs)\n", (508, 537), False, 'from geoh5 import kea\n'), ((640, 667), 'geoh5.kea.open', 'kea.open', (['"""file-1.kea"""', '"""r"""'], {}), "('file-1.kea', 'r')\n", (648, 667), False, 'from geoh5 import kea\n'), (... |
# Copyright 2019 The TensorFlow Hub 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... | [
"tensorflow_hub.tools.module_search.search.main",
"numpy.ones",
"tensorflow.compat.v2.executing_eagerly",
"tensorflow.compat.v2.TensorSpec",
"tensorflow.compat.v2.test.main",
"unittest.mock.patch.object",
"tensorflow.compat.v2.math.reduce_mean",
"absl.testing.flagsaver.flagsaver"
] | [((1869, 1959), 'unittest.mock.patch.object', 'unittest.mock.patch.object', (['search.utils.tfds', '"""load"""'], {'side_effect': 'fake_image_dataset'}), "(search.utils.tfds, 'load', side_effect=\n fake_image_dataset)\n", (1895, 1959), False, 'import unittest\n'), ((2331, 2345), 'tensorflow.compat.v2.test.main', 'tf... |
"""Common utilities for Numba operations with groupby ops"""
import inspect
from typing import Any, Callable, Dict, Optional, Tuple
import numpy as np
from pandas._typing import Scalar
from pandas.compat._optional import import_optional_dependency
from pandas.core.util.numba_ import (
NUMBA_FUNC_CACHE,
Numba... | [
"pandas.core.util.numba_.get_jit_arguments",
"inspect.signature",
"pandas.core.util.numba_.jit_user_function",
"numpy.empty",
"pandas.core.util.numba_.NumbaUtilError",
"pandas.compat._optional.import_optional_dependency"
] | [((2170, 2210), 'pandas.core.util.numba_.get_jit_arguments', 'get_jit_arguments', (['engine_kwargs', 'kwargs'], {}), '(engine_kwargs, kwargs)\n', (2187, 2210), False, 'from pandas.core.util.numba_ import NUMBA_FUNC_CACHE, NumbaUtilError, get_jit_arguments, jit_user_function\n'), ((2372, 2422), 'pandas.core.util.numba_.... |
from pathlib import Path
from dateutil.parser import parse
from datetime import timedelta
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from helper_funcs import *
def preprocesamiento_casos():
ts_global = {}
for file in Path('.').glob('*_global.csv'):
ts = ts_since_two_per_co... | [
"dateutil.parser.parse",
"pandas.read_csv",
"pathlib.Path",
"numpy.delete",
"pandas.to_numeric",
"pandas.read_excel",
"pandas.concat"
] | [((4232, 4259), 'numpy.delete', 'np.delete', (['health_topics', '(5)'], {}), '(health_topics, 5)\n', (4241, 4259), True, 'import numpy as np\n'), ((4280, 4308), 'numpy.delete', 'np.delete', (['health_topics', '(-1)'], {}), '(health_topics, -1)\n', (4289, 4308), True, 'import numpy as np\n'), ((4329, 4357), 'numpy.delet... |
#
# Copyright (c) 2017-2019 AutoDeploy AI
#
# 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 ... | [
"onnx.save",
"onnx.load_model",
"torch.from_numpy",
"numpy.array",
"xgboost.DMatrix",
"os.path.exists",
"pypmml.Model.close",
"sklearn.base.is_classifier",
"numpy.asarray",
"pyspark.SparkConf",
"onnx.load_model_from_string",
"pandas.DataFrame",
"numpy.dtype",
"torch.randn",
"pypmml.Model... | [((18149, 18174), 'sklearn.base.is_classifier', 'is_classifier', (['self.model'], {}), '(self.model)\n', (18162, 18174), False, 'from sklearn.base import is_classifier, is_regressor\n'), ((18235, 18259), 'sklearn.base.is_regressor', 'is_regressor', (['self.model'], {}), '(self.model)\n', (18247, 18259), False, 'from sk... |
#!/usr/bin/env python
"""
TODO:
# Author:
# Created Time :
# File Name:
# Description:
"""
import numpy as np
import scipy.sparse as sp
import random
import inspect
try:
import tensorflow as tf
except ImportError:
raise ImportError('DeepLinc requires TensorFlow. Please follow instructions'
... | [
"tensorflow.sparse_placeholder",
"tensorflow.get_variable_scope",
"numpy.array",
"tensorflow.ones_like",
"scipy.sparse.isspmatrix_coo",
"tensorflow.nn.weighted_cross_entropy_with_logits",
"scipy.sparse.eye",
"numpy.where",
"numpy.delete",
"tensorflow.placeholder",
"numpy.vstack",
"scipy.sparse... | [((818, 836), 'scipy.sparse.coo_matrix', 'sp.coo_matrix', (['adj'], {}), '(adj)\n', (831, 836), True, 'import scipy.sparse as sp\n'), ((4000, 4032), 'numpy.random.shuffle', 'np.random.shuffle', (['all_edges_idx'], {}), '(all_edges_idx)\n', (4017, 4032), True, 'import numpy as np\n'), ((4476, 4523), 'numpy.delete', 'np.... |
"""
Module that contains many useful utilities
for validating data or function arguments
"""
from typing import Iterable, Union
import warnings
import numpy as np
from my_happy_pandas.core.dtypes.common import is_bool
def _check_arg_length(fname, args, max_fname_arg_count, compat_args):
"""
Checks whether '... | [
"my_happy_pandas.core.dtypes.common.is_bool",
"my_happy_pandas.core.missing.clean_fill_method",
"numpy.asarray",
"warnings.warn"
] | [((13010, 13023), 'numpy.asarray', 'np.asarray', (['q'], {}), '(q)\n', (13020, 13023), True, 'import numpy as np\n'), ((7514, 7528), 'my_happy_pandas.core.dtypes.common.is_bool', 'is_bool', (['value'], {}), '(value)\n', (7521, 7528), False, 'from my_happy_pandas.core.dtypes.common import is_bool\n'), ((11962, 11987), '... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"sklearn.model_selection.GridSearchCV",
"sklearn.externals.joblib.load",
"torch.from_numpy",
"losses.triplet_loss.TripletLoss",
"networks.causal_cnn.CausalCNNEncoder",
"torch.isnan",
"networks.lstm.LSTMEncoder",
"sklearn.model_selection.cross_val_score",
"sklearn.model_selection.train_test_split",
... | [((3578, 3667), 'losses.triplet_loss.TripletLoss', 'losses.triplet_loss.TripletLoss', (['compared_length', 'nb_random_samples', 'negative_penalty'], {}), '(compared_length, nb_random_samples,\n negative_penalty)\n', (3609, 3667), False, 'import losses\n'), ((3714, 3816), 'losses.triplet_loss.TripletLossVaryingLength... |
import sys
sys.path.append("./Pendulum-problem/pendulum_problem")
import numpy as np
import tensorflow as tf
from ddpg import DeepDeterministicPolicyGradients
from replay_buffer import ReplayBuffer
from neural_nets import ActorNet, CriticNet
from exploration import OrnsteinUhlenbeckActionNoise
from camera_environment i... | [
"replay_buffer.ReplayBuffer",
"camera_environment.CameraEnvironment",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.config.list_physical_devices",
"neural_nets.CriticNet",
"tensorflow.keras.layers.Dense",
"tensorflow.config.LogicalDeviceConfiguration",
"sys.path.append",
"numpy.random.Ra... | [((11, 65), 'sys.path.append', 'sys.path.append', (['"""./Pendulum-problem/pendulum_problem"""'], {}), "('./Pendulum-problem/pendulum_problem')\n", (26, 65), False, 'import sys\n'), ((3886, 3924), 'tensorflow.config.list_physical_devices', 'tf.config.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (3917, 3924... |
import os
import json
import random
import numpy as np
import tensorflow as tf
from dataset import DataProcessor, get_dataset
class BeerProcessor(DataProcessor):
"""
Processor for the Beer dataset.
"""
def get_train_examples(self, data_dir):
return self._create_examples(
self._re... | [
"random.sample",
"json.loads",
"tensorflow.data.Dataset.from_tensor_slices",
"os.path.join",
"dataset.get_dataset",
"random.seed",
"numpy.array",
"numpy.sum"
] | [((1664, 1684), 'numpy.array', 'np.array', (['[0.0, 0.0]'], {}), '([0.0, 0.0])\n', (1672, 1684), True, 'import numpy as np\n'), ((1908, 1928), 'numpy.array', 'np.array', (['[0.0, 0.0]'], {}), '([0.0, 0.0])\n', (1916, 1928), True, 'import numpy as np\n'), ((3282, 3355), 'dataset.get_dataset', 'get_dataset', (['train_exa... |
import os
import datetime
from typing import List, Union, Dict
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import torch
from torch import nn
from torch.utils.tensorboard import SummaryWriter
from torch import device as torchDevice
from genEM3.util import gpu
from gen... | [
"torch.utils.tensorboard.SummaryWriter",
"os.path.exists",
"numpy.asarray",
"matplotlib.colors.ListedColormap",
"numpy.exp",
"numpy.stack",
"numpy.concatenate",
"torch.cuda.current_device",
"numpy.ones",
"genEM3.util.gpu.get_gpu",
"matplotlib.pyplot.axes",
"torch.device",
"os.makedirs",
"o... | [((1560, 1579), 'torch.device', 'torchDevice', (['device'], {}), '(device)\n', (1571, 1579), True, 'from torch import device as torchDevice\n'), ((1604, 1644), 'os.path.join', 'os.path.join', (['run_root', '""".log"""', 'run_name'], {}), "(run_root, '.log', run_name)\n", (1616, 1644), False, 'import os\n'), ((2606, 263... |
# imports
from numpy import zeros
from numpy.random import randint,seed
from tensorflow.keras.utils import to_categorical
from utils import configs
# end imports
seed(42)
'''
-------------------------------------------------------------------------------------------
DataHandler : in this class we han... | [
"numpy.random.randint",
"numpy.random.seed",
"numpy.zeros"
] | [((163, 171), 'numpy.random.seed', 'seed', (['(42)'], {}), '(42)\n', (167, 171), False, 'from numpy.random import randint, seed\n'), ((1168, 1213), 'numpy.random.randint', 'randint', (['self.n_moves'], {'size': '(self.n_samples,)'}), '(self.n_moves, size=(self.n_samples,))\n', (1175, 1213), False, 'from numpy.random im... |
from __future__ import print_function
__author__ = 'rogerjiang'
"""
Purposes:
1. Visualization of training data
2. Evaluation of training data augmentation
Notes on the data files:
train_wkt_v4.csv: training labels with ImageId, ClassType, MultipolygonWKT
train_geoson_v3 (similar to train_wkt_v4.csv): training labe... | [
"pandas.read_csv",
"shapely.wkt.loads",
"descartes.patch.PolygonPatch",
"seaborn.set_style",
"numpy.array",
"cv2.approxPolyDP",
"numpy.percentile",
"shapely.affinity.scale",
"numpy.arange",
"numpy.mean",
"numpy.reshape",
"seaborn.despine",
"cv2.contourArea",
"numpy.dot",
"numpy.concatena... | [((2667, 2780), 'pandas.read_csv', 'pd.read_csv', (["(data_dir + '/data/train_wkt_v4.csv')"], {'names': "['ImageId', 'ClassId', 'MultipolygonWKT']", 'skiprows': '(1)'}), "(data_dir + '/data/train_wkt_v4.csv', names=['ImageId',\n 'ClassId', 'MultipolygonWKT'], skiprows=1)\n", (2678, 2780), True, 'import pandas as pd\... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
tif_to_nii
command line executable to convert a directory of tif images
(from one image) to a nifti image stacked along a user-specified axis
call as: python tif_to_nii.py /path/to/tif/ /path/to/nifti
(append optional arguments to the call as desired)
Author: <NAME> (<E... | [
"os.listdir",
"tifffile.imread",
"PIL.Image.open",
"argparse.ArgumentParser",
"pathlib.Path",
"os.path.splitext",
"os.path.join",
"numpy.asarray",
"os.path.dirname",
"numpy.stack",
"os.path.basename",
"nibabel.Nifti1Image"
] | [((528, 602), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""merge 2d tif images into a 3d image"""'}), "(description='merge 2d tif images into a 3d image')\n", (551, 602), False, 'import argparse\n'), ((1027, 1052), 'os.path.dirname', 'os.path.dirname', (['filepath'], {}), '(filepath)\n... |
from ipyleaflet import Map, basemaps, basemap_to_tiles
m = Map(
layers=(basemap_to_tiles(basemaps.NASAGIBS.ModisTerraTrueColorCR, "2017-04-08"), ),
center=(52.204793, 360.121558),
zoom=4
)
m
import ipyleaflet
import json
import pandas as pd
import os
import requests
from ipywidgets import link, FloatSlid... | [
"seaborn.set",
"ipyleaflet.basemap_to_tiles",
"seaborn.set_color_codes",
"seaborn.despine",
"numpy.arange",
"ipyleaflet.Choropleth",
"seaborn.load_dataset",
"pandas.date_range",
"requests.get",
"seaborn.lineplot",
"numpy.random.RandomState",
"pandas.DataFrame",
"seaborn.barplot",
"ipyleafl... | [((1031, 1208), 'ipyleaflet.Choropleth', 'ipyleaflet.Choropleth', ([], {'geo_data': 'geo_json_data', 'choro_data': 'unemployment', 'colormap': 'linear.YlOrRd_04', 'border_color': '"""black"""', 'style': "{'fillOpacity': 0.8, 'dashArray': '5, 5'}"}), "(geo_data=geo_json_data, choro_data=unemployment,\n colormap=linea... |
# pylint: disable=redefined-outer-name
"""Global configuration."""
import os
import shutil
import pytest
@pytest.fixture(scope="session")
def workspace_folder(tmpdir_factory):
"""Path to pytest workspace directory."""
path = str(tmpdir_factory.mktemp("workspace"))
yield path
shutil.rmtree(path)
@py... | [
"os.chdir",
"numpy.random.seed",
"shutil.rmtree",
"pytest.fixture",
"os.path.abspath"
] | [((109, 140), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (123, 140), False, 'import pytest\n'), ((318, 349), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (332, 349), False, 'import pytest\n'), ((452, 480), 'pytest.fixture'... |
# Classify images, based on training data
#
# Usage:
# 1. create folder with:
# - folder with training data (one folder for each type)
# - folder with images to be classified
# - this script
# 3. set required parameters:
# - data_dir = (relative) folder with traing/validation images ('document_images')
# ... | [
"tensorflow.keras.layers.Dense",
"tensorflow.nn.softmax",
"tensorflow.compat.as_bytes",
"os.remove",
"os.listdir",
"tensorflow.keras.layers.Conv2D",
"argparse.ArgumentParser",
"pathlib.Path",
"matplotlib.pyplot.plot",
"numpy.max",
"tensorflow.keras.utils.img_to_array",
"tensorflow.keras.prepro... | [((1019, 1044), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1042, 1044), False, 'import argparse\n'), ((1412, 1434), 'pathlib.Path', 'pathlib.Path', (['data_dir'], {}), '(data_dir)\n', (1424, 1434), False, 'import pathlib\n'), ((1448, 1468), 'os.listdir', 'os.listdir', (['data_dir'], {}), '... |
from dataprocessing import create_feature_sets_and_labels
import tensorflow as tf
import pickle
import numpy as np
train_x,train_y,test_x,test_y = create_feature_sets_and_labels('pos.txt','neg.txt')
n_nodes_hl1 = 1500
n_nodes_hl2 = 1500
n_nodes_hl3 = 1500
n_classes = 2
batch_size = 100
hm_epochs = 10
... | [
"tensorflow.initialize_all_variables",
"tensorflow.random_normal",
"tensorflow.nn.relu",
"dataprocessing.create_feature_sets_and_labels",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.nn.softmax_cross_entropy_with_logits_v2",
"numpy.array",
"tensorflow.argmax",
"tensorflow.matmul",
... | [((155, 207), 'dataprocessing.create_feature_sets_and_labels', 'create_feature_sets_and_labels', (['"""pos.txt"""', '"""neg.txt"""'], {}), "('pos.txt', 'neg.txt')\n", (185, 207), False, 'from dataprocessing import create_feature_sets_and_labels\n'), ((327, 350), 'tensorflow.placeholder', 'tf.placeholder', (['"""float""... |
import numpy
import tqdm
from sklearn.manifold import TSNE
class _Transform:
def __init__(self):
pass
def fit(self, X):
return self.transform.fit_transform(X)
class tSNE(_Transform):
def __init__(self):
super().__init__()
self.transform = TSNE(n_components=2, verbose=1,... | [
"mpld3.plugins.connect",
"tqdm.tqdm",
"sklearn.manifold.TSNE",
"mpld3.save_html",
"mpld3.plugins.PointHTMLTooltip",
"numpy.concatenate"
] | [((289, 347), 'sklearn.manifold.TSNE', 'TSNE', ([], {'n_components': '(2)', 'verbose': '(1)', 'perplexity': '(40)', 'n_iter': '(300)'}), '(n_components=2, verbose=1, perplexity=40, n_iter=300)\n', (293, 347), False, 'from sklearn.manifold import TSNE\n'), ((1096, 1116), 'tqdm.tqdm', 'tqdm.tqdm', (['sentences'], {}), '(... |
import os, datetime, gc, warnings, glob
from natsort import natsorted
import numpy as np
import cv2
import tifffile
import logging
from .. import utils, plot, transforms
from ..io import imread, imsave, outlines_to_text
import omnipose
try:
from PyQt5.QtWidgets import QFileDialog
GUI = True
except:
GUI = ... | [
"numpy.array",
"PyQt5.QtWidgets.QFileDialog.getOpenFileName",
"numpy.save",
"numpy.reshape",
"os.path.split",
"numpy.linspace",
"numpy.random.seed",
"numpy.tile",
"numpy.ones",
"omnipose.utils.ncolorlabel",
"numpy.floor",
"os.path.splitext",
"os.path.isfile",
"gc.collect",
"cv2.resize",
... | [((917, 944), 'os.path.isfile', 'os.path.isfile', (['manual_file'], {}), '(manual_file)\n', (931, 944), False, 'import os, datetime, gc, warnings, glob\n'), ((3607, 3619), 'gc.collect', 'gc.collect', ([], {}), '()\n', (3617, 3619), False, 'import os, datetime, gc, warnings, glob\n'), ((4187, 4209), 'numpy.array', 'np.a... |
# Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import numpy as np
import torch
from mmdet.core import bbox2result
def imrenormalize(img, img_norm_cfg, new_img_norm_cfg):
"""Re-normalize the image.
Args:
img (Tensor | ndarray): Input image. If the input is a Tensor, the
shape ... | [
"torch.from_numpy",
"mmdet.core.bbox2result",
"numpy.array",
"mmcv.imdenormalize",
"numpy.stack",
"mmcv.concat_list",
"numpy.zeros",
"numpy.concatenate",
"mmcv.imnormalize"
] | [((1748, 1787), 'mmcv.imdenormalize', 'mmcv.imdenormalize', (['img'], {}), '(img, **img_norm_cfg)\n', (1766, 1787), False, 'import mmcv\n'), ((1798, 1839), 'mmcv.imnormalize', 'mmcv.imnormalize', (['img'], {}), '(img, **new_img_norm_cfg)\n', (1814, 1839), False, 'import mmcv\n'), ((5421, 5453), 'numpy.array', 'np.array... |
import random
import numpy as np
import skimage.io as sio
import skimage.color as sc
import skimage.transform as st
import torch
from torchvision import transforms
def get_patch(haze_tensor, A_tensor, t_tensor, latent_tensor, patch_size):
assert haze_tensor.shape[1:] == A_tensor.shape[1:]
assert haze_tensor.... | [
"random.randrange",
"skimage.color.rgb2ycbcr",
"torch.from_numpy",
"numpy.ascontiguousarray",
"numpy.concatenate",
"numpy.expand_dims",
"random.random"
] | [((458, 498), 'random.randrange', 'random.randrange', (['(0)', '(iw - patch_size + 1)'], {}), '(0, iw - patch_size + 1)\n', (474, 498), False, 'import random\n'), ((508, 548), 'random.randrange', 'random.randrange', (['(0)', '(ih - patch_size + 1)'], {}), '(0, ih - patch_size + 1)\n', (524, 548), False, 'import random\... |
# Copyright 2019 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... | [
"numpy.random.rand",
"tensorflow.python.keras.Model",
"tensorflow.python.keras.layers.Dense",
"tensorflow.python.keras.Sequential",
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.keras.optimizer_v2.gradient_descent.SGD",
"tensorflow.python.keras.layers.Input"
] | [((1380, 1403), 'numpy.random.rand', 'np.random.rand', (['(1000)', '(3)'], {}), '(1000, 3)\n', (1394, 1403), True, 'import numpy as np\n'), ((1460, 1483), 'numpy.random.rand', 'np.random.rand', (['(1000)', '(5)'], {}), '(1000, 5)\n', (1474, 1483), True, 'import numpy as np\n'), ((1549, 1572), 'numpy.random.rand', 'np.r... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Other coordinate and distance-related functions"""
import numpy as np
from astropy.units import Quantity, Unit
__all__ = [
"cartesian",
"galactic",
"velocity_glon_glat",
"motion_since_birth",
"polar",
"D_SUN_TO_GALACTIC_CENTER",... | [
"numpy.sqrt",
"astropy.units.Unit",
"numpy.arcsin",
"numpy.arctan2",
"numpy.cos",
"numpy.sin",
"astropy.units.Quantity"
] | [((442, 462), 'astropy.units.Quantity', 'Quantity', (['(8.5)', '"""kpc"""'], {}), "(8.5, 'kpc')\n", (450, 462), False, 'from astropy.units import Quantity, Unit\n'), ((804, 828), 'numpy.sqrt', 'np.sqrt', (['(x ** 2 + y ** 2)'], {}), '(x ** 2 + y ** 2)\n', (811, 828), True, 'import numpy as np\n'), ((841, 857), 'numpy.a... |
"""Utility functions for conversion between color models."""
__all__ = [
"color_to_rgb",
"color_to_rgba",
"rgb_to_color",
"rgba_to_color",
"rgb_to_hex",
"hex_to_rgb",
"invert_color",
"color_to_int_rgb",
"color_to_int_rgba",
"color_gradient",
"interpolate_color",
"average... | [
"numpy.dot",
"colour.Color",
"numpy.apply_along_axis"
] | [((7681, 7718), 'numpy.apply_along_axis', 'np.apply_along_axis', (['np.mean', '(0)', 'rgbs'], {}), '(np.mean, 0, rgbs)\n', (7700, 7718), True, 'import numpy as np\n'), ((7920, 7938), 'colour.Color', 'Color', ([], {'rgb': 'new_rgb'}), '(rgb=new_rgb)\n', (7925, 7938), False, 'from colour import Color\n'), ((6213, 6227), ... |
import numpy as np
from utils.rbo import rbo as rbo_utils
from itertools import combinations
def proportion_common_words(topics, topk=10):
"""
compute proportion of unique words
Parameters
----------
topics: a list of lists of words
topk: top k words on which the topic diversity will be compu... | [
"itertools.combinations",
"numpy.mean",
"utils.rbo.rbo"
] | [((1832, 1855), 'itertools.combinations', 'combinations', (['topics', '(2)'], {}), '(topics, 2)\n', (1844, 1855), False, 'from itertools import combinations\n'), ((1364, 1387), 'itertools.combinations', 'combinations', (['topics', '(2)'], {}), '(topics, 2)\n', (1376, 1387), False, 'from itertools import combinations\n'... |
import sys
sys.path.append('../')
from config import DATA_PATH
import pylangacq
from aux import load_audio
from aux_evaluate import first_last, get_bounds, filtered_overlapping_indexes, prepare_mono_for_forward
import os
import numpy as np
from spectral_cluster import get_affinity_matrix, cluster_affinity, adjust_label... | [
"pyannote.core.Segment",
"numpy.logical_and",
"numpy.where",
"spectral_cluster.arr_to_areas",
"numpy.chararray",
"numpy.zeros_like",
"numpy.max",
"pylangacq.Reader.from_files",
"numpy.sum",
"aux.load_audio",
"numpy.min",
"aux_evaluate.filtered_overlapping_indexes",
"aux_evaluate.first_last",... | [((11, 33), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (26, 33), False, 'import sys\n'), ((698, 716), 'numpy.where', 'np.where', (['bool_arr'], {}), '(bool_arr)\n', (706, 716), True, 'import numpy as np\n'), ((792, 814), 'numpy.min', 'np.min', (['[b1[0], b2[0]]'], {}), '([b1[0], b2[0]])\n',... |
#! /usr/bin/env python
# Mathematica nb from Alex & Laurent
# <EMAIL> major reorg as LG++ 2018 01
# python3 required (int( (len(coeffs) -1)/2 )) because of float int/int result change from python2
import numpy as np
import scipy.special
import numpy.linalg as linalg
import sys
from scipy.special import comb
import ... | [
"numpy.sqrt",
"numpy.linalg.cond",
"linearfit.linearfit.LinearFit",
"numpy.array",
"numpy.arctan2",
"scipy.special.comb",
"uncertainties.unumpy.arctan2",
"numpy.where",
"numpy.delete",
"numpy.dot",
"numpy.linalg.lstsq",
"uncertainties.unumpy.sqrt",
"numpy.abs",
"numpy.mat",
"numpy.shape"... | [((619, 630), 'numpy.sum', 'np.sum', (['img'], {}), '(img)\n', (625, 630), True, 'import numpy as np\n'), ((2534, 2561), 'numpy.delete', 'np.delete', (['flatimg', 'nanlist'], {}), '(flatimg, nanlist)\n', (2543, 2561), True, 'import numpy as np\n'), ((3560, 3594), 'numpy.dot', 'np.dot', (['flatmodeltransp', 'flatmodel']... |
# Copyright (c) 2019-2021, <NAME>, <NAME>, <NAME>, and <NAME>.
#
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/vector for details.
import typing
"""
.. code-block:: python
@property
Lorentz.t(self)
"""
import numpy
from vector._compute.lorent... | [
"vector._methods._ttype",
"vector._methods._aztype",
"vector._compute.lorentz.t2.xy_z_tau",
"vector._compute.lorentz.t2.xy_theta_tau",
"vector._compute.lorentz.t2.xy_eta_tau",
"numpy.errstate",
"vector._compute.lorentz.t2.rhophi_z_tau",
"vector._compute.lorentz.t2.rhophi_theta_tau",
"vector._methods... | [((670, 700), 'vector._compute.lorentz.t2.xy_z_tau', 't2.xy_z_tau', (['lib', 'x', 'y', 'z', 'tau'], {}), '(lib, x, y, z, tau)\n', (681, 700), False, 'from vector._compute.lorentz import t2\n'), ((817, 855), 'vector._compute.lorentz.t2.xy_theta_tau', 't2.xy_theta_tau', (['lib', 'x', 'y', 'theta', 'tau'], {}), '(lib, x, ... |
#
# Copyright (C) 2014-2016 UAVCAN Development Team <dronecan.org>
#
# This software is distributed under the terms of the MIT License.
#
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
from __future__ import division, absolute_import, print_function, unicode_literals
import decimal
class SourceTimeResolve... | [
"time.monotonic",
"time.sleep",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.random.uniform",
"time.time",
"decimal.Decimal",
"matplotlib.pyplot.show"
] | [((9066, 9126), 'numpy.random.uniform', 'numpy.random.uniform', (['delay_min', 'delay_max'], {'size': 'num_samples'}), '(delay_min, delay_max, size=num_samples)\n', (9086, 9126), False, 'import numpy\n'), ((9808, 9820), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (9818, 9820), True, 'import matplotlib.p... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import warnings
from distutils.version import LooseVersion
from .pycompat import OrderedDict, zip, dask_array_type
from .common import full_like
from .combine import concat
from .ops import (... | [
"numpy.ones",
"warnings.warn",
"distutils.version.LooseVersion",
"numpy.maximum",
"numpy.arange"
] | [((5211, 5240), 'numpy.maximum', 'np.maximum', (['(stops - window)', '(0)'], {}), '(stops - window, 0)\n', (5221, 5240), True, 'import numpy as np\n'), ((1739, 1907), 'warnings.warn', 'warnings.warn', (['"""xarray requires bottleneck version of 1.0 or greater for rolling operations. Rolling aggregation methods will use... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import numpy as np
def TestReduction(op, data, axes, keepdims):
if op == "ReduceL1":
return np.sum(a=np.abs(data), axis=axes, keepdims=keepdims)
elif op == "ReduceL2":
return np.sqrt(np.sum(... | [
"numpy.abs",
"numpy.mean",
"numpy.prod",
"itertools.product",
"numpy.min",
"numpy.argmax",
"numpy.square",
"numpy.max",
"numpy.sum",
"numpy.exp",
"numpy.random.seed",
"numpy.expand_dims",
"numpy.random.uniform",
"numpy.argmin"
] | [((3060, 3077), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (3074, 3077), True, 'import numpy as np\n'), ((3095, 3130), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': 'input_shape'}), '(size=input_shape)\n', (3112, 3130), True, 'import numpy as np\n'), ((3944, 3988), 'itertools.product', ... |
import numpy as np
from starfish import ImageStack
from starfish.core.image.Filter.zero_by_channel_magnitude import ZeroByChannelMagnitude
def create_imagestack_with_magnitude_scale():
"""create an imagestack with increasing magnitudes"""
data = np.linspace(0, 1, 11, dtype=np.float32)
data = np.repeat(dat... | [
"starfish.ImageStack.from_numpy",
"numpy.repeat",
"starfish.core.image.Filter.zero_by_channel_magnitude.ZeroByChannelMagnitude",
"numpy.linspace",
"numpy.all"
] | [((256, 295), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(11)'], {'dtype': 'np.float32'}), '(0, 1, 11, dtype=np.float32)\n', (267, 295), True, 'import numpy as np\n'), ((307, 342), 'numpy.repeat', 'np.repeat', (['data[None, :]', '(2)'], {'axis': '(0)'}), '(data[None, :], 2, axis=0)\n', (316, 342), True, 'import ... |
import numpy as np
def generate_features(implementation_version, draw_graphs, raw_data, axes, sampling_freq, scale_axes):
# features is a 1D array, reshape so we have a matrix
raw_data = raw_data.reshape(int(len(raw_data) / len(axes)), len(axes))
features = []
graphs = []
# split out the data fro... | [
"numpy.array"
] | [((535, 546), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (543, 546), True, 'import numpy as np\n')] |
import parasail
from .._util._multiprocessing import EnhancedPool as Pool
import itertools
from anndata import AnnData
from typing import Union, Collection, List, Tuple, Dict, Callable
from .._compat import Literal
import numpy as np
from scanpy import logging
import numpy.testing as npt
from .._util import _is_na, _is... | [
"parasail.Matrix",
"scanpy.logging.debug",
"parasail.nw_scan_profile_16",
"itertools.product",
"numpy.min",
"Levenshtein.distance",
"scipy.sparse.coo_matrix",
"scanpy.logging.info",
"parasail.profile_create_16",
"itertools.repeat"
] | [((24130, 24196), 'scanpy.logging.debug', 'logging.debug', (['"""Finished converting distances to connectivities. """'], {}), "('Finished converting distances to connectivities. ')\n", (24143, 24196), False, 'from scanpy import logging\n'), ((2977, 3044), 'scipy.sparse.coo_matrix', 'coo_matrix', (['(d, (row, col))'], {... |
# =========================================================================
# (c) Copyright 2019
# All rights reserved
# Programs written by <NAME>
# Department of Computer Science
# New Jersey Institute of Technology
# University Heights, Newark, NJ 07102, USA
#
# Permission to use, copy, modify, and dis... | [
"sklearn.preprocessing.LabelEncoder",
"numpy.unique",
"pandas.read_csv",
"csv.writer",
"tensorflow.compat.v1.logging.set_verbosity",
"numpy.array",
"keras.utils.np_utils.to_categorical",
"csv.reader"
] | [((1054, 1116), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (1088, 1116), True, 'import tensorflow as tf\n'), ((2370, 2391), 'pandas.read_csv', 'pd.read_csv', (['datafile'], {}), '(datafile)\n', (2381, 2391),... |
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | [
"numpy.mean",
"collections.deque",
"numpy.min",
"numpy.diff",
"numpy.max",
"numpy.array",
"numpy.linspace",
"numpy.vstack",
"numpy.cos",
"numpy.std",
"numpy.sin"
] | [((7431, 7483), 'numpy.linspace', 'np.linspace', (['(-np.pi)', 'np.pi', 'phi_steps'], {'endpoint': '(True)'}), '(-np.pi, np.pi, phi_steps, endpoint=True)\n', (7442, 7483), True, 'import numpy as np\n'), ((7494, 7501), 'collections.deque', 'deque', ([], {}), '()\n', (7499, 7501), False, 'from collections import deque\n'... |
# Copyright 2018 Uber Technologies, Inc. All Rights Reserved.
# Modifications copyright (C) 2019 Intel Corporation
# Modifications copyright (C) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | [
"horovod.torch.synchronize",
"torch.optim.Optimizer.__subclasses__",
"torch.nn.BatchNorm1d",
"horovod.torch.size",
"torch.cuda.is_available",
"torch.IntTensor",
"horovod.torch.stop_timeline",
"itertools.product",
"horovod.torch.allgather_object",
"horovod.torch.start_timeline",
"platform.system"... | [((1322, 1353), 'distutils.version.LooseVersion', 'LooseVersion', (['torch.__version__'], {}), '(torch.__version__)\n', (1334, 1353), False, 'from distutils.version import LooseVersion\n'), ((1357, 1378), 'distutils.version.LooseVersion', 'LooseVersion', (['"""1.5.0"""'], {}), "('1.5.0')\n", (1369, 1378), False, 'from ... |
from ..base import BaseText2Vec
from ....base import catch_vector_errors
from ....doc_utils import ModelDefinition
from ....import_utils import is_all_dependency_installed
from ....models_dict import MODEL_REQUIREMENTS
from datetime import date
if is_all_dependency_installed(MODEL_REQUIREMENTS['encoders-text-tfhub-bert... | [
"tensorflow.keras.layers.Input",
"tensorflow.convert_to_tensor",
"bert.bert_tokenization.FullTokenizer",
"numpy.array",
"tensorflow_hub.KerasLayer"
] | [((2373, 2398), 'tensorflow_hub.KerasLayer', 'hub.KerasLayer', (['model_url'], {}), '(model_url)\n', (2387, 2398), True, 'import tensorflow_hub as hub\n'), ((2424, 2491), 'tensorflow.keras.layers.Input', 'tf.keras.layers.Input', ([], {'shape': '(self.max_seq_length,)', 'dtype': 'tf.int32'}), '(shape=(self.max_seq_lengt... |
import argparse # argsparse是python的命令行解析的标准模块,直接在命令行中就可以向程序中传入参数并让程序运行
import os
import numpy as np
# 用于data augmentation
import torchvision.transforms as transforms
# 保存生成图像
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
# Varibale包含三... | [
"numpy.random.normal",
"torch.nn.Sigmoid",
"numpy.prod",
"torch.nn.Tanh",
"argparse.ArgumentParser",
"os.makedirs",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm1d",
"torch.nn.BCELoss",
"torch.cuda.is_available",
"torch.save",
"torch.nn.Linear",
"torchvision.transforms.Resize",
"torchvision.tr... | [((589, 625), 'os.makedirs', 'os.makedirs', (['"""images"""'], {'exist_ok': '(True)'}), "('images', exist_ok=True)\n", (600, 625), False, 'import os\n'), ((648, 673), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (671, 673), False, 'import argparse\n'), ((4667, 4685), 'torch.nn.BCELoss', 'torc... |
"""Yohkoh SXT Map subclass definitions"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import numpy as np
from astropy.visualization import PowerStretch
from astropy.visualization.mpl_normalize import ImageNormalize
from sunpy.map import GenericMap
from sunpy.map.sources.source_type import source_stretch
from sunpy.... | [
"numpy.deg2rad",
"sunpy.map.GenericMap.__init__",
"astropy.visualization.PowerStretch"
] | [((1484, 1533), 'sunpy.map.GenericMap.__init__', 'GenericMap.__init__', (['self', 'data', 'header'], {}), '(self, data, header, **kwargs)\n', (1503, 1533), False, 'from sunpy.map import GenericMap\n'), ((2559, 2600), 'numpy.deg2rad', 'np.deg2rad', (["(self.meta['solar_r'] / 3600.0)"], {}), "(self.meta['solar_r'] / 3600... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
hsv_colors = [(0.56823266219239377, 0.82777777777777772, 0.70588235294117652),
(0.078146611341632088, 0.94509803921568625, 1.0),
(0.33333333333333331, 0.72499999999999998, 0.62745098039215685),
(0.9990476190... | [
"matplotlib.pyplot.colorbar",
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title"
] | [((1016, 1028), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1026, 1028), True, 'import matplotlib.pyplot as plt\n'), ((1033, 1104), 'matplotlib.pyplot.scatter', 'plt.scatter', (['Y[:, 0]', 'Y[:, 1]'], {'s': '(30)', 'c': 'labels', 'cmap': 'colors', 'linewidth': '(0)'}), '(Y[:, 0], Y[:, 1], s=30, c=label... |
#pythran export run(int, int, int)
#runas run(10,10,10)
#from https://raw.githubusercontent.com/cphhpc/numpy/victim_cache/benchmark/Python/shallow_water.py
import numpy as np
def model(height, width, dtype):
m = np.ones((height, width),dtype=dtype)
m[height/4,width/4] = 6.0
return m
def step(H, U, V, d... | [
"numpy.zeros_like",
"numpy.ones"
] | [((217, 254), 'numpy.ones', 'np.ones', (['(height, width)'], {'dtype': 'dtype'}), '((height, width), dtype=dtype)\n', (224, 254), True, 'import numpy as np\n'), ((2400, 2416), 'numpy.zeros_like', 'np.zeros_like', (['H'], {}), '(H)\n', (2413, 2416), True, 'import numpy as np\n'), ((2425, 2441), 'numpy.zeros_like', 'np.z... |
"""
Working with PSID in python
@author : <NAME> <<EMAIL>>
@date : 2015-02-04 09:02:56
use the read_csv option `usecols` to only keep what we need
"""
import re
import os
import gc
import os.path
import zipfile
import requests
import lxml.html
import numpy as np
import pandas as pd
# ----------- #
# Downloading ... | [
"pandas.Series",
"textwrap.dedent",
"requests.session",
"os.path.exists",
"zipfile.ZipFile",
"pandas.read_csv",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.split",
"os.remove",
"datetime.datetime.now",
"gc.collect",
"numpy.genfromtxt",
"glob.glob",
"re.search"
] | [((998, 1016), 'requests.session', 'requests.session', ([], {}), '()\n', (1014, 1016), False, 'import requests\n'), ((2620, 2645), 'zipfile.ZipFile', 'zipfile.ZipFile', (['filename'], {}), '(filename)\n', (2635, 2645), False, 'import zipfile\n'), ((5272, 5329), 'numpy.genfromtxt', 'np.genfromtxt', (['ascii_name'], {'na... |
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import random
random.seed(1337)
np.random.seed(1337) # for reproducibility
from keras.models import Sequential, load_model, save_model
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution3D, Ma... | [
"keras.layers.Activation",
"keras.models.save_model",
"keras.layers.Dense",
"os.path.exists",
"os.listdir",
"argparse.ArgumentParser",
"numpy.random.seed",
"random.uniform",
"random.choice",
"keras.layers.Flatten",
"keras.models.Sequential",
"keras.layers.Convolution3D",
"keras.layers.Dropou... | [((94, 111), 'random.seed', 'random.seed', (['(1337)'], {}), '(1337)\n', (105, 111), False, 'import random\n'), ((112, 132), 'numpy.random.seed', 'np.random.seed', (['(1337)'], {}), '(1337)\n', (126, 132), True, 'import numpy as np\n'), ((815, 863), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'descripti... |
import os
from collections.abc import Iterable
from functools import partial
from math import ceil
from operator import getitem
from threading import Lock
from typing import Optional, Union
import numpy as np
import pandas as pd
import dask.array as da
from dask.base import tokenize
from dask.blockwise import Blockwi... | [
"dask.utils._deprecated",
"dask.bag.core.Bag",
"dask.array.unique",
"dask.utils.is_arraylike",
"numpy.array",
"dask.base.tokenize",
"dask.blockwise.blockwise",
"pandas.RangeIndex",
"bcolz.ctable",
"numpy.isscalar",
"dask.dataframe.core.DataFrame",
"numpy.searchsorted",
"threading.Lock",
"n... | [((926, 932), 'threading.Lock', 'Lock', ([], {}), '()\n', (930, 932), False, 'from threading import Lock\n'), ((9674, 9712), 'dask.utils._deprecated', '_deprecated', ([], {'after_version': '"""2022.02.1"""'}), "(after_version='2022.02.1')\n", (9685, 9712), False, 'from dask.utils import M, _deprecated, funcname, is_arr... |
# Copyright 2015-2016 Stanford University
#
# 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 ... | [
"random.shuffle",
"pandas.read_csv",
"collections.Counter",
"numpy.array",
"pandas.get_dummies"
] | [((1390, 1410), 'random.shuffle', 'random.shuffle', (['rows'], {}), '(rows)\n', (1404, 1410), False, 'import random\n'), ((2865, 2887), 'numpy.array', 'np.array', (['covDf.values'], {}), '(covDf.values)\n', (2873, 2887), True, 'import numpy as np\n'), ((2896, 2924), 'numpy.array', 'np.array', (['resDf.values[:, 0]'], {... |
# | <NAME>, <NAME>, <NAME> |
# | POLITECHNIKA WROCŁAWSKA |
# | WYDZIAŁ INFORMATYKI I TELEKOMUNIKACJI |
# | 2021/2022 |
import os
import numpy as np
from PyQt5.QtWidgets import QFileDialog
import helpers.load_from_mendeley as mendeley
i... | [
"helpers.load_from_mendeley.load_from_file",
"os.path.splitext",
"helpers.load_from_mitdb.load_from_file",
"numpy.empty",
"os.path.basename",
"PyQt5.QtWidgets.QFileDialog.getOpenFileName"
] | [((736, 758), 'os.path.basename', 'os.path.basename', (['path'], {}), '(path)\n', (752, 758), False, 'import os\n'), ((446, 543), 'PyQt5.QtWidgets.QFileDialog.getOpenFileName', 'QFileDialog.getOpenFileName', (['context', '"""Open a file"""', '""""""', '""".dat .hea .mat (*.dat *.hea *.mat)"""'], {}), "(context, 'Open a... |
'''
Created on 24-May-2018
@author: <NAME>
'''
#Import all the packages we will going to use
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
#Initialize the random number generator for reproducible results
np.random.seed(41)
tf.set_random_seed(41)
#Number of Sample points
n = 400
#Proba... | [
"tensorflow.layers.flatten",
"matplotlib.pyplot.ylabel",
"tensorflow.set_random_seed",
"numpy.random.binomial",
"numpy.where",
"matplotlib.pyplot.xlabel",
"tensorflow.placeholder",
"tensorflow.Session",
"matplotlib.pyplot.plot",
"tensorflow.nn.sigmoid",
"numpy.random.seed",
"numpy.meshgrid",
... | [((237, 255), 'numpy.random.seed', 'np.random.seed', (['(41)'], {}), '(41)\n', (251, 255), True, 'import numpy as np\n'), ((256, 278), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(41)'], {}), '(41)\n', (274, 278), True, 'import tensorflow as tf\n'), ((471, 509), 'numpy.random.binomial', 'np.random.binomial',... |
import os
import sys
sys.path.append('..')
from beepose.utils.util import NumpyEncoder, rotate_bound2,distance_point,distance_line_point, read_json,save_json, dets2boxes,boxes2dets,non_max_suppression_slow
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import json
import glob,os
import pyl... | [
"beepose.utils.util.read_json",
"beepose.utils.util.non_max_suppression_slow",
"keras.models.load_model",
"argparse.ArgumentParser",
"beepose.utils.util.rotate_bound2",
"tensorflow.Session",
"beepose.utils.util.distance_point",
"os.path.join",
"math.degrees",
"numpy.array",
"beepose.utils.util.d... | [((22, 43), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (37, 43), False, 'import sys\n'), ((2742, 2765), 'cv2.VideoCapture', 'cv2.VideoCapture', (['video'], {}), '(video)\n', (2758, 2765), False, 'import cv2\n'), ((2776, 2813), 'keras.models.load_model', 'load_model', (['model_json', 'model_we... |
#!/software/anaconda3.6/bin/python
from mpi4py import MPI
import os
import pickle
from OpSim import OpSim
from astropy.coordinates import SkyCoord
from astropy import units
import numpy as np
if __name__ == "__main__":
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
sendbuf = None
root = ... | [
"os.path.exists",
"numpy.log10",
"numpy.reshape",
"numpy.full_like",
"os.makedirs",
"numpy.where",
"numpy.floor",
"numpy.diff",
"numpy.squeeze",
"numpy.append",
"numpy.array",
"numpy.empty",
"numpy.cumsum",
"OpSim.OpSim"
] | [((568, 617), 'numpy.empty', 'np.empty', (['(size, nfieldsPerCore)'], {'dtype': '"""float64"""'}), "((size, nfieldsPerCore), dtype='float64')\n", (576, 617), True, 'import numpy as np\n'), ((629, 670), 'numpy.empty', 'np.empty', (['nfieldsPerCore'], {'dtype': '"""float64"""'}), "(nfieldsPerCore, dtype='float64')\n", (6... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.