code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# -*- coding: utf-8 -*- import os import tensorflow as tf import os import pathlib import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import glob, os import random import math import sys from sklearn.neighbors import NearestNeighbors from sklearn.metrics import confusion_matrix import...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.bar", "tensorflow.reshape", "tensorflow.train.AdamOptimizer", "matplotlib.pyplot.figure", "numpy.random.randint", "numpy.arange", "tensorflow.layers.max_pooling2d", "glob.glob", "matplotlib.pyplot.tight_layout", "os.path.join", "yellowbrick.style.p...
[((3500, 3519), 'numpy.array', 'np.array', (['train_set'], {}), '(train_set)\n', (3508, 3519), True, 'import numpy as np\n'), ((3535, 3557), 'numpy.array', 'np.array', (['template_set'], {}), '(template_set)\n', (3543, 3557), True, 'import numpy as np\n'), ((3569, 3587), 'numpy.array', 'np.array', (['test_set'], {}), '...
r""" Functions for the infinite sheds bifacial irradiance model. """ import numpy as np import pandas as pd from pvlib.tools import cosd, sind, tand from pvlib.bifacial import utils from pvlib.shading import masking_angle from pvlib.irradiance import beam_component, aoi def _vf_ground_sky_integ(surface_tilt, surface...
[ "numpy.arctan2", "numpy.clip", "pandas.DataFrame", "pvlib.irradiance.aoi", "pvlib.bifacial.utils._unshaded_ground_fraction", "numpy.linspace", "pvlib.shading.masking_angle", "pandas.concat", "pvlib.tools.tand", "numpy.trapz", "pvlib.irradiance.beam_component", "pvlib.bifacial.utils._vf_ground_...
[((2206, 2232), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'npoints'], {}), '(0, 1, npoints)\n', (2217, 2232), True, 'import numpy as np\n'), ((2248, 2275), 'numpy.atleast_1d', 'np.atleast_1d', (['surface_tilt'], {}), '(surface_tilt)\n', (2261, 2275), True, 'import numpy as np\n'), ((2552, 2579), 'numpy.trapz', '...
import sys import torch import random import numpy as np import progressbar from dataclass_utlis import load_response_id_dict, load_context_data, load_dev_data, process_text UNK, PAD = '[UNK]', '[PAD]' # pad_context(batch_context_id_list, padding_idx) import pickle def load_pickle_file(in_f): with open(in_f, 'rb')...
[ "dataclass_utlis.load_context_data", "torch.topk", "dataclass_utlis.process_text", "random.sample", "dataclass_utlis.load_dev_data", "torch.FloatTensor", "pickle.load", "numpy.array", "torch.Size", "torch.unsqueeze", "torch.matmul", "torch.sum" ]
[((343, 357), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (354, 357), False, 'import pickle\n'), ((2121, 2216), 'dataclass_utlis.load_context_data', 'load_context_data', (['train_context_path', 'self.max_uttr_num', 'self.max_uttr_len', 'self.tokenizer'], {}), '(train_context_path, self.max_uttr_num, self.max_ut...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """The CG algorithm for image reconstruction.""" import numpy as np import time class CGReco: """ Conjugate Gradient Optimization. This class performs conjugate gradient based optimization given some data and a operator derived from linop.Operator. The o...
[ "numpy.fft.ifftshift", "numpy.meshgrid", "numpy.abs", "numpy.ceil", "numpy.floor", "numpy.zeros", "time.perf_counter", "numpy.isfinite", "numpy.vdot", "numpy.mod", "numpy.linalg.norm", "numpy.sqrt" ]
[((4877, 4906), 'numpy.meshgrid', 'np.meshgrid', (['kpoints', 'kpoints'], {}), '(kpoints, kpoints)\n', (4888, 4906), True, 'import numpy as np\n'), ((4926, 4952), 'numpy.sqrt', 'np.sqrt', (['(xx ** 2 + yy ** 2)'], {}), '(xx ** 2 + yy ** 2)\n', (4933, 4952), True, 'import numpy as np\n'), ((5133, 5236), 'numpy.zeros', '...
import numpy as np import matplotlib.pyplot as plt MAX_ITERS = 1000 DOUBLE_PRECISION_THRESHOLD = 1e-15 SINGLE_PRECISION_THRESHOLD = 1e-8 def newton_raphson(x_0, f, df): x = np.copy(x_0) # xs = [x_0] for i in range(MAX_ITERS): x_last = x try: x = x_last - np.dot(np.linalg.inv(df(...
[ "numpy.zeros_like", "numpy.linalg.norm", "numpy.copy" ]
[((179, 191), 'numpy.copy', 'np.copy', (['x_0'], {}), '(x_0)\n', (186, 191), True, 'import numpy as np\n'), ((1144, 1156), 'numpy.copy', 'np.copy', (['x_0'], {}), '(x_0)\n', (1151, 1156), True, 'import numpy as np\n'), ((434, 451), 'numpy.linalg.norm', 'np.linalg.norm', (['x'], {}), '(x)\n', (448, 451), True, 'import n...
from Resnet_model import resnet101 from utils.data_utils import parser from utils.plot_utils import ploy_rect import tensorflow as tf import argparse import numpy as np import cv2 # define clasify: background and car LABELS = { 1: 'Person', 2: 'Bird', 3: 'Cat', 4: 'Cow', 5: 'Dog', 6: 'Horse', ...
[ "utils.plot_utils.ploy_rect", "numpy.sum", "argparse.ArgumentParser", "tensorflow.train.Saver", "tensorflow.data.TFRecordDataset", "tensorflow.global_variables_initializer", "cv2.waitKey", "tensorflow.Session", "tensorflow.variable_scope", "utils.data_utils.parser", "tensorflow.local_variables_i...
[((583, 642), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""RetinaNet image test"""'}), "(description='RetinaNet image test')\n", (606, 642), False, 'import argparse\n'), ((1284, 1318), 'tensorflow.data.TFRecordDataset', 'tf.data.TFRecordDataset', (['val_files'], {}), '(val_files)\n', (...
import numpy as np import pandas as pd def get_daily_vol(close, span=100): """Estimate exponential average volatility""" use_idx = close.index.searchsorted(close.index - pd.Timedelta(days=1)) use_idx = use_idx[use_idx > 0] # Get rid of duplications in index use_idx = np.unique(use_idx) prev_id...
[ "pandas.Series", "numpy.unique", "pandas.Timedelta" ]
[((290, 308), 'numpy.unique', 'np.unique', (['use_idx'], {}), '(use_idx)\n', (299, 308), True, 'import numpy as np\n'), ((324, 387), 'pandas.Series', 'pd.Series', (['close.index[use_idx - 1]'], {'index': 'close.index[use_idx]'}), '(close.index[use_idx - 1], index=close.index[use_idx])\n', (333, 387), True, 'import pand...
import argparse import os.path as osp import os import shutil import tempfile import numpy as np import mmcv import torch import copy import torch.distributed as dist from mmcv.runner import load_checkpoint, get_dist_info from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmdet.apis import init_d...
[ "PIL.Image.new", "argparse.ArgumentParser", "matplotlib.cm.get_cmap", "mmcv.mkdir_or_exist", "mmdet.datasets.get_dataset", "torch.cat", "mmcv.Config.fromfile", "mmdet.core.tensor2imgs", "os.path.join", "mmdet.models.build_detector", "cv2.imwrite", "mmcv.imrescale", "mmdet.apis.init_dist", ...
[((1656, 1686), 'numpy.uint8', 'np.uint8', (['(activation_org * 255)'], {}), '(activation_org * 255)\n', (1664, 1686), True, 'import numpy as np\n'), ((1703, 1740), 'matplotlib.cm.get_cmap', 'mpl_color_map.get_cmap', (['colormap_name'], {}), '(colormap_name)\n', (1725, 1740), True, 'import matplotlib.cm as mpl_color_ma...
from __future__ import print_function, division import os import numpy as np from astropy.table import Table from . import six from .fit_info import FitInfo, FitInfoFile from .extinction import Extinction from .models import load_parameter_table def write_parameters(input_fits, output_file, select_format=("N", 1),...
[ "numpy.char.strip" ]
[((1455, 1485), 'numpy.char.strip', 'np.char.strip', (["t['MODEL_NAME']"], {}), "(t['MODEL_NAME'])\n", (1468, 1485), True, 'import numpy as np\n')]
""" Test the grid search for BNMTF, in grid_search_bnmtf.py """ import sys, os project_location = os.path.dirname(__file__)+"/../../../" sys.path.append(project_location) from BNMTF.code.cross_validation.greedy_search_bnmtf import GreedySearch from BNMTF.code.models.bnmtf_vb_optimised import bnmtf_vb_optimised import...
[ "sys.path.append", "numpy.random.seed", "os.path.dirname", "numpy.ones", "pytest.raises", "random.seed", "numpy.array_equal", "BNMTF.code.cross_validation.greedy_search_bnmtf.GreedySearch" ]
[((138, 171), 'sys.path.append', 'sys.path.append', (['project_location'], {}), '(project_location)\n', (153, 171), False, 'import sys, os\n'), ((99, 124), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (114, 124), False, 'import sys, os\n'), ((493, 511), 'numpy.ones', 'numpy.ones', (['(I, J)...
""" Base class for all systems in OpenMDAO.""" import sys from fnmatch import fnmatch from itertools import chain from six import string_types, iteritems, itervalues import numpy as np from openmdao.core.mpi_wrap import MPI from openmdao.core.options import OptionsDictionary from collections import OrderedDict from ...
[ "numpy.size", "openmdao.core.options.OptionsDictionary", "numpy.zeros", "six.itervalues", "openmdao.core.vec_wrapper._PlaceholderVecWrapper", "collections.OrderedDict", "six.iteritems", "itertools.chain", "fnmatch.fnmatch" ]
[((625, 638), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (636, 638), False, 'from collections import OrderedDict\n'), ((669, 682), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (680, 682), False, 'from collections import OrderedDict\n'), ((915, 949), 'openmdao.core.vec_wrapper._Placeholde...
# Copyright 2019 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "numpy.full", "tests.common.tensorio.compare_tensor", "tests.common.test_op.conv_ad_v2.conv_01", "tests.common.test_run.conv_utils.random_gaussian", "tests.common.test_op.conv_ad_v2.conv_02", "numpy.abs", "numpy.flip", "tests.common.test_run.conv_utils.conv_forward_naive", "numpy.transpose", "nump...
[((967, 1039), 'tests.common.tensorio.compare_tensor', 'compare_tensor', (['out_data', 'expect'], {'rtol': '(0.001)', 'atol': '(0.001)', 'equal_nan': '(True)'}), '(out_data, expect, rtol=0.001, atol=0.001, equal_nan=True)\n', (981, 1039), False, 'from tests.common.tensorio import compare_tensor\n'), ((9682, 9724), 'tes...
import torch import torch.onnx as onnx import torchvision.models as models import os import os.path as path from tempfile import mkdtemp import numpy as np #import matplotlib.pyplot as plt #from skimage.transform import rotate import torch torch.manual_seed(0) import random random.seed(0) import nibabel as nib fr...
[ "numpy.random.seed", "torch.optim.lr_scheduler.StepLR", "numpy.sum", "os.walk", "torch.cat", "collections.defaultdict", "torchsummary.summary", "numpy.arange", "os.path.join", "numpy.eye", "torch.utils.data.DataLoader", "torch.load", "numpy.transpose", "torch.nn.functional.binary_cross_ent...
[((244, 264), 'torch.manual_seed', 'torch.manual_seed', (['(0)'], {}), '(0)\n', (261, 264), False, 'import torch\n'), ((280, 294), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (291, 294), False, 'import random\n'), ((359, 376), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (373, 376), True, 'i...
""" This code is largely take from <NAME>'s Github https://github.com/mdeff/cnn_graph/blob/master/nips2016/mnist.ipynb. """ import numpy as np import scipy.sparse as sp from sklearn.model_selection import train_test_split from sklearn.neighbors import kneighbors_graph from tensorflow.keras.datasets import mnist as m ...
[ "numpy.stack", "numpy.meshgrid", "numpy.maximum", "sklearn.model_selection.train_test_split", "numpy.empty", "numpy.logical_not", "tensorflow.keras.datasets.mnist.load_data", "scipy.sparse.lil_matrix", "numpy.linspace", "numpy.random.choice", "sklearn.neighbors.kneighbors_graph" ]
[((1406, 1419), 'tensorflow.keras.datasets.mnist.load_data', 'm.load_data', ([], {}), '()\n', (1417, 1419), True, 'from tensorflow.keras.datasets import mnist as m\n'), ((1612, 1663), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X_train', 'y_train'], {'test_size': '(10000)'}), '(X_train, y_train, ...
import os import pdb import os.path as osp import sys sys.path[0] = os.getcwd() import cv2 import copy import json import yaml import logging import argparse from tqdm import tqdm from itertools import groupby import pycocotools.mask as mask_utils import numpy as np import torch from torchvision.trans...
[ "yaml.load", "numpy.sum", "argparse.ArgumentParser", "numpy.abs", "os.path.join", "tracker.mot.pose.PoseAssociationTracker", "json.dump", "copy.deepcopy", "utils.meter.Timer", "numpy.asarray", "os.system", "torchvision.transforms.transforms.ToTensor", "data.video.LoadImagesAndPoseObs", "nu...
[((72, 83), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (81, 83), False, 'import os\n'), ((959, 978), 'copy.deepcopy', 'copy.deepcopy', (['obsj'], {}), '(obsj)\n', (972, 978), False, 'import copy\n'), ((1647, 1674), 'tracker.mot.pose.PoseAssociationTracker', 'PoseAssociationTracker', (['opt'], {}), '(opt)\n', (1669, 16...
import networkx as nx import csv from scipy import sparse as sp from scipy.sparse import csgraph import scipy.sparse.linalg as splinalg import numpy as np import pandas as pd import warnings import collections as cole from .cpp import * import random import gzip import bz2 import lzma import multiprocessing as mp im...
[ "networkx.from_scipy_sparse_matrix", "numpy.sum", "pandas.read_csv", "numpy.ones", "collections.defaultdict", "scipy.sparse.csgraph.connected_components", "networkx.adjacency_matrix", "collections.Counter", "multiprocessing.RawArray", "matplotlib.pyplot.get_cmap", "numpy.frombuffer", "numpy.as...
[((1065, 1102), 'multiprocessing.RawArray', 'mp.RawArray', (['ctypes.c_uint8', 'a.nbytes'], {}), '(ctypes.c_uint8, a.nbytes)\n', (1076, 1102), True, 'import multiprocessing as mp\n'), ((1155, 1171), 'numpy.copyto', 'np.copyto', (['sa', 'a'], {}), '(sa, a)\n', (1164, 1171), True, 'import numpy as np\n'), ((8946, 8967), ...
from aiida.parsers import Parser from aiida.orm import Dict from aiida.common import OutputParsingError from aiida.common import exceptions # See the LICENSE.txt and AUTHORS.txt files. class STMOutputParsingError(OutputParsingError): pass #--------------------------- class STMParser(Parser): """ Pars...
[ "aiida.orm.Dict", "numpy.array", "itertools.groupby", "aiida.orm.ArrayData", "aiida.engine.ExitCode" ]
[((4255, 4271), 'itertools.groupby', 'groupby', (['data', 'h'], {}), '(data, h)\n', (4262, 4271), False, 'from itertools import groupby\n'), ((4348, 4364), 'itertools.groupby', 'groupby', (['data', 'h'], {}), '(data, h)\n', (4355, 4364), False, 'from itertools import groupby\n'), ((4441, 4457), 'itertools.groupby', 'gr...
""" Noteworthy util functions 1. bandpass_default: default bandpass filter 2. phaseT: calculate phase time series 3. ampT: calculate amplitude time series 4. findpt - find peaks and troughs of oscillations * _removeboundaryextrema - ignore peaks and troughs along the edge of the signal 5. f_psd - calculate PSD with...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.loglog", "numpy.abs", "numpy.sum", "scipy.signal.welch", "numpy.argmax", "numpy.empty", "numpy.isnan", "numpy.argmin", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "numpy.exp", "scipy.interpolate.interp1d", "numpy.convolve", "n...
[((2967, 2995), 'numpy.convolve', 'np.convolve', (['taps', 'x', '"""same"""'], {}), "(taps, x, 'same')\n", (2978, 2995), True, 'import numpy as np\n'), ((3815, 3854), 'scipy.signal.butter', 'sp.signal.butter', (['order', 'Wn', '"""bandstop"""'], {}), "(order, Wn, 'bandstop')\n", (3831, 3854), True, 'import scipy as sp\...
# -*- coding: utf-8 -*- """ parse mp4 'colr' lazily ======================= """ # import standard libraries import os from struct import unpack, pack from pathlib import Path import shutil # import third-party libraries from numpy.testing._private.utils import assert_equal # import my libraries # information __aut...
[ "numpy.testing._private.utils.assert_equal", "os.path.abspath", "struct.unpack", "struct.pack", "pathlib.Path", "shutil.copyfile" ]
[((3450, 3484), 'struct.unpack', 'unpack', (['""">HHH"""', 'colour_binary_data'], {}), "('>HHH', colour_binary_data)\n", (3456, 3484), False, 'from struct import unpack, pack\n'), ((3780, 3857), 'struct.pack', 'pack', (['""">HHH"""', 'colour_primaries', 'transfer_characteristics', 'matrix_coefficients'], {}), "('>HHH',...
""" Newman Model ----------------------- This module contains a functions for generating random graph using configuration model. In configuration model, one represents a graph using degree sequence. The actual graph is obtained by randomly connecting stubs of vertices. """ import sys, os, math import numpy as np sys....
[ "os.path.abspath", "numpy.random.normal" ]
[((1141, 1176), 'numpy.random.normal', 'np.random.normal', (['mu', 'sigma'], {'size': 'n'}), '(mu, sigma, size=n)\n', (1157, 1176), True, 'import numpy as np\n'), ((364, 389), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (379, 389), False, 'import sys, os, math\n')]
import os import sys import glob import time import copy import logging import argparse import random import numpy as np import utils import lightgbm as lgb from nasbench import api parser = argparse.ArgumentParser() # Basic model parameters. parser.add_argument('--data', type=str, default='data') pa...
[ "numpy.random.seed", "argparse.ArgumentParser", "logging.basicConfig", "lightgbm.train", "lightgbm.Dataset", "numpy.argsort", "logging.info", "random.seed", "numpy.array", "glob.glob", "os.path.join", "utils.generate_arch", "utils.get_feature_name" ]
[((207, 232), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (230, 232), False, 'import argparse\n'), ((919, 1030), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.INFO', 'format': 'log_format', 'datefmt': '"""%m/%d %I:%M:%S %p"""'}), "(stream=sys.s...
import pytest import vaex pytest.importorskip("sklearn") from vaex.ml.sklearn import SKLearnPredictor import numpy as np # Regressions from sklearn.linear_model import LinearRegression, Ridge, Lasso from sklearn.svm import SVR from sklearn.ensemble import AdaBoostRegressor, GradientBoostingRegressor, RandomForestRegr...
[ "vaex.ml.Pipeline", "sklearn.ensemble.GradientBoostingRegressor", "sklearn.svm.SVC", "numpy.testing.assert_array_almost_equal", "sklearn.linear_model.Ridge", "sklearn.linear_model.Lasso", "sklearn.ensemble.RandomForestClassifier", "sklearn.ensemble.AdaBoostClassifier", "sklearn.ensemble.RandomForest...
[((26, 56), 'pytest.importorskip', 'pytest.importorskip', (['"""sklearn"""'], {}), "('sklearn')\n", (45, 56), False, 'import pytest\n'), ((544, 562), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {}), '()\n', (560, 562), False, 'from sklearn.linear_model import LinearRegression, Ridge, Lasso\n'), ((...
from abc import ABCMeta, abstractmethod import ConnectTools as CT import numpy as np # Class to control connectivity maps / to determine whether transitions have occured class StructureMap: def __init__(self, mol): self.criteriaMet = False @abstractmethod def reinitialise(self, mol): p...
[ "numpy.count_nonzero", "ConnectTools.refBonds", "numpy.zeros", "ConnectTools.bondMatrix" ]
[((466, 482), 'ConnectTools.refBonds', 'CT.refBonds', (['mol'], {}), '(mol)\n', (477, 482), True, 'import ConnectTools as CT\n'), ((500, 529), 'ConnectTools.bondMatrix', 'CT.bondMatrix', (['self.dRef', 'mol'], {}), '(self.dRef, mol)\n', (513, 529), True, 'import ConnectTools as CT\n'), ((563, 574), 'numpy.zeros', 'np.z...
from ..utils import get_data_filename #TODO add need off omm parmed decorator: https://stackoverflow.com/questions/739654/how-to-make-a-chain-of-function-decorators def minimise_energy_all_confs(mol, models = None, epsilon = 4, allow_undefined_stereo = True, **kwargs ): from simtk import unit from simtk.openmm ...
[ "copy.deepcopy", "openforcefield.topology.Molecule.from_rdkit", "simtk.openmm.app.Simulation", "rdkit.Geometry.Point3D", "openforcefield.topology.Topology.from_molecules", "mlddec.load_models", "numpy.array", "mlddec.get_charges", "rdkit.Chem.AddHs", "simtk.openmm.LangevinIntegrator" ]
[((534, 565), 'rdkit.Chem.AddHs', 'Chem.AddHs', (['mol'], {'addCoords': '(True)'}), '(mol, addCoords=True)\n', (544, 565), False, 'from rdkit import Chem\n'), ((652, 683), 'mlddec.get_charges', 'mlddec.get_charges', (['mol', 'models'], {}), '(mol, models)\n', (670, 683), False, 'import mlddec\n'), ((1149, 1167), 'copy....
import sys import math from PIL import Image import numpy as np def main(path, input_width, input_height): input_width = int(input_width) input_height = int(input_height) im = Image.open(path) im = im.resize((128,128), Image.ANTIALIAS) width, height = im.size horizontal_num = math.cei...
[ "math.ceil", "PIL.Image.new", "numpy.array", "PIL.Image.open" ]
[((194, 210), 'PIL.Image.open', 'Image.open', (['path'], {}), '(path)\n', (204, 210), False, 'from PIL import Image\n'), ((312, 342), 'math.ceil', 'math.ceil', (['(input_width / width)'], {}), '(input_width / width)\n', (321, 342), False, 'import math\n'), ((362, 394), 'math.ceil', 'math.ceil', (['(input_height / heigh...
# -*- coding: utf-8 -*- import logging import numpy as np from sklearn.metrics import accuracy_score from lichee import plugin from .metrics_base import BaseMetrics @plugin.register_plugin(plugin.PluginType.MODULE_METRICS, "Accuracy") class AccuracyMetrics(BaseMetrics): """define accuracy metric that measures si...
[ "sklearn.metrics.accuracy_score", "lichee.plugin.register_plugin", "numpy.concatenate", "numpy.argmax" ]
[((169, 237), 'lichee.plugin.register_plugin', 'plugin.register_plugin', (['plugin.PluginType.MODULE_METRICS', '"""Accuracy"""'], {}), "(plugin.PluginType.MODULE_METRICS, 'Accuracy')\n", (191, 237), False, 'from lichee import plugin\n'), ((1088, 1129), 'numpy.concatenate', 'np.concatenate', (['self.total_labels'], {'ax...
from django.shortcuts import render from django.http import HttpResponse from .models import Customer,Drone,Order, Depot import pandas as pd import numpy as np from scipy.spatial.distance import squareform, pdist from haversine import haversine from .vrp import * # Create your views here. def maps(request): n = l...
[ "django.shortcuts.render", "numpy.append", "numpy.array", "scipy.spatial.distance.pdist" ]
[((926, 969), 'numpy.array', 'np.array', (["[[coords['lat'], coords['long']]]"], {}), "([[coords['lat'], coords['long']]])\n", (934, 969), True, 'import numpy as np\n'), ((2708, 2753), 'django.shortcuts.render', 'render', (['request', '"""maps.html"""'], {'context': 'context'}), "(request, 'maps.html', context=context)...
#! /usr/bin/env python import macrodensity as md import math import numpy as np import matplotlib.pyplot as plt #------------------------------------------------------------------ # READING # Get the two potentials and change them to a planar average. # This section should not be altered #-----------------------...
[ "macrodensity.matrix_2_abc", "macrodensity.translate_grid", "macrodensity.get_volume", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "macrodensity.match_resolution", "macrodensity.matched_spline_generate", "macrodensity.read_vasp_density", "macrodensity.density_2_grid", "macrodensity.extend_...
[((406, 441), 'macrodensity.read_vasp_density', 'md.read_vasp_density', (['"""CHGCAR.Slab"""'], {}), "('CHGCAR.Slab')\n", (426, 441), True, 'import macrodensity as md\n'), ((480, 504), 'macrodensity.matrix_2_abc', 'md.matrix_2_abc', (['Lattice'], {}), '(Lattice)\n', (495, 504), True, 'import macrodensity as md\n'), ((5...
import numpy as np keys = np.array(['HX', 'HY', 'A0', 'A1', 'A2', 'A3', 'N', 'E', 'S', 'W', 'THL', 'THR', 'TL', 'TR', 'TL2', 'TR3', 'M' ,'ST', 'SL']) outputs = {'HX': 0, 'HY': 0, 'A0': 0, 'A1': 0, 'A2': 0, 'A3': 0, 'N': 0, 'E': 0, 'S': 0, 'W': 0, 'THL': 0, 'THR': 0, 'TL': 0, 'TR': 0, 'TL2': 0, 'TR3': 0, 'M': 0, 'ST': ...
[ "numpy.array" ]
[((27, 154), 'numpy.array', 'np.array', (["['HX', 'HY', 'A0', 'A1', 'A2', 'A3', 'N', 'E', 'S', 'W', 'THL', 'THR', 'TL',\n 'TR', 'TL2', 'TR3', 'M', 'ST', 'SL']"], {}), "(['HX', 'HY', 'A0', 'A1', 'A2', 'A3', 'N', 'E', 'S', 'W', 'THL',\n 'THR', 'TL', 'TR', 'TL2', 'TR3', 'M', 'ST', 'SL'])\n", (35, 154), True, 'import...
# mlp-attention_03 # {'val_loss': [ # 0.8321127831733865, 0.8149616334763244, 0.8080661035819032, 0.8043228179784596, 0.8002183685173205, # 0.7972857836676045, 0.793001569427853, 0.7924909000240787, 0.7921270519020359, 0.7874714549603654, # 0.7854632683025837, 0.7836462063538413, 0.7816860973027518, 0.7811260843474584,...
[ "sklearn.model_selection.train_test_split", "numpy.asarray", "keras.layers.Flatten", "surprise.Dataset.load_builtin", "keras.models.Model", "keras.optimizers.Adam", "keras.layers.multiply", "keras.layers.Dense", "keras.layers.Embedding", "keras.layers.Input", "keras.layers.concatenate" ]
[((2063, 2092), 'surprise.Dataset.load_builtin', 'Dataset.load_builtin', (['"""ml-1m"""'], {}), "('ml-1m')\n", (2083, 2092), False, 'from surprise import Dataset\n'), ((2344, 2398), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x', 'y'], {'test_size': '(0.2)', 'random_state': '(42)'}), '(x, y, test...
import multiprocessing import time import numpy as np from MulticoreTSNE import MulticoreTSNE as TSNE from sklearn.decomposition import PCA from . import image_util try: from StringIO import StringIO # Python 2.7 except ImportError: from io import BytesIO as StringIO # Python 3.x def tsne_image( feat...
[ "numpy.asarray", "time.time", "sklearn.decomposition.PCA", "MulticoreTSNE.MulticoreTSNE", "multiprocessing.cpu_count" ]
[((1255, 1293), 'numpy.asarray', 'np.asarray', (['features'], {'dtype': 'np.float32'}), '(features, dtype=np.float32)\n', (1265, 1293), True, 'import numpy as np\n'), ((1371, 1382), 'time.time', 'time.time', ([], {}), '()\n', (1380, 1382), False, 'import time\n'), ((1613, 1678), 'MulticoreTSNE.MulticoreTSNE', 'TSNE', (...
""" 1st phase of the analysis """ from trackme.tracking.analytics.multifactor_analysis import pearson_correlation, pointbiserial_correlation from typing import List, Tuple from trackme.tracking.crud.tracking import filter_entries, get_time_horizon, collect_attributes_ids from trackme.tracking.crud.tracking_validation i...
[ "trackme.tracking.crud.tracking_validation.is_attribute_binary", "trackme.tracking.crud.tracking.collect_attributes_ids", "statsmodels.stats.stattools.durbin_watson", "trackme.tracking.crud.tracking.get_time_horizon", "statsmodels.tsa.stattools.pacf", "trackme.tracking.analytics.multifactor_analysis.pears...
[((1450, 1500), 'statsmodels.api.tsa.filters.hpfilter', 'sm.tsa.filters.hpfilter', (['input_data', '(1600 * 3 ** 4)'], {}), '(input_data, 1600 * 3 ** 4)\n', (1473, 1500), True, 'import statsmodels.api as sm\n'), ((5008, 5068), 'trackme.tracking.crud.tracking.get_time_horizon', 'get_time_horizon', ([], {'user_id': 'user...
import numpy as np from scipy.optimize import curve_fit import matplotlib.pyplot as plt def linear(x, *params): y = np.zeros_like(x) k = params[0] y0 = params[1] y = y0 + k * x return y def linearFitter(x, y, *y0): guess = [1, 0] if len(y0) == 0: try: pri...
[ "numpy.zeros_like", "matplotlib.pyplot.plot", "numpy.argmax", "numpy.zeros", "scipy.optimize.curve_fit", "numpy.max", "numpy.min", "numpy.exp" ]
[((126, 142), 'numpy.zeros_like', 'np.zeros_like', (['x'], {}), '(x)\n', (139, 142), True, 'import numpy as np\n'), ((1395, 1411), 'numpy.zeros_like', 'np.zeros_like', (['x'], {}), '(x)\n', (1408, 1411), True, 'import numpy as np\n'), ((1684, 1695), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (1692, 1695), True,...
import matplotlib.pyplot as plt import numpy as np import os fileNameList = ['results_C1-BHD_0_16_0_0_-30000_30000_5000.txt', 'results_C1-BHD_0_16_16_0_-30000_30000_5000.txt', 'results_C1-SU2_0_16_0_0_-30000_30000_5000.txt', 'results_C1-SU2_16_16_32_0_-30000_30000_5000.txt', 'results_C1-SU2_32_16_16_0_-30000_30000_500...
[ "os.makedirs", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "os.path.exists", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "numpy.arange", "numpy.loadtxt", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.gri...
[((873, 893), 'numpy.loadtxt', 'np.loadtxt', (['fileName'], {}), '(fileName)\n', (883, 893), True, 'import numpy as np\n'), ((1054, 1083), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 6.5)'}), '(figsize=(10, 6.5))\n', (1064, 1083), True, 'import matplotlib.pyplot as plt\n'), ((1609, 1634), 'matplotl...
"""Common features for the models.""" # Licensed under the 3-clause BSD license. # http://opensource.org/licenses/BSD-3-Clause # # Copyright (C) 2014 <NAME> # All rights reserved. import numpy as np from scipy.special import erfinv, logit # ====== Linear regression uncertainity parameters =========================...
[ "numpy.divide", "numpy.sum", "numpy.abs", "numpy.count_nonzero", "numpy.empty", "numpy.asarray", "numpy.square", "scipy.special.erfinv", "numpy.triu_indices", "numpy.random.RandomState", "numpy.ix_", "numpy.zeros", "scipy.special.logit", "numpy.mean", "numpy.squeeze", "numpy.eye", "n...
[((737, 760), 'scipy.special.erfinv', 'erfinv', (['(2 * GAMMA_0 - 1)'], {}), '(2 * GAMMA_0 - 1)\n', (743, 760), False, 'from scipy.special import erfinv, logit\n'), ((767, 777), 'scipy.special.logit', 'logit', (['P_0'], {}), '(P_0)\n', (772, 777), False, 'from scipy.special import erfinv, logit\n'), ((1614, 1630), 'num...
import numpy as np from time import time import re from pmesh.pm import ParticleMesh from nbodykit.lab import BigFileCatalog, MultipleSpeciesCatalog, FFTPower # # #Global, fixed things scratch1 = '/global/cscratch1/sd/yfeng1/m3127/' scratch2 = '/global/cscratch1/sd/chmodi/m3127/H1mass/' project = '/project/project...
[ "nbodykit.lab.BigFileCatalog", "numpy.abs", "nbodykit.lab.FFTPower", "numpy.savetxt", "pmesh.pm.ParticleMesh", "numpy.array", "numpy.exp" ]
[((627, 671), 'pmesh.pm.ParticleMesh', 'ParticleMesh', ([], {'BoxSize': 'bs', 'Nmesh': '[nc, nc, nc]'}), '(BoxSize=bs, Nmesh=[nc, nc, nc])\n', (639, 671), False, 'from pmesh.pm import ParticleMesh\n'), ((2414, 2482), 'numpy.savetxt', 'np.savetxt', (["('../data/pkdebug2-%d.txt' % wsize)", 'tosave'], {'header': 'header'}...
from __future__ import print_function import unittest import numpy.testing as npt from .context import SimulationHydro class TestBasic(unittest.TestCase): @staticmethod def test_cons_to_primitive(): a = SimulationHydro.SimulationHydro() test_primitive = [0, 0.4, 1.4] con = [1, 0, 1]...
[ "unittest.main", "numpy.testing.assert_allclose" ]
[((740, 755), 'unittest.main', 'unittest.main', ([], {}), '()\n', (753, 755), False, 'import unittest\n'), ((380, 433), 'numpy.testing.assert_allclose', 'npt.assert_allclose', (['prim', 'test_primitive'], {'rtol': '(1e-05)'}), '(prim, test_primitive, rtol=1e-05)\n', (399, 433), True, 'import numpy.testing as npt\n'), (...
"""Setting a parameter by cross-validation ======================================================= Here we set the number of features selected in an Anova-SVC approach to maximize the cross-validation score. After separating 2 sessions for validation, we vary that parameter and measure the cross-validation score. We ...
[ "nilearn.image.index_img", "matplotlib.pyplot.plot", "nilearn.plotting.show", "pandas.read_csv", "matplotlib.pyplot.legend", "nilearn.datasets.fetch_haxby", "matplotlib.pyplot.axis", "sklearn.model_selection.KFold", "matplotlib.pyplot.figure", "numpy.mean", "numpy.array", "nilearn.decoding.Dec...
[((1800, 1822), 'nilearn.datasets.fetch_haxby', 'datasets.fetch_haxby', ([], {}), '()\n', (1820, 1822), False, 'from nilearn import datasets\n'), ((2135, 2188), 'pandas.read_csv', 'pd.read_csv', (['haxby_dataset.session_target[0]'], {'sep': '""" """'}), "(haxby_dataset.session_target[0], sep=' ')\n", (2146, 2188), True...
import argparse import datetime import json import math import os import pdb import pickle import random import sys import time import numpy as np import torch from torch.utils.data import DataLoader from config import model_conf, special_toks, train_conf from dataset import FastDataset from models import BlindStatel...
[ "argparse.ArgumentParser", "torch.cuda.device_count", "numpy.mean", "torch.autograd.set_detect_anomaly", "numpy.arange", "utilities.DataParallelV2", "utilities.plotting_loss", "torch.no_grad", "os.path.join", "random.randint", "torch.utils.data.DataLoader", "config.model_conf.update", "torch...
[((543, 582), 'torch.autograd.set_detect_anomaly', 'torch.autograd.set_detect_anomaly', (['(True)'], {}), '(True)\n', (576, 582), False, 'import torch\n'), ((2155, 2179), 'numpy.arange', 'np.arange', (['(1)', '(epochs + 1)'], {}), '(1, epochs + 1)\n', (2164, 2179), True, 'import numpy as np\n'), ((2405, 2548), 'utiliti...
import os import requests import base64 import logging import datetime import hashlib from pathlib import Path import tempfile import traceback from synthesizer.inference import Synthesizer from encoder import inference as encoder from vocoder import inference as vocoder import numpy as np import librosa logging.basi...
[ "numpy.pad", "os.remove", "traceback.print_exc", "requests.head", "numpy.concatenate", "logging.basicConfig", "os.path.exists", "datetime.datetime.now", "base64.b64decode", "encoder.inference.embed_utterance", "hashlib.sha256", "vocoder.inference.infer_waveform", "tempfile.TemporaryFile", ...
[((308, 408), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '(10)', 'format': '"""%(asctime)s - [%(levelname)8s] - %(name)s - %(message)s"""'}), "(level=10, format=\n '%(asctime)s - [%(levelname)8s] - %(name)s - %(message)s')\n", (327, 408), False, 'import logging\n'), ((410, 444), 'logging.getLogger'...
"""A module for extracting structured data from Vision Card screenshots.""" import re import sys import cv2 import imutils import numpy import pytesseract import requests # for downloading images from PIL import Image from vision_card_common import VisionCard class VisionCardOcrUtils: """Utilities for working wi...
[ "cv2.GaussianBlur", "PIL.Image.new", "cv2.bitwise_not", "vision_card_common.VisionCard", "cv2.cvtColor", "cv2.threshold", "pytesseract.image_to_string", "cv2.imread", "numpy.array", "requests.get", "imutils.grab_contours", "PIL.Image.fromarray", "cv2.boundingRect", "cv2.inRange", "re.com...
[((1669, 1685), 'cv2.imread', 'cv2.imread', (['path'], {}), '(path)\n', (1679, 1685), False, 'import cv2\n'), ((3009, 3060), 'cv2.cvtColor', 'cv2.cvtColor', (['vision_card_image', 'cv2.COLOR_BGR2GRAY'], {}), '(vision_card_image, cv2.COLOR_BGR2GRAY)\n', (3021, 3060), False, 'import cv2\n'), ((3210, 3249), 'cv2.GaussianB...
# -*- coding: utf-8 -*- """ i_comp.py generated by WhatsOpt 1.8.2 """ import numpy as np from i_comp_base import ICompBase class IComp(ICompBase): """ An OpenMDAO component to encapsulate IComp discipline """ def compute(self, inputs, outputs): """ IComp computation """ if self._impl: ...
[ "numpy.ones" ]
[((519, 533), 'numpy.ones', 'np.ones', (['(50,)'], {}), '((50,))\n', (526, 533), True, 'import numpy as np\n')]
import glob, os import pandas as pd import numpy as np import mmcv from mmdet.apis import init_detector, inference_detector import argparse def parse_args(): parser = argparse.ArgumentParser(description='Предварительная разметка видео. Результатом является csv файл с номером кадра и боксами на нем') parser.a...
[ "pandas.DataFrame", "os.mkdir", "argparse.ArgumentParser", "mmdet.apis.init_detector", "os.path.exists", "mmdet.apis.inference_detector", "numpy.insert", "mmcv.track_iter_progress", "os.path.join", "os.listdir" ]
[((174, 317), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Предварительная разметка видео. Результатом является csv файл с номером кадра и боксами на нем"""'}), "(description=\n 'Предварительная разметка видео. Результатом является csv файл с номером кадра и боксами на нем'\n )\n...
# Install the following packages (pip3 install <NAME>) before running the study code: # seaborn # torch # pandas # pystan # arviz import pickle import random import numpy as np import pandas as pd from generate_data import generate_data import matplotlib.pyplot as plt import matplotlib import os import time import sub...
[ "webbrowser.open", "generate_data.generate_data", "numpy.random.seed", "os.makedirs", "pickle.dump", "random.shuffle", "os.path.exists", "os.system", "time.time", "machine_education_interactive_test.ts_teach_user_study", "matplotlib.pyplot.subplots", "pandas.concat" ]
[((1099, 1117), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)', '(1)'], {}), '(2, 1)\n', (1111, 1117), True, 'import matplotlib.pyplot as plt\n'), ((1120, 1181), 'webbrowser.open', 'webbrowser.open', (['"""https://forms.gle/AkY5xLrPzxN43Dry7"""'], {'new': '(2)'}), "('https://forms.gle/AkY5xLrPzxN43Dry7', new=2)\...
'''mclotstrats.py: A simple Monte Carlo algorithm for lottery games Developed using Pythonista for iPhone/iPad (c) <NAME>, 2017 *Lottery customization: no. of balls (balls) in lottery; lowest (low) and highest (high) numbers in lottery *Game customization: number of lotteries played (N); number of tickets played (tick...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "numpy.sum", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "random.sample", "numpy.zeros", "numpy.sort", "numpy.linspace", "numpy.array_equal", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((593, 613), 'numpy.linspace', 'np.linspace', (['(0)', 'N', 'N'], {}), '(0, N, N)\n', (604, 613), True, 'import numpy as np\n'), ((683, 709), 'numpy.zeros', 'np.zeros', (['[ticketN, balls]'], {}), '([ticketN, balls])\n', (691, 709), True, 'import numpy as np\n'), ((722, 748), 'numpy.zeros', 'np.zeros', (['[ticketN, ba...
import numpy as np from minkf import utils def kf_predict(xest, Cest, M, Q, u=None): """ Prediction step of the Kalman filter, xp = M*xest + u + Q. Parameters ---------- xest: np.array of length n, posterior estimate for the current time Cest: np.array of shape (n, n), posterior covariance fo...
[ "minkf.utils.normal_log_pdf", "numpy.zeros", "numpy.isnan", "numpy.random.multivariate_normal", "numpy.squeeze", "numpy.eye", "minkf.utils.rsolve", "numpy.linalg.solve" ]
[((1314, 1347), 'minkf.utils.rsolve', 'utils.rsolve', (['obs_precision', 'CpKT'], {}), '(obs_precision, CpKT)\n', (1326, 1347), False, 'from minkf import utils\n'), ((1374, 1385), 'numpy.isnan', 'np.isnan', (['y'], {}), '(y)\n', (1382, 1385), True, 'import numpy as np\n'), ((1460, 1479), 'numpy.eye', 'np.eye', (['Cp.sh...
# Copyright 2019, The Jelly Bean World 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 ...
[ "matplotlib.pyplot.fignum_exists", "matplotlib.collections.LineCollection", "matplotlib.patches.RegularPolygon", "numpy.log", "math.ceil", "matplotlib.patches.Rectangle", "matplotlib.pyplot.close", "numpy.empty", "math.floor", "matplotlib.patches.Circle", "matplotlib.pyplot.draw", "matplotlib....
[((1834, 1843), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (1841, 1843), True, 'import matplotlib.pyplot as plt\n'), ((2654, 2674), 'matplotlib.pyplot.close', 'plt.close', (['self._fig'], {}), '(self._fig)\n', (2663, 2674), True, 'import matplotlib.pyplot as plt\n'), ((8243, 8253), 'matplotlib.pyplot.draw', ...
import sys import os import pathlib import psutil import numpy from pin_lookup import pin def compCrawl(): """Finds local removable partitions. No associated unit test. :returns: list of paths of removable partitions """ allPartitions = psutil.disk_partitions() maybeDASHRpartitions = [] for s...
[ "psutil.disk_partitions", "pin_lookup.pin", "numpy.fromfile", "os.walk", "pathlib.PurePath" ]
[((256, 280), 'psutil.disk_partitions', 'psutil.disk_partitions', ([], {}), '()\n', (278, 280), False, 'import psutil\n'), ((1344, 1372), 'os.walk', 'os.walk', (['maybeDASHRpartition'], {}), '(maybeDASHRpartition)\n', (1351, 1372), False, 'import os\n'), ((1718, 1754), 'numpy.fromfile', 'numpy.fromfile', (['path'], {'d...
import cv2 import numpy as np print('done') frameWidth=640 frameHeight=480 cap=cv2.VideoCapture(1) cap.set(3,frameHeight) cap.set(4,frameWidth) cap.set(10,150) myColors=[ [97,167,171,107,255,255], [16,85,141,151,255,213], [75,91,224,179,255,255], [37,64,0,95,255,25...
[ "cv2.boundingRect", "cv2.contourArea", "cv2.circle", "cv2.approxPolyDP", "cv2.cvtColor", "cv2.arcLength", "cv2.waitKey", "cv2.VideoCapture", "numpy.array", "cv2.imshow", "cv2.inRange", "cv2.findContours" ]
[((88, 107), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(1)'], {}), '(1)\n', (104, 107), False, 'import cv2\n'), ((811, 847), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2HSV'], {}), '(img, cv2.COLOR_BGR2HSV)\n', (823, 847), False, 'import cv2\n'), ((1339, 1402), 'cv2.findContours', 'cv2.findContours', (['im...
import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LogNorm from scipy.ndimage import filters import casatools import os.path tb = casatools.table() ms = casatools.ms() nall2nant = lambda nall: max(np.round(np.roots([1/2., 1/2., -nall]), 0).astype(int)) # nant calc from cross+auto def c...
[ "numpy.roots", "numpy.sum", "matplotlib.pyplot.show", "numpy.zeros", "numpy.triu_indices", "matplotlib.pyplot.colorbar", "matplotlib.colors.LogNorm", "casatools.ms", "casatools.table", "matplotlib.pyplot.savefig" ]
[((161, 178), 'casatools.table', 'casatools.table', ([], {}), '()\n', (176, 178), False, 'import casatools\n'), ((184, 198), 'casatools.ms', 'casatools.ms', ([], {}), '()\n', (196, 198), False, 'import casatools\n'), ((830, 877), 'numpy.zeros', 'np.zeros', (['(nant, nant, nchan, npol)'], {'dtype': 'bool'}), '((nant, na...
#!/usr/bin/env python3 # This file is covered by the LICENSE file in the root of this project. # This script has been initiated with the goal of making an inference based on Livox Mid 40 range image # Work initiated by: Vice, 03.09.2021 import argparse import yaml from shutil import copyfile import os import shutil ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "os.makedirs", "os.path.isdir", "matplotlib.pyplot.imshow", "numpy.asarray", "open3d.io.read_point_cloud", "numpy.shape", "matplotlib.pyplot.figure", "numpy.squeeze", "shutil.rmtree", "os.path.join" ]
[((844, 912), 'open3d.io.read_point_cloud', 'o3d.io.read_point_cloud', (['"""./data/cropped_1.pcd"""'], {'print_progress': '(True)'}), "('./data/cropped_1.pcd', print_progress=True)\n", (867, 912), True, 'import open3d as o3d\n'), ((951, 983), 'numpy.asarray', 'np.asarray', (['livox_raw_pcd.points'], {}), '(livox_raw_p...
import pandas as pd import numpy as np import keras import matplotlib.pyplot as plt from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten, LSTM, TimeDistributed, RepeatVector, Bidirectional from keras.models import load_model import random from sklearn.metrics import confusion...
[ "keras.models.load_model", "os.mkdir", "sklearn.metrics.confusion_matrix", "numpy.argmax", "pandas.read_csv", "tensorflow.ConfigProto", "matplotlib.pyplot.figure", "keras.callbacks.LearningRateScheduler", "keras.backend.tensorflow_backend.set_session", "matplotlib.pyplot.close", "os.path.exists"...
[((621, 637), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (635, 637), True, 'import tensorflow as tf\n'), ((685, 710), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (695, 710), True, 'import tensorflow as tf\n'), ((711, 732), 'keras.backend.tensorflow_backend.set...
import numpy as np import matplotlib.pyplot as plt import gc save_path='/home/asap7772/cog/images/' paths = [ # ('/nfs/kun1/users/asap7772/prior_data/task_singleneut_Widow250DoubleDrawerGraspNeutral-v0_10K_save_all_noise_0.1_2021-03-25T22-52-59_9750.npy', 'coll_task'), # ('/nfs/kun1/users/asap7772/cog_data/dra...
[ "matplotlib.pyplot.title", "numpy.load", "matplotlib.pyplot.hist", "ipdb.set_trace", "matplotlib.pyplot.close", "gc.collect", "matplotlib.pyplot.figure", "numpy.array", "matplotlib.pyplot.savefig" ]
[((856, 868), 'gc.collect', 'gc.collect', ([], {}), '()\n', (866, 868), False, 'import gc\n'), ((884, 913), 'numpy.load', 'np.load', (['f'], {'allow_pickle': '(True)'}), '(f, allow_pickle=True)\n', (891, 913), True, 'import numpy as np\n'), ((935, 951), 'ipdb.set_trace', 'ipdb.set_trace', ([], {}), '()\n', (949, 951), ...
import casadi as ca import casadi.tools as ca_tools import gym import highway_env import numpy as np import torch from nets import CLPP from MPC.casadi_mul_shooting import get_first_action import time import matplotlib.pyplot as plt T = 0.1 # sampling time [s] N = 50 # prediction horizon accel_max = 1 omega_max = n...
[ "numpy.load", "matplotlib.pyplot.show", "gym.make", "matplotlib.pyplot.plot", "torch.LongTensor", "torch.load", "numpy.clip", "time.sleep", "matplotlib.pyplot.figure", "torch.Tensor", "numpy.arange", "numpy.array" ]
[((334, 360), 'torch.load', 'torch.load', (['"""pp_model.pkl"""'], {}), "('pp_model.pkl')\n", (344, 360), False, 'import torch\n'), ((385, 411), 'torch.load', 'torch.load', (['"""de_model.pkl"""'], {}), "('de_model.pkl')\n", (395, 411), False, 'import torch\n'), ((417, 441), 'numpy.load', 'np.load', (['"""embedding.npy...
#!/usr/bin/env python import numpy as nump import matplotlib.pyplot as py import sys,os import pickle from matplotlib import rc #rc('font', **{'family': 'sans-serif', 'sans-serif': ['Times']}) rc('text', usetex=True) strategies=["Analytic","Automatic","Numeric"] colors={} colors["Analytic"]="blue" colors["Automatic"]=...
[ "matplotlib.pyplot.subplot", "matplotlib.rc", "pickle.dump", "matplotlib.pyplot.clf", "os.path.isdir", "numpy.zeros", "matplotlib.pyplot.cla", "numpy.linspace", "os.path.join", "os.listdir", "matplotlib.pyplot.savefig" ]
[((193, 216), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (195, 216), False, 'from matplotlib import rc\n'), ((1282, 1297), 'matplotlib.pyplot.subplot', 'py.subplot', (['(111)'], {}), '(111)\n', (1292, 1297), True, 'import matplotlib.pyplot as py\n'), ((4418, 4452), 'matplo...
import glob import cv2 import math import numpy as np from sklearn.model_selection import train_test_split #import matplotlib.pyplot as plt import h5py import scipy from PIL import Image from scipy import ndimage from matplotlib import pyplot as plt import matplotlib.image as mpimg from skimage.filters import threshol...
[ "numpy.uint8", "FeatureExtraction.Entropy", "FeatureExtraction.sumEntropy", "FeatureExtraction.informationMeasureOfCorelation1", "cv2.cvtColor", "skimage.feature.greycoprops", "FeatureExtraction.informationMeasureOfCorelation2", "FeatureExtraction.sumOfSquares", "FeatureExtraction.sumVariance", "s...
[((880, 922), 'skimage.io.imread', 'io.imread', (['image_list[index]'], {'as_grey': '(True)'}), '(image_list[index], as_grey=True)\n', (889, 922), False, 'from skimage import feature, io\n'), ((941, 970), 'cv2.imread', 'cv2.imread', (['image_list[index]'], {}), '(image_list[index])\n', (951, 970), False, 'import cv2\n'...
""" Geometry container base class. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-----------...
[ "yt.config.ytcfg.getboolean", "yt.funcs.iterable", "yt.utilities.logger.ytLogger.debug", "yt.utilities.on_demand_imports._h5py.File", "yt.utilities.exceptions.YTFieldNotFound", "yt.utilities.logger.ytLogger.info", "numpy.empty", "os.path.dirname", "os.path.isfile", "numpy.array", "yt.units.yt_ar...
[((1120, 1160), 'yt.utilities.parallel_tools.parallel_analysis_interface.ParallelAnalysisInterface.__init__', 'ParallelAnalysisInterface.__init__', (['self'], {}), '(self)\n', (1154, 1160), False, 'from yt.utilities.parallel_tools.parallel_analysis_interface import ParallelAnalysisInterface, parallel_root_only\n'), ((1...
import time import numpy as np import scipy.io as sio import h5py from sklearn.datasets import load_svmlight_file from sklearn.cluster import KMeans f = h5py.File('/code/BIDMach/data/MNIST8M/all.mat','r') t0 = time.time() data = f.get('/all') # Get a certain dataset X = np.array(data) t1 = time.time() t_read = t1 -...
[ "sklearn.cluster.KMeans", "h5py.File", "numpy.array", "time.time" ]
[((155, 207), 'h5py.File', 'h5py.File', (['"""/code/BIDMach/data/MNIST8M/all.mat"""', '"""r"""'], {}), "('/code/BIDMach/data/MNIST8M/all.mat', 'r')\n", (164, 207), False, 'import h5py\n'), ((213, 224), 'time.time', 'time.time', ([], {}), '()\n', (222, 224), False, 'import time\n'), ((274, 288), 'numpy.array', 'np.array...
"""Interfacing parameters for the OpenBCI Ganglion Board.""" from ble2lsl.devices.device import BasePacketHandler from ble2lsl.utils import bad_data_size, dict_partial_from_keys import struct from warnings import warn import numpy as np from pygatt import BLEAddressType NAME = "Ganglion" MANUFACTURER = "OpenBCI" ...
[ "numpy.copy", "struct.unpack", "numpy.zeros", "struct.pack", "ble2lsl.utils.dict_partial_from_keys", "ble2lsl.utils.bad_data_size", "numpy.array" ]
[((599, 630), 'ble2lsl.utils.dict_partial_from_keys', 'dict_partial_from_keys', (['STREAMS'], {}), '(STREAMS)\n', (621, 630), False, 'from ble2lsl.utils import bad_data_size, dict_partial_from_keys\n'), ((8030, 8073), 'ble2lsl.utils.bad_data_size', 'bad_data_size', (['unpacked', '(3)', '"""3-byte buffer"""'], {}), "(un...
import cv2 from imutils.video.pivideostream import PiVideoStream import time from tf_lite import Model import numpy as np import RPi.GPIO as GPIO from time import sleep from cv2 import resize from picamera import PiCamera import wiringpi as wiringpi GPIO.setmode(GPIO.BOARD) GPIO.setup(11, GPIO.OUT) GPIO.setup(13, GPIO....
[ "wiringpi.softPwmCreate", "numpy.argmax", "cv2.rectangle", "cv2.imencode", "RPi.GPIO.output", "cv2.imshow", "RPi.GPIO.setup", "cv2.cvtColor", "wiringpi.pinMode", "imutils.video.pivideostream.PiVideoStream", "numpy.reshape", "cv2.destroyAllWindows", "wiringpi.softPwmWrite", "tf_lite.Model",...
[((250, 274), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BOARD'], {}), '(GPIO.BOARD)\n', (262, 274), True, 'import RPi.GPIO as GPIO\n'), ((275, 299), 'RPi.GPIO.setup', 'GPIO.setup', (['(11)', 'GPIO.OUT'], {}), '(11, GPIO.OUT)\n', (285, 299), True, 'import RPi.GPIO as GPIO\n'), ((300, 324), 'RPi.GPIO.setup', 'GPIO.setu...
from config import HNConfig as Config import numpy as np from matplotlib import pyplot as plt from matplotlib import cm from matplotlib import colors import os window_size = 5 dpi = 100 iter_lim = 5000 record_moment = np.arange(0, iter_lim, 10) record = False delta_t = 0.01 noise = 0.001 u_0 = 0.02 param_a = 1.0 param...
[ "os.mkdir", "config.HNConfig.city_file.replace", "os.stat", "matplotlib.colors.Normalize", "os.path.dirname", "numpy.zeros", "numpy.ones", "numpy.genfromtxt", "matplotlib.pyplot.figure", "numpy.random.random", "numpy.linalg.norm", "numpy.arange", "numpy.reshape", "numpy.exp", "numpy.dot"...
[((219, 245), 'numpy.arange', 'np.arange', (['(0)', 'iter_lim', '(10)'], {}), '(0, iter_lim, 10)\n', (228, 245), True, 'import numpy as np\n'), ((476, 499), 'numpy.linalg.norm', 'np.linalg.norm', (['(p1 - p2)'], {}), '(p1 - p2)\n', (490, 499), True, 'import numpy as np\n'), ((683, 699), 'numpy.zeros', 'np.zeros', (['(n...
import copy import pandas as pd import numpy as np import warnings import logging from supervised.preprocessing.preprocessing_utils import PreprocessingUtils from supervised.preprocessing.preprocessing_categorical import PreprocessingCategorical from supervised.preprocessing.preprocessing_missing import PreprocessingM...
[ "pandas.DataFrame", "supervised.preprocessing.datetime_transformer.DateTimeTransformer", "supervised.exceptions.AutoMLException", "supervised.preprocessing.preprocessing_categorical.PreprocessingCategorical", "pandas.isnull", "supervised.preprocessing.goldenfeatures_transformer.GoldenFeaturesTransformer",...
[((1148, 1175), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1165, 1175), False, 'import logging\n'), ((2507, 2519), 'pandas.isnull', 'pd.isnull', (['y'], {}), '(y)\n', (2516, 2519), True, 'import pandas as pd\n'), ((21376, 21407), 'pandas.DataFrame', 'pd.DataFrame', (["{'prediction': ...
#!/usr/bin/env ipython # author: <NAME> # chunk the merged file and also build the chunkfile import numpy as np import pandas as pd import ipdb import mimic_paths n_splits = 50 def build_chunk_file(version='180817'): base_merged_dir = mimic_paths.merged_dir + version + '/reduced/' df = pd.read_hdf(base_merg...
[ "numpy.array_split", "pandas.read_csv", "pandas.read_hdf" ]
[((299, 370), 'pandas.read_hdf', 'pd.read_hdf', (["(base_merged_dir + 'merged_clean.h5')"], {'columns': "['PatientID']"}), "(base_merged_dir + 'merged_clean.h5', columns=['PatientID'])\n", (310, 370), True, 'import pandas as pd\n'), ((428, 458), 'numpy.array_split', 'np.array_split', (['pids', 'n_splits'], {}), '(pids,...
import matplotlib.pyplot as plt import numpy as np def draw_text(ax, x, y): max_y = np.max(y) for i, v in enumerate(y): text = str(y[i]) ax.text(x[i] - 0.045 * len(text), y[i], r'\textbf{' + text + '}') def draw_error_bar(ax, x, xticks, y_gpu, e_gpu, title, ylabel): offse...
[ "matplotlib.pyplot.show", "numpy.max", "numpy.array", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((90, 99), 'numpy.max', 'np.max', (['y'], {}), '(y)\n', (96, 99), True, 'import numpy as np\n'), ((663, 690), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (669, 690), True, 'import matplotlib.pyplot as plt\n'), ((695, 725), 'matplotlib.pyplot.rc', 'plt.rc', (['""...
"""Simulate a trading bot by predicting a series of values using train/test sets.""" from model import Forecast import numpy as np import copy from multiprocessing import Pool def simulate(p=1, d=0, q=0): """ This bot will perform the following steps. 1. Load data, pipeline, and split it into training an...
[ "copy.deepcopy", "model.Forecast", "numpy.append", "multiprocessing.Pool", "numpy.delete" ]
[((717, 743), 'model.Forecast', 'Forecast', (['"""blockchain.csv"""'], {}), "('blockchain.csv')\n", (725, 743), False, 'from model import Forecast\n'), ((1191, 1216), 'copy.deepcopy', 'copy.deepcopy', (['test_endog'], {}), '(test_endog)\n', (1204, 1216), False, 'import copy\n'), ((2482, 2508), 'multiprocessing.Pool', '...
import matplotlib as plt import numpy as np from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk from matplotlib.figure import Figure plt.use('TkAgg') #Adapted for python3 and contec data graphing from # https://stackoverflow.com/questions/43114508/can-a-pyqt-embedded-matplotlib-graph...
[ "matplotlib.backends.backend_tkagg.NavigationToolbar2Tk", "matplotlib.figure.Figure", "matplotlib.use", "numpy.loadtxt", "tkinter.Tk", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg" ]
[((168, 184), 'matplotlib.use', 'plt.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (175, 184), True, 'import matplotlib as plt\n'), ((1973, 1980), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (1978, 1980), True, 'import tkinter as tk\n'), ((514, 570), 'numpy.loadtxt', 'np.loadtxt', (['"""contec_data.csv"""'], {'skiprows': '(...
"""Class to create batches from a configuration""" import logging import math import random import numpy as np from .Batch import Batch from ..config.ExperimentConfig import ExperimentConfig from ..constants import DATA_OUT_INDEX, DATA_TYPE_TEST, DATA_TYPE_DEV from ..constants import DATA_TYPE_TRAIN class Batches(o...
[ "random.randint", "random.shuffle", "numpy.asarray", "numpy.random.randint", "logging.getLogger" ]
[((1208, 1252), 'logging.getLogger', 'logging.getLogger', (['"""shared.Batches.__init__"""'], {}), "('shared.Batches.__init__')\n", (1225, 1252), False, 'import logging\n'), ((5188, 5244), 'logging.getLogger', 'logging.getLogger', (['"""shared.Batches.find_min_num_batches"""'], {}), "('shared.Batches.find_min_num_batch...
import cv2 import numpy as np import pyrealsense2 as rs import pandas as pd import os from cubemos.skeletontracking.core_wrapper import CM_TargetComputeDevice from cubemos.skeletontracking.native_wrapper import Api import math joints = ['Nose','Neck','Right_shoulder','Right_elbow','Right_wrist','Left_shoulder', ...
[ "pandas.DataFrame", "pyrealsense2.decimation_filter", "cv2.circle", "math.sqrt", "pyrealsense2.pipeline", "cv2.waitKey", "pyrealsense2.spatial_filter", "numpy.zeros", "os.system", "pyrealsense2.align", "pyrealsense2.config", "pyrealsense2.rs2_deproject_pixel_to_point", "pyrealsense2.hole_fil...
[((695, 789), 'os.path.join', 'os.path.join', (['sdk_path', '"""models"""', '"""skeleton-tracking"""', '"""fp32"""', '"""skeleton-tracking.cubemos"""'], {}), "(sdk_path, 'models', 'skeleton-tracking', 'fp32',\n 'skeleton-tracking.cubemos')\n", (707, 789), False, 'import os\n'), ((856, 869), 'pyrealsense2.pipeline', ...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root for full license information. # factor_graph_input_pipeline.py : Defines the input pipeline for the PDP framework. import collections import json import linecache import numpy as np imp...
[ "numpy.stack", "linecache.getline", "json.loads", "torch.utils.data.DataLoader", "numpy.zeros", "numpy.array", "numpy.tile", "collections.OrderedDict", "numpy.concatenate", "torch.from_numpy" ]
[((3044, 3069), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (3067, 3069), False, 'import collections\n'), ((4208, 4228), 'json.loads', 'json.loads', (['json_str'], {}), '(json_str)\n', (4218, 4228), False, 'import json\n'), ((4533, 4571), 'numpy.stack', 'np.stack', (['(variable_ind, function...
# Copyright 2018 The Cirq Developers # # 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 ...
[ "cirq.ms", "cirq.QubitOrder.explicit", "cirq.testing.random_unitary", "cirq.unitary", "cirq.NamedQubit", "random.random", "cirq.allclose_up_to_global_phase", "numpy.sin", "cirq.two_qubit_matrix_to_ion_operations", "numpy.array", "numpy.cos", "cirq.Circuit", "numpy.eye", "numpy.sqrt" ]
[((879, 894), 'random.random', 'random.random', ([], {}), '()\n', (892, 894), False, 'import random\n'), ((903, 912), 'numpy.sin', 'np.sin', (['t'], {}), '(t)\n', (909, 912), True, 'import numpy as np\n'), ((921, 930), 'numpy.cos', 'np.cos', (['t'], {}), '(t)\n', (927, 930), True, 'import numpy as np\n'), ((1267, 1282)...
#!/usr/bin/env python3 #-*- coding:utf-8 -*- import numpy as np def selection_sort(arr): for i in range(len(arr)): j = i + np.argmin(arr[i:]) (arr[i],arr[j]) = (arr[j],arr[i]) return arr if __name__ == "__main__" : x = [1,3,24,5,6] x = selection_sort(x) print(x)
[ "numpy.argmin" ]
[((127, 145), 'numpy.argmin', 'np.argmin', (['arr[i:]'], {}), '(arr[i:])\n', (136, 145), True, 'import numpy as np\n')]
''' Social LSTM model implementation using Tensorflow Social LSTM Paper: http://vision.stanford.edu/pdf/CVPR16_N_LSTM.pdf Author : <NAME> Date: 10th October 2016 ''' import tensorflow as tf import numpy as np from tensorflow.python.ops import rnn_cell import ipdb # The Vanilla LSTM model class Model(): def __i...
[ "tensorflow.reduce_sum", "tensorflow.trainable_variables", "tensorflow.constant_initializer", "tensorflow.maximum", "tensorflow.reshape", "tensorflow.train.RMSPropOptimizer", "tensorflow.matmul", "tensorflow.python.ops.rnn_cell.BasicLSTMCell", "tensorflow.Variable", "tensorflow.sqrt", "tensorflo...
[((895, 954), 'tensorflow.python.ops.rnn_cell.BasicLSTMCell', 'rnn_cell.BasicLSTMCell', (['args.rnn_size'], {'state_is_tuple': '(False)'}), '(args.rnn_size, state_is_tuple=False)\n', (917, 954), False, 'from tensorflow.python.ops import rnn_cell\n'), ((1034, 1103), 'tensorflow.python.ops.rnn_cell.MultiRNNCell', 'rnn_ce...
""" Compute distance from an arrays """ import tensorflow as tf import sqlite3 import numpy as np import time def get_face_v(database_filename='face.db'): scope_conn = sqlite3.connect(database_filename) scope_cursor = scope_conn.cursor() records = [] sql_statement = 'SELECT vector ' + ' FROM image_f...
[ "tensorflow.global_variables_initializer", "numpy.asarray", "tensorflow.device", "tensorflow.Session", "numpy.square", "time.time", "tensorflow.transpose", "tensorflow.placeholder", "tensorflow.shape", "tensorflow.tile", "numpy.linalg.norm", "sqlite3.connect", "tensorflow.Graph", "tensorfl...
[((176, 210), 'sqlite3.connect', 'sqlite3.connect', (['database_filename'], {}), '(database_filename)\n', (191, 210), False, 'import sqlite3\n'), ((3218, 3229), 'time.time', 'time.time', ([], {}), '()\n', (3227, 3229), False, 'import time\n'), ((3464, 3481), 'numpy.asarray', 'np.asarray', (['facev'], {}), '(facev)\n', ...
import os, sys from pathlib import Path import numpy as np import matplotlib.pyplot as plt from matplotlib import patches import torch import torchvision # 1. Architecture from net_module.net import ConvMultiHypoNet, ConvMixtureDensityNet # 2. Training manager from network_manager import NetworkManager # 3. Data han...
[ "util.utils_test.fit_DBSCAN", "pathlib.Path", "network_manager.NetworkManager", "os.path.join", "torch.load", "data_handle.data_handler_zip.ToTensor", "matplotlib.pyplot.cla", "numpy.linspace", "matplotlib.pyplot.subplots", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "matplotlib.pyplo...
[((662, 708), 'os.path.join', 'os.path.join', (['root_dir', '"""Config/"""', 'config_file'], {}), "(root_dir, 'Config/', config_file)\n", (674, 708), False, 'import os, sys\n'), ((717, 749), 'util.utils_yaml.from_yaml', 'utils_yaml.from_yaml', (['param_path'], {}), '(param_path)\n', (737, 749), False, 'from util import...
import math import numpy as np from shapely.geometry import Point from shapely.geometry.polygon import Polygon import shapely def array_minmax(x): mn = np.min(x) mx = np.max(x) md = (mn + mx)/2.0 (mn,mx) = ((mn-md)*1.2+md, (mx-md)*1.2+md) return (mn, mx) def create_samples(count, uv_poly): pr...
[ "shapely.geometry.Point", "numpy.meshgrid", "matplotlib.pyplot.show", "math.isnan", "matplotlib.pyplot.plot", "numpy.min", "numpy.max", "numpy.arange", "shapely.geometry.polygon.Polygon", "numpy.array", "numpy.random.rand", "image_loader.load_image_withsize", "numpy.concatenate" ]
[((158, 167), 'numpy.min', 'np.min', (['x'], {}), '(x)\n', (164, 167), True, 'import numpy as np\n'), ((177, 186), 'numpy.max', 'np.max', (['x'], {}), '(x)\n', (183, 186), True, 'import numpy as np\n'), ((489, 499), 'shapely.geometry.polygon.Polygon', 'Polygon', (['a'], {}), '(a)\n', (496, 499), False, 'from shapely.ge...
# coding=utf-8 # Copyright 2018 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
[ "tf_agents.specs.array_spec.BoundedArraySpec", "tf_agents.policies.py_tf_eager_policy.PyTFEagerPolicy", "tf_agents.policies.py_tf_eager_policy.SavedModelPyTFEagerPolicy", "tf_agents.agents.ddpg.actor_network.ActorNetwork", "tf_agents.trajectories.time_step.time_step_spec", "tensorflow.nest.map_structure",...
[((6472, 6518), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['None', '(0)', '(100)', '(200000)'], {}), '(None, 0, 100, 200000)\n', (6496, 6518), False, 'from absl.testing import parameterized\n'), ((10732, 10749), 'tf_agents.utils.test_utils.main', 'test_utils.main', ([], {}), '()\n', (10747, ...
import argparse import tensorflow as tf from docqa.model_dir import ModelDir import numpy as np def main(): parser = argparse.ArgumentParser(description='') parser.add_argument("model") args = parser.parse_args() model_dir = ModelDir(args.model) checkpoint = model_dir.get_best_weights() print...
[ "tensorflow.train.NewCheckpointReader", "argparse.ArgumentParser", "numpy.prod", "docqa.model_dir.ModelDir" ]
[((123, 162), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""""""'}), "(description='')\n", (146, 162), False, 'import argparse\n'), ((244, 264), 'docqa.model_dir.ModelDir', 'ModelDir', (['args.model'], {}), '(args.model)\n', (252, 264), False, 'from docqa.model_dir import ModelDir\n'), (...
#! /usr/bin/env python from matplotlib.pyplot import sci import numpy as np import math as m from scipy import linalg # test pass def generate_H (traj_constant, timelist): max_exponent = traj_constant.max_exponent max_diff = traj_constant.max_diff trajs_num = timelist.shape[0]-1 H = np.zeros((0,0)) ...
[ "scipy.linalg.block_diag", "numpy.zeros", "math.factorial" ]
[((301, 317), 'numpy.zeros', 'np.zeros', (['(0, 0)'], {}), '((0, 0))\n', (309, 317), True, 'import numpy as np\n'), ((330, 389), 'numpy.zeros', 'np.zeros', (['(max_exponent + 1, max_exponent + 1)'], {'dtype': 'float'}), '((max_exponent + 1, max_exponent + 1), dtype=float)\n', (338, 389), True, 'import numpy as np\n'), ...
import open3d as o3d import numpy as np import python.open3d_tutorial as o3dtut # http://www.open3d.org/docs/release/tutorial/geometry/mesh_deformation.html ######################################################################################################################## # 1. Mesh deformation ##################...
[ "open3d.utility.VerbosityContextManager", "numpy.asarray", "python.open3d_tutorial.get_armadillo_mesh", "numpy.where", "numpy.array", "open3d.utility.Vector3dVector", "open3d.utility.IntVector" ]
[((1352, 1379), 'python.open3d_tutorial.get_armadillo_mesh', 'o3dtut.get_armadillo_mesh', ([], {}), '()\n', (1377, 1379), True, 'import python.open3d_tutorial as o3dtut\n'), ((1392, 1417), 'numpy.asarray', 'np.asarray', (['mesh.vertices'], {}), '(mesh.vertices)\n', (1402, 1417), True, 'import numpy as np\n'), ((1651, 1...
"""Functions for rounding numbers.""" import functools import numpy as np def np_vectorize(f): """Like `np.vectorize`, but with some embellishments. - Includes `functools.wraps` - Applies `.item()` to output if input was a scalar. """ vectorized = np.vectorize(f) @functools.wraps(f) de...
[ "numpy.vectorize", "numpy.abs", "numpy.isscalar", "numpy.isnan", "functools.wraps", "numpy.round" ]
[((273, 288), 'numpy.vectorize', 'np.vectorize', (['f'], {}), '(f)\n', (285, 288), True, 'import numpy as np\n'), ((295, 313), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (310, 313), False, 'import functools\n'), ((1436, 1447), 'numpy.isnan', 'np.isnan', (['x'], {}), '(x)\n', (1444, 1447), True, 'import...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "<NAME>" __email__ = "<EMAIL>" __description__ = """ Img processor for decision if mouth is open or close """ import sys import os import cv2 import numpy as np from pprint import pprint # root of project repository THE_FILE_DIR = os.path.join(os.path.dir...
[ "sys.path.append", "os.path.abspath", "src.img.container.geometry.Point", "numpy.linalg.norm", "src.img.container.result.ImageProcessorResult", "os.path.join" ]
[((436, 465), 'sys.path.append', 'sys.path.append', (['PROJECT_ROOT'], {}), '(PROJECT_ROOT)\n', (451, 465), False, 'import sys\n'), ((384, 434), 'os.path.join', 'os.path.join', (['THE_FILE_DIR', '"""../../.."""', '""".."""', '""".."""'], {}), "(THE_FILE_DIR, '../../..', '..', '..')\n", (396, 434), False, 'import os\n')...
import os import math import numpy as np import pickle from PIL import Image import matplotlib.pyplot as plt import torch import torchvision def tensor2im(img, imtype=np.uint8, unnormalize=True, idx=0, nrows=None): if img.shape[1] == 1: # img = np.repeat(img, 3, axis=1) img = torch.cat((img, img,...
[ "os.makedirs", "numpy.random.rand", "numpy.asarray", "numpy.savetxt", "numpy.zeros", "torch.cat", "os.path.exists", "os.path.dirname", "torchvision.utils.make_grid", "numpy.ones", "pickle.load", "numpy.random.randint", "PIL.Image.fromarray" ]
[((1442, 1470), 'PIL.Image.fromarray', 'Image.fromarray', (['image_numpy'], {}), '(image_numpy)\n', (1457, 1470), False, 'from PIL import Image\n'), ((1573, 1620), 'numpy.savetxt', 'np.savetxt', (['path', 'data'], {'delimiter': '""","""', 'fmt': '"""%s"""'}), "(path, data, delimiter=',', fmt='%s')\n", (1583, 1620), Tru...
from tempfile import TemporaryDirectory, NamedTemporaryFile import numpy as np import pytest from lhotse import ( ChunkedLilcomHdf5Writer, LilcomFilesWriter, LilcomHdf5Writer, NumpyFilesWriter, NumpyHdf5Writer, ) from lhotse.array import Array, TemporalArray @pytest.mark.parametrize( "array"...
[ "tempfile.NamedTemporaryFile", "tempfile.TemporaryDirectory", "lhotse.array.Array", "numpy.testing.assert_almost_equal", "lhotse.NumpyHdf5Writer", "numpy.arange", "numpy.testing.assert_equal", "lhotse.array.TemporalArray.from_dict", "pytest.mark.parametrize", "pytest.mark.xfail" ]
[((1939, 2017), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""writer_class"""', '[LilcomFilesWriter, LilcomHdf5Writer]'], {}), "('writer_class', [LilcomFilesWriter, LilcomHdf5Writer])\n", (1962, 2017), False, 'import pytest\n'), ((3135, 3170), 'lhotse.array.TemporalArray.from_dict', 'TemporalArray.from_di...
""" Create a uniformly spaced (lon,lat) grid of initial particle locations based on nemo bathymetry """ import numpy as np from netCDF4 import Dataset import matplotlib.pyplot as plt from scipy.interpolate import griddata from mpl_toolkits.basemap import Basemap spacing = 0.1 #spacing between particles plotspacing = ...
[ "netCDF4.Dataset", "numpy.meshgrid", "numpy.histogram2d", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.figure", "numpy.min", "numpy.array", "numpy.reshape", "numpy.arange", "matplotlib.pyplot.pcolormesh", "numpy.max", "mpl_toolkits.basemap.Basemap" ]
[((535, 557), 'netCDF4.Dataset', 'Dataset', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (542, 557), False, 'from netCDF4 import Dataset\n'), ((567, 599), 'numpy.array', 'np.array', (["data['Bathy_level'][0]"], {}), "(data['Bathy_level'][0])\n", (575, 599), True, 'import numpy as np\n'), ((608, 638), 'numpy.arra...
import os import numpy as np def generate_first_N_primes(N): ii, jj, flag = 0, 0, 0 primes = [] # Traverse each number from 1 to N # with the help of for loop for ii in range(1, N + 1, 1): if (ii == 1 or ii == 0): # Skip 0 and 1 continue # flag variab...
[ "numpy.floor", "numpy.zeros", "numpy.ones" ]
[((824, 842), 'numpy.zeros', 'np.zeros', (['(dim, n)'], {}), '((dim, n))\n', (832, 842), True, 'import numpy as np\n'), ((1150, 1161), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (1158, 1161), True, 'import numpy as np\n'), ((797, 809), 'numpy.ones', 'np.ones', (['dim'], {}), '(dim)\n', (804, 809), True, 'import n...
# Copyright (c) 2020, <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: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the fo...
[ "numpy.ceil", "numpy.floor", "numpy.nonzero", "numpy.linalg.inv", "numpy.array", "numpy.diag" ]
[((4541, 4557), 'numpy.array', 'np.array', (['scales'], {}), '(scales)\n', (4549, 4557), True, 'import numpy as np\n'), ((4752, 4824), 'numpy.array', 'np.array', (['[[i, j, k] for k in (-1, 1) for j in (-1, 1) for i in (-1, 1)]'], {}), '([[i, j, k] for k in (-1, 1) for j in (-1, 1) for i in (-1, 1)])\n', (4760, 4824), ...
# -*- coding: utf-8 -*- import sys, os, importlib, pdb, random, datetime, collections, pickle, cv2, requests import matplotlib.pyplot as plt, numpy as np, scipy.spatial.distance from sklearn import svm, metrics, calibration from PIL import Image, ExifTags random.seed(0) ################################ # ImageInfo c...
[ "matplotlib.pyplot.title", "random.shuffle", "numpy.isnan", "pickle.load", "numpy.linalg.norm", "cv2.imshow", "numpy.round", "random.randint", "cv2.cvtColor", "cv2.copyMakeBorder", "os.path.exists", "cv2.split", "random.seed", "requests.get", "cv2.resize", "matplotlib.pyplot.ylim", "...
[((257, 271), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (268, 271), False, 'import sys, os, importlib, pdb, random, datetime, collections, pickle, cv2, requests\n'), ((6221, 6279), 'matplotlib.pyplot.scatter', 'plt.scatter', (['scoresTrain', 'probsTrain'], {'c': '"""r"""', 'label': '"""train"""'}), "(scores...
import numpy as np array = np.array([ [[+0, +1, +2], [+3, +4, +5], [+6, +7, +8], [+9, 10, 11], [12, 13, 14]], [[15, 16, 17], [18, 19, 20], [21, 22, 23], [24, 25, 26], [27, 28, 29]], [[30, 31, 32], [33, 34, 35], [36, 37, 38], [39, 40, 41], [42, 43, 44]], [[45, 46, 47], [48, 49, 50], [51, 52, 53], [54, 5...
[ "numpy.nditer", "numpy.array" ]
[((28, 342), 'numpy.array', 'np.array', (['[[[+0, +1, +2], [+3, +4, +5], [+6, +7, +8], [+9, 10, 11], [12, 13, 14]], [[\n 15, 16, 17], [18, 19, 20], [21, 22, 23], [24, 25, 26], [27, 28, 29]], [\n [30, 31, 32], [33, 34, 35], [36, 37, 38], [39, 40, 41], [42, 43, 44]],\n [[45, 46, 47], [48, 49, 50], [51, 52, 53], ...
import numpy as np import cvxpy as cvx class BlackLittermanPortfolio(): def __init__(self, exp_returns, sigma, market_cap, prior, delta, tau, min_returns, omega): if len(prior) == 0: self.prior = self.calculate_prior(sigma, market_cap, delta, tau) else: self.prior = prior ...
[ "numpy.identity", "numpy.array", "cvxpy.Problem", "numpy.reshape", "cvxpy.Variable", "numpy.linalg.inv", "numpy.diag", "cvxpy.quad_form" ]
[((960, 994), 'numpy.identity', 'np.identity', (['views_vector.shape[0]'], {}), '(views_vector.shape[0])\n', (971, 994), True, 'import numpy as np\n'), ((1780, 1797), 'cvxpy.Variable', 'cvx.Variable', (['dim'], {}), '(dim)\n', (1792, 1797), True, 'import cvxpy as cvx\n'), ((1865, 1888), 'numpy.reshape', 'np.reshape', (...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides WCS helper tools. """ from astropy import units as u from astropy.coordinates import UnitSphericalRepresentation from astropy.wcs import WCS from astropy.wcs.utils import pixel_to_skycoord, skycoord_to_pixel import numpy as np d...
[ "numpy.arctan2", "astropy.wcs.utils.skycoord_to_pixel", "numpy.hypot", "astropy.coordinates.UnitSphericalRepresentation", "astropy.wcs.utils.pixel_to_skycoord" ]
[((4251, 4283), 'astropy.wcs.utils.skycoord_to_pixel', 'skycoord_to_pixel', (['skycoord', 'wcs'], {}), '(skycoord, wcs)\n', (4268, 4283), False, 'from astropy.wcs.utils import pixel_to_skycoord, skycoord_to_pixel\n'), ((4359, 4417), 'astropy.coordinates.UnitSphericalRepresentation', 'UnitSphericalRepresentation', (['co...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import contextlib import copy import io import itertools import json import logging import numpy as np import os import pickle from collections import OrderedDict import pynlostools.mask as mask_util import torch from fvcore.common.file_io import Pa...
[ "pickle.dump", "torch.cat", "pynlostools.nlos.NLOS", "json.dumps", "numpy.mean", "detectron2.utils.logger.create_small_table", "torch.arange", "torch.device", "pynlostools.nloseval.NLOSeval", "detectron2.data.MetadataCatalog.get", "os.path.join", "detectron2.structures.pairwise_iou", "fvcore...
[((17202, 17260), 'detectron2.structures.BoxMode.convert', 'BoxMode.convert', (['boxes', 'BoxMode.XYXY_ABS', 'BoxMode.XYWH_ABS'], {}), '(boxes, BoxMode.XYXY_ABS, BoxMode.XYWH_ABS)\n', (17217, 17260), False, 'from detectron2.structures import Boxes, BoxMode, pairwise_iou\n'), ((22757, 22780), 'torch.sort', 'torch.sort',...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import numpy as np import unittest from scipy.constants import mu_0 from SimPEG.electromagnetics import natural_source as nsem from SimPEG import maps TOL = 1e-4 FLR = 1e-20 # "zero", so if residual below t...
[ "unittest.main", "SimPEG.electromagnetics.natural_source.utils.test_utils.setup1DSurvey", "numpy.random.seed", "numpy.abs", "SimPEG.maps.IdentityMap", "numpy.random.rand" ]
[((514, 589), 'SimPEG.electromagnetics.natural_source.utils.test_utils.setup1DSurvey', 'nsem.utils.test_utils.setup1DSurvey', (['sigmaHalf'], {'tD': 'forType', 'structure': '(False)'}), '(sigmaHalf, tD=forType, structure=False)\n', (549, 589), True, 'from SimPEG.electromagnetics import natural_source as nsem\n'), ((103...
#!/usr/bin/env python from __future__ import print_function import logging import os import sys import keras import numpy as np import pandas as pd from tqdm import tqdm import c_lm import preprocess # logging logging.basicConfig(format='%(asctime)s %(process)s %(levelname)-8s %(message)s', stream=sys.stdout) log ...
[ "pandas.DataFrame", "logging.basicConfig", "c_lm.vectorise", "numpy.zeros", "numpy.mean", "keras.models.Sequential", "os.path.join", "os.listdir", "logging.getLogger" ]
[((215, 320), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(process)s %(levelname)-8s %(message)s"""', 'stream': 'sys.stdout'}), "(format=\n '%(asctime)s %(process)s %(levelname)-8s %(message)s', stream=sys.stdout)\n", (234, 320), False, 'import logging\n'), ((322, 349), 'logging.ge...
# -*- coding: utf-8 -*- from typing import Dict, List, NamedTuple, Optional, Tuple, Union import numpy as np import pandas as pd import pymatgen as pmg import spyns Neighbor = Tuple[pmg.PeriodicSite, float, int] SiteNeighbors = List[Optional[Neighbor]] AllNeighborDistances = List[SiteNeighbors] NeighborDistances = ...
[ "pandas.DataFrame", "pandas.IntervalIndex.from_breaks", "pandas.cut", "numpy.isclose", "pandas.Categorical", "spyns.lattice.generate.add_subspecie_labels_if_missing", "numpy.concatenate" ]
[((1167, 1252), 'spyns.lattice.generate.add_subspecie_labels_if_missing', 'spyns.lattice.generate.add_subspecie_labels_if_missing', ([], {'cell_structure': 'structure'}), '(cell_structure=structure\n )\n', (1221, 1252), False, 'import spyns\n'), ((6223, 6302), 'numpy.concatenate', 'np.concatenate', (['(unique_floats...
# Standard Library import os import time from datetime import datetime # Third Party import numpy as np import pytest import xgboost from tests.core.utils import check_tf_events, delete_local_trials, verify_files # First Party from smdebug.core.modes import ModeKeys from smdebug.core.save_config import SaveConfig, Sa...
[ "tests.core.utils.delete_local_trials", "numpy.random.seed", "xgboost.train", "datetime.datetime.now", "time.time", "smdebug.core.save_config.SaveConfigMode", "smdebug.core.save_config.SaveConfig", "tests.core.utils.check_tf_events", "numpy.random.randint", "tests.core.utils.verify_files", "nump...
[((2346, 2424), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""collection"""', "[('all', '.*'), ('scalars', '^scalar')]"], {}), "('collection', [('all', '.*'), ('scalars', '^scalar')])\n", (2369, 2424), False, 'import pytest\n'), ((2788, 2844), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""wi...
import cv2 import numpy as np cap = cv2.VideoCapture('./video/Teletubbies_Trim.mp4') while True: ret, frame = cap.read() if not ret: cap = cv2.VideoCapture('./video/Teletubbies_Trim.mp4') ret, frame = cap.read() # break cv2.imshow('frame', frame) # color filtering hsv = cv...
[ "cv2.bitwise_and", "cv2.dilate", "cv2.cvtColor", "cv2.morphologyEx", "cv2.waitKey", "cv2.imshow", "numpy.ones", "cv2.VideoCapture", "numpy.array", "cv2.erode", "cv2.destroyAllWindows", "cv2.inRange" ]
[((37, 85), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""./video/Teletubbies_Trim.mp4"""'], {}), "('./video/Teletubbies_Trim.mp4')\n", (53, 85), False, 'import cv2\n'), ((1165, 1188), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1186, 1188), False, 'import cv2\n'), ((258, 284), 'cv2.imshow', 'c...
from skimage import io import matplotlib.pyplot as plt import numpy as np import os import sys if __name__ == "__main__": from libExtractTile import getNotEmptyTiles import npImageNormalizations as npImNorm else: from .libExtractTile import getNotEmptyTiles #import .npImageNormalizations as npImNorm imp...
[ "npImageNormalizations.getImageContrast_withoutPureWhite", "matplotlib.pyplot.show", "os.path.join", "math.sqrt", "math.ceil", "npImageNormalizations.getImageMean_withoutPureWhite", "matplotlib.pyplot.imshow", "os.path.exists", "matplotlib.pyplot.figure", "numpy.mean", "numpy.array", "npImageN...
[((2594, 2606), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (2604, 2606), True, 'import matplotlib.pyplot as plt\n'), ((2611, 2634), 'matplotlib.pyplot.imshow', 'plt.imshow', (['testCase.im'], {}), '(testCase.im)\n', (2621, 2634), True, 'import matplotlib.pyplot as plt\n'), ((2868, 2907), 'libExtractTil...
import glob import skimage.io as io import skimage.transform as trans import numpy as np import pylab as plt def square_image(img, random = None): """ Square Image Function that takes an image (ndarray), gets its maximum dimension, creates a black square canvas of max dimension and puts the origin...
[ "pylab.show", "numpy.zeros", "pylab.imshow", "skimage.transform.resize", "numpy.reshape" ]
[((640, 674), 'numpy.zeros', 'np.zeros', (['(size, size)', 'np.float32'], {}), '((size, size), np.float32)\n', (648, 674), True, 'import numpy as np\n'), ((1090, 1120), 'skimage.transform.resize', 'trans.resize', (['img', 'target_size'], {}), '(img, target_size)\n', (1102, 1120), True, 'import skimage.transform as tran...
""" Copyright (c) 2018-2019 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 i...
[ "mo.graph.graph.Node", "numpy.array", "mo.middle.passes.fusing.helpers.get_next_operation", "mo.middle.passes.eliminate.graph_clean_up_tf", "mo.middle.passes.eliminate.merge_data_nodes" ]
[((1567, 1584), 'mo.graph.graph.Node', 'Node', (['graph', 'node'], {}), '(graph, node)\n', (1571, 1584), False, 'from mo.graph.graph import Node, Graph\n'), ((3442, 3498), 'mo.middle.passes.eliminate.merge_data_nodes', 'merge_data_nodes', (['graph', 'first_data_node', 'last_data_node'], {}), '(graph, first_data_node, l...
"""Wrapped xgboost for tabular datasets.""" from time import perf_counter import logging from copy import copy from copy import deepcopy from typing import Optional from typing import Callable from typing import Tuple from typing import Dict import xgboost as xgb from xgboost import dask as dxgb import numpy as np ...
[ "copy.deepcopy", "xgboost.train", "lightautoml.ml_algo.tuning.base.SearchSpace", "copy.copy", "time.perf_counter", "xgboost.dask.train", "xgboost.dask.inplace_predict", "xgboost.dask.DaskDeviceQuantileDMatrix", "numpy.array", "pandas.Series", "cupy.cuda.Device", "cupy.copy", "xgboost.DMatrix...
[((814, 841), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (831, 841), False, 'import logging\n'), ((2201, 2218), 'copy.copy', 'copy', (['self.params'], {}), '(self.params)\n', (2205, 2218), False, 'from copy import copy\n'), ((2357, 2376), 'logging.getLogger', 'logging.getLogger', ([],...