code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
__description__ = \ """ assembly_auto_inhibition.py Model of ligand-mediated protein assembly and autoinhibition of the assembly, also referred to as auto-regulated protein assembly and related to the prozone effect. """ __author__ = "<NAME>" __date__ = "2018-02-22" import inspect import numpy as np from scipy.optim...
[ "scipy.optimize.root", "numpy.zeros", "scipy.optimize.OptimizeResult" ]
[((6148, 6166), 'numpy.zeros', 'np.zeros', (['N_points'], {}), '(N_points)\n', (6156, 6166), True, 'import numpy as np\n'), ((6175, 6193), 'numpy.zeros', 'np.zeros', (['N_points'], {}), '(N_points)\n', (6183, 6193), True, 'import numpy as np\n'), ((3913, 3949), 'numpy.zeros', 'np.zeros', (['(num_shots - 1)'], {'dtype':...
# -*- coding: utf-8 -*- from operator import attrgetter import datetime import numpy as np from ..distance import DistanceHypothesiser from ...types.detection import Detection from ...types.state import GaussianState from ...types.track import Track from ... import measures def test_mahalanobis(predictor, updater):...
[ "numpy.array", "operator.attrgetter", "datetime.datetime.now" ]
[((338, 361), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (359, 361), False, 'import datetime\n'), ((1512, 1535), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1533, 1535), False, 'import datetime\n'), ((469, 484), 'numpy.array', 'np.array', (['[[2]]'], {}), '([[2]])\n', (...
# Action policy module # Constructs action probability distribution used by agent to sample action and calculate log_prob, entropy, etc. from gym import spaces from slm_lab.env.wrapper import LazyFrames from slm_lab.lib import distribution, logger, math_util, util from torch import distributions import numpy as np impo...
[ "slm_lab.lib.util.in_eval_lab_modes", "slm_lab.lib.logger.get_logger", "torch.clamp", "numpy.random.rand", "torch.diag_embed", "torch.is_tensor", "slm_lab.lib.util.set_attr", "torch.tensor" ]
[((359, 386), 'slm_lab.lib.logger.get_logger', 'logger.get_logger', (['__name__'], {}), '(__name__)\n', (376, 386), False, 'from slm_lab.lib import distribution, logger, math_util, util\n'), ((5502, 5523), 'torch.tensor', 'torch.tensor', (['_action'], {}), '(_action)\n', (5514, 5523), False, 'import torch\n'), ((2386, ...
# -*- coding: utf-8 -*- """ @author: Gualandi """ import numpy as np import networkx as nx from math import sqrt from time import sleep from pyomo.environ import ConcreteModel, Var, Objective, Constraint, SolverFactory, Set from pyomo.environ import maximize, Binary, RangeSet, PositiveReals, ConstraintList, NonNegat...
[ "matplotlib.collections.LineCollection", "pylab.show", "numpy.random.seed", "pyomo.environ.SolverFactory", "math.sqrt", "pyomo.environ.RangeSet", "pyomo.environ.Var", "networkx.stoer_wagner", "numpy.ones", "pylab.subplots", "networkx.cycle_basis", "networkx.Graph", "numpy.random.random", "...
[((2309, 2455), 'matplotlib.collections.LineCollection', 'mc.LineCollection', (['lines'], {'linewidths': '[(1.5 if x > 0.501 else 1) for x in values]', 'colors': "[('blue' if x > 0.501 else 'orange') for x in values]"}), "(lines, linewidths=[(1.5 if x > 0.501 else 1) for x in\n values], colors=[('blue' if x > 0.501 ...
# multithreaded code here # put KLD computations in single function import numpy as np import multiprocessing as mp from multiprocessing import Process, Manager import ray import time from .models import BnnBase, BnnBinaryClassifier from .projections import CovarianceProjection from .logutils import TqdmLoggingHandl...
[ "ray.init", "numpy.trace", "numpy.sum", "numpy.concatenate", "numpy.zeros", "time.time", "ray.put", "ray.shutdown", "numpy.arange", "numpy.matmul", "numpy.array", "numpy.linalg.det", "numpy.eye", "numpy.delete", "logging.getLogger" ]
[((348, 375), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (365, 375), False, 'import logging\n'), ((2504, 2516), 'numpy.arange', 'np.arange', (['p'], {}), '(p)\n', (2513, 2516), True, 'import numpy as np\n'), ((2629, 2654), 'ray.init', 'ray.init', ([], {'num_cpus': 'n_jobs'}), '(num_cp...
#!/usr/bin/env python # coding: utf-8 # In[1]: #!/usr/bin/env python # coding: utf-8 # In[1]: #Imports import sys sys.path.append('../../python/') #import NGC5533_functions-newmag as nf import numpy as np import matplotlib.pyplot as plt #import scipy.optimize as opt import lmfit as lm import dataPython as dp imp...
[ "sys.path.append", "matplotlib.pyplot.xlim", "scipy.interpolate.InterpolatedUnivariateSpline", "matplotlib.pyplot.plot", "warnings.filterwarnings", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "numpy.asarray", "dataPython.getXYdata", "matplotlib.pyplot.legend", "numpy.shape", "numpy.ap...
[((120, 152), 'sys.path.append', 'sys.path.append', (['"""../../python/"""'], {}), "('../../python/')\n", (135, 152), False, 'import sys\n'), ((659, 692), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (682, 692), False, 'import warnings\n'), ((814, 877), 'dataPython.getXY...
"""These classes hold methods to apply general filters to any data type. By inheriting these classes into the wrapped VTK data structures, a user can easily apply common filters in an intuitive manner. Example ------- >>> import pyvista >>> from pyvista import examples >>> dataset = examples.load_uniform() >>> # Thr...
[ "numpy.sum", "vtk.vtkArrowSource", "vtk.vtkPoints", "vtk.vtkSelectionNode.CONTAINING_CELLS", "vtk.vtkShrinkFilter", "numpy.ones", "vtk.vtkSelectionNode.INVERSE", "matplotlib.pyplot.figure", "numpy.arange", "pyvista.Line", "vtk.vtkAppendPolyData", "logging.warning", "pyvista.Plotter", "pyvi...
[((4773, 4803), 'pyvista.utilities.generate_plane', 'generate_plane', (['normal', 'origin'], {}), '(normal, origin)\n', (4787, 4803), False, 'from pyvista.utilities import FieldAssociation, NORMALS, assert_empty_kwargs, generate_plane, get_array, vtk_id_list_to_array, wrap, ProgressMonitor, abstract_class\n'), ((8026, ...
#!/usr/bin/env python import aqml.cheminfo as co import aqml.cheminfo.core as cc import os import numpy as np T, F = True, False def get_up_down(*path): """Get up and down electron numbers from ORCA output file. Number of up&down electrons required in CASINO input. """ regexp1 = re.compile('Multipl...
[ "aqml.cheminfo.chemical_symbols.index", "numpy.sum", "os.path.exists", "numpy.arange", "aqml.cheminfo.core.molecules", "os.path.join", "aqml.cheminfo.core.catoms" ]
[((3911, 3926), 'numpy.sum', 'np.sum', (['obj.nas'], {}), '(obj.nas)\n', (3917, 3926), True, 'import numpy as np\n'), ((4117, 4130), 'numpy.arange', 'np.arange', (['na'], {}), '(na)\n', (4126, 4130), True, 'import numpy as np\n'), ((477, 507), 'os.path.join', 'os.path.join', (['*path', '"""mol.out"""'], {}), "(*path, '...
import shutil import subprocess as sp import numpy as np import pandas as pd import pkg_resources import pytest from astropy import units as u from astropy.time import Time from lstchain.io.io import ( dl1_params_lstcam_key, dl2_params_lstcam_key, get_dataset_keys, dl1_params_src_dep_lstcam_key, ) d...
[ "subprocess.run", "astropy.table.Table.read", "pandas.read_hdf", "astropy.time.Time", "lstchain.io.io.read_data_dl2_to_QTable", "numpy.testing.assert_allclose", "pytest.fixture", "lstchain.io.io.get_dataset_keys", "datetime.datetime.strptime", "pytest.mark.parametrize", "pkg_resources.iter_entry...
[((944, 990), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""script"""', 'ALL_SCRIPTS'], {}), "('script', ALL_SCRIPTS)\n", (967, 990), False, 'import pytest\n'), ((1114, 1145), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (1128, 1145), False, 'import pytest\n...
import cv2 import numpy as np import matplotlib.pyplot as plt from glob import glob # Dicrease color def dic_color(img): img //= 63 img = img * 64 + 32 return img # Database def get_DB(): # get training image path train = glob("dataset/train_*") train.sort() # prepare database db = np...
[ "numpy.abs", "numpy.sum", "numpy.zeros", "numpy.argmin", "cv2.imread", "numpy.where", "glob.glob" ]
[((244, 267), 'glob.glob', 'glob', (['"""dataset/train_*"""'], {}), "('dataset/train_*')\n", (248, 267), False, 'from glob import glob\n'), ((1101, 1123), 'glob.glob', 'glob', (['"""dataset/test_*"""'], {}), "('dataset/test_*')\n", (1105, 1123), False, 'from glob import glob\n'), ((1305, 1333), 'numpy.zeros', 'np.zeros...
import numpy as np import gym from typing import List, Optional from ray.rllib.models.tf.tf_modelv2 import TFModelV2 from ray.rllib.utils.framework import try_import_tf from ray.rllib.utils.typing import ModelConfigDict, TensorType tf1, tf, tfv = try_import_tf() class DDPGTFModel(TFModelV2): """Extension of sta...
[ "ray.rllib.utils.framework.try_import_tf", "numpy.logical_and" ]
[((249, 264), 'ray.rllib.utils.framework.try_import_tf', 'try_import_tf', ([], {}), '()\n', (262, 264), False, 'from ray.rllib.utils.framework import try_import_tf\n'), ((2472, 2542), 'numpy.logical_and', 'np.logical_and', (['action_space.bounded_above', 'action_space.bounded_below'], {}), '(action_space.bounded_above,...
#%% from os import listdir import pandas as pd import numpy as np from numpy import linalg as LA import re from pathlib import Path #%% def calculate_area(path): f = open(path,'r') lines = f.readlines() if len(lines) > 4: wanted_lines = [3,4] cmpt = 1 #vector1 x = np.array...
[ "pandas.DataFrame.from_dict", "numpy.cross", "pathlib.Path", "re.findall", "numpy.linalg.norm", "os.listdir" ]
[((677, 701), 'os.listdir', 'listdir', (['"""./R2/CONTCARs"""'], {}), "('./R2/CONTCARs')\n", (684, 701), False, 'from os import listdir\n'), ((943, 1006), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['areas'], {'orient': '"""index"""', 'columns': "['Area']"}), "(areas, orient='index', columns=['Area'])\n",...
import random import numpy as np from nlpaug.util import Action, Method, WarningException, WarningName, WarningCode, WarningMessage class Augmenter: def __init__(self, name, method, action, aug_min, aug_p=0.1, verbose=0): self.name = name self.action = action self.method = method ...
[ "nlpaug.util.Action.getall", "nlpaug.util.WarningException", "random.randint", "random.sample", "random.random", "numpy.array", "nlpaug.util.Method.getall" ]
[((3661, 3676), 'random.random', 'random.random', ([], {}), '()\n', (3674, 3676), False, 'import random\n'), ((572, 587), 'nlpaug.util.Method.getall', 'Method.getall', ([], {}), '()\n', (585, 587), False, 'from nlpaug.util import Action, Method, WarningException, WarningName, WarningCode, WarningMessage\n'), ((740, 755...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Functions for performing PSF fitting photometry on 2-D arrays.""" from __future__ import division import warnings import numpy as np from astropy.modeling.parameters import Parameter from astropy.utils.exceptions import AstropyUserWarning from astropy...
[ "numpy.ma.copy", "numpy.ma.sum", "imageutils.extract_array_2d", "numpy.isnan", "imageutils.subpixel_indices", "numpy.ndarray", "warnings.simplefilter", "numpy.append", "warnings.catch_warnings", "numpy.ma.dstack", "imageutils.mask_to_mirrored_num", "numpy.indices", "numpy.all", "numpy.isco...
[((1652, 1674), 'astropy.modeling.parameters.Parameter', 'Parameter', (['"""amplitude"""'], {}), "('amplitude')\n", (1661, 1674), False, 'from astropy.modeling.parameters import Parameter\n'), ((1685, 1701), 'astropy.modeling.parameters.Parameter', 'Parameter', (['"""x_0"""'], {}), "('x_0')\n", (1694, 1701), False, 'fr...
import os import numpy as np import matplotlib.pyplot as plt from sklearn import metrics import sklearn import seaborn as sns def testing_data(data_set, params, plot = 'y', save=False): os.chdir(data_set.ip['outdir']) """ Function which evaluates the MSE/MAE of the test setr Inputs: ...
[ "matplotlib.pyplot.title", "numpy.abs", "matplotlib.pyplot.plot", "numpy.power", "matplotlib.pyplot.legend", "numpy.shape", "numpy.sort", "matplotlib.pyplot.figure", "numpy.dot", "os.chdir", "matplotlib.pyplot.savefig" ]
[((193, 224), 'os.chdir', 'os.chdir', (["data_set.ip['outdir']"], {}), "(data_set.ip['outdir'])\n", (201, 224), False, 'import os\n'), ((776, 799), 'numpy.sort', 'np.sort', (['y_test'], {'axis': '(0)'}), '(y_test, axis=0)\n', (783, 799), True, 'import numpy as np\n'), ((822, 844), 'numpy.sort', 'np.sort', (['y_ref'], {...
# coding=utf-8 # Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. # Copyright 2018 The Google AI Language Team 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...
[ "modeling.BertModel", "json.dumps", "collections.defaultdict", "tensorflow.get_collection_ref", "ft_tensorflow_quantization.QuantDescriptor", "tensorflow.nn.log_softmax", "tokenization.FullTokenizer", "tensorflow.compat.v1.logging.info", "ft_tensorflow_quantization.QuantDense.set_default_quant_desc_...
[((7507, 7563), 'ft_tensorflow_quantization.QuantDescriptor', 'QuantDescriptor', (['"""input"""'], {'disable_key_words': 'DISABLE_LIST'}), "('input', disable_key_words=DISABLE_LIST)\n", (7522, 7563), False, 'from ft_tensorflow_quantization import get_calibrators, QuantDense, QuantDescriptor\n'), ((7578, 7653), 'ft_tens...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/02-attribute extraction.ipynb (unless otherwise specified). __all__ = ['get_field_name_tags', 'field_hierarchies_to_root', 'assign_idx_fields', 'initialise_site_data_with_ids', 'get_dict_head', 'datapackage_ref_to_ds_schema', 'init_datapackage_ref', ...
[ "pandas.DataFrame", "os.mkdir", "os.remove", "json.loads", "os.path.isdir", "os.path.exists", "urllib.request.urlopen", "frictionless.Package", "json.dumps", "numpy.isnan", "urllib.request.urlretrieve", "pandas.isnull", "pandas.Series", "warnings.warn" ]
[((7494, 7517), 'frictionless.Package', 'Package', (['datapackage_fp'], {}), '(datapackage_fp)\n', (7501, 7517), False, 'from frictionless import Package\n'), ((16877, 16909), 'json.dumps', 'json.dumps', (['obj'], {'default': 'default'}), '(obj, default=default)\n', (16887, 16909), False, 'import json\n'), ((16928, 170...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 19 21:15:48 2018 @author: Adekanye """ import numpy as np import matplotlib.pyplot as plt import dataGenerator class LogReg(object): def __init__(self, eta=0.1, n_iter=10): assert eta >= 0 and eta <= 1, "eta must be between 0.0 and 1....
[ "numpy.zeros", "dataGenerator.generate_data" ]
[((1345, 1392), 'dataGenerator.generate_data', 'dataGenerator.generate_data', ([], {'x1_min': '(0)', 'x2_min': '(0)'}), '(x1_min=0, x2_min=0)\n', (1372, 1392), False, 'import dataGenerator\n'), ((561, 585), 'numpy.zeros', 'np.zeros', (['(X.shape[1] + 1)'], {}), '(X.shape[1] + 1)\n', (569, 585), True, 'import numpy as n...
import xml.etree.ElementTree as ET import warnings import os import glob from ..base import PSGbase import pandas as pd import numpy as np import mne import shutil def read_psg_edf(folder, include = 'all', preload = False): """ Read compumedics polysomnography files exported to .edf. This function was only...
[ "pandas.DataFrame", "xml.etree.ElementTree.parse", "numpy.sum", "numpy.ones_like", "os.path.basename", "os.path.isdir", "os.path.dirname", "numpy.cumsum", "mne.io.read_raw_edf", "os.path.isfile", "glob.glob", "shutil.copy" ]
[((4270, 4288), 'xml.etree.ElementTree.parse', 'ET.parse', (['xml_file'], {}), '(xml_file)\n', (4278, 4288), True, 'import xml.etree.ElementTree as ET\n'), ((4328, 4342), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (4340, 4342), True, 'import pandas as pd\n'), ((5310, 5328), 'xml.etree.ElementTree.parse', 'ET...
''' Created on Aug 9, 2017 @author: <NAME> ''' from math import sqrt from ScopeFoundry import Measurement from ScopeFoundry.helper_funcs import sibling_path, load_qt_ui_file from ScopeFoundry import h5_io import pyqtgraph as pg import numpy as np import time import os from random import randint,random from PyQt5.QtWid...
[ "pyqtgraph.ViewBox", "ScopeFoundry.helper_funcs.sibling_path", "numpy.random.exponential", "numpy.zeros", "os.path.exists", "numpy.ones", "time.sleep", "ScopeFoundry.h5_io.h5_base_file", "numpy.random.randint", "numpy.linspace", "ScopeFoundry.helper_funcs.load_qt_ui_file", "numpy.convolve", ...
[((1103, 1151), 'ScopeFoundry.helper_funcs.sibling_path', 'sibling_path', (['__file__', '"""block_training_plot.ui"""'], {}), "(__file__, 'block_training_plot.ui')\n", (1115, 1151), False, 'from ScopeFoundry.helper_funcs import sibling_path, load_qt_ui_file\n'), ((1256, 1289), 'ScopeFoundry.helper_funcs.load_qt_ui_file...
####################################################################### # Copyright (C) 2017 <NAME>(<EMAIL>) # # Permission given to modify the code as long as you keep this # # declaration at the top # ##############################################################...
[ "numpy.concatenate", "numpy.random.rand", "numpy.asarray", "torch.cat", "torch.multiprocessing.Process.__init__", "torch.multiprocessing.Pipe", "numpy.random.shuffle" ]
[((2257, 2285), 'numpy.random.shuffle', 'np.random.shuffle', (['self.data'], {}), '(self.data)\n', (2274, 2285), True, 'import numpy as np\n'), ((3290, 3315), 'torch.multiprocessing.Process.__init__', 'mp.Process.__init__', (['self'], {}), '(self)\n', (3309, 3315), True, 'import torch.multiprocessing as mp\n'), ((3354,...
import numpy as np import cv2 as cv class CvComparisonSliderWindow(object): def __init__(self, window_name='debug', line_color=(255, 255, 255), line_thickness=0): self.window_name = window_name self.click_point = [1, 1] self.line_color = l...
[ "cv2.line", "numpy.concatenate", "cv2.namedWindow", "cv2.setMouseCallback", "cv2.imshow", "cv2.resize" ]
[((384, 416), 'cv2.namedWindow', 'cv.namedWindow', (['self.window_name'], {}), '(self.window_name)\n', (398, 416), True, 'import cv2 as cv\n'), ((425, 484), 'cv2.setMouseCallback', 'cv.setMouseCallback', (['self.window_name', 'self._mouse_callback'], {}), '(self.window_name, self._mouse_callback)\n', (444, 484), True, ...
import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset, DataLoader from PIL import Image, ImageDraw import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib.path import Path import seaborn as sns import tqdm class DetectionDataset(Dataset)...
[ "PIL.Image.open", "matplotlib.path.Path", "numpy.min", "numpy.max", "numpy.array", "numpy.arange", "torch.as_tensor", "numpy.vstack" ]
[((1481, 1503), 'torch.as_tensor', 'torch.as_tensor', (['boxes'], {}), '(boxes)\n', (1496, 1503), False, 'import torch\n'), ((1521, 1544), 'torch.as_tensor', 'torch.as_tensor', (['labels'], {}), '(labels)\n', (1536, 1544), False, 'import torch\n'), ((1561, 1583), 'torch.as_tensor', 'torch.as_tensor', (['masks'], {}), '...
import numpy from ._common import jitted __all__ = [ "depthplot", ] @jitted def resample(thickness, velocity_p, velocity_s, density, dz): """Resample velocity model.""" mmax = len(thickness) sizes = numpy.empty(mmax, dtype=numpy.int32) for i in range(mmax): sizes[i] = numpy.ceil(thickne...
[ "numpy.empty", "matplotlib.pyplot.subplots", "numpy.ceil" ]
[((220, 256), 'numpy.empty', 'numpy.empty', (['mmax'], {'dtype': 'numpy.int32'}), '(mmax, dtype=numpy.int32)\n', (231, 256), False, 'import numpy\n'), ((392, 430), 'numpy.empty', 'numpy.empty', (['size'], {'dtype': 'numpy.float64'}), '(size, dtype=numpy.float64)\n', (403, 430), False, 'import numpy\n'), ((439, 477), 'n...
#!/usr/bin/python import numpy as np import math as m import soundfile as sf import matplotlib.pyplot as plot def genwin(winsize, f): win = np.zeros(winsize) for i in range(0, winsize): y = f(i/winsize) win[i] = y return win def hann(winsize): return genwin(winsize, lambda x: 0.5 - 0.5...
[ "soundfile.read", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "numpy.fft.fft", "numpy.zeros", "numpy.array", "math.cos" ]
[((145, 162), 'numpy.zeros', 'np.zeros', (['winsize'], {}), '(winsize)\n', (153, 162), True, 'import numpy as np\n'), ((727, 740), 'numpy.array', 'np.array', (['wav'], {}), '(wav)\n', (735, 740), True, 'import numpy as np\n'), ((754, 785), 'numpy.zeros', 'np.zeros', (['[iter_times, winsize]'], {}), '([iter_times, winsi...
import os import numpy as np import multiprocessing import time import esutil import glob from .wcs_table import WcsTableBuilder from .region_mapper import RegionMapper from .healpix_consolidator import HealpixConsolidator from .utils import op_str_to_code from . import decasu_globals class MultiHealpixMapper(object...
[ "esutil.stat.histogram", "os.path.isdir", "numpy.searchsorted", "time.time", "multiprocessing.get_context", "os.path.isfile", "numpy.where", "os.rmdir", "os.path.join", "os.listdir", "numpy.concatenate" ]
[((1638, 1649), 'time.time', 'time.time', ([], {}), '()\n', (1647, 1649), False, 'import time\n'), ((1667, 1702), 'multiprocessing.get_context', 'multiprocessing.get_context', (['"""fork"""'], {}), "('fork')\n", (1694, 1702), False, 'import multiprocessing\n'), ((2243, 2269), 'numpy.concatenate', 'np.concatenate', (['p...
import unittest from polyhedral_analysis.orientation_parameters import cos_theta import numpy as np import math class OrientationParametersTestCase( unittest.TestCase ): def test_cos_theta_one( self ): a = np.array( [ 0.0, 0.0, 1.0 ] ) b = np.array( [ 1.0, 0.0, 0.0 ] ) self.assertEqual( co...
[ "unittest.main", "numpy.array", "math.sqrt", "polyhedral_analysis.orientation_parameters.cos_theta" ]
[((742, 757), 'unittest.main', 'unittest.main', ([], {}), '()\n', (755, 757), False, 'import unittest\n'), ((220, 245), 'numpy.array', 'np.array', (['[0.0, 0.0, 1.0]'], {}), '([0.0, 0.0, 1.0])\n', (228, 245), True, 'import numpy as np\n'), ((262, 287), 'numpy.array', 'np.array', (['[1.0, 0.0, 0.0]'], {}), '([1.0, 0.0, ...
import os import torch import numpy as np import cv2 from pycocotools.coco import COCO from .base import BaseDataset class CocoDataset(BaseDataset): def get_data_info(self, ann_path): """ Load basic information of dataset such as image path, label and so on. :param ann_path: coco json fil...
[ "numpy.zeros", "cv2.imread", "pycocotools.coco.COCO", "numpy.array", "os.path.join" ]
[((773, 787), 'pycocotools.coco.COCO', 'COCO', (['ann_path'], {}), '(ann_path)\n', (777, 787), False, 'from pycocotools.coco import COCO\n'), ((4029, 4067), 'os.path.join', 'os.path.join', (['self.img_path', 'file_name'], {}), '(self.img_path, file_name)\n', (4041, 4067), False, 'import os\n'), ((4082, 4104), 'cv2.imre...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[ "replay_memory.ReplayMemory", "gym.make", "model.Model", "numpy.mean", "algorithm.DQN", "agent.Agent" ]
[((2556, 2576), 'numpy.mean', 'np.mean', (['eval_reward'], {}), '(eval_reward)\n', (2563, 2576), True, 'import numpy as np\n'), ((2601, 2624), 'gym.make', 'gym.make', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (2609, 2624), False, 'import gym\n'), ((2862, 2887), 'replay_memory.ReplayMemory', 'ReplayMemory', (['M...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ # CODE NAME HERE # CODE DESCRIPTION HERE Created on 2020-03-27 at 13:42 @author: cook """ from astropy.io import fits from astropy.table import Table from astropy import units as uu import numpy as np import warnings import sys import os from scipy.interpolate import In...
[ "numpy.nanpercentile", "numpy.sum", "numpy.abs", "numpy.nanmedian", "astropy.io.fits.PrimaryHDU", "numpy.isnan", "os.path.isfile", "numpy.arange", "numpy.exp", "glob.glob", "numpy.diag", "numpy.convolve", "astropy.io.fits.HDUList", "os.path.join", "numpy.round", "numpy.unique", "nump...
[((1502, 1539), 'astropy.table.Table.read', 'Table.read', (['MASK_FILE'], {'format': '"""ascii"""'}), "(MASK_FILE, format='ascii')\n", (1512, 1539), False, 'from astropy.table import Table\n'), ((3956, 3992), 'numpy.sqrt', 'np.sqrt', (['((1 + dv / c) / (1 - dv / c))'], {}), '((1 + dv / c) / (1 - dv / c))\n', (3963, 399...
import numpy as np import matplotlib.pyplot as plt import inspect # Used for storing the input from .element import Element from .equation import LeakyWallEquation from . import besselnumba class LineDoubletHoBase(Element): '''Higher Order LineDoublet Base Class. All Higher Order Line Doublet elements are der...
[ "numpy.abs", "numpy.sum", "matplotlib.pyplot.plot", "numpy.arctan2", "numpy.empty", "numpy.zeros", "numpy.ones", "numpy.hstack", "numpy.sin", "numpy.arange", "numpy.cos", "inspect.currentframe", "numpy.atleast_2d" ]
[((1366, 1391), 'numpy.abs', 'np.abs', (['(self.z1 - self.z2)'], {}), '(self.z1 - self.z2)\n', (1372, 1391), True, 'import numpy as np\n'), ((1773, 1796), 'numpy.zeros', 'np.zeros', (['self.ncp', '"""D"""'], {}), "(self.ncp, 'D')\n", (1781, 1796), True, 'import numpy as np\n'), ((1816, 1831), 'numpy.cos', 'np.cos', (['...
#!/usr/bin/python3 import cv2 import time import threading import subprocess import numpy as np from sys import exit from os import system from keras import backend as K from keras.models import load_model from yad2k.models.keras_yolo import yolo_eval, yolo_head ''' ---# GLOBAL VARIABLES #--- ''' #USER SETTINGS : ma...
[ "keras.models.load_model", "cv2.VideoWriter_fourcc", "numpy.floor", "time.strftime", "numpy.ones", "yad2k.models.keras_yolo.yolo_eval", "keras.backend.placeholder", "yad2k.models.keras_yolo.yolo_head", "cv2.resize", "threading.Thread", "cv2.bitwise_xor", "keras.backend.learning_phase", "cv2....
[((1160, 1168), 'sys.exit', 'exit', (['(-1)'], {}), '(-1)\n', (1164, 1168), False, 'from sys import exit\n'), ((2885, 2921), 'cv2.blur', 'cv2.blur', (['mat_1_gray', '(blur1, blur1)'], {}), '(mat_1_gray, (blur1, blur1))\n', (2893, 2921), False, 'import cv2\n'), ((2941, 2979), 'cv2.threshold', 'cv2.threshold', (['mat_1_g...
import os import json import argparse import numpy as np if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-emb', '--emb_dir', required=True, type=str, help='path to the input dir') parser.add_argument('-dict', '--dict_dir', required=True, type=str, help='path to the inpu...
[ "numpy.random.uniform", "os.path.join", "argparse.ArgumentParser" ]
[((100, 125), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (123, 125), False, 'import argparse\n'), ((1052, 1100), 'os.path.join', 'os.path.join', (["opt['emb_dir']", '"""relation2vec.bin"""'], {}), "(opt['emb_dir'], 'relation2vec.bin')\n", (1064, 1100), False, 'import os\n'), ((2091, 2137), ...
import numpy as np from pathlib import Path import pandas as pd from grid_simulations import MacroGen if __name__ == "__main__": np.random.seed(65432) macgen = MacroGen() macgen._base_geometry_cmd = "/control/execute setup_normal_run.mac" macgen.run_macs = [#"run696keV.mac", # "...
[ "pathlib.Path", "numpy.random.seed", "grid_simulations.MacroGen" ]
[((135, 156), 'numpy.random.seed', 'np.random.seed', (['(65432)'], {}), '(65432)\n', (149, 156), True, 'import numpy as np\n'), ((170, 180), 'grid_simulations.MacroGen', 'MacroGen', ([], {}), '()\n', (178, 180), False, 'from grid_simulations import MacroGen\n'), ((939, 963), 'pathlib.Path', 'Path', (['"""inbeam_grid_ma...
import numpy as np class LPSolver: """Class for solving labeling problem on given graph.""" def __init__(self, graph): self.graph = graph self.labels = np.zeros(self.graph.vertex_weights.shape) def solve(self): """Returns graph labeling (in our case sequence of letters) that mini...
[ "numpy.min", "numpy.zeros", "numpy.arange", "numpy.argmin" ]
[((179, 220), 'numpy.zeros', 'np.zeros', (['self.graph.vertex_weights.shape'], {}), '(self.graph.vertex_weights.shape)\n', (187, 220), True, 'import numpy as np\n'), ((407, 446), 'numpy.arange', 'np.arange', (['(1)', 'self.graph.objects_number'], {}), '(1, self.graph.objects_number)\n', (416, 446), True, 'import numpy ...
import time import threading import os import numpy as np import zmq import msgpack import tensorflow as tf from tensorflow.python.platform import test from tensorflow.python.framework import dtypes from tensorflow.python.ops import resources zmq_module = tf.load_op_library('./build/nvzmq_ops/kernel/nvzmq_ops.so') ...
[ "tensorflow.load_op_library", "tensorflow.python.platform.test.main", "tensorflow.python.ops.resources.local_resources", "numpy.dtype", "tensorflow.TensorShape", "numpy.array", "numpy.arange", "msgpack.packb", "zmq.Context" ]
[((260, 319), 'tensorflow.load_op_library', 'tf.load_op_library', (['"""./build/nvzmq_ops/kernel/nvzmq_ops.so"""'], {}), "('./build/nvzmq_ops/kernel/nvzmq_ops.so')\n", (278, 319), True, 'import tensorflow as tf\n'), ((8575, 8586), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (8584, 8586), Fals...
""" Global configuration for the problem settings """ import numpy as np from scipy import stats horizon = 300 runs = 40 DefaultConfiguration = { "price_buy" : [1.2,2.1,3.3], "price_sell" : [1,2,3], "price_probabilities" : np.array([[0.8, 0.1, 0.1],[0.1, 0.8, 0.1],[0.1, 0.1, 0.8]]), "initial_capacity...
[ "numpy.zeros", "scipy.stats.norm", "numpy.array", "numpy.arange" ]
[((238, 299), 'numpy.array', 'np.array', (['[[0.8, 0.1, 0.1], [0.1, 0.8, 0.1], [0.1, 0.1, 0.8]]'], {}), '([[0.8, 0.1, 0.1], [0.1, 0.8, 0.1], [0.1, 0.1, 0.8]])\n', (246, 299), True, 'import numpy as np\n'), ((1782, 1793), 'numpy.array', 'np.array', (['P'], {}), '(P)\n', (1790, 1793), True, 'import numpy as np\n'), ((263...
import streamlit as st import pandas as pd import numpy as np import scipy.stats from scipy.stats import norm import altair as alt st.set_page_config( page_title="A/B Test Comparison", page_icon="📈", initial_sidebar_state="expanded" ) def conversion_rate(conversions, visitors): return (conversions / visitor...
[ "pandas.read_csv", "altair.Chart", "streamlit.radio", "altair.Text", "streamlit.sidebar.form", "pandas.DataFrame", "streamlit.set_page_config", "scipy.stats.norm", "altair.Y", "streamlit.metric", "streamlit.beta_columns", "streamlit.slider", "streamlit.file_uploader", "streamlit.form_submi...
[((132, 237), 'streamlit.set_page_config', 'st.set_page_config', ([], {'page_title': '"""A/B Test Comparison"""', 'page_icon': '"""📈"""', 'initial_sidebar_state': '"""expanded"""'}), "(page_title='A/B Test Comparison', page_icon='📈',\n initial_sidebar_state='expanded')\n", (150, 237), True, 'import streamlit as st...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from unittest import mock import numpy as np import torch from ax.models.torch.alebo import ( ALEBO, ALEBOGP, ...
[ "ax.models.torch.alebo.get_batch_model", "torch.ones", "torch.pinverse", "ax.models.torch.alebo.ALEBOGP", "ax.models.torch.alebo.alebo_acqf_optimizer", "torch.equal", "botorch.models.model_list_gp_regression.ModelListGP", "ax.models.torch.alebo.ei_or_nei", "unittest.mock.patch", "ax.models.torch.a...
[((783, 876), 'torch.tensor', 'torch.tensor', (['[[1.0, 2.0, 3.0, 4.0, 5.0], [2.0, 3.0, 4.0, 5.0, 6.0]]'], {'dtype': 'torch.double'}), '([[1.0, 2.0, 3.0, 4.0, 5.0], [2.0, 3.0, 4.0, 5.0, 6.0]], dtype=\n torch.double)\n', (795, 876), False, 'import torch\n'), ((1481, 1539), 'torch.tensor', 'torch.tensor', (['[[0.0, 0....
"""Integrated gradient based attribution""" from typing import Callable, List, Optional, Tuple import numpy as np import torch import torch.nn.functional as F from scipy import ndimage class ModelWrapper: def zero_grad(self): raise NotImplementedError() def __call__(self, x): return self.fo...
[ "torch.mean", "torch.stack", "torch.zeros_like", "numpy.array", "torch.from_numpy" ]
[((911, 933), 'numpy.array', 'np.array', (['spectrograms'], {}), '(spectrograms)\n', (919, 933), True, 'import numpy as np\n'), ((2146, 2164), 'torch.stack', 'torch.stack', (['grads'], {}), '(grads)\n', (2157, 2164), False, 'import torch\n'), ((2394, 2419), 'torch.mean', 'torch.mean', (['grads'], {'axis': '(0)'}), '(gr...
import copy import csv import glob import os import random import sys import cv2 import numpy as np import torch from PIL.Image import Image import skimage import skimage.color import skimage.io import skimage.transform from pycocotools import coco from pycocotools.coco import COCO from torch.utils.data import Datas...
[ "csv.reader", "pandas.read_csv", "random.shuffle", "glob.glob", "os.path.join", "pandas.DataFrame", "numpy.set_printoptions", "numpy.append", "torch.zeros", "skimage.io.imsave", "skimage.io.imread", "PIL.Image.Image.open", "random.random", "skimage.color.gray2rgb", "os.listdir", "torch...
[((482, 516), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (501, 516), True, 'import numpy as np\n'), ((29500, 29549), 'torch.zeros', 'torch.zeros', (['batch_size', 'max_width', 'max_height', '(3)'], {}), '(batch_size, max_width, max_height, 3)\n', (29511, 29549), ...
""" 7. Reverse integer Given an 32-bit signed integer, reverse the digits of an integer. Example: Input: 123 Output: 321 """ class Solution: def reverse(self, x: int) -> int: # One way to do this is to iterate through powers of 10 and find the # remainder after division. The reversed nu...
[ "numpy.array", "numpy.append", "numpy.abs", "numpy.sign" ]
[((546, 556), 'numpy.sign', 'np.sign', (['x'], {}), '(x)\n', (553, 556), True, 'import numpy as np\n'), ((569, 578), 'numpy.abs', 'np.abs', (['x'], {}), '(x)\n', (575, 578), True, 'import numpy as np\n'), ((640, 652), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (648, 652), True, 'import numpy as np\n'), ((741, 7...
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
[ "megengine.tensor", "numpy.random.random_sample", "megengine.distributed.functional.reduce_scatter_sum", "megengine.distributed.get_rank", "megengine.distributed.functional.all_gather", "megengine.distributed.functional.scatter", "numpy.allclose", "numpy.split", "megengine.distributed.functional.all...
[((666, 693), 'pytest.mark.require_ngpu', 'pytest.mark.require_ngpu', (['(2)'], {}), '(2)\n', (690, 693), False, 'import pytest\n'), ((695, 783), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""shape"""', '[(2, 3), (8, 10), (99, 77), (2, 2, 2, 2)]'], {'ids': 'str'}), "('shape', [(2, 3), (8, 10), (99, 77), (...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import subprocess import shutil import argparse import itertools from Bio import SeqIO import funannotate.library as lib from funannotate.interlap import InterLap from collections import defaultdict from natsort import natsorted import numpy as np fro...
[ "funannotate.library.ncbiCheckErrors", "os.remove", "funannotate.library.get_version", "funannotate.library.runSubprocess2", "argparse.ArgumentParser", "funannotate.library.runSubprocess8", "funannotate.library.runSubprocess", "funannotate.library.getSeqRegions", "funannotate.interlap.InterLap", "...
[((11881, 11915), 'funannotate.library.gff2dict', 'lib.gff2dict', (['gff_in', 'fasta', 'genes'], {}), '(gff_in, fasta, genes)\n', (11893, 11915), True, 'import funannotate.library as lib\n'), ((18236, 18253), 'funannotate.library.which', 'lib.which', (['"""pigz"""'], {}), "('pigz')\n", (18245, 18253), True, 'import fun...
from ctapipe.utils.rgbtohex import intensity_to_rgb, intensity_to_hex import numpy as np def test_rgb(): input_ = np.array([4]) min_ = 0 max_ = 10 output = intensity_to_rgb(input_, min_, max_) assert (output == np.array([41, 120, 142, 255])).all() def test_hex(): input_ = np.array([4]) ...
[ "ctapipe.utils.rgbtohex.intensity_to_rgb", "numpy.array", "ctapipe.utils.rgbtohex.intensity_to_hex" ]
[((120, 133), 'numpy.array', 'np.array', (['[4]'], {}), '([4])\n', (128, 133), True, 'import numpy as np\n'), ((174, 210), 'ctapipe.utils.rgbtohex.intensity_to_rgb', 'intensity_to_rgb', (['input_', 'min_', 'max_'], {}), '(input_, min_, max_)\n', (190, 210), False, 'from ctapipe.utils.rgbtohex import intensity_to_rgb, i...
# Copyright 2022 DeepMind Technologies Limited. 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 ...
[ "jax.tree_flatten", "jax.numpy.full_like", "jax.numpy.block", "jax.lax.psum", "jax.experimental.enable_x64", "jax.process_index", "jax.numpy.reshape", "jax.numpy.swapaxes", "jax.jit", "jax.numpy.mean", "jax.tree_util.register_pytree_node", "jax.local_device_count", "jax.numpy.greater", "ja...
[((1072, 1084), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (1079, 1084), False, 'from typing import Any, Callable, Iterable, Iterator, Optional, Sequence, Tuple, Type, TypeVar, Union\n'), ((8943, 8964), 'jax.pmap', 'jax.pmap', (['(lambda x: x)'], {}), '(lambda x: x)\n', (8951, 8964), False, 'import jax\...
# Copyright (c) 2021 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", "numpy.fmin", "paddle.static.data", "numpy.random.uniform", "numpy.random.choice", "paddle.fluid.core.CUDAPlace", "paddle.enable_static", "numpy.allclose", "paddle.static.Program", "paddle.fluid.core.CPUPlace", "numpy.array", "paddle.disable_static", "paddle.static.Executor"...
[((760, 782), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (780, 782), False, 'import paddle\n'), ((8005, 8027), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (8025, 8027), False, 'import paddle\n'), ((8032, 8047), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8045, 8047)...
# Credit: https://stackoverflow.com/questions/28089942/difference-between-fill-and-expand-options-for-tkinter-pack-method/28090362 import tkinter as tk import numpy as np class Shadow(tk.Tk): ''' Add shadow to a widget This class adds a squared shadow to a widget. The size, the position, and the...
[ "numpy.linspace", "tkinter.Frame" ]
[((6587, 6653), 'numpy.linspace', 'np.linspace', (['self.from_rgb[0]', 'self.to_rgb[0]', 'max_size'], {'dtype': 'int'}), '(self.from_rgb[0], self.to_rgb[0], max_size, dtype=int)\n', (6598, 6653), True, 'import numpy as np\n'), ((6667, 6733), 'numpy.linspace', 'np.linspace', (['self.from_rgb[2]', 'self.to_rgb[2]', 'max_...
import numpy as np from ..env import ParasolEnvironment __all__ = ['Rotation'] def shape_check(mats, shapes): try: for i in range(len(mats)): mat, shape = mats[i], shapes[i] for j in range(len(mat.shape)): if mat.shape[j] != shape[j]: return Fal...
[ "numpy.random.randn", "numpy.zeros", "numpy.ones", "numpy.sin", "numpy.random.multivariate_normal", "numpy.cos", "numpy.random.rand", "numpy.eye" ]
[((628, 648), 'numpy.zeros', 'np.zeros', (['(dim, dim)'], {}), '((dim, dim))\n', (636, 648), True, 'import numpy as np\n'), ((2387, 2427), 'numpy.random.multivariate_normal', 'np.random.multivariate_normal', (['mean', 'cov'], {}), '(mean, cov)\n', (2416, 2427), True, 'import numpy as np\n'), ((2463, 2511), 'numpy.rando...
# ######################################################################### # Copyright (c) , UChicago Argonne, LLC. All rights reserved. # # # # See LICENSE file. # # ##############...
[ "numpy.load", "GPUtil.getGPUs", "numpy.sum", "numpy.arctan2", "numpy.abs", "os.remove", "psutil.virtual_memory", "numpy.angle", "numpy.argmax", "numpy.floor", "numpy.clip", "logging.Formatter", "os.path.isfile", "numpy.tile", "numpy.exp", "numpy.lib.pad", "os.path.join", "multiproc...
[((1839, 1862), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (1856, 1862), False, 'import logging\n'), ((1913, 1946), 'os.path.join', 'os.path.join', (['ldir', '"""default.log"""'], {}), "(ldir, 'default.log')\n", (1925, 1946), False, 'import os\n'), ((1956, 1985), 'logging.FileHandler', 'loggi...
import numpy as np from io import StringIO import matplotlib.pyplot as plt from joblib import Parallel, delayed import multiprocessing import config import logging import pandas as pd from sqlalchemy import create_engine class Data_Retreival: def __init__(self): self.code_complexity_query = 'SELECT M...
[ "numpy.clip", "numpy.mean", "matplotlib.pyplot.gca", "multiprocessing.cpu_count", "pandas.DataFrame", "numpy.max", "pandas.read_sql_query", "matplotlib.pyplot.xticks", "matplotlib.pyplot.subplots", "pandas.concat", "io.StringIO", "matplotlib.pyplot.show", "numpy.median", "matplotlib.pyplot...
[((19411, 19435), 'matplotlib.pyplot.xticks', 'plt.xticks', (['y_pos', 'langs'], {}), '(y_pos, langs)\n', (19421, 19435), True, 'import matplotlib.pyplot as plt\n'), ((19440, 19475), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Programming Languages"""'], {}), "('Programming Languages')\n", (19450, 19475), True, 'im...
import numpy as np class MyMath(object): def boxplus( rad_angle_alfa, rad_angle_beta): c_a, s_a= np.cos(rad_angle_alfa), np.sin(rad_angle_alfa) c_b, s_b= np.cos(rad_angle_beta), np.sin(rad_angle_beta) R_alfa = np.array([[ c_a, -s_a], [s_a, c_a ]]) R_beta = np.array([[ c_b, -s_...
[ "numpy.arctan2", "numpy.sin", "numpy.array", "numpy.cos", "numpy.matmul" ]
[((245, 280), 'numpy.array', 'np.array', (['[[c_a, -s_a], [s_a, c_a]]'], {}), '([[c_a, -s_a], [s_a, c_a]])\n', (253, 280), True, 'import numpy as np\n'), ((300, 335), 'numpy.array', 'np.array', (['[[c_b, -s_b], [s_b, c_b]]'], {}), '([[c_b, -s_b], [s_b, c_b]])\n', (308, 335), True, 'import numpy as np\n'), ((350, 375), ...
import logging import os import numpy as np import pybullet as p from igibson import object_states from igibson.objects.articulated_object import URDFObject from igibson.scenes.empty_scene import EmptyScene from igibson.simulator import Simulator from igibson.utils.assets_utils import get_ig_model_path from igibson.u...
[ "pybullet.saveState", "logging.basicConfig", "igibson.simulator.Simulator", "numpy.array", "igibson.utils.utils.restoreState", "igibson.utils.assets_utils.get_ig_model_path", "igibson.objects.articulated_object.URDFObject", "os.path.join", "igibson.scenes.empty_scene.EmptyScene" ]
[((886, 991), 'igibson.simulator.Simulator', 'Simulator', ([], {'mode': "('gui_interactive' if not headless else 'headless')", 'image_width': '(1280)', 'image_height': '(720)'}), "(mode='gui_interactive' if not headless else 'headless',\n image_width=1280, image_height=720)\n", (895, 991), False, 'from igibson.simul...
# coding=utf-8 # Copyright 2020 RigL 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 agree...
[ "tensorflow.compat.v1.size", "numpy.random.shuffle", "numpy.sum", "tensorflow.compat.v1.constant", "numpy.floor", "numpy.ones", "numpy.prod", "tensorflow.compat.v1.logging.info", "tensorflow.compat.v1.assign", "re.findall", "google_research.micronet_challenge.counting.Conv2D", "tensorflow.comp...
[((1167, 1183), 'tensorflow.compat.v1.constant', 'tf.constant', (['(0.0)'], {}), '(0.0)\n', (1178, 1183), True, 'import tensorflow.compat.v1 as tf\n'), ((1201, 1217), 'tensorflow.compat.v1.constant', 'tf.constant', (['(0.0)'], {}), '(0.0)\n', (1212, 1217), True, 'import tensorflow.compat.v1 as tf\n'), ((2625, 2665), 't...
r""" Tests for the :mod:`scglue.num` module """ # pylint: disable=redefined-outer-name, wildcard-import, unused-wildcard-import import numpy as np import pytest import scglue from .fixtures import * def test_sigmoid(): assert scglue.num.sigmoid(0) == 0.5 assert 0 < scglue.num.sigmoid(-1) < 0.5 < scglue.nu...
[ "scglue.num.normalize_edges", "scglue.num.vertex_degrees", "scglue.num.tfidf", "scglue.num.pcc_mat", "numpy.allclose", "scglue.num.cov_mat", "scglue.num.sigmoid", "scglue.num.col_var", "pytest.raises", "scglue.num.spr_mat", "numpy.array", "numpy.diag", "numpy.sqrt" ]
[((377, 400), 'scglue.num.col_var', 'scglue.num.col_var', (['mat'], {}), '(mat)\n', (395, 400), False, 'import scglue\n'), ((409, 434), 'scglue.num.col_var', 'scglue.num.col_var', (['spmat'], {}), '(spmat)\n', (427, 434), False, 'import scglue\n'), ((443, 497), 'scglue.num.col_var', 'scglue.num.col_var', (['mat[:10, :2...
""" This module contains classes to solve and simulate consumption-savings models, of the type studied in ConsumptionSavingModel.py, with the addition of a discrete, exogenous, stochastic Markov state (e.g. unemployment). """ import sys sys.path.insert(0,'../') from copy import deepcopy import numpy as np from Cons...
[ "numpy.sum", "numpy.ones", "ConsumptionSavingModel.IndShockConsumerType.__init__", "numpy.arange", "numpy.unique", "numpy.zeros_like", "ConsumptionSavingModel.IndShockConsumerType.advanceIncShks", "time.clock", "numpy.insert", "numpy.cumsum", "numpy.max", "HARKinterpolation.LinearInterp", "n...
[((240, 265), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../"""'], {}), "(0, '../')\n", (255, 265), False, 'import sys\n'), ((40603, 41166), 'numpy.array', 'np.array', (['[[(1 - p_unemploy_good) * (1 - bust_prob), p_unemploy_good * (1 - bust_prob\n ), (1 - p_unemploy_good) * bust_prob, p_unemploy_good * bust...
# -*- coding: utf-8 -*- # import numpy import pytest import quadpy from quadpy.nsimplex.helpers import integrate_monomial_over_unit_simplex from helpers import check_degree @pytest.mark.parametrize( "scheme", [quadpy.nsimplex.GrundmannMoeller(dim, k) for dim in range(3, 7) for k in range(5)] # + [ ...
[ "quadpy.nsimplex.GrundmannMoeller", "quadpy.nsimplex.Stroud", "numpy.zeros", "quadpy.nsimplex.integrate", "quadpy.nsimplex.Walkington" ]
[((1432, 1455), 'numpy.zeros', 'numpy.zeros', (['(n + 1, n)'], {}), '((n + 1, n))\n', (1443, 1455), False, 'import numpy\n'), ((1873, 1909), 'quadpy.nsimplex.Stroud', 'quadpy.nsimplex.Stroud', (['n_', '"""Tn 5-1"""'], {}), "(n_, 'Tn 5-1')\n", (1895, 1909), False, 'import quadpy\n'), ((1559, 1607), 'quadpy.nsimplex.inte...
import numpy as np from collections import Counter # from sklearn.utils.linear_assignment_ import linear_assignment # replaced with source code from: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/utils/linear_assignment_.py """ Mostly borrowed from https://github.com/clarkkev/deep-coref/blob/m...
[ "numpy.argmax", "numpy.logical_not", "numpy.zeros", "numpy.ones", "numpy.any", "numpy.min", "numpy.where", "numpy.array", "collections.Counter", "numpy.atleast_2d" ]
[((6443, 6471), 'numpy.array', 'np.array', (['indices'], {'dtype': 'int'}), '(indices, dtype=int)\n', (6451, 6471), True, 'import numpy as np\n'), ((2900, 2909), 'collections.Counter', 'Counter', ([], {}), '()\n', (2907, 2909), False, 'from collections import Counter\n'), ((6908, 6934), 'numpy.atleast_2d', 'np.atleast_...
from datetime import datetime import numpy as np import os import pytz import six import warnings class ALL: "Sentinel used as the default value for stream_name" pass if six.PY2: # http://stackoverflow.com/a/5032238/380231 def ensure_path_exists(path, exist_ok=True): import errno try...
[ "os.makedirs", "numpy.isscalar", "datetime.datetime", "datetime.datetime.strptime", "pytz.timezone", "warnings.warn" ]
[((3256, 3273), 'pytz.timezone', 'pytz.timezone', (['tz'], {}), '(tz)\n', (3269, 3273), False, 'import pytz\n'), ((613, 649), 'os.makedirs', 'os.makedirs', (['path'], {'exist_ok': 'exist_ok'}), '(path, exist_ok=exist_ok)\n', (624, 649), False, 'import os\n'), ((795, 811), 'numpy.isscalar', 'np.isscalar', (['val'], {}),...
# Machine Learning model 3 (Test w/ some different MAC address + K.Arunan's Echo) import numpy as np import matplotlib.pyplot as plt import pandas as pd import itertools from sklearn.preprocessing import LabelEncoder,OneHotEncoder from sklearn.feature_extraction.text import CountVectorizer from catboost import CatBoos...
[ "matplotlib.pyplot.title", "pandas.read_csv", "sklearn.metrics.accuracy_score", "sklearn.metrics.classification_report", "matplotlib.pyplot.figure", "catboost.CatBoostClassifier", "matplotlib.pyplot.tight_layout", "os.path.abspath", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "matplo...
[((1935, 1980), 'pandas.read_csv', 'pd.read_csv', (['TRAIN_DATASET'], {'names': 'headernames'}), '(TRAIN_DATASET, names=headernames)\n', (1946, 1980), True, 'import pandas as pd\n'), ((2221, 2265), 'pandas.read_csv', 'pd.read_csv', (['TEST_DATASET'], {'names': 'headernames'}), '(TEST_DATASET, names=headernames)\n', (22...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Helpers @author: thomas """ import numpy as np import random import os from shutil import copyfile from gym import spaces def stable_normalizer(x,temp): ''' Computes x[i]**temp/sum_i(x[i]**temp) ''' x = (x / np.max(x))**temp return np.abs(x/np.sum(x)) def...
[ "os.remove", "numpy.save", "numpy.sum", "numpy.argmax", "random.shuffle", "os.path.exists", "random.choice", "numpy.isnan", "numpy.ones", "numpy.max", "numpy.arange", "numpy.array", "shutil.copyfile" ]
[((1283, 1307), 'os.path.exists', 'os.path.exists', (['new_name'], {}), '(new_name)\n', (1297, 1307), False, 'import os\n'), ((1349, 1376), 'numpy.save', 'np.save', (['new_name', 'to_store'], {}), '(new_name, to_store)\n', (1356, 1376), True, 'import numpy as np\n'), ((1383, 1407), 'os.path.exists', 'os.path.exists', (...
import pickle import numpy as np import argparse import os import random import matplotlib.pyplot as plt import matplotlib.animation as animation import matplotlib as mpl from IPython.display import HTML import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.std", "matplotlib.pyplot.legend", "numpy.transpose", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "numpy.mean", "pickle.load", "matplotlib.pyplot.ylabel", "matplotlib.p...
[((776, 806), 'numpy.mean', 'np.mean', (['G_losses_orig'], {'axis': '(0)'}), '(G_losses_orig, axis=0)\n', (783, 806), True, 'import numpy as np\n'), ((820, 863), 'numpy.std', 'np.std', (['(G_losses_orig - G_orig_mean)'], {'axis': '(0)'}), '(G_losses_orig - G_orig_mean, axis=0)\n', (826, 863), True, 'import numpy as np\...
# Description: Calculate coherences between daily vorticity terms. # # Author: <NAME> # E-mail: <EMAIL> # Date: April/2019 import numpy as np import matplotlib.pyplot as plt from glob import glob from netCDF4 import Dataset from xarray import open_dataset from pandas import Timestamp from xarray impor...
[ "netCDF4.Dataset", "numpy.load", "numpy.nansum", "pandas.Timestamp", "numpy.logical_and", "numpy.asanyarray", "xarray.open_dataset", "numpy.bool8", "numpy.isnan", "numpy.append", "numpy.array", "numpy.logical_or", "glob.glob" ]
[((1069, 1090), 'glob.glob', 'glob', (["(headin + '*.nc')"], {}), "(headin + '*.nc')\n", (1073, 1090), False, 'from glob import glob\n'), ((1273, 1294), 'netCDF4.Dataset', 'Dataset', (['fname_ncgrid'], {}), '(fname_ncgrid)\n', (1280, 1294), False, 'from netCDF4 import Dataset\n'), ((1441, 1456), 'numpy.load', 'np.load'...
""" ModelGrid.py Author: <NAME> Affiliation: University of Colorado at Boulder Created on: Thu Dec 5 15:49:16 MST 2013 Description: For working with big model grids. Setting them up, running them, and analyzing them. """ from __future__ import print_function import os import gc import re import copy import time i...
[ "numpy.sum", "numpy.abs", "mpi4py.MPI.COMM_WORLD.Recv", "numpy.empty", "time.ctime", "numpy.ones", "numpy.argmin", "gc.collect", "numpy.random.randint", "numpy.arange", "numpy.interp", "mpi4py.MPI.COMM_WORLD.Allreduce", "numpy.unique", "os.path.exists", "numpy.reshape", "signal.alarm",...
[((7816, 7843), 'numpy.array', 'np.array', (['assign'], {'dtype': 'int'}), '(assign, dtype=int)\n', (7824, 7843), True, 'import numpy as np\n'), ((18849, 18863), 'numpy.zeros', 'np.zeros', (['size'], {}), '(size)\n', (18857, 18863), True, 'import numpy as np\n'), ((24612, 24623), 'time.time', 'time.time', ([], {}), '()...
# Import modules import numpy as np import os from sklearn.linear_model import ElasticNetCV import pandas as pd import time from joblib import Parallel, delayed import multiprocessing from optparse import OptionParser from local_functions_20200813 import make_weights, weight_data, select_frequent_dominate_genera, Elast...
[ "pandas.DataFrame", "numpy.matrix", "numpy.average", "numpy.sum", "optparse.OptionParser", "numpy.std", "local_functions_20200813.make_weights", "os.path.exists", "numpy.append", "numpy.where", "joblib.Parallel", "numpy.dot", "joblib.delayed", "numpy.delete", "local_functions_20200813.se...
[((539, 555), 'numpy.matrix', 'np.matrix', (['abund'], {}), '(abund)\n', (548, 555), True, 'import numpy as np\n'), ((568, 622), 'numpy.append', 'np.append', (['abund[1:, target_otu]', 'abund[0:-1,]'], {'axis': '(1)'}), '(abund[1:, target_otu], abund[0:-1,], axis=1)\n', (577, 622), True, 'import numpy as np\n'), ((1459...
import copy import os.path import output_utils import sys import torch import numpy as np import argparse import time import data_utils import models import model_utils import config_utils import embedding_loader import sklearn.metrics import pandas as pd # Try to avoid? from collections import Counter, defaultdict # ...
[ "argparse.ArgumentParser", "data_utils.get_cv_folds", "time.strftime", "collections.defaultdict", "torch.set_num_threads", "data_utils.transform_labels_into_names", "data_utils.get_counts_entities", "numpy.sqrt", "data_utils.load_video_vec", "pandas.DataFrame", "data_utils.get_vocabulary", "em...
[((419, 444), 'output_utils.Logger', 'output_utils.Logger', (['args'], {}), '(args)\n', (438, 444), False, 'import output_utils\n'), ((531, 565), 'torch.set_num_threads', 'torch.set_num_threads', (['num_threads'], {}), '(num_threads)\n', (552, 565), False, 'import torch\n'), ((687, 739), 'data_utils.load_entity_map', '...
import matplotlib.pyplot as plt from scipy import signal import numpy as np # Number of neighbours 0 1 2 3 4 5 6 7 8 RULE_OF_SURVIVAL = np.array([0, 0, 1, 1, 0, 0, 0, 0, 0]) RULE_OF_CREATION = np.array([0, 0, 0, 1, 0, 0, 0, 0, 0]) # Map resolution MAP_SIZE = 100 # Map creation gof_map = np.random.choic...
[ "matplotlib.pyplot.show", "scipy.signal.convolve2d", "numpy.array", "numpy.random.choice", "matplotlib.pyplot.subplots" ]
[((151, 188), 'numpy.array', 'np.array', (['[0, 0, 1, 1, 0, 0, 0, 0, 0]'], {}), '([0, 0, 1, 1, 0, 0, 0, 0, 0])\n', (159, 188), True, 'import numpy as np\n'), ((208, 245), 'numpy.array', 'np.array', (['[0, 0, 0, 1, 0, 0, 0, 0, 0]'], {}), '([0, 0, 0, 1, 0, 0, 0, 0, 0])\n', (216, 245), True, 'import numpy as np\n'), ((305...
import tensorflow as tf import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import MinMaxScaler, StandardScaler def get_next_batch(i_count): while True: if i_count >= max_batch - 1: i_count = int(i_count % max_batch) a_...
[ "tensorflow.nn.relu", "pandas.read_csv", "sklearn.model_selection.train_test_split", "tensorflow.argmax", "sklearn.preprocessing.MinMaxScaler", "numpy.zeros", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.constant", "tensorflow.Session", "tensorflow.global_variables_initializer", ...
[((1171, 1196), 'pandas.read_csv', 'pd.read_csv', (['"""123456.csv"""'], {}), "('123456.csv')\n", (1182, 1196), True, 'import pandas as pd\n'), ((1218, 1270), 'sklearn.model_selection.train_test_split', 'train_test_split', (['df'], {'test_size': '(0.3)', 'random_state': '(12)'}), '(df, test_size=0.3, random_state=12)\n...
#!/usr/bin/env python """ psource.py Routines for dealing with point source files in ROMS Author: <NAME> <<EMAIL>> Copyright (c) 2019, <NAME>, all rights reserved. Created: 10 January 2019 """ import seapy.roms.ncgen import numpy as np import urllib.request as urllib import json import datetime disc...
[ "numpy.abs", "numpy.asarray", "numpy.ma.getmaskarray", "urllib.request.urlopen", "numpy.ones", "datetime.datetime.strptime", "numpy.array", "numpy.ma.masked_array" ]
[((1856, 1873), 'numpy.asarray', 'np.asarray', (['river'], {}), '(river)\n', (1866, 1873), True, 'import numpy as np\n'), ((3412, 3431), 'urllib.request.urlopen', 'urllib.urlopen', (['url'], {}), '(url)\n', (3426, 3431), True, 'import urllib.request as urllib\n'), ((2566, 2604), 'numpy.asarray', 'np.asarray', (["r['vsh...
#%% # constants - enoshima (sample) MESHES = ['523973', '523974'] GPKG = 'enoshima_shape.gpkg' DEM = 'enoshima_dem.vrt' # DEM = 'dem_10m.vrt' TILES = [ (15, 29079, 12944), # 片瀬海岸 (15, 29080, 12944), # 龍口寺 (15, 29081, 12944), # 津西 (15, 29079, 12945), # 江の島参道 (15, 29080, 12945), # 湘南港 (15, 29...
[ "landtile.roads_builder.build", "landtile.buildings_extender.extend", "os.remove", "landtile.terrain_creator.create", "landtile.mesh.write_obj", "os.path.basename", "landtile.dem_digger.undig", "landtile.tile.num2lonlat", "os.path.exists", "os.system", "landtile.buildings_builder.build", "nump...
[((792, 856), 'os.system', 'os.system', (['f"""gdalbuildvrt {DEM} ../../data/dem05s/52397[34].tif"""'], {}), "(f'gdalbuildvrt {DEM} ../../data/dem05s/52397[34].tif')\n", (801, 856), False, 'import os\n'), ((1253, 1291), 'os.system', 'os.system', (['f"""cp landtile/common.mtl ."""'], {}), "(f'cp landtile/common.mtl .')\...
"""Module that implement an iterator version of the sampler.""" from os.path import join from random import shuffle import numpy as np import soundfile as sf from audio_loader.samplers.decorator import SamplerBase class WindowedSegmentSampler(SamplerBase): """Create samples with associated groundtruth. No ...
[ "random.shuffle", "soundfile.read", "os.path.join", "numpy.sum" ]
[((2633, 2651), 'random.shuffle', 'shuffle', (['file_list'], {}), '(file_list)\n', (2640, 2651), False, 'from random import shuffle\n'), ((2841, 2891), 'soundfile.read', 'sf.read', (['filepath'], {'always_2d': '(True)', 'dtype': '"""float32"""'}), "(filepath, always_2d=True, dtype='float32')\n", (2848, 2891), True, 'im...
from __future__ import absolute_import import numpy as np import scipy import torch from pysurvival.models import BaseModel from pysurvival import utils, HAS_GPU from pysurvival.utils import optimization as opt from pysurvival.utils import neural_networks as nn class BaseParametricModel(BaseModel): """ Base class...
[ "pysurvival.utils.check_data", "numpy.maximum", "torch.FloatTensor", "numpy.argmin", "pysurvival.utils.neural_networks.ParametricNet", "torch.exp", "torch.pow", "numpy.reshape", "numpy.linspace", "pysurvival.utils.optimization.optimize", "torch.sum", "torch.log", "torch.tensor", "numpy.sqr...
[((2026, 2080), 'numpy.linspace', 'np.linspace', (['min_time', '(max_time * (1.0 + p))', 'self.bins'], {}), '(min_time, max_time * (1.0 + p), self.bins)\n', (2037, 2080), True, 'import numpy as np\n'), ((8167, 8192), 'pysurvival.utils.check_data', 'utils.check_data', (['X', 'T', 'E'], {}), '(X, T, E)\n', (8183, 8192), ...
import math import sys, os #import .base from .base.pygamewrapper import PyGameWrapper import pygame from pygame.constants import K_w, K_s from .utils.vec2d import vec2d class Block(pygame.sprite.Sprite): def __init__(self, pos_init, speed, SCREEN_WIDTH, SCREEN_HEIGHT): pygame.sprite.Sprite.__init__(se...
[ "pygame.quit", "os.path.abspath", "pygame.Surface", "pygame.draw.rect", "pygame.event.get", "numpy.random.RandomState", "pygame.init", "pygame.sprite.Group", "pygame.display.update", "pygame.sprite.Sprite.__init__", "pygame.sprite.spritecollide", "pygame.image.load", "pygame.time.Clock", "...
[((9529, 9542), 'pygame.init', 'pygame.init', ([], {}), '()\n', (9540, 9542), False, 'import pygame\n'), ((9677, 9696), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (9694, 9696), False, 'import pygame\n'), ((9712, 9737), 'numpy.random.RandomState', 'np.random.RandomState', (['(24)'], {}), '(24)\n', (9733...
import numpy as np import seaborn as sns import matplotlib.pyplot as plt from matplotlib import patches import matplotlib.patches as mpatches import scipy.io as sio # plotting configuration ratio = 1.5 figure_len, figure_width = 15*ratio, 12*ratio font_size_1, font_size_2 = 36*ratio, 36*ratio legend_size = 18*ratio li...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.yscale", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "numpy.power", "numpy.asarray", "matplotlib.pyplot.yticks", "matplotlib.pyplot.legend", "numpy.clip", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.gca", "matplotlib.pyp...
[((1377, 1394), 'numpy.asarray', 'np.asarray', (['l_r_e'], {}), '(l_r_e)\n', (1387, 1394), True, 'import numpy as np\n'), ((1403, 1420), 'numpy.asarray', 'np.asarray', (['l_r_i'], {}), '(l_r_i)\n', (1413, 1420), True, 'import numpy as np\n'), ((1427, 1442), 'numpy.asarray', 'np.asarray', (['l_x'], {}), '(l_x)\n', (1437...
"""Data utils functions for pre-processing and data loading.""" import os import pickle as pkl import sys import networkx as nx import numpy as np import scipy.sparse as sp import torch from sc_utility import * def load_data(args, datapath): if args.task == 'nc': data = load_data_nc(args.dataset) else:...
[ "numpy.random.seed", "numpy.sum", "numpy.argmax", "torch.cat", "numpy.ones", "pickle.load", "numpy.arange", "scipy.sparse.isspmatrix", "os.path.join", "scipy.sparse.eye", "networkx.adjacency_matrix", "numpy.power", "scipy.sparse.triu", "torch.Tensor", "numpy.random.shuffle", "scipy.spa...
[((1389, 1412), 'scipy.sparse.isspmatrix', 'sp.isspmatrix', (['features'], {}), '(features)\n', (1402, 1412), True, 'import scipy.sparse as sp\n'), ((1540, 1562), 'torch.Tensor', 'torch.Tensor', (['features'], {}), '(features)\n', (1552, 1562), False, 'import torch\n'), ((1894, 1909), 'scipy.sparse.diags', 'sp.diags', ...
import unittest import pointcloud.utils.misc as misc from shapely.geometry import Polygon import numpy as np workspace = 'test_data/' points = np.array([[1, 1, 1], [1, 2, 1], [3, 1, 1], [4, 5, 1], [3, 6, 10], [2, 5, 10], ...
[ "unittest.main", "shapely.geometry.Polygon", "pointcloud.utils.misc.calculate_tile_size_from_target_number_of_points", "pointcloud.utils.misc.get_names_and_polygons_in_workspace", "pointcloud.utils.misc.calculate_polygon_from_filename", "numpy.array" ]
[((145, 252), 'numpy.array', 'np.array', (['[[1, 1, 1], [1, 2, 1], [3, 1, 1], [4, 5, 1], [3, 6, 10], [2, 5, 10], [4, 6,\n 10], [3, 5, 10]]'], {}), '([[1, 1, 1], [1, 2, 1], [3, 1, 1], [4, 5, 1], [3, 6, 10], [2, 5, 10\n ], [4, 6, 10], [3, 5, 10]])\n', (153, 252), True, 'import numpy as np\n'), ((1904, 1919), 'unitt...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from utilities.helpers import load_model_from_dict class Model(nn.Module): """ Defines an aligner network. This is the main class of the architecture code. `height` is the number of levels of the network `featur...
[ "torch.load", "torch.nn.Conv2d", "utilities.helpers.load_model_from_dict", "torch.cat", "torch.nn.MaxPool2d", "torch.nn.functional.interpolate", "numpy.sqrt", "torch.nn.functional.pad" ]
[((1812, 1899), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channels', 'out_channels'], {'kernel_size': '(3)', 'stride': '(1)', 'padding': '(1)', 'bias': '(True)'}), '(in_channels, out_channels, kernel_size=3, stride=1, padding=1,\n bias=True)\n', (1821, 1899), True, 'import torch.nn as nn\n'), ((1948, 1996), 'torch.nn.Ma...
from PIL import Image import numpy as np import os import re import cv2 import shutil import random def get_all_images_in_folder(train_folder,test_folder): images = [] dataCounter = 1 random.seed(1) #Train - Tumour for directory in sorted(os.listdir(train_folder)): print (directory) ...
[ "numpy.size", "numpy.save", "numpy.count_nonzero", "random.shuffle", "cv2.threshold", "os.walk", "random.seed", "os.path.join", "os.listdir", "cv2.resize" ]
[((3970, 3998), 'os.walk', 'os.walk', (['"""../dataset/Train/"""'], {}), "('../dataset/Train/')\n", (3977, 3998), False, 'import os\n'), ((4150, 4177), 'os.walk', 'os.walk', (['"""../dataset/Test/"""'], {}), "('../dataset/Test/')\n", (4157, 4177), False, 'import os\n'), ((4329, 4357), 'os.walk', 'os.walk', (['"""../dat...
#!/usr/bin/env python # Copyright (C) 2018 <NAME> import numpy as np import crispy as cy import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from natsort import natsorted from scipy.stats import pearsonr from analysis.DataImporter import DataImporter def estimate_copynumber_bias(beds): # - ...
[ "matplotlib.pyplot.title", "pandas.pivot_table", "pandas.read_csv", "crispy.QCplot.bias_boxplot", "crispy.QCplot.recall_curve", "matplotlib.pyplot.axvline", "matplotlib.pyplot.close", "crispy.QCplot.recall_curve_discretise", "pandas.concat", "matplotlib.pyplot.errorbar", "matplotlib.pyplot.axhli...
[((2537, 2555), 'pandas.concat', 'pd.concat', (['aucs_df'], {}), '(aucs_df)\n', (2546, 2555), True, 'import pandas as pd\n'), ((4079, 4098), 'matplotlib.pyplot.xlim', 'plt.xlim', (['(None, 1)'], {}), '((None, 1))\n', (4087, 4098), True, 'import matplotlib.pyplot as plt\n'), ((4103, 4122), 'matplotlib.pyplot.ylim', 'plt...
""" .. _admitsegment: ADMITSegmentFinder --- Finds segments of emission within a spectrum. -------------------------------------------------------------------- This module defines the class for spectral line segment detection. """ # system imports import math import numpy as np import numpy.ma as ma # AD...
[ "numpy.ma.median", "numpy.ma.masked_outside", "numpy.hanning", "numpy.ma.masked_invalid", "numpy.array", "admit.util.AdmitLogging.AdmitLogging.debug", "numpy.convolve", "admit.util.stats.robust" ]
[((9404, 9431), 'admit.util.stats.robust', 'stats.robust', (['data2', 'self.f'], {}), '(data2, self.f)\n', (9416, 9431), False, 'from admit.util import stats\n'), ((9643, 9667), 'numpy.ma.masked_invalid', 'ma.masked_invalid', (['data2'], {}), '(data2)\n', (9660, 9667), True, 'import numpy.ma as ma\n'), ((9911, 9938), '...
import pytest from gpu_pairwise import pairwise_distance from scipy.spatial.distance import cdist, squareform import numpy as np from numpy.testing import assert_allclose SCIPY_METRICS = [ 'euclidean', 'sqeuclidean', 'cityblock', 'braycurtis', 'canberra', 'chebyshev', ] # def test_simple_c...
[ "scipy.spatial.distance.cdist", "numpy.fill_diagonal", "numpy.asarray", "numpy.testing.assert_allclose", "gpu_pairwise.pairwise_distance", "numpy.random.randint", "numpy.random.rand", "pytest.mark.parametrize" ]
[((2130, 2178), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""metric"""', 'SCIPY_METRICS'], {}), "('metric', SCIPY_METRICS)\n", (2153, 2178), False, 'import pytest\n'), ((2221, 2261), 'gpu_pairwise.pairwise_distance', 'pairwise_distance', (['matrix'], {'metric': 'metric'}), '(matrix, metric=metric)\n', (2...
# -*- coding: utf-8 -*- import numpy as np import pandas as pd from pandas.core.base import PandasObject from scipy.optimize import minimize from decorator import decorator from sklearn.covariance import ledoit_wolf @decorator def mean_var_weights(func_covar, *args, **kwargs): """ Calculates the mean-variance ...
[ "pandas.DataFrame", "pyetf.algos.future_mean_var", "scipy.optimize.minimize", "sklearn.covariance.ledoit_wolf", "pyetf.algos.forecast_var_from_garch", "pyetf.algos.forecast_var_from_lstm", "numpy.ones", "numpy.sin", "pyetf.algos.forecast_cov_from_lstm", "pandas.Series", "numpy.dot", "numpy.sqr...
[((1723, 1849), 'scipy.optimize.minimize', 'minimize', (['fitness', 'weights', '(exp_rets, covar, rf)'], {'method': '"""SLSQP"""', 'constraints': 'constraints', 'bounds': 'bounds', 'options': 'options'}), "(fitness, weights, (exp_rets, covar, rf), method='SLSQP',\n constraints=constraints, bounds=bounds, options=opt...
# routines for generating a list of coordinate offsets for various template structures import numpy as np class Template: """Class template for generating lists of template voxels Parameters ---------- type: string Required by constructor. The type of template currently available types are:...
[ "numpy.array", "numpy.zeros", "numpy.sign" ]
[((5458, 5486), 'numpy.zeros', 'np.zeros', (['(self.dim, 2)', 'int'], {}), '((self.dim, 2), int)\n', (5466, 5486), True, 'import numpy as np\n'), ((23117, 23142), 'numpy.array', 'np.array', (['self.offsets[i]'], {}), '(self.offsets[i])\n', (23125, 23142), True, 'import numpy as np\n'), ((23145, 23165), 'numpy.array', '...
import numpy as np from astropy import units as u from astropy.cosmology import Planck15 from scipy.constants import c class Converter(object): def __init__(self): pass class HIConverter(object): def __init__(self, mode='relativistic'): # HI restframe self.nu0 = 1420.4058 sel...
[ "astropy.cosmology.Planck15.luminosity_distance", "astropy.units.doppler_relativistic", "numpy.array", "astropy.units.doppler_radio", "astropy.units.doppler_optical", "numpy.sqrt" ]
[((463, 497), 'astropy.units.doppler_relativistic', 'u.doppler_relativistic', (['self.nu0_u'], {}), '(self.nu0_u)\n', (485, 497), True, 'from astropy import units as u\n'), ((1262, 1276), 'numpy.array', 'np.array', (['velo'], {}), '(velo)\n', (1270, 1276), True, 'import numpy as np\n'), ((1359, 1403), 'numpy.sqrt', 'np...
#Python wrapper / library for Einstein Analytics API #core libraries import sys import logging import json import time from dateutil import tz import re from decimal import Decimal import base64 import csv import math import pkg_resources # installed libraries import browser_cookie3 import requests import unicodecsv ...
[ "json.dumps", "requests.utils.dict_from_cookiejar", "datetime.datetime.utcnow", "logging.NullHandler", "sys.getsizeof", "sys.exc_info", "pandas.DataFrame", "pkg_resources.get_distribution", "logging.error", "json.loads", "logging.warning", "dateutil.tz.tzlocal", "re.findall", "datetime.tim...
[((518, 574), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s: %(message)s"""'}), "(format='%(levelname)s: %(message)s')\n", (537, 574), False, 'import logging\n'), ((495, 516), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (514, 516), False, 'import logging\n'), ((456,...
import copy import glob import os import re from collections import defaultdict from datetime import date from datetime import datetime import numpy import pytz from mxio import read_header from mxdc.utils import misc FRAME_NUMBER_DIGITS = 4 OUTLIER_DEVIATION = 50 class StrategyType(object): SINGLE, FULL, SCRE...
[ "copy.deepcopy", "os.path.join", "mxdc.conf.settings.get_session", "os.path.exists", "mxdc.conf.settings.get_string", "re.match", "datetime.datetime.now", "collections.defaultdict", "datetime.date.today", "numpy.diff", "numpy.arange", "numpy.array", "numpy.linspace", "mxio.read_header", ...
[((2789, 2808), 'copy.deepcopy', 'copy.deepcopy', (['info'], {}), '(info)\n', (2802, 2808), False, 'import copy\n'), ((3339, 3380), 'mxdc.conf.settings.get_string', 'settings.get_string', (['"""directory-template"""'], {}), "('directory-template')\n", (3358, 3380), False, 'from mxdc.conf import settings\n'), ((9403, 94...
import os # os.environ['CUDA_VISIBLE_DEVICES'] = '1' import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import Dataset, DataLoader from utils.early_stopping import EarlyStopping import numpy as np import copy from tqdm import tqdm from model.hrlce import HierarchicalPredictor, NUM_EMO ...
[ "pickle.dump", "numpy.random.seed", "argparse.ArgumentParser", "random.shuffle", "model.hrlce.HierarchicalPredictor", "torch.cuda.device_count", "os.path.isfile", "pickle.load", "sys.stdout.flush", "numpy.random.normal", "torch.no_grad", "torch.nn.MSELoss", "torch.utils.data.DataLoader", "...
[((806, 852), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Options"""'}), "(description='Options')\n", (829, 852), False, 'import argparse\n'), ((2841, 2871), 'torch.manual_seed', 'torch.manual_seed', (['RANDOM_SEED'], {}), '(RANDOM_SEED)\n', (2858, 2871), False, 'import torch\n'), ((2...
# Created byMartin.cz # Copyright (c) <NAME>. All rights reserved. import unittest import pero import numpy class TestCase(unittest.TestCase): """Test case for linear interpolator.""" def test_log10(self): """Tests whether interpolator works for log10 range.""" interpol =...
[ "unittest.main", "pero.LogInterpol", "numpy.array" ]
[((2004, 2030), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (2017, 2030), False, 'import unittest\n'), ((321, 339), 'pero.LogInterpol', 'pero.LogInterpol', ([], {}), '()\n', (337, 339), False, 'import pero\n'), ((982, 1000), 'pero.LogInterpol', 'pero.LogInterpol', ([], {}), '()\n', ...
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "mindspore.context.set_context", "numpy.random.seed", "numpy.frombuffer", "grpc.insecure_channel", "numpy.zeros", "ms_service_pb2.PredictRequest", "tests.st.networks.models.bert.src.bert_model.BertModel", "mindspore.Tensor", "numpy.ones", "numpy.random.randint", "random.seed", "mindspore.datas...
[((984, 1052), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE', 'device_target': '"""Ascend"""'}), "(mode=context.GRAPH_MODE, device_target='Ascend')\n", (1003, 1052), False, 'from mindspore import Tensor, context\n'), ((1054, 1068), 'random.seed', 'random.seed', (['(1)'], {})...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @File :kine_UAV.py @Description : @Date :2021/09/29 14:08:39 @Author :<NAME> ''' import numpy as np from .rotation_matrix import RotationMatrix rm = RotationMatrix() class KineUAV(): """ UAV kinematics, yaw is fixed """ def __init__...
[ "numpy.zeros", "numpy.append", "numpy.sin", "numpy.array", "numpy.matmul", "numpy.cos", "numpy.diag", "numpy.concatenate" ]
[((1239, 1259), 'numpy.array', 'np.array', (['[d_p, d_v]'], {}), '([d_p, d_v])\n', (1247, 1259), True, 'import numpy as np\n'), ((1277, 1302), 'numpy.append', 'np.append', (['d_state', 'd_phi'], {}), '(d_state, d_phi)\n', (1286, 1302), True, 'import numpy as np\n'), ((1321, 1348), 'numpy.append', 'np.append', (['d_stat...
import numpy as np from citysim3d.spaces import Space class ConcatenationSpace(Space): def __init__(self, spaces): self.spaces = spaces sizes = [] for space in self.spaces: size, = space.shape sizes.append(size) cumsum = np.cumsum(sizes) self.slices ...
[ "numpy.cumsum" ]
[((283, 299), 'numpy.cumsum', 'np.cumsum', (['sizes'], {}), '(sizes)\n', (292, 299), True, 'import numpy as np\n')]
from __future__ import print_function import torch import numpy as np from PIL import Image import inspect, re import numpy as np import os import collections import subprocess as sp import gc from skimage.draw import disk, line_aa, polygon, polygon2mask, rectangle # Converts a Tensor into a Numpy array # |imtype|: ...
[ "numpy.abs", "numpy.floor", "numpy.mean", "numpy.arange", "numpy.tile", "numpy.std", "os.path.exists", "numpy.logical_and.reduce", "numpy.transpose", "numpy.max", "torch.zeros", "torch.is_tensor", "re.search", "numpy.repeat", "numpy.minimum", "numpy.ceil", "skimage.draw.line_aa", "...
[((3113, 3160), 'numpy.zeros', 'np.zeros', ([], {'shape': '(img_size + (3,))', 'dtype': 'np.uint8'}), '(shape=img_size + (3,), dtype=np.uint8)\n', (3121, 3160), True, 'import numpy as np\n'), ((3172, 3208), 'numpy.zeros', 'np.zeros', ([], {'shape': 'img_size', 'dtype': 'bool'}), '(shape=img_size, dtype=bool)\n', (3180,...
import time import numpy as np class Simplex: """Primal simplex method that solves a linear program expressed in standard form. It starts with a feasible basic solution, and moves from one feasible basic solution to another to decrease objective function, until reaching the minimum. """ ...
[ "numpy.copy", "numpy.zeros", "numpy.expand_dims", "numpy.argmin", "time.time", "numpy.where", "numpy.array", "numpy.vstack" ]
[((8361, 8479), 'numpy.array', 'np.array', (['[[1, 0, 0, 2, -1, 10], [0, 1, 0, -1, -5, 20], [0, 0, 1, 6, -12, 18], [0, 0,\n 0, -2, 3, 60]]'], {'dtype': 'float'}), '([[1, 0, 0, 2, -1, 10], [0, 1, 0, -1, -5, 20], [0, 0, 1, 6, -12, 18\n ], [0, 0, 0, -2, 3, 60]], dtype=float)\n', (8369, 8479), True, 'import numpy as ...
""" Integrator module ================= Module with the classes of integrators to multi-thread the integration of an ordinary differential equations .. math:: \dot{\\boldsymbol{x}} = \\boldsymbol{f}(t, \\boldsymbol{x}) of the model and its linearized version. Module classes --------...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.arange", "multiprocessing.Queue", "integrators.integrate._integrate_runge_kutta_jit", "multiprocessing.cpu_count", "numpy.full", "functions.util.reverse", "numpy.random.randn", "scipy.integrate.odeint", "numpy.swapaxes", "multiproce...
[((50697, 50722), 'numpy.arange', 'np.arange', (['(0.0)', '(10.0)', '(0.1)'], {}), '(0.0, 10.0, 0.1)\n', (50706, 50722), True, 'import numpy as np\n'), ((50870, 50882), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (50880, 50882), True, 'import matplotlib.pyplot as plt\n'), ((51173, 51193), 'matplotlib.py...
import numpy as np from .. import Geometry, Line, LineSegmentMaterial from ..utils import Color DTYPE = "f4" class GridHelper(Line): """An object indicating the z=0 plane.""" def __init__( self, size=10.0, divisions=10, color1=(0.35, 0.35, 0.35, 1), color2=(0.1, 0.1,...
[ "numpy.empty", "numpy.zeros", "numpy.linspace" ]
[((500, 560), 'numpy.linspace', 'np.linspace', (['(-half_size)', 'half_size'], {'num': 'n_lines', 'dtype': 'DTYPE'}), '(-half_size, half_size, num=n_lines, dtype=DTYPE)\n', (511, 560), True, 'import numpy as np\n'), ((692, 733), 'numpy.zeros', 'np.zeros', (['(2, n_lines, 2, 3)'], {'dtype': 'DTYPE'}), '((2, n_lines, 2, ...
# -*- coding: utf-8 -*- """ Defines unit tests for :mod:`colour.io.luts.common` module. """ from __future__ import division, unicode_literals import numpy as np import unittest from colour.constants import DEFAULT_INT_DTYPE from colour.io.luts.common import parse_array, path_to_title __author__ = 'Colour Developers...
[ "unittest.main", "colour.io.luts.common.parse_array", "numpy.array", "numpy.linspace", "colour.io.luts.common.path_to_title" ]
[((2175, 2190), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2188, 2190), False, 'import unittest\n'), ((1149, 1170), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(10)'], {}), '(0, 1, 10)\n', (1160, 1170), True, 'import numpy as np\n'), ((916, 945), 'colour.io.luts.common.parse_array', 'parse_array', (['""...
""" Copyright (c) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
[ "cv2.resize", "pytest.importorskip", "numpy.argmax", "cv2.cvtColor", "numpy.transpose", "pytest.skip", "pytest.raises", "accuracy_checker.launcher.launcher.create_launcher", "pytest.mark.usefixtures" ]
[((592, 654), 'pytest.importorskip', 'pytest.importorskip', (['"""accuracy_checker.launcher.onnx_launcher"""'], {}), "('accuracy_checker.launcher.onnx_launcher')\n", (611, 654), False, 'import pytest\n'), ((3112, 3155), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""mock_path_exists"""'], {}), "('mock_path...
import numpy as np ################################################################################## # Two class or binary SVM # ################################################################################## def binary_svm_loss(theta, X, y, C): """ ...
[ "numpy.sum", "numpy.zeros", "numpy.maximum", "numpy.square" ]
[((741, 762), 'numpy.zeros', 'np.zeros', (['theta.shape'], {}), '(theta.shape)\n', (749, 762), True, 'import numpy as np\n'), ((2671, 2692), 'numpy.zeros', 'np.zeros', (['theta.shape'], {}), '(theta.shape)\n', (2679, 2692), True, 'import numpy as np\n'), ((4731, 4752), 'numpy.zeros', 'np.zeros', (['theta.shape'], {}), ...
import warnings import os from ..base import PSGbase import numpy as np import pandas as pd from .utils import _read_event, _read_technician_note, _read_sleep_stage, \ _read_data_segments,_read_header,_read_montage, _read_epoch_data,\ read_dat_data, read_d16_data, read_dat_discrete_data import scipy.signal impo...
[ "pandas.DataFrame", "numpy.ones_like", "numpy.asarray", "mne.create_info", "datetime.datetime.strptime", "numpy.bitwise_and", "os.path.splitext", "warnings.warn", "os.path.join", "numpy.vstack" ]
[((3117, 3151), 'mne.create_info', 'mne.create_info', (['ch_name'], {'sfreq': 'sf'}), '(ch_name, sfreq=sf)\n', (3132, 3151), False, 'import mne\n'), ((8043, 8080), 'numpy.asarray', 'np.asarray', (['self._stages'], {'dtype': '"""int"""'}), "(self._stages, dtype='int')\n", (8053, 8080), True, 'import numpy as np\n'), ((8...
import pathlib import tempfile import numpy as np import qpimage from drymass.cli import config, dialog def setup_test_data(radius_px=30, size=200, pxsize=1e-6, medium_index=1.335, wavelength=550e-9, method="edge", model="projection", refraction_increment=.18, num=1, write_co...
[ "qpimage.QPSeries", "drymass.cli.config.ConfigFile", "tempfile.mkstemp", "numpy.roll", "pathlib.Path", "numpy.arange", "qpimage.QPImage", "tempfile.mktemp", "drymass.cli.dialog.main", "numpy.sqrt" ]
[((443, 481), 'numpy.sqrt', 'np.sqrt', (['((x - cx) ** 2 + (y - cy) ** 2)'], {}), '((x - cx) ** 2 + (y - cy) ** 2)\n', (450, 481), True, 'import numpy as np\n'), ((564, 626), 'qpimage.QPImage', 'qpimage.QPImage', ([], {'data': '(pha, amp)', 'which_data': '"""phase,amplitude"""'}), "(data=(pha, amp), which_data='phase,a...