code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/python import numpy as np import inkscapeMadeEasy.inkscapeMadeEasy_Base as inkBase import inkscapeMadeEasy.inkscapeMadeEasy_Draw as inkDraw # reference: https://www.electronics-tutorials.ws/resources/transformer-symbols.html class transformer(inkBase.inkscapeMadeEasy): def add(self, vector, delta): ...
[ "inkscapeMadeEasy.inkscapeMadeEasy_Draw.line.relCoords", "inkscapeMadeEasy.inkscapeMadeEasy_Draw.lineStyle.createDashedLinePattern", "inkscapeMadeEasy.inkscapeMadeEasy_Draw.color.defined", "numpy.array", "inkscapeMadeEasy.inkscapeMadeEasy_Draw.lineStyle.set" ]
[((475, 490), 'numpy.array', 'np.array', (['delta'], {}), '(delta)\n', (483, 490), True, 'import numpy as np\n'), ((2803, 2871), 'inkscapeMadeEasy.inkscapeMadeEasy_Draw.line.relCoords', 'inkDraw.line.relCoords', (['elem', '[[0, -20]]', 'position'], {'lineStyle': 'myLine'}), '(elem, [[0, -20]], position, lineStyle=myLin...
# -*- coding: utf-8 -*- """ SCRIPT TO TEST DG CLASSIFICATION @date: 2018.04.10 @author: <NAME> (<EMAIL>) """ # IMPORTS from time import time from sys import stdout import h5py import numpy as np #from matplotlib import pyplot as plt import math from transforms3d import euler from sklearn.model_selection import t...
[ "sys.stdout.write", "numpy.random.seed", "sklearn.preprocessing.StandardScaler", "numpy.argmax", "sklearn.model_selection.train_test_split", "keras.models.Model", "tensorflow.ConfigProto", "matplotlib.pyplot.figure", "numpy.isclose", "numpy.arange", "keras.layers.Input", "tensorflow.get_defaul...
[((1394, 1424), 'h5py.File', 'h5py.File', (['dir_dataset_dg', '"""r"""'], {}), "(dir_dataset_dg, 'r')\n", (1403, 1424), False, 'import h5py\n'), ((1645, 1657), 'numpy.unique', 'np.unique', (['U'], {}), '(U)\n', (1654, 1657), True, 'import numpy as np\n'), ((4708, 4726), 'sys.stdout.write', 'stdout.write', (['"""\n"""']...
# -*- coding: utf-8 -*- """ Colorization models for deepzipper Author: <NAME> """ import tensorflow as tf from utils import load_and_preprocess_single import matplotlib.pyplot as plt import numpy as np import random import time import os # LOAD AND PREPROCESS DATA image_folder = 'train_images' i...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "tensorflow.keras.layers.Conv2D", "matplotlib.pyplot.imshow", "numpy.expand_dims", "matplotlib.pyplot.axis", "time.time", "tensorflow.keras.layers.InputLayer", "tensorflow.nn.depth_to_space", "matplotlib.pyplot.figure", "tensorflow.keras.opt...
[((4620, 4651), 'tensorflow.keras.optimizers.Adam', 'tf.keras.optimizers.Adam', (['(0.001)'], {}), '(0.001)\n', (4644, 4651), True, 'import tensorflow as tf\n'), ((334, 374), 'os.path.join', 'os.path.join', (['"""train_images"""', 'image_name'], {}), "('train_images', image_name)\n", (346, 374), False, 'import os\n'), ...
#!/usr/bin/env python import numpy as np import pathlib import re import tensorflow as tf class tfDataset(): def __init__(self, img_path: pathlib.Path): """ Loads images from a path in the form: path/{category}/*.jpg """ self._img_path = img_path self._dataset = t...
[ "numpy.array", "re.match" ]
[((693, 714), 'numpy.array', 'np.array', (['class_names'], {}), '(class_names)\n', (701, 714), True, 'import numpy as np\n'), ((638, 667), 're.match', 're.match', (['dir_pattern', 'c.name'], {}), '(dir_pattern, c.name)\n', (646, 667), False, 'import re\n')]
from quail.egg import Egg import numpy as np import pytest def test_spc(): presented=[[['cat', 'bat', 'hat', 'goat'],['zoo', 'animal', 'zebra', 'horse']]] recalled=[[['bat', 'cat', 'goat', 'hat'],['animal', 'horse', 'zoo']]] egg = Egg(pres=presented,rec=recalled) assert np.array_equal(egg.analyze('spc'...
[ "numpy.array", "pytest.raises", "quail.egg.Egg" ]
[((244, 277), 'quail.egg.Egg', 'Egg', ([], {'pres': 'presented', 'rec': 'recalled'}), '(pres=presented, rec=recalled)\n', (247, 277), False, 'from quail.egg import Egg\n'), ((740, 773), 'quail.egg.Egg', 'Egg', ([], {'pres': 'presented', 'rec': 'recalled'}), '(pres=presented, rec=recalled)\n', (743, 773), False, 'from q...
import sys import argparse import logging import numpy as np from scipy.spatial import distance_matrix np.set_printoptions(precision=5) np.set_printoptions(suppress=True) # Logging options logging.basicConfig( # filename=os.path.join(dir_path, 'thomson_problem.log'), level=logging.INFO, format='%(asctime...
[ "numpy.stack", "numpy.fill_diagonal", "numpy.set_printoptions", "logging.debug", "argparse.ArgumentParser", "logging.basicConfig", "numpy.random.seed", "numpy.zeros", "numpy.ones", "scipy.spatial.distance_matrix", "numpy.random.standard_normal", "numpy.linalg.norm" ]
[((105, 137), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(5)'}), '(precision=5)\n', (124, 137), True, 'import numpy as np\n'), ((138, 172), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (157, 172), True, 'import numpy as np\n'), ((192, 315)...
#!/usr/bin/env python """ NAME suServer - websocket server for su data RETURNS returns a json string """ from datetime import datetime import sys import asyncio import json import websockets import numpy as np import scipy.signal as sig #import pprint #print("loading obspy...") from obspy.io.segy.segy import...
[ "obspy.io.segy.segy._read_su", "websockets.serve", "scipy.signal.welch", "scipy.signal.filtfilt", "asyncio.get_event_loop", "json.loads", "json.dumps", "numpy.max", "numpy.mean", "sys.stdout.flush", "numpy.min", "numpy.arange", "numpy.array", "scipy.signal.decimate", "datetime.datetime.n...
[((10545, 10585), 'websockets.serve', 'websockets.serve', (['api', '"""localhost"""', '(9191)'], {}), "(api, 'localhost', 9191)\n", (10561, 10585), False, 'import websockets\n'), ((10668, 10686), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (10684, 10686), False, 'import sys\n'), ((1354, 1373), 'numpy.mean...
from __future__ import print_function import gym import math import random import numpy as np import matplotlib from collections import namedtuple from itertools import count import time import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import os import gym_graph from vi...
[ "random.sample", "visdom.Visdom", "torch.cat", "numpy.mean", "torch.no_grad", "torch.load", "os.path.exists", "torch.nn.Linear", "torch.zeros", "itertools.count", "time.sleep", "random.random", "math.exp", "torch.nn.ReLU", "gym.make", "numpy.array", "collections.namedtuple", "rando...
[((360, 368), 'visdom.Visdom', 'Visdom', ([], {}), '()\n', (366, 368), False, 'from visdom import Visdom\n'), ((661, 730), 'collections.namedtuple', 'namedtuple', (['"""Transition"""', "('state', 'action', 'next_state', 'reward')"], {}), "('Transition', ('state', 'action', 'next_state', 'reward'))\n", (671, 730), False...
import neuro import pickle import os.path import numpy as np import matplotlib.pyplot as plt import os import data_collector import time import datetime earth_population = 8000 zero_human = 1/(earth_population*2) doomsday = 1735689600 max_gini_index = 70 min_lat = -90 max_lat = 90 min_lng = -180 max_l...
[ "pickle.dump", "numpy.argmax", "data_collector.Country_info_collector", "numpy.asfarray", "os.path.isfile", "pickle.load", "neuro.NeuralNetwork", "datetime.datetime.strptime", "os.listdir" ]
[((382, 413), 'os.listdir', 'os.listdir', (['covid_reports_files'], {}), '(covid_reports_files)\n', (392, 413), False, 'import os\n'), ((681, 711), 'os.path.isfile', 'os.path.isfile', (['"""neuro.pickle"""'], {}), "('neuro.pickle')\n", (695, 711), False, 'import os\n'), ((2943, 2967), 'numpy.asfarray', 'np.asfarray', (...
import numpy as np import pandas as pd import pytest from sklearn.ensemble import ExtraTreesClassifier, RandomForestClassifier from sklearn.base import ClassifierMixin from sklearn.pipeline import Pipeline from poniard import PoniardClassifier def test_add(): clf = PoniardClassifier() clf.add_estimators([Ext...
[ "sklearn.ensemble.RandomForestClassifier", "poniard.PoniardClassifier", "sklearn.ensemble.ExtraTreesClassifier", "numpy.array", "pytest.mark.parametrize" ]
[((1228, 1337), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""include_preprocessor,output_type"""', '[(True, Pipeline), (False, ClassifierMixin)]'], {}), "('include_preprocessor,output_type', [(True,\n Pipeline), (False, ClassifierMixin)])\n", (1251, 1337), False, 'import pytest\n'), ((273, 292), 'poni...
import numpy as np import torch from torch.autograd import Variable import matplotlib.pyplot as plt from scipy.stats import gaussian_kde, norm from torch.distributions import multivariate_normal from tqdm import tqdm # ## debugging def numpy_p(x): return 1/3 * norm.pdf(x, -2, 1) + 2/3 * norm.pdf(x, 2, 1) def nump...
[ "torch.sqrt", "matplotlib.pyplot.figure", "numpy.arange", "torch.median", "torch.dist", "torch.exp", "torch.Tensor", "torch.zeros", "torch.matmul", "torch.mean", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "torch.autograd.Variable", "matplotlib.pyplot.legend", "torch.norm", "ma...
[((576, 596), 'torch.Tensor', 'torch.Tensor', (['[0, 0]'], {}), '([0, 0])\n', (588, 596), False, 'import torch\n'), ((614, 644), 'torch.tensor', 'torch.tensor', (['[[5, 2], [2, 1]]'], {}), '([[5, 2], [2, 1]])\n', (626, 644), False, 'import torch\n'), ((656, 685), 'scipy.stats.norm.pdf', 'norm.pdf', (['x', 'mean', 'cova...
import numpy as np import numba from typing import List, Callable from scipy.constants import speed_of_light from divergence_approx import div_vec_approx, gradient_vec """Adams-Bashforth 2-step method coeffs""" adams_bashforth2_c0: float = 3. / 2. adams_bashforth2_c1: float = -1. / 2. """Adams-Bashforth 3-step method...
[ "numpy.abs", "numpy.ceil", "numpy.floor", "numpy.zeros", "numpy.array", "numpy.arange", "numba.jit", "numpy.exp", "numpy.round" ]
[((901, 952), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)', 'parallel': '(True)', 'nogil': '(True)'}), '(nopython=True, parallel=True, nogil=True)\n', (910, 952), False, 'import numba\n'), ((1421, 1472), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)', 'parallel': '(True)', 'nogil': '(True)'}), '(nopython=...
#--------------------------------- utils.py file ---------------------------------------# """ This file contains utility functions and classes that support the TBNN-s class. This includes cleaning and processing functions. """ # ------------ Import statements import os import timeit import numpy as np from t...
[ "numpy.trace", "tensorflow.reduce_sum", "numpy.sum", "numpy.amin", "numpy.abs", "tensorflow.maximum", "numpy.argmin", "numpy.argsort", "numpy.arange", "numpy.linalg.norm", "numpy.diag", "numpy.zeros_like", "numpy.transpose", "numpy.linalg.eig", "tensorflow.minimum", "numpy.random.shuff...
[((1223, 1241), 'numpy.arange', 'np.arange', (['n_total'], {}), '(n_total)\n', (1232, 1241), True, 'import numpy as np\n'), ((1315, 1341), 'numpy.random.shuffle', 'np.random.shuffle', (['idx_tot'], {}), '(idx_tot)\n', (1332, 1341), True, 'import numpy as np\n'), ((4838, 4860), 'timeit.default_timer', 'timeit.default_ti...
# -*- coding: utf-8 -*- """ Created on Tue Nov 17 17:43:51 2020 @author: emc1977 """ # Energy of the system can be found as # 1/2*kb*(sqrt(x1^2+(Lb+x2)^2)-Lb)^2 # 1/2*ka*(sqrt(x1^2+(La-x2)^2)-La)^2 # -F1x1-F2x2 import sympy import numpy as np x,y = sympy.symbols('x,y') #need the following to create fun...
[ "sympy.symbols", "numpy.empty", "sympy.utilities.lambdify.lambdify", "sympy.Matrix", "numpy.shape", "numpy.append", "sympy.init_printing", "sympy.hessian", "numpy.array", "numpy.linalg.norm" ]
[((263, 283), 'sympy.symbols', 'sympy.symbols', (['"""x,y"""'], {}), "('x,y')\n", (276, 283), False, 'import sympy\n'), ((494, 509), 'sympy.init_printing', 'init_printing', ([], {}), '()\n', (507, 509), False, 'from sympy import symbols, Matrix, Function, simplify, exp, hessian, solve, init_printing\n'), ((563, 577), '...
# -*- coding: utf-8 -*- # Copyright 2020 PyePAL 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 l...
[ "warnings.warn", "numpy.array" ]
[((4101, 4244), 'warnings.warn', 'warnings.warn', (['"""Only one epsilon value provided,\nwill automatically expand to use the same value in every dimension"""', 'UserWarning'], {}), '(\n """Only one epsilon value provided,\nwill automatically expand to use the same value in every dimension"""\n , UserWarning)\n'...
import enum import os import re from typing import Optional, Tuple import numpy as np from scipy.ndimage import median_filter from skimage.io import imread OCTOPUSLITE_FILEPATTERN = ( "img_channel(?P<channel>[0-9]+)_position(?P<position>[0-9]+)" "_time(?P<time>[0-9]+)_z(?P<z>[0-9]+)" ) @enum.unique class Ch...
[ "numpy.matrix", "numpy.ravel", "numpy.zeros", "re.match", "numpy.nonzero", "numpy.min", "numpy.max", "numpy.arange", "numpy.reshape", "numpy.linalg.inv", "os.path.split", "scipy.ndimage.median_filter", "skimage.io.imread" ]
[((827, 851), 'scipy.ndimage.median_filter', 'median_filter', (['x'], {'size': '(2)'}), '(x, size=2)\n', (840, 851), False, 'from scipy.ndimage import median_filter\n'), ((2153, 2191), 'numpy.zeros', 'np.zeros', (['(x.shape[0] * x.shape[1], 6)'], {}), '((x.shape[0] * x.shape[1], 6))\n', (2161, 2191), True, 'import nump...
""" Copyright (C) 2019 <NAME>, ETH Zurich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
[ "functools.partial", "rpy2.robjects.packages.importr", "rpy2.robjects.numpy2ri.activate", "numpy.std", "rpy2.robjects.pandas2ri.activate", "numpy.expand_dims", "numpy.mean", "numpy.array", "sklearn.decomposition.PCA", "numpy.where", "numpy.column_stack", "numpy.reshape", "rpy2.robjects.Formu...
[((2039, 2059), 'rpy2.robjects.packages.importr', 'importr', (['"""causaldrf"""'], {}), "('causaldrf')\n", (2046, 2059), False, 'from rpy2.robjects.packages import importr\n'), ((2212, 2231), 'rpy2.robjects.numpy2ri.activate', 'numpy2ri.activate', ([], {}), '()\n', (2229, 2231), False, 'from rpy2.robjects import numpy2...
import unittest from ..fsf import * import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal class TestFSF(unittest.TestCase): def setUp(self) -> None: self.A = np.array([[0, 1], [-2, -3]]) self.b = np.array([[0], [1]]) self.poles = np.array([-3, -4]) ...
[ "numpy.poly", "numpy.testing.assert_array_equal", "numpy.array" ]
[((210, 238), 'numpy.array', 'np.array', (['[[0, 1], [-2, -3]]'], {}), '([[0, 1], [-2, -3]])\n', (218, 238), True, 'import numpy as np\n'), ((256, 276), 'numpy.array', 'np.array', (['[[0], [1]]'], {}), '([[0], [1]])\n', (264, 276), True, 'import numpy as np\n'), ((298, 316), 'numpy.array', 'np.array', (['[-3, -4]'], {}...
import sys import time import os import torch import random import sklearn # Ignore sklearn related warnings import warnings warnings.filterwarnings("ignore", category=RuntimeWarning) import numpy as np import torch.nn as nn import torchvision.utils as vutils import torch.optim as optim import finetune_utils as ftu i...
[ "wandb.run.save", "model_utils.compute_val_metrics", "numpy.random.seed", "torch.eye", "utils.calc_topk_accuracy", "model_3d.DpcRnn", "model_3d.ImageFetCombiner", "torch.cat", "sim_utils.CorrSimHandler", "torch.cuda.device_count", "collections.defaultdict", "sim_utils.AlignSimHandler", "torc...
[((126, 184), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'RuntimeWarning'}), "('ignore', category=RuntimeWarning)\n", (149, 184), False, 'import warnings\n'), ((480, 510), 'sys.path.append', 'sys.path.append', (['"""../backbone"""'], {}), "('../backbone')\n", (495, 510), False...
# <NAME>/Feb 2022 import numpy as np from numpy import linalg as LA import matplotlib import matplotlib.dates import datetime from alive_progress import alive_bar from floodsystem.datafetcher import fetch_measure_levels from floodsystem.station import MonitoringStation from floodsystem.flood import stations_level_ove...
[ "floodsystem.station.inconsistent_typical_range_stations", "floodsystem.flood.stations_level_over_threshold", "numpy.poly1d", "numpy.polyfit", "numpy.array", "datetime.timedelta", "matplotlib.dates.date2num" ]
[((486, 518), 'matplotlib.dates.date2num', 'matplotlib.dates.date2num', (['dates'], {}), '(dates)\n', (511, 518), False, 'import matplotlib\n'), ((1851, 1896), 'floodsystem.station.inconsistent_typical_range_stations', 'inconsistent_typical_range_stations', (['stations'], {}), '(stations)\n', (1886, 1896), False, 'from...
#!/usr/bin/python # -*- coding: utf-8 -*- import numpy as np import numpy.ma as ma import itertools class TPM: """ A collecton of static methods to calculate transition probability matrix of a descrete markov process from an unbalanced panel data """ @staticmethod def f(x): ...
[ "numpy.divide", "numpy.sum", "numpy.unique", "numpy.zeros", "numpy.ma.masked_invalid", "numpy.isnan", "numpy.argsort", "numpy.apply_along_axis", "numpy.array", "numpy.array_split", "numpy.random.shuffle" ]
[((12699, 12723), 'numpy.random.shuffle', 'np.random.shuffle', (['array'], {}), '(array)\n', (12716, 12723), True, 'import numpy as np\n'), ((13262, 13286), 'numpy.random.shuffle', 'np.random.shuffle', (['array'], {}), '(array)\n', (13279, 13286), True, 'import numpy as np\n'), ((1869, 1886), 'numpy.argsort', 'np.argso...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Xtreme RGB Colourspace ====================== Defines the *Xtreme RGB* colourspace: - :attr:`XTREME_RGB_COLOURSPACE`. See Also -------- `RGB Colourspaces IPython Notebook <http://nbviewer.ipython.org/github/colour-science/colour-ipython/blob/master/notebooks/model...
[ "colour.models.normalised_primary_matrix", "colour.models.RGB_Colourspace", "colour.colorimetry.ILLUMINANTS.get", "numpy.linalg.inv", "numpy.array" ]
[((1215, 1249), 'numpy.array', 'np.array', (['[[1, 0], [0, 1], [0, 0]]'], {}), '([[1, 0], [0, 1], [0, 0]])\n', (1223, 1249), True, 'import numpy as np\n'), ((1549, 1619), 'colour.models.normalised_primary_matrix', 'normalised_primary_matrix', (['XTREME_RGB_PRIMARIES', 'XTREME_RGB_WHITEPOINT'], {}), '(XTREME_RGB_PRIMARI...
import numpy as np import pickle as pkl import os import pandas as pd # Creates a dictionary, path_dict, with all of the required path information for the following # functions including save directory and finding the s2p-output # Parameters: # fdir - the path to the original recording file # fna...
[ "pandas.DataFrame", "numpy.load", "numpy.save", "os.path.join" ]
[((635, 674), 'os.path.join', 'os.path.join', (['fdir', '"""suite2p"""', '"""plane0"""'], {}), "(fdir, 'suite2p', 'plane0')\n", (647, 674), False, 'import os\n'), ((706, 749), 'os.path.join', 'os.path.join', (["path_dict['s2p_dir']", '"""F.npy"""'], {}), "(path_dict['s2p_dir'], 'F.npy')\n", (718, 749), False, 'import o...
from typing import Optional, Tuple import numpy as np from sklearn import datasets from torch.utils.data import DataLoader, Dataset import torch # import torch.multiprocessing as multiprocessing # multiprocessing.set_start_method("spawn") # class DensityDataset: # def __init__(self, data, dtype=np.float32): # ...
[ "numpy.random.seed", "numpy.concatenate", "numpy.random.randn", "numpy.std", "numpy.power", "numpy.floor", "sklearn.datasets.make_blobs", "numpy.random.RandomState", "sklearn.datasets.make_moons", "sklearn.datasets.make_swiss_roll", "numpy.mean", "numpy.sin", "numpy.linspace", "sklearn.dat...
[((2267, 2284), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (2281, 2284), True, 'import numpy as np\n'), ((2293, 2314), 'numpy.linspace', 'np.linspace', (['(-1)', '(1)', 'N'], {}), '(-1, 1, N)\n', (2304, 2314), True, 'import numpy as np\n'), ((2451, 2461), 'numpy.mean', 'np.mean', (['Y'], {}), '(Y)\n...
""" 2-layer controller. """ from aw_nas import utils, assert_rollout_type from aw_nas.utils import DistributedDataParallel from aw_nas.controller.base import BaseController from aw_nas.btcs.layer2.search_space import ( Layer2Rollout, Layer2DiffRollout, DenseMicroRollout, DenseMicroDiffRollout, Stag...
[ "aw_nas.utils.gumbel_softmax", "aw_nas.utils.get_numpy", "torch.cat", "torch.device", "aw_nas.btcs.layer2.search_space.SinkConnectMacroDiffRollout", "aw_nas.btcs.layer2.search_space.Layer2DiffRollout", "aw_nas.utils.torch_utils.max_eig_of_hessian", "os.path.dirname", "torch.nn.ParameterList", "tor...
[((2257, 2281), 'torch.nn.Module.__init__', 'nn.Module.__init__', (['self'], {}), '(self)\n', (2275, 2281), True, 'import torch.nn as nn\n'), ((5941, 5961), 'torch.nn.ParameterList', 'nn.ParameterList', (['[]'], {}), '([])\n', (5957, 5961), True, 'import torch.nn as nn\n'), ((7560, 7582), 'aw_nas.utils.get_numpy', 'uti...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ "tvm.convert", "tvm.create_schedule", "tvm.relay.Function", "tvm.testing.assert_allclose", "mxnet.gluon.utils.download", "tvm.relay.multiply", "tvm.relay.frontend.from_mxnet", "mxnet.gluon.model_zoo.vision.get_model", "tvm.relay.const", "numpy.random.uniform", "tvm.relay.testing.resnet.get_workl...
[((1123, 1165), 'tvm.micro.Session', 'micro.Session', (['DEVICE_TYPE', 'BINUTIL_PREFIX'], {}), '(DEVICE_TYPE, BINUTIL_PREFIX)\n', (1136, 1165), True, 'import tvm.micro as micro\n'), ((1412, 1430), 'tvm.convert', 'tvm.convert', (['shape'], {}), '(shape)\n', (1423, 1430), False, 'import tvm\n'), ((1439, 1488), 'tvm.place...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from timeit import Timer a = np.array([1, 2, 3, 4]) print(a + 1) 2**a b = np.ones(4) + 1 a - b a * b j = np.arange(5) 2**(j + 1) - j c = np.ones((3, 3)) # NOT matrix multiplication! print(c * c) print(c.dot(c)) a = np.arange(10) b = a[0::2] c = a[1::2]...
[ "timeit.Timer", "numpy.ones", "numpy.array", "numpy.arange", "numpy.fromiter" ]
[((95, 117), 'numpy.array', 'np.array', (['[1, 2, 3, 4]'], {}), '([1, 2, 3, 4])\n', (103, 117), True, 'import numpy as np\n'), ((171, 183), 'numpy.arange', 'np.arange', (['(5)'], {}), '(5)\n', (180, 183), True, 'import numpy as np\n'), ((204, 219), 'numpy.ones', 'np.ones', (['(3, 3)'], {}), '((3, 3))\n', (211, 219), Tr...
import pickle from pathlib import Path import numpy as np from second.core import box_np_ops from second.data.dataset import Dataset, get_dataset_class from second.data.kitti_dataset import KittiDataset import second.data.nuscenes_dataset as nuds from second.utils.progress_bar import progress_bar_iter as prog_bar fr...
[ "numpy.full", "pickle.dump", "numpy.concatenate", "numpy.flatnonzero", "numpy.zeros", "second.core.box_np_ops.points_in_rbbox", "pathlib.Path", "numpy.arange", "second.data.dataset.get_dataset_class", "numpy.all" ]
[((1058, 1073), 'pathlib.Path', 'Path', (['data_path'], {}), '(data_path)\n', (1062, 1073), False, 'from pathlib import Path\n'), ((4946, 4961), 'pathlib.Path', 'Path', (['data_path'], {}), '(data_path)\n', (4950, 4961), False, 'from pathlib import Path\n'), ((939, 976), 'second.data.dataset.get_dataset_class', 'get_da...
# -*- encoding: utf-8 -*- """Script for analyzing data from the simulated primary and follow-up experiments.""" # Allow importing modules from parent directory. import sys sys.path.append('..') from fdr import lsu, tst, qvalue from fwer import bonferroni, sidak, hochberg, holm_bonferroni from permutation import tfr_p...
[ "sys.path.append", "numpy.ndindex", "numpy.save", "numpy.load", "numpy.zeros", "util.grid_model_counts", "numpy.shape", "numpy.reshape" ]
[((173, 194), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (188, 194), False, 'import sys\n'), ((1262, 1281), 'numpy.shape', 'np.shape', (['pvals_pri'], {}), '(pvals_pri)\n', (1270, 1281), True, 'import numpy as np\n'), ((1408, 1448), 'numpy.zeros', 'np.zeros', (['[n_iterations, n_effect_sizes]...
from collections import defaultdict, Counter, OrderedDict, namedtuple, deque from typing import List, Dict, Any, Tuple, Iterable, Set, Optional import numpy as np import tensorflow as tf from dpu_utils.tfutils import unsorted_segment_logsumexp, pick_indices_from_probs from dpu_utils.mlutils.vocabulary import Vocabular...
[ "tensorflow.einsum", "tensorflow.reduce_sum", "numpy.empty", "tensorflow.reshape", "collections.defaultdict", "numpy.arange", "numpy.exp", "collections.deque", "tensorflow.nn.softmax", "tensorflow.size", "tensorflow.gather", "tensorflow.concat", "tensorflow.variable_scope", "tensorflow.pla...
[((1096, 1608), 'collections.namedtuple', 'namedtuple', (['"""ExpansionInformation"""', "['node_to_type', 'node_to_label', 'node_to_prod_id', 'node_to_children',\n 'node_to_parent', 'node_to_synthesised_attr_node',\n 'node_to_inherited_attr_node', 'variable_to_last_use_id',\n 'node_to_representation', 'node_to...
from glob import glob import zipfile import shutil import os import json import numpy as np import nibabel as nib import matplotlib.pyplot as plt """ find all zip files, unzip one by one for each unzipped content: get patient ID according to zip filename save T1 weighted nifit as format "mri5726_NACC626353" zi...
[ "matplotlib.pyplot.subplot", "os.mkdir", "json.load", "zipfile.ZipFile", "nibabel.load", "numpy.std", "matplotlib.pyplot.imshow", "matplotlib.pyplot.close", "os.walk", "os.path.exists", "numpy.mean", "numpy.array", "glob.glob", "shutil.rmtree", "os.path.join", "matplotlib.pyplot.savefi...
[((1100, 1119), 'shutil.rmtree', 'shutil.rmtree', (['path'], {}), '(path)\n', (1113, 1119), False, 'import shutil\n'), ((1226, 1239), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (1233, 1239), False, 'import os\n'), ((1443, 1456), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (1450, 1456), False, 'import os\n'...
import numpy as _np import scipy.sparse as _sp from ._basis_utils import _shuffle_sites #################################################### # set of helper functions to implement the partial # # trace of lattice density matrices. They do not # # have any checks and states are assumed to be # # in the non-sym...
[ "numpy.zeros", "numpy.einsum" ]
[((6095, 6140), 'numpy.zeros', '_np.zeros', (['psi.col.shape'], {'dtype': 'psi.col.dtype'}), '(psi.col.shape, dtype=psi.col.dtype)\n', (6104, 6140), True, 'import numpy as _np\n'), ((1385, 1420), 'numpy.einsum', '_np.einsum', (['"""...jlkl->...jk"""', 'rho_v'], {}), "('...jlkl->...jk', rho_v)\n", (1395, 1420), True, 'i...
import torch import numpy as np __all__ = ["CosineDistance"] #NOTE: see https://github.com/pytorch/pytorch/issues/8069 #TODO: update acos_safe once PR mentioned in above link is merged and available def _acos_safe(x: torch.Tensor, eps: float=1e-4): slope = np.arccos(1.0 - eps) / eps # TODO: stop doing this a...
[ "torch.sum", "torch.sign", "torch.abs", "torch.empty_like", "numpy.arccos", "torch.acos" ]
[((422, 441), 'torch.empty_like', 'torch.empty_like', (['x'], {}), '(x)\n', (438, 441), False, 'import torch\n'), ((506, 524), 'torch.sign', 'torch.sign', (['x[bad]'], {}), '(x[bad])\n', (516, 524), False, 'import torch\n'), ((541, 560), 'torch.acos', 'torch.acos', (['x[good]'], {}), '(x[good])\n', (551, 560), False, '...
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Copyright (c) 2019, Eurecat / UPF # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of...
[ "numpy.minimum", "masp.shoebox_room_sim.render_rirs_mic", "numpy.empty", "masp.shoebox_room_sim.apply_source_signals_mic", "time.time", "librosa.core.load", "masp.shoebox_room_sim.find_abs_coeffs_from_rt", "numpy.array", "masp.shoebox_room_sim.compute_echograms_mic", "masp.shoebox_room_sim.room_st...
[((2087, 2113), 'numpy.array', 'np.array', (['[10.2, 7.1, 3.2]'], {}), '([10.2, 7.1, 3.2])\n', (2095, 2113), True, 'import numpy as np\n'), ((2187, 2222), 'numpy.array', 'np.array', (['[1.0, 0.8, 0.7, 0.6, 0.5]'], {}), '([1.0, 0.8, 0.7, 0.6, 0.5])\n', (2195, 2222), True, 'import numpy as np\n'), ((2285, 2301), 'numpy.e...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import argparse import datetime import json import logging import os import random import time from pathlib import Path import cv2 import numpy as np import torch from PIL import Image from torch.utils.data import DataLoader, DistributedSampler fro...
[ "numpy.random.seed", "argparse.ArgumentParser", "torch.optim.lr_scheduler.StepLR", "torch.utils.data.RandomSampler", "torch.optim.AdamW", "json.dumps", "pathlib.Path", "torch.device", "util.misc.is_main_process", "os.path.join", "util.misc.init_distributed_mode", "datasets.coco.build", "torc...
[((577, 604), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (594, 604), False, 'import logging\n'), ((6230, 6297), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Set transformer detector"""'], {'add_help': '(False)'}), "('Set transformer detector', add_help=False)\n", (6253,...
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ @File : DecisionTree.py @Author : <NAME> @Emial : <EMAIL> @Date : 2022/02/21 16:59 @Description : 决策树 """ import time import numpy as np def loadData(fileName): """ 加载文件 @Args: fileName: 加载的文件路径 @Returns: ...
[ "numpy.log2", "numpy.array", "time.time" ]
[((2776, 2799), 'numpy.array', 'np.array', (['trainDataList'], {}), '(trainDataList)\n', (2784, 2799), True, 'import numpy as np\n'), ((2820, 2844), 'numpy.array', 'np.array', (['trainLabelList'], {}), '(trainLabelList)\n', (2828, 2844), True, 'import numpy as np\n'), ((6624, 6635), 'time.time', 'time.time', ([], {}), ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 1 20:33:32 2019 @authors: <NAME> (<EMAIL>) <NAME> (<EMAIL>) """ from collections import Counter from scipy import signal import numpy as np import matplotlib.pyplot as plt import matplotlib matplotlib.use('TkAgg') class EmotionalSlice: ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "scipy.signal.resample", "matplotlib.pyplot.close", "numpy.asarray", "matplotlib.pyplot.yticks", "numpy.zeros", "matplotlib.pyplot.legend", "collections.Counter", "numpy.hstack", "matplotlib.pyplot.figure", "matplotlib.use", "numpy.linspac...
[((272, 295), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (286, 295), False, 'import matplotlib\n'), ((3573, 3592), 'numpy.zeros', 'np.zeros', (['sliceSize'], {}), '(sliceSize)\n', (3581, 3592), True, 'import numpy as np\n'), ((12613, 12633), 'numpy.asarray', 'np.asarray', (['self.ots'], {...
import pytest import numpy from pyckmeans.knee import KneeLocator @pytest.mark.parametrize('direction', ['increasing', 'decreasing']) @pytest.mark.parametrize('curve', ['convex', 'concave']) def test_simple(direction, curve): x = numpy.array([1.0, 2.0, 3.0 ,4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ]) y = numpy.array([...
[ "pytest.mark.parametrize", "pytest.raises", "pyckmeans.knee.KneeLocator", "numpy.array" ]
[((69, 135), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""direction"""', "['increasing', 'decreasing']"], {}), "('direction', ['increasing', 'decreasing'])\n", (92, 135), False, 'import pytest\n'), ((137, 192), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""curve"""', "['convex', 'concave']"...
# evaluate_hypotheses.py # This script evaluates our preregistered hypotheses using # the doctopics file produced by MALLET. # This version of evaluate_hypotheses is redesigned to permit # being called repeatedly as a function from measure_variation. import sys, csv import numpy as np from scipy.spatial.distance imp...
[ "csv.DictReader", "collections.Counter", "scipy.spatial.distance.cosine", "numpy.array" ]
[((2758, 2767), 'collections.Counter', 'Counter', ([], {}), '()\n', (2765, 2767), False, 'from collections import Counter\n'), ((2785, 2794), 'collections.Counter', 'Counter', ([], {}), '()\n', (2792, 2794), False, 'from collections import Counter\n'), ((2810, 2819), 'collections.Counter', 'Counter', ([], {}), '()\n', ...
# 数据处理部分之前的代码,加入部分数据处理的库 import gzip import json import os import random import matplotlib.image as mpimg import matplotlib.pyplot as plt import numpy as np import paddle.fluid as fluid import pandas as pd from PIL import Image from paddle.fluid.dygraph.nn import Conv2D, Pool2D, Linear def load_data(mode='train'): ...
[ "matplotlib.pyplot.title", "os.remove", "pandas.read_csv", "random.shuffle", "matplotlib.pyplot.figure", "paddle.fluid.io.DataLoader.from_generator", "paddle.fluid.dygraph.nn.Linear", "paddle.fluid.layers.mean", "pandas.DataFrame", "matplotlib.pyplot.imshow", "os.path.exists", "paddle.fluid.dy...
[((4923, 4935), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (4933, 4935), True, 'import matplotlib.pyplot as plt\n'), ((4937, 4972), 'matplotlib.pyplot.title', 'plt.title', (['"""trainning"""'], {'fontsize': '(24)'}), "('trainning', fontsize=24)\n", (4946, 4972), True, 'import matplotlib.pyplot as plt\n...
import abc import logging.config import os import numpy as np from rec_to_nwb.processing.time.continuous_time_extractor import \ ContinuousTimeExtractor from rec_to_nwb.processing.time.timestamp_converter import TimestampConverter path = os.path.dirname(os.path.abspath(__file__)) logging.config.fileConfig( f...
[ "rec_to_nwb.processing.time.continuous_time_extractor.ContinuousTimeExtractor", "numpy.shape", "os.path.abspath", "rec_to_nwb.processing.time.timestamp_converter.TimestampConverter" ]
[((260, 285), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (275, 285), False, 'import os\n'), ((747, 772), 'rec_to_nwb.processing.time.continuous_time_extractor.ContinuousTimeExtractor', 'ContinuousTimeExtractor', ([], {}), '()\n', (770, 772), False, 'from rec_to_nwb.processing.time.continu...
from numpy.random import seed import tensorflow def set_seed(): seed(1) tensorflow.random.set_seed(2)
[ "tensorflow.random.set_seed", "numpy.random.seed" ]
[((69, 76), 'numpy.random.seed', 'seed', (['(1)'], {}), '(1)\n', (73, 76), False, 'from numpy.random import seed\n'), ((81, 110), 'tensorflow.random.set_seed', 'tensorflow.random.set_seed', (['(2)'], {}), '(2)\n', (107, 110), False, 'import tensorflow\n')]
import os import utils import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from experiments_manager import ExperimentsManager from sklearn.preprocessing import MinMaxScaler from device_session_classifier import DeviceSessionClassifier from device_sequence_classifier import Devic...
[ "numpy.full", "seaborn.set_style", "os.path.abspath", "pandas.DataFrame", "os.makedirs", "pandas.read_csv", "os.path.exists", "os.path.splitext", "multiple_device_classifier.MultipleDeviceClassifier", "os.path.join" ]
[((480, 502), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('white')\n", (493, 502), True, 'import seaborn as sns\n'), ((6227, 6252), 'os.path.abspath', 'os.path.abspath', (['"""models"""'], {}), "('models')\n", (6242, 6252), False, 'import os\n'), ((6267, 6302), 'os.path.abspath', 'os.path.abspath', (...
from . import Cosmology, MassFunction, HaloPhysics import numpy as np from scipy.special import spherical_jn from scipy.integrate import simps class MassIntegrals: """ Class to compute and store the various mass integrals of the form .. math:: I_p^{q_1,q_2}(k_1,...k_p) = \\int n(m)b^{(q_1)}(m)b^{...
[ "numpy.power", "numpy.linspace" ]
[((3743, 3802), 'numpy.linspace', 'np.linspace', (['self.min_logM_h', 'self.max_logM_h', 'self.npoints'], {}), '(self.min_logM_h, self.max_logM_h, self.npoints)\n', (3754, 3802), True, 'import numpy as np\n'), ((14928, 15006), 'numpy.power', 'np.power', (['(3.0 * self.m_h_grid / (4.0 * np.pi * self.cosmology.rhoM))', '...
import numpy as np import pickle import cv2 from sklearn.model_selection import train_test_split import pickle import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras import layers data = pickle.loads(open('output/embeddings.pickle', "rb").read()) x = d = np.array(data["embeddings"]) y = ...
[ "sklearn.model_selection.train_test_split", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "numpy.array", "tensorflow.keras.layers.Dense" ]
[((287, 315), 'numpy.array', 'np.array', (["data['embeddings']"], {}), "(data['embeddings'])\n", (295, 315), True, 'import numpy as np\n'), ((440, 462), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x', 'y'], {}), '(x, y)\n', (456, 462), False, 'from sklearn.model_selection import train_test_split\...
import autoarray as aa import numpy as np from test_autoarray.mock.mock_inversion import MockPixelizationGrid, MockRegMapper class TestRegularizationinstance: def test__regularization_matrix__compare_to_regularization_util(self): pixel_neighbors = np.array( [ [1, 3, 7, 2], ...
[ "autoarray.reg.AdaptiveBrightness", "test_autoarray.mock.mock_inversion.MockRegMapper", "autoarray.util.regularization.adaptive_regularization_weights_from_pixel_signals", "autoarray.util.regularization.constant_regularization_matrix_from_pixel_neighbors", "test_autoarray.mock.mock_inversion.MockPixelizatio...
[((264, 412), 'numpy.array', 'np.array', (['[[1, 3, 7, 2], [4, 2, 0, -1], [1, 5, 3, -1], [4, 6, 0, -1], [7, 1, 5, 3], [\n 4, 2, 8, -1], [7, 3, 0, -1], [4, 8, 6, -1], [7, 5, -1, -1]]'], {}), '([[1, 3, 7, 2], [4, 2, 0, -1], [1, 5, 3, -1], [4, 6, 0, -1], [7, 1,\n 5, 3], [4, 2, 8, -1], [7, 3, 0, -1], [4, 8, 6, -1], [...
# Author: Ruthger import logging from typing import Optional, Tuple import random from PIL.Image import Image import numpy as np from keras.models import load_model import h5py from keras.preprocessing.image import img_to_array import io logger = logging.getLogger(__name__) # Prediction result datatype, simply stor...
[ "keras.models.load_model", "io.BytesIO", "h5py.File", "numpy.asarray", "keras.preprocessing.image.img_to_array", "logging.getLogger" ]
[((250, 277), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (267, 277), False, 'import logging\n'), ((3179, 3193), 'keras.models.load_model', 'load_model', (['h5'], {}), '(h5)\n', (3189, 3193), False, 'from keras.models import load_model\n'), ((4580, 4622), 'numpy.asarray', 'np.asarray',...
""" Module to analyze vessel pulsatility during the heart cycle in ecg-gated CT radius change - area change - volume change Authors: <NAME> and <NAME>. Created 2019. """ import os import sys import time import openpyxl import pirt import numpy as np import visvis as vv from stentseg.utils.datahandling ...
[ "numpy.abs", "stentseg.utils.datahandling.loadmodel", "stentseg.utils.fitting.project_to_plane", "stentseg.utils.fitting.project_from_plane", "numpy.floor", "pirt.DeformationFieldBackward", "stentseg.utils.fitting.fit_ellipse", "stentseg.utils.fitting.area", "numpy.sin", "os.path.join", "visvis....
[((2749, 2960), 'stentseg.utils.datahandling.select_dir', 'select_dir', (['"""D:\\\\Profiles\\\\koenradesma\\\\SURFdrive\\\\UTdrive\\\\MedDataMimics\\\\LSPEAS_Mimics"""', '"""C:\\\\Users\\\\Maaike\\\\SURFdrive\\\\UTdrive\\\\MedDataMimics\\\\LSPEAS_Mimics"""', '"""C:\\\\stack\\\\data\\\\lspeas\\\\vaatwand"""'], {}), "(\...
from multiprocessing.sharedctypes import Value import numpy as np import warnings from ..core import Bullet from ..scene_maker import BulletSceneMaker from ..collision_checker import BulletCollisionChecker from ..robots import PandaDualArm import gym import pybullet as p from gym import spaces from gym.envs.registratio...
[ "numpy.zeros", "numpy.all", "numpy.clip", "numpy.any", "pybullet.readUserDebugParameter", "numpy.array", "gym.spaces.Box", "numpy.linalg.norm", "warnings.warn", "gym.envs.registration.register" ]
[((15825, 15941), 'gym.envs.registration.register', 'register', ([], {'id': '"""MyPandaDualArmReach-v0"""', 'entry_point': '"""pybullet_wrapper:PandaDualArmGymEnv"""', 'max_episode_steps': '(100)'}), "(id='MyPandaDualArmReach-v0', entry_point=\n 'pybullet_wrapper:PandaDualArmGymEnv', max_episode_steps=100)\n", (1583...
import gym import gym_flowers import numpy as np import os os.environ['LD_LIBRARY_PATH']+=':'+os.environ['HOME']+'/.mujoco/mjpro150/bin:' # env = gym.make('ModularArm012-v0') env = gym.make('MultiTaskFetchArm4-v5') obs = env.reset() goal = np.array([-1,-1,-1]) task = 2 env.unwrapped.reset_task_goal(goal, task) env.ren...
[ "numpy.zeros", "numpy.array", "gym.make" ]
[((182, 215), 'gym.make', 'gym.make', (['"""MultiTaskFetchArm4-v5"""'], {}), "('MultiTaskFetchArm4-v5')\n", (190, 215), False, 'import gym\n'), ((241, 263), 'numpy.array', 'np.array', (['[-1, -1, -1]'], {}), '([-1, -1, -1])\n', (249, 263), True, 'import numpy as np\n'), ((543, 567), 'numpy.array', 'np.array', (['[1, 0,...
import numpy as np import os import keras from keras.applications import inception_v3, inception_resnet_v2, vgg19 from keras.models import Sequential from keras.layers.core import Dense, Flatten from keras.layers.convolutional import Conv2D from keras.optimizers import Adam def build_model(input_shape, with_one_by_...
[ "keras.layers.core.Dense", "os.rename", "numpy.zeros", "keras.optimizers.Adam", "os.path.exists", "keras.layers.PReLU", "keras.layers.convolutional.Conv2D", "keras.layers.core.Flatten", "keras.models.Sequential" ]
[((486, 498), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (496, 498), False, 'from keras.models import Sequential\n'), ((614, 691), 'keras.layers.convolutional.Conv2D', 'Conv2D', (['n_channels_for_pretrained', '(1)'], {'padding': '"""same"""', 'input_shape': 'input_shape'}), "(n_channels_for_pretrained, ...
import os os.chdir('osmFISH_Ziesel/') import numpy as np import pandas as pd import matplotlib matplotlib.use('qt5agg') matplotlib.rcParams['pdf.fonttype'] = 42 matplotlib.rcParams['ps.fonttype'] = 42 import matplotlib.pyplot as plt import scipy.stats as st from matplotlib.lines import Line2D import pickle...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.lines.Line2D", "pandas.read_csv", "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "scipy.stats.spearmanr", "numpy.isnan", "matplotlib.pyplot.style.use", "matplotlib.use", "pickle.load", "pandas.Series", "numpy.array", ...
[((11, 38), 'os.chdir', 'os.chdir', (['"""osmFISH_Ziesel/"""'], {}), "('osmFISH_Ziesel/')\n", (19, 38), False, 'import os\n'), ((102, 126), 'matplotlib.use', 'matplotlib.use', (['"""qt5agg"""'], {}), "('qt5agg')\n", (116, 126), False, 'import matplotlib\n'), ((546, 622), 'pandas.read_csv', 'pd.read_csv', (['"""Results/...
import numpy as np import jax.numpy as jnp def radial_profile(data): """ Compute the radial profile of 2d image :param data: 2d image :return: radial profile """ center = data.shape[0]/2 y, x = jnp.indices((data.shape)) r = jnp.sqrt((x - center)**2 + (y - center)**2) r = r.astype('int32') tbin = j...
[ "numpy.meshgrid", "jax.numpy.fft.fft2", "numpy.fft.fftfreq", "numpy.arange", "numpy.int", "jax.numpy.conj", "jax.numpy.indices", "jax.numpy.sqrt", "numpy.sqrt" ]
[((209, 232), 'jax.numpy.indices', 'jnp.indices', (['data.shape'], {}), '(data.shape)\n', (220, 232), True, 'import jax.numpy as jnp\n'), ((241, 288), 'jax.numpy.sqrt', 'jnp.sqrt', (['((x - center) ** 2 + (y - center) ** 2)'], {}), '((x - center) ** 2 + (y - center) ** 2)\n', (249, 288), True, 'import jax.numpy as jnp\...
""" This module illustrates how to generate a three-dimensional plot and a contour plot. For the example, the f(x,y) = x**2 * y**3 will be reproduced. """ import numpy as np import matplotlib.pyplot as plt from mpl_toolkits import mplot3d X = np.linspace(-2, 2) Y = np.linspace(-1, 1) x, y = np.meshgrid(X, Y) z = x...
[ "numpy.meshgrid", "matplotlib.pyplot.show", "matplotlib.pyplot.figure", "numpy.linspace", "matplotlib.pyplot.subplots" ]
[((247, 265), 'numpy.linspace', 'np.linspace', (['(-2)', '(2)'], {}), '(-2, 2)\n', (258, 265), True, 'import numpy as np\n'), ((270, 288), 'numpy.linspace', 'np.linspace', (['(-1)', '(1)'], {}), '(-1, 1)\n', (281, 288), True, 'import numpy as np\n'), ((297, 314), 'numpy.meshgrid', 'np.meshgrid', (['X', 'Y'], {}), '(X, ...
import os import inspect import numpy as np from scipy.sparse import coo_matrix from composites.laminate import read_stack from structsolve import solve from meshless.espim.read_mesh import read_mesh from meshless.espim.plate2d_calc_k0 import calc_k0 from meshless.espim.plate2d_add_k0s import add_k0s THISDIR = os.pa...
[ "numpy.lexsort", "meshless.espim.plate2d_calc_k0.calc_k0", "numpy.zeros", "numpy.indices", "scipy.sparse.coo_matrix", "composites.laminate.read_stack", "structsolve.solve", "inspect.currentframe", "os.path.join", "meshless.espim.plate2d_add_k0s.add_k0s" ]
[((535, 588), 'composites.laminate.read_stack', 'read_stack', (['[0]'], {'plyt': 'plyt', 'laminaprop': '(E11, E11, nu)'}), '([0], plyt=plyt, laminaprop=(E11, E11, nu))\n', (545, 588), False, 'from composites.laminate import read_stack\n'), ((347, 369), 'inspect.currentframe', 'inspect.currentframe', ([], {}), '()\n', (...
""" A Reccurent Neural Network (LSTM) implementation example using TensorFlow library """ import AlphaBase import os import tensorflow as tf #from tensorflow.models.rnn import rnn, rnn_cell import numpy as np import LanguageSource as LanguageSource import LangTestData as langTestData # Get training data lang_data_dir...
[ "tensorflow.reshape", "tensorflow.matmul", "os.path.isfile", "AlphaBase.AlphaBase.load_object_from_file", "tensorflow.split", "AlphaBase.AlphaBase", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.placeholder", "LangTestData.LangTestData", "tensorflow.nn.rnn_cell.BasicLSTMCell", "...
[((416, 447), 'os.path.isfile', 'os.path.isfile', (['alpha_file_name'], {}), '(alpha_file_name)\n', (430, 447), False, 'import os\n'), ((808, 848), 'LanguageSource.LanguageSource', 'LanguageSource.LanguageSource', (['alpha_set'], {}), '(alpha_set)\n', (837, 848), True, 'import LanguageSource as LanguageSource\n'), ((13...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Apr 18 18:20:34 2020 @author: ishidaira """ from cvxopt import matrix import numpy as np from numpy import linalg import cvxopt from numpy import linalg as LA from sklearn import preprocessing from imblearn.over_sampling import SMOTE import pandas as p...
[ "numpy.sum", "numpy.ravel", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.MinMaxScaler", "numpy.ones", "numpy.mean", "numpy.linalg.norm", "numpy.exp", "pandas.DataFrame", "numpy.identity", "fsvmClass.HYP_SVM", "cvxopt.solvers.qp", "cvxopt.matrix", ...
[((643, 657), 'numpy.dot', 'np.dot', (['x1', 'x2'], {}), '(x1, x2)\n', (649, 657), True, 'import numpy as np\n'), ((838, 851), 'numpy.asarray', 'np.asarray', (['x'], {}), '(x)\n', (848, 851), True, 'import numpy as np\n'), ((860, 873), 'numpy.asarray', 'np.asarray', (['y'], {}), '(y)\n', (870, 873), True, 'import numpy...
from unittest import TestCase import moderngl import numpy import platform class ContextTests(TestCase): def test_create_destroy(self): """Create and destroy a context""" for _ in range(25): ctx = moderngl.create_context(standalone=True) ctx.release() def test_context...
[ "platform.system", "numpy.array", "moderngl.create_context" ]
[((400, 440), 'moderngl.create_context', 'moderngl.create_context', ([], {'standalone': '(True)'}), '(standalone=True)\n', (423, 440), False, 'import moderngl\n'), ((456, 496), 'moderngl.create_context', 'moderngl.create_context', ([], {'standalone': '(True)'}), '(standalone=True)\n', (479, 496), False, 'import moderng...
import gym import random import numpy as np from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Flatten from tensorflow.keras.optimizers import Adam from rl.agents import DQNAgent from rl.policy import BoltzmannQPolicy from rl.memory import SequentialMemory env = gym.make('CartPol...
[ "rl.memory.SequentialMemory", "gym.make", "tensorflow.keras.layers.Dense", "rl.policy.BoltzmannQPolicy", "numpy.mean", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.models.Sequential", "rl.agents.DQNAgent", "tensorflow.keras.layers.Flatten" ]
[((303, 326), 'gym.make', 'gym.make', (['"""CartPole-v1"""'], {}), "('CartPole-v1')\n", (311, 326), False, 'import gym\n'), ((504, 516), 'tensorflow.keras.models.Sequential', 'Sequential', ([], {}), '()\n', (514, 516), False, 'from tensorflow.keras.models import Sequential\n'), ((821, 839), 'rl.policy.BoltzmannQPolicy'...
import os import pickle import random import numpy as np from carla.env.env_rendering import EnvRenderer, get_gt_factors from carla.train_agent import env_fnc from PIL import Image from tqdm import tqdm def check_dir(directory): if not os.path.exists(directory): print('{} not exist. calling mkdir!'.fo...
[ "pickle.dump", "os.makedirs", "argparse.ArgumentParser", "carla.env.env_rendering.EnvRenderer", "numpy.argmax", "os.path.exists", "carla.train_agent.env_fnc", "carla.env.env_rendering.get_gt_factors", "random.choice", "numpy.random.randint", "PIL.Image.fromarray", "os.path.join" ]
[((431, 456), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (454, 456), False, 'import argparse\n'), ((1661, 1793), 'carla.env.env_rendering.EnvRenderer', 'EnvRenderer', ([], {'total_objects': 'total_objects', 'grid_size': 'args.grid_size', 'tile_size': 'args.tile_size', 'context_config': 'arg...
#!/usr/bin/env python # coding: utf-8 from nltk.tokenize import sent_tokenize from nltk import word_tokenize from sklearn.model_selection import train_test_split from nltk.stem.snowball import SnowballStemmer from sklearn.preprocessing import StandardScaler from sklearn.model_selection import KFold from sklearn.featur...
[ "pandas.DataFrame", "numpy.random.choice", "nltk.stem.snowball.SnowballStemmer", "sklearn.metrics.confusion_matrix", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.naive_bayes.MultinomialNB", "nltk.stem.WordNetLemmatizer", "sklearn.model_selection.train_test_split", "sklearn.metrics.acc...
[((1878, 1904), 'nltk.stem.snowball.SnowballStemmer', 'SnowballStemmer', (['"""english"""'], {}), "('english')\n", (1893, 1904), False, 'from nltk.stem.snowball import SnowballStemmer\n'), ((2142, 2171), 'nltk.stem.WordNetLemmatizer', 'nltk.stem.WordNetLemmatizer', ([], {}), '()\n', (2169, 2171), False, 'import nltk\n'...
import datetime import pytest from fuzzyfields import Timestamp, MalformedFieldError from . import has_pandas, requires_pandas if has_pandas: import numpy import pandas else: class numpy: @classmethod def datetime64(cls, x): pass class pandas: @classmethod d...
[ "fuzzyfields.Timestamp", "numpy.datetime64", "datetime.datetime", "pytest.raises", "pandas.to_datetime", "pytest.mark.parametrize" ]
[((381, 510), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""value"""', "['not a date', '10/notAMonth/2016', '2016-00-01', '2016-13-13',\n '2016-01-00', '2016-02-30']"], {}), "('value', ['not a date', '10/notAMonth/2016',\n '2016-00-01', '2016-13-13', '2016-01-00', '2016-02-30'])\n", (404, 510), Fals...
from .filters import Filter import numpy as np from astropy.io import fits from scipy.constants import c class SED: """ Represents an SED Wavelength is given in micron, Fnu is in Jy. """ def __init__(self, wavelengths, fnu, ferr=None): if (ferr is not None) and (len(ferr.shape) > 1) a...
[ "numpy.square", "numpy.array", "astropy.io.fits.open" ]
[((564, 585), 'numpy.array', 'np.array', (['wavelengths'], {}), '(wavelengths)\n', (572, 585), True, 'import numpy as np\n'), ((605, 618), 'numpy.array', 'np.array', (['fnu'], {}), '(fnu)\n', (613, 618), True, 'import numpy as np\n'), ((2210, 2229), 'astropy.io.fits.open', 'fits.open', (['filename'], {}), '(filename)\n...
import tensorflow as tf import numpy as np def load_cifar10(num_batch_train, num_batch_test, mode='RGB'): """Load CIFAR-10 dataset with Tensorflow built-in function. Generate and shuffle CIFAR-10 iterators via using tf.data.Data. :param num_batch_train: An integer. :param num_batch_test: An integer. ...
[ "tensorflow.ones", "tensorflow.sin", "tensorflow.reshape", "tensorflow.image.rgb_to_hsv", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.stack", "tensorflow.cast", "numpy.argsort", "tensorflow.zeros", "tensorflow.multiply", "numpy.loadtxt", "tensorflow.atan", "tensorflow.cos", "...
[((725, 774), 'tensorflow.image.convert_image_dtype', 'tf.image.convert_image_dtype', (['x_train', 'tf.float32'], {}), '(x_train, tf.float32)\n', (753, 774), True, 'import tensorflow as tf\n'), ((788, 836), 'tensorflow.image.convert_image_dtype', 'tf.image.convert_image_dtype', (['x_test', 'tf.float32'], {}), '(x_test,...
#!/usr/bin/env python import matplotlib import matplotlib.pyplot as plt import numpy import os from cycler import cycler # Set matplotlib defaults to agree with MATLAB code plt.rc("legend", framealpha=None) plt.rc("legend", edgecolor='black') plt.rc("font", family="serif") # Following option for TeX text seems to not...
[ "matplotlib.pyplot.loglog", "matplotlib.pyplot.subplot", "cycler.cycler", "numpy.abs", "matplotlib.pyplot.plot", "numpy.log2", "matplotlib.pyplot.legend", "matplotlib.pyplot.axis", "numpy.argsort", "matplotlib.pyplot.figure", "numpy.array", "matplotlib.pyplot.rc", "os.path.splitext", "matp...
[((175, 208), 'matplotlib.pyplot.rc', 'plt.rc', (['"""legend"""'], {'framealpha': 'None'}), "('legend', framealpha=None)\n", (181, 208), True, 'import matplotlib.pyplot as plt\n'), ((209, 244), 'matplotlib.pyplot.rc', 'plt.rc', (['"""legend"""'], {'edgecolor': '"""black"""'}), "('legend', edgecolor='black')\n", (215, 2...
import os import numpy as np import matplotlib.pyplot as plt from skimage.color import rgb2xyz import cv2 import warnings def svd_trunc(I): U, S, V_T = np.linalg.svd(I, full_matrices=False) U = U * S U = U[:,:3] V_T = V_T[:3,:] return U, V_T def set_mesh(px_size=7e-4, res=(100, 100)): [X, Y] ...
[ "os.mkdir", "numpy.load", "numpy.einsum", "numpy.linalg.svd", "numpy.linalg.norm", "numpy.arange", "numpy.sin", "matplotlib.pyplot.imsave", "numpy.tile", "numpy.fft.ifft2", "numpy.fft.ifftshift", "warnings.simplefilter", "numpy.max", "warnings.catch_warnings", "numpy.real", "numpy.lins...
[((157, 194), 'numpy.linalg.svd', 'np.linalg.svd', (['I'], {'full_matrices': '(False)'}), '(I, full_matrices=False)\n', (170, 194), True, 'import numpy as np\n'), ((701, 710), 'numpy.max', 'np.max', (['X'], {}), '(X)\n', (707, 710), True, 'import numpy as np\n'), ((723, 732), 'numpy.max', 'np.max', (['Y'], {}), '(Y)\n'...
""" Utililities =========== This module holds all the core utility functions used throughout the library. These functions are intended to simplify common tasks and to make their output and functionality consistent where needed. """ import json import os from typing import Dict, List import numpy as np # type: igno...
[ "os.remove", "frewpy.models.exceptions.FrewError", "os.path.exists", "numpy.array", "comtypes.client.CreateObject", "frewpy.models.exceptions.NodeError" ]
[((7631, 7690), 'frewpy.models.exceptions.NodeError', 'NodeError', (['"""Number of nodes is not unique for every stage."""'], {}), "('Number of nodes is not unique for every stage.')\n", (7640, 7690), False, 'from frewpy.models.exceptions import FrewError, NodeError\n'), ((580, 619), 'frewpy.models.exceptions.FrewError...
#!/usr/bin/env python # Author: <NAME> (<EMAIL>) ########################## # Plotting configuration ########################## from XtDac.DivideAndConquer import matplotlibConfig # Use a matplotlib backend which does not show plots to the user # (they will be saved in files) import matplotlib matplotlib.use("Agg"...
[ "matplotlib.pyplot.savefig", "argparse.ArgumentParser", "XtDac.FixedBinSearch.Likelihood.PointSource", "numpy.argsort", "XtDac.DivideAndConquer.XMMWCS.XMMWCS", "os.path.isfile", "XtDac.DivideAndConquer.TimeIntervalConsolidator.TimeIntervalConsolidator", "XtDac.DivideAndConquer.Results.Summary", "XtD...
[((300, 321), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (314, 321), False, 'import matplotlib\n'), ((334, 362), 'XtDac.DivideAndConquer.matplotlibConfig.getConfig', 'matplotlibConfig.getConfig', ([], {}), '()\n', (360, 362), False, 'from XtDac.DivideAndConquer import matplotlibConfig\n'), ((...
from numpy.core.numeric import outer import torch from torch import log, mean, nn import torch.nn.functional as F import numpy as np class VGAE_Encoder(nn.Module): def __init__(self, n_in, n_hid, n_out, adj=None): super(VGAE_Encoder, self).__init__() self.n_out = n_out self.base_gcn = Gra...
[ "torch.nn.Parameter", "torch.nn.Dropout", "torch.nn.ReLU", "torch.rand", "torch.nn.Tanh", "torch.nn.init.xavier_normal_", "torch.mm", "torch.spmm", "torch.exp", "torch.nn.ELU", "torch.nn.functional.hardtanh", "torch.nn.Linear", "torch.nn.functional.relu", "numpy.sqrt" ]
[((8286, 8325), 'numpy.sqrt', 'np.sqrt', (['(6.0 / (input_dim + output_dim))'], {}), '(6.0 / (input_dim + output_dim))\n', (8293, 8325), True, 'import numpy as np\n'), ((8409, 8430), 'torch.nn.Parameter', 'nn.Parameter', (['initial'], {}), '(initial)\n', (8421, 8430), False, 'from torch import log, mean, nn\n'), ((1170...
""" Find a nearby root of the coupled radial/angular Teukolsky equations. TODO Documentation. """ from __future__ import division, print_function, absolute_import import logging import numpy as np from scipy import optimize from .angular import sep_const_closest, C_and_sep_const_closest from . import radial # TOD...
[ "numpy.finfo", "numpy.imag", "numpy.array", "numpy.real", "numpy.prod" ]
[((3914, 3926), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (3922, 3926), True, 'import numpy as np\n'), ((4322, 4334), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (4330, 4334), True, 'import numpy as np\n'), ((5821, 5848), 'numpy.prod', 'np.prod', (['(omega - self.poles)'], {}), '(omega - self.poles)\n',...
import glob, os, pickle, datetime, time, re, pprint import matplotlib.pyplot as plt import numpy as np from src import plotter, graphs from src.mltoolbox.metrics import METRICS from src.utils import * from shutil import copyfile, rmtree def main(): # SETUP BEGIN """ x01 : reg only uniform edges avg on 8 ...
[ "pickle.dump", "numpy.sum", "os.makedirs", "numpy.savetxt", "os.path.exists", "re.match", "time.time", "src.graphs.generate_n_nodes_graphs_list", "pprint.PrettyPrinter", "pickle.load", "glob.escape", "numpy.loadtxt", "shutil.rmtree", "os.path.join", "re.compile" ]
[((562, 578), 're.compile', 're.compile', (['""".*"""'], {}), "('.*')\n", (572, 578), False, 'import glob, os, pickle, datetime, time, re, pprint\n'), ((5525, 5604), 'src.graphs.generate_n_nodes_graphs_list', 'graphs.generate_n_nodes_graphs_list', (["setup['n']", 'new_ordered_setup_graphs_names'], {}), "(setup['n'], ne...
import numpy as np from skimage.metrics import structural_similarity, peak_signal_noise_ratio import functools # Data format: H W C __all__ = [ 'psnr', 'ssim', 'sam', 'ergas', 'mpsnr', 'mssim', 'mpsnr_max' ] def psnr(output, target, data_range=1): return peak_signal_noise_ratio(targe...
[ "numpy.sum", "numpy.amax", "skimage.metrics.structural_similarity", "numpy.mean", "numpy.real", "functools.wraps", "numpy.log10", "skimage.metrics.peak_signal_noise_ratio", "numpy.sqrt" ]
[((291, 353), 'skimage.metrics.peak_signal_noise_ratio', 'peak_signal_noise_ratio', (['target', 'output'], {'data_range': 'data_range'}), '(target, output, data_range=data_range)\n', (314, 353), False, 'from skimage.metrics import structural_similarity, peak_signal_noise_ratio\n'), ((399, 458), 'skimage.metrics.structu...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on %(date)s @author: <NAME> """ import pandas as pd import numpy as np from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn.neural_network import MLPClassifier from sklearn.metrics import mean_squared_error # Po...
[ "pandas.read_csv", "sklearn.model_selection.train_test_split", "imblearn.over_sampling.RandomOverSampler", "sklearn.preprocessing.normalize", "sklearn.neural_network.MLPClassifier", "sklearn.metrics.mean_squared_error", "numpy.concatenate" ]
[((787, 839), 'pandas.read_csv', 'pd.read_csv', (['"""../../Data/WeatherOutagesAllJerry.csv"""'], {}), "('../../Data/WeatherOutagesAllJerry.csv')\n", (798, 839), True, 'import pandas as pd\n'), ((997, 1052), 'sklearn.model_selection.train_test_split', 'train_test_split', (['data'], {'test_size': '(0.1)', 'random_state'...
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to us...
[ "numpy.random.randn", "numpy.cross", "numpy.sin", "numpy.linalg.norm", "numpy.array", "numpy.cos", "numpy.arccos" ]
[((1393, 1433), 'numpy.array', 'np.array', (['[each[0][0] for each in batch]'], {}), '([each[0][0] for each in batch])\n', (1401, 1433), True, 'import numpy as np\n'), ((1480, 1520), 'numpy.array', 'np.array', (['[each[0][1] for each in batch]'], {}), '([each[0][1] for each in batch])\n', (1488, 1520), True, 'import nu...
# coding=utf-8 # Copyright 2018 The DisentanglementLib 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 # # Un...
[ "numpy.stack", "cv2.circle", "six.moves.range", "numpy.float32", "numpy.zeros", "cv2.warpAffine", "numpy.sin", "numpy.arange", "numpy.cos", "gin.configurable", "numpy.sqrt" ]
[((1125, 1156), 'gin.configurable', 'gin.configurable', (['"""translation"""'], {}), "('translation')\n", (1141, 1156), False, 'import gin\n'), ((1005, 1022), 'numpy.zeros', 'np.zeros', (['x.shape'], {}), '(x.shape)\n', (1013, 1022), True, 'import numpy as np\n'), ((1097, 1107), 'numpy.sqrt', 'np.sqrt', (['(3)'], {}), ...
import PyQt5 import os import imutils import cv2 import numpy as np from PIL import Image as im from PyQt5 import QtWidgets, uic, QtGui from PyQt5.QtGui import QGuiApplication import sys #Image augmentation GUI App def contour_crop_no_resize(image,dim): ''' Contour and crop the image (generally...
[ "cv2.GaussianBlur", "os.walk", "numpy.ones", "PyQt5.uic.loadUi", "cv2.warpAffine", "PyQt5.QtWidgets.QApplication", "cv2.erode", "cv2.getRotationMatrix2D", "cv2.subtract", "cv2.filter2D", "cv2.dilate", "cv2.cvtColor", "os.path.exists", "cv2.resize", "PyQt5.QtGui.QPixmap", "imutils.grab_...
[((38929, 38961), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (38951, 38961), False, 'from PyQt5 import QtWidgets, uic, QtGui\n'), ((422, 474), 'cv2.resize', 'cv2.resize', (['image', 'dim'], {'interpolation': 'cv2.INTER_AREA'}), '(image, dim, interpolation=cv2.INTER_ARE...
"""Testing for Showalter Index only. While MetPy handles all five parameters, the Showalter Index was contributed to MetPy by the GeoCAT team because of the skewt_params function. Additionally, a discrepancy between NCL and MetPy calculations of CAPE has been identified. After validating the CAPE value by hand using th...
[ "metpy.calc.parcel_profile", "xarray.open_dataset", "geocat.datafiles.get", "geocat.comp.showalter_index", "geocat.comp.get_skewt_vars", "numpy.testing.assert_equal", "numpy.round" ]
[((1864, 1885), 'numpy.round', 'np.round', (["out['Shox']"], {}), "(out['Shox'])\n", (1872, 1885), True, 'import numpy as np\n'), ((1207, 1247), 'geocat.datafiles.get', 'gdf.get', (['"""ascii_files/sounding.testdata"""'], {}), "('ascii_files/sounding.testdata')\n", (1214, 1247), True, 'import geocat.datafiles as gdf\n'...
import grblas import numba import numpy as np from typing import Union, Tuple from .container import Flat, Pivot from .schema import SchemaMismatchError from .oputils import jitted_op class SizeMismatchError(Exception): pass # Sentinel to indicate the fill values come from the object to which we are aligning _f...
[ "grblas.Vector.new", "numpy.zeros", "grblas.Matrix.new", "grblas.dtypes.lookup_dtype", "grblas.Matrix.from_values" ]
[((7765, 7834), 'grblas.Matrix.from_values', 'grblas.Matrix.from_values', (['index', 'index', 'vals'], {'nrows': 'size', 'ncols': 'size'}), '(index, index, vals, nrows=size, ncols=size)\n', (7790, 7834), False, 'import grblas\n'), ((9584, 9635), 'grblas.Matrix.new', 'grblas.Matrix.new', (['x.vector.dtype', 'x.vector.si...
import torch import librosa import numpy as np import mlflow.pytorch import torch.nn.functional as F import matplotlib.pyplot as plt from librosa.feature import mfcc def predict(model, x): n_mfcc = 40 sample_rate = 22050 mel_coefficients = mfcc(x, sample_rate, n_mfcc=n_mfcc) time_frames = mel_coeff...
[ "numpy.pad", "numpy.stack", "matplotlib.pyplot.show", "numpy.ceil", "torch.argmax", "torch.FloatTensor", "matplotlib.pyplot.subplots", "numpy.split", "torch.squeeze", "librosa.load", "torch.reshape", "librosa.feature.mfcc" ]
[((257, 292), 'librosa.feature.mfcc', 'mfcc', (['x', 'sample_rate'], {'n_mfcc': 'n_mfcc'}), '(x, sample_rate, n_mfcc=n_mfcc)\n', (261, 292), False, 'from librosa.feature import mfcc\n'), ((443, 505), 'numpy.pad', 'np.pad', (['mel_coefficients', '((0, 0), (0, pad_size))'], {'mode': '"""wrap"""'}), "(mel_coefficients, ((...
import numpy as np from sklearn.preprocessing import Imputer, StandardScaler from matplotlib import pyplot as plt data = np.load('sample.npy') # Plot raw data. plt.figure(1) plt.plot(data) # Impute missing values. imputer = Imputer() data = imputer.fit_transform(data) plt.figure(2) plt.plot(data) # Scale data. sca...
[ "numpy.load", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "sklearn.preprocessing.Imputer", "matplotlib.pyplot.figure" ]
[((122, 143), 'numpy.load', 'np.load', (['"""sample.npy"""'], {}), "('sample.npy')\n", (129, 143), True, 'import numpy as np\n'), ((162, 175), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (172, 175), True, 'from matplotlib import pyplot as plt\n'), ((176, 190), 'matplotlib.pyplot.plot', 'plt.plot',...
# 3rd party modules import gym import numpy as np import subprocess import os from gym import spaces from basilisk_env.simulators import opNavSimulator class opNavEnv(gym.Env): """ OpNav scenario. The spacecraft must decide when to point at the ground (which generates a reward) versus pointing at the su...
[ "numpy.random.seed", "basilisk_env.simulators.opNavSimulator.scenario_OpNav", "gym.spaces.Discrete", "numpy.zeros", "numpy.array", "gym.spaces.Box", "numpy.linalg.norm" ]
[((1050, 1085), 'gym.spaces.Box', 'spaces.Box', (['low', 'high'], {'shape': '(4, 1)'}), '(low, high, shape=(4, 1))\n', (1060, 1085), False, 'from gym import spaces\n'), ((1103, 1116), 'numpy.zeros', 'np.zeros', (['[4]'], {}), '([4])\n', (1111, 1116), True, 'import numpy as np\n'), ((1146, 1160), 'numpy.zeros', 'np.zero...
import os import random import sys import numpy as np import pytest sys.path.append(os.path.join(os.path.dirname(__file__))) sys.path.append("\\".join(os.path.dirname(__file__).split("\\")[:-2])) sys.path.append(os.path.join(os.path.dirname(__file__), "../../")) from src.distributed_reflectors.reflector import Refl...
[ "src.distributed_reflectors.reflector.Reflector", "numpy.random.randn", "os.path.dirname", "numpy.testing.assert_allclose", "numpy.array", "numpy.testing.assert_equal", "pytest.mark.parametrize", "numpy.sqrt" ]
[((1387, 1600), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""particle_coordinates,length,reflector_coordinates,expected_collisions,expected_new_coordinates"""', '[straight_collision_and_clear_miss, barely_misses, near_misses_but_hit, hit]'], {}), "(\n 'particle_coordinates,length,reflector_coordinates...
import random from typing import List, Tuple, Union import numpy as np from srl.base.define import ContinuousAction, DiscreteAction, DiscreteSpaceType, RLObservation from srl.base.env.spaces.box import BoxSpace class ArrayContinuousSpace(BoxSpace): def __init__( self, size: int, low: Unio...
[ "numpy.asarray" ]
[((1716, 1731), 'numpy.asarray', 'np.asarray', (['val'], {}), '(val)\n', (1726, 1731), True, 'import numpy as np\n'), ((2055, 2070), 'numpy.asarray', 'np.asarray', (['val'], {}), '(val)\n', (2065, 2070), True, 'import numpy as np\n')]
#!/usr/bin/env python3 import collections import glob import os import pandas as pd import numpy as np import torch.nn.functional as F import PIL.Image as Image from inference.base_image_utils import get_scale_size, image2batch, choose_center_full_size_crop_params from inference.metrics.fid.fid_score import _compute_...
[ "inference.base_image_utils.image2batch", "inference.perspective.load_video_frames_from_folder", "argparse.ArgumentParser", "collections.defaultdict", "numpy.mean", "inference.encode_and_animate.sum_dicts", "os.path.join", "pandas.DataFrame", "inference.base_image_utils.get_scale_size", "os.path.d...
[((3471, 3596), 'inference.metrics.fid.fid_score._compute_statistics_of_images', '_compute_statistics_of_images', (['gt_frames_as_img', 'fid_model'], {'batch_size': 'args.batch', 'dims': '(2048)', 'cuda': '(True)', 'keep_size': '(False)'}), '(gt_frames_as_img, fid_model, batch_size=args.\n batch, dims=2048, cuda=Tru...
import numpy as np def CheckScore(board): Win = Loss = Tie = False zeros = np.where(board == 0) if np.all(board[0,0:3] == 1) or np.all(board[1,0:3] == 1) or np.all(board[2,0:3] == 1): Win = True elif np.all(board[0:3,0] == 1) or np.all(board[0:3,1] == 1) or np.all(board[0:3,2] == 1): Wi...
[ "numpy.where", "numpy.all" ]
[((84, 104), 'numpy.where', 'np.where', (['(board == 0)'], {}), '(board == 0)\n', (92, 104), True, 'import numpy as np\n'), ((112, 138), 'numpy.all', 'np.all', (['(board[0, 0:3] == 1)'], {}), '(board[0, 0:3] == 1)\n', (118, 138), True, 'import numpy as np\n'), ((141, 167), 'numpy.all', 'np.all', (['(board[1, 0:3] == 1)...
#!/usr/bin/python3 # # Monitor GUI for an array of CBRS boards to watch power levels # and temperature across time along with a user-controlled # value for frequency, gain, and others. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # INCLUDING BUT NOT LIMITED TO T...
[ "PyQt5.QtCore.pyqtSignal", "numpy.abs", "PyQt5.QtWidgets.QMainWindow.__init__", "numpy.argmax", "PyQt5.QtWidgets.QDockWidget.__init__", "PyQt5.QtWidgets.QVBoxLayout", "PyQt5.QtWidgets.QApplication", "sklk_widgets.FreqEntryWidget", "PyQt5.QtWidgets.QLabel", "PyQt5.QtWidgets.QWidget", "PyQt5.QtCor...
[((3545, 3561), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['dict'], {}), '(dict)\n', (3555, 3561), False, 'from PyQt5.QtCore import pyqtSignal\n'), ((6522, 6540), 'sklk_widgets.LogPowerFFT', 'LogPowerFFT', (['samps'], {}), '(samps)\n', (6533, 6540), False, 'from sklk_widgets import LogPowerFFT\n'), ((7292, 7302), 'nump...
#!/usr/bin/env python3 import numpy as np from computeCostMulti import computeCostMulti def gradientDescentMulti(X, y, theta, alpha, num_iters): #GRADIENTDESCENTMULTI Performs gradient descent to learn theta # theta = GRADIENTDESCENTMULTI(x, y, theta, alpha, num_iters) updates theta by # taking num_...
[ "numpy.dot", "numpy.zeros", "computeCostMulti.computeCostMulti" ]
[((479, 503), 'numpy.zeros', 'np.zeros', (['(num_iters, 1)'], {}), '((num_iters, 1))\n', (487, 503), True, 'import numpy as np\n'), ((1147, 1176), 'computeCostMulti.computeCostMulti', 'computeCostMulti', (['X', 'y', 'theta'], {}), '(X, y, theta)\n', (1163, 1176), False, 'from computeCostMulti import computeCostMulti\n'...
##technically, this means that I don't have to force floats in my division from __future__ import division, absolute_import ##this makes the plot lines thicker, darker, etc. from matplotlib import rc,rcParams rc('text', usetex=True) rc('axes', linewidth=2) rc('font', weight='bold') ##importing the needed modules impo...
[ "matplotlib.rc", "numpy.nanmedian", "pandas.read_csv", "numpy.argsort", "numpy.histogram", "numpy.arange", "scipy.spatial.cKDTree", "numpy.unique", "numpy.nanmean", "os.path.exists", "numpy.isfinite", "numpy.max", "matplotlib.pyplot.subplots", "numpy.radians", "matplotlib.pyplot.show", ...
[((210, 233), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (212, 233), False, 'from matplotlib import rc, rcParams\n'), ((234, 257), 'matplotlib.rc', 'rc', (['"""axes"""'], {'linewidth': '(2)'}), "('axes', linewidth=2)\n", (236, 257), False, 'from matplotlib import rc, rcPar...
import matplotlib.pyplot as plt import numpy as np def plotLine(c0, c1, ax): t = np.linspace(0, 1, 11) c = (c1 - c0) * t + c0 ax.plot(c.real, c.imag) def plotCircle(c0, r, ax): t = np.linspace(0, 1, 1001) * 2 * np.pi s = c0 + r * np.exp(1j * t) ax.plot(s.real, s.imag) def plotEllipse(c0, a...
[ "numpy.fmax", "numpy.abs", "numpy.sum", "matplotlib.pyplot.gca", "numpy.hstack", "numpy.imag", "matplotlib.pyplot.figure", "numpy.array", "numpy.exp", "numpy.real", "numpy.linspace", "waveforms.math.fit.mult_gaussian_pdf", "waveforms.math.fit.get_threshold_info" ]
[((87, 108), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(11)'], {}), '(0, 1, 11)\n', (98, 108), True, 'import numpy as np\n'), ((387, 403), 'numpy.exp', 'np.exp', (['(1.0j * t)'], {}), '(1.0j * t)\n', (393, 403), True, 'import numpy as np\n'), ((684, 710), 'waveforms.math.fit.get_threshold_info', 'get_threshold_...
import lorm from lorm.manif import Sphere2 from lorm.funcs import ManifoldObjectiveFunction from nfft import nfsft import numpy as np import copy as cp class plan(ManifoldObjectiveFunction): def __init__(self, M, N, alpha, L, equality_constraint=False, closed=True): ''' plan for computing the (poly...
[ "numpy.sum", "nfft.nfsft.plan", "numpy.zeros", "nfft.nfsft.SphericalFourierCoefficients", "lorm.manif.Sphere2", "numpy.ones", "numpy.sin", "numpy.linalg.norm", "numpy.cos", "numpy.sqrt" ]
[((765, 781), 'nfft.nfsft.plan', 'nfsft.plan', (['M', 'N'], {}), '(M, N)\n', (775, 781), False, 'from nfft import nfsft\n'), ((809, 846), 'nfft.nfsft.SphericalFourierCoefficients', 'nfsft.SphericalFourierCoefficients', (['N'], {}), '(N)\n', (843, 846), False, 'from nfft import nfsft\n'), ((964, 1001), 'nfft.nfsft.Spher...
# Copyright 2020 The FastEstimator 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 appl...
[ "numpy.allclose", "tensorflow.constant", "fastestimator.backend.exp", "numpy.array", "torch.tensor" ]
[((874, 896), 'numpy.array', 'np.array', (['[-2.0, 2, 1]'], {}), '([-2.0, 2, 1])\n', (882, 896), True, 'import numpy as np\n'), ((911, 928), 'fastestimator.backend.exp', 'fe.backend.exp', (['n'], {}), '(n)\n', (925, 928), True, 'import fastestimator as fe\n'), ((944, 989), 'numpy.array', 'np.array', (['[0.13533528, 7.3...
# (c) 2019-2021, <NAME> @ ETH Zurich # Computer-assisted Applications in Medicine (CAiM) Group, Prof. <NAME> import tensorflow as tf import numpy as np import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) class DiceLoss(tf.losses.Loss): """ Dice loss References ----...
[ "tensorflow.reduce_sum", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.argmax", "tensorflow.reshape", "tensorflow.reduce_mean", "tensorflow.multiply", "tensorflow.shape", "numpy.array", "logging.getLogger" ]
[((181, 208), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (198, 208), False, 'import logging\n'), ((2124, 2155), 'tensorflow.multiply', 'tf.multiply', (['prediction', 'labels'], {}), '(prediction, labels)\n', (2135, 2155), True, 'import tensorflow as tf\n'), ((2570, 2618), 'tensorflow....
__version__ = '1.0.0-rc.1' __author__ = '<NAME>, <NAME>, <NAME>, <NAME>' import json import os import random import numpy as np import torch from transformers import AutoTokenizer from rate_severity_of_toxic_comments.dataset import AVAILABLE_DATASET_TYPES from rate_severity_of_toxic_comments.embedding import AVAILA...
[ "rate_severity_of_toxic_comments.tokenizer.NaiveTokenizer", "json.load", "numpy.random.seed", "rate_severity_of_toxic_comments.tokenizer.create_recurrent_model_tokenizer", "torch.manual_seed", "os.path.exists", "torch.cuda.manual_seed", "transformers.AutoTokenizer.from_pretrained", "random.seed", ...
[((825, 848), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (842, 848), False, 'import torch\n'), ((853, 873), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (867, 873), True, 'import numpy as np\n'), ((878, 895), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (889...
from pymc import * from numpy import ones, array n = 5*ones(4,dtype=int) dose=array([-.86,-.3,-.05,.73]) @stochastic def alpha(value=-1.): return 0. @stochastic def beta(value=10.): return 0. @deterministic def theta(a=alpha, b=beta, d=dose): """theta = inv_logit(a+b)""" return invlogit(a+b*d) @obs...
[ "numpy.array", "numpy.ones" ]
[((79, 112), 'numpy.array', 'array', (['[-0.86, -0.3, -0.05, 0.73]'], {}), '([-0.86, -0.3, -0.05, 0.73])\n', (84, 112), False, 'from numpy import ones, array\n'), ((56, 74), 'numpy.ones', 'ones', (['(4)'], {'dtype': 'int'}), '(4, dtype=int)\n', (60, 74), False, 'from numpy import ones, array\n'), ((366, 398), 'numpy.ar...
import numpy as np import matplotlib.pyplot as plt import sys pose_file = sys.argv[1] poses = np.load(pose_file) x, y, z = poses[:30, 0, -1], poses[:30, 1, -1], poses[:30, 2, -1] # Creating figure fig = plt.figure(figsize = (10, 7)) ax = plt.axes(projection ="3d") # Creating plot ax.scatter3D(x, y, z, color = "gree...
[ "matplotlib.pyplot.title", "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.axes", "matplotlib.pyplot.figure" ]
[((95, 113), 'numpy.load', 'np.load', (['pose_file'], {}), '(pose_file)\n', (102, 113), True, 'import numpy as np\n'), ((205, 232), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 7)'}), '(figsize=(10, 7))\n', (215, 232), True, 'import matplotlib.pyplot as plt\n'), ((240, 265), 'matplotlib.pyplot.axes'...
""" In this file, we analyse the action library generated by Teacher1 and Teacher2. Through 1. filtering out actions that decrease rho less effectively 2. filtering out actions that occur less frequently 3. filtering out "do nothing" action 4. add your filtering rules..., we obtain an action space in th...
[ "pandas.read_csv", "numpy.save", "os.path.join", "pandas.value_counts" ]
[((1242, 1281), 'pandas.value_counts', 'pd.value_counts', (["actions['action_list']"], {}), "(actions['action_list'])\n", (1257, 1281), True, 'import pandas as pd\n'), ((1517, 1581), 'os.path.join', 'os.path.join', (['save_path', "('actions%d.npy' % action_space.shape[0])"], {}), "(save_path, 'actions%d.npy' % action_s...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "apache_beam.metrics.Metrics.counter", "logging.exception", "tensorflow.train.Example", "moonlight.util.more_iter_tools.iter_sample", "tensorflow.Session", "numpy.less", "tensorflow.RunOptions", "six.moves.filter" ]
[((1860, 1914), 'apache_beam.metrics.Metrics.counter', 'metrics.Metrics.counter', (['self.__class__', '"""total_pages"""'], {}), "(self.__class__, 'total_pages')\n", (1883, 1914), False, 'from apache_beam import metrics\n'), ((2002, 2057), 'apache_beam.metrics.Metrics.counter', 'metrics.Metrics.counter', (['self.__clas...
from casadi import Opti, sin, cos, tan, vertcat import numpy as np import matplotlib.pyplot as plt def bicycle_robot_model(q, u, L=0.3, dt=0.01): """ Implements the discrete time dynamics of your robot. i.e. this function implements F in q_{t+1} = F(q_{t}, u_{t}) dt is the discretization timestep...
[ "casadi.tan", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "casadi.cos", "numpy.zeros", "matplotlib.pyplot.ylabel", "casadi.sin", "casadi.vertcat", "casadi.Opti", "numpy.array", "numpy.arange", "numpy.linspace", "matplotlib....
[((1314, 1406), 'casadi.vertcat', 'vertcat', (['(x + x_dot * dt)', '(y + y_dot * dt)', '(theta + theta_dot * dt)', '(sigma + sigma_dot * dt)'], {}), '(x + x_dot * dt, y + y_dot * dt, theta + theta_dot * dt, sigma + \n sigma_dot * dt)\n', (1321, 1406), False, 'from casadi import Opti, sin, cos, tan, vertcat\n'), ((25...
# -*- coding: utf-8 -*- """ Created on Wed Nov 18 12:49:59 2020 @author: tonim """ # -*- coding: utf-8 -*- """ Created on Mon Nov 16 09:01:01 2020 Models 1 and 2 @author: Tonima """ #%% Data import and prep import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.r...
[ "matplotlib.pyplot.title", "keras.preprocessing.image.ImageDataGenerator", "numpy.argmax", "keras.layers.MaxPool2D", "keras.optimizers.Adagrad", "keras.models.Model", "sklearn.metrics.classification_report", "keras.preprocessing.image.img_to_array", "matplotlib.pyplot.figure", "numpy.rot90", "py...
[((927, 1015), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'validation_split': '(0.2)', 'rescale': '(1.0 / 255)', 'featurewise_center': '(True)'}), '(validation_split=0.2, rescale=1.0 / 255,\n featurewise_center=True)\n', (945, 1015), False, 'from keras.preprocessing.image import Imag...
from numpy import array2string from numpy import delete from numpy import s_ from numpy import concatenate from keras.models import model_from_json from sklearn.preprocessing import MinMaxScaler from connectDB import ConnectDB import argparse import time class Predict(object): SYMBOL = 0 ID_COIN = 1 def _...
[ "argparse.ArgumentParser", "connectDB.ConnectDB", "numpy.array2string", "sklearn.preprocessing.MinMaxScaler", "time.time", "keras.models.model_from_json", "numpy.delete", "numpy.concatenate" ]
[((2798, 2876), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Forecast coin price with deep learning."""'}), "(description='Forecast coin price with deep learning.')\n", (2821, 2876), False, 'import argparse\n'), ((353, 364), 'connectDB.ConnectDB', 'ConnectDB', ([], {}), '()\n', (362, 3...