code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np from torch import nn def layer_init(layer, std=np.sqrt(2), bias_const=0.0): """ Simple function to init layers """ nn.init.orthogonal_(layer.weight, std) nn.init.constant_(layer.bias, bias_const) return layer
[ "torch.nn.init.orthogonal_", "numpy.sqrt", "torch.nn.init.constant_" ]
[((68, 78), 'numpy.sqrt', 'np.sqrt', (['(2)'], {}), '(2)\n', (75, 78), True, 'import numpy as np\n'), ((152, 190), 'torch.nn.init.orthogonal_', 'nn.init.orthogonal_', (['layer.weight', 'std'], {}), '(layer.weight, std)\n', (171, 190), False, 'from torch import nn\n'), ((195, 236), 'torch.nn.init.constant_', 'nn.init.co...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the PyMVPA package for the # copyright and license terms. # ### ### ### ### ###...
[ "numpy.abs", "numpy.eye", "numpy.random.random", "mvpa2.base.externals.exists", "unittest.makeSuite", "itertools.product", "mvpa2.datasets.base.dataset_wizard", "numpy.linalg.det", "numpy.dot", "numpy.linalg.norm", "mvpa2.testing.datasets.get_random_rotation", "mvpa2.mappers.procrustean.Procru...
[((733, 765), 'mvpa2.base.externals.exists', 'externals.exists', (['"""liblapack.so"""'], {}), "('liblapack.so')\n", (749, 765), False, 'from mvpa2.base import externals\n'), ((793, 818), 'mvpa2.base.externals.exists', 'externals.exists', (['"""scipy"""'], {}), "('scipy')\n", (809, 818), False, 'from mvpa2.base import ...
import bpy import numpy as np import math import mathutils import time import os class Prism: """ ^""" """ / \\""" """ / ^ \\""" """ / | \\""" """ /'alpha'\\ <-- lenght of this side is calculated based on 'width' and 'alpha'""" """/ \\""" """-------...
[ "bpy.ops.object.delete", "mathutils.Vector", "numpy.tan", "bpy.ops.object.select_all", "bpy.data.objects.new", "bpy.data.meshes.new", "math.radians", "bpy.context.collection.objects.link" ]
[((732, 751), 'math.radians', 'math.radians', (['alpha'], {}), '(alpha)\n', (744, 751), False, 'import math\n'), ((877, 919), 'bpy.ops.object.select_all', 'bpy.ops.object.select_all', ([], {'action': '"""SELECT"""'}), "(action='SELECT')\n", (902, 919), False, 'import bpy\n'), ((929, 968), 'bpy.ops.object.delete', 'bpy....
""" The container to store indexes in active learning. Serve as the basic type of 'set' operation. """ # Authors: <NAME> # License: BSD 3 clause from __future__ import division import collections import copy import numpy as np from .multi_label_tools import check_index_multilabel, infer_label_size_multilabel, flatt...
[ "numpy.unique", "numpy.asarray", "numpy.zeros", "numpy.argwhere", "numpy.unravel_index", "numpy.nonzero", "copy.deepcopy" ]
[((3255, 3290), 'copy.deepcopy', 'copy.deepcopy', (['self._innercontainer'], {}), '(self._innercontainer)\n', (3268, 3290), False, 'import copy\n'), ((16509, 16558), 'numpy.unique', 'np.unique', (['[tp[0] for tp in self._innercontainer]'], {}), '([tp[0] for tp in self._innercontainer])\n', (16518, 16558), True, 'import...
import pandas as pd import rapidfuzz import math import numpy as np # ------------------------- # # --------- DATA ---------- # # ------------------------- # # Read in mock census and PES data CEN = pd.read_csv('Data/Mock_Rwanda_Data_Census.csv') PES = pd.read_csv('Data/Mock_Rwanda_Data_Pes.csv') # select ne...
[ "rapidfuzz.string_metric.normalized_levenshtein", "pandas.read_csv", "numpy.where", "math.log2", "numpy.maximum" ]
[((209, 256), 'pandas.read_csv', 'pd.read_csv', (['"""Data/Mock_Rwanda_Data_Census.csv"""'], {}), "('Data/Mock_Rwanda_Data_Census.csv')\n", (220, 256), True, 'import pandas as pd\n'), ((263, 307), 'pandas.read_csv', 'pd.read_csv', (['"""Data/Mock_Rwanda_Data_Pes.csv"""'], {}), "('Data/Mock_Rwanda_Data_Pes.csv')\n", (27...
# coding=utf-8 # date: 2019/1/1, 19:38 # name: smz import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from sklearn.utils import shuffle from LinearModel.modules.model3 import ModelThreeClasses from LinearModel.configuration.options import opts from LinearModel.scripts.gen_data import generate_d...
[ "LinearModel.modules.model3.ModelThreeClasses", "numpy.eye", "sklearn.utils.shuffle", "tensorflow.Session", "numpy.argmax", "tensorflow.global_variables_initializer", "matplotlib.pyplot.figure", "LinearModel.scripts.gen_data.generate_data", "numpy.random.seed", "numpy.load", "numpy.random.randn"...
[((352, 370), 'numpy.random.seed', 'np.random.seed', (['(10)'], {}), '(10)\n', (366, 370), True, 'import numpy as np\n'), ((444, 471), 'numpy.random.randn', 'np.random.randn', (['fields_num'], {}), '(fields_num)\n', (459, 471), True, 'import numpy as np\n'), ((482, 500), 'numpy.eye', 'np.eye', (['fields_num'], {}), '(f...
import argparse import os import sys import numpy as np from scipy import misc import cv2 import torch import torch.nn as nn from torch.autograd import Variable from torchvision.models import vgg16, vgg19 from torchvision.utils import save_image from lib.gradients import GradCam, GuidedBackpropGrad from lib.image_uti...
[ "os.path.exists", "numpy.multiply", "lib.gradients.GradCam", "argparse.ArgumentParser", "torchvision.models.vgg19", "lib.gradients.GuidedBackpropGrad", "os.makedirs", "lib.image_utils.preprocess_image", "os.path.join", "numpy.zeros", "torch.cuda.is_available", "cv2.resize", "cv2.imread", "...
[((455, 480), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (478, 480), False, 'import argparse\n'), ((1634, 1666), 'lib.image_utils.preprocess_image', 'preprocess_image', (['img', 'args.cuda'], {}), '(img, args.cuda)\n', (1650, 1666), False, 'from lib.image_utils import preprocess_image, save...
# Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause import sys import os import unittest import numpy as np import matplotlib.pyplot as plt import torch import torch.nn.functional as F from lava.lib.dl.slayer.neuron import alif verbose = True if (('-v' in sys.argv) or ('--verbose' in sys....
[ "lava.lib.dl.slayer.neuron.alif.Neuron", "torch.nn.functional.mse_loss", "matplotlib.pyplot.show", "numpy.random.random", "matplotlib.pyplot.legend", "matplotlib.pyplot.xlabel", "torch.floor", "os.environ.get", "numpy.random.randint", "torch.cuda.is_available", "matplotlib.pyplot.figure", "num...
[((346, 369), 'numpy.random.randint', 'np.random.randint', (['(1000)'], {}), '(1000)\n', (363, 369), True, 'import numpy as np\n'), ((383, 403), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (397, 403), True, 'import numpy as np\n'), ((442, 467), 'torch.cuda.is_available', 'torch.cuda.is_available'...
import numpy as np EXPERIMENT_NAME = 'EXP_12' CORPUS_PATH = '/home/dddhiraj/Documents/stuff/data/wiki_en.txt' TRAINING_WINDOW = 5 CONTEXT_DIMENSION = 64 LEANING_RATE = 1 DROPOUT = 0.05 CONTEXT_DECAY = 1 - TRAINING_WINDOW ** -0.5 CONTRASTIVE_WEIGHT = 1#0.1 NEGATIVE_SAMPLE_SIZE ...
[ "pymongo.MongoClient", "numpy.sqrt", "redis.Redis" ]
[((367, 391), 'numpy.sqrt', 'np.sqrt', (['TRAINING_WINDOW'], {}), '(TRAINING_WINDOW)\n', (374, 391), True, 'import numpy as np\n'), ((496, 544), 'pymongo.MongoClient', 'pymongo.MongoClient', (['"""mongodb://localhost:27017"""'], {}), "('mongodb://localhost:27017')\n", (515, 544), False, 'import pymongo\n'), ((721, 738)...
import argparse, pdb import gym import numpy as np import os import pickle import random import torch import scipy.misc from gym.envs.registration import register parser = argparse.ArgumentParser() parser.add_argument('-display', type=int, default=0) parser.add_argument('-seed', type=int, default=1) parser.add_argumen...
[ "torch.manual_seed", "argparse.ArgumentParser", "random.seed", "gym.envs.registration.register", "numpy.random.seed", "os.system", "gym.make" ]
[((173, 198), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (196, 198), False, 'import argparse, pdb\n'), ((1027, 1048), 'random.seed', 'random.seed', (['opt.seed'], {}), '(opt.seed)\n', (1038, 1048), False, 'import random\n'), ((1049, 1073), 'numpy.random.seed', 'np.random.seed', (['opt.seed'...
import matplotlib.pylab as plt import numpy as np import random from scipy.ndimage import gaussian_filter mu =9 N = 50 k = 10 eta =10 sigma = 2 p0 = 0.5 inverse_random = False L = range(N*N) Q = np.zeros((N*mu,N*mu)) for o in range(mu*mu): print(o) F = 1000*k a = np.ones((N,N)) for k_ in range(1000): ...
[ "matplotlib.pylab.axis", "matplotlib.pylab.subplots", "numpy.ones", "numpy.where", "numpy.random.random", "numpy.zeros", "matplotlib.pylab.imshow", "numpy.random.randint", "numpy.unravel_index", "scipy.ndimage.gaussian_filter" ]
[((197, 223), 'numpy.zeros', 'np.zeros', (['(N * mu, N * mu)'], {}), '((N * mu, N * mu))\n', (205, 223), True, 'import numpy as np\n'), ((908, 944), 'matplotlib.pylab.subplots', 'plt.subplots', (['(1)', '(1)'], {'figsize': '(20, 20)'}), '(1, 1, figsize=(20, 20))\n', (920, 944), True, 'import matplotlib.pylab as plt\n')...
import random import gym import numpy as np from collections import deque from keras.models import Sequential from keras.layers import Dense, Dropout from keras.optimizers import Adam import tensorflow as tf import os import logging os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' logging.getLogger('tensorflow').disabled = Tr...
[ "logging.getLogger", "tensorflow.device", "random.sample", "keras.optimizers.Adam", "collections.deque", "numpy.random.rand", "numpy.reshape", "random.randrange", "numpy.amax", "numpy.argmax", "keras.models.Sequential", "keras.layers.Dense", "keras.layers.Dropout", "gym.make" ]
[((275, 306), 'logging.getLogger', 'logging.getLogger', (['"""tensorflow"""'], {}), "('tensorflow')\n", (292, 306), False, 'import logging\n'), ((903, 921), 'collections.deque', 'deque', ([], {'maxlen': '(4096)'}), '(maxlen=4096)\n', (908, 921), False, 'from collections import deque\n'), ((1141, 1153), 'keras.models.Se...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import _thread import sys import time from math import exp from random import random from typing import List, Tuple, Set from scipy import spatial import numpy as np import torch from torch import nn from torc...
[ "logging.getLogger", "numpy.log10", "torch.LongTensor", "torch.optim.optimizer.step", "torch.sin", "numpy.array", "torch.cos", "math.exp", "dataloader.TrainDataset", "torch.random.manual_seed", "torch.utils.tensorboard.SummaryWriter", "numpy.where", "torch.optim.optimizer.zero_grad", "logg...
[((691, 723), 'torch.random.manual_seed', 'torch.random.manual_seed', (['(123456)'], {}), '(123456)\n', (715, 723), False, 'import torch\n'), ((7415, 7442), 'logging.getLogger', 'logging.getLogger', (['"""logger"""'], {}), "('logger')\n", (7432, 7442), False, 'import logging\n'), ((7481, 7542), 'logging.basicConfig', '...
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "argparse.ArgumentParser", "mindspore.context.set_context", "mindspore.Tensor", "numpy.random.uniform", "src.models.ADNet.adnet" ]
[((832, 881), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""ADNet test"""'}), "(description='ADNet test')\n", (855, 881), False, 'import argparse\n'), ((1169, 1285), 'mindspore.context.set_context', 'context.set_context', ([], {'device_target': 'args.device_target', 'mode': 'context.PYN...
from .pressureprofile import PressureProfile import numpy as np class ArrayPressureProfile(PressureProfile): def __init__(self, array, reverse=False): super().__init__(self.__class__.__name__, array.shape[-1]) if reverse: self.pressure_profile = array[::-1] else: ...
[ "numpy.append", "numpy.log10", "numpy.gradient" ]
[((503, 534), 'numpy.log10', 'np.log10', (['self.pressure_profile'], {}), '(self.pressure_profile)\n', (511, 534), True, 'import numpy as np\n'), ((551, 568), 'numpy.gradient', 'np.gradient', (['logp'], {}), '(logp)\n', (562, 568), True, 'import numpy as np\n'), ((627, 680), 'numpy.append', 'np.append', (['(logp - grad...
"""EESG.py Created by <NAME>, <NAME>. Copyright (c) NREL. All rights reserved. Electromagnetic design based on conventional magnetic circuit laws Structural design based on McDonald's thesis """ from openmdao.api import Group, Problem, Component,ExecComp,IndepVarComp,ScipyOptimizer,pyOptSparseDriver from openmd...
[ "openmdao.api.ExecComp", "math.tan", "openmdao.api.IndepVarComp", "math.sqrt", "math.cos", "numpy.array", "openmdao.drivers.pyoptsparse_driver.pyOptSparseDriver", "math.sin", "math.atan" ]
[((30236, 30255), 'openmdao.drivers.pyoptsparse_driver.pyOptSparseDriver', 'pyOptSparseDriver', ([], {}), '()\n', (30253, 30255), False, 'from openmdao.drivers.pyoptsparse_driver import pyOptSparseDriver\n'), ((35050, 35075), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (35058, 35075), T...
import copy import logging import os from typing import Dict, List, Tuple import checksumdir import imageio import numpy as np import torch from torch.utils.data import DataLoader, Dataset from tqdm import tqdm from ..adapter import download_object logger = logging.getLogger("fastface.dataset") class _IdentitiyTra...
[ "logging.getLogger", "numpy.mean", "os.path.exists", "copy.deepcopy", "numpy.sqrt", "os.path.join", "torch.from_numpy", "numpy.ascontiguousarray", "numpy.array", "numpy.stack", "numpy.zeros", "numpy.concatenate", "torch.utils.data.DataLoader", "imageio.imread", "checksumdir.dirhash" ]
[((261, 298), 'logging.getLogger', 'logging.getLogger', (['"""fastface.dataset"""'], {}), "('fastface.dataset')\n", (278, 298), False, 'import logging\n'), ((1663, 1695), 'copy.deepcopy', 'copy.deepcopy', (['self.targets[idx]'], {}), '(self.targets[idx])\n', (1676, 1695), False, 'import copy\n'), ((2914, 2943), 'imagei...
import torch.utils.data as data import os import os.path import numpy as np from numpy.random import randint import torch from colorama import init from colorama import Fore, Back, Style import random from os import listdir from os.path import join, splitext import numpy as np import torch import torch.nn.functiona...
[ "torchvision.transforms.CenterCrop", "torch.utils.data.append", "os.listdir", "PIL.Image.open", "numpy.ones", "torch.load", "torch.stack", "os.path.join", "numpy.append", "numpy.zeros", "numpy.random.randint", "torchvision.transforms.Normalize", "torchvision.transforms.Resize", "torchvisio...
[((505, 525), 'colorama.init', 'init', ([], {'autoreset': '(True)'}), '(autoreset=True)\n', (509, 525), False, 'from colorama import init\n'), ((5481, 5500), 'torch.stack', 'torch.stack', (['frames'], {}), '(frames)\n', (5492, 5500), False, 'import torch\n'), ((8333, 8350), 'torch.stack', 'torch.stack', (['data'], {}),...
""" author: @nimrobotics description: calculates the effective connectivity between regions and plots them """ import numpy as np import scipy.io import glob import sys sys.path.append('../utils') from plots import plotData dir = "./process3/" #directory of the data outdir = 'process3/' #directory to save the plots r...
[ "numpy.multiply", "plots.plotData", "sys.path.append", "glob.glob" ]
[((170, 197), 'sys.path.append', 'sys.path.append', (['"""../utils"""'], {}), "('../utils')\n", (185, 197), False, 'import sys\n'), ((358, 384), 'glob.glob', 'glob.glob', (["(dir + '/*_.mat')"], {}), "(dir + '/*_.mat')\n", (367, 384), False, 'import glob\n'), ((909, 931), 'numpy.multiply', 'np.multiply', (['fval', 'sig...
from __future__ import with_statement from nose.tools import assert_true from os.path import exists import numpy as np from nibabel import Nifti1Image from numpy.testing import assert_equal from ...utils.simul_multisubject_fmri_dataset import surrogate_3d_dataset from ..bsa_io import make_bsa_image from nibabel.tmpdirs...
[ "os.path.exists", "numpy.eye", "numpy.ones", "numpy.testing.assert_equal", "nibabel.tmpdirs.InTemporaryDirectory", "nose.run" ]
[((1505, 1534), 'nose.run', 'nose.run', ([], {'argv': "['', __file__]"}), "(argv=['', __file__])\n", (1513, 1534), False, 'import nose\n'), ((584, 598), 'numpy.ones', 'np.ones', (['shape'], {}), '(shape)\n', (591, 598), True, 'import numpy as np\n'), ((600, 609), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)\n', (606, 609...
import torch from torch import nn from transformers import BertTokenizer, VisualBertModel, VisualBertConfig import numpy as np class VisualBertClassifier(nn.Module): def __init__(self, visual_bert_model, num_classes: int = 8, initial_visual_embedding_dim: int = 9...
[ "torch.nn.Dropout", "torch.unsqueeze", "transformers.BertTokenizer.from_pretrained", "torch.from_numpy", "torch.nn.Linear", "numpy.load", "torch.ones" ]
[((2161, 2211), 'transformers.BertTokenizer.from_pretrained', 'BertTokenizer.from_pretrained', (['"""bert-base-uncased"""'], {}), "('bert-base-uncased')\n", (2190, 2211), False, 'from transformers import BertTokenizer, VisualBertModel, VisualBertConfig\n'), ((2689, 2729), 'numpy.load', 'np.load', (['sample_face_body_em...
# -*- coding: utf-8 -*- """ (SHORT NAME EXPLANATION) >>>DOCTEST COMMANDS (THE TEST ANSWER) @author: <NAME>. Created on Mon Jul 10 20:12:27 2017 Department of Aerodynamics Faculty of Aerospace Engineering TU Delft #SUMMARY---------------- #INPUTS----------------- #ESSENTI...
[ "inner_product.inner", "forms.Form", "function_space.FunctionSpace", "numpy.cos", "numpy.sin", "mesh.CrazyMesh" ]
[((1661, 1707), 'mesh.CrazyMesh', 'CrazyMesh', (['(2)', '(2, 2)', '((-1, 1), (-1, 1))', '(0.05)'], {}), '(2, (2, 2), ((-1, 1), (-1, 1)), 0.05)\n', (1670, 1707), False, 'from mesh import CrazyMesh\n'), ((1732, 1786), 'function_space.FunctionSpace', 'FunctionSpace', (['mesh', '"""1-gauss"""', '(5, 5)'], {'is_inner': '(Fa...
import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Slider from kalman_filter import KalmanFilter raw_data = np.loadtxt("barometer_data.txt") # Truncate raw data (it's super long) raw_data = raw_data[:raw_data.size//4] raw_data_step = np.loadtxt("barometer_data_step.txt") t1 = np.arange(0...
[ "kalman_filter.KalmanFilter", "matplotlib.pyplot.figure", "numpy.zeros", "matplotlib.widgets.Slider", "numpy.loadtxt", "numpy.arange", "matplotlib.pyplot.show" ]
[((140, 172), 'numpy.loadtxt', 'np.loadtxt', (['"""barometer_data.txt"""'], {}), "('barometer_data.txt')\n", (150, 172), True, 'import numpy as np\n'), ((266, 303), 'numpy.loadtxt', 'np.loadtxt', (['"""barometer_data_step.txt"""'], {}), "('barometer_data_step.txt')\n", (276, 303), True, 'import numpy as np\n'), ((309, ...
# Copyright 2019-2020 QuantumBlack Visual Analytics Limited # # 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 # # THE SOFTWARE IS PROVIDED "AS IS"...
[ "itertools.permutations", "copy.deepcopy", "numpy.hstack" ]
[((7215, 7242), 'numpy.hstack', 'np.hstack', (['[X, new_columns]'], {}), '([X, new_columns])\n', (7224, 7242), True, 'import numpy as np\n'), ((8158, 8178), 'copy.deepcopy', 'deepcopy', (['tabu_edges'], {}), '(tabu_edges)\n', (8166, 8178), False, 'from copy import deepcopy\n'), ((9531, 9551), 'copy.deepcopy', 'deepcopy...
from adam_visual_perception import LandmarkDetector from adam_visual_perception.utility import * import numpy as np import math import cv2 import os import sys class HeadGazeEstimator: """ A class for estimating gaze ray from facial landmarks """ def __init__(self, write_video=False): # 3D model poin...
[ "os.makedirs", "cv2.line", "math.sqrt", "os.path.join", "cv2.imshow", "cv2.VideoWriter", "numpy.array", "numpy.zeros", "cv2.solvePnP", "cv2.destroyAllWindows", "adam_visual_perception.LandmarkDetector", "cv2.VideoCapture", "sys.exit", "cv2.VideoWriter_fourcc", "os.path.isdir", "os.path...
[((352, 506), 'numpy.array', 'np.array', (['[(0.0, 0.0, 0.0), (0.0, -330.0, -65.0), (-225.0, 170.0, -135.0), (225.0, \n 170.0, -135.0), (-150.0, -150.0, -125.0), (150.0, -150.0, -125.0)]'], {}), '([(0.0, 0.0, 0.0), (0.0, -330.0, -65.0), (-225.0, 170.0, -135.0), (\n 225.0, 170.0, -135.0), (-150.0, -150.0, -125.0),...
import time from collections import deque import gym import numpy as np from stable_baselines import logger, PPO2 from stable_baselines.a2c.utils import total_episode_reward_logger from stable_baselines.common import explained_variance, TensorboardWriter from stable_baselines.common.runners import AbstractEnvRunner fr...
[ "numpy.clip", "numpy.copy", "numpy.mean", "stable_baselines.logger.logkv", "collections.deque", "stable_baselines.common.explained_variance", "time.time", "numpy.asarray", "numpy.sum", "numpy.zeros", "stable_baselines.common.TensorboardWriter", "stable_baselines.ppo2.ppo2.safe_mean", "stable...
[((724, 759), 'stable_baselines.ppo2.ppo2.get_schedule_fn', 'get_schedule_fn', (['self.learning_rate'], {}), '(self.learning_rate)\n', (739, 759), False, 'from stable_baselines.ppo2.ppo2 import get_schedule_fn, safe_mean, swap_and_flatten\n'), ((785, 816), 'stable_baselines.ppo2.ppo2.get_schedule_fn', 'get_schedule_fn'...
#!/usr/bin/env python # coding: utf-8 """ Multi-Sensor Moving Platform Simulation Example =============================================== This example looks at how multiple sensors can be mounted on a single moving platform and exploiting a defined moving platform as a sensor target. """ # %% # Building a Simulated M...
[ "stonesoup.updater.particle.ParticleUpdater", "stonesoup.platform.base.MovingPlatform", "stonesoup.simulator.simple.DummyGroundTruthSimulator", "stonesoup.measures.Mahalanobis", "stonesoup.functions.sphere2cart", "numpy.array", "datetime.timedelta", "stonesoup.simulator.platform.PlatformDetectionSimul...
[((2101, 2115), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (2113, 2115), False, 'from datetime import datetime\n'), ((3612, 3659), 'stonesoup.types.array.StateVector', 'StateVector', (['[[0], [0], [0], [50], [8000], [0]]'], {}), '([[0], [0], [0], [50], [8000], [0]])\n', (3623, 3659), False, 'from stones...
""" render_fmo.py renders obj file to rgb image with fmo model Aviable function: - clear_mash: delete all the mesh in the secene - scene_setting_init: set scene configurations - node_setting_init: set node configurations - render: render rgb image for one obj file and one viewpoint - render_obj: wrapper function for r...
[ "os.open", "numpy.array", "bpy.data.images.load", "bpy.data.images.remove", "os.remove", "bpy.ops.object.delete", "os.path.exists", "numpy.mean", "os.listdir", "scipy.signal.fftconvolve", "bpy.data.textures.remove", "numpy.max", "os.dup", "numpy.linspace", "bpy.ops.object.lamp_add", "o...
[((869, 894), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (884, 894), False, 'import os\n'), ((911, 936), 'os.path.dirname', 'os.path.dirname', (['abs_path'], {}), '(abs_path)\n', (926, 936), False, 'import os\n'), ((1235, 1250), 'numpy.max', 'np.max', (['[2, ns]'], {}), '([2, ns])\n', (12...
#!/usr/bin/env python3 # Copyright 2019-2022 <NAME>, <NAME>, <NAME> # # This file is part of WarpX. # # License: BSD-3-Clause-LBNL # This script tests the reduced particle diagnostics. # The setup is a uniform plasma with electrons, protons and photons. # Various particle and field quantities are written to file usin...
[ "sys.path.insert", "numpy.where", "openpmd_api.Series", "os.getcwd", "checksumAPI.evaluate_checksum", "numpy.zeros", "yt.load", "numpy.all" ]
[((667, 727), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../../../warpx/Regression/Checksum/"""'], {}), "(1, '../../../../warpx/Regression/Checksum/')\n", (682, 727), False, 'import sys\n'), ((823, 834), 'yt.load', 'yt.load', (['fn'], {}), '(fn)\n', (830, 834), False, 'import yt\n'), ((964, 1025), 'openpmd_a...
import warnings warnings.simplefilter("ignore", category=FutureWarning) from pmaf.biome.essentials._metakit import EssentialFeatureMetabase from pmaf.biome.essentials._base import EssentialBackboneBase from pmaf.internal._constants import ( AVAIL_TAXONOMY_NOTATIONS, jRegexGG, jRegexQIIME, BIOM_TAXONOMY...
[ "pmaf.internal._shared.generate_lineages_from_taxa", "pandas.read_csv", "pmaf.internal._shared.indentify_taxon_notation", "pmaf.internal._shared.extract_valid_ranks", "pmaf.internal._shared.get_rank_upto", "biom.load_table", "numpy.asarray", "pandas.DataFrame", "warnings.simplefilter", "pandas.not...
[((17, 72), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {'category': 'FutureWarning'}), "('ignore', category=FutureWarning)\n", (38, 72), False, 'import warnings\n'), ((6508, 6533), 'biom.load_table', 'biom.load_table', (['filepath'], {}), '(filepath)\n', (6523, 6533), False, 'import biom\n'), ...
from typing import List import numpy as np def mask_nan(arrays: List[np.ndarray]) -> List[np.ndarray]: """ Drop indices from equal-sized arrays if the element at that index is NaN in any of the input arrays. Parameters ---------- arrays : List[np.ndarray] list of ndarrays containing ...
[ "numpy.where", "numpy.array", "numpy.isnan" ]
[((908, 929), 'numpy.array', 'np.array', (['([False] * n)'], {}), '([False] * n)\n', (916, 929), True, 'import numpy as np\n'), ((988, 1001), 'numpy.isnan', 'np.isnan', (['arr'], {}), '(arr)\n', (996, 1001), True, 'import numpy as np\n'), ((1019, 1034), 'numpy.where', 'np.where', (['(~mask)'], {}), '(~mask)\n', (1027, ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import numpy as np # continuously differentiable fn_dict_cdiff = {'2dpoly': 1, 'sigmoid': 2, 'sin': 3, 'frequent_sin': 4, '3dpoly': 7, 'linear': 8} # continuous but not differentiable fn_dict_cont = {'abs': 0, '...
[ "numpy.random.normal", "numpy.sqrt", "numpy.amin", "numpy.hstack", "numpy.searchsorted", "numpy.power", "numpy.random.randint", "numpy.random.uniform", "numpy.arange" ]
[((1272, 1311), 'numpy.random.uniform', 'np.random.uniform', (['(-4)', '(4)'], {'size': 'n_pieces'}), '(-4, 4, size=n_pieces)\n', (1289, 1311), True, 'import numpy as np\n'), ((4108, 4151), 'numpy.random.normal', 'np.random.normal', (['(0)', '(1)'], {'size': '(n_samples, 1)'}), '(0, 1, size=(n_samples, 1))\n', (4124, 4...
import argparse import os import pathlib import cv2 import pickle import numpy as np from matplotlib import pyplot as plt from PIL import Image from numpy import genfromtxt def parse_command_line_options(print_options=False): parser = argparse.ArgumentParser() parser.add_argument("-n", type=int, default=-1)...
[ "matplotlib.pyplot.fill_between", "numpy.array", "cv2.destroyAllWindows", "matplotlib.pyplot.errorbar", "numpy.mean", "os.path.exists", "os.listdir", "argparse.ArgumentParser", "matplotlib.pyplot.plot", "os.mkdir", "cv2.VideoWriter_fourcc", "matplotlib.pyplot.gca", "pickle.load", "numpy.st...
[((243, 268), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (266, 268), False, 'import argparse\n'), ((1698, 1723), 'pickle.dump', 'pickle.dump', (['object', 'file'], {}), '(object, file)\n', (1709, 1723), False, 'import pickle\n'), ((1986, 2003), 'pickle.load', 'pickle.load', (['file'], {}), ...
import numpy as np def histogram_r(r_array,height, width): length = height * width R_rray = [] for i in range(height): for j in range(width): R_rray.append(r_array[i][j]) R_rray.sort() I_min = int(R_rray[int(length / 500)]) I_max = int(R_rray[-int(length / 500)]) array_G...
[ "numpy.zeros" ]
[((349, 374), 'numpy.zeros', 'np.zeros', (['(height, width)'], {}), '((height, width))\n', (357, 374), True, 'import numpy as np\n'), ((1279, 1304), 'numpy.zeros', 'np.zeros', (['(height, width)'], {}), '((height, width))\n', (1287, 1304), True, 'import numpy as np\n'), ((2189, 2214), 'numpy.zeros', 'np.zeros', (['(hei...
# Copyright 2021 Sony 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...
[ "nnabla.parametric_functions.affine", "nnabla.parametric_functions.convolution", "nnabla.clear_parameters", "nnabla.parametric_functions.batch_normalization", "nnabla.parameter_scope", "numpy.array", "nnabla.Variable", "numpy.sin", "pytest.skip", "nnabla.experimental.tb_graph_writer.TBGraphWriter"...
[((922, 943), 'nnabla.clear_parameters', 'nn.clear_parameters', ([], {}), '()\n', (941, 943), True, 'import nnabla as nn\n'), ((952, 977), 'nnabla.Variable', 'nn.Variable', (['(2, 3, 4, 4)'], {}), '((2, 3, 4, 4))\n', (963, 977), True, 'import nnabla as nn\n'), ((987, 1011), 'nnabla.parameter_scope', 'nn.parameter_scope...
import numpy as np import tensorflow as tf from time import perf_counter as timer def main(): x = np.load('data/cifar_test_x.npy') y = np.load('data/cifar_test_y.npy').flatten() interpreter = tf.lite.Interpreter(model_path='data/fbnet.tflite') interpreter.allocate_tensors() input_details = inter...
[ "tensorflow.lite.Interpreter", "numpy.load", "time.perf_counter" ]
[((104, 136), 'numpy.load', 'np.load', (['"""data/cifar_test_x.npy"""'], {}), "('data/cifar_test_x.npy')\n", (111, 136), True, 'import numpy as np\n'), ((207, 258), 'tensorflow.lite.Interpreter', 'tf.lite.Interpreter', ([], {'model_path': '"""data/fbnet.tflite"""'}), "(model_path='data/fbnet.tflite')\n", (226, 258), Tr...
################################################################################ # Module: schedule.py # Description: Functions for handling conversion of EnergyPlus schedule objects # License: MIT, see full license in LICENSE.txt # Web: https://github.com/samuelduchesne/archetypal #####################################...
[ "archetypal.check_unique_name", "pandas.read_csv", "pandas.Grouper", "archetypal.settings.unique_schedules.append", "numpy.array", "datetime.timedelta", "archetypal.log", "pandas.date_range", "numpy.arange", "datetime.datetime", "numpy.mean", "io.StringIO", "functools.reduce", "os.path.dir...
[((44582, 44619), 'functools.reduce', 'functools.reduce', (['logical', 'conditions'], {}), '(logical, conditions)\n', (44598, 44619), False, 'import functools\n'), ((2337, 2356), 'io.StringIO', 'io.StringIO', (['idftxt'], {}), '(idftxt)\n', (2348, 2356), False, 'import io\n'), ((2436, 2459), 'archetypal.IDF', 'archetyp...
import higher from leap import Leap import numpy as np import os import torch import torch.nn as nn import gc def train(model, source_corpus, char2idx, args, device): model = model.to(device) optimizer = torch.optim.Adam(model.parameters(), lr=args.lr_init) lr_scheduler = torch.optim.lr_scheduler.ReduceLR...
[ "higher.innerloop_ctx", "torch.optim.lr_scheduler.ReduceLROnPlateau", "numpy.average", "torch.backends.cudnn.flags", "torch.nn.functional.cosine_similarity", "os.path.join", "gc.collect", "torch.nn.functional.cross_entropy", "torch.no_grad", "leap.Leap", "numpy.arange" ]
[((287, 416), 'torch.optim.lr_scheduler.ReduceLROnPlateau', 'torch.optim.lr_scheduler.ReduceLROnPlateau', (['optimizer'], {'factor': 'args.lr_decay', 'patience': 'args.patience', 'threshold': 'args.threshold'}), '(optimizer, factor=args.lr_decay,\n patience=args.patience, threshold=args.threshold)\n', (329, 416), Fa...
#!/usr/bin/env python # encoding=utf-8 from inspect import getblock import json import os from os import read from numpy.core.fromnumeric import mean import numpy as np import paddlehub as hub import six import math import random import sys from util import read_file from config import Config # 配置文件 conf = Config() c...
[ "numpy.mean", "json.loads", "random.shuffle", "util.read_file", "config.Config", "numpy.zeros", "numpy.core.fromnumeric.mean", "paddlehub.dataset.LCQMC" ]
[((308, 316), 'config.Config', 'Config', ([], {}), '()\n', (314, 316), False, 'from config import Config\n'), ((6858, 6879), 'numpy.zeros', 'np.zeros', (['conf.nwords'], {}), '(conf.nwords)\n', (6866, 6879), True, 'import numpy as np\n'), ((10812, 10831), 'paddlehub.dataset.LCQMC', 'hub.dataset.LCQMC', ([], {}), '()\n'...
import numpy as np import numpy.linalg as la from MdlUtilities import Field, FieldList import MdlUtilities as mdl def get_osaCasing_fields(): OD = Field(2030) ID = Field(2031) Weight = Field(2032) Density = Field(2039) E = Field(2040) osaCasing_fields = FieldList() osaCasing_...
[ "MdlUtilities.physicalValue", "numpy.mean", "numpy.sqrt", "MdlUtilities.Field", "MdlUtilities.LogicalError", "numpy.tanh", "numpy.sinh", "numpy.array", "numpy.linspace", "numpy.dot", "MdlUtilities.calculate_buoyancyFactor", "numpy.cos", "numpy.cosh", "numpy.sin", "MdlUtilities.FieldList"...
[((167, 178), 'MdlUtilities.Field', 'Field', (['(2030)'], {}), '(2030)\n', (172, 178), False, 'from MdlUtilities import Field, FieldList\n'), ((191, 202), 'MdlUtilities.Field', 'Field', (['(2031)'], {}), '(2031)\n', (196, 202), False, 'from MdlUtilities import Field, FieldList\n'), ((215, 226), 'MdlUtilities.Field', 'F...
"""Test converting an image to a pyramid. """ import numpy as np import napari points = np.random.randint(100, size=(50_000, 2)) with napari.gui_qt(): viewer = napari.view_points(points, face_color='red')
[ "napari.gui_qt", "numpy.random.randint", "napari.view_points" ]
[((90, 129), 'numpy.random.randint', 'np.random.randint', (['(100)'], {'size': '(50000, 2)'}), '(100, size=(50000, 2))\n', (107, 129), True, 'import numpy as np\n'), ((137, 152), 'napari.gui_qt', 'napari.gui_qt', ([], {}), '()\n', (150, 152), False, 'import napari\n'), ((167, 211), 'napari.view_points', 'napari.view_po...
from __future__ import print_function, absolute_import import unittest, math import pandas as pd import numpy as np from . import * class T(base_pandas_extensions_tester.BasePandasExtensionsTester): def test_concat(self): df = pd.DataFrame({'c_1':['a', 'b', 'c'], 'c_2': ['d', 'e', 'f']}) df.en...
[ "numpy.testing.assert_allclose", "math.sqrt", "math.log", "numpy.array", "pandas.DataFrame", "numpy.testing.assert_array_equal" ]
[((244, 306), 'pandas.DataFrame', 'pd.DataFrame', (["{'c_1': ['a', 'b', 'c'], 'c_2': ['d', 'e', 'f']}"], {}), "({'c_1': ['a', 'b', 'c'], 'c_2': ['d', 'e', 'f']})\n", (256, 306), True, 'import pandas as pd\n'), ((509, 599), 'pandas.DataFrame', 'pd.DataFrame', (["{'c_1': ['a', 'b', 'c'], 'c_2': ['d', 'e', 'f'], 'c_3': ['...
import numpy as np import math import pyrobot.utils.util as prutil import rospy import habitat_sim.agent as habAgent import habitat_sim.utils as habUtils from habitat_sim.agent.controls import ActuationSpec import habitat_sim.errors import quaternion from tf.transformations import euler_from_quaternion, euler_from_mat...
[ "numpy.arccos", "tf.transformations.euler_from_matrix", "math.sqrt", "numpy.asarray", "habitat_sim.agent.controls.ActuationSpec", "math.degrees", "numpy.array", "numpy.dot", "numpy.cos", "numpy.linalg.norm", "numpy.sin", "pyrobot.utils.util.quat_to_rot_mat" ]
[((1145, 1178), 'pyrobot.utils.util.quat_to_rot_mat', 'prutil.quat_to_rot_mat', (['quat_list'], {}), '(quat_list)\n', (1167, 1178), True, 'import pyrobot.utils.util as prutil\n'), ((1905, 1949), 'tf.transformations.euler_from_matrix', 'euler_from_matrix', (['cur_rotation'], {'axes': '"""sxzy"""'}), "(cur_rotation, axes...
from enum import Enum from typing import Generator, Tuple, Iterable, Dict, List import cv2 import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy.ndimage import label, generate_binary_structure from scipy.ndimage.morphology import distance_transform_edt as dist_trans import trainer.lib as...
[ "numpy.copy", "numpy.ones_like", "numpy.unique", "numpy.ones", "numpy.where", "scipy.ndimage.generate_binary_structure", "scipy.ndimage.label", "numpy.any", "numpy.max", "numpy.invert", "numpy.lexsort", "numpy.split", "numpy.zeros", "numpy.argwhere", "imgaug.augmenters.Sequential", "nu...
[((431, 447), 'numpy.lexsort', 'np.lexsort', (['data'], {}), '(data)\n', (441, 447), True, 'import numpy as np\n'), ((459, 510), 'numpy.any', 'np.any', (['(data.T[ind[1:]] != data.T[ind[:-1]])'], {'axis': '(1)'}), '(data.T[ind[1:]] != data.T[ind[:-1]], axis=1)\n', (465, 510), True, 'import numpy as np\n'), ((558, 578),...
#!/usr/bin/env python ''' Advent of Code 2021 - Day 9: Smoke Basin (Part 1) https://adventofcode.com/2021/day/9 ''' import numpy as np class HeightMap(): def __init__(self) -> None: self._grid = np.array([]) def add_row(self, row): np_row = np.array(row) if self._grid.size != 0: ...
[ "numpy.array", "numpy.vstack", "numpy.ndenumerate" ]
[((211, 223), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (219, 223), True, 'import numpy as np\n'), ((270, 283), 'numpy.array', 'np.array', (['row'], {}), '(row)\n', (278, 283), True, 'import numpy as np\n'), ((514, 540), 'numpy.ndenumerate', 'np.ndenumerate', (['self._grid'], {}), '(self._grid)\n', (528, 540),...
import sklearn.mixture import matplotlib.pyplot as plt import numpy as np from matplotlib import ticker import matplotlib.patheffects as mpatheffects def get_gmm_and_pos_label( array, n_components=2, n_steps=5000 ): gmm = sklearn.mixture.GaussianMixture( n_components=n_components, covarianc...
[ "numpy.ptp", "numpy.sqrt", "matplotlib.patheffects.Normal", "numpy.array", "matplotlib.ticker.ScalarFormatter", "numpy.arange", "numpy.mean", "numpy.exp", "numpy.linspace", "numpy.min", "numpy.argmin", "numpy.round", "numpy.ediff1d", "numpy.argmax", "matplotlib.pyplot.get_cmap", "numpy...
[((410, 431), 'numpy.argmax', 'np.argmax', (['gmm.means_'], {}), '(gmm.means_)\n', (419, 431), True, 'import numpy as np\n'), ((669, 700), 'numpy.linspace', 'np.linspace', (['low', 'high', 'n_steps'], {}), '(low, high, n_steps)\n', (680, 700), True, 'import numpy as np\n'), ((1099, 1120), 'numpy.argmax', 'np.argmax', (...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time: 2020/5/14 20:41 # @Author: Mecthew import time import numpy as np import pandas as pd import scipy from sklearn.svm import LinearSVC from sklearn.linear_model import logistic from sklearn.calibration import CalibratedClassifierCV from sklearn.metrics import ac...
[ "sklearn.metrics.accuracy_score", "numpy.abs", "numpy.eye", "scipy.sparse.diags", "numpy.power", "sklearn.preprocessing.OneHotEncoder", "sklearn.svm.LinearSVC", "numpy.argmax", "numpy.array", "numpy.concatenate", "scipy.sparse.coo_matrix", "pandas.DataFrame", "sklearn.linear_model.logistic.L...
[((452, 470), 'utils.logger.get_logger', 'get_logger', (['"""INFO"""'], {}), "('INFO')\n", (462, 470), False, 'from utils.logger import get_logger\n'), ((1327, 1338), 'time.time', 'time.time', ([], {}), '()\n', (1336, 1338), False, 'import time\n'), ((2410, 2461), 'numpy.concatenate', 'np.concatenate', (['[x_train_feat...
import numpy as np import unittest from chainer.dataset import DatasetMixin from chainer import testing from chainercv.utils import assert_is_bbox_dataset from chainercv.utils import generate_random_bbox class BboxDataset(DatasetMixin): def __init__(self, options=(), empty_bbox=False): self.options = o...
[ "chainercv.utils.generate_random_bbox", "numpy.random.randint", "chainer.testing.run_module", "chainercv.utils.assert_is_bbox_dataset" ]
[((2565, 2603), 'chainer.testing.run_module', 'testing.run_module', (['__name__', '__file__'], {}), '(__name__, __file__)\n', (2583, 2603), False, 'from chainer import testing\n'), ((451, 494), 'numpy.random.randint', 'np.random.randint', (['(0)', '(256)'], {'size': '(3, 48, 64)'}), '(0, 256, size=(3, 48, 64))\n', (468...
# Lint as: python3 # Copyright 2019 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 # # ...
[ "haiku._src.stateful.grad", "haiku._src.stateful.cond", "jax.ad.deflinear", "numpy.testing.assert_allclose", "haiku._src.stateful.remat", "absl.testing.absltest.main", "jax.numpy.array", "haiku._src.stateful.jit", "haiku._src.base.set_state", "jax.core.Primitive", "haiku._src.stateful.value_and_...
[((5840, 5873), 'jax.core.Primitive', 'jax.core.Primitive', (['"""hk_callback"""'], {}), "('hk_callback')\n", (5858, 5873), False, 'import jax\n'), ((5933, 5963), 'jax.ad.deflinear', 'jax.ad.deflinear', (['prim', 'b_impl'], {}), '(prim, b_impl)\n', (5949, 5963), False, 'import jax\n'), ((6456, 6471), 'absl.testing.absl...
"""Solvates a host, inserts guest(s) into solvated host, equilibrates """ import os import time import tempfile import numpy as np from rdkit import Chem from md import builders, minimizer from fe import pdb_writer, free_energy from ff import Forcefield from ff.handlers.deserialize import deserialize_handlers from t...
[ "rdkit.Chem.SDMolSupplier", "os.remove", "os.path.exists", "rdkit.Chem.MolFromPDBFile", "argparse.ArgumentParser", "docking.report.too_much_force", "numpy.linspace", "fe.free_energy.AbsoluteFreeEnergy", "numpy.concatenate", "docking.report.report_step", "timemachine.lib.custom_ops.Context", "t...
[((2726, 2769), 'md.builders.build_protein_system', 'builders.build_protein_system', (['host_pdbfile'], {}), '(host_pdbfile)\n', (2755, 2769), False, 'from md import builders, minimizer\n'), ((2798, 2840), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {'suffix': '""".pdb"""', 'text': '(True)'}), "(suffix='.pdb', text=Tr...
from typing import Dict import numpy as np from ..envs.env import StructuralModel from ..utils.lik_func import * from ..utils.useful_class import ParameterGrid class Estimator(ABC): """An Estimator takes in a (trained) solver and relevant params and outputs estimated structural params """ def __...
[ "numpy.append", "numpy.eye" ]
[((1986, 2027), 'numpy.eye', 'np.eye', (["self.estimator_params['n_moment']"], {}), "(self.estimator_params['n_moment'])\n", (1992, 2027), True, 'import numpy as np\n'), ((2800, 2824), 'numpy.append', 'np.append', (['moments', 'mean'], {}), '(moments, mean)\n', (2809, 2824), True, 'import numpy as np\n'), ((2898, 2926)...
import numpy import pandas import hts.hierarchy from hts.functions import ( _create_bl_str_col, get_agg_series, get_hierarchichal_df, to_sum_mat, ) def test_sum_mat_uv(uv_tree): mat, sum_mat_labels = to_sum_mat(uv_tree) assert isinstance(mat, numpy.ndarray) shp = mat.shape assert shp[...
[ "hts.functions.get_hierarchichal_df", "hts.functions._create_bl_str_col", "hts.functions.get_agg_series", "numpy.array", "pandas.DataFrame", "numpy.testing.assert_array_equal", "hts.functions.to_sum_mat" ]
[((223, 242), 'hts.functions.to_sum_mat', 'to_sum_mat', (['uv_tree'], {}), '(uv_tree)\n', (233, 242), False, 'from hts.functions import _create_bl_str_col, get_agg_series, get_hierarchichal_df, to_sum_mat\n'), ((448, 467), 'hts.functions.to_sum_mat', 'to_sum_mat', (['mv_tree'], {}), '(mv_tree)\n', (458, 467), False, 'f...
from pathlib import Path import shutil import unittest import numpy as np import siml.optimize as optimize import siml.setting as setting class TestOptimize(unittest.TestCase): def test_generate_dict(self): main_setting = setting.MainSetting.read_settings_yaml( Path('tests/data/deform/optun...
[ "siml.setting.MainSetting.read_settings_yaml", "pathlib.Path", "numpy.max", "shutil.rmtree", "siml.optimize.Objective", "siml.optimize.Study", "siml.setting.DBSetting" ]
[((349, 387), 'siml.optimize.Objective', 'optimize.Objective', (['main_setting', 'None'], {}), '(main_setting, None)\n', (367, 387), True, 'import siml.optimize as optimize\n'), ((1979, 2007), 'siml.optimize.Study', 'optimize.Study', (['main_setting'], {}), '(main_setting)\n', (1993, 2007), True, 'import siml.optimize ...
# -*- coding: utf-8 -*- """ @author: david """ import matplotlib.pyplot as plt import seaborn as sns import numpy as np from sklearn.model_selection import KFold from sklearn.metrics import confusion_matrix, classification_report from sklearn.metrics import PrecisionRecallDisplay, RocCurveDisplay class ModelEvaluatio...
[ "numpy.copy", "numpy.unique", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "sklearn.metrics.classification_report", "matplotlib.pyplot.gca", "matplotlib.pyplot.xlabel", "seaborn.heatmap", "sklearn.metrics.RocCurveDisplay.from_predictions", "matplotlib.pyplot.figure", "sklearn.metrics.Pr...
[((701, 723), 'sklearn.model_selection.KFold', 'KFold', ([], {'n_splits': 'kFolds'}), '(n_splits=kFolds)\n', (706, 723), False, 'from sklearn.model_selection import KFold\n'), ((509, 521), 'numpy.unique', 'np.unique', (['y'], {}), '(y)\n', (518, 521), True, 'import numpy as np\n'), ((1287, 1312), 'sklearn.metrics.confu...
import math import numpy as np import torch from torch import nn from torch.backends import cudnn from torch.utils.data import DataLoader from tqdm import tqdm from model import CharRNN from data import TextDataset, TextConverter class Trainer(object): def __init__(self, args): self.args = args ...
[ "torch.nn.CrossEntropyLoss", "data.TextConverter", "numpy.random.choice", "torch.topk", "data.TextDataset", "tqdm.tqdm", "torch.LongTensor", "model.CharRNN", "math.sqrt", "numpy.array", "torch.sum", "torch.save", "torch.utils.data.DataLoader", "torch.no_grad", "torch.device" ]
[((334, 383), 'torch.device', 'torch.device', (["('cuda' if self.args.cuda else 'cpu')"], {}), "('cuda' if self.args.cuda else 'cpu')\n", (346, 383), False, 'import torch\n'), ((709, 768), 'data.TextConverter', 'TextConverter', (['self.args.txt'], {'max_vocab': 'self.args.max_vocab'}), '(self.args.txt, max_vocab=self.a...
import numpy as np import pytest from pandas.core.frame import DataFrame from bender.importers import DataImporters from bender.model_loaders import ModelLoaders from bender.model_trainer.decision_tree import DecisionTreeClassifierTrainer from bender.split_strategies import SplitStrategies pytestmark = pytest.mark.as...
[ "bender.model_trainer.decision_tree.DecisionTreeClassifierTrainer", "bender.split_strategies.SplitStrategies.ratio", "bender.importers.DataImporters.literal", "bender.model_loaders.ModelLoaders.literal", "numpy.all", "pandas.core.frame.DataFrame" ]
[((686, 731), 'pandas.core.frame.DataFrame', 'DataFrame', (["{'x': [2, -3, 4], 'y': [2, -3, 4]}"], {}), "({'x': [2, -3, 4], 'y': [2, -3, 4]})\n", (695, 731), False, 'from pandas.core.frame import DataFrame\n'), ((886, 912), 'numpy.all', 'np.all', (['(expected == result)'], {}), '(expected == result)\n', (892, 912), Tru...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 10 23:54:16 2021 @author: rolandvarga """ import gym import numpy as np import matplotlib.pyplot as plt import time from scipy.signal import savgol_filter import pickle #%matplotlib qt #%matplotlib inline # Set to 1 to repeat SARSA learning (With...
[ "matplotlib.pyplot.ylabel", "scipy.signal.savgol_filter", "numpy.array", "gym.make", "numpy.arange", "matplotlib.pyplot.imshow", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.linspace", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "numpy....
[((973, 1002), 'gym.make', 'gym.make', (['"""SphericalRobot-v0"""'], {}), "('SphericalRobot-v0')\n", (981, 1002), False, 'import gym\n'), ((2376, 2411), 'numpy.array', 'np.array', (['[6, 6, 2 * np.pi / env.c]'], {}), '([6, 6, 2 * np.pi / env.c])\n', (2384, 2411), True, 'import numpy as np\n'), ((2458, 2478), 'numpy.arr...
# -*- coding: utf-8 -*- """ Created on Fri Aug 9 15:33:47 2019 @author: Bogoclu """ import typing import multiprocessing as mp import warnings import numpy as np from scipy import stats from .space import FullSpace from duqo.proba import DS, MC, SUSE, ISPUD, FORM from duqo.doe.lhs import make_doe def _check_obj_w...
[ "numpy.mean", "numpy.ones", "duqo.doe.lhs.make_doe", "scipy.stats.norm", "numpy.logical_not", "multiprocessing.cpu_count", "numpy.array", "numpy.zeros", "numpy.std", "warnings.warn", "numpy.var" ]
[((1245, 1274), 'numpy.array', 'np.array', (['use_std'], {'dtype': 'bool'}), '(use_std, dtype=bool)\n', (1253, 1274), True, 'import numpy as np\n'), ((2344, 2358), 'multiprocessing.cpu_count', 'mp.cpu_count', ([], {}), '()\n', (2356, 2358), True, 'import multiprocessing as mp\n'), ((9965, 10008), 'numpy.ones', 'np.ones...
import tensorflow as tf import numpy as np from dps.register import RegisterBank from dps.env import TensorFlowEnv from dps.utils import Param, Config def build_env(): return PathDiscovery() config = Config( build_env=build_env, curriculum=[ dict(shape=(2, 2), threshold=6), dict(shape=(...
[ "numpy.product", "tensorflow.equal", "tensorflow.shape", "dps.register.RegisterBank", "tensorflow.split", "dps.utils.Param", "numpy.random.randint", "tensorflow.argmax", "tensorflow.clip_by_value", "numpy.concatenate", "tensorflow.reshape", "tensorflow.cast", "tensorflow.minimum" ]
[((740, 747), 'dps.utils.Param', 'Param', ([], {}), '()\n', (745, 747), False, 'from dps.utils import Param, Config\n'), ((760, 767), 'dps.utils.Param', 'Param', ([], {}), '()\n', (765, 767), False, 'from dps.utils import Param, Config\n'), ((780, 787), 'dps.utils.Param', 'Param', ([], {}), '()\n', (785, 787), False, '...
#!/usr/bin/env python import math import os import numpy as np import time import sys import copy import rospy import moveit_msgs.msg import geometry_msgs.msg import random import csv from sensor_msgs.msg import JointState from gazebo_msgs.msg import LinkStates from gazebo_msgs.msg import LinkState from std_msgs.msg i...
[ "panda_rl.srv.StepActionResponse", "rospy.init_node", "rospy.Service", "rospy.wait_for_message", "numpy.append", "moveit_commander.MoveGroupCommander", "numpy.array", "rospy.spin", "numpy.linalg.norm", "numpy.round" ]
[((523, 570), 'moveit_commander.MoveGroupCommander', 'moveit_commander.MoveGroupCommander', (['group_name'], {}), '(group_name)\n', (558, 570), False, 'import moveit_commander\n'), ((583, 610), 'numpy.array', 'np.array', (['[1, 0, 0.0075, 0]'], {}), '([1, 0, 0.0075, 0])\n', (591, 610), True, 'import numpy as np\n'), ((...
import unittest import numpy as np import pandas as pd import mlsurvey as mls class TestData(unittest.TestCase): def test_to_dict_dict_should_be_set(self): """ :test : mlsurvey.model.Data.to_dict() :condition : x,y, y_pred data are filled. :main_result : the dictionary generated...
[ "pandas.DataFrame", "numpy.array", "mlsurvey.sl.models.DataPandas", "mlsurvey.sl.models.DataPandas.from_dict" ]
[((369, 401), 'numpy.array', 'np.array', (['[[1, 2, 3], [4, 5, 6]]'], {}), '([[1, 2, 3], [4, 5, 6]])\n', (377, 401), True, 'import numpy as np\n'), ((414, 430), 'numpy.array', 'np.array', (['[0, 1]'], {}), '([0, 1])\n', (422, 430), True, 'import numpy as np\n'), ((448, 464), 'numpy.array', 'np.array', (['[1, 0]'], {}),...
from random import shuffle import numpy as np import torch import torch.nn as nn import math import torch.nn.functional as F import cv2 from matplotlib.colors import rgb_to_hsv, hsv_to_rgb from PIL import Image from .RepulsionLoss.my_repulsion_loss import repulsion def preprocess_input(image): image /= 255 ...
[ "numpy.random.rand", "PIL.Image.new", "torch.max", "torch.pow", "torch.eq", "numpy.array", "torch.unsqueeze", "numpy.concatenate", "torch.zeros_like", "torch.le", "torch.ones_like", "torch.abs", "random.shuffle", "torch.ge", "cv2.cvtColor", "torch.lt", "torch.clamp", "PIL.Image.ope...
[((734, 756), 'torch.clamp', 'torch.clamp', (['iw'], {'min': '(0)'}), '(iw, min=0)\n', (745, 756), False, 'import torch\n'), ((766, 788), 'torch.clamp', 'torch.clamp', (['ih'], {'min': '(0)'}), '(ih, min=0)\n', (777, 788), False, 'import torch\n'), ((890, 916), 'torch.clamp', 'torch.clamp', (['ua'], {'min': '(1e-08)'})...
import numpy as np from stardist import star_dist, relabel_image_stardist import pytest from utils import random_image, real_image2d, check_similar, circle_image @pytest.mark.parametrize('img', (real_image2d()[1], random_image((128, 123)))) @pytest.mark.parametrize('n_rays', (4, 16, 32)) def test_types(img, n_rays): ...
[ "matplotlib.pyplot.imshow", "stardist.star_dist", "utils.check_similar", "utils.circle_image", "utils.random_image", "numpy.count_nonzero", "pytest.mark.parametrize", "stardist.relabel_image_stardist", "matplotlib.pyplot.figure", "numpy.bitwise_and", "matplotlib.pyplot.tight_layout", "matplotl...
[((244, 290), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n_rays"""', '(4, 16, 32)'], {}), "('n_rays', (4, 16, 32))\n", (267, 290), False, 'import pytest\n'), ((819, 865), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n_rays"""', '(4, 16, 32)'], {}), "('n_rays', (4, 16, 32))\n", (842, 865)...
import math import functools from scipy.stats import binom import numpy as np import itertools import sys import matplotlib.pyplot as plt import matplotlib.patheffects as PathEffects from copy import copy def combine_distribs(deletes, inserts): """ Combine insert and delete models/distributions :param de...
[ "matplotlib.pyplot.ylabel", "matplotlib.pyplot.pcolor", "numpy.log", "copy.copy", "math.exp", "matplotlib.patheffects.withStroke", "numpy.arange", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.max", "matplotlib.pyplot.close", "numpy.exp", "numpy.concatenate", "matplotlib.pyp...
[((691, 726), 'numpy.zeros_like', 'np.zeros_like', (['deletes'], {'dtype': 'float'}), '(deletes, dtype=float)\n', (704, 726), True, 'import numpy as np\n'), ((3544, 3613), 'functools.partial', 'functools.partial', (['model_full', 'rng', 'model_params'], {'rate_func': 'rate_func'}), '(model_full, rng, model_params, rate...
''' file: donkey_env.py author: <NAME> date: 2018-08-31 ''' import os from threading import Thread import numpy as np import gym from gym import error, spaces, utils from gym.utils import seeding from donkey_gym.envs.donkey_sim import DonkeyUnitySimContoller from donkey_gym.envs.donkey_proc import DonkeyU...
[ "gym.utils.seeding.np_random", "donkey_gym.envs.donkey_sim.DonkeyUnitySimContoller", "numpy.array", "donkey_gym.envs.donkey_proc.DonkeyUnityProcess" ]
[((705, 725), 'donkey_gym.envs.donkey_proc.DonkeyUnityProcess', 'DonkeyUnityProcess', ([], {}), '()\n', (723, 725), False, 'from donkey_gym.envs.donkey_proc import DonkeyUnityProcess\n'), ((1535, 1603), 'donkey_gym.envs.donkey_sim.DonkeyUnitySimContoller', 'DonkeyUnitySimContoller', ([], {'level': 'level', 'time_step':...
#!/usr/bin/env python '''Tests for the likelihood.py module''' from time import perf_counter_ns import pytest import numpy as np from numpy.testing import assert_array_equal, assert_almost_equal from scipy.stats import gamma import likelihood SMALL_FIT_PARAMS = { 'baseline_intensities': np.asarray([1, 2, np.na...
[ "numpy.random.default_rng", "likelihood.read_and_tidy_data", "time.perf_counter_ns", "likelihood.likelihood", "scipy.stats.gamma.pdf", "numpy.asarray", "likelihood.cached_single_excitation", "numpy.testing.assert_almost_equal", "numpy.linspace", "numpy.testing.assert_array_equal", "likelihood.si...
[((1212, 1332), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_element,result_dtype"""', '[(123456789, np.uint32), (65535, np.uint16), (255, np.uint8)]'], {}), "('test_element,result_dtype', [(123456789, np.uint32\n ), (65535, np.uint16), (255, np.uint8)])\n", (1235, 1332), False, 'import pytest\n'...
from numpy.testing import assert_array_almost_equal as array_assert from badboids.boids import SimulationParameters def test_simulation_parameters_init(): """Tests Simulation Parameters constructor""" # Arrange formation_flying_distance = 800 formation_flying_strength = 0.10 alert_distance = 8 ...
[ "badboids.boids.SimulationParameters", "numpy.testing.assert_array_almost_equal", "badboids.boids.SimulationParameters.get_defaults" ]
[((392, 520), 'badboids.boids.SimulationParameters', 'SimulationParameters', (['formation_flying_distance', 'formation_flying_strength', 'alert_distance', 'move_to_middle_strength', 'delta_t'], {}), '(formation_flying_distance, formation_flying_strength,\n alert_distance, move_to_middle_strength, delta_t)\n', (412, ...
import numpy as np import cv2 from imutils.object_detection import non_max_suppression import pytesseract from matplotlib import pyplot as plt def ocr(images): results = [] for image in images: args = {"image": image, "east": "frozen_east_text_detection.pb", "min_confidence": 0.5, "width": 320, ...
[ "cv2.dnn.blobFromImage", "numpy.array", "numpy.cos", "pytesseract.image_to_string", "numpy.sin", "cv2.resize", "cv2.imread", "cv2.dnn.readNet" ]
[((391, 416), 'cv2.imread', 'cv2.imread', (["args['image']"], {}), "(args['image'])\n", (401, 416), False, 'import cv2\n'), ((627, 658), 'cv2.resize', 'cv2.resize', (['image', '(newW, newH)'], {}), '(image, (newW, newH))\n', (637, 658), False, 'import cv2\n'), ((708, 805), 'cv2.dnn.blobFromImage', 'cv2.dnn.blobFromImag...
# -*- coding: utf-8 -*- """ INTRO @author: <NAME>. Created on Tue May 21 11:57:52 2019 Department of Aerodynamics Faculty of Aerospace Engineering TU Delft, Delft, the Netherlands """ import inspect from screws.freeze.main import FrozenOnly from typing import Dict, Union import nu...
[ "numpy.shape", "inspect.getfullargspec" ]
[((1001, 1038), 'inspect.getfullargspec', 'inspect.getfullargspec', (['self.__init__'], {}), '(self.__init__)\n', (1023, 1038), False, 'import inspect\n'), ((4446, 4465), 'numpy.shape', 'np.shape', (['_dict_[R]'], {}), '(_dict_[R])\n', (4454, 4465), True, 'import numpy as np\n')]
from foolbox import zoo import numpy as np import foolbox import sys import pytest from foolbox.zoo.model_loader import ModelLoader from os.path import join, dirname @pytest.fixture(autouse=True) def unload_foolbox_model_module(): # reload foolbox_model from scratch for every run # to ensure atomic tests with...
[ "numpy.argmax", "foolbox.zoo.model_loader.ModelLoader.get", "pytest.mark.parametrize", "numpy.zeros", "numpy.sum", "pytest.raises", "os.path.dirname", "foolbox.utils.softmax", "pytest.fixture", "foolbox.zoo.get_model", "numpy.random.randn" ]
[((169, 197), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (183, 197), False, 'import pytest\n'), ((853, 899), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""url, dim"""', 'test_data'], {}), "('url, dim', test_data)\n", (876, 899), False, 'import pytest\n'), ((967, 9...
import cv2 import numpy as np import os from auto_pose.meshrenderer import meshrenderer from auto_pose.ae.utils import lazy_property class PoseVisualizer: def __init__(self, mp_pose_estimator, downsample=1, vertex_scale=False): self.downsample = downsample self.vertex_scale = [mp_pose_estimator...
[ "cv2.rectangle", "numpy.dstack", "numpy.any", "cv2.imshow", "cv2.putText", "cv2.waitKey", "cv2.resize", "numpy.zeros_like" ]
[((2879, 2908), 'cv2.resize', 'cv2.resize', (['image', '(W_d, H_d)'], {}), '(image, (W_d, H_d))\n', (2889, 2908), False, 'import cv2\n'), ((3016, 3034), 'numpy.zeros_like', 'np.zeros_like', (['bgr'], {}), '(bgr)\n', (3029, 3034), True, 'import numpy as np\n'), ((3798, 3817), 'numpy.any', 'np.any', (['depth_image'], {})...
import numpy as np from uncertainties import umath as um def getTeqpl(Teffst, aR, ecc, A=0, f=1/4.): """Return the planet equilibrium temperature. Relation adapted from equation 4 page 4 in http://www.mpia.de/homes/ppvi/chapter/madhusudhan.pdf and https://en.wikipedia.org/wiki/Stefan%E2%80%93Boltzmann_law...
[ "numpy.sqrt", "uncertainties.umath.sqrt" ]
[((1240, 1255), 'numpy.sqrt', 'np.sqrt', (['(1 / aR)'], {}), '(1 / aR)\n', (1247, 1255), True, 'import numpy as np\n'), ((2469, 2484), 'uncertainties.umath.sqrt', 'um.sqrt', (['(1 / aR)'], {}), '(1 / aR)\n', (2476, 2484), True, 'from uncertainties import umath as um\n')]
import time import sys import json import argparse from tqdm import trange from typing import Any, Callable, Dict, List, Optional, Tuple, Union import torch import numpy as np from scipy.spatial.distance import jensenshannon import gym import matplotlib.pyplot as plt from matplotlib.axes import Axes fr...
[ "pandemic_simulator.sh.DefaultPersonRoutineAssignment", "torch.as_tensor", "numpy.sqrt", "pandemic_simulator.model.StageModel", "torch.exp", "numpy.array", "pandemic_simulator.init_globals", "matplotlib.ticker.MaxNLocator", "pandemic_simulator.viz.GymViz.from_config", "pandemic_simulator.env.Locat...
[((8355, 8376), 'numpy.array', 'np.array', (['viz._stages'], {}), '(viz._stages)\n', (8363, 8376), True, 'import numpy as np\n'), ((8395, 8420), 'numpy.array', 'np.array', (['viz._stages_std'], {}), '(viz._stages_std)\n', (8403, 8420), True, 'import numpy as np\n'), ((8930, 8982), 'matplotlib.lines.Line2D', 'Line2D', (...
import matplotlib.pyplot as plt import numpy as np import tensorflow as tf tf.logging.set_verbosity(tf.logging.ERROR) max_epochs = 6000 init_stddev = 0.0001 source_embedding_size = 2 target_embedding_size = 2 source_state_size = 2 preattention_size = 2 target_state_size = 2 max_seq_len = 10 source_tokens = [ ...
[ "tensorflow.shape", "tensorflow.nn.bidirectional_dynamic_rnn", "tensorflow.reduce_sum", "tensorflow.logging.set_verbosity", "tensorflow.nn.sparse_softmax_cross_entropy_with_logits", "tensorflow.contrib.rnn.GRUCell", "tensorflow.nn.softmax", "tensorflow.zeros_initializer", "tensorflow.Graph", "tens...
[((76, 118), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)\n', (100, 118), True, 'import tensorflow as tf\n'), ((2201, 2211), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (2209, 2211), True, 'import tensorflow as tf\n'), ((2254, 2310), 'tensorflow.p...
import numpy as np from ctapipe.core import Component from ctapipe.containers import MuonRingContainer from .fitting import kundu_chaudhuri_circle_fit, taubin_circle_fit import traitlets as traits # the fit methods do not expose the same interface, so we # force the same interface onto them, here. # we also modify th...
[ "numpy.sqrt", "numpy.arctan2" ]
[((1539, 1569), 'numpy.arctan2', 'np.arctan2', (['center_y', 'center_x'], {}), '(center_y, center_x)\n', (1549, 1569), True, 'import numpy as np\n'), ((1599, 1637), 'numpy.sqrt', 'np.sqrt', (['(center_x ** 2 + center_y ** 2)'], {}), '(center_x ** 2 + center_y ** 2)\n', (1606, 1637), True, 'import numpy as np\n')]
''' This script makes an image very similar to Figure 2 of Hutchison et al. 2019 (https://arxiv.org/pdf/1905.08812.pdf). Undoubtedly, there are likely simpler ways to make this figure -- this is how I chose to code it up. Because the figure in the paper uses some proprietary data, the code below will generate fake dat...
[ "matplotlib.pyplot.savefig", "matplotlib.pyplot.Subplot", "matplotlib.pyplot.close", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.figure", "numpy.random.seed", "numpy.random.uniform", "matplotlib.gridspec.GridSpecFromSubplotSpec", "numpy.loadtxt", "matplotlib.patheffects.withStroke", "matp...
[((808, 830), 'numpy.random.seed', 'np.random.seed', ([], {'seed': '(3)'}), '(seed=3)\n', (822, 830), True, 'import numpy as np\n'), ((897, 938), 'numpy.loadtxt', 'np.loadtxt', (['"""gaussian2D_sig2_kernel7.txt"""'], {}), "('gaussian2D_sig2_kernel7.txt')\n", (907, 938), True, 'import numpy as np\n'), ((973, 1014), 'num...
import torch from torch.autograd import Variable from util.util import * from util.data_util import * import numpy as np from PIL import Image from data.base_dataset import get_transform_params, get_raw_transform_fn, \ get_transform_fn, get_soft_bbox, get_masked_image from util.data_util i...
[ "util.data_util.crop_canvas", "numpy.random.choice", "util.data_util.paste_canvas", "data.base_dataset.get_raw_transform_fn", "torch.no_grad", "torch.zeros_like", "torch.autograd.Variable" ]
[((2324, 2371), 'data.base_dataset.get_raw_transform_fn', 'get_raw_transform_fn', ([], {'normalize': 'normalize_image'}), '(normalize=normalize_image)\n', (2344, 2371), False, 'from data.base_dataset import get_transform_params, get_raw_transform_fn, get_transform_fn, get_soft_bbox, get_masked_image\n'), ((2397, 2434),...
r"""Train an EfficientNet classifier. Currently implementation of multi-label multi-class classification is non-functional. During training, start tensorboard from within the classification/ directory: tensorboard --logdir run --bind_all --samples_per_plugin scalars=0,images=0 Example usage: python train_cla...
[ "tensorflow.io.read_file", "tensorflow.GradientTape", "tensorflow.nn.softmax", "tensorflow.image.random_saturation", "tensorflow.summary.image", "tensorflow.keras.layers.Input", "os.path.exists", "classification.train_utils.imgs_with_confidences", "argparse.ArgumentParser", "tensorflow.data.Datase...
[((3300, 3345), 'tensorflow.data.Dataset.from_tensor_slices', 'tf.data.Dataset.from_tensor_slices', (['img_files'], {}), '(img_files)\n', (3334, 3345), True, 'import tensorflow as tf\n'), ((4063, 4105), 'tensorflow.data.Dataset.from_tensor_slices', 'tf.data.Dataset.from_tensor_slices', (['labels'], {}), '(labels)\n', (...
# Author: <NAME> # email: <EMAIL> import matplotlib.pyplot as plt, numpy as np # import seaborn as sns # from pandas import DataFrame # from sklearn.neighbors import NearestNeighbors from terminaltables import AsciiTable from collections import Counter from .private import save_vis_close_helper, get_fig_ax_helper fro...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel", "numpy.argsort", "numpy.array", "xinshuo_miscellaneous.iscolorimage_dimension", "xinshuo_miscellaneous.isinteger", "numpy.arange", "numpy.mean", "xinshuo_miscellaneous.isnparray", "matplotlib.pyplot.xlabel", "matpl...
[((2895, 2922), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (2905, 2922), True, 'import matplotlib.pyplot as plt, numpy as np\n'), ((3148, 3183), 'numpy.linspace', 'np.linspace', (['(0)', 'maximum_x', 'num_bins'], {}), '(0, maximum_x, num_bins)\n', (3159, 3183), True, ...
import napari import time from napari._qt.qthreading import thread_worker import numpy as np # create a viewer window viewer = napari.Viewer() # https://napari.org/guides/stable/threading.html @thread_worker def loop_run(): while True: # endless loop print("Hello world", time.time()) time.sleep(0....
[ "napari.Viewer", "numpy.random.random", "time.sleep", "napari.run", "time.time" ]
[((128, 143), 'napari.Viewer', 'napari.Viewer', ([], {}), '()\n', (141, 143), False, 'import napari\n'), ((701, 713), 'napari.run', 'napari.run', ([], {}), '()\n', (711, 713), False, 'import napari\n'), ((307, 322), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (317, 322), False, 'import time\n'), ((286, 297)...
from arguments import get_args import numpy as np from network.models import MLP_Net from utils.utils import get_env_params import torch import os, gym """ script to watch the demo of the ESIL """ # process the inputs def process_inputs(o, g, o_mean, o_std, g_mean, g_std, args): o_clip = np.clip(o, -args.clip_obs...
[ "numpy.clip", "utils.utils.get_env_params", "torch.load", "torch.tensor", "torch.no_grad", "network.models.MLP_Net", "numpy.concatenate", "arguments.get_args", "gym.make" ]
[((295, 336), 'numpy.clip', 'np.clip', (['o', '(-args.clip_obs)', 'args.clip_obs'], {}), '(o, -args.clip_obs, args.clip_obs)\n', (302, 336), True, 'import numpy as np\n'), ((350, 391), 'numpy.clip', 'np.clip', (['g', '(-args.clip_obs)', 'args.clip_obs'], {}), '(g, -args.clip_obs, args.clip_obs)\n', (357, 391), True, 'i...
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from LLC_Membranes.timeseries.forecast_ctrw import System from LLC_Membranes.llclib import file_rw import names residues = ["GCL", "SOH"] wt = 10 path = "/home/bcoscia/Documents/Gromacs/Transport/NaGA3C11" colors = ['blue', 'red'] opacity = 1 n...
[ "numpy.histogram", "LLC_Membranes.llclib.file_rw.load_object", "numpy.linspace", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((348, 383), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(2)'], {'figsize': '(10, 5)'}), '(1, 2, figsize=(10, 5))\n', (360, 383), True, 'import matplotlib.pyplot as plt\n'), ((1882, 1900), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (1898, 1900), True, 'import matplotlib.pyplot ...
from Tkinter import * import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.autograd as autograd from torch.autograd import Variable master = Tk() goal = 0 var_goal = StringVar() GAMMA = 0.9 last_state = Variable(torch.Tensor([0,0,0,0,0,0])).u...
[ "numpy.abs", "numpy.random.rand", "torch.nn.LSTMCell", "torch.Tensor", "torch.nn.functional.smooth_l1_loss", "torch.nn.Linear", "torch.zeros", "torch.nn.functional.softmax" ]
[((1365, 1382), 'torch.nn.functional.softmax', 'F.softmax', (['output'], {}), '(output)\n', (1374, 1382), True, 'import torch.nn.functional as F\n'), ((1931, 1948), 'torch.nn.functional.softmax', 'F.softmax', (['output'], {}), '(output)\n', (1940, 1948), True, 'import torch.nn.functional as F\n'), ((2154, 2187), 'torch...
import pandas as pd import numpy as np from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import StandardScaler from sklearn.cross_validation import train_test_split import utils import glob, os import pca.dataanalyzer as da, pca.pca as pca from sklearn.metrics import accuracy_score # visulaize ...
[ "sklearn.preprocessing.LabelEncoder", "utils.load_h5", "matplotlib.pyplot.hist", "numpy.unique", "matplotlib.rcParams.update", "glob.iglob", "matplotlib.pyplot.figure", "pca.dataanalyzer.getbytes", "sklearn.cross_validation.train_test_split", "matplotlib.pyplot.tight_layout", "os.path.basename",...
[((1219, 1240), 'pandas.concat', 'pd.concat', (['dataframes'], {}), '(dataframes)\n', (1228, 1240), True, 'import pandas as pd\n'), ((1428, 1455), 'pca.dataanalyzer.getbytes', 'da.getbytes', (['data', 'data_len'], {}), '(data, data_len)\n', (1439, 1455), True, 'import pca.dataanalyzer as da, pca.pca as pca\n'), ((1606,...
# -*- coding: utf-8 -*- import time import numpy as np from qulab.device import BaseDriver, QInteger, QOption, QReal, QString, QVector class Driver(BaseDriver): error_command = '*ESR?' support_models = ['AFG3102'] quants = [ QOption('Output',ch=1, set_cmd='OUTP%(ch)d %(option)s', get_...
[ "qulab.device.QReal", "qulab.device.QOption", "numpy.zeros" ]
[((252, 376), 'qulab.device.QOption', 'QOption', (['"""Output"""'], {'ch': '(1)', 'set_cmd': '"""OUTP%(ch)d %(option)s"""', 'get_cmd': '"""OUTP%(ch)d?"""', 'options': "[('OFF', 'OFF'), ('ON', 'ON')]"}), "('Output', ch=1, set_cmd='OUTP%(ch)d %(option)s', get_cmd=\n 'OUTP%(ch)d?', options=[('OFF', 'OFF'), ('ON', 'ON')...
import pickle import pytest import numpy as np from astropy.coordinates import Longitude from astropy import coordinates as coord from astropy.tests.helper import pickle_protocol, check_pickling_recovery # noqa # Can't test distances without scipy due to cosmology deps from astropy.utils.compat.optional_deps import ...
[ "numpy.identity", "pickle.dumps", "astropy.coordinates.Longitude", "pickle.loads", "astropy.tests.helper.check_pickling_recovery", "pytest.xfail" ]
[((369, 413), 'astropy.coordinates.Longitude', 'Longitude', (['(1.23)', '"""radian"""'], {'wrap_angle': '"""180d"""'}), "(1.23, 'radian', wrap_angle='180d')\n", (378, 413), False, 'from astropy.coordinates import Longitude\n'), ((422, 440), 'pickle.dumps', 'pickle.dumps', (['lon1'], {}), '(lon1)\n', (434, 440), False, ...
#!/usr/bin/env python # # Copyright (C) 2017 ShadowMan # import operator import numpy as np group = np.array([ [1.0, 1.1], [1.0, 1.0], [0.0, 0.0], [0.0, 0.1] ]) labels = ['A', 'A', 'B','B'] def auto_normal(data_set): # 寻找一行/列中的最小值 # axis:表示行(1)或者列(0) min_values = data_set.min(axis = 0) ...
[ "numpy.array", "numpy.zeros", "numpy.tile", "operator.itemgetter" ]
[((101, 159), 'numpy.array', 'np.array', (['[[1.0, 1.1], [1.0, 1.0], [0.0, 0.0], [0.0, 0.1]]'], {}), '([[1.0, 1.1], [1.0, 1.0], [0.0, 0.0], [0.0, 0.1]])\n', (109, 159), True, 'import numpy as np\n'), ((497, 521), 'numpy.zeros', 'np.zeros', (['data_set.shape'], {}), '(data_set.shape)\n', (505, 521), True, 'import numpy ...
from math import pi, sin, cos from panda3d.core import * from direct.showbase.ShowBase import ShowBase from direct.task import Task from floorplan import Floorplan import numpy as np import random import copy class Viewer(ShowBase): def __init__(self): ShowBase.__init__(self) #self.scene = self.loader.loadM...
[ "numpy.arcsin", "floorplan.Floorplan", "numpy.cos", "copy.deepcopy", "numpy.sin", "direct.showbase.ShowBase.ShowBase.__init__", "random.random", "random.randint" ]
[((261, 284), 'direct.showbase.ShowBase.ShowBase.__init__', 'ShowBase.__init__', (['self'], {}), '(self)\n', (278, 284), False, 'from direct.showbase.ShowBase import ShowBase\n'), ((737, 766), 'floorplan.Floorplan', 'Floorplan', (['"""test/floorplan_7"""'], {}), "('test/floorplan_7')\n", (746, 766), False, 'from floorp...
import numpy as np class KF1D: # this EKF assumes constant covariance matrix, so calculations are much simpler # the Kalman gain also needs to be precomputed using the control module def __init__(self, x0, A, C, K): self.x = x0 self.A = A self.C = C self.K = K self.A_K = self.A - np.dot(se...
[ "numpy.dot" ]
[((311, 333), 'numpy.dot', 'np.dot', (['self.K', 'self.C'], {}), '(self.K, self.C)\n', (317, 333), True, 'import numpy as np\n'), ((560, 584), 'numpy.dot', 'np.dot', (['self.A_K', 'self.x'], {}), '(self.A_K, self.x)\n', (566, 584), True, 'import numpy as np\n'), ((587, 607), 'numpy.dot', 'np.dot', (['self.K', 'meas'], ...
""" @author: mkowalska """ import os import numpy as np from numpy.linalg import LinAlgError import matplotlib.pyplot as plt from figure_properties import * import matplotlib.gridspec as gridspec from kcsd import KCSD1D import targeted_basis as tb __abs_file__ = os.path.abspath(__file__) def _html(r, g, b): ret...
[ "numpy.identity", "numpy.linalg.LinAlgError", "targeted_basis.simulate_data", "kcsd.KCSD1D", "matplotlib.pyplot.figure", "matplotlib.gridspec.GridSpec", "numpy.linspace", "numpy.dot", "os.path.abspath", "numpy.arange", "matplotlib.pyplot.show" ]
[((265, 290), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (280, 290), False, 'import os\n'), ((3478, 3568), 'targeted_basis.simulate_data', 'tb.simulate_data', (['csd_profile', 'true_csd_xlims', 'R', 'MU', 'total_ele', 'ele_lims'], {'noise': 'noise'}), '(csd_profile, true_csd_xlims, R, MU,...
from keras.models import Model, Sequential from keras.layers import Input, Convolution2D, ZeroPadding2D, MaxPooling2D, Flatten, Dense, Dropout, Activation import numpy as np from os import listdir,path from os.path import isfile, join from PIL import Image from keras.preprocessing.image import load_img, save_img, img_t...
[ "keras.preprocessing.image.img_to_array", "numpy.sqrt", "keras.layers.Activation", "numpy.multiply", "os.listdir", "keras.models.Model", "keras.applications.imagenet_utils.preprocess_input", "keras.layers.ZeroPadding2D", "keras.layers.Convolution2D", "keras.layers.Flatten", "keras.layers.MaxPool...
[((529, 541), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (539, 541), False, 'from keras.models import Model, Sequential\n'), ((2285, 2353), 'keras.models.Model', 'Model', ([], {'inputs': 'model.layers[0].input', 'outputs': 'model.layers[-2].output'}), '(inputs=model.layers[0].input, outputs=model.layers...
# 2020.05.10 # update topNscore # learner on subspace # particular designed for encounter missing class in this subspace # if one class do not exists in training data, probability for this class would be zeros under anytime # # learner: a regressor or classifier, must have methods named 'predict' # num_class: tota...
[ "numpy.ones", "numpy.unique", "sklearn.model_selection.train_test_split", "sklearn.datasets.load_digits", "numpy.argsort", "numpy.array", "numpy.zeros", "sklearn.svm.SVC" ]
[((3189, 3211), 'sklearn.datasets.load_digits', 'datasets.load_digits', ([], {}), '()\n', (3209, 3211), False, 'from sklearn import datasets\n'), ((3358, 3431), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'digits.target'], {'test_size': '(0.2)', 'stratify': 'digits.target'}), '(X, digits.targ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import mechkit import mechmean class KanataniFactory(object): def __init__(self, N): self.con = mechkit.notation.Converter() self._I2 = mechkit.tensors.Basic().I2 self.N = N = self.con.to_tensor(N) self.degree = le...
[ "numpy.arccos", "mechkit.notation.Converter", "mechkit.tensors.Basic", "numpy.column_stack", "numpy.multiply.outer", "numpy.array", "numpy.einsum", "numpy.cos", "numpy.linalg.norm", "numpy.sin", "numpy.arange" ]
[((3198, 3235), 'numpy.arccos', 'arccos', (['(1 - 2 * indices / nbr_vectors)'], {}), '(1 - 2 * indices / nbr_vectors)\n', (3204, 3235), False, 'from numpy import pi, cos, sin, arccos, arange\n'), ((3367, 3393), 'numpy.column_stack', 'np.column_stack', (['(x, y, z)'], {}), '((x, y, z))\n', (3382, 3393), True, 'import nu...
# Import modules from __future__ import print_function import sys import numpy as np from polytope import box2poly from tulip import hybrid from tulip.abstract import prop2part, discretize import Interface.DSL as DSL from Interface import Statechart as dumpsmach from Interface.Reduce import * from Interface.Transfor...
[ "tulip.hybrid.LtiSysDyn", "Interface.Statechart.tulip_to_xmi", "tulip.abstract.prop2part", "polytope.box2poly", "numpy.array", "sys.stdout.flush", "tulip.abstract.discretize" ]
[((769, 845), 'numpy.array', 'np.array', (['[[1.0, 0, 2.0, 0], [0, 1.0, 0, 2], [0, 0, 0.5, 0], [0, 0, 0, 0.5]]'], {}), '([[1.0, 0, 2.0, 0], [0, 1.0, 0, 2], [0, 0, 0.5, 0], [0, 0, 0, 0.5]])\n', (777, 845), True, 'import numpy as np\n'), ((847, 915), 'numpy.array', 'np.array', (['[[0, 0, 0, 0], [0, 0, 0, 0], [5, -5, 0, 0...
import argparse import json from data_management.DatasetFactory import datasetFactory from config import cfg import numpy as np if __name__ == "__main__": parser = argparse.ArgumentParser(description='Calculates metrics from output of a Classification network.' + ...
[ "argparse.ArgumentParser", "config.cfg.freeze", "config.cfg.merge_from_file", "numpy.sum", "numpy.zeros", "data_management.DatasetFactory.datasetFactory", "json.load", "config.cfg.merge_from_list" ]
[((171, 325), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': "('Calculates metrics from output of a Classification network.' +\n ' Run `run_network.py <config> test` first.')"}), "(description=\n 'Calculates metrics from output of a Classification network.' +\n ' Run `run_network.py...
"""Test the viscous fluid helper functions.""" __copyright__ = """ Copyright (C) 2021 University of Illinois Board of Trustees """ __license__ = """ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Softwar...
[ "logging.getLogger", "mirgecom.transport.PowerLawTransport", "mirgecom.viscous.conductive_heat_flux", "grudge.op.nodal_min", "pytools.convergence.EOCRecorder", "numpy.array", "grudge.op.local_grad", "mirgecom.flux.gradient_flux_central", "pytools.obj_array.make_obj_array", "grudge.dt_utils.h_max_f...
[((1839, 1866), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1856, 1866), False, 'import logging\n'), ((1870, 1920), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""transport_model"""', '[0, 1]'], {}), "('transport_model', [0, 1])\n", (1893, 1920), False, 'import pytest\n')...
# ****************************************************************************** # Copyright 2017-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.apa...
[ "numpy.uint8", "numpy.random.rand", "numpy.int32", "numpy.array", "numpy.arange", "numpy.int8", "numpy.int64", "numpy.reshape", "ngraph.concat", "pytest.mark.xfail", "numpy.float64", "numpy.uint64", "numpy.uint32", "numpy.empty", "numpy.random.seed", "numpy.concatenate", "ngraph.para...
[((3265, 3515), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""val_type, range_start, range_end"""', '[(np.int8, -8, 8), (np.int16, -64, 64), (np.int32, -1024, 1024), (np.int64,\n -16383, 16383), (np.uint8, 0, 8), (np.uint16, 0, 64), (np.uint32, 0, \n 1024), (np.uint64, 0, 16383)]'], {}), "('val_type...
from numpy import log10, isnan def signOfFeasible(p): r = '-' if p.isFeas(p.xk): r = '+' return r textOutputDict = {\ 'objFunVal': lambda p: p.iterObjFunTextFormat % (-p.Fk if p.invertObjFunc else p.Fk), 'log10(maxResidual)': lambda p: '%0.2f' % log10(p.rk+1e-100), 'log10(MaxResidual/ConTol)':lambda p: '...
[ "numpy.log10", "numpy.isnan" ]
[((260, 280), 'numpy.log10', 'log10', (['(p.rk + 1e-100)'], {}), '(p.rk + 1e-100)\n', (265, 280), False, 'from numpy import log10, isnan\n'), ((759, 784), 'numpy.isnan', 'isnan', (['p.f_bound_distance'], {}), '(p.f_bound_distance)\n', (764, 784), False, 'from numpy import log10, isnan\n'), ((884, 911), 'numpy.isnan', '...
import numpy as np import matplotlib.pyplot as plt import os path = "/Users/petermarinov/msci project/electrode data/test data/data/" filenames = [] for f in os.listdir(path): if not f.startswith('.'): filenames.append(f) i=-12 data = np.genfromtxt(path + filenames[i]) V = np.zeros((200,20...
[ "os.listdir", "matplotlib.pyplot.grid", "numpy.float", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.zeros", "matplotlib.pyplot.title", "numpy.genfromtxt", "matplotlib.pyplot.show" ]
[((167, 183), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (177, 183), False, 'import os\n'), ((264, 298), 'numpy.genfromtxt', 'np.genfromtxt', (['(path + filenames[i])'], {}), '(path + filenames[i])\n', (277, 298), True, 'import numpy as np\n'), ((304, 324), 'numpy.zeros', 'np.zeros', (['(200, 200)'], {}), ...
from data_reader.reader import CsvReader from util import * import numpy as np import matplotlib.pyplot as plt class LogisticRegression(object): def __init__(self, learning_rate=0.01, epochs=50): self.__epochs= epochs self.__learning_rate = learning_rate def fit(self, X, y): self.w_ =...
[ "numpy.log10", "matplotlib.pyplot.ylabel", "data_reader.reader.CsvReader", "matplotlib.pyplot.xlabel", "numpy.log", "numpy.asarray", "numpy.exp", "numpy.zeros", "numpy.dot", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "matplotlib.pyplot.show" ]
[((1601, 1629), 'data_reader.reader.CsvReader', 'CsvReader', (['"""./data/Iris.csv"""'], {}), "('./data/Iris.csv')\n", (1610, 1629), False, 'from data_reader.reader import CsvReader\n'), ((2608, 2628), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Epochs"""'], {}), "('Epochs')\n", (2618, 2628), True, 'import matplotl...