code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
from copy import deepcopy from dataclasses import dataclass from typing import Dict, List, Optional, Set, Tuple import numpy as np from l5kit.data import filter_agents_by_frames, PERCEPTION_LABEL_TO_INDEX from l5kit.dataset import EgoDataset from l5kit.geometry.transform import yaw_as_rotation33 from l5kit.simulation...
[ "copy.deepcopy", "l5kit.simulation.utils.insert_agent", "numpy.asarray", "l5kit.simulation.utils.get_frames_subset", "l5kit.data.filter_agents_by_frames", "l5kit.geometry.transform.yaw_as_rotation33", "numpy.linalg.norm", "l5kit.simulation.utils.disable_agents", "numpy.unique" ]
[((4310, 4344), 'copy.deepcopy', 'deepcopy', (['self.scene_dataset_batch'], {}), '(self.scene_dataset_batch)\n', (4318, 4344), False, 'from copy import deepcopy\n'), ((3087, 3145), 'l5kit.simulation.utils.get_frames_subset', 'get_frames_subset', (['zarr_dt', 'start_frame_idx', 'end_frame_idx'], {}), '(zarr_dt, start_fr...
from .net_s3fd import s3fd from .bbox import nms, decode import torch.nn.functional as F import numpy as np import cv2 import torch class SFDDetector: def __init__(self, device, model_path, image_info): # Initialise the face detector model_weights = torch.load(model_path) torch.backends.cu...
[ "torch.load", "numpy.where", "numpy.array", "torch.Tensor", "torch.no_grad", "cv2.resize", "torch.from_numpy" ]
[((272, 294), 'torch.load', 'torch.load', (['model_path'], {}), '(model_path)\n', (282, 294), False, 'import torch\n'), ((624, 659), 'cv2.resize', 'cv2.resize', (['frame', '(self.h, self.w)'], {}), '(frame, (self.h, self.w))\n', (634, 659), False, 'import cv2\n'), ((1968, 1984), 'numpy.array', 'np.array', (['bboxes'], ...
import pandas as pd from pandas import * from keras.models import Sequential from keras.layers import LSTM, Dense, TimeDistributed, Bidirectional, Dropout, Masking from keras import optimizers import numpy as np X_batches_train = [np.array([[-1.00612917, 1.47313952, 2.68021318, 1.54875809, 0.98385996, ...
[ "keras.layers.Masking", "keras.optimizers.SGD", "keras.layers.Dropout", "keras.layers.LSTM", "keras.layers.Dense", "numpy.array", "keras.models.Sequential" ]
[((22876, 22888), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (22886, 22888), False, 'from keras.models import Sequential\n'), ((23182, 23247), 'keras.optimizers.SGD', 'optimizers.SGD', ([], {'lr': '(0.01)', 'decay': '(1e-06)', 'momentum': '(0.9)', 'nesterov': '(True)'}), '(lr=0.01, decay=1e-06, momentum...
''' @author: rohangupta References: https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_matcher/py_matcher.html https://stackoverflow.com/questions/13063201/how-to-show-the-whole-image-when-using-opencv-warpperspective/20355545#20355545 ''' import cv2 import numpy as np from matplotlib import pyplot as ...
[ "numpy.mean", "numpy.linalg.svd", "numpy.diag", "numpy.set_printoptions", "cv2.cvtColor", "cv2.imwrite", "numpy.std", "cv2.BFMatcher", "numpy.reshape", "numpy.random.choice", "numpy.asarray", "numpy.dot", "numpy.concatenate", "cv2.drawMatches", "numpy.float32", "cv2.imread", "numpy.a...
[((1803, 1830), 'cv2.imread', 'cv2.imread', (['"""mountain1.jpg"""'], {}), "('mountain1.jpg')\n", (1813, 1830), False, 'import cv2\n'), ((1843, 1870), 'cv2.imread', 'cv2.imread', (['"""mountain2.jpg"""'], {}), "('mountain2.jpg')\n", (1853, 1870), False, 'import cv2\n'), ((1933, 1976), 'cv2.cvtColor', 'cv2.cvtColor', ([...
# Copyright 2020 MONAI Consortium # 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.full", "numpy.asarray", "numpy.zeros", "numpy.iinfo", "numpy.any", "random.random", "numpy.min", "numpy.max", "numpy.where", "numpy.eye" ]
[((943, 962), 'numpy.any', 'np.any', (['img'], {'axis': '(0)'}), '(img, axis=0)\n', (949, 962), True, 'import numpy as np\n'), ((973, 992), 'numpy.any', 'np.any', (['img'], {'axis': '(1)'}), '(img, axis=1)\n', (979, 992), True, 'import numpy as np\n'), ((2271, 2282), 'numpy.min', 'np.min', (['arr'], {}), '(arr)\n', (22...
""" @author: <NAME> <<EMAIL>> """ import numpy from .hosemi_crf_ad import HOSemiCRFADModelRepresentation, HOSemiCRFAD from .utilities import HO_AStarSearcher, vectorized_logsumexp class HOCRFADModelRepresentation(HOSemiCRFADModelRepresentation): """Model representation that will hold data structures to be used...
[ "numpy.argmax", "numpy.ones", "numpy.argpartition", "numpy.max", "numpy.dot" ]
[((13207, 13250), 'numpy.argpartition', 'numpy.argpartition', (['(-delta[j, :])', 'beam_size'], {}), '(-delta[j, :], beam_size)\n', (13225, 13250), False, 'import numpy\n'), ((4210, 4237), 'numpy.dot', 'numpy.dot', (['w[w_indx]', 'f_val'], {}), '(w[w_indx], f_val)\n', (4219, 4237), False, 'import numpy\n'), ((14999, 15...
import torch import torch.nn as nn import numpy as np from torch.nn import functional as F from bin.tts.text.symbols import symbols from bin.tts.utils import get_sinusoid_encoding_table from src.transformer.attention import MultiHeadedAttention class ScaledDotProductAttention(nn.Module): ''' Scaled Dot-Product At...
[ "torch.nn.Dropout", "bin.tts.utils.get_sinusoid_encoding_table", "torch.bmm", "numpy.power", "torch.nn.Embedding", "torch.nn.Conv1d", "torch.nn.LayerNorm", "torch.nn.Softmax", "torch.nn.Linear" ]
[((459, 476), 'torch.nn.Softmax', 'nn.Softmax', ([], {'dim': '(2)'}), '(dim=2)\n', (469, 476), True, 'import torch.nn as nn\n'), ((741, 759), 'torch.bmm', 'torch.bmm', (['attn', 'v'], {}), '(attn, v)\n', (750, 759), False, 'import torch\n'), ((1062, 1094), 'torch.nn.Linear', 'nn.Linear', (['d_model', '(n_head * d_k)'],...
import os import pandas as pd import argparse import sqlite3 import numpy as np def get_args(): desc = ('Extracts the locations, novelty, and transcript assignments of' ' exons/introns in a TALON database or GTF file. All positions ' 'are 1-based.') parser = argparse.ArgumentParser(...
[ "pandas.DataFrame", "argparse.ArgumentParser", "numpy.asarray", "os.path.exists", "sqlite3.connect" ]
[((296, 337), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'desc'}), '(description=desc)\n', (319, 337), False, 'import argparse\n'), ((2141, 2160), 'sqlite3.connect', 'sqlite3.connect', (['db'], {}), '(db)\n', (2156, 2160), False, 'import sqlite3\n'), ((2276, 2361), 'pandas.DataFrame', 'p...
#coding:utf-8 import scipy.io as scio import numpy as np from PIL import Image from scipy import misc as smisc import argparse import os import imageio def gaussian_filter(shape=[3, 3], sigma=1.0): """ 2D gaussian mask - should give the same result as MATLAB's fspecial('gaussian',[shape],[sigma]) ...
[ "numpy.random.uniform", "argparse.ArgumentParser", "imageio.imread", "numpy.zeros", "numpy.shape", "numpy.finfo", "numpy.exp", "os.path.join", "os.listdir" ]
[((420, 468), 'numpy.exp', 'np.exp', (['(-(x * x + y * y) / (2.0 * sigma * sigma))'], {}), '(-(x * x + y * y) / (2.0 * sigma * sigma))\n', (426, 468), True, 'import numpy as np\n'), ((804, 827), 'imageio.imread', 'imageio.imread', (['im_file'], {}), '(im_file)\n', (818, 827), False, 'import imageio\n'), ((840, 855), 'n...
import numpy as np import matplotlib.pyplot as plt from numpyviz import VisualArray start = np.random.randint(99, size=(5,7,3)) height, width = start.shape[:2] v, u = np.indices((height, width)) print(u) print(v) print(np.around(-0.5 + u / (width-1), 2)) print(np.around((-0.5 + v / (height-1)) * height / width, 2)) va...
[ "matplotlib.pyplot.show", "numpy.indices", "numpy.around", "numpy.random.randint", "numpyviz.VisualArray" ]
[((93, 130), 'numpy.random.randint', 'np.random.randint', (['(99)'], {'size': '(5, 7, 3)'}), '(99, size=(5, 7, 3))\n', (110, 130), True, 'import numpy as np\n'), ((168, 195), 'numpy.indices', 'np.indices', (['(height, width)'], {}), '((height, width))\n', (178, 195), True, 'import numpy as np\n'), ((323, 341), 'numpyvi...
import itertools from numbers import Number from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast import numpy as np import great_expectations.exceptions as ge_exceptions from great_expectations.core.batch import Batch, BatchRequest, RuntimeBatchRequest from great_expectations.rule_based_profiler...
[ "typing.cast", "great_expectations.util.is_numeric", "numpy.zeros", "numpy.greater", "numpy.indices", "great_expectations.exceptions.ProfilerExecutionError", "great_expectations.rule_based_profiler.helpers.util.get_parameter_value_and_validate_return_type", "numpy.isclose", "great_expectations.rule_...
[((12420, 12599), 'great_expectations.rule_based_profiler.helpers.util.get_parameter_value_and_validate_return_type', 'get_parameter_value_and_validate_return_type', ([], {'domain': 'domain', 'parameter_reference': 'self.sampling_method', 'expected_return_type': 'str', 'variables': 'variables', 'parameters': 'parameter...
import tensorflow as tf import numpy as np import copy import lib.layer as layer import lib.config as C import param as P class Policy_net: def __init__(self, name: str, sess, ob_space, act_space_array, activation=tf.nn.relu): """ :param name: string """ self.sess = sess s...
[ "lib.layer.max_pool", "tensorflow.reduce_sum", "tensorflow.clip_by_value", "tensorflow.get_collection", "tensorflow.reshape", "tensorflow.get_variable_scope", "tensorflow.multiply", "tensorflow.assign", "numpy.random.randint", "numpy.mean", "lib.layer.batch_norm", "tensorflow.summary.merge", ...
[((4108, 4128), 'numpy.asscalar', 'np.asscalar', (['v_preds'], {}), '(v_preds)\n', (4119, 4128), True, 'import numpy as np\n'), ((4197, 4257), 'tensorflow.get_collection', 'tf.get_collection', (['tf.GraphKeys.GLOBAL_VARIABLES', 'self.scope'], {}), '(tf.GraphKeys.GLOBAL_VARIABLES, self.scope)\n', (4214, 4257), True, 'im...
import numpy as np from scipy.sparse import coo_matrix import math import tensorflow as tf from model import Model class MessageGraph(): sender_indices = None receiver_indices = None message_types = None def __init__(self, edges, vertex_count, label_count): self.vertex_count = vertex_count ...
[ "tensorflow.range", "tensorflow.transpose", "tensorflow.ones_like", "tensorflow.placeholder", "tensorflow.shape", "tensorflow.stack", "numpy.array", "tensorflow.sparse_reduce_sum_sparse", "tensorflow.SparseTensor" ]
[((472, 494), 'tensorflow.transpose', 'tf.transpose', (['triplets'], {}), '(triplets)\n', (484, 494), True, 'import tensorflow as tf\n'), ((5911, 5928), 'numpy.array', 'np.array', (['triples'], {}), '(triples)\n', (5919, 5928), True, 'import numpy as np\n'), ((6441, 6502), 'tensorflow.placeholder', 'tf.placeholder', ([...
import strax import straxen from straxen.get_corrections import get_correction_from_cmt import numpy as np import numba from straxen.numbafied_scipy import numba_gammaln, numba_betainc from scipy.special import loggamma import tarfile import tempfile export, __all__ = strax.exporter() @export @strax.takes_config( ...
[ "numpy.sum", "strax.endtime", "numba.njit", "numpy.isnan", "straxen.numbafied_scipy.numba_gammaln", "numpy.arange", "scipy.special.loggamma", "tempfile.TemporaryDirectory", "numpy.isfinite", "straxen.numbafied_scipy.numba_betainc", "tarfile.open", "strax.exporter", "straxen.get_corrections.g...
[((270, 286), 'strax.exporter', 'strax.exporter', ([], {}), '()\n', (284, 286), False, 'import strax\n'), ((22440, 22462), 'numba.njit', 'numba.njit', ([], {'cache': '(True)'}), '(cache=True)\n', (22450, 22462), False, 'import numba\n'), ((321, 494), 'strax.Option', 'strax.Option', (['"""s1_optical_map"""'], {'help': '...
######################################### # Time Series Figures ######################################### #### Import Libraries and Functions from pyhydroqc import anomaly_utilities, rules_detect, calibration from pyhydroqc.parameters import site_params import matplotlib.pyplot as plt import datetime import pandas as ...
[ "matplotlib.pyplot.savefig", "pyhydroqc.anomaly_utilities.get_data", "pandas.read_csv", "matplotlib.pyplot.figure", "numpy.arange", "os.chdir", "pyhydroqc.calibration.lin_drift_cor", "pandas.Timedelta", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "pandas.date_range", "pyhydroqc.rul...
[((793, 885), 'pyhydroqc.anomaly_utilities.get_data', 'anomaly_utilities.get_data', ([], {'sensors': 'sensors', 'site': 'site', 'years': 'years', 'path': '"""./LRO_data/"""'}), "(sensors=sensors, site=site, years=years, path=\n './LRO_data/')\n", (819, 885), False, 'from pyhydroqc import anomaly_utilities, rules_det...
import gym import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from copy import deepcopy from utils import ReplayBuffer # set up device device = torch.device("cpu") class Actor(nn.Module): def __init__(self, state_dim, action_dim, max_action): super(Actor, self).__init_...
[ "copy.deepcopy", "numpy.save", "gym.make", "torch.load", "torch.nn.functional.mse_loss", "torch.cat", "numpy.array", "numpy.random.normal", "torch.nn.Linear", "torch.device", "utils.ReplayBuffer" ]
[((181, 200), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (193, 200), False, 'import torch\n'), ((381, 406), 'torch.nn.Linear', 'nn.Linear', (['state_dim', '(400)'], {}), '(state_dim, 400)\n', (390, 406), True, 'import torch.nn as nn\n'), ((425, 444), 'torch.nn.Linear', 'nn.Linear', (['(400)', '(3...
# import numpy as np # import matplotlib.pyplot as plt # import visualization.panda.world as world # import robot_math as rm # import modeling.geometric_model as gm # # sp2d = rm.gen_2d_spiral_points(max_radius=.2, radial_granularity=.001, tangential_granularity=.01) # plt.plot(sp2d[:,0], sp2d[:,1]) # plt.show() # # ba...
[ "numpy.pad", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.empty", "numpy.asarray", "time.time", "numpy.append", "numpy.sin", "numpy.array", "numpy.tile", "numpy.linspace", "numpy.column_stack", "numpy.arange", "numpy.cos", "numpy.row_stack", "numpy.arctan" ]
[((2443, 2455), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (2451, 2455), True, 'import numpy as np\n'), ((2469, 2481), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (2477, 2481), True, 'import numpy as np\n'), ((3235, 3247), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (3243, 3247), True, 'import num...
import pandas as pd import timemachines import numpy as np TEMPLATE = 'https://raw.githubusercontent.com/microprediction/precisedata/main/returns/fathom_data_N.csv' col = 'fathom_xx' from timemachines.skaters.simple.movingaverage import EMA_SKATERS from timemachines.skaters.simple.thinking import THINKING_SKATERS fro...
[ "pandas.DataFrame", "timemachines.skatertools.utilities.conventions.targets", "numpy.isnan", "timemachines.skating.prior", "numpy.array" ]
[((810, 845), 'timemachines.skating.prior', 'prior', ([], {'f': 'f', 'y': 'y', 'k': 'k', 'e': 'es', 'x0': 'y[0]'}), '(f=f, y=y, k=k, e=es, x0=y[0])\n', (815, 845), False, 'from timemachines.skating import prior\n'), ((855, 865), 'timemachines.skatertools.utilities.conventions.targets', 'targets', (['y'], {}), '(y)\n', ...
# -*- coding: utf-8 -*- ''' Module that prepare a list of documents to be processed with LDA. ''' import re import numpy as np import nltk #import spellChecker as sc from collections import Counter from nltk.corpus import stopwords ''' Words to be masked ''' set_conectores_aditivos = ["más aún", "todavía más", "inclu...
[ "numpy.diag", "numpy.triu", "numpy.sum", "numpy.log2", "numpy.transpose", "re.escape", "numpy.nonzero", "numpy.argsort", "numpy.array", "nltk.corpus.stopwords.words", "collections.Counter", "re.sub", "nltk.SnowballStemmer" ]
[((4675, 4706), 'nltk.SnowballStemmer', 'nltk.SnowballStemmer', (['"""spanish"""'], {}), "('spanish')\n", (4695, 4706), False, 'import nltk\n'), ((4307, 4333), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""spanish"""'], {}), "('spanish')\n", (4322, 4333), False, 'from nltk.corpus import stopwords\n'), ((5656,...
#!/usr/bin/env python # encoding: utf-8 ''' @author: <NAME> @contact: <EMAIL> @file: logistic regression.py @time: 7/21/20 3:30 PM @desc: ''' import seaborn as sns import numpy as np import matplotlib.pyplot as plt def show_data(frame_data): positive = frame_data[frame_data["species"] == 1] negative = frame_da...
[ "matplotlib.pyplot.title", "seaborn.set_style", "matplotlib.pyplot.show", "numpy.sum", "matplotlib.pyplot.plot", "numpy.multiply", "seaborn.load_dataset", "numpy.ones", "seaborn.swarmplot", "numpy.exp", "numpy.dot", "numpy.random.shuffle" ]
[((356, 456), 'seaborn.swarmplot', 'sns.swarmplot', ([], {'x': '"""sepal_length"""', 'y': '"""petal_length"""', 'hue': '"""species"""', 'data': 'positive', 'palette': '"""Set2"""'}), "(x='sepal_length', y='petal_length', hue='species', data=\n positive, palette='Set2')\n", (369, 456), True, 'import seaborn as sns\n'...
import os import cv2 import torch import numpy as np from lib.utils.net_tools import load_ckpt from lib.utils.logging import setup_logging import torchvision.transforms as transforms from tools.parse_arg_test import TestOptions from data.load_dataset import CustomerDataLoader from lib.models.metric_depth_model import M...
[ "torch.no_grad", "os.path.join", "lib.models.metric_depth_model.MetricDepthModel", "torchvision.transforms.Normalize", "numpy.transpose", "tools.parse_arg_test.TestOptions", "lib.models.image_transfer.bins_to_depth", "data.load_dataset.CustomerDataLoader", "torch.nn.DataParallel", "lib.utils.net_t...
[((451, 474), 'lib.utils.logging.setup_logging', 'setup_logging', (['__name__'], {}), '(__name__)\n', (464, 474), False, 'from lib.utils.logging import setup_logging\n'), ((692, 720), 'numpy.transpose', 'np.transpose', (['img', '(2, 0, 1)'], {}), '(img, (2, 0, 1))\n', (704, 720), True, 'import numpy as np\n'), ((1068, ...
# ============================================================================= # caching.py - Supervised caching of function results. # Copyright (C) 1999, 2000, 2001, 2002 <NAME> # Australian National University (1999-2003) # Geoscience Australia (2003-present) # # This program is free software; you can redistribu...
[ "os.mkdir", "string.split", "os.remove", "time", "past.utils.old_div", "numpy.ravel", "string.maketrans", "time.ctime", "time.strftime", "dill.loads", "time.mktime", "glob.glob", "builtins.range", "os.path.join", "os.path.expanduser", "time.asctime", "builtins.input.readlines", "in...
[((2814, 2846), 'os.path.join', 'os.path.join', (['homedir', 'cache_dir'], {}), '(homedir, cache_dir)\n', (2826, 2846), False, 'import os, time, string\n'), ((2404, 2423), 'os.getenv', 'getenv', (['"""ANUGADATA"""'], {}), "('ANUGADATA')\n", (2410, 2423), False, 'from os import getenv\n'), ((16818, 16880), 'anuga.utilit...
#!../../../../virtualenv/bin/python3 # -*- coding: utf-8 -*- # NB: The shebang line above assumes you've installed a python virtual environment alongside your working copy of the # <4most-4gp-scripts> git repository. It also only works if you invoke this python script from the directory where it # is located. If these...
[ "lib.base_synthesizer.Synthesizer", "logging.basicConfig", "numpy.arange", "itertools.product", "logging.getLogger" ]
[((817, 958), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""[%(asctime)s] %(levelname)s:%(filename)s:%(message)s"""', 'datefmt': '"""%d/%m/%Y %H:%M:%S"""'}), "(level=logging.INFO, format=\n '[%(asctime)s] %(levelname)s:%(filename)s:%(message)s', datefmt=\n '%d/%m/%Y %H...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== import numpy as np from ..context import * from ..ops.cntk2 import Input from ..sgd...
[ "numpy.asarray", "numpy.isinf", "numpy.isnan" ]
[((2591, 2608), 'numpy.isnan', 'np.isnan', (['data[0]'], {}), '(data[0])\n', (2599, 2608), True, 'import numpy as np\n'), ((2620, 2637), 'numpy.isnan', 'np.isnan', (['data[1]'], {}), '(data[1])\n', (2628, 2637), True, 'import numpy as np\n'), ((2751, 2768), 'numpy.isnan', 'np.isnan', (['data[4]'], {}), '(data[4])\n', (...
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2019 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from pymor.core.config import config if config.HAVE_PYMESS: import numpy as np import sc...
[ "scipy.linalg.solve", "numpy.eye", "pymess.glyap", "scipy.linalg.cholesky", "pymor.algorithms.lyapunov.mat_eqn_sparse_min_size", "pymor.algorithms.lyapunov._solve_lyap_dense_check_args", "pymor.bindings.scipy._solve_ricc_check_args", "pymess.dense_nm_gmpare", "pymess.Options", "pymess.lradi", "p...
[((869, 1104), 'pymor.core.defaults.defaults', 'defaults', (['"""adi_maxit"""', '"""adi_memory_usage"""', '"""adi_output"""', '"""adi_rel_change_tol"""', '"""adi_res2_tol"""', '"""adi_res2c_tol"""', '"""adi_shifts_arp_m"""', '"""adi_shifts_arp_p"""', '"""adi_shifts_b0"""', '"""adi_shifts_l0"""', '"""adi_shifts_p"""', '...
import os import numpy as np import torch.utils.data as td import pandas as pd import config from csl_common.utils.nn import Batch from csl_common.utils import geometry from datasets import facedataset def read_300W_detection(lmFilepath): lms = [] with open(lmFilepath) as f: for line in f: ...
[ "pandas.DataFrame", "csl_common.utils.nn.Batch", "csl_common.vis.vis.vis_square", "torch.utils.data.DataLoader", "torch.manual_seed", "csl_common.vis.vis.to_disp_images", "csl_common.vis.vis.add_landmarks_to_images", "config.get_dataset_paths", "config.register_dataset", "torch.cuda.manual_seed_al...
[((5062, 5091), 'config.register_dataset', 'config.register_dataset', (['W300'], {}), '(W300)\n', (5085, 5091), False, 'import config\n'), ((501, 515), 'numpy.vstack', 'np.vstack', (['lms'], {}), '(lms)\n', (510, 515), True, 'import numpy as np\n'), ((5196, 5216), 'torch.manual_seed', 'torch.manual_seed', (['(0)'], {})...
import pytest import imageio import numpy as np from bentoml.yatai.client import YataiClient from tests.bento_service_examples.example_bento_service import ExampleBentoService def pytest_configure(): ''' global constants for tests ''' # async request client async def assert_request( meth...
[ "bentoml.yatai.client.YataiClient", "numpy.zeros", "pytest.fixture", "aiohttp.ClientSession" ]
[((1654, 1670), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1668, 1670), False, 'import pytest\n'), ((1761, 1777), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1775, 1777), False, 'import pytest\n'), ((1929, 1945), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1943, 1945), False, 'import p...
""" Tests the SynthData class which is used to generate synthetic stellar kinematic data from simple, Gaussian distributions. """ from __future__ import print_function, division, unicode_literals from astropy.table import Table, join import numpy as np import sys sys.path.insert(0,'..') from chronostar.synthdata impo...
[ "numpy.sum", "numpy.random.seed", "numpy.abs", "numpy.allclose", "numpy.isclose", "numpy.mean", "numpy.copy", "numpy.std", "numpy.max", "numpy.int", "chronostar.component.EllipComponent", "chronostar.synthdata.SynthData", "numpy.hstack", "numpy.min", "chronostar.tabletool.build_data_dict...
[((266, 290), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (281, 290), False, 'import sys\n'), ((440, 554), 'numpy.array', 'np.array', (['[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0, 5.0, 1e-05], [5.0, 0.0, -5.0, 0.0, \n 0.0, 0.0, 10.0, 5.0, 40.0]]'], {}), '([[0.0, 0.0, 0.0, 0.0, 0.0, 0.0...
""" Copyright (c) 2022 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
[ "numpy.stack", "numpy.random.seed", "nncf.experimental.onnx.samplers.ONNXBatchSampler", "nncf.experimental.onnx.samplers.ONNXRandomBatchSampler", "numpy.zeros", "numpy.ones", "numpy.array_equal", "pytest.mark.parametrize" ]
[((1317, 1365), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""batch_size"""', '(1, 2, 3)'], {}), "('batch_size', (1, 2, 3))\n", (1340, 1365), False, 'import pytest\n'), ((1994, 2042), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""batch_size"""', '(1, 2, 3)'], {}), "('batch_size', (1, 2, 3))\...
""" **************************************** * @author: <NAME> * Date: 8/26/21 **************************************** """ """ **************************************** * @author: <NAME> * Date: 5/22/21 **************************************** """ import time import tensorflow.keras as keras import pandas as pd fro...
[ "copy.deepcopy", "tqdm.tqdm", "numpy.sum", "tensorflow.keras.layers.Dense", "random.sample", "numpy.median", "sklearn.preprocessing.MinMaxScaler", "sklearn.preprocessing.OneHotEncoder", "numpy.ones", "time.time", "numpy.random.randint", "numpy.array", "tensorflow.keras.models.Sequential", ...
[((1069, 1080), 'time.time', 'time.time', ([], {}), '()\n', (1078, 1080), False, 'import time\n'), ((1283, 1294), 'time.time', 'time.time', ([], {}), '()\n', (1292, 1294), False, 'import time\n'), ((1374, 1385), 'time.time', 'time.time', ([], {}), '()\n', (1383, 1385), False, 'import time\n'), ((1456, 1467), 'time.time...
import pickle import matplotlib.pyplot as plt import numpy as np list_a = list(range(1000)) list_b = [i*2 for i in range(317)] list_c = [i*3 for i in range(256)] list_d = [i*4 for i in range(1530)] with open("Paint_a.pickle", "wb") as f: pickle.dump(list_a, f) with open("Paint_b.pickle", "wb") as f: pickle....
[ "matplotlib.pyplot.title", "pickle.dump", "numpy.random.seed", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "pickle.load", "numpy.random.normal", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig" ]
[((911, 928), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (925, 928), True, 'import numpy as np\n'), ((935, 974), 'numpy.random.normal', 'np.random.normal', (['mu', 'sigma', 'sampleNo_a'], {}), '(mu, sigma, sampleNo_a)\n', (951, 974), True, 'import numpy as np\n'), ((982, 1021), 'numpy.random.normal'...
# -*- coding: utf-8 -*- """ This example demonstrates a very basic use of flowcharts: filter data, displaying both the input and output of the filter. The behavior of he filter can be reprogrammed by the user. Basic steps are: - create a flowchart and two plots - input noisy data to the flowchart - flowchart con...
[ "pyqtgraph.flowchart.Flowchart", "pyqtgraph.Qt.QtGui.QMainWindow", "pyqtgraph.Qt.QtGui.QWidget", "pyqtgraph.Qt.QtGui.QApplication.instance", "pyqtgraph.Qt.QtGui.QGridLayout", "numpy.random.normal", "pyqtgraph.Qt.QtGui.QApplication", "numpy.linspace", "pyqtgraph.PlotWidget" ]
[((715, 737), 'pyqtgraph.Qt.QtGui.QApplication', 'QtGui.QApplication', (['[]'], {}), '([])\n', (733, 737), False, 'from pyqtgraph.Qt import QtGui, QtCore\n'), ((784, 803), 'pyqtgraph.Qt.QtGui.QMainWindow', 'QtGui.QMainWindow', ([], {}), '()\n', (801, 803), False, 'from pyqtgraph.Qt import QtGui, QtCore\n'), ((860, 875)...
# This source code is part of the Biotite package and is distributed # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further # information. import itertools import glob from os.path import join import numpy as np import pytest from pytest import approx import biotite import biotite.structure as struc im...
[ "biotite.structure.io.pdbx.set_structure", "numpy.full", "biotite.structure.io.pdbx.PDBxFile", "biotite.structure.io.pdbx.get_structure", "numpy.allclose", "biotite.structure.io.pdbx.get_model_count", "biotite.structure.io.pdbx.get_sequence", "pytest.raises", "biotite.structure.io.pdbx.PDBxFile.read...
[((695, 1029), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""category, key, exp_value"""', "[('audit_author', 'name', ['<NAME>.', '<NAME>.', '<NAME>.']), (\n 'struct_ref_seq', 'pdbx_PDB_id_code', '1L2Y'), ('pdbx_nmr_ensemble',\n 'conformer_selection_criteria',\n 'structures with acceptable covale...
import numpy as np import matplotlib.pyplot as plt def normalize_cell(supercell): normalize = [] for r in np.array(supercell): normalize.append(r/np.linalg.norm(r)) return np.array(normalize) class TrajectoryAnalysis: def __init__(self, trajectories): self.trajectories = trajectorie...
[ "numpy.sum", "concurrent.futures.ProcessPoolExecutor", "numpy.isnan", "numpy.linalg.norm", "numpy.interp", "numpy.nanmean", "numpy.max", "numpy.linspace", "numpy.nansum", "numpy.average", "matplotlib.pyplot.legend", "numpy.linalg.inv", "numpy.dot", "matplotlib.pyplot.ylabel", "concurrent...
[((116, 135), 'numpy.array', 'np.array', (['supercell'], {}), '(supercell)\n', (124, 135), True, 'import numpy as np\n'), ((194, 213), 'numpy.array', 'np.array', (['normalize'], {}), '(normalize)\n', (202, 213), True, 'import numpy as np\n'), ((7477, 7493), 'numpy.sqrt', 'np.sqrt', (['length2'], {}), '(length2)\n', (74...
from itertools import product from scipy.signal.windows import blackman from scipy.signal import convolve2d from scipy.stats import gaussian_kde import numpy as np from PIL import Image import time import psutil def smoothen(data,width): kernel = blackman(width) kernel /= np.sum(kernel) return np.convolve(data,kern...
[ "numpy.sum", "scipy.signal.windows.blackman", "numpy.linalg.norm", "numpy.exp", "numpy.random.randint", "numpy.interp", "numpy.convolve", "psutil.process_iter", "numpy.zeros_like", "scipy.signal.convolve2d", "numpy.empty_like", "numpy.max", "numpy.linspace", "numpy.average", "numpy.asarr...
[((249, 264), 'scipy.signal.windows.blackman', 'blackman', (['width'], {}), '(width)\n', (257, 264), False, 'from scipy.signal.windows import blackman\n'), ((276, 290), 'numpy.sum', 'np.sum', (['kernel'], {}), '(kernel)\n', (282, 290), True, 'import numpy as np\n'), ((299, 337), 'numpy.convolve', 'np.convolve', (['data...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import abc from collections import OrderedDict import numpy as np class Region(metaclass=abc.ABCMeta): """ Base class for regions. Parameters ---------- rid : int or str region ID coordinate_frame : `~gwcs.coordinate_fra...
[ "numpy.asarray", "numpy.cross", "collections.OrderedDict.fromkeys", "numpy.sort", "numpy.diff" ]
[((2271, 2291), 'numpy.asarray', 'np.asarray', (['vertices'], {}), '(vertices)\n', (2281, 2291), True, 'import numpy as np\n'), ((3360, 3403), 'collections.OrderedDict.fromkeys', 'OrderedDict.fromkeys', (['self._scan_line_range'], {}), '(self._scan_line_range)\n', (3380, 3403), False, 'from collections import OrderedDi...
__author__ = 'marko' import numpy as np from random import randint from skimage.feature import hessian_matrix from skimage.morphology import disk from skimage.filters.rank import entropy from preprocess import Preprocess import cv2 class ImageSample(object): '''Image wrapper class that is used for samples extract...
[ "random.randint", "cv2.cvtColor", "numpy.zeros", "skimage.morphology.disk", "cv2.imread", "skimage.feature.hessian_matrix", "skimage.filters.rank.entropy" ]
[((602, 638), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_RGB2HSV'], {}), '(img, cv2.COLOR_RGB2HSV)\n', (614, 638), False, 'import cv2\n'), ((728, 765), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_RGB2GRAY'], {}), '(img, cv2.COLOR_RGB2GRAY)\n', (740, 765), False, 'import cv2\n'), ((852, 881), 'skimage.f...
# coding: utf-8 import os import cv2 import numpy as np from tqdm import tqdm import dlib from config import IMG_SIZE from models.mobile_net import MobileNetDeepEstimator from preprocessor import preprocess_input detector = dlib.get_frontal_face_detector() def preprocess(image_arr): data = preprocess_input(i...
[ "tqdm.tqdm", "models.mobile_net.MobileNetDeepEstimator", "cv2.cvtColor", "os.walk", "numpy.shape", "numpy.arange", "dlib.get_frontal_face_detector", "cv2.rectangle", "preprocessor.preprocess_input", "os.path.join", "cv2.resize" ]
[((229, 261), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (259, 261), False, 'import dlib\n'), ((302, 329), 'preprocessor.preprocess_input', 'preprocess_input', (['image_arr'], {}), '(image_arr)\n', (318, 329), False, 'from preprocessor import preprocess_input\n'), ((387, 423),...
import numpy as np from envs.mpe.core import World, Agent, Landmark from envs.mpe.scenario import BaseScenario class Scenario(BaseScenario): def make_world(self, args, now_agent_num=None): world = World() # set any world properties first world.dim_c = 3 num_landmarks = 3 wor...
[ "numpy.random.uniform", "envs.mpe.core.Agent", "numpy.square", "numpy.zeros", "envs.mpe.core.World", "numpy.array", "numpy.random.choice", "numpy.concatenate", "envs.mpe.core.Landmark" ]
[((210, 217), 'envs.mpe.core.World', 'World', ([], {}), '()\n', (215, 217), False, 'from envs.mpe.core import World, Agent, Landmark\n'), ((1488, 1521), 'numpy.random.choice', 'np.random.choice', (['world.landmarks'], {}), '(world.landmarks)\n', (1504, 1521), True, 'import numpy as np\n'), ((1755, 1783), 'numpy.array',...
import pandas as pd import seaborn as sn import numpy as np from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt ##read in the file file_name="train.csv" titanic=pd.read_csv(file_name,header=0,sep=",") ###split data X=titanic.drop("Survived",axis=1) y=titanic["Survived"] X_train,X_te...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "numpy.sum", "pandas.read_csv", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.suptitle", "pandas.get_dummies", "seaborn.barplot", "pandas.cut", "matplotlib.pyplot.figure", "seaborn.boxplot", "matplotlib.pyplot.ylabel", "ma...
[((196, 237), 'pandas.read_csv', 'pd.read_csv', (['file_name'], {'header': '(0)', 'sep': '""","""'}), "(file_name, header=0, sep=',')\n", (207, 237), True, 'import pandas as pd\n'), ((338, 392), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.2)', 'random_state': '(42)'}),...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "numpy.result_type", "numpy.asarray", "operator.methodcaller", "numpy.isnan", "collections.defaultdict", "numpy.array_repr", "operator.attrgetter", "six.moves.xrange", "itertools.chain", "os.getenv", "numpy.issubdtype" ]
[((13888, 13905), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (13899, 13905), False, 'from collections import namedtuple, defaultdict\n'), ((17633, 17654), 'operator.attrgetter', 'op.attrgetter', (['"""aval"""'], {}), "('aval')\n", (17646, 17654), True, 'import operator as op\n'), ((1478, 1516...
import os from collections import OrderedDict import torch from torch.utils.data import Sampler import numpy as np from experiment_logger import get_logger class FixedLengthBatchSampler(Sampler): def __init__(self, data_source, batch_size, include_partial=False, rng=None): self.data_source = data_sour...
[ "collections.OrderedDict", "experiment_logger.get_logger", "numpy.random.RandomState" ]
[((609, 621), 'experiment_logger.get_logger', 'get_logger', ([], {}), '()\n', (619, 621), False, 'from experiment_logger import get_logger\n'), ((711, 724), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (722, 724), False, 'from collections import OrderedDict\n'), ((393, 423), 'numpy.random.RandomState', '...
import numpy as np import logging import torch import torch.nn as nn import torch.nn.functional as F from torch import nn from torch.autograd import Variable import torch from crowd_nav.policy.cadrl import mlp, mlp2, conv_mlp2 from crowd_nav.policy.multi_human_rl import MultiHumanRL class AFAModule(nn.Module): d...
[ "torch.mean", "crowd_nav.policy.cadrl.conv_mlp2", "torch.eye", "torch.nn.Conv1d", "torch.cat", "torch.mul", "torch.nn.functional.softmax", "torch.exp", "numpy.random.random", "torch.cuda.is_available", "torch.Tensor", "torch.sum", "crowd_nav.policy.cadrl.mlp" ]
[((1830, 1890), 'torch.nn.Conv1d', 'nn.Conv1d', (['(hidden_dim + input_dim)', 'hidden_dim', '(1)'], {'bias': '(False)'}), '(hidden_dim + input_dim, hidden_dim, 1, bias=False)\n', (1839, 1890), False, 'from torch import nn\n'), ((1910, 1970), 'torch.nn.Conv1d', 'nn.Conv1d', (['(hidden_dim + input_dim)', 'hidden_dim', '(...
def calc_massive_common_envelope_evolution(primary_masses, black_hole_masses, companion_masses, semi_major_axes, eccentricities): import numpy ...
[ "calc_roche_lobe_radius_ratio_eggleton.calc_roche_lobe_radius_ratio_eggleton", "numpy.zeros_like", "numpy.where" ]
[((663, 695), 'numpy.zeros_like', 'numpy.zeros_like', (['eccentricities'], {}), '(eccentricities)\n', (679, 695), False, 'import numpy\n'), ((1644, 1676), 'numpy.zeros_like', 'numpy.zeros_like', (['eccentricities'], {}), '(eccentricities)\n', (1660, 1676), False, 'import numpy\n'), ((3270, 3311), 'numpy.where', 'numpy....
# # MIT License # # Copyright (c) 2018 WillQ # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
[ "numpy.random.uniform", "os.path.abspath", "pandas.Timestamp", "pandas.date_range", "os.path.dirname", "numpy.random.randint", "os.path.join" ]
[((1248, 1276), 'pandas.Timestamp', 'pandas.Timestamp', (['(2018)', '(1)', '(3)'], {}), '(2018, 1, 3)\n', (1264, 1276), False, 'import pandas\n'), ((1641, 1669), 'pandas.Timestamp', 'pandas.Timestamp', (['(2018)', '(1)', '(3)'], {}), '(2018, 1, 3)\n', (1657, 1669), False, 'import pandas\n'), ((3021, 3079), 'pandas.date...
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-unsafe import re from operator import attrgetter from unittest import TestCase import numpy as np import pandas as pd import statsmodel...
[ "numpy.random.seed", "numpy.sum", "kats.detectors.cusum_detection.CUSUMDetector", "numpy.logspace", "numpy.floor", "numpy.ones", "numpy.isnan", "numpy.sin", "numpy.arange", "numpy.random.normal", "numpy.zeros_like", "numpy.random.randn", "re.findall", "sklearn.datasets.make_spd_matrix", ...
[((5409, 5622), 'parameterized.parameterized.parameterized.expand', 'parameterized.expand', (["[['inc_change_points', 1], ['dec_change_points', 1], [\n 'season_inc_trend_change_points', 1], ['no_var_change_points', 1], [\n 'no_reg_change_points', 0], ['no_season_change_points', 0]]"], {}), "([['inc_change_points'...
__author__ = 'chenkovsky' import pandas as pd import numpy as np from . import knn from sklearn.neighbors import KDTree class TestRecommender: def setUp(self): data = {1: {1: 3.0, 2: 4.0, 3: 3.5, 4: 5.0, 5: 3.0}, 2: {1: 3.0, 2: 4.0, 3: 2.0, 4: 3.0, 5: 3.0, 6: 2.0}, 3: {2: 3.5, 3: 2.5, 4: ...
[ "pandas.DataFrame", "numpy.matrix", "sklearn.neighbors.KDTree", "numpy.nan_to_num" ]
[((562, 580), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (574, 580), True, 'import pandas as pd\n'), ((593, 606), 'numpy.matrix', 'np.matrix', (['df'], {}), '(df)\n', (602, 606), True, 'import numpy as np\n'), ((655, 671), 'numpy.nan_to_num', 'np.nan_to_num', (['m'], {}), '(m)\n', (668, 671), True,...
import os import numpy as np import shutil from vipy.globals import print from vipy.util import remkdir, imlist, filetail, istuple, islist, isnumpy, filebase, temphtml, isurl from vipy.image import Image from vipy.show import savefig from collections import defaultdict import time import PIL import vipy.video import we...
[ "vipy.util.filetail", "PIL.Image.new", "webbrowser.open", "os.path.exists", "vipy.util.temphtml", "vipy.util.isurl", "time.time", "pathlib.Path", "vipy.util.remkdir", "vipy.globals.print", "numpy.sqrt" ]
[((11536, 11551), 'vipy.util.remkdir', 'remkdir', (['outdir'], {}), '(outdir)\n', (11543, 11551), False, 'from vipy.util import remkdir, imlist, filetail, istuple, islist, isnumpy, filebase, temphtml, isurl\n'), ((13165, 13180), 'vipy.util.remkdir', 'remkdir', (['outdir'], {}), '(outdir)\n', (13172, 13180), False, 'fro...
from KernelMatrix import kernelmatrix import numpy as np def regularizedkernlstrain(xtr, ytr, kernel, sigma, lambd): ''' Input: xtr: training input ytr: training output kernel: type of kernel ('linear', 'polynomial', 'gaussian') lambd: regularization parameter Output: c: model wei...
[ "KernelMatrix.kernelmatrix", "numpy.identity" ]
[((543, 580), 'KernelMatrix.kernelmatrix', 'kernelmatrix', (['xtr', 'xtr', 'sigma', 'kernel'], {}), '(xtr, xtr, sigma, kernel)\n', (555, 580), False, 'from KernelMatrix import kernelmatrix\n'), ((627, 641), 'numpy.identity', 'np.identity', (['n'], {}), '(n)\n', (638, 641), True, 'import numpy as np\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- """ charm-cli.py: Simple command line interface for CHarm. """ import argparse import logging try: import matplotlib matplotlib.use('Agg') matplotlib.rc('font', **{'sans-serif': 'DejaVu Sans', 'serif': 'DejaVu Serif', ...
[ "matplotlib.rc", "LibCharm.IO.load_file", "argparse.ArgumentParser", "logging.FileHandler", "numpy.ma.where", "logging.StreamHandler", "logging.getLogger", "matplotlib.use", "numpy.array", "matplotlib.ticker.MultipleLocator", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((175, 196), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (189, 196), False, 'import matplotlib\n'), ((201, 308), 'matplotlib.rc', 'matplotlib.rc', (['"""font"""'], {}), "('font', **{'sans-serif': 'DejaVu Sans', 'serif':\n 'DejaVu Serif', 'family': 'sans-serif'})\n", (214, 308), False, 'imp...
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- import numpy as np from .config import cfg from ..nms.gpu_nms import gpu_nms f...
[ "numpy.where", "numpy.hstack" ]
[((1683, 1715), 'numpy.where', 'np.where', (['(dets[:, 4] > threshold)'], {}), '(dets[:, 4] > threshold)\n', (1691, 1715), True, 'import numpy as np\n'), ((1528, 1577), 'numpy.hstack', 'np.hstack', (['(cls_boxes, cls_scores[:, np.newaxis])'], {}), '((cls_boxes, cls_scores[:, np.newaxis]))\n', (1537, 1577), True, 'impor...
# -*- coding: utf-8 -*- """ Test mapsequence functionality """ from __future__ import absolute_import import numpy as np import astropy.units as u import sunpy import sunpy.map from sunpy.util.metadata import MetaDict import pytest import os import sunpy.data.test @pytest.fixture def aia_map(): """ Load SunP...
[ "numpy.zeros_like", "sunpy.map.Map", "numpy.ma.getdata", "numpy.logical_not", "pytest.fixture", "pytest.raises", "numpy.ma.masked_array", "numpy.ma.getmask", "os.path.join", "numpy.all" ]
[((1658, 1674), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1672, 1674), False, 'import pytest\n'), ((402, 447), 'os.path.join', 'os.path.join', (['testpath', '"""aia_171_level1.fits"""'], {}), "(testpath, 'aia_171_level1.fits')\n", (414, 447), False, 'import os\n'), ((459, 482), 'sunpy.map.Map', 'sunpy.map....
""" From http://stackoverflow.com/a/13504757 """ from scipy.interpolate import interp1d from scipy.interpolate._fitpack import _bspleval import numpy as np class fast_interpolation: def __init__(self, x, y, axis=-1): assert len(x) == y.shape[axis] self.x = x self.y = y self.axis =...
[ "scipy.interpolate._fitpack._bspleval", "scipy.interpolate.interp1d", "numpy.empty_like" ]
[((344, 397), 'scipy.interpolate.interp1d', 'interp1d', (['x', 'y'], {'axis': 'axis', 'kind': '"""slinear"""', 'copy': '(False)'}), "(x, y, axis=axis, kind='slinear', copy=False)\n", (352, 397), False, 'from scipy.interpolate import interp1d\n'), ((627, 695), 'scipy.interpolate.interp1d', 'interp1d', (['self.x', 'self....
"""Class definitions for Speakers, Files, Utterances and Jobs""" from __future__ import annotations import os import re import sys import traceback from collections import Counter from typing import ( TYPE_CHECKING, Any, ClassVar, Dict, Generator, List, Optional, Set, Tuple, Typ...
[ "montreal_forced_aligner.data.UtteranceData", "os.remove", "numpy.abs", "montreal_forced_aligner.data.CtmInterval", "praatio.utilities.constants.Interval", "montreal_forced_aligner.corpus.helper.get_wav_info", "numpy.isnan", "numpy.arange", "sys.exc_info", "os.path.join", "montreal_forced_aligne...
[((37938, 37976), 'typing.TypeVar', 'TypeVar', (['"""T"""', 'Speaker', 'File', 'Utterance'], {}), "('T', Speaker, File, Utterance)\n", (37945, 37976), False, 'from typing import TYPE_CHECKING, Any, ClassVar, Dict, Generator, List, Optional, Set, Tuple, TypeVar, Union\n'), ((5890, 5937), 're.compile', 're.compile', (['"...
import numpy as np import copy import pickle from functools import partial from rootpy.vector import LorentzVector from sklearn.preprocessing import RobustScaler import multiprocessing as mp # Data loading related def multithreadmap(f,X,ncores=20, **kwargs): """ multithreading map of a function, default on 20 cpu c...
[ "functools.partial", "copy.deepcopy", "numpy.arctan2", "numpy.abs", "numpy.log", "sklearn.preprocessing.RobustScaler", "numpy.zeros", "numpy.isfinite", "rootpy.vector.LorentzVector", "numpy.isclose", "pickle.load", "numpy.array", "numpy.where", "numpy.exp", "multiprocessing.Pool", "num...
[((339, 359), 'functools.partial', 'partial', (['f'], {}), '(f, **kwargs)\n', (346, 359), False, 'from functools import partial\n'), ((363, 378), 'multiprocessing.Pool', 'mp.Pool', (['ncores'], {}), '(ncores)\n', (370, 378), True, 'import multiprocessing as mp\n'), ((2131, 2149), 'numpy.arctan2', 'np.arctan2', (['py', ...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2020 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
[ "numpy.radians", "improver.utilities.spatial.lat_lon_determine", "numpy.zeros_like", "numpy.degrees", "numpy.arcsin", "numpy.ones", "datetime.datetime", "improver.utilities.spatial.transform_grid_to_lat_lon", "numpy.min", "numpy.sin", "numpy.max", "numpy.tan", "numpy.cos", "numpy.where", ...
[((5625, 5648), 'numpy.radians', 'np.radians', (['declination'], {}), '(declination)\n', (5635, 5648), True, 'import numpy as np\n'), ((5739, 5761), 'numpy.radians', 'np.radians', (['hour_angle'], {}), '(hour_angle)\n', (5749, 5761), True, 'import numpy as np\n'), ((5773, 5794), 'numpy.radians', 'np.radians', (['latitu...
'''Various extensions to distributions * skew normal and skew t distribution by Azzalini, A. & Capitanio, A. * Gram-Charlier expansion distribution (using 4 moments), * distributions based on non-linear transformation - Transf_gen - ExpTransf_gen, LogTransf_gen - TransfTwo_gen (defines as examples: square, n...
[ "numpy.abs", "scipy.stats.norm.rvs", "numpy.ones", "scipy.stats.chi2.rvs", "numpy.exp", "numpy.diag", "scipy.stats.describe", "numpy.isposinf", "numpy.atleast_2d", "scipy.factorial2", "numpy.power", "statsmodels.stats.moment_helpers.mc2mvsk", "scipy.stats.mvn.mvndst", "numpy.putmask", "s...
[((6955, 6964), 'numpy.poly1d', 'poly1d', (['(1)'], {}), '(1)\n', (6961, 6964), False, 'from numpy import poly1d, sqrt, exp\n'), ((7486, 7495), 'numpy.poly1d', 'poly1d', (['(1)'], {}), '(1)\n', (7492, 7495), False, 'from numpy import poly1d, sqrt, exp\n'), ((7506, 7518), 'numpy.sqrt', 'sqrt', (['cnt[1]'], {}), '(cnt[1]...
import numpy as np import chainer from sklearn.decomposition import PCA from sklearn.datasets import load_svmlight_file def make_data(datatype='mnist', seed=2018, pca_dim=100): print("data_name", datatype) x, t, doPCA = get_data(datatype) print("x_shape", x.shape) print("t_shape", t.shape) #if doP...
[ "numpy.concatenate", "numpy.mean", "numpy.loadtxt", "sklearn.datasets.load_svmlight_file", "chainer.datasets.get_mnist" ]
[((531, 574), 'sklearn.datasets.load_svmlight_file', 'load_svmlight_file', (['"""dataset/mushrooms.txt"""'], {}), "('dataset/mushrooms.txt')\n", (549, 574), False, 'from sklearn.datasets import load_svmlight_file\n'), ((713, 762), 'numpy.loadtxt', 'np.loadtxt', (['"""dataset/waveform.txt"""'], {'delimiter': '""","""'})...
# reference implementation of MNIST training import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision.datasets as datasets import torchvision.transforms as transforms from torch.utils.data import DataLoader, random_split from tqdm import tqdm #...
[ "numpy.random.seed", "argparse.ArgumentParser", "torch.utils.data.DataLoader", "random.seed", "torch.initial_seed", "torch.nn.Linear", "torch.nn.functional.max_pool2d", "tqdm.tqdm", "torch.manual_seed", "torch.nn.Conv2d", "torch.cuda.manual_seed", "torch.cuda.is_available", "torch.max", "t...
[((503, 530), 'numpy.random.seed', 'np.random.seed', (['worker_seed'], {}), '(worker_seed)\n', (517, 530), True, 'import numpy as np\n'), ((535, 559), 'random.seed', 'random.seed', (['worker_seed'], {}), '(worker_seed)\n', (546, 559), False, 'import random\n'), ((1748, 1827), 'argparse.ArgumentParser', 'argparse.Argume...
import io import logging import os from logging.handlers import RotatingFileHandler from pathlib import Path from time import sleep from typing import Dict, List, Optional, Union import numpy as np import pandas as pd import shopify from dotenv import load_dotenv from PIL import Image from pydantic import BaseSettings...
[ "myshopify.shopify.inventory.delete_variant", "numpy.nan_to_num", "shopify.Location.find_first", "myshopify.shopify.inventory.update_inventory", "pathlib.Path", "myshopify.shopify.inventory.update_product_metafield", "myshopify.shopify.inventory.update_product", "myshopify.shopify.inventory.add_metafi...
[((1196, 1219), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (1217, 1219), False, 'import logging\n'), ((1220, 1328), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'handlers': '[file_handler, stream_handler]', 'format': 'logging_format'}), '(level=logging.DEBUG, ha...
#%% Reproduce MovieLens Experiment of the paper import sys sys.path.append('../code') import pandas as pd import numpy as np import matplotlib.pyplot as plt from cot import cot_numpy from scipy.stats import mode #%% def cot_clustering(X, ns, nv, niter_cluster, niter, algo1='emd', algo2 = 'emd', reg1 = 0, reg2 = 0, ver...
[ "sys.path.append", "matplotlib.pyplot.title", "numpy.sum", "matplotlib.pyplot.show", "numpy.random.randn", "pandas.read_csv", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "cot.cot_numpy", "numpy.argsort", "matplotlib.pyplot.figure", "numpy.where", "matplotlib.pyplot.xticks", "ma...
[((60, 86), 'sys.path.append', 'sys.path.append', (['"""../code"""'], {}), "('../code')\n", (75, 86), False, 'import sys\n'), ((835, 953), 'pandas.read_csv', 'pd.read_csv', (['"""../data/ml-100k/u.data"""'], {'delimiter': '"""\t"""', 'header': 'None', 'names': "['user', 'item', 'rating', 'timestamp']"}), "('../data/ml-...
# import the necessary packages import time from datetime import datetime import cv2 import numpy import RPi.GPIO as GPIO import Iothub_client_functions as iot import picamera import io, sys import threading import cropdata1440 from picamera.array import PiRGBArray import picamera.array from PIL import Image from imut...
[ "threading.Timer", "cv2.bitwise_and", "cv2.medianBlur", "cv2.rectangle", "cv2.absdiff", "RPi.GPIO.output", "cv2.inRange", "cv2.contourArea", "cv2.cvtColor", "RPi.GPIO.setup", "Iothub_client_functions.iothub_client_init", "Iothub_client_functions.print_last_message_time", "io.open", "RPi.GP...
[((1514, 1536), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (1526, 1536), True, 'import RPi.GPIO as GPIO\n'), ((1541, 1564), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (1557, 1564), True, 'import RPi.GPIO as GPIO\n'), ((2027, 2082), 'cv2.imread', 'cv2.imread'...
import numpy as np import Box2D from Box2D.b2 import (edgeShape, circleShape, fixtureDef, polygonShape, revoluteJointDef, distanceJointDef, contactListener) import gym from gym import spaces from gym.utils import seeding """ The objective of this environment is to land a rocket on a ship. STATE...
[ "numpy.random.uniform", "gym.envs.classic_control.rendering.Transform", "Box2D.b2.polygonShape", "Box2D.b2.revoluteJointDef", "gym.spaces.Discrete", "Box2D.b2.contactListener.__init__", "numpy.clip", "Box2D.b2World", "gym.envs.classic_control.rendering.FilledPolygon", "Box2D.b2.distanceJointDef", ...
[((1989, 2076), 'numpy.array', 'np.array', (['[-0.034, -0.15, -0.016, 0.0024, 0.0024, 0.137, -0.02, -0.01, -0.8, 0.002]'], {}), '([-0.034, -0.15, -0.016, 0.0024, 0.0024, 0.137, -0.02, -0.01, -0.8,\n 0.002])\n', (1997, 2076), True, 'import numpy as np\n'), ((2105, 2190), 'numpy.array', 'np.array', (['[0.08, 0.33, 0.0...
from __future__ import division import numpy as np import scipy.stats as st import os from functools import reduce def mvlognorm(data, n=1000, seed=None, correlated=True): """Returns joint lognormal random variables. Inputs: data: (m, p) array of 'observations' where m is the number o...
[ "numpy.log", "scipy.stats.multivariate_normal.rvs", "scipy.stats.norm.rvs", "os.path.dirname", "numpy.linalg.eig", "numpy.append", "numpy.mean", "numpy.where", "numpy.loadtxt", "numpy.matmul", "numpy.eye", "numpy.cov", "numpy.var", "numpy.sqrt" ]
[((1139, 1160), 'numpy.mean', 'np.mean', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (1146, 1160), True, 'import numpy as np\n'), ((1173, 1193), 'numpy.var', 'np.var', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (1179, 1193), True, 'import numpy as np\n'), ((1530, 1550), 'numpy.linalg.eig', 'np.linalg.eig', (...
""" Tests for L{eliot._output}. """ from sys import stdout from unittest import TestCase, skipUnless # Make sure to use StringIO that only accepts unicode: from io import BytesIO, StringIO import json as pyjson from tempfile import mktemp from time import time from uuid import UUID from threading import Thread try: ...
[ "zope.interface.verify.verifyClass", "threading.Thread", "io.BytesIO", "io.StringIO", "numpy.uint64", "time.time", "unittest.skipUnless", "uuid.UUID", "numpy.int64", "tempfile.mktemp", "json.JSONEncoder.default" ]
[((3634, 3675), 'unittest.skipUnless', 'skipUnless', (['np', '"""NumPy is not installed."""'], {}), "(np, 'NumPy is not installed.')\n", (3644, 3675), False, 'from unittest import TestCase, skipUnless\n'), ((26224, 26265), 'unittest.skipUnless', 'skipUnless', (['np', '"""NumPy is not installed."""'], {}), "(np, 'NumPy ...
import pandas as pd import numpy as np import math from scipy.stats import nct from copy import deepcopy import matplotlib.pyplot as plt from ..estimators.stan_estimator import StanEstimatorMAP from ..exceptions import IllegalArgument, ModelException from ..utils.kernels import sandwich_kernel from ..utils.features im...
[ "pandas.DataFrame", "copy.deepcopy", "matplotlib.pyplot.show", "math.ceil", "matplotlib.pyplot.close", "pandas.infer_freq", "numpy.zeros", "numpy.isnan", "numpy.max", "numpy.where", "numpy.arange", "pandas.to_datetime", "numpy.timedelta64", "numpy.array", "numpy.squeeze", "matplotlib.p...
[((11047, 11103), 'numpy.zeros', 'np.zeros', (['(self.num_of_observations, 0)'], {'dtype': 'np.double'}), '((self.num_of_observations, 0), dtype=np.double)\n', (11055, 11103), True, 'import numpy as np\n'), ((13943, 13999), 'numpy.zeros', 'np.zeros', (['(self.num_of_observations, 0)'], {'dtype': 'np.double'}), '((self....
# Graph convolution layer test # requires Tensorflow 1.14.0, Keras 2.2.4 # import numpy as np import pandas as pd import keras.backend as K from keras.layers import Layer, Dense, Activation, LSTM from keras.layers.normalization import BatchNormalization from keras.models import Sequential class gconv_lstm(La...
[ "keras.backend.stack", "keras.backend.dot", "numpy.load", "keras.layers.Activation", "pandas.read_csv", "keras.layers.LSTM", "keras.layers.Dense", "keras.backend.transpose", "keras.backend.tf.multiply", "keras.models.Sequential", "keras.backend.tf.reduce_mean", "keras.backend.variable", "ker...
[((1443, 1466), 'numpy.load', 'np.load', (['"""inp_test.npy"""'], {}), "('inp_test.npy')\n", (1450, 1466), True, 'import numpy as np\n'), ((1476, 1499), 'numpy.load', 'np.load', (['"""out_test.npy"""'], {}), "('out_test.npy')\n", (1483, 1499), True, 'import numpy as np\n'), ((1540, 1585), 'pandas.read_csv', 'pd.read_cs...
""" Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. NVIDIA CORPORATION and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related docu...
[ "isaacgym.gymapi.CameraProperties", "yaml.safe_load", "isaacgym.gymapi.Quat", "torch.zeros", "matplotlib.pyplot.subplots", "isaacgym.gymapi.AssetOptions", "isaacgym.gymapi.Vec3", "isaacgym.gymapi.SimParams", "matplotlib.pyplot.show", "isaacgym.gymapi.acquire_gym", "torch.norm", "time.sleep", ...
[((1363, 1383), 'isaacgym.gymapi.acquire_gym', 'gymapi.acquire_gym', ([], {}), '()\n', (1381, 1383), False, 'from isaacgym import gymapi\n'), ((1410, 1478), 'isaacgym.gymutil.parse_arguments', 'gymutil.parse_arguments', ([], {'description': '"""Joint control Methods Example"""'}), "(description='Joint control Methods E...
import warnings from copy import copy import numpy as np import pandas as pd import scipy from pandas.core.common import SettingWithCopyWarning from scipy.sparse import csr_matrix from scipy.stats import hmean, fisher_exact, rankdata, norm from sklearn.feature_extraction.text import TfidfTransformer from sklearn.linea...
[ "numpy.isin", "scattertext.CSRMatrixTools.CSRMatrixFactory", "scattertext.TermDocMatrixWithoutCategories.TermDocMatrixWithoutCategories.__init__", "pandas.DataFrame", "warnings.simplefilter", "sklearn.linear_model.ElasticNet", "scipy.stats.rankdata", "scattertext.termscoring.ScaledFScore.ScaledFScore....
[((872, 943), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'SettingWithCopyWarning'}), "(action='ignore', category=SettingWithCopyWarning)\n", (893, 943), False, 'import warnings\n'), ((2288, 2471), 'scattertext.TermDocMatrixWithoutCategories.TermDocMatrixWithoutCategori...
import numpy as np import pytest from jina import Document, DocumentArray, Flow, Executor, Client, requests exposed_port = 12345 class ShardsExecutor(Executor): def __init__(self, n_docs: int = 5, **kwargs): super().__init__(**kwargs) self.n_docs = n_docs @requests(on='/search') def sea...
[ "jina.Client", "jina.requests", "numpy.zeros", "jina.Flow", "jina.Document", "pytest.mark.parametrize" ]
[((1332, 1373), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n_docs"""', '[3, 5]'], {}), "('n_docs', [3, 5])\n", (1355, 1373), False, 'import pytest\n'), ((2580, 2623), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n_shards"""', '[3, 5]'], {}), "('n_shards', [3, 5])\n", (2603, 2623), False,...
# This code is supporting material for the book # Building Machine Learning Systems with Python # by <NAME> and <NAME> # published by PACKT Publishing # # It is made available under the MIT License import os from matplotlib import pylab import numpy as np import scipy from scipy.stats import norm, pearsonr from util...
[ "matplotlib.pylab.autoscale", "scipy.polyfit", "matplotlib.pylab.scatter", "numpy.random.seed", "matplotlib.pylab.subplot", "os.path.join", "matplotlib.pylab.title", "matplotlib.pylab.clf", "scipy.stats.pearsonr", "numpy.arange", "matplotlib.pylab.xlabel", "matplotlib.pylab.ylabel", "matplot...
[((387, 401), 'scipy.stats.pearsonr', 'pearsonr', (['x', 'y'], {}), '(x, y)\n', (395, 401), False, 'from scipy.stats import norm, pearsonr\n'), ((449, 468), 'matplotlib.pylab.scatter', 'pylab.scatter', (['x', 'y'], {}), '(x, y)\n', (462, 468), False, 'from matplotlib import pylab\n'), ((473, 491), 'matplotlib.pylab.tit...
""" Showcases *Prismatic* colourspace computations. """ import numpy as np import colour from colour.utilities import message_box message_box('"Prismatic" Colourspace Computations') RGB = np.array([0.25, 0.50, 0.75]) message_box( f'Converting from the "RGB" colourspace to the "Prismatic" colourspace ' f'giv...
[ "colour.Prismatic_to_RGB", "colour.utilities.message_box", "numpy.array", "colour.RGB_to_Prismatic" ]
[((133, 184), 'colour.utilities.message_box', 'message_box', (['""""Prismatic" Colourspace Computations"""'], {}), '(\'"Prismatic" Colourspace Computations\')\n', (144, 184), False, 'from colour.utilities import message_box\n'), ((192, 219), 'numpy.array', 'np.array', (['[0.25, 0.5, 0.75]'], {}), '([0.25, 0.5, 0.75])\n...
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import pandas as pd import numpy as np import os from sklearn.model_selection import train_test_split as tts from matplotlib import pyplot as plt from zipfile import ZipFile import gensim from gensim.models import...
[ "torch.relu", "pandas.read_csv", "sklearn.model_selection.train_test_split", "torch.std", "numpy.arange", "torch.no_grad", "os.chdir", "torch.utils.data.DataLoader", "torch.Tensor", "torch.nn.Linear", "sklearn.svm.LinearSVC", "torch.mean", "torch.nn.Conv2d", "torch.max", "torch.min", "...
[((5302, 5323), 'os.chdir', 'os.chdir', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (5310, 5323), False, 'import os\n'), ((5335, 5347), 'os.listdir', 'os.listdir', ([], {}), '()\n', (5345, 5347), False, 'import os\n'), ((5445, 5460), 'os.chdir', 'os.chdir', (['"""../"""'], {}), "('../')\n", (5453, 5460), False, 'import o...
import torch.nn as nn import torch.nn.functional as F import torch from torch.autograd import Function from torch.nn import BCELoss, MSELoss, CrossEntropyLoss import numpy as np from torch.autograd import Variable def make_one_hot(labels, classes): if len(labels.size()) == 4: one_hot = torch.cuda.FloatTen...
[ "torch.nn.functional.sigmoid", "torch.ones", "torch.nn.MSELoss", "torch.gather", "torch.nn.BCELoss", "torch.FloatTensor", "torch.exp", "numpy.reshape", "torch.nn.functional.log_softmax", "torch.log", "torch.mean", "torch.autograd.Variable", "torch.nn.KLDivLoss", "numpy.log2", "numpy.asar...
[((771, 783), 'torch.nn.BCELoss', 'nn.BCELoss', ([], {}), '()\n', (781, 783), True, 'import torch.nn as nn\n'), ((1241, 1258), 'torch.nn.functional.sigmoid', 'F.sigmoid', (['logits'], {}), '(logits)\n', (1250, 1258), True, 'import torch.nn.functional as F\n'), ((3145, 3159), 'torch.nn.Softmax2d', 'nn.Softmax2d', ([], {...
import cv2 import numpy as np import os, csv def get_label_info(csv_path): """ Retrieve the class names and label values for the selected dataset. Must be in CSV format! # Arguments csv_path: The file path of the class dictionairy # Returns Two lists: one for the class nam...
[ "numpy.stack", "csv.reader", "numpy.argmax", "numpy.equal", "numpy.array", "os.path.splitext", "numpy.all" ]
[((397, 423), 'os.path.splitext', 'os.path.splitext', (['csv_path'], {}), '(csv_path)\n', (413, 423), False, 'import os, csv\n'), ((1757, 1788), 'numpy.stack', 'np.stack', (['semantic_map'], {'axis': '(-1)'}), '(semantic_map, axis=-1)\n', (1765, 1788), True, 'import numpy as np\n'), ((2276, 2301), 'numpy.argmax', 'np.a...
from DataSpace import DataSpace import numpy as np from scipy.spatial.distance import euclidean, cosine class Distance_Datas(DataSpace): """ Измерение внутреннего пространства данных (выбор типа) Вычисление расстояния по типу между своими данными и внешними данными data: данные checked_data : ...
[ "scipy.spatial.distance.cosine", "numpy.random.random", "numpy.random.binomial", "scipy.spatial.distance.euclidean" ]
[((2523, 2553), 'numpy.random.random', 'np.random.random', ([], {'size': '(10, 7)'}), '(size=(10, 7))\n', (2539, 2553), True, 'import numpy as np\n'), ((2569, 2609), 'numpy.random.binomial', 'np.random.binomial', (['(2)', '(0.7)'], {'size': '(20, 7)'}), '(2, 0.7, size=(20, 7))\n', (2587, 2609), True, 'import numpy as n...
# sys.path.append("../src/") import sys sys.path.append("../src/") # from post_processing import compute_sig, local_project import site import sys import pandas as pd import sys import matplotlib.pyplot as plt import matplotlib matplotlib.use('Agg') import mshr import dolfin from dolfin import MPI import os import s...
[ "yaml.load", "dolfin.MeshFunction", "dolfin.CompiledSubDomain", "yaml.dump", "dolfin.cpp.log.log", "dolfin.DirichletBC", "dolfin.Constant", "mshr.generate_mesh", "matplotlib.pyplot.figure", "pathlib.Path", "solver_stability.StabilitySolver", "matplotlib.pyplot.gca", "os.path.join", "dolfin...
[((40, 66), 'sys.path.append', 'sys.path.append', (['"""../src/"""'], {}), "('../src/')\n", (55, 66), False, 'import sys\n'), ((230, 251), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (244, 251), False, 'import matplotlib\n'), ((432, 455), 'petsc4py.init', 'petsc4py.init', (['sys.argv'], {}), '...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from scipy import stats def ecdf(data): """Compute ECDF for a one-dimensional array of measurements.""" # Number of data points: n n = len(data) # x-data for the ECDF: x x = np.sort(data) # y-data fo...
[ "matplotlib.pyplot.plot", "scipy.stats.normaltest", "numpy.std", "matplotlib.pyplot.legend", "numpy.sort", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "seaborn.set" ]
[((414, 440), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 7)'}), '(figsize=(8, 7))\n', (424, 440), True, 'import matplotlib.pyplot as plt\n'), ((440, 449), 'seaborn.set', 'sns.set', ([], {}), '()\n', (447, 449), True, 'import seaborn as sns\n'), ((450, 494), 'matplotlib.pyplot.plot', 'plt.plot', (['...
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2020 # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivati...
[ "warnings.warn", "logging.getLogger", "numpy.sqrt" ]
[((942, 969), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (959, 969), False, 'import logging\n'), ((1693, 1998), 'warnings.warn', 'warnings.warn', (['"""The ChemistryOperator is deprecated as of Qiskit Aqua 0.8.0 and will be removed no earlier than 3 months after the release date. Inst...
import numpy as np from pandas.compat import reduce from pandas.core.dtypes.common import is_list_like from pandas.core import common as com def cartesian_product(X): """ Numpy version of itertools.product or pandas.compat.product. Sometimes faster (for large inputs)... Parameters ---------- ...
[ "numpy.zeros_like", "pandas.core.common.values_from_object", "numpy.roll", "pandas.core.dtypes.common.is_list_like", "numpy.cumproduct", "numpy.product", "pandas.compat.reduce" ]
[((1073, 1092), 'numpy.cumproduct', 'np.cumproduct', (['lenX'], {}), '(lenX)\n', (1086, 1092), True, 'import numpy as np\n'), ((1102, 1122), 'numpy.roll', 'np.roll', (['cumprodX', '(1)'], {}), '(cumprodX, 1)\n', (1109, 1122), True, 'import numpy as np\n'), ((1721, 1745), 'pandas.compat.reduce', 'reduce', (['_compose2',...
import numpy as np from tensorflow import keras def is_numpy(obj): """ Check of the type is instance of numpy array :param obj: object to check :return: True if the object is numpy-type array. """ return isinstance(obj, (np.ndarray, np.generic)) def ensure_numpy_type(obj): """ Raise ...
[ "numpy.abs", "torch.FloatTensor", "numpy.transpose", "tensorflow.constant", "numpy.array", "numpy.int32", "tensorflow.keras.layers.Lambda" ]
[((1153, 1197), 'tensorflow.keras.layers.Lambda', 'keras.layers.Lambda', (['target_layer'], {'name': 'name'}), '(target_layer, name=name)\n', (1172, 1197), False, 'from tensorflow import keras\n'), ((823, 836), 'numpy.int32', 'np.int32', (['obj'], {}), '(obj)\n', (831, 836), True, 'import numpy as np\n'), ((1095, 1128)...
# -*- coding: utf-8 -*- # # Copyright (c) 2015 Cisco Systems, Inc. and others. 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...
[ "tensorflow.contrib.layers.xavier_initializer", "sklearn.preprocessing.LabelBinarizer", "numpy.argmax", "tensorflow.constant_initializer", "tensorflow.reshape", "tensorflow.local_variables_initializer", "tensorflow.nn.pool", "tensorflow.matmul", "tensorflow.nn.bidirectional_dynamic_rnn", "tensorfl...
[((1173, 1200), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1190, 1200), False, 'import logging\n'), ((1456, 1486), 'numpy.asarray', 'np.asarray', (['X'], {'dtype': '"""float32"""'}), "(X, dtype='float32')\n", (1466, 1486), True, 'import numpy as np\n'), ((1508, 1536), 'numpy.asarray'...
"""This holds a routine for restricting the current process memory on Windows.""" import multiprocessing import ctypes def set_memory_limit(memory_limit): """Creates a new unnamed job object and assigns the current process to it. The job object will have the given memory limit in bytes: the given process ...
[ "os.getpid", "ctypes.sizeof", "numpy.zeros", "multiprocessing.Process", "ctypes.POINTER" ]
[((645, 656), 'os.getpid', 'os.getpid', ([], {}), '()\n', (654, 656), False, 'import os\n'), ((4667, 4745), 'multiprocessing.Process', 'multiprocessing.Process', ([], {'target': 'runner', 'args': '(thunk, memory_limit, test_bytes)'}), '(target=runner, args=(thunk, memory_limit, test_bytes))\n', (4690, 4745), False, 'im...
''' .. module:: skrf.media.distributedCircuit ============================================================ distributedCircuit (:mod:`skrf.media.distributedCircuit`) ============================================================ A transmission line mode defined in terms of distributed impedance and admittance values. ...
[ "numpy.imag", "numpy.real", "numpy.sqrt" ]
[((7107, 7128), 'numpy.sqrt', 'sqrt', (['(self.Z / self.Y)'], {}), '(self.Z / self.Y)\n', (7111, 7128), False, 'from numpy import sqrt, exp, array, tan, sin, cos, inf, log, real, imag, interp, linspace, shape, zeros, reshape\n'), ((7642, 7663), 'numpy.sqrt', 'sqrt', (['(self.Z * self.Y)'], {}), '(self.Z * self.Y)\n', (...
import numpy as np from sklearn.metrics import roc_auc_score as roc_auc from cases.data.data_utils import get_scoring_case_data_paths from fedot.core.data.data import InputData from fedot.core.pipelines.node import PrimaryNode, SecondaryNode from fedot.core.pipelines.pipeline import Pipeline from fedot.core.pipelines....
[ "fedot.core.data.data.InputData.from_csv", "fedot.core.pipelines.pipeline.Pipeline", "cases.data.data_utils.get_scoring_case_data_paths", "sklearn.metrics.roc_auc_score", "numpy.mean", "fedot.core.pipelines.node.SecondaryNode", "fedot.core.pipelines.tuning.unified.PipelineTuner", "fedot.core.pipelines...
[((491, 520), 'cases.data.data_utils.get_scoring_case_data_paths', 'get_scoring_case_data_paths', ([], {}), '()\n', (518, 520), False, 'from cases.data.data_utils import get_scoring_case_data_paths\n'), ((539, 574), 'fedot.core.data.data.InputData.from_csv', 'InputData.from_csv', (['train_file_path'], {}), '(train_file...
import collections import numpy as np import sys import grammar def format_table(table, sep=' '): num_cols = len(table[0]) if any([len(row) != num_cols for row in table]): raise RuntimeError('Number of columns must match.') widths = [max([len(row[i]) for row in table]) for i in ...
[ "collections.defaultdict", "numpy.isscalar", "grammar.pretty_print" ]
[((5127, 5156), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (5150, 5156), False, 'import collections\n'), ((5240, 5259), 'numpy.isscalar', 'np.isscalar', (['item.z'], {}), '(item.z)\n', (5251, 5259), True, 'import numpy as np\n'), ((5915, 5946), 'grammar.pretty_print', 'grammar.pre...
import pandas as pd import numpy as np #time:2020年7月30日 #author:ZhangChang #function description:函数描述 #处理CMU数据集,生产一次事件的数据 #user 是用户名,line_start #fileName是数据文件名 #测试用例 ''' fileName = "./data/DSL-StrongPasswordData.xls" keystroke_data,end_time = make_estimate_data('s002',0,fileName) print (keystroke_data...
[ "pandas.read_excel", "numpy.concatenate" ]
[((418, 451), 'pandas.read_excel', 'pd.read_excel', (['fileName'], {'header': '(0)'}), '(fileName, header=0)\n', (431, 451), True, 'import pandas as pd\n'), ((956, 989), 'numpy.concatenate', 'np.concatenate', (['data_instance_all'], {}), '(data_instance_all)\n', (970, 989), True, 'import numpy as np\n'), ((1053, 1086),...
import glob import numpy as np import config import os # find files in the raw directory files = glob.glob("raw/raw*") os.system("rm output/*") # number of arguments to expect per line kargs = 14 ksensors = 12 # buffer for duplicate timestamps buf_value = 100000 # take raw data files and convert to a dictionary o...
[ "numpy.array", "os.system", "glob.glob" ]
[((98, 119), 'glob.glob', 'glob.glob', (['"""raw/raw*"""'], {}), "('raw/raw*')\n", (107, 119), False, 'import glob\n'), ((121, 145), 'os.system', 'os.system', (['"""rm output/*"""'], {}), "('rm output/*')\n", (130, 145), False, 'import os\n'), ((2705, 2725), 'numpy.array', 'np.array', (['([0] * krow)'], {}), '([0] * kr...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Convert an osc file to multiple csv files. Accepts file.osc with contents: ____________________________________________________________________________________________________ osc_time |path |types |packets ...
[ "argparse.ArgumentParser", "os.makedirs", "os.path.isdir", "collections.defaultdict", "numpy.array", "os.path.join" ]
[((1067, 1165), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Convert an osc file to multiple csv files."""', 'epilog': 'eaxmple_usage'}), "(description='Convert an osc file to multiple csv files.',\n epilog=eaxmple_usage)\n", (1081, 1165), False, 'from argparse import ArgumentParser\n'), ((1...
#!/usr/bin/env python import pyflann_ibeis import numpy as np from numpy import ones from numpy.random import rand import pytest import unittest class Test_PyFLANN_nn(unittest.TestCase): def setUp(self): self.nn = pyflann_ibeis.FLANN() class Test_PyFLANN_nn_index(unittest.TestCase): def testnn_ind...
[ "unittest.main", "pyflann_ibeis.FLANN", "numpy.ones", "pytest.raises", "numpy.arange", "numpy.random.permutation", "numpy.random.rand", "pytest.mark.skip" ]
[((1541, 1574), 'pytest.mark.skip', 'pytest.mark.skip', (['"""not debugging"""'], {}), "('not debugging')\n", (1557, 1574), False, 'import pytest\n'), ((1860, 1893), 'pytest.mark.skip', 'pytest.mark.skip', (['"""not debugging"""'], {}), "('not debugging')\n", (1876, 1893), False, 'import pytest\n'), ((2362, 2377), 'uni...
""" Created on Jan 29, 2018 @author: Brian The purpose of this code is to learn basic plotting using MatPlotLib and Numpy. This code also addresses related topics, like making 1D Numpy arrays, saving plots as image files, deleting files, and making a polynomial regression. """ import matplotlib.pyplot as plt # imp...
[ "matplotlib.pyplot.loglog", "os.remove", "numpy.polyfit", "numpy.logspace", "matplotlib.pyplot.figure", "numpy.polyval", "matplotlib.pyplot.close", "numpy.linspace", "matplotlib.pyplot.semilogy", "matplotlib.pyplot.subplots", "os.startfile", "matplotlib.pyplot.ylim", "numpy.corrcoef", "mat...
[((541, 581), 'numpy.array', 'np.array', (['[12.5, 25, 37.5, 50, 62.5, 75]'], {}), '([12.5, 25, 37.5, 50, 62.5, 75])\n', (549, 581), True, 'import numpy as np\n'), ((600, 638), 'numpy.array', 'np.array', (['[20, 59, 118, 197, 299, 420]'], {}), '([20, 59, 118, 197, 299, 420])\n', (608, 638), True, 'import numpy as np\n'...
import numpy as np ecoli_m_b = np.array([[0.1, 0.15, 0.19, 0.5, # Matraz 250 mL 0.9, 1.4, 1.8, 2.1, 2.3], [0.1, 0.17, 0.2, 0.53, # Biorreactor 50 L 0.97, 1.43, 1.8, 2.1, 2.8], [0.1, 0.17, 0.2, 0.52, # B. alimentado 50 L ...
[ "numpy.array" ]
[((31, 201), 'numpy.array', 'np.array', (['[[0.1, 0.15, 0.19, 0.5, 0.9, 1.4, 1.8, 2.1, 2.3], [0.1, 0.17, 0.2, 0.53, \n 0.97, 1.43, 1.8, 2.1, 2.8], [0.1, 0.17, 0.2, 0.52, 0.95, 1.41, 1.8, 2.2,\n 2.8]]'], {}), '([[0.1, 0.15, 0.19, 0.5, 0.9, 1.4, 1.8, 2.1, 2.3], [0.1, 0.17, 0.2,\n 0.53, 0.97, 1.43, 1.8, 2.1, 2.8]...
import numpy as np from rasterio import ( ubyte, uint8, uint16, uint32, int16, int32, float32, float64) from rasterio.dtypes import ( _gdal_typename, is_ndarray, check_dtype, get_minimum_dtype, can_cast_dtype, validate_dtype ) def test_is_ndarray(): assert is_ndarray(np.zeros((1,))) assert is_nda...
[ "rasterio.dtypes.can_cast_dtype", "rasterio.dtypes._gdal_typename", "rasterio.dtypes.check_dtype", "numpy.zeros", "rasterio.dtypes.is_ndarray", "numpy.array", "rasterio.dtypes.get_minimum_dtype", "rasterio.dtypes.validate_dtype" ]
[((413, 434), 'rasterio.dtypes.check_dtype', 'check_dtype', (['np.uint8'], {}), '(np.uint8)\n', (424, 434), False, 'from rasterio.dtypes import _gdal_typename, is_ndarray, check_dtype, get_minimum_dtype, can_cast_dtype, validate_dtype\n'), ((469, 487), 'rasterio.dtypes.check_dtype', 'check_dtype', (['ubyte'], {}), '(ub...
# -*- coding:utf8 -*- # ============================================================================== # Copyright 2017 Baidu.com, Inc. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of th...
[ "numpy.zeros" ]
[((4618, 4644), 'numpy.zeros', 'np.zeros', (['[self.embed_dim]'], {}), '([self.embed_dim])\n', (4626, 4644), True, 'import numpy as np\n')]
"""Main game script for real-life fruit ninja.""" from ninja import Ninja import numpy as np import cv2 def main(): game = Ninja(420, 640) cap = cv2.VideoCapture(0) # setup optical flow _, frame1 = cap.read() frame1 = cv2.resize(frame1, (640, 360)) prvs = cv2.cvtColor(frame1, cv2.COLOR_BGR2G...
[ "numpy.zeros_like", "cv2.cartToPolar", "ninja.Ninja", "cv2.cvtColor", "cv2.waitKey", "cv2.VideoCapture", "cv2.calcOpticalFlowFarneback", "cv2.normalize", "cv2.imshow", "cv2.resize" ]
[((130, 145), 'ninja.Ninja', 'Ninja', (['(420)', '(640)'], {}), '(420, 640)\n', (135, 145), False, 'from ninja import Ninja\n'), ((156, 175), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (172, 175), False, 'import cv2\n'), ((242, 272), 'cv2.resize', 'cv2.resize', (['frame1', '(640, 360)'], {}), '(fra...
import logging # from random import randint, seed, getstate, setstate import random import numpy as np from scipy import optimize from copulas import EPSILON from copulas.bivariate.base import Bivariate, CopulaTypes from copulas.multivariate.base import Multivariate from copulas.multivariate.tree import Tree from cop...
[ "numpy.random.uniform", "copulas.bivariate.base.CopulaTypes", "numpy.sum", "numpy.random.seed", "random.randint", "numpy.random.get_state", "numpy.empty", "numpy.zeros", "logging.getLogger", "numpy.where", "scipy.optimize.fminbound", "random.setstate", "random.getstate", "copulas.multivari...
[((371, 398), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (388, 398), False, 'import logging\n'), ((1118, 1155), 'numpy.empty', 'np.empty', (['[self.n_sample, self.n_var]'], {}), '([self.n_sample, self.n_var])\n', (1126, 1155), True, 'import numpy as np\n'), ((1690, 1705), 'copulas.mul...
# import external modules import numpy, os # Add Exasim to Python search path cdir = os.getcwd(); ii = cdir.find("Exasim"); exec(open(cdir[0:(ii+6)] + "/Installation/setpath.py").read()); # import internal modules import Preprocessing, Postprocessing, Gencode, Mesh # Create pde object and mesh object pde,mesh = Prep...
[ "os.getcwd", "Preprocessing.initializeexasim", "Postprocessing.exasim", "numpy.array", "Mesh.SquareMesh", "Postprocessing.vis" ]
[((86, 97), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (95, 97), False, 'import numpy, os\n'), ((316, 348), 'Preprocessing.initializeexasim', 'Preprocessing.initializeexasim', ([], {}), '()\n', (346, 348), False, 'import Preprocessing, Postprocessing, Gencode, Mesh\n'), ((881, 899), 'numpy.array', 'numpy.array', (['[1...
""" IMGO - Process, augment, and balance image data. ------------------------------------------------ UPTOOLS module Classes ------- Image_Dataset: Class representing an image dataset, being a collection of X (square image data) and y (label data) arrays. Class Attributes: base_path (str): path to the dir...
[ "os.mkdir", "numpy.load", "numpy.abs", "numpy.sum", "numpy.argmax", "sklearn.model_selection.train_test_split", "os.walk", "numpy.clip", "matplotlib.pyplot.figure", "numpy.arange", "numpy.round", "os.path.join", "numpy.unique", "pandas.DataFrame", "os.path.exists", "numpy.divmod", "n...
[((5871, 5889), 'os.walk', 'os.walk', (['base_path'], {}), '(base_path)\n', (5878, 5889), False, 'import os\n'), ((9361, 9379), 'numpy.array', 'np.array', (['img_list'], {}), '(img_list)\n', (9369, 9379), True, 'import numpy as np\n'), ((9398, 9418), 'numpy.array', 'np.array', (['label_list'], {}), '(label_list)\n', (9...
from couplib.myreportservice import * from couplib.constants import * from configuration import * from math import * import numpy as np #------------------------------------------------------------------------------- class AtomInterface(): """Interface class for the ionfromation about atoms (primarely read from PDB f...
[ "numpy.asarray" ]
[((1870, 1906), 'numpy.asarray', 'np.asarray', (['[self.x, self.y, self.z]'], {}), '([self.x, self.y, self.z])\n', (1880, 1906), True, 'import numpy as np\n')]
import datajoint as dj import numpy as np from . import get_schema_name schema = dj.schema(get_schema_name('lab')) @schema class Person(dj.Manual): definition = """ username : varchar(24) ---- fullname : varchar(255) """ @schema class Rig(dj.Manual): definition = """ rig : ...
[ "numpy.arange", "numpy.tile" ]
[((7464, 7504), 'numpy.tile', 'np.tile', (['[0, 0 + col_spacing]', 'row_count'], {}), '([0, 0 + col_spacing], row_count)\n', (7471, 7504), True, 'import numpy as np\n'), ((7748, 7774), 'numpy.tile', 'np.tile', (['[0, 1]', 'row_count'], {}), '([0, 1], row_count)\n', (7755, 7774), True, 'import numpy as np\n'), ((7683, 7...