code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
from datetime import datetime import numpy as np import pytest import pandas as pd from pandas import ( Categorical, CategoricalIndex, DataFrame, Index, MultiIndex, Series, qcut, ) import pandas._testing as tm def cartesian_product_for_groupers(result, args, names, fill...
[ "pandas._testing.assert_equal", "numpy.sum", "pandas._testing.assert_dict_equal", "numpy.random.randint", "numpy.arange", "numpy.mean", "pytest.mark.parametrize", "pandas._testing.assert_numpy_array_equal", "pandas.CategoricalIndex", "pandas.DataFrame", "numpy.random.randn", "pandas.Categorica...
[((7791, 7840), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ordered"""', '[True, False]'], {}), "('ordered', [True, False])\n", (7814, 7840), False, 'import pytest\n'), ((16907, 16956), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ordered"""', '[True, False]'], {}), "('ordered', [True, Fa...
""" compute partial correlation """ import numpy def pcor_from_precision(P,zero_diagonal=1): # given a precision matrix, compute the partial correlation matrix # based on wikipedia page: http://en.wikipedia.org/wiki/Partial_correlat #Using_matrix_inversion pcor=numpy.zeros(P.shape) for i in range(...
[ "numpy.zeros", "numpy.sqrt" ]
[((280, 300), 'numpy.zeros', 'numpy.zeros', (['P.shape'], {}), '(P.shape)\n', (291, 300), False, 'import numpy\n'), ((398, 427), 'numpy.sqrt', 'numpy.sqrt', (['(P[i, i] * P[j, j])'], {}), '(P[i, i] * P[j, j])\n', (408, 427), False, 'import numpy\n')]
# Copyright (c) OpenMMLab. All rights reserved. import random from tempfile import TemporaryDirectory import numpy as np import pytest import torch from scipy import stats from torch import nn from mmcv.cnn import (Caffe2XavierInit, ConstantInit, KaimingInit, NormalInit, PretrainedInit, TruncNor...
[ "torch.full", "mmcv.cnn.kaiming_init", "mmcv.cnn.Caffe2XavierInit", "mmcv.cnn.ConstantInit", "mmcv.cnn.initialize", "tempfile.TemporaryDirectory", "mmcv.cnn.caffe2_xavier_init", "torch.nn.Conv1d", "mmcv.cnn.XavierInit", "pytest.raises", "mmcv.cnn.normal_init", "torch.nn.Linear", "mmcv.cnn.Ka...
[((607, 626), 'torch.nn.Conv2d', 'nn.Conv2d', (['(3)', '(16)', '(3)'], {}), '(3, 16, 3)\n', (616, 626), False, 'from torch import nn\n'), ((631, 662), 'mmcv.cnn.constant_init', 'constant_init', (['conv_module', '(0.1)'], {}), '(conv_module, 0.1)\n', (644, 662), False, 'from mmcv.cnn import Caffe2XavierInit, ConstantIni...
import numpy import clarity.IO as io; def writePoints(filename, points, **args): """Write point data to csv file Arguments: filename (str): file name points (array): point data Returns: str: file name """ numpy.savetxt(filename, points, delimiter=',', newlin...
[ "numpy.savetxt", "numpy.loadtxt", "clarity.IO.pointsToRange" ]
[((267, 339), 'numpy.savetxt', 'numpy.savetxt', (['filename', 'points'], {'delimiter': '""","""', 'newline': '"""\n"""', 'fmt': '"""%.5e"""'}), "(filename, points, delimiter=',', newline='\\n', fmt='%.5e')\n", (280, 339), False, 'import numpy\n'), ((616, 654), 'numpy.loadtxt', 'numpy.loadtxt', (['filename'], {'delimite...
from collections import Counter import json import os import time import numpy as np import pickle from ray import tune from ray.tune.durable_trainable import DurableTrainable class ProgressCallback(tune.callback.Callback): def __init__(self): self.last_update = 0 self.update_interval = 60 ...
[ "numpy.random.uniform", "ray.tune.uniform", "json.dump", "pickle.dump", "ray.tune.report", "ray.tune.run", "os.environ.get", "time.sleep", "time.time", "time.monotonic", "ray.tune.checkpoint_dir", "collections.Counter", "os.path.join", "os.getenv" ]
[((4338, 4372), 'os.getenv', 'os.getenv', (['"""AWS_ACCESS_KEY_ID"""', '""""""'], {}), "('AWS_ACCESS_KEY_ID', '')\n", (4347, 4372), False, 'import os\n'), ((4390, 4428), 'os.getenv', 'os.getenv', (['"""AWS_SECRET_ACCESS_KEY"""', '""""""'], {}), "('AWS_SECRET_ACCESS_KEY', '')\n", (4399, 4428), False, 'import os\n'), ((4...
import numpy as np from scipy import signal, sparse import matplotlib.pyplot as plt from matplotlib import animation, rc from matplotlib.collections import LineCollection from matplotlib.gridspec import GridSpec from sklearn import preprocessing from scipy.spatial import distance #-----------------------------------...
[ "matplotlib.collections.LineCollection", "numpy.random.seed", "numpy.vectorize", "sklearn.preprocessing.scale", "scipy.signal.sawtooth", "numpy.linalg.eigh", "numpy.min", "numpy.random.randint", "numpy.max", "numpy.sin", "numpy.cos", "numpy.column_stack" ]
[((628, 650), 'numpy.vectorize', 'np.vectorize', (['periodic'], {}), '(periodic)\n', (640, 650), True, 'import numpy as np\n'), ((802, 824), 'numpy.vectorize', 'np.vectorize', (['triangle'], {}), '(triangle)\n', (814, 824), True, 'import numpy as np\n'), ((949, 970), 'numpy.vectorize', 'np.vectorize', (['cos_fun'], {})...
# Copyright 2018 <NAME> # # 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, softw...
[ "galini.io.writer.MessageWriter", "h5py.File", "logging.FileHandler", "galini.io.message.add_bab_node_message", "galini.io.message.update_variable_message", "logging.StreamHandler", "galini.io.message.text_message", "galini.io.message.prune_bab_node_message", "logging.Logger", "numpy.shape", "pa...
[((2039, 2063), 'logging.Logger', 'logging.Logger', (['__name__'], {}), '(__name__)\n', (2053, 2063), False, 'import logging\n'), ((3527, 3542), 'pathlib.Path', 'Path', (['directory'], {}), '(directory)\n', (3531, 3542), False, 'from pathlib import Path\n'), ((3726, 3759), 'galini.io.writer.MessageWriter', 'MessageWrit...
#!/usr/bin/env python # coding: utf-8 # # Finetuning FakeNewsAAAI # FakeNewsAAAI is a Fake News dataset with 2 possible labels: `real` and `fake` # In[1]: import os, sys import re import argparse import random import numpy as np import pandas as pd import torch from torch import optim import torch.nn.functional as ...
[ "transformers.AutoConfig.from_pretrained", "numpy.random.seed", "argparse.ArgumentParser", "torch.manual_seed", "torch.load", "torch.cuda.manual_seed", "utils.data_utils.FakeNewsDataLoader", "utils.metrics.classification_metrics_fn", "transformers.AutoTokenizer.from_pretrained", "random.seed", "...
[((681, 698), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (692, 698), False, 'import random\n'), ((703, 723), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (717, 723), True, 'import numpy as np\n'), ((728, 751), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (74...
""" A simple SVC model, for reference please see https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html I am only using five pickle parameters as feaures, in principle more features can be used and one can also generate features on the go using the data passed in to the Model. """ import numpy as np ...
[ "sklearn.ensemble.RandomForestClassifier", "cPickle.dump", "numpy.hstack" ]
[((614, 715), 'sklearn.ensemble.RandomForestClassifier', 'RandomForestClassifier', ([], {'n_estimators': 'n_estimators', 'max_depth': 'max_depth', 'random_state': 'random_state'}), '(n_estimators=n_estimators, max_depth=max_depth,\n random_state=random_state)\n', (636, 715), False, 'from sklearn.ensemble import Rand...
#DISCLAIRMER: ESTE CODIGO ES A MODO DE EJEMPLO DIDÁCTICO, NO CONTIENE CONTROL DE ERRORES, NI SOFISTICACIONES, NI MEJORAS DE # PERFORMANCE. TODOS LOS USOS DE LIBRERIAS EXTERNAS PUEDEN SER MEJORADAS EN SU IMPLEMENTACIÓN. # =================================================================================== import matplot...
[ "sklearn.ensemble.RandomForestClassifier", "matplotlib.pyplot.show", "csv.DictReader", "numpy.asarray", "numpy.zeros", "osgeo.osr.CoordinateTransformation", "matplotlib.pyplot.colorbar", "numpy.array", "numpy.reshape", "osgeo.ogr.Geometry", "osgeo.gdal.Open", "osgeo.osr.SpatialReference" ]
[((930, 951), 'osgeo.gdal.Open', 'gdal.Open', (['image_name'], {}), '(image_name)\n', (939, 951), False, 'from osgeo import gdal, ogr, osr\n'), ((1008, 1087), 'numpy.zeros', 'np.zeros', (['(raster_ds.RasterYSize, raster_ds.RasterXSize, raster_ds.RasterCount)'], {}), '((raster_ds.RasterYSize, raster_ds.RasterXSize, rast...
import numpy as np import param from ..core import util from ..core import Dimension, Dataset, Element2D from ..core.data import GridInterface class Chart(Dataset, Element2D): """ The data held within Chart is a numpy array of shape (N, D), where N is the number of samples and D the number of dimensions...
[ "param.List", "numpy.nanmin", "numpy.array", "numpy.column_stack", "param.String", "numpy.nanmax" ]
[((801, 845), 'param.String', 'param.String', ([], {'default': '"""Chart"""', 'constant': '(True)'}), "(default='Chart', constant=True)\n", (813, 845), False, 'import param\n'), ((1999, 2045), 'param.String', 'param.String', ([], {'default': '"""Scatter"""', 'constant': '(True)'}), "(default='Scatter', constant=True)\n...
import random import numpy as np def generate(total,list_total,five_hits,five_hits_and_miss): m = [] for i in range(6): temp = random.randint(1,10) if temp == 1: m.append(False) else: m.append(True) num_hits = m.count(True) total += num_hits list_tota...
[ "numpy.std", "random.randint" ]
[((790, 808), 'numpy.std', 'np.std', (['list_total'], {}), '(list_total)\n', (796, 808), True, 'import numpy as np\n'), ((143, 164), 'random.randint', 'random.randint', (['(1)', '(10)'], {}), '(1, 10)\n', (157, 164), False, 'import random\n')]
from howtrader.app.cta_strategy import ( CtaTemplate, StopOrder, TickData, BarData, TradeData, OrderData ) from howtrader.app.cta_strategy.engine import CtaEngine from howtrader.trader.event import EVENT_TIMER from howtrader.event import Event from howtrader.trader.object import Status, Directi...
[ "talib.ADXR", "talib.TRANGE", "talib.WILLR", "talib.KAMA", "talib.MOM", "talib.AROONOSC", "talib.MAX", "talib.ADX", "talib.PLUS_DI", "howtrader.app.cta_strategy.BarGenerator", "talib.ROCR", "talib.APO", "talib.AD", "talib.MINUS_DM", "talib.NATR", "talib.DX", "talib.BOP", "talib.MIN...
[((894, 908), 'numpy.zeros', 'np.zeros', (['size'], {}), '(size)\n', (902, 908), True, 'import numpy as np\n'), ((947, 961), 'numpy.zeros', 'np.zeros', (['size'], {}), '(size)\n', (955, 961), True, 'import numpy as np\n'), ((999, 1013), 'numpy.zeros', 'np.zeros', (['size'], {}), '(size)\n', (1007, 1013), True, 'import ...
## Generates prediction of the steering angles for a given dashboard image ## Calls the imitation learning model trained # and obtained from the training code and imitates the expert's training data ## Access the test images from the testset folder to generate # predictions on them import os import cv2 import torc...
[ "torch.nn.Dropout", "cv2.VideoWriter_fourcc", "torch.cuda.device_count", "glob.glob", "cv2.cv2.cvtColor", "pandas.DataFrame", "torch.nn.MSELoss", "torch.utils.data.DataLoader", "cv2.cvtColor", "torch.load", "torchvision.transforms.Lambda", "torch.nn.Linear", "torch.nn.Conv2d", "torch.nn.EL...
[((894, 909), 'cv2.imread', 'cv2.imread', (['img'], {}), '(img)\n', (904, 909), False, 'import cv2\n'), ((1084, 1120), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_RGB2HSV'], {}), '(img, cv2.COLOR_RGB2HSV)\n', (1096, 1120), False, 'import cv2\n'), ((1132, 1159), 'numpy.random.uniform', 'np.random.uniform', (['(0...
import numpy as np def soda_strategy_discount(n_energy, n_nosugar): if n_energy <= n_nosugar: discount = -0.2; else: discount = 0.2; return discount def soda_strategy_nodiscount(n_energy, n_nosugar): discount = 0.0; return discount def soda_strategy_param(n_energy, n_nosugar, ...
[ "numpy.sign" ]
[((401, 430), 'numpy.sign', 'np.sign', (['(n_energy - n_nosugar)'], {}), '(n_energy - n_nosugar)\n', (408, 430), True, 'import numpy as np\n')]
""" Summary ------- Simulate expected revenue for a hotel. """ import numpy as np from base import Model, Problem class Hotel(Model): """ A model that simulates business of a hotel with Poisson arrival rate. Attributes ---------- name : string name of model n_rngs : int numbe...
[ "numpy.sum", "numpy.zeros", "numpy.ones", "numpy.array", "numpy.dot" ]
[((7494, 7537), 'numpy.array', 'np.array', (["self.factors['product_incidence']"], {}), "(self.factors['product_incidence'])\n", (7502, 7537), True, 'import numpy as np\n'), ((7891, 7942), 'numpy.zeros', 'np.zeros', (["(self.factors['num_products'], arr_bound)"], {}), "((self.factors['num_products'], arr_bound))\n", (7...
from typing import Union import numpy as np def manhattan( x: Union[list, np.array], y: Union[list, np.array] ) -> Union[float, list, np.array]: """Calculate manhattan distance between two points. The distance between two points measured along axes at right angles. Args: x: Point x y...
[ "numpy.abs", "numpy.square", "numpy.array" ]
[((393, 404), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (401, 404), True, 'import numpy as np\n'), ((445, 456), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (453, 456), True, 'import numpy as np\n'), ((646, 665), 'numpy.abs', 'np.abs', (['(x[0] - y[0])'], {}), '(x[0] - y[0])\n', (652, 665), True, 'import num...
from bodynavigation.advanced_segmentation import seg import numpy as np from loguru import logger import h5py import sed3 from bodynavigation.advanced_segmentation import lines import skimage.io import skimage import skimage.transform from bodynavigation.advanced_segmentation import CT_regression_tools import matplotli...
[ "bodynavigation.advanced_segmentation.CT_regression_tools.normalize", "h5py.File", "bodynavigation.advanced_segmentation.CT_regression_tools.resize", "numpy.asarray", "bodynavigation.advanced_segmentation.seg.read_scan", "loguru.logger.info", "loguru.logger.debug" ]
[((888, 921), 'bodynavigation.advanced_segmentation.seg.read_scan', 'seg.read_scan', (['"""3Dircadb1"""', '(i + 1)'], {}), "('3Dircadb1', i + 1)\n", (901, 921), False, 'from bodynavigation.advanced_segmentation import seg\n'), ((970, 1003), 'bodynavigation.advanced_segmentation.seg.read_scan', 'seg.read_scan', (['"""sl...
# Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
[ "apache_beam.metrics.Metrics.counter", "apache_beam.Map", "tensorflow.logging.info", "tensorflow.logging.debug", "tensorflow_data_validation.utils.batch_util.BatchExamplesToArrowTables", "tfx.types.artifact_utils.get_split_uri", "tfx.components.transform.common.GetSoleValue", "tensorflow.logging.warni...
[((10272, 10318), 'apache_beam.typehints.with_input_types', 'beam.typehints.with_input_types', (['beam.Pipeline'], {}), '(beam.Pipeline)\n', (10303, 10318), True, 'import apache_beam as beam\n'), ((10322, 10373), 'apache_beam.typehints.with_output_types', 'beam.typehints.with_output_types', (['beam.pvalue.PDone'], {}),...
import abc from typing import Dict import numpy as np from algorithms.abstract_state import AbstractState, AbstractMove from game.development_cards import DevelopmentCard from game.pieces import * from game.resource import Resource class AbstractPlayer(abc.ABC): c = 1 def __init__(self, seed: int=None, tim...
[ "numpy.random.RandomState" ]
[((536, 563), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (557, 563), True, 'import numpy as np\n')]
# ****************************************************************************** # Copyright 2017-2020 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.apa...
[ "ngraph.add", "ngraph.floor_mod", "ngraph.utils.tensor_iterator_types.TensorIteratorInvariantInputDesc", "ngraph.bucketize", "ngraph.lstm_sequence", "ngraph.proposal", "ngraph.psroi_pooling", "ngraph.assign", "ngraph.roi_pooling", "pytest.mark.parametrize", "ngraph.gru_cell", "ngraph.unsqueeze...
[((1109, 1151), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dtype"""', 'np_types'], {}), "('dtype', np_types)\n", (1132, 1151), False, 'import pytest\n'), ((1923, 1965), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""dtype"""', 'np_types'], {}), "('dtype', np_types)\n", (1946, 1965), False,...
# NAME: <NAME> # template matching # import all the required libraries packages import cv2 import numpy as np import argparse import json import os from timeit import default_timer as timer from skimage.io import imread_collection # construct the argument parser and parse the arguments #ap = argparse.ArgumentParser...
[ "json.dump", "cv2.cvtColor", "timeit.default_timer", "numpy.float32", "cv2.FlannBasedMatcher", "numpy.int32", "cv2.xfeatures2d.SIFT_create", "cv2.perspectiveTransform", "skimage.io.imread_collection", "cv2.findHomography", "os.listdir" ]
[((6757, 6786), 'cv2.xfeatures2d.SIFT_create', 'cv2.xfeatures2d.SIFT_create', ([], {}), '()\n', (6784, 6786), False, 'import cv2\n'), ((1445, 1452), 'timeit.default_timer', 'timer', ([], {}), '()\n', (1450, 1452), True, 'from timeit import default_timer as timer\n'), ((1644, 1694), 'cv2.FlannBasedMatcher', 'cv2.FlannBa...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides a container class to store parameters for the geometry of an ellipse. """ import math from astropy import log import numpy as np __all__ = ['EllipseGeometry'] IN_MASK = [ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], ...
[ "numpy.atleast_2d", "numpy.sum", "numpy.abs", "math.sqrt", "numpy.std", "numpy.zeros", "numpy.ones", "math.sin", "astropy.log.info", "math.acos", "numpy.sin", "numpy.array", "math.cos", "numpy.ma.masked_array", "numpy.cos", "numpy.sqrt" ]
[((5058, 5109), 'numpy.array', 'np.array', (['[fix_center, fix_center, fix_pa, fix_eps]'], {}), '([fix_center, fix_center, fix_pa, fix_eps])\n', (5066, 5109), True, 'import numpy as np\n'), ((8776, 8806), 'numpy.sum', 'np.sum', (['self._centerer_ones_in'], {}), '(self._centerer_ones_in)\n', (8782, 8806), True, 'import ...
""" Functions used for filtering data, or modifying existing filters. """ import numpy as np from latools.helpers.signal import bool_2_indices from latools.helpers.stat_fns import nominal_values def threshold(values, threshold): """ Return boolean arrays where a >= and < threshold. Parameters -------...
[ "latools.helpers.stat_fns.nominal_values", "numpy.diff", "latools.helpers.signal.bool_2_indices", "numpy.roll" ]
[((519, 541), 'latools.helpers.stat_fns.nominal_values', 'nominal_values', (['values'], {}), '(values)\n', (533, 541), False, 'from latools.helpers.stat_fns import nominal_values\n'), ((1139, 1160), 'latools.helpers.signal.bool_2_indices', 'bool_2_indices', (['(~filt)'], {}), '(~filt)\n', (1153, 1160), False, 'from lat...
import collections import sys import unittest import example_robot_data import numpy as np import crocoddyl import pinocchio from crocoddyl.utils import Contact3DDerived, Contact6DDerived pinocchio.switchToNumpyMatrix() class ContactModelAbstractTestCase(unittest.TestCase): ROBOT_MODEL = None ROBOT_STATE =...
[ "crocoddyl.StateMultibody", "pinocchio.updateFramePlacements", "pinocchio.SE3.Random", "unittest.TextTestRunner", "unittest.TestSuite", "example_robot_data.loadICub", "numpy.allclose", "crocoddyl.utils.Contact6DDerived", "crocoddyl.ContactModelMultiple", "pinocchio.utils.zero", "unittest.TestLoa...
[((191, 222), 'pinocchio.switchToNumpyMatrix', 'pinocchio.switchToNumpyMatrix', ([], {}), '()\n', (220, 222), False, 'import pinocchio\n'), ((4879, 4916), 'crocoddyl.StateMultibody', 'crocoddyl.StateMultibody', (['ROBOT_MODEL'], {}), '(ROBOT_MODEL)\n', (4903, 4916), False, 'import crocoddyl\n'), ((4930, 4953), 'pinocch...
import matplotlib.pyplot as plt import numpy as np import pandas as pd # set list of repos manually repo = ["ML_Affine_D40_E2", "ML_Affine_D40_E5", "ML_Affine_D40_E10", "ML_Affine_D40_E20"] # set x labels x_ticks = [2, 5, 10, 20] def main(): # todo: load the "results.csv" file from the mia-results directory ...
[ "matplotlib.pyplot.show", "pandas.read_csv", "numpy.max", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((925, 961), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)', '(5)'], {'figsize': '(16, 10)'}), '(2, 5, figsize=(16, 10))\n', (937, 961), True, 'import matplotlib.pyplot as plt\n'), ((1920, 1954), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""mia-result/plot.png"""'], {}), "('mia-result/plot.png')\n", (1931,...
# Import functions and libraries import cv2 import os import numpy as np import matplotlib.pyplot as plt from scipy.fft import dct, idct # set image file to ../data/00.bmp # you are free to point to any other image files IMG_FILE = os.path.join("..", "data", "zelda.bmp") # read image file, img is a gray sc...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.gray", "scipy.fft.idct", "matplotlib.pyplot.show", "numpy.sum", "matplotlib.pyplot.imshow", "numpy.zeros", "cv2.imread", "numpy.max", "scipy.fft.dct", "os.path.join" ]
[((242, 281), 'os.path.join', 'os.path.join', (['""".."""', '"""data"""', '"""zelda.bmp"""'], {}), "('..', 'data', 'zelda.bmp')\n", (254, 281), False, 'import os\n'), ((342, 384), 'cv2.imread', 'cv2.imread', (['IMG_FILE', 'cv2.IMREAD_GRAYSCALE'], {}), '(IMG_FILE, cv2.IMREAD_GRAYSCALE)\n', (352, 384), False, 'import cv2...
# coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. import numpy as np import os from pyiron_atomistics.atomistics.structure.atoms import Atoms from pyiron_base.generic.hdf...
[ "unittest.main", "os.path.abspath", "pyiron_base.generic.hdfio.FileHDFio", "numpy.array", "pyiron_atomistics.atomistics.structure.atoms.Atoms", "numpy.intersect1d", "pyiron_electrochemistry.atomistic.geometry.water.WaterGeometryCalculator" ]
[((4480, 4495), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4493, 4495), False, 'import unittest\n'), ((825, 850), 'os.path.abspath', 'os.path.abspath', (['filename'], {}), '(filename)\n', (840, 850), False, 'import os\n'), ((875, 898), 'pyiron_base.generic.hdfio.FileHDFio', 'FileHDFio', (['abs_filename'], {})...
#!/usr/bin/env python import sys import numpy as np import telescope_1d import os ndishes = int(sys.argv[1]) npix = int(sys.argv[2]) redundant = bool(sys.argv[3]=="1") redstr = 'red' if redundant else 'nred' t = None for seed in range(30): for sigt in 'sig point gauss unif'.split(): sig = None ...
[ "os.path.isfile", "numpy.save", "telescope_1d.Telescope1D" ]
[((445, 469), 'os.path.isfile', 'os.path.isfile', (['outfname'], {}), '(outfname)\n', (459, 469), False, 'import os\n'), ((1588, 1638), 'numpy.save', 'np.save', (['outfname', '(uvplane, uvplane_f, uvplane_1)'], {}), '(outfname, (uvplane, uvplane_f, uvplane_1))\n', (1595, 1638), True, 'import numpy as np\n'), ((786, 890...
from core.utils import decode_cfg, load_weights from core.image import draw_bboxes, preprocess_image, postprocess_image, read_image, read_video, Shader import matplotlib.pyplot as plt import time import cv2 import numpy as np import tensorflow as tf import sys import mediapipe as mp from djitellopy import Tello mp_fac...
[ "numpy.full", "core.model.one_stage.yolov4.YOLOv4", "cv2.cvtColor", "cv2.waitKey", "numpy.asarray", "cv2.imshow", "numpy.expand_dims", "core.image.Shader", "time.time", "core.utils.decode_cfg", "djitellopy.Tello", "headers.YoloV4Header", "core.image.preprocess_image", "core.utils.load_weig...
[((704, 739), 'core.utils.decode_cfg', 'decode_cfg', (['"""cfgs/coco_yolov4.yaml"""'], {}), "('cfgs/coco_yolov4.yaml')\n", (714, 739), False, 'from core.utils import decode_cfg, load_weights\n'), ((758, 773), 'core.model.one_stage.yolov4.YOLOv4', 'Model', (['cfg', '(416)'], {}), '(cfg, 416)\n', (763, 773), True, 'from ...
from .methodtools import cached_property, cached_method import warnings class MissingPackage(UserWarning): pass try: import ffmpeg except ImportError: warnings.warn('pip3 install ffmpeg-python', MissingPackage) try: import numpy as np except ImportError: warnings.warn('pip3 install numpy', Missi...
[ "os.remove", "numpy.floor", "numpy.clip", "scipy.io.wavfile.read", "ffmpeg.run", "numpy.arange", "matplotlib.pyplot.gca", "numpy.zeros_like", "os.path.exists", "scipy.io.wavfile.write", "numpy.cumsum", "numpy.linspace", "matplotlib.pyplot.show", "numpy.ma.minimum_fill_value", "numpy.corr...
[((167, 226), 'warnings.warn', 'warnings.warn', (['"""pip3 install ffmpeg-python"""', 'MissingPackage'], {}), "('pip3 install ffmpeg-python', MissingPackage)\n", (180, 226), False, 'import warnings\n'), ((279, 330), 'warnings.warn', 'warnings.warn', (['"""pip3 install numpy"""', 'MissingPackage'], {}), "('pip3 install ...
###################################################################################### # # Authors : <NAME>, <NAME> # KTH # Email : {ni<EMAIL>ika, <EMAIL> # # mst_utils.py: Implements MST utility functions. ##################################################################################### import ...
[ "networkx.shortest_path_length", "networkx.maximum_spanning_tree", "networkx.shortest_path", "numpy.argsort", "networkx.Graph", "tree_utils.update_topology" ]
[((531, 541), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (539, 541), True, 'import networkx as nx\n'), ((851, 878), 'networkx.maximum_spanning_tree', 'nx.maximum_spanning_tree', (['G'], {}), '(G)\n', (875, 878), True, 'import networkx as nx\n'), ((1399, 1466), 'networkx.shortest_path', 'nx.shortest_path', (['mst',...
# Copyright (c) [2012]-[2021] Shanghai Yitu Technology Co., Ltd. # # This source code is licensed under the Clear BSD License # LICENSE file in the root directory of this file # All rights reserved. """ Borrow from timm(https://github.com/rwightman/pytorch-image-models) """ import torch import torch.nn as nn import num...
[ "torch.nn.Dropout", "timm.models.layers.DropPath", "numpy.power", "torch.FloatTensor", "numpy.sin", "numpy.cos", "torch.nn.Linear", "torch.nn.Identity" ]
[((3111, 3142), 'numpy.sin', 'np.sin', (['sinusoid_table[:, 0::2]'], {}), '(sinusoid_table[:, 0::2])\n', (3117, 3142), True, 'import numpy as np\n'), ((3183, 3214), 'numpy.cos', 'np.cos', (['sinusoid_table[:, 1::2]'], {}), '(sinusoid_table[:, 1::2])\n', (3189, 3214), True, 'import numpy as np\n'), ((652, 691), 'torch.n...
import argparse import numpy as np import cv2 from skimage import transform as trans import tensorflow as tf import os import skimage.io as io import sys from tqdm import tqdm import align.detect_face as detect_face # Transform grey image to RGB image def to_rgb(img): w, h = img.shape ret = np.empty((w, h, 3...
[ "tqdm.tqdm", "argparse.ArgumentParser", "os.makedirs", "align.detect_face.detect_face", "align.detect_face.create_mtcnn", "numpy.empty", "numpy.asarray", "numpy.argmax", "tensorflow.Session", "os.path.exists", "numpy.power", "skimage.transform.SimilarityTransform", "cv2.warpAffine", "numpy...
[((303, 338), 'numpy.empty', 'np.empty', (['(w, h, 3)'], {'dtype': 'np.uint8'}), '((w, h, 3), dtype=np.uint8)\n', (311, 338), True, 'import numpy as np\n'), ((510, 643), 'numpy.array', 'np.array', (['[[38.2946, 51.6963], [73.5318, 51.5014], [56.0252, 71.7366], [41.5493, \n 92.3655], [70.7299, 92.2041]]'], {'dtype': ...
import numpy as np import numbers import warnings class ExtendedQuadratic(): """ A python object that represents the extended quadratic function f(x) = (1/2) x.T P x + q.T x + (1/2) x + { 0 if Fx+g=0 +infty otherwise } """ def __init__(self, P, q, r, F=None, g=Non...
[ "numpy.linalg.eigvals", "numpy.empty", "numpy.allclose", "numpy.zeros", "numpy.linalg.svd", "numpy.linalg.matrix_rank", "numpy.arange", "numpy.linalg.norm", "numpy.dot", "numpy.eye", "numpy.linalg.pinv", "warnings.warn", "numpy.diag", "numpy.atleast_2d" ]
[((3165, 3206), 'numpy.linalg.svd', 'np.linalg.svd', (['self.F'], {'full_matrices': '(True)'}), '(self.F, full_matrices=True)\n', (3178, 3206), True, 'import numpy as np\n'), ((3222, 3251), 'numpy.linalg.matrix_rank', 'np.linalg.matrix_rank', (['self.F'], {}), '(self.F)\n', (3243, 3251), True, 'import numpy as np\n'), ...
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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 # # ht...
[ "SimpleITK.ReadImage", "scipy.ndimage.binary_fill_holes", "numpy.zeros", "numpy.unique", "SimpleITK.GetArrayFromImage", "shutil.copy", "numpy.min", "numpy.where", "numpy.max", "numpy.array", "multiprocessing.Pool", "collections.OrderedDict", "numpy.vstack" ]
[((1120, 1156), 'numpy.zeros', 'np.zeros', (['data.shape[1:]'], {'dtype': 'bool'}), '(data.shape[1:], dtype=bool)\n', (1128, 1156), True, 'import numpy as np\n'), ((1296, 1327), 'scipy.ndimage.binary_fill_holes', 'binary_fill_holes', (['nonzero_mask'], {}), '(nonzero_mask)\n', (1313, 1327), False, 'from scipy.ndimage i...
""" Fold detector inference. """ import time import argparse from sys import argv import numpy as np import torch from dataset import * from test.model import Model from test.utils import * from nets.detect_net import * def em_detector(opt): # Output fold_out = np.zeros(opt.patch_size + (opt.n_test,), dtype=...
[ "numpy.zeros", "argparse.ArgumentParser", "time.time" ]
[((273, 328), 'numpy.zeros', 'np.zeros', (['(opt.patch_size + (opt.n_test,))'], {'dtype': '"""uint8"""'}), "(opt.patch_size + (opt.n_test,), dtype='uint8')\n", (281, 328), True, 'import numpy as np\n'), ((880, 905), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (903, 905), False, 'import argpa...
# coding=utf-8 # Copyright 2018 XXX Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
[ "torch.nn.Dropout", "torch.ones", "os.path.abspath", "re.fullmatch", "re.split", "torch.nn.MSELoss", "tensorflow.train.list_variables", "tensorflow.train.load_variable", "torch.nn.CrossEntropyLoss", "numpy.transpose", "torch.nn.Linear", "torch.zeros", "logging.getLogger", "torch.from_numpy...
[((1054, 1081), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1071, 1081), False, 'import logging\n'), ((2097, 2132), 'os.path.abspath', 'os.path.abspath', (['tf_checkpoint_path'], {}), '(tf_checkpoint_path)\n', (2112, 2132), False, 'import os\n'), ((2258, 2290), 'tensorflow.train.list_...
# -*- mode: python; coding: utf-8 -*- # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Commonly used utility functions.""" import re import copy import warnings from collections.abc import Iterable import numpy as np from scipy.spatial.distance import pdist, squareform ...
[ "numpy.isin", "numpy.sum", "numpy.abs", "numpy.allclose", "numpy.isclose", "numpy.mean", "numpy.linalg.norm", "scipy.spatial.distance.pdist", "numpy.arange", "numpy.sin", "numpy.float64", "astropy.coordinates.Angle", "numpy.unique", "numpy.zeros_like", "numpy.true_divide", "numpy.appen...
[((469, 723), 'warnings.warn', 'warnings.warn', (['"""_str_to_bytes is deprecated and will be removed in pyuvdata version 2.2. For an input string s, this function is a thin wrapper on s.encode(\'utf8\'). The use of encode is preferred over calling this function."""', 'DeprecationWarning'], {}), '(\n "_str_to_bytes ...
import gurobipy as gb import pandas as pd import numpy as np from benders_stochastic_subproblem import Benders_Subproblem #### # Benders' decomposition, stochastic version # Generators' production are set day ahead. # Subproblems find costs associated with that setting # depending on which demand scenario occurs. ###...
[ "pandas.read_csv", "benders_stochastic_subproblem.Benders_Subproblem", "gurobipy.Model", "gurobipy.quicksum", "numpy.random.normal" ]
[((4492, 4578), 'pandas.read_csv', 'pd.read_csv', (['"""benders_stochastic_gens.csv"""'], {'index_col': '"""gen"""', 'skipinitialspace': '(True)'}), "('benders_stochastic_gens.csv', index_col='gen',\n skipinitialspace=True)\n", (4503, 4578), True, 'import pandas as pd\n'), ((5319, 5329), 'gurobipy.Model', 'gb.Model'...
from __future__ import annotations from typing import Union import numpy as np def fix_nodata( arr: np.ndarray, nodata: Union[np.int32, np.int64, np.float32, np.float64] ) -> np.ndarray: """Set values close to nodata to nan. Parameters: arr: data array to fix nodata: value used to re...
[ "numpy.empty", "numpy.isnan" ]
[((908, 923), 'numpy.empty', 'np.empty', (['shape'], {}), '(shape)\n', (916, 923), True, 'import numpy as np\n'), ((625, 638), 'numpy.isnan', 'np.isnan', (['arr'], {}), '(arr)\n', (633, 638), True, 'import numpy as np\n')]
"""ImageNet data loader.""" import os import numpy as np from scipy import misc from collections import OrderedDict import theano from athenet.utils import get_bin_path, get_data_path from athenet.data_loader import DataLoader, Buffer class ImageNetDataLoader(DataLoader): """ImageNet data loader.""" name_...
[ "numpy.asarray", "athenet.data_loader.Buffer", "athenet.utils.get_data_path", "numpy.split", "theano.shared", "athenet.utils.get_bin_path", "numpy.random.permutation", "numpy.rollaxis", "collections.OrderedDict", "os.path.join", "numpy.concatenate" ]
[((4148, 4167), 'numpy.rollaxis', 'np.rollaxis', (['img', '(2)'], {}), '(img, 2)\n', (4159, 4167), True, 'import numpy as np\n'), ((4246, 4289), 'numpy.asarray', 'np.asarray', (['img'], {'dtype': 'theano.config.floatX'}), '(img, dtype=theano.config.floatX)\n', (4256, 4289), True, 'import numpy as np\n'), ((2416, 2439),...
#!/usr/bin/env python import healsparse import healpy as hp import numpy as np import redmapper import esutil nside = 512 nsideCoverage = 32 gals = redmapper.GalaxyCatalog.from_fits_file('redmagic_test_input_gals.fit') theta = np.radians(90.0 - gals.dec) phi = np.radians(gals.ra) ipnest = hp.ang2pix(nside, theta, ...
[ "numpy.radians", "healsparse.HealSparseMap.makeEmpty", "numpy.ones", "redmapper.GalaxyCatalog.from_fits_file", "healpy.nside2npix", "numpy.where", "healpy.ang2pix" ]
[((151, 221), 'redmapper.GalaxyCatalog.from_fits_file', 'redmapper.GalaxyCatalog.from_fits_file', (['"""redmagic_test_input_gals.fit"""'], {}), "('redmagic_test_input_gals.fit')\n", (189, 221), False, 'import redmapper\n'), ((231, 258), 'numpy.radians', 'np.radians', (['(90.0 - gals.dec)'], {}), '(90.0 - gals.dec)\n', ...
import os import argparse import cv2 import numpy as np import face_blend_common as fbc from face_landmark_detection import load_models_and_image, validate_params, display_image def align_face(img, points, output_dim): print('Aligning Image') img_norm, points = fbc.normalizeImagesAndLandmarks(output_dim, img...
[ "os.path.abspath", "numpy.uint8", "argparse.ArgumentParser", "os.path.basename", "face_landmark_detection.load_models_and_image", "cv2.imwrite", "numpy.float32", "face_blend_common.getLandmarks", "face_landmark_detection.validate_params", "face_blend_common.normalizeImagesAndLandmarks", "face_la...
[((273, 329), 'face_blend_common.normalizeImagesAndLandmarks', 'fbc.normalizeImagesAndLandmarks', (['output_dim', 'img', 'points'], {}), '(output_dim, img, points)\n', (304, 329), True, 'import face_blend_common as fbc\n'), ((345, 369), 'numpy.uint8', 'np.uint8', (['(img_norm * 255)'], {}), '(img_norm * 255)\n', (353, ...
# -*- coding: utf-8 -*- # task_runner.py """ Run lightcurve processing tasks, as defined within a list of request objects. """ import logging import os import time import numpy as np from eas_batman_wrapper.batman_wrapper import BatmanWrapper from eas_psls_wrapper.psls_wrapper import PslsWrapper from .lc_reader_lcs...
[ "os.unlink", "os.path.exists", "time.time", "logging.info", "numpy.min", "eas_batman_wrapper.batman_wrapper.BatmanWrapper", "numpy.max", "numpy.arange", "eas_psls_wrapper.psls_wrapper.PslsWrapper", "os.path.join" ]
[((7383, 7394), 'time.time', 'time.time', ([], {}), '()\n', (7392, 7394), False, 'import time\n'), ((9594, 9605), 'time.time', 'time.time', ([], {}), '()\n', (9603, 9605), False, 'import time\n'), ((11852, 11891), 'logging.info', 'logging.info', (['"""Multiplying lightcurves"""'], {}), "('Multiplying lightcurves')\n", ...
# -*- coding: UTF-8 -*- """ Copyright 2021 Tianshu AI Platform. 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 req...
[ "tsne.bh_sne", "numpy.zeros", "numpy.random.RandomState", "numpy.hstack", "scipy.linalg.svd", "numpy.array", "numpy.dot" ]
[((1034, 1048), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (1042, 1048), True, 'import numpy as np\n'), ((1603, 1635), 'scipy.linalg.svd', 'la.svd', (['cov'], {'full_matrices': '(False)'}), '(cov, full_matrices=False)\n', (1609, 1635), True, 'from scipy import linalg as la\n'), ((1859, 1878), 'numpy.array',...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright INRIA # Contributors: <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # # This software is governed by the CeCILL license under French law and abiding # by the rules of distribution of free software. Yo...
[ "numpy.zeros", "numpy.where", "numpy.array", "numpy.exp", "numpy.fromfunction" ]
[((1963, 1995), 'numpy.fromfunction', 'np.fromfunction', (['distance', 'shape'], {}), '(distance, shape)\n', (1978, 1995), True, 'import numpy as np\n'), ((2006, 2045), 'numpy.where', 'np.where', (['(D < radius * radius)', '(1.0)', '(0.0)'], {}), '(D < radius * radius, 1.0, 0.0)\n', (2014, 2045), True, 'import numpy as...
import logging import os import re from itertools import chain from threading import Lock import nltk import numpy as np import requests from gensim.models import Word2Vec from nltk import word_tokenize, WordNetLemmatizer, SnowballStemmer from nltk.corpus import wordnet, stopwords from sklearn.feature_extraction.text ...
[ "itertools.chain.from_iterable", "sklearn.feature_extraction.text.CountVectorizer", "numpy.sum", "nltk.WordNetLemmatizer", "nltk.SnowballStemmer", "gensim.models.Word2Vec", "numpy.zeros", "threading.Lock", "nltk.Counter", "numpy.mean", "nltk.corpus.stopwords.words", "itertools.chain", "nltk....
[((371, 398), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (388, 398), False, 'import logging\n'), ((736, 742), 'threading.Lock', 'Lock', ([], {}), '()\n', (740, 742), False, 'from threading import Lock\n'), ((6335, 6385), 'os.getenv', 'os.getenv', (['"""FASTTEXT_URL"""', '"""http://loc...
import numpy as np import scipy.linalg as la from bh_sne import BH_SNE def bh_sne( data, pca_d=None, d=2, perplexity=30.0, theta=0.5, random_state=None, copy_data=False, verbose=False, ): """ Run Barnes-Hut T-SNE on _data_. @param data The data. @param pca_d ...
[ "numpy.copy", "bh_sne.BH_SNE", "scipy.linalg.svd", "numpy.random.randint", "numpy.dot" ]
[((1785, 1793), 'bh_sne.BH_SNE', 'BH_SNE', ([], {}), '()\n', (1791, 1793), False, 'from bh_sne import BH_SNE\n'), ((1548, 1580), 'scipy.linalg.svd', 'la.svd', (['cov'], {'full_matrices': '(False)'}), '(cov, full_matrices=False)\n', (1554, 1580), True, 'import scipy.linalg as la\n'), ((1619, 1634), 'numpy.dot', 'np.dot'...
#!/usr/bin/env python3 # # Copyright (c) <NAME> and the University of Texas MD Anderson Cancer Center # Distributed under the terms of the 3-clause BSD License. from collections import Sequence from sos.utils import short_repr, env import numpy import pandas import json Ruby_init_statement = r''' require 'daru' req...
[ "numpy.isnan", "sos.utils.short_repr" ]
[((3145, 3161), 'numpy.isnan', 'numpy.isnan', (['obj'], {}), '(obj)\n', (3156, 3161), False, 'import numpy\n'), ((6550, 6565), 'sos.utils.short_repr', 'short_repr', (['obj'], {}), '(obj)\n', (6560, 6565), False, 'from sos.utils import short_repr, env\n')]
import math import numpy as np import torch from torch.optim.optimizer import Optimizer, required class RAdam(Optimizer): def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0): defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay) self.buffer = [[None...
[ "torch.zeros_like", "math.sqrt", "numpy.isnan" ]
[((4293, 4310), 'numpy.isnan', 'np.isnan', (['metrics'], {}), '(metrics)\n', (4301, 4310), True, 'import numpy as np\n'), ((1113, 1142), 'torch.zeros_like', 'torch.zeros_like', (['p_data_fp32'], {}), '(p_data_fp32)\n', (1129, 1142), False, 'import torch\n'), ((1185, 1214), 'torch.zeros_like', 'torch.zeros_like', (['p_d...
import unyt as u import numpy as np import pandas as pd import matplotlib.pyplot as plt plt.rc("font", family="serif") def main(): data_nd = pd.read_csv("results_nd.csv") fig, ax = plt.subplots() ax.errorbar( data_nd["mu-cassandra_kJmol"], data_nd["press_bar"], yerr=[2 * p for p ...
[ "pandas.read_csv", "matplotlib.pyplot.subplots", "matplotlib.pyplot.rc", "numpy.sqrt" ]
[((89, 119), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'family': '"""serif"""'}), "('font', family='serif')\n", (95, 119), True, 'import matplotlib.pyplot as plt\n'), ((149, 178), 'pandas.read_csv', 'pd.read_csv', (['"""results_nd.csv"""'], {}), "('results_nd.csv')\n", (160, 178), True, 'import pandas as pd\n...
import warnings from xml.etree.ElementTree import Element from base64 import b64encode import types from imageio import imwrite import numpy as np from copy import copy from scipy import ndimage as ndi import vispy.color from ..base import Layer from ..layer_utils import calc_data_range, increment_unnamed_colormap from...
[ "numpy.ones", "numpy.clip", "numpy.round", "numpy.full", "warnings.simplefilter", "numpy.copy", "xml.etree.ElementTree.Element", "scipy.ndimage.zoom", "numpy.max", "warnings.catch_warnings", "numpy.divide", "numpy.asarray", "numpy.concatenate", "numpy.all", "numpy.dtype", "numpy.zeros"...
[((6396, 6421), 'numpy.zeros', 'np.zeros', (['ndim'], {'dtype': 'int'}), '(ndim, dtype=int)\n', (6404, 6421), True, 'import numpy as np\n'), ((7456, 7489), 'copy.copy', 'copy', (['self._contrast_limits_range'], {}), '(self._contrast_limits_range)\n', (7460, 7489), False, 'from copy import copy\n'), ((9198, 9214), 'nump...
# Baseline model for "SGCN:Sparse Graph Convolution Network for Pedestrian Trajectory Prediction" # Source-code directly referred from SGCN at https://github.com/shuaishiliu/SGCN/tree/0ff25cedc04852803787196e83c0bb941d724fc2/utils.py import os import math import torch import numpy as np from torch.utils.data import Da...
[ "math.sqrt", "numpy.polyfit", "numpy.asarray", "numpy.unique", "numpy.zeros", "numpy.transpose", "numpy.around", "numpy.cumsum", "numpy.arange", "numpy.linspace", "os.path.join", "os.listdir", "numpy.concatenate", "torch.from_numpy" ]
[((379, 433), 'math.sqrt', 'math.sqrt', (['((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2)'], {}), '((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2)\n', (388, 433), False, 'import math\n'), ((609, 634), 'numpy.arange', 'np.arange', (['(1)', '(obs_len + 1)'], {}), '(1, obs_len + 1)\n', (618, 634), True, 'import numpy as np\n...
from socket import timeout import serial import serial.tools.list_ports import struct import threading import time import numpy as np """ ------------------------------------- 数据包格式 ------------------------------------- 字节数 数据 说明 1 0xFF 包头 1 0x 字节长度(数据部分) 0~254 1 ...
[ "serial.Serial", "threading.Thread", "numpy.sum", "serial.tools.list_ports.comports", "struct.pack", "time.time", "time.sleep" ]
[((524, 535), 'time.time', 'time.time', ([], {}), '()\n', (533, 535), False, 'import time\n'), ((1141, 1200), 'serial.Serial', 'serial.Serial', (['self.portx', 'self.baud'], {'timeout': 'self.time_out'}), '(self.portx, self.baud, timeout=self.time_out)\n', (1154, 1200), False, 'import serial\n'), ((1270, 1319), 'thread...
import numpy from numpy import savetxt import matplotlib.pyplot as plt import matplotlib from io import BytesIO import base64 from PIL import Image ### Generating X,Y coordinaltes to be used in plot data = numpy.load('../Inbreastdata.npy') print(type(data)) print(len(data)) print(data.shape) print(data[0]) size= le...
[ "io.BytesIO", "numpy.load", "matplotlib.pyplot.plot", "matplotlib.image.imsave", "numpy.linspace", "matplotlib.pyplot.savefig" ]
[((210, 243), 'numpy.load', 'numpy.load', (['"""../Inbreastdata.npy"""'], {}), "('../Inbreastdata.npy')\n", (220, 243), False, 'import numpy\n'), ((1339, 1348), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (1346, 1348), False, 'from io import BytesIO\n'), ((1349, 1383), 'matplotlib.pyplot.savefig', 'plt.savefig', (['figf...
"""coding=utf-8 Copyright 2020 Huawei Technologies Co., Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or...
[ "bert.pretrain.tokenization.FullTokenizer", "pickle.dump", "driver.Config.Configurable", "numpy.random.seed", "argparse.ArgumentParser", "handle_data.dataLoader.read_sentence", "bert.pretrain.modeling.BertConfig.from_json_file", "tensorflow.set_random_seed", "pickle.load", "random.seed", "handle...
[((1034, 1050), 'random.seed', 'random.seed', (['(233)'], {}), '(233)\n', (1045, 1050), False, 'import random\n'), ((1056, 1075), 'numpy.random.seed', 'np.random.seed', (['(233)'], {}), '(233)\n', (1070, 1075), True, 'import numpy as np\n'), ((1081, 1104), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(233)'],...
""" This module contains code for interacting with hit graphs. A Graph is a namedtuple of matrices X, Ri, Ro, y. """ from collections import namedtuple import numpy as np import torch import matplotlib.pyplot as plt import tqdm # A Graph is a namedtuple of matrices (X, Ri, Ro, y) # Graph = namedtuple('Graph', ['X', ...
[ "numpy.load", "matplotlib.pyplot.get_cmap", "numpy.ones", "matplotlib.pyplot.subplots", "collections.namedtuple", "matplotlib.pyplot.tight_layout" ]
[((382, 429), 'collections.namedtuple', 'namedtuple', (['"""Graph"""', "['X', 'spRi', 'spRo', 'y']"], {}), "('Graph', ['X', 'spRi', 'spRo', 'y'])\n", (392, 429), False, 'from collections import namedtuple\n'), ((968, 1009), 'numpy.ones', 'np.ones', (['(Ri_rows.shape[0],)'], {'dtype': 'dtype'}), '((Ri_rows.shape[0],), d...
import sys sys.path.append('../../') import numpy as np import time from scipy import stats from matplotlib import pyplot as plt from gpsearch import GaussianInputs, KDE_Numba from gpsearch.examples import Oscillator, Noise from KDEpy import FFTKDE import statsmodels.api as sm def benchmark_gumbel(n_run=1): for...
[ "sys.path.append", "matplotlib.pyplot.xlim", "statsmodels.api.nonparametric.KDEUnivariate", "matplotlib.pyplot.show", "gpsearch.GaussianInputs", "matplotlib.pyplot.ylim", "numpy.zeros", "numpy.genfromtxt", "scipy.stats.gaussian_kde", "numpy.ones", "time.time", "gpsearch.KDE_Numba", "numpy.mi...
[((11, 36), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (26, 36), False, 'import sys\n'), ((1582, 1616), 'numpy.genfromtxt', 'np.genfromtxt', (['"""map_samples2D.txt"""'], {}), "('map_samples2D.txt')\n", (1595, 1616), True, 'import numpy as np\n'), ((1692, 1706), 'gpsearch.examples.Noi...
r""" .. _disk-spatial-model: Disk Spatial Model ================== This is a spatial model parametrising a disk. By default, the model is symmetric, i.e. a disk: .. math:: \phi(lon, lat) = \frac{1}{2 \pi (1 - \cos{r_0}) } \cdot \begin{cases} 1 & \text{for } \theta \leq r_0 \ ...
[ "gammapy.modeling.models.Models", "matplotlib.pyplot.show", "matplotlib.pyplot.vlines", "matplotlib.pyplot.text", "gammapy.modeling.models.DiskSpatialModel", "gammapy.modeling.models.PowerLawSpectralModel", "numpy.sin", "numpy.linspace", "numpy.cos", "matplotlib.pyplot.ylabel", "astropy.coordina...
[((1202, 1217), 'astropy.coordinates.Angle', 'Angle', (['"""30 deg"""'], {}), "('30 deg')\n", (1207, 1217), False, 'from astropy.coordinates import Angle\n'), ((1226, 1329), 'gammapy.modeling.models.DiskSpatialModel', 'DiskSpatialModel', ([], {'lon_0': '"""2 deg"""', 'lat_0': '"""2 deg"""', 'r_0': '"""1 deg"""', 'e': '...
#!/usr/bin/env python import os import numpy as np puzzle = [ [5, 3, 0, 0, 7, 0, 0, 0, 0], [6, 0, 0, 1, 9, 5, 0, 0, 0], [0, 9, 8, 0, 0, 0, 0, 6, 0], [8, 0, 0, 0, 6, 0, 0, 0, 3], [4, 0, 0, 8, 0, 3, 0, 0, 1], [7, 0, 0, 0, 2, 0, 0, 0, 6], [0, 6, 0, 0, 0, 0, 2, 8, 0], [0, 0, 0, 4, 1, 9, 0, ...
[ "numpy.vsplit", "numpy.array", "numpy.hsplit" ]
[((399, 415), 'numpy.array', 'np.array', (['puzzle'], {}), '(puzzle)\n', (407, 415), True, 'import numpy as np\n'), ((468, 483), 'numpy.vsplit', 'np.vsplit', (['p', '(3)'], {}), '(p, 3)\n', (477, 483), True, 'import numpy as np\n'), ((517, 547), 'numpy.hsplit', 'np.hsplit', (['split_row_thirds', '(3)'], {}), '(split_ro...
from __future__ import print_function import unittest from nose.tools import assert_equal, assert_raises import numpy.testing as np_test from numpy.testing import assert_almost_equal from matplotlib.transforms import Affine2D, BlendedGenericTransform from matplotlib.path import Path from matplotlib.scale import LogSc...
[ "matplotlib.pyplot.axes", "numpy.allclose", "matplotlib.testing.decorators.image_comparison", "numpy.sin", "matplotlib.transforms.Transform.__init__", "numpy.arange", "matplotlib.scale.LogScale.Log10Transform", "numpy.testing.assert_array_almost_equal", "matplotlib.transforms.Affine2D.from_values", ...
[((2718, 2774), 'matplotlib.testing.decorators.image_comparison', 'image_comparison', ([], {'baseline_images': "['pre_transform_data']"}), "(baseline_images=['pre_transform_data'])\n", (2734, 2774), False, 'from matplotlib.testing.decorators import cleanup, image_comparison\n'), ((1793, 1803), 'matplotlib.pyplot.axes',...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "unittest.main", "paddle.fluid.layers.matmul", "paddle.fluid.data", "paddle.fluid.layers.reshape", "paddle.fluid.unique_name.guard", "paddle.fluid.layers.relu", "paddle.fluid.program_guard", "paddle.fluid.optimizer.Adam", "paddle.fluid.layers.batch_norm", "numpy.random.random", "paddle.fluid.lay...
[((7672, 7687), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7685, 7687), False, 'import unittest\n'), ((3170, 3198), 'paddle.fluid.core.is_compiled_with_cuda', 'core.is_compiled_with_cuda', ([], {}), '()\n', (3196, 3198), True, 'import paddle.fluid.core as core\n'), ((6509, 6537), 'paddle.fluid.core.is_compile...
#!/usr/bin/env python3 import rospy import numpy as np import time from geometry_msgs.msg import Twist from sensor_msgs.msg import LaserScan class LaserFollowGapNode: def __init__(self): ''' initialise DemoNode object ''' # Register ROS node rospy.init_node('laser_follow_gap_node') ...
[ "rospy.logwarn", "rospy.logerr", "rospy.Subscriber", "numpy.abs", "rospy.wait_for_message", "numpy.argmax", "rospy.Publisher", "geometry_msgs.msg.Twist", "numpy.clip", "time.sleep", "numpy.sin", "numpy.array", "rospy.init_node", "numpy.cos", "rospy.get_name", "rospy.spin", "rospy.Dur...
[((274, 314), 'rospy.init_node', 'rospy.init_node', (['"""laser_follow_gap_node"""'], {}), "('laser_follow_gap_node')\n", (289, 314), False, 'import rospy\n'), ((770, 818), 'rospy.Publisher', 'rospy.Publisher', (['"""cmd_vel"""', 'Twist'], {'queue_size': '(10)'}), "('cmd_vel', Twist, queue_size=10)\n", (785, 818), Fals...
import numpy as np import h5py import os import illustris_python as il import matplotlib.pyplot as plt # snap_num = 99 diskID = np.load('F:/Linux/data/diskID.npy') StellarMass = il.groupcat.loadSubhalos('F:/Linux/data/TNG/Groupcatalog', 99, 'SubhaloMassType')[:,4] #load barred galaxies' ID bigID = np.load(...
[ "numpy.load", "illustris_python.groupcat.loadSubhalos", "matplotlib.pyplot.figure", "numpy.log10", "numpy.concatenate" ]
[((138, 173), 'numpy.load', 'np.load', (['"""F:/Linux/data/diskID.npy"""'], {}), "('F:/Linux/data/diskID.npy')\n", (145, 173), True, 'import numpy as np\n'), ((312, 346), 'numpy.load', 'np.load', (['"""F:/Linux/data/bigID.npy"""'], {}), "('F:/Linux/data/bigID.npy')\n", (319, 346), True, 'import numpy as np\n'), ((358, ...
# pylint: disable=E1101,C1801,C0103 """Defines the GUI IO file for Nastran.""" from __future__ import annotations import os import sys import traceback from itertools import chain from io import StringIO from collections import defaultdict, OrderedDict from typing import List, Dict, Tuple, Any, TYPE_CHECKING #VTK_TRIA...
[ "pyNastran.gui.gui_objects.gui_result.NormalResult", "vtk.vtkPoints", "collections.defaultdict", "numpy.argsort", "numpy.arange", "numpy.degrees", "vtk.vtkBiQuadraticQuad", "io.StringIO", "vtk.vtkLine", "vtk.vtkTriangle", "numpy.vstack", "numpy.nanmax", "pyNastran.bdf.mesh_utils.delete_bad_e...
[((277333, 277366), 'pyNastran.femutils.nan.isgreater_int', 'isgreater_int', (['material_coord', '(-1)'], {}), '(material_coord, -1)\n', (277346, 277366), False, 'from pyNastran.femutils.nan import isfinite, isfinite_and_greater_than, isfinite_and_nonzero, isgreater_int\n'), ((277714, 277738), 'pyNastran.femutils.nan.i...
from .cantorProject.network import Network from .cantorProject.tfp_trainer import tfp_Trainer, set_weights from .cantorProject.sci_trainer import sci_Trainer from .utils import plot import tensorflow as tf import numpy as np import math from tensorflow.keras.layers import Lambda class GradientLayer(tf.ker...
[ "tensorflow.math.log", "numpy.fmod", "tensorflow.keras.layers.Concatenate", "math.pow", "math.sqrt", "numpy.power", "numpy.zeros", "numpy.ones", "tensorflow.keras.models.Model", "tensorflow.math.sqrt", "tensorflow.exp", "tensorflow.keras.layers.Input", "numpy.random.rand", "tensorflow.kera...
[((12307, 12329), 'numpy.fmod', 'np.fmod', (['t', 'timeperiod'], {}), '(t, timeperiod)\n', (12314, 12329), True, 'import numpy as np\n'), ((2467, 2500), 'tensorflow.keras.layers.Input', 'tf.keras.layers.Input', ([], {'shape': '(1,)'}), '(shape=(1,))\n', (2488, 2500), True, 'import tensorflow as tf\n'), ((2508, 2541), '...
#!/usr/bin/env python # -*- coding: utf-8 -*- from . import frameworkBase from . import mcFramework import os import random import sys import shutil from . import dynamicFramework import numpy from numpy import linalg import pickle from .frameworkBase import generateNameT, generateNameS, generateNameST ## \brief Fram...
[ "pcraster.readmap", "os.mkdir", "pickle.dump", "os.remove", "numpy.eye", "shutil.rmtree", "os.path.isdir", "os.getcwd", "numpy.zeros", "os.path.exists", "numpy.transpose", "numpy.linalg.pinv", "pickle.load", "numpy.array", "numpy.dot", "os.path.join", "os.chdir", "sys.exit" ]
[((1739, 1796), 'os.path.join', 'os.path.join', (['"""observedState"""', "('obs%s.tmp' % filtermoment)"], {}), "('observedState', 'obs%s.tmp' % filtermoment)\n", (1751, 1796), False, 'import os\n'), ((1834, 1865), 'pickle.dump', 'pickle.dump', (['observations', 'file'], {}), '(observations, file)\n', (1845, 1865), Fals...
import operator as op import unittest import typing from unittest.mock import call, patch, ANY import numpy as np import pandas as pd from . import Tracer class BaseTest(unittest.TestCase): def setUp(self): patcher = patch("record_api.core.log_call") self.mock = patcher.start() self.addC...
[ "unittest.main", "unittest.mock.patch", "numpy.arange", "pandas.DataFrame.from_records", "unittest.mock.call" ]
[((7255, 7270), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7268, 7270), False, 'import unittest\n'), ((233, 266), 'unittest.mock.patch', 'patch', (['"""record_api.core.log_call"""'], {}), "('record_api.core.log_call')\n", (238, 266), False, 'from unittest.mock import call, patch, ANY\n'), ((854, 867), 'numpy....
"""Test discern.estimators.batch_integration.""" import json import pathlib from contextlib import ExitStack as no_raise import numpy as np import pandas as pd import pytest import tensorflow as tf import tensorflow_addons from discern import io from discern.estimators import batch_integration from discern.estimators...
[ "pandas.DataFrame", "numpy.random.uniform", "pandas.testing.assert_frame_equal", "json.load", "tensorflow.keras.backend.clear_session", "numpy.testing.assert_allclose", "numpy.zeros", "numpy.ones", "contextlib.ExitStack", "tensorflow.keras.Model", "discern.estimators.batch_integration.DISCERN.fr...
[((2354, 2407), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""is_compiled"""', '[True, False]'], {}), "('is_compiled', [True, False])\n", (2377, 2407), False, 'import pytest\n'), ((6573, 6625), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""with_decay"""', '[True, False]'], {}), "('with_decay...
from argparse import ArgumentParser import pandas as pd import numpy as np from fyne import blackscholes, heston import matplotlib.pyplot as plt def _years_to_expiry(date, expiry): return (expiry - date)/pd.to_timedelta('365d') def plot(underlying, ivs, params, date): time = pd.to_datetime(f"{date} 12:15:...
[ "argparse.ArgumentParser", "pandas.to_timedelta", "pandas.to_datetime", "pandas.read_parquet", "numpy.linspace" ]
[((290, 324), 'pandas.to_datetime', 'pd.to_datetime', (['f"""{date} 12:15:00"""'], {}), "(f'{date} 12:15:00')\n", (304, 324), True, 'import pandas as pd\n'), ((650, 689), 'numpy.linspace', 'np.linspace', (['strike_min', 'strike_max', '(20)'], {}), '(strike_min, strike_max, 20)\n', (661, 689), True, 'import numpy as np\...
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from datetime import datetime from datagen import genheatmap from model import build_model np.set_printoptions(threshold=np.inf, linewidth=np.inf) test_anno_file_path = '../datasets/wider_face/full_test_anno.txt' test_img_dir_path = '../datas...
[ "numpy.set_printoptions", "matplotlib.pyplot.show", "datagen.genheatmap", "model.build_model", "datetime.datetime.now", "matplotlib.pyplot.subplots" ]
[((168, 223), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.inf', 'linewidth': 'np.inf'}), '(threshold=np.inf, linewidth=np.inf)\n', (187, 223), True, 'import numpy as np\n'), ((510, 549), 'model.build_model', 'build_model', ([], {'ishape': 'ishape', 'mode': '"""test"""'}), "(ishape=ishape, mo...
import math import matplotlib.pyplot as plt import numpy as np import os import time import tensorflow as tf def run_model(sess, X, y, is_training, predict, loss_val, Xd, yd, epochs=1, batch_size=64, print_every=100, training=None, plot_losses=False, learning_rate=None, learn...
[ "numpy.sum", "matplotlib.pyplot.show", "tensorflow.train.Saver", "matplotlib.pyplot.plot", "tensorflow.argmax", "math.ceil", "os.makedirs", "os.path.exists", "tensorflow.cast", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "numpy.random.s...
[((629, 651), 'numpy.arange', 'np.arange', (['Xd.shape[0]'], {}), '(Xd.shape[0])\n', (638, 651), True, 'import numpy as np\n'), ((656, 689), 'numpy.random.shuffle', 'np.random.shuffle', (['train_indicies'], {}), '(train_indicies)\n', (673, 689), True, 'import numpy as np\n'), ((1060, 1076), 'tensorflow.train.Saver', 't...
import matplotlib.pyplot as plt import numpy as np track_name = "Canada_Training" absolute_path = "." waypoints = np.load("%s/%s.npy" % (absolute_path, track_name)) print("Number of waypoints = " + str(waypoints.shape[0])) for i, point in enumerate(waypoints): waypoint = (point[2], point[3]) plt.sca...
[ "matplotlib.pyplot.scatter", "numpy.load", "matplotlib.pyplot.show" ]
[((120, 170), 'numpy.load', 'np.load', (["('%s/%s.npy' % (absolute_path, track_name))"], {}), "('%s/%s.npy' % (absolute_path, track_name))\n", (127, 170), True, 'import numpy as np\n'), ((410, 420), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (418, 420), True, 'import matplotlib.pyplot as plt\n'), ((313, 35...
# coding=utf-8 # Copyright 2018 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
[ "tensorflow.test.main", "tf_agents.specs.array_spec.BoundedArraySpec", "tf_agents.environments.parallel_py_environment.ParallelPyEnvironment", "functools.partial", "tf_agents.environments.parallel_py_environment.ProcessPyEnvironment", "tf_agents.specs.array_spec.ArraySpec", "tf_agents.environments.time_...
[((7913, 7927), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (7925, 7927), True, 'import tensorflow as tf\n'), ((1200, 1240), 'tf_agents.specs.array_spec.ArraySpec', 'array_spec.ArraySpec', (['(3, 3)', 'np.float32'], {}), '((3, 3), np.float32)\n', (1220, 1240), False, 'from tf_agents.specs import array_spe...
""" Utility classes and functions used in this library """ import numpy as np import heapq import numba import numba.experimental class InvalidPrefsError(Exception): """ Exception called when input preferences are invalid. """ pass class InvalidCapsError(Exception): """ Exception called whe...
[ "numpy.sum", "numpy.copy", "numpy.empty", "numpy.floor", "numpy.power", "numba.experimental.jitclass", "numpy.ones", "numpy.random.default_rng", "numpy.indices", "numpy.argsort", "numpy.where", "numpy.array", "numpy.arange", "numpy.exp", "numpy.round", "numpy.sqrt" ]
[((586, 624), 'numba.experimental.jitclass', 'numba.experimental.jitclass', (['heap_spec'], {}), '(heap_spec)\n', (613, 624), False, 'import numba\n'), ((2883, 2921), 'numba.experimental.jitclass', 'numba.experimental.jitclass', (['heap_spec'], {}), '(heap_spec)\n', (2910, 2921), False, 'import numba\n'), ((7018, 7030)...
import tensorflow as tf import numpy as np from data import shuffle import math from tqdm import tqdm from sklearn.metrics import roc_auc_score class Model(object): def __init__(self): tf.reset_default_graph() self.X = tf.placeholder(tf.float32, [None, 88, 200, 3]) self.Y = t...
[ "tensorflow.contrib.layers.xavier_initializer", "data.shuffle", "tensorflow.get_collection", "tensorflow.reset_default_graph", "tensorflow.reshape", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.matmul", "tensorflow.train.latest_checkpoint", "tensorflow.nn.conv2d", "tensorflow.lay...
[((209, 233), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (231, 233), True, 'import tensorflow as tf\n'), ((254, 300), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, 88, 200, 3]'], {}), '(tf.float32, [None, 88, 200, 3])\n', (268, 300), True, 'import tensorflow as t...
import numpy as np from scipy.optimize import root_scalar from scipy.linalg import schur from solovay_kitaev.gates.paulis import * def dag(matrix : np.ndarray): ''' dag Performs a Hermitean conjugate (i.e. conjugate transpose) on the input matrix. Simply returns matrix.conj().T. :: matrix ...
[ "scipy.optimize.root_scalar", "numpy.linalg.eig", "numpy.sin", "numpy.real", "numpy.cos", "scipy.linalg.schur", "numpy.linalg.det", "numpy.arccos" ]
[((1936, 1975), 'scipy.optimize.root_scalar', 'root_scalar', (['fn'], {'bracket': '[0, np.pi / 2]'}), '(fn, bracket=[0, np.pi / 2])\n', (1947, 1975), False, 'from scipy.optimize import root_scalar\n'), ((2729, 2751), 'numpy.linalg.eig', 'np.linalg.eig', (['unitary'], {}), '(unitary)\n', (2742, 2751), True, 'import nump...
# -*- coding: utf-8 -*- import sys import numpy from utils import * class RBM(object): def __init__(self, input=None, n_visible=2, n_hidden=3, \ W=None, hbias=None, vbias=None, rng=None): self.n_visible = n_visible # num of units in visible (input) layer self.n_hidden = n_hidden ...
[ "numpy.log", "numpy.zeros", "numpy.random.RandomState", "numpy.mean", "numpy.array", "numpy.dot" ]
[((3903, 4040), 'numpy.array', 'numpy.array', (['[[1, 1, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1,\n 0], [0, 0, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0]]'], {}), '([[1, 1, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0], [0,\n 0, 1, 1, 1, 0], [0, 0, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0]])\n', (391...
""" Authors: <NAME>, <NAME> E-mail: <EMAIL>, <EMAIL> Course: Mashinski vid, FEEIT, Spring 2022 Date: 01.03.2022 Description: design, train, evaluate and apply a fully connected neural network for multi-class image classification Python version: 3.6 """ # python imports import os import cv2 import numpy as np from sk...
[ "numpy.argmax", "sklearn.model_selection.train_test_split", "keras.optimizers.Adam", "Helpers_Classification.helper_stats.plot_confusion_matrix", "Helpers_Classification.helper_model.construct_model_cnn", "sklearn.metrics.confusion_matrix", "os.path.join", "Helpers_Classification.helper_stats.save_tra...
[((1333, 1370), 'os.path.join', 'os.path.join', (['dstResultsPath', 'version'], {}), '(dstResultsPath, version)\n', (1345, 1370), False, 'import os\n'), ((1497, 1533), 'os.path.join', 'os.path.join', (['dstModelsPath', 'version'], {}), '(dstModelsPath, version)\n', (1509, 1533), False, 'import os\n'), ((2297, 2333), 'k...
import numpy from matplotlib import pyplot from enyo.etc import spectrographs tmtb = spectrographs.TMTWFOSBlueOpticalModel() test_img = numpy.zeros((100,50), dtype=float) wave0 = 3110. pixelscale = 0.05153458543289052 dispscale = 15 #0.1995 test_img[20,:] = 1 test_img[60,:] = 1 test_img[:,10] = 1 test_img[:,30] = 1...
[ "numpy.array", "numpy.zeros", "enyo.etc.spectrographs.TMTWFOSBlueOpticalModel" ]
[((88, 127), 'enyo.etc.spectrographs.TMTWFOSBlueOpticalModel', 'spectrographs.TMTWFOSBlueOpticalModel', ([], {}), '()\n', (125, 127), False, 'from enyo.etc import spectrographs\n'), ((140, 175), 'numpy.zeros', 'numpy.zeros', (['(100, 50)'], {'dtype': 'float'}), '((100, 50), dtype=float)\n', (151, 175), False, 'import n...
import unittest import numpy import pytest import six import chainer from chainer import initializers from chainer import testing from chainer import utils import chainerx # Utilities for contiguousness tests. # # These tests checks incoming array contiguousness. # As it's not possible to assume contiguousness of i...
[ "chainer.utils.force_array", "chainer.Parameter", "chainer.initializers.Constant", "six.moves.zip", "chainer.testing.run_module", "numpy.prod", "chainer.testing.function_link._check_contiguousness", "chainer.testing.inject_backend_tests", "chainer.testing.fix_random", "chainer.backend.get_array_mo...
[((2244, 2547), 'chainer.testing.inject_backend_tests', 'testing.inject_backend_tests', (['None', "[{}, {'use_ideep': 'always'}, {'use_cuda': True}, {'use_cuda': True,\n 'cuda_device': 1}, {'use_chainerx': True, 'chainerx_device': 'native:0'\n }, {'use_chainerx': True, 'chainerx_device': 'cuda:0'}, {'use_chainerx...
#!/usr/bin/env python # wujian@2019 """ Compute labels for DC (Deep Clustering) training: -1 means silence 0...N for each speaker """ import argparse import numpy as np from libs.opts import StftParser from libs.data_handler import SpectrogramReader, NumpyWriter from libs.utils import get_logger, EPSILON lo...
[ "numpy.stack", "libs.utils.get_logger", "numpy.zeros_like", "numpy.maximum", "argparse.ArgumentParser", "numpy.sum", "libs.data_handler.SpectrogramReader", "libs.data_handler.NumpyWriter", "numpy.max" ]
[((327, 347), 'libs.utils.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (337, 347), False, 'from libs.utils import get_logger, EPSILON\n'), ((769, 811), 'libs.data_handler.SpectrogramReader', 'SpectrogramReader', (['args.mix'], {}), '(args.mix, **stft_kwargs)\n', (786, 811), False, 'from libs.data_hand...
# Copyright 2020 University of New South Wales, University of Sydney, Ingham Institute # 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 # Unle...
[ "numpy.abs", "numpy.sum", "numpy.ravel", "numpy.isnan", "numpy.histogram", "numpy.mean", "numpy.float64", "platipy.imaging.label.fusion.combine_labels", "numpy.std", "platipy.imaging.label.projection.evaluate_distance_to_reference", "numpy.isfinite", "numpy.linspace", "platipy.imaging.label....
[((3467, 3519), 'loguru.logger.info', 'logger.info', (['""" Calculating surface distance maps: """'], {}), "(' Calculating surface distance maps: ')\n", (3478, 3519), False, 'from loguru import logger\n'), ((9678, 9712), 'loguru.logger.info', 'logger.info', (['""" Analysing results"""'], {}), "(' Analysing results'...
import numpy as np import matplotlib.pyplot as plt x = np.random.rand(10) y = np.diff(x, 0) print(x) print(y) plt.plot(x, y, 'x') plt.show()
[ "numpy.random.rand", "numpy.diff", "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ]
[((56, 74), 'numpy.random.rand', 'np.random.rand', (['(10)'], {}), '(10)\n', (70, 74), True, 'import numpy as np\n'), ((79, 92), 'numpy.diff', 'np.diff', (['x', '(0)'], {}), '(x, 0)\n', (86, 92), True, 'import numpy as np\n'), ((111, 130), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y', '"""x"""'], {}), "(x, y, 'x')\...
from collections import deque import random import numpy as np import torch import torch.nn as nn import os import sys sys.path.append('../../') from training.train_ddpg.ddpg_networks import ActorNet, CriticNet class Agent: """ Class for DDPG Agent Main Function: 1. Remember: Insert new memory in...
[ "sys.path.append", "os.mkdir", "torch.nn.MSELoss", "training.train_ddpg.ddpg_networks.ActorNet", "numpy.sum", "numpy.random.randn", "random.sample", "torch.load", "training.train_ddpg.ddpg_networks.CriticNet", "numpy.zeros", "numpy.clip", "torch.Tensor", "numpy.array", "torch.cuda.is_avail...
[((119, 144), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (134, 144), False, 'import sys\n'), ((3606, 3636), 'collections.deque', 'deque', ([], {'maxlen': 'self.memory_size'}), '(maxlen=self.memory_size)\n', (3611, 3636), False, 'from collections import deque\n'), ((3723, 3854), 'train...
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np x = np.linspace(-6 * np.pi, 6 * np.pi, 1000) y = np.sin(x) z = np.cos(x) fig = plt.figure() ax = Axes3D(fig) ax.plot(x, y, z) plt.show()
[ "matplotlib.pyplot.show", "mpl_toolkits.mplot3d.Axes3D", "matplotlib.pyplot.figure", "numpy.sin", "numpy.cos", "numpy.linspace" ]
[((97, 137), 'numpy.linspace', 'np.linspace', (['(-6 * np.pi)', '(6 * np.pi)', '(1000)'], {}), '(-6 * np.pi, 6 * np.pi, 1000)\n', (108, 137), True, 'import numpy as np\n'), ((142, 151), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (148, 151), True, 'import numpy as np\n'), ((156, 165), 'numpy.cos', 'np.cos', (['x'], {}...
#!/usr/bin/env python # -*- coding: utf-8 -*- import copy import argparse import time from pymouse import PyMouse from pykeyboard import PyKeyboard import cv2 as cv import numpy as np import mediapipe as mp from utils import CvFpsCalc def get_args(): parser = argparse.ArgumentParser() parser.add_argument("-...
[ "argparse.ArgumentParser", "numpy.empty", "pymouse.PyMouse", "cv2.rectangle", "cv2.imshow", "cv2.line", "cv2.cvtColor", "numpy.append", "cv2.boundingRect", "cv2.destroyAllWindows", "copy.deepcopy", "cv2.circle", "cv2.waitKey", "pykeyboard.PyKeyboard", "time.sleep", "cv2.flip", "cv2.p...
[((267, 292), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (290, 292), False, 'import argparse\n'), ((1568, 1595), 'cv2.VideoCapture', 'cv.VideoCapture', (['cap_device'], {}), '(cap_device)\n', (1583, 1595), True, 'import cv2 as cv\n'), ((2077, 2101), 'utils.CvFpsCalc', 'CvFpsCalc', ([], {'bu...
# coding: utf-8 import re import numpy class toolkit: def readConf(self, filename='./decisionTree.conf'): with open(filename, 'r') as f: text=f.read() trainset_pat=re.compile(r'trainset_name=(.*)\n') testset_pat=re.compile(r'testset_name=(.*)\n') feature_discrete_pat=re...
[ "numpy.genfromtxt", "re.compile" ]
[((198, 233), 're.compile', 're.compile', (['"""trainset_name=(.*)\\\\n"""'], {}), "('trainset_name=(.*)\\\\n')\n", (208, 233), False, 'import re\n'), ((254, 288), 're.compile', 're.compile', (['"""testset_name=(.*)\\\\n"""'], {}), "('testset_name=(.*)\\\\n')\n", (264, 288), False, 'import re\n'), ((318, 356), 're.comp...
import os import ast import numpy as np from uti import webBrowser from abaqusGui import * import gui_commands import gui_plot from desicos import __version__ as version import desicos.conecylDB as conecylDB from desicos.conecylDB import fetch from desicos.abaqus.utils import remove_special_characters as rsc from de...
[ "numpy.empty", "gui_plot.plot_stress_analysis", "os.path.isfile", "gui_plot.plot_ti", "gui_plot.plot_msi", "os.path.join", "os.chdir", "gui_plot.plot_ls_curve", "gui_commands.load_study_gui", "gui_plot.plot_kdf_curve", "desicos.conecylDB.fetch", "gui_plot.plot_opened_conecyl", "desicos.conec...
[((1500, 1538), 'numpy.empty', 'np.empty', (['(NUM_PLIES, 3)'], {'dtype': '"""|S50"""'}), "((NUM_PLIES, 3), dtype='|S50')\n", (1508, 1538), True, 'import numpy as np\n'), ((483, 504), 'ast.literal_eval', 'ast.literal_eval', (['tmp'], {}), '(tmp)\n', (499, 504), False, 'import ast\n'), ((5910, 5962), 'os.path.join', 'os...
# Copyright (c) <NAME>, <NAME>, and ZOZO Technologies, Inc. All rights reserved. # Licensed under the Apache 2.0 License. """Dataset Class for Real-World Logged Bandit Feedback.""" from dataclasses import dataclass from logging import getLogger, basicConfig, INFO from pathlib import Path from typing import Optional i...
[ "sklearn.utils.check_random_state", "logging.basicConfig", "pandas.read_csv", "pandas.get_dummies", "scipy.stats.rankdata", "sklearn.preprocessing.LabelEncoder", "pathlib.Path", "numpy.int", "numpy.arange", "pandas.concat", "logging.getLogger" ]
[((569, 588), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (578, 588), False, 'from logging import getLogger, basicConfig, INFO\n'), ((589, 612), 'logging.basicConfig', 'basicConfig', ([], {'level': 'INFO'}), '(level=INFO)\n', (600, 612), False, 'from logging import getLogger, basicConfig, INFO...
# example of calculating the frechet inception distance in Keras import numpy import glob import os from skimage.measure import compare_ssim from PIL import Image import cv2 import numpy as np # calculate SSIM def calculate_average_ssim(images1, images2): ssim_sum=0 n = len(images1) ssims_list = [] for...
[ "skimage.measure.compare_ssim", "cv2.cvtColor", "numpy.std", "numpy.mean", "numpy.array", "os.path.split", "os.path.join" ]
[((539, 559), 'numpy.array', 'np.array', (['ssims_list'], {}), '(ssims_list)\n', (547, 559), True, 'import numpy as np\n'), ((739, 768), 'os.path.join', 'os.path.join', (['folder', '"""*.png"""'], {}), "(folder, '*.png')\n", (751, 768), False, 'import os\n'), ((1362, 1401), 'cv2.cvtColor', 'cv2.cvtColor', (['or_img', '...
import pandas as pd import numpy as np from sklearn import ensemble from sklearn import metrics from sklearn import model_selection from functools import partial from sklearn import decomposition from sklearn import pipeline from sklearn import preprocessing import optuna def optimize(trial, X, y): criterion = ...
[ "sklearn.ensemble.RandomForestClassifier", "functools.partial", "pandas.read_csv", "sklearn.metrics.accuracy_score", "numpy.mean", "sklearn.model_selection.StratifiedKFold", "optuna.create_study" ]
[((578, 710), 'sklearn.ensemble.RandomForestClassifier', 'ensemble.RandomForestClassifier', ([], {'n_estimators': 'n_estimators', 'max_depth': 'max_depth', 'max_features': 'max_features', 'criterion': 'criterion'}), '(n_estimators=n_estimators, max_depth=\n max_depth, max_features=max_features, criterion=criterion)\...
import numpy as np # noinspection PyPep8Naming import torch.nn.functional as F import torch.nn as nn import torch from lib.distributions import log_standard_normal from lib.flows import cpflows from lib.made import MADE, CMADE from lib.naf import sigmoid_flow _scaling_min = 0.001 # noinspection PyUnusedLocal class ...
[ "torch.eye", "torch.sqrt", "lib.made.MADE", "torch.mm", "torch.slogdet", "numpy.exp", "torch.pixel_shuffle", "torch.diag", "torch.sign", "torch.exp", "torch.triu", "torch.nn.Linear", "torch.zeros", "torch.log", "torch.nn.Parameter", "torch.zeros_like", "torch.nn.ModuleList", "torch...
[((7325, 7363), 'torch.pixel_shuffle', 'torch.pixel_shuffle', (['x', 'upscale_factor'], {}), '(x, upscale_factor)\n', (7344, 7363), False, 'import torch\n'), ((3902, 3928), 'torch.nn.ModuleList', 'torch.nn.ModuleList', (['flows'], {}), '(flows)\n', (3921, 3928), False, 'import torch\n'), ((5240, 5261), 'matplotlib.use'...
import numpy as np if __name__=='__main__': T = 4000 d = 1000 s = 10 K = 2 delta_vals = np.logspace(-3,1,10) eps_vals = np.logspace(-3,1,10) iters = 20 print("cd ../") for i in range(len(delta_vals)): print("python3 -W ignore LimeCB.py --T %d --d %d --s %d --K %d --iters...
[ "numpy.logspace" ]
[((110, 132), 'numpy.logspace', 'np.logspace', (['(-3)', '(1)', '(10)'], {}), '(-3, 1, 10)\n', (121, 132), True, 'import numpy as np\n'), ((146, 168), 'numpy.logspace', 'np.logspace', (['(-3)', '(1)', '(10)'], {}), '(-3, 1, 10)\n', (157, 168), True, 'import numpy as np\n')]
# This file is part of DEAP. # # DEAP is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
[ "deap.base.Toolbox", "MPDA_decode.MPDA_decode_discrete.MPDA_Decode_Discrete_NB", "random.randint", "random.shuffle", "MPDA_decode.instance.Instance", "numpy.zeros", "time.clock", "random.random", "deap.creator.create", "MPDA_decode.MPDA_decode_discrete.MPDA_Decode_Discrete_RC", "random.seed", ...
[((885, 944), 'deap.creator.create', 'creator.create', (['"""FitnessMin"""', 'base.Fitness'], {'weights': '(-1.0,)'}), "('FitnessMin', base.Fitness, weights=(-1.0,))\n", (899, 944), False, 'from deap import creator\n'), ((945, 1021), 'deap.creator.create', 'creator.create', (['"""Individual"""', 'list'], {'typecode': '...
from utils.data_reader import prepare_data, prepare_data_loaders from utils.utils import getMetrics import torch.nn as nn import torch import numpy as np from tqdm import tqdm import os import pandas as pd import numpy as np import os import math import random import numpy as np from utils import constant pred_fi...
[ "numpy.array", "utils.utils.getMetrics", "numpy.zeros", "numpy.arange" ]
[((936, 964), 'numpy.zeros', 'np.zeros', (['(pred.shape[0], 4)'], {}), '((pred.shape[0], 4))\n', (944, 964), True, 'import numpy as np\n'), ((1171, 1201), 'utils.utils.getMetrics', 'getMetrics', (['pred', 'ground', '(True)'], {}), '(pred, ground, True)\n', (1181, 1201), False, 'from utils.utils import getMetrics\n'), (...
#!/usr/bin/env/python3 """Recipe for training a neural speech separation system on wsjmix the dataset. The system employs an encoder, a decoder, and a masking network. To run this recipe, do the following: > python train.py hparams/sepformer.yaml > python train.py hparams/dualpath_rnn.yaml > python train.py hparams/co...
[ "augment.FlipSign", "numpy.sum", "speechbrain.nnet.schedulers.update_learning_rate", "speechbrain.create_experiment_directory", "logging.getLogger", "numpy.mean", "datasets.MusdbDataset", "torch.no_grad", "os.path.join", "csv.DictWriter", "torch.nn.functional.pad", "speechbrain.utils.distribut...
[((13460, 13492), 'speechbrain.parse_arguments', 'sb.parse_arguments', (['sys.argv[1:]'], {}), '(sys.argv[1:])\n', (13478, 13492), True, 'import speechbrain as sb\n'), ((13647, 13692), 'speechbrain.utils.distributed.ddp_init_group', 'sb.utils.distributed.ddp_init_group', (['run_opts'], {}), '(run_opts)\n', (13682, 1369...
## This is originally from: http://nghiaho.com/?page_id=671 import numpy as np # Input: expects Nx3 matrix of points # Returns R,t # R = 3x3 rotation matrix # t = 3x1 column vector def rigid_transform_3D(A, B): assert len(A) == len(B) N = A.shape[0] # total points centroid_A = np.mean(A, axis=0) ...
[ "numpy.linalg.svd", "numpy.dot", "numpy.mean", "numpy.linalg.det" ]
[((299, 317), 'numpy.mean', 'np.mean', (['A'], {'axis': '(0)'}), '(A, axis=0)\n', (306, 317), True, 'import numpy as np\n'), ((335, 353), 'numpy.mean', 'np.mean', (['B'], {'axis': '(0)'}), '(B, axis=0)\n', (342, 353), True, 'import numpy as np\n'), ((677, 693), 'numpy.dot', 'np.dot', (['AA.T', 'BB'], {}), '(AA.T, BB)\n...
""" Collection of utility functions for wrapping-textures. Written by <NAME> """ from __future__ import print_function import sys import time import itertools import logging import numpy from recordclass import recordclass ###################################### # Record classes for neccessary data # ##############...
[ "recordclass.recordclass", "numpy.amin", "numpy.empty", "numpy.floor", "time.sleep", "numpy.amax", "numpy.array", "sys.stdout.flush", "itertools.tee", "numpy.linalg.det", "logging.getLogger" ]
[((350, 379), 'recordclass.recordclass', 'recordclass', (['"""UV"""', "['u', 'v']"], {}), "('UV', ['u', 'v'])\n", (361, 379), False, 'from recordclass import recordclass\n'), ((388, 420), 'recordclass.recordclass', 'recordclass', (['"""Pixel"""', "['x', 'y']"], {}), "('Pixel', ['x', 'y'])\n", (399, 420), False, 'from r...