code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# Importing the Required libraries import cv2 import numpy as np # Private Required functions def defineTheCoOrdinates(image, lane_paramters): print(lane_paramters) slope, intercept = lane_paramters # Now Defining the co-ordinates Y1 = image.shape[0] # We'll get image height, it means our line should...
[ "cv2.line", "cv2.GaussianBlur", "cv2.Canny", "numpy.zeros_like", "numpy.average", "cv2.bitwise_and", "numpy.polyfit", "cv2.waitKey", "cv2.destroyAllWindows", "cv2.fillPoly", "cv2.addWeighted", "cv2.imread", "numpy.array", "cv2.HoughLinesP", "cv2.imshow" ]
[((8540, 8568), 'cv2.imread', 'cv2.imread', (['"""road_image.jpg"""'], {}), "('road_image.jpg')\n", (8550, 8568), False, 'import cv2\n'), ((8854, 8961), 'cv2.HoughLinesP', 'cv2.HoughLinesP', (['croppedImage'], {'rho': '(1)', 'theta': '(np.pi / 180)', 'threshold': '(100)', 'minLineLength': '(40)', 'maxLineGap': '(50)'})...
import matplotlib.pyplot as plt import matplotlib.font_manager as font_manager from matplotlib.pyplot import rc from jamo import h2j, j2hcj from text import PAD, EOS from text.korean import normalize FONT_NAME = "NanumBarunGothic" def check_font(): flist = font_manager.findSystemFonts() names = [font_manager...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplot", "jamo.h2j", "matplotlib.font_manager.findSystemFonts", "matplotlib.pyplot.show", "matplotlib.font_manager.FontProperties", "text.korean.normalize", "matplotlib.font_manager._rebuild", "matplotlib.pyplot.imsho...
[((460, 488), 'matplotlib.pyplot.rc', 'rc', (['"""font"""'], {'family': 'FONT_NAME'}), "('font', family=FONT_NAME)\n", (462, 488), False, 'from matplotlib.pyplot import rc\n'), ((264, 294), 'matplotlib.font_manager.findSystemFonts', 'font_manager.findSystemFonts', ([], {}), '()\n', (292, 294), True, 'import matplotlib....
import mmcv import numpy as np import pycocotools.mask as maskUtils import torch from mmdet.core import get_classes from mmdet.datasets import to_tensor from mmdet.datasets.transforms import ImageTransform from PIL import Image import cv2 def _prepare_data(img, img_transform, cfg, device): ori_shape = img.shape ...
[ "numpy.load", "pycocotools.mask.decode", "numpy.floor", "numpy.random.randint", "mmdet.datasets.transforms.ImageTransform", "torch.no_grad", "mmcv.imread", "numpy.full", "cv2.cvtColor", "mmdet.core.get_classes", "numpy.save", "numpy.ceil", "mmcv.concat_list", "mmdet.datasets.to_tensor", ...
[((4181, 4197), 'mmcv.imread', 'mmcv.imread', (['img'], {}), '(img)\n', (4192, 4197), False, 'import mmcv\n'), ((4444, 4456), 'numpy.load', 'np.load', (['img'], {}), '(img)\n', (4451, 4456), True, 'import numpy as np\n'), ((4724, 4736), 'numpy.load', 'np.load', (['img'], {}), '(img)\n', (4731, 4736), True, 'import nump...
# -*- coding: utf-8 -*- from datetime import date import numpy as np import csv import requests import random import os.path import pickle import math import tensorflow as tf download_path = '../pickle' import matplotlib.pyplot as plt class Stock: VALID_ACTIONS = [0, 1, -1] def __init__(self): self....
[ "pickle.dump", "csv.reader", "requests.Session", "numpy.zeros", "random.choice", "pickle.load", "numpy.reshape" ]
[((1514, 1563), 'numpy.zeros', 'np.zeros', ([], {'shape': '(2, 2, 2, 2, 400)', 'dtype': 'np.uint8'}), '(shape=(2, 2, 2, 2, 400), dtype=np.uint8)\n', (1522, 1563), True, 'import numpy as np\n'), ((1726, 1759), 'numpy.reshape', 'np.reshape', (['environment', '[80, 80]'], {}), '(environment, [80, 80])\n', (1736, 1759), Tr...
"""Taylor Green vortex flow (5 minutes). """ import numpy as np import os from pysph.base.nnps import DomainManager from pysph.base.utils import get_particle_array from pysph.base.kernels import QuinticSpline from pysph.solver.application import Application from pysph.sph.equation import Group, Equation from pysph.s...
[ "numpy.random.seed", "numpy.abs", "numpy.sum", "matplotlib.pyplot.clf", "pysph.sph.wc.crksph.CRKSPH", "pysph.sph.scheme.SchemeChooser", "pysph.sph.wc.edac.ComputeAveragePressure", "numpy.arange", "numpy.exp", "os.path.join", "pysph.sph.wc.crksph.CRKSPHPreStep", "numpy.meshgrid", "pysph.solve...
[((889, 902), 'numpy.exp', 'np.exp', (['(b * t)'], {}), '(b * t)\n', (895, 902), True, 'import numpy as np\n'), ((3517, 3537), 'pysph.base.kernels.QuinticSpline', 'QuinticSpline', ([], {'dim': '(2)'}), '(dim=2)\n', (3530, 3537), False, 'from pysph.base.kernels import QuinticSpline\n'), ((3692, 3804), 'pysph.sph.scheme....
#!/usr/bin/env python # # Copyright (c) 2019 Opticks Team. All Rights Reserved. # # This file is part of Opticks # (see https://bitbucket.org/simoncblyth/opticks). # # 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...
[ "numpy.uint64", "numpy.zeros_like", "numpy.sum", "numpy.logical_and", "logging.basicConfig", "numpy.power", "numpy.all", "logging.getLogger", "numpy.prod", "numpy.argsort", "md5.md5", "numpy.fromstring", "numpy.array", "numpy.vstack", "numpy.bincount", "scipy.stats.chi2.cdf", "numpy....
[((865, 892), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (882, 892), False, 'import os, logging\n'), ((2214, 2229), 'numpy.unique', 'np.unique', (['vals'], {}), '(vals)\n', (2223, 2229), True, 'import numpy as np\n'), ((2372, 2387), 'numpy.unique', 'np.unique', (['vals'], {}), '(vals)...
import math import numpy as np from ..utils.darray import DependArray from .distance import * from .elec_near import ElecNear try: from .pme import Ewald except ImportError: from .ewald import Ewald from .ewald import Ewald as EwaldQMQM class Elec(object): def __init__( self, qm_positi...
[ "numpy.nonzero", "numpy.logical_and", "importlib.import_module" ]
[((2935, 2996), 'importlib.import_module', 'importlib.import_module', (['""".nonpbc"""'], {'package': '"""qmhub.electools"""'}), "('.nonpbc', package='qmhub.electools')\n", (2958, 2996), False, 'import importlib\n'), ((1805, 1824), 'numpy.nonzero', 'np.nonzero', (['(x < 0.8)'], {}), '(x < 0.8)\n', (1815, 1824), True, '...
import sys import os import numpy as np sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from math_helpers import vectors as vec from math_helpers import rotations as rot from math_helpers import matrices as mat from math_helpers.constants import * def get_orbital_elements(rvec, vvec...
[ "numpy.abs", "math_helpers.vectors.vxadd", "numpy.allclose", "numpy.arsin", "math_helpers.vectors.vxs", "math_helpers.vectors.norm", "numpy.exp", "os.path.dirname", "math_helpers.vectors.vdotv", "math_helpers.rotations.rotate", "numpy.hstack", "numpy.dot", "numpy.log", "numpy.deg2rad", "...
[((1275, 1293), 'math_helpers.vectors.norm', 'vec.norm', (['node_vec'], {}), '(node_vec)\n', (1283, 1293), True, 'from math_helpers import vectors as vec\n'), ((3985, 4021), 'numpy.array', 'np.array', (['[sma, e, i, raan, aop, ta]'], {}), '([sma, e, i, raan, aop, ta])\n', (3993, 4021), True, 'import numpy as np\n'), ((...
#####~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##### ##### CLIMS data viewer V01 - FS - 01/30/2019 ##### Please define the default search path and experiment name below ##### for an enhanced user experience! #####~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##### ##### DEFAULT SEAR...
[ "numpy.abs", "dash_core_components.Input", "os.path.isfile", "netCDF4.Dataset", "dash.Dash", "dash_core_components.Slider", "numpy.copy", "dash_html_components.Div", "dash.dependencies.State", "numpy.loadtxt", "dash_core_components.Store", "plotly.graph_objs.Scatter", "dash_html_components.B...
[((1066, 1083), 'os.listdir', 'os.listdir', (['DPATH'], {}), '(DPATH)\n', (1076, 1083), False, 'import os\n'), ((1553, 1615), 'dash.Dash', 'dash.Dash', (['__name__'], {'external_stylesheets': 'external_stylesheets'}), '(__name__, external_stylesheets=external_stylesheets)\n', (1562, 1615), False, 'import dash\n'), ((75...
import sys import gym import numpy as np from collections import defaultdict, deque import matplotlib.pyplot as plt #%matplotlib inline import check_test from plot_utils import plot_values env = gym.make('CliffWalking-v0') def epsilon_greedy(state, Q, epsilon, nA): a_max = np.argmax(Q[state]) probabilities ...
[ "plot_utils.plot_values", "check_test.run_check", "gym.make", "numpy.argmax", "numpy.zeros", "numpy.max", "numpy.arange", "sys.stdout.flush", "numpy.random.choice" ]
[((197, 224), 'gym.make', 'gym.make', (['"""CliffWalking-v0"""'], {}), "('CliffWalking-v0')\n", (205, 224), False, 'import gym\n'), ((2025, 2079), 'check_test.run_check', 'check_test.run_check', (['"""td_control_check"""', 'policy_sarsa'], {}), "('td_control_check', policy_sarsa)\n", (2045, 2079), False, 'import check_...
import cv2 import numpy as np import warnings warnings.filterwarnings("ignore") # Open the image. img = cv2.imread('../Images and Videos/flower.jpg') cv2.imshow('image',img) ''' log transformation : S = c*log(1+r) where s : output intensity value r : pixel value of the image constant c : 255/log(1+m) wher...
[ "numpy.log", "warnings.filterwarnings", "cv2.waitKey", "cv2.imwrite", "cv2.destroyAllWindows", "cv2.imread", "numpy.max", "numpy.array", "cv2.imshow" ]
[((48, 81), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (71, 81), False, 'import warnings\n'), ((108, 153), 'cv2.imread', 'cv2.imread', (['"""../Images and Videos/flower.jpg"""'], {}), "('../Images and Videos/flower.jpg')\n", (118, 153), False, 'import cv2\n'), ((156, 1...
""" This file contains methods that display the training data in a reader-friendly manner """ import os import pandas as pd import json import numpy as np from termcolor import colored from functional import pseq from matplotlib import pyplot as plt import build_pairs dirname = os.path.dirname(__file__) data_path = ...
[ "matplotlib.pyplot.title", "json.load", "matplotlib.pyplot.hist", "pandas.read_csv", "os.path.dirname", "matplotlib.pyplot.legend", "termcolor.colored", "numpy.mean", "functional.pseq", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "os.path.join", "os.listdir", "matplotlib.pyplot...
[((282, 307), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (297, 307), False, 'import os\n'), ((320, 376), 'os.path.join', 'os.path.join', (['dirname', '"""../../resources/training_pairs/"""'], {}), "(dirname, '../../resources/training_pairs/')\n", (332, 376), False, 'import os\n'), ((650, ...
import math import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.metrics import mean_absolute_error from sklearn.model_selection import cross_val_predict from sklearn.model_selection import KFold from sklearn.linear_model import LinearRegression from sklearn.linear_model ...
[ "matplotlib.pyplot.title", "sklearn.preprocessing.StandardScaler", "seaborn.heatmap", "pandas.read_csv", "sklearn.ensemble.GradientBoostingRegressor", "sklearn.metrics.mean_absolute_error", "numpy.mean", "pandas.DataFrame", "sklearn.tree.DecisionTreeRegressor", "matplotlib.pyplot.subplots", "skl...
[((692, 725), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (715, 725), False, 'import warnings\n'), ((975, 1006), 'pandas.read_csv', 'pd.read_csv', (['"""cleandataset.csv"""'], {}), "('cleandataset.csv')\n", (986, 1006), True, 'import pandas as pd\n'), ((1131, 1206), 'pa...
# -*- coding: utf-8 -*- """Template-based prediction ================================================================================ In this tutorial, we show how to better predict new contrasts for a target subject using many source subjects corresponding contrasts. For this purpose, we create a template to which we...
[ "nilearn.image.concat_imgs", "nilearn.image.index_img", "nilearn.plotting.plot_stat_map", "fmralign.template_alignment.TemplateAlignment", "fmralign._utils.voxelwise_correlation", "numpy.mean", "nilearn.input_data.NiftiMasker", "fmralign.fetch_example_data.fetch_ibc_subjects_contrasts" ]
[((1399, 1493), 'fmralign.fetch_example_data.fetch_ibc_subjects_contrasts', 'fetch_ibc_subjects_contrasts', (["['sub-01', 'sub-02', 'sub-04', 'sub-05', 'sub-06', 'sub-07']"], {}), "(['sub-01', 'sub-02', 'sub-04', 'sub-05',\n 'sub-06', 'sub-07'])\n", (1427, 1493), False, 'from fmralign.fetch_example_data import fetch...
from __future__ import print_function import sys import getopt import rl_env import numpy as np from rulebased_agent import RulebasedAgent from agents.random_agent import RandomAgent from agents.simple_agent import SimpleAgent from internal_agent import InternalAgent from outer_agent import OuterAgent from iggi_agent ...
[ "getopt.getopt", "numpy.zeros", "run_paired_experiment.run_episode_behavioral", "rl_env.make", "run_paired_experiment.create_obs_stacker" ]
[((4980, 5058), 'getopt.getopt', 'getopt.getopt', (['sys.argv[1:]', '""""""', "['players=', 'num_episodes=', 'agent_class=']"], {}), "(sys.argv[1:], '', ['players=', 'num_episodes=', 'agent_class='])\n", (4993, 5058), False, 'import getopt\n'), ((814, 870), 'rl_env.make', 'rl_env.make', (['"""Hanabi-Full"""'], {'num_pl...
# -*- coding: utf-8 -*- """ Created on Wed Apr 11 19:20:27 2018 @author: <NAME> @email: <EMAIL> """ import json import os import numpy import pandas import unittest from research_engine.engine import ResearchEngine from scipy.sparse.csr import csr_matrix from sklearn.feature_extraction.text import TfidfVectorizer cl...
[ "json.dump", "pandas.testing.assert_frame_equal", "os.remove", "research_engine.engine.ResearchEngine", "numpy.array", "pandas.Series", "pandas.DataFrame.from_records", "pandas.testing.assert_series_equal" ]
[((624, 672), 'pandas.DataFrame.from_records', 'pandas.DataFrame.from_records', (['self.example_list'], {}), '(self.example_list)\n', (653, 672), False, 'import pandas\n'), ((803, 834), 'os.remove', 'os.remove', (['self.json_descriptor'], {}), '(self.json_descriptor)\n', (812, 834), False, 'import os\n'), ((878, 901), ...
#!/usr/bin/env python #------------------------------------------------------------------------------ # plot_imsrg_flow.py # # author: <NAME> # version: 1.0.0 # date: Dec 6, 2016 # # tested with Python v2.7 # #------------------------------------------------------------------------------ from sys import arg...
[ "matplotlib.pyplot.loglog", "matplotlib.pyplot.show", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "numpy.log10", "matplotlib.ticker.FuncFormatter", "numpy.loadtxt", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.semilogy", "matplotlib.pyplot.xlabel", "m...
[((1560, 1574), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1572, 1574), True, 'import matplotlib.pyplot as plt\n'), ((1578, 1715), 'matplotlib.pyplot.semilogx', 'plt.semilogx', (['[1e-08, 0.0001, 1.0, 100]', '[exact, exact, exact, exact]'], {'linewidth': '(2)', 'color': '"""black"""', 'linestyle':...
from __future__ import division, print_function import torch import numpy as np try: import librosa except ImportError: librosa = None class Compose(object): """Composes several transforms together. Args: transforms (list of ``Transform`` objects): list of transforms to compose. Example:...
[ "numpy.stack", "torch.from_numpy", "numpy.abs", "torch.FloatTensor", "torch.cat", "torch.log1p", "torch.sign", "torch.abs", "numpy.sign", "librosa.feature.melspectrogram", "numpy.log1p" ]
[((4813, 4827), 'numpy.stack', 'np.stack', (['L', '(2)'], {}), '(L, 2)\n', (4821, 4827), True, 'import numpy as np\n'), ((2477, 2508), 'torch.cat', 'torch.cat', (['(tensor, pad)'], {'dim': '(0)'}), '((tensor, pad), dim=0)\n', (2486, 2508), False, 'import torch\n'), ((4685, 4737), 'librosa.feature.melspectrogram', 'libr...
"""Network models and submodels. The :class:`Model` class is used to encapsulate a set of Theano shared variables (model parameters), and can create symbolic expressions for model outputs and loss functions. This module also contains subclasses, such as :class:`Linear`, that function as building blocks for more compl...
[ "theano.tensor.tanh", "theano.ifelse.ifelse", "theano.tensor.as_tensor_variable", "theano.tensor.tensor3", "theano.tensor.concatenate", "theano.tensor.ones_like", "numpy.abs", "theano.tensor.dot", "theano.sandbox.rng_mrg.MRG_RandomStreams", "pickle.load", "theano.tensor.ones", "collections.Ord...
[((1561, 1574), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1572, 1574), False, 'from collections import OrderedDict\n'), ((1633, 1646), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1644, 1646), False, 'from collections import OrderedDict\n'), ((8480, 8494), 'pickle.load', 'pickle.load'...
# -*- coding: utf-8 -*- displayFull = False import numpy as np from pandas import read_csv as importDB import pandas as pd database = r'\\UBSPROD.MSAD.UBS.NET\UserData\ozsanos\RF\Desktop\Black\stockData.csv' tickers = ['AAPL','ADBE','ADI','AMD','AXP','BRCM','C','GLD','GOOG','GS','HNZ','HPQ','IBM','MSFT','TXN','XOM']...
[ "numpy.std", "numpy.average", "numpy.zeros", "pandas.read_csv" ]
[((1113, 1127), 'numpy.zeros', 'np.zeros', (['days'], {}), '(days)\n', (1121, 1127), True, 'import numpy as np\n'), ((1422, 1441), 'numpy.average', 'np.average', (['returns'], {}), '(returns)\n', (1432, 1441), True, 'import numpy as np\n'), ((1463, 1478), 'numpy.std', 'np.std', (['returns'], {}), '(returns)\n', (1469, ...
# coding=utf-8 # Copyright 2019 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ "tapas.utils.text_utils.parse_question_id", "absl.logging.log_every_n", "collections.defaultdict", "absl.logging.info", "numpy.array", "tapas.utils.text_utils.get_padded_question_id" ]
[((1788, 1817), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (1811, 1817), False, 'import collections\n'), ((2564, 2657), 'absl.logging.log_every_n', 'logging.log_every_n', (['logging.INFO', '"""best_span: %s, score: %s"""', '(500)', 'best_span', 'best_logit'], {}), "(logging.INFO, ...
from .general import * import matplotlib import matplotlib.pyplot as plt import pandas as pd from easydict import EasyDict from tqdm import tqdm_notebook import shutil import datetime import pickle from collections import Counter import random import subprocess import yaml import re ## File utilities def ensure_fol...
[ "matplotlib.pyplot.title", "pickle.dump", "numpy.random.seed", "numpy.argmax", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score", "seaborn.light_palette", "random.sample", "yaml.dump", "logging.Formatter", "sklearn.metrics.f1_score", "pickle.load...
[((4846, 4869), 'easydict.EasyDict', 'EasyDict', (['yaml_contents'], {}), '(yaml_contents)\n', (4854, 4869), False, 'from easydict import EasyDict\n'), ((10090, 10187), 'logging.Formatter', 'logging.Formatter', (["(format or '%(asctime)s %(name)s %(funcName)s [%(levelname)s]: %(message)s')"], {}), "(format or\n '%(a...
""" Copyright (C) 2018-2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to i...
[ "mo.graph.graph.Node", "mo.utils.unittest.graph.build_graph", "mo.front.common.partial_infer.utils.int64_array", "numpy.array_equal", "extensions.ops.slice_like.SliceLike.infer" ]
[((877, 896), 'mo.front.common.partial_infer.utils.int64_array', 'int64_array', (['[3, 4]'], {}), '([3, 4])\n', (888, 896), False, 'from mo.front.common.partial_infer.utils import int64_array\n'), ((963, 982), 'mo.front.common.partial_infer.utils.int64_array', 'int64_array', (['[2, 3]'], {}), '([2, 3])\n', (974, 982), ...
"""! \ingroup lammpstools Produces a histogram in a more intuitive way than numpy does. """ import numpy as np def make_histogram( yy, y0, y1, Nbins ): """! Produces a histogram from data in yy. @param yy Data to histogram @param y0 Lower bound of histogram @param y1 Upper bound of h...
[ "numpy.zeros", "numpy.argmax" ]
[((571, 599), 'numpy.zeros', 'np.zeros', (['Nbins'], {'dtype': 'float'}), '(Nbins, dtype=float)\n', (579, 599), True, 'import numpy as np\n'), ((669, 697), 'numpy.zeros', 'np.zeros', (['Nbins'], {'dtype': 'float'}), '(Nbins, dtype=float)\n', (677, 697), True, 'import numpy as np\n'), ((1076, 1091), 'numpy.argmax', 'np....
from Control import Control import numpy as np class UpdateGraph: def update_plot_data(self): # update ate o graph range if self.y.size < (self.graphRange / self.sampleTimeSec): #valor multiplicado pela tensão do arduino self.mv_value = 5 * self.board.analog[self.analogPor...
[ "numpy.append", "Control.Control.PID_calc", "numpy.delete" ]
[((351, 383), 'numpy.append', 'np.append', (['self.y', 'self.mv_value'], {}), '(self.y, self.mv_value)\n', (360, 383), True, 'import numpy as np\n'), ((1085, 1108), 'numpy.delete', 'np.delete', (['self.temp', '(0)'], {}), '(self.temp, 0)\n', (1094, 1108), True, 'import numpy as np\n'), ((1133, 1189), 'numpy.append', 'n...
import numpy as np import pytest import torch from mmpose.models import BottomUpHigherResolutionHead, BottomUpSimpleHead def test_bottom_up_simple_head(): """test bottom up simple head.""" with pytest.raises(TypeError): # extra _ = BottomUpSimpleHead( in_channels=512, num_joints=...
[ "mmpose.models.BottomUpHigherResolutionHead", "mmpose.models.BottomUpSimpleHead", "torch.FloatTensor", "pytest.raises", "numpy.random.random", "torch.Size" ]
[((600, 707), 'mmpose.models.BottomUpSimpleHead', 'BottomUpSimpleHead', ([], {'in_channels': '(512)', 'num_joints': '(17)', 'with_ae_loss': '[True]', 'extra': "{'final_conv_kernel': 3}"}), "(in_channels=512, num_joints=17, with_ae_loss=[True],\n extra={'final_conv_kernel': 3})\n", (618, 707), False, 'from mmpose.mod...
from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from __future__ import division from numbers import Number import numpy as np from sklearn.base import BaseEstimator from sklearn.base import ClassifierMixin from sklearn.utils.validation import check_X...
[ "numpy.divide", "scipy.optimize.minimize", "numpy.multiply", "numpy.average", "numpy.subtract", "numpy.concatenate", "sklearn.utils.validation.check_X_y", "numpy.zeros", "numpy.transpose", "numpy.insert", "numpy.array", "pyafm.util.log_one_plus_exp_vect", "numpy.unique", "sklearn.utils.val...
[((4649, 4667), 'numpy.multiply', 'np.multiply', (['l2', 'w'], {}), '(l2, w)\n', (4660, 4667), True, 'import numpy as np\n'), ((1226, 1241), 'sklearn.utils.validation.check_X_y', 'check_X_y', (['X', 'y'], {}), '(X, y)\n', (1235, 1241), False, 'from sklearn.utils.validation import check_X_y\n'), ((1343, 1376), 'numpy.un...
import numpy as np from skopt.sampler import Sobol, Lhs from litebo.utils.config_space import ConfigurationSpace, Configuration from litebo.utils.util_funcs import get_types, check_random_state class Sampler(object): """ Generate samples within the specified domain (which defaults to the whole config space)....
[ "litebo.utils.util_funcs.check_random_state", "litebo.utils.config_space.Configuration", "numpy.clip", "skopt.sampler.Lhs", "skopt.sampler.Sobol", "numpy.array", "litebo.utils.util_funcs.get_types" ]
[((1087, 1110), 'litebo.utils.util_funcs.get_types', 'get_types', (['config_space'], {}), '(config_space)\n', (1096, 1110), False, 'from litebo.utils.util_funcs import get_types, check_random_state\n'), ((1815, 1847), 'litebo.utils.util_funcs.check_random_state', 'check_random_state', (['random_state'], {}), '(random_s...
import sys sys.path.append("../src") from convolutional_VAE import ConVae import h5py import numpy as np import keras as ker import os import tensorflow as tf from sklearn.model_selection import cross_val_score from sklearn.linear_model import LogisticRegression from sklearn.neural_network import MLPClassifier from...
[ "sys.path.append", "numpy.load", "h5py.File", "os.getpid", "numpy.concatenate", "matplotlib.pyplot.suptitle", "convolutional_VAE.ConVae", "keras.datasets.mnist.load_data", "numpy.zeros", "numpy.expand_dims", "sklearn.linear_model.LogisticRegression", "matplotlib.use", "numpy.array", "tenso...
[((12, 37), 'sys.path.append', 'sys.path.append', (['"""../src"""'], {}), "('../src')\n", (27, 37), False, 'import sys\n'), ((413, 434), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (427, 434), False, 'import matplotlib\n'), ((4453, 4688), 'convolutional_VAE.ConVae', 'ConVae', (['n_layers', 'fi...
import logging import os from os import PathLike import re from typing import Dict, List, Set, Type, Optional, Union import numpy import torch from allennlp.common.checks import ConfigurationError from allennlp.common.params import Params from allennlp.models import Model from allennlp.common.registrable import Regis...
[ "dl4nlp_pos_tagging.common.utils.extend_dictionary_by_namespace", "numpy.argmax", "logging.getLogger", "allennlp.models.Model.register" ]
[((688, 715), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (705, 715), False, 'import logging\n'), ((718, 755), 'allennlp.models.Model.register', 'Model.register', (['"""meta_tagger_wrapper"""'], {}), "('meta_tagger_wrapper')\n", (732, 755), False, 'from allennlp.models import Model\n')...
import io from dataclasses import InitVar, dataclass, field from typing import Any import numpy as np from PIL import Image @dataclass class Film: file_name: str samples: int width: int height: int image: Any = field(init=False) def __post_init__(self): self.image = np.zeros([self.he...
[ "dataclasses.field", "io.BytesIO", "numpy.zeros" ]
[((234, 251), 'dataclasses.field', 'field', ([], {'init': '(False)'}), '(init=False)\n', (239, 251), False, 'from dataclasses import InitVar, dataclass, field\n'), ((303, 351), 'numpy.zeros', 'np.zeros', (['[self.height, self.width, 3]', 'np.float'], {}), '([self.height, self.width, 3], np.float)\n', (311, 351), True, ...
import numpy as np def get_array_indices(*shape): return np.arange(np.prod(shape)).reshape(shape)
[ "numpy.prod" ]
[((73, 87), 'numpy.prod', 'np.prod', (['shape'], {}), '(shape)\n', (80, 87), True, 'import numpy as np\n')]
import numpy as np from . import posquat as pq from . import utilities as ut class Bone(object): def __init__(self, name, parent=-1): self.name = name self.parent = parent self.children = [] class Skeleton(object): def __init__(self): self.bones = [] self.parentlist =...
[ "numpy.zeros_like", "numpy.sum", "numpy.zeros", "numpy.ones", "numpy.array", "numpy.linalg.norm", "numpy.sqrt" ]
[((348, 369), 'numpy.zeros', 'np.zeros', (['[512, 4, 4]'], {}), '([512, 4, 4])\n', (356, 369), True, 'import numpy as np\n'), ((397, 418), 'numpy.zeros', 'np.zeros', (['[512, 4, 4]'], {}), '([512, 4, 4])\n', (405, 418), True, 'import numpy as np\n'), ((826, 844), 'numpy.zeros_like', 'np.zeros_like', (['pos'], {}), '(po...
import numpy as np import pandas as pd def eps(n): return np.random.normal(size=n) def causal_network(B, C, n): A = 1.414*B + eps(n) D = -2.71*C + eps(n) Z = .5*B - 3.14*C + eps(n) X = 2*A - .3*Z + eps(n) W = .3*X + eps(n) Y = 3*W - 1.2*Z + 10*D + eps(n) df = pd.DataFrame() ...
[ "pandas.DataFrame", "numpy.random.normal" ]
[((64, 88), 'numpy.random.normal', 'np.random.normal', ([], {'size': 'n'}), '(size=n)\n', (80, 88), True, 'import numpy as np\n'), ((300, 314), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (312, 314), True, 'import pandas as pd\n')]
# Copyright 2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "numpy.stack", "numpy.ones_like" ]
[((762, 877), 'numpy.stack', 'np.stack', (['[box[:, 1] - box[:, 3], box[:, 0] - box[:, 2], box[:, 3] - box[:, 1], box[:,\n 2] - box[:, 0]]'], {'axis': '(1)'}), '([box[:, 1] - box[:, 3], box[:, 0] - box[:, 2], box[:, 3] - box[:, \n 1], box[:, 2] - box[:, 0]], axis=1)\n', (770, 877), True, 'import numpy as np\n'), ...
########################################################################### # MÓDULO: VIZUALIZAÇÃO DA ESTRUTURA PARA CONFERÊNCIA DA ENTRADA DOS DADOS # ########################################################################### import tkinter import tkinter.messagebox import numpy # Inicialização da janela wnview = tk...
[ "tkinter.PhotoImage", "tkinter.Canvas", "tkinter.Button", "tkinter.messagebox.showinfo", "numpy.arcsin", "numpy.around", "tkinter.Frame", "tkinter.Tk" ]
[((318, 330), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (328, 330), False, 'import tkinter\n'), ((425, 446), 'tkinter.Frame', 'tkinter.Frame', (['wnview'], {}), '(wnview)\n', (438, 446), False, 'import tkinter\n'), ((558, 646), 'tkinter.Canvas', 'tkinter.Canvas', (['frame'], {'height': 'height', 'width': 'width', '...
import numpy as np import scipy.cluster.hierarchy as hy import matplotlib.pyplot as plt # Generate random features and distance matrix. def clusters(number=20, cnumber=10, csize=10): # Note, the way the clusters are positioned is gaussian randomness rnum = np.random.rand(cnumber, 2) rn = rnum[:, 0] * numbe...
[ "scipy.cluster.hierarchy.fcluster", "numpy.random.randn", "scipy.cluster.hierarchy.linkage", "matplotlib.pyplot.figure", "numpy.max", "numpy.where", "numpy.column_stack", "numpy.random.rand", "numpy.vstack", "numpy.unique" ]
[((1282, 1324), 'scipy.cluster.hierarchy.linkage', 'hy.linkage', (['cls[:, 0:2]'], {'method': '"""complete"""'}), "(cls[:, 0:2], method='complete')\n", (1292, 1324), True, 'import scipy.cluster.hierarchy as hy\n'), ((1609, 1643), 'scipy.cluster.hierarchy.fcluster', 'hy.fcluster', (['Y', 'cutoff', '"""distance"""'], {})...
import os import json import yaml import argparse import numpy as np from math import log import dgl import torch import torch.backends.cudnn as cudnn import torch.nn.functional as F import torch.nn.utils.rnn as rnn_utils from tqdm import tqdm from torch import nn from torch import optim from torch.optim import lr_sc...
[ "numpy.load", "model.fvqa_testdataset.FvqaTestDataset", "argparse.ArgumentParser", "yaml.dump", "util.checkpointing.load_checkpoint", "dgl.unbatch", "torch.device", "torch.no_grad", "torch.nn.BCELoss", "torch.utils.data.DataLoader", "model.model.CMGCNnet", "torch.FloatTensor", "util.vocabula...
[((1503, 1528), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1526, 1528), False, 'import argparse\n'), ((2408, 2429), 'torch.manual_seed', 'torch.manual_seed', (['(10)'], {}), '(10)\n', (2425, 2429), False, 'import torch\n'), ((2434, 2460), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed',...
import numpy as np from scipy.spatial.distance import pdist, squareform """ Compute the KSD divergence using samples, adapted from the theano code """ def KSD(z, Sqx): # compute the rbf kernel K, dimZ = z.shape sq_dist = pdist(z) pdist_square = squareform(sq_dist)**2 # use median ...
[ "numpy.sum", "numpy.log", "numpy.median", "scipy.spatial.distance.squareform", "scipy.spatial.distance.pdist", "numpy.exp", "numpy.dot", "numpy.diag" ]
[((247, 255), 'scipy.spatial.distance.pdist', 'pdist', (['z'], {}), '(z)\n', (252, 255), False, 'from scipy.spatial.distance import pdist, squareform\n'), ((331, 354), 'numpy.median', 'np.median', (['pdist_square'], {}), '(pdist_square)\n', (340, 354), True, 'import numpy as np\n'), ((411, 449), 'numpy.exp', 'np.exp', ...
''' Simpler example showing how to use train and use the convincingness model for prediction. This script trains a model on the UKPConvArgStrict dataset. So, before running this script, you need to run "python/analysis/habernal_comparison/run_preprocessing.py" to extract the linguistic features from this dataset. '''...
[ "sys.path.append", "embeddings.load_embeddings", "os.path.abspath", "vocabulary_embeddings_extractor.load_all", "gp_pref_learning.GPPrefLearning", "os.path.join", "pickle.dump", "tests.get_docidxs_from_ids", "logging.info", "numpy.array", "data_loader.load_single_file_separate_args", "os.path....
[((379, 406), 'sys.path.append', 'sys.path.append', (['"""./python"""'], {}), "('./python')\n", (394, 406), False, 'import sys\n'), ((407, 443), 'sys.path.append', 'sys.path.append', (['"""./python/analysis"""'], {}), "('./python/analysis')\n", (422, 443), False, 'import sys\n'), ((444, 478), 'sys.path.append', 'sys.pa...
import numpy as np import pytest from pytest import approx from desdeov2.solver.ASF import SimpleASF from desdeov2.solver.NumericalMethods import ScipyDE from desdeov2.solver.ScalarSolver import ( ASFScalarSolver, EpsilonConstraintScalarSolver, ScalarSolverError, WeightingMethodScalarSolver, ) @pytes...
[ "desdeov2.solver.NumericalMethods.ScipyDE", "numpy.zeros", "numpy.ones", "numpy.not_equal", "desdeov2.solver.ScalarSolver.WeightingMethodScalarSolver", "numpy.isclose", "desdeov2.solver.ScalarSolver.ASFScalarSolver", "numpy.array", "desdeov2.solver.ASF.SimpleASF", "pytest.raises", "pytest.mark.f...
[((3077, 3129), 'pytest.mark.filterwarnings', 'pytest.mark.filterwarnings', (['"""ignore::RuntimeWarning"""'], {}), "('ignore::RuntimeWarning')\n", (3103, 3129), False, 'import pytest\n'), ((3734, 3786), 'pytest.mark.filterwarnings', 'pytest.mark.filterwarnings', (['"""ignore::RuntimeWarning"""'], {}), "('ignore::Runti...
from PyQt5.QtCore import QThread, pyqtSignal import win32 from PIL import Image from numba import jit, njit import numpy as np import time SLEEP_TIME = 0.002 class CaptureWorker(QThread): done = pyqtSignal(object) def __init__(self, parent): super().__init__(parent) self.exiting = False self.capture...
[ "PyQt5.QtCore.pyqtSignal", "numpy.subtract", "numpy.asarray", "numba.njit", "numpy.zeros", "win32.Win32UICapture", "time.time", "PIL.Image.open", "time.sleep" ]
[((4822, 4900), 'numba.njit', 'njit', (['"""uint8[:,:](float32[:,:,:],float32[:],float32[:],float32[:],float32[:])"""'], {}), "('uint8[:,:](float32[:,:,:],float32[:],float32[:],float32[:],float32[:])')\n", (4826, 4900), False, 'from numba import jit, njit\n'), ((199, 217), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['ob...
import numpy as np import torch from torch.utils import data class carlaDataset(data.Dataset): def __init__(self, list_IDs, obs_w, factual, time_shift, args, TEST=False): '''Initialization''' self.list_IDs = list_IDs self.obs_w = obs_w self.data_dir = args.data_dir self.ID_a...
[ "numpy.load", "numpy.sum", "numpy.argmax", "numpy.zeros", "numpy.min", "numpy.sin", "numpy.array", "pdb.set_trace", "numpy.cos", "numpy.max", "numpy.where", "numpy.concatenate", "numpy.repeat" ]
[((1471, 1493), 'numpy.zeros', 'np.zeros', (['(n_samples,)'], {}), '((n_samples,))\n', (1479, 1493), True, 'import numpy as np\n'), ((1512, 1545), 'numpy.zeros', 'np.zeros', (['(self.obs_w, n_samples)'], {}), '((self.obs_w, n_samples))\n', (1520, 1545), True, 'import numpy as np\n'), ((1569, 1606), 'numpy.zeros', 'np.z...
""" Usage: python -m recipy example_script3.py OUTPUT.npy """ from __future__ import print_function import sys import numpy if len(sys.argv) < 2: print(__doc__, file=sys.stderr) sys.exit(1) arr = numpy.arange(10) arr = arr + 500 # We've made a fairly big change here! numpy.save(sys.argv[1], arr)
[ "numpy.save", "numpy.arange", "sys.exit" ]
[((208, 224), 'numpy.arange', 'numpy.arange', (['(10)'], {}), '(10)\n', (220, 224), False, 'import numpy\n'), ((281, 309), 'numpy.save', 'numpy.save', (['sys.argv[1]', 'arr'], {}), '(sys.argv[1], arr)\n', (291, 309), False, 'import numpy\n'), ((189, 200), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (197, 200), Fals...
# 引入需要得包 #数据处理常用得包 import numpy as np import pandas as pd from sklearn.metrics import f1_score # 随机森林的包 import sklearn as skl from sklearn.ensemble import RandomForestClassifier # 画图的包 import matplotlib.pyplot as plt import seaborn as sns sns.set(color_codes=True) import warnings warnings.filterwarnings("ignore") ...
[ "sklearn.ensemble.RandomForestClassifier", "warnings.filterwarnings", "pandas.read_csv", "sklearn.metrics.f1_score", "numpy.array", "seaborn.set" ]
[((241, 266), 'seaborn.set', 'sns.set', ([], {'color_codes': '(True)'}), '(color_codes=True)\n', (248, 266), True, 'import seaborn as sns\n'), ((284, 317), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (307, 317), False, 'import warnings\n'), ((350, 393), 'pandas.read_csv...
from sim3d import simulate_img3d import h5py from mainviewer import mainViewer import numpy as np import cv2 from moviepy.editor import ImageSequenceClip from random import randrange, uniform import math from skimage.util.shape import view_as_blocks from skimage import io def write_hdf5(dataset, n, canvas, positions=F...
[ "numpy.stack", "h5py.File", "math.floor", "numpy.array", "cv2.rectangle", "cv2.resize" ]
[((379, 399), 'h5py.File', 'h5py.File', (['path', '"""a"""'], {}), "(path, 'a')\n", (388, 399), False, 'import h5py\n'), ((644, 664), 'h5py.File', 'h5py.File', (['path', '"""r"""'], {}), "(path, 'r')\n", (653, 664), False, 'import h5py\n'), ((820, 836), 'numpy.array', 'np.array', (['canvas'], {}), '(canvas)\n', (828, 8...
# This code is adopted from "https://github.com/Line290/FeatureAttack" from __future__ import print_function import time import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd.gradcheck import zero_gradients from torch.autograd import Variable import torch.ba...
[ "argparse.ArgumentParser", "torchvision.datasets.CIFAR10", "torch.nn.CosineSimilarity", "sys.stdout.flush", "torch.autograd.gradcheck.zero_gradients", "torchvision.datasets.SVHN", "torch.utils.data.DataLoader", "torch.load", "torch.sign", "torch.zeros", "torch.zeros_like", "torch.autograd.Vari...
[((537, 562), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (560, 562), False, 'import argparse\n'), ((2735, 2824), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['testset'], {'batch_size': '(10000)', 'shuffle': '(False)', 'num_workers': '(20)'}), '(testset, batch_size=10000, ...
#!/usr/bin/env python # coding: utf-8 # In[2]: import pandas as pd import urllib import numpy as np import json from tqdm.autonotebook import tqdm #%matplotlib inline tqdm.pandas()#tqdm) # import jellyfish import dask.dataframe as dd # from dask.multiprocessing import get from importlib import reload imp...
[ "pandas.DataFrame", "os.mkdir", "numpy.sum", "getopt.getopt", "importlib.import_module", "AddressCleanserUtils.pbar.register", "pandas.ExcelWriter", "dask.diagnostics.ResourceProfiler", "tqdm.autonotebook.tqdm.pandas", "bokeh.io.output_file", "importlib.reload", "dask.diagnostics.Profiler", ...
[((176, 189), 'tqdm.autonotebook.tqdm.pandas', 'tqdm.pandas', ([], {}), '()\n', (187, 189), False, 'from tqdm.autonotebook import tqdm\n'), ((345, 373), 'importlib.reload', 'reload', (['AddressCleanserUtils'], {}), '(AddressCleanserUtils)\n', (351, 373), False, 'from importlib import reload\n'), ((460, 479), 'logging.g...
import cplex import numpy as np import warnings import time from .lp import Solution def solve(formula, display=True, export=False, params={}): cpx = cplex.Cplex() obj = formula.obj.flatten() linear = formula.linear row = linear.shape[0] spmat = [[linear.indices[linear.indptr[i]:linear.indptr[i...
[ "cplex.Cplex", "time.sleep", "cplex.SparseTriple", "time.time", "numpy.array", "warnings.warn" ]
[((158, 171), 'cplex.Cplex', 'cplex.Cplex', ([], {}), '()\n', (169, 171), False, 'import cplex\n'), ((1833, 1844), 'time.time', 'time.time', ([], {}), '()\n', (1842, 1844), False, 'import time\n'), ((1309, 1364), 'cplex.SparseTriple', 'cplex.SparseTriple', ([], {'ind1': 'cone', 'ind2': 'cone', 'val': 'cone_data'}), '(i...
#!/usr/bin/env python3 # Train and run a character-level language model. The training set is # a single ASCII text file. import numpy as np import pvml import sys # CONFIGURATION HIDDEN_STATES = [256] BATCH_SIZE = 16 TRAINING_STEPS = 10000 MAXLEN = 400 # ASCII characters in the 32-126 range are encoded as (code -...
[ "numpy.concatenate", "numpy.zeros", "numpy.array", "numpy.arange", "sys.exit" ]
[((710, 741), 'numpy.array', 'np.array', (['codes'], {'dtype': 'np.uint8'}), '(codes, dtype=np.uint8)\n', (718, 741), True, 'import numpy as np\n'), ((1530, 1567), 'numpy.zeros', 'np.zeros', (['(U.size, k)'], {'dtype': 'np.uint8'}), '((U.size, k), dtype=np.uint8)\n', (1538, 1567), True, 'import numpy as np\n'), ((1437,...
""" =========================================================== Metrics and observables (:py:mod:`reservoirpy.observables`) =========================================================== Metrics and observables for Reservoir Computing: .. autosummary:: :toctree: generated/ spectral_radius mse rmse nr...
[ "numpy.quantile", "numpy.sum", "scipy.sparse.issparse", "numpy.asarray", "scipy.linalg.eig", "numpy.mean", "scipy.sparse.linalg.eigs" ]
[((761, 779), 'numpy.asarray', 'np.asarray', (['y_true'], {}), '(y_true)\n', (771, 779), True, 'import numpy as np\n'), ((799, 817), 'numpy.asarray', 'np.asarray', (['y_pred'], {}), '(y_pred)\n', (809, 817), True, 'import numpy as np\n'), ((2222, 2233), 'scipy.sparse.issparse', 'issparse', (['W'], {}), '(W)\n', (2230, ...
import numpy as np import pybullet as p from diy_gym.addons.addon import Addon class OutOfBoundsPenalty(Addon): def __init__(self, parent, config): super(OutOfBoundsPenalty, self).__init__(parent, config) self.source_model = parent#.models[config.get('source_model')] self.min_xyz = config...
[ "pybullet.getLinkState", "pybullet.getBasePositionAndOrientation", "numpy.array" ]
[((952, 972), 'numpy.array', 'np.array', (['source_xyz'], {}), '(source_xyz)\n', (960, 972), True, 'import numpy as np\n'), ((734, 793), 'pybullet.getLinkState', 'p.getLinkState', (['self.source_model.uid', 'self.source_frame_id'], {}), '(self.source_model.uid, self.source_frame_id)\n', (748, 793), True, 'import pybull...
import time,os,copy,argparse,subprocess, sys, pysam, datetime os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import numpy as np import multiprocessing as mp import tensorflow as tf from model_architect import * from generate_SNP_pileups import get_snp_testing_candidates from intervaltree import Interval, IntervalTree from...
[ "numpy.sum", "numpy.argmax", "tensorflow.reset_default_graph", "tensorflow.local_variables_initializer", "tensorflow.ConfigProto", "numpy.argsort", "os.path.join", "os.path.dirname", "os.path.exists", "numpy.log10", "datetime.datetime.now", "copy.deepcopy", "tensorflow.train.Saver", "tenso...
[((406, 422), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (420, 422), True, 'import tensorflow as tf\n'), ((505, 567), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (539, 567), True, 'import t...
"""Angles and anomalies. """ import numpy as np from astropy import units as u from scipy import optimize def _kepler_equation(E, M, ecc): return E - ecc * np.sin(E) - M def _kepler_equation_prime(E, M, ecc): return 1 - ecc * np.cos(E) def _kepler_equation_hyper(F, M, ecc): return -F + ecc * np.sin...
[ "numpy.abs", "numpy.tan", "scipy.optimize.newton", "numpy.arcsinh", "numpy.cos", "astropy.units.dimensionless_angles", "numpy.cosh", "numpy.arctan", "numpy.sin", "numpy.exp", "numpy.sinh", "numpy.sqrt" ]
[((3596, 3612), 'numpy.tan', 'np.tan', (['(nu / 2.0)'], {}), '(nu / 2.0)\n', (3602, 3612), True, 'import numpy as np\n'), ((2476, 2502), 'numpy.sqrt', 'np.sqrt', (['(2.0 / (1.0 + ecc))'], {}), '(2.0 / (1.0 + ecc))\n', (2483, 2502), True, 'import numpy as np\n'), ((3068, 3080), 'numpy.arctan', 'np.arctan', (['D'], {}), ...
""" MIT License Copyright (c) 2020 <NAME> and <NAME> 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, publ...
[ "numpy.maximum", "numpy.polyfit", "numpy.zeros", "numpy.tile", "numpy.linspace", "numpy.concatenate" ]
[((2363, 2395), 'numpy.zeros', 'np.zeros', (['metrics.number_of_conv'], {}), '(metrics.number_of_conv)\n', (2371, 2395), True, 'import numpy as np\n'), ((2436, 2468), 'numpy.zeros', 'np.zeros', (['metrics.number_of_conv'], {}), '(metrics.number_of_conv)\n', (2444, 2468), True, 'import numpy as np\n'), ((2491, 2523), 'n...
import sys import numpy as np import numpy.random as rnd from keras import backend as K import src.model.objectives as obj import src.utils.metrics as mtr rnd.seed(123) _EPSILON = K.epsilon() allobj = [obj.mfom_eer_normalized, obj.pooled_mfom_eer, obj.mfom_microf1, obj.mfom_macrof1, ...
[ "numpy.random.uniform", "numpy.sum", "numpy.random.seed", "numpy.log", "numpy.abs", "keras.backend.epsilon", "numpy.isclose", "numpy.mean", "numpy.exp", "numpy.reshape", "numpy.random.choice", "keras.backend.variable" ]
[((156, 169), 'numpy.random.seed', 'rnd.seed', (['(123)'], {}), '(123)\n', (164, 169), True, 'import numpy.random as rnd\n'), ((181, 192), 'keras.backend.epsilon', 'K.epsilon', ([], {}), '()\n', (190, 192), True, 'from keras import backend as K\n'), ((476, 507), 'numpy.reshape', 'np.reshape', (['y_true', '(-1, s[-1])']...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 11 16:39:01 2018 @author: gotamist """ import numpy as np from data_generator import AudioGenerator #import re from itertools import chain #from textblob import TextBlob as tb #import kenlm import panphon.distance from fuzzy import DMetaphone import...
[ "numpy.zeros", "pyphen.Pyphen", "data_generator.AudioGenerator", "fuzzy.DMetaphone", "itertools.chain.from_iterable" ]
[((375, 388), 'fuzzy.DMetaphone', 'DMetaphone', (['(5)'], {}), '(5)\n', (385, 388), False, 'from fuzzy import DMetaphone\n'), ((1234, 1258), 'pyphen.Pyphen', 'pyphen.Pyphen', ([], {'lang': '"""en"""'}), "(lang='en')\n", (1247, 1258), False, 'import pyphen\n'), ((1858, 1871), 'fuzzy.DMetaphone', 'DMetaphone', (['(5)'], ...
import numpy as np from tqdm import tqdm # import scipy.misc as scm from PIL import Image from matplotlib.pyplot import imread import os from utils import crop_center import h5py import pdb from utils import read_data_file class DataLoader: def __init__(self): return def load_images_and_labels(self,...
[ "utils.crop_center", "numpy.zeros", "utils.read_data_file", "numpy.where", "numpy.array", "numpy.reshape", "PIL.Image.fromarray", "os.path.join" ]
[((1458, 1558), 'numpy.zeros', 'np.zeros', (['(imgs_names.shape[0], self.input_size, self.input_size, num_channel)'], {'dtype': 'np.float32'}), '((imgs_names.shape[0], self.input_size, self.input_size,\n num_channel), dtype=np.float32)\n', (1466, 1558), True, 'import numpy as np\n'), ((1572, 1630), 'numpy.zeros', 'n...
#!/usr/bin/env python """how_much_cpu.py for Ramses by <NAME> This script looks at PBS outputs in the current working directory, assuming they are generated by Ramses runs, and estimates the total amount of CPU hours spent on the current run. If matplotlib is installed, it also saves a PDF with a plot of the amount ...
[ "pylab.ylabel", "pylab.savefig", "matplotlib.use", "numpy.array", "pylab.xlabel", "glob.glob", "re.search" ]
[((452, 469), 'glob.glob', 'glob.glob', (['"""*.o*"""'], {}), "('*.o*')\n", (461, 469), False, 'import glob, re\n'), ((1485, 1506), 'matplotlib.use', 'matplotlib.use', (['"""pdf"""'], {}), "('pdf')\n", (1499, 1506), False, 'import matplotlib, numpy as np\n'), ((1588, 1609), 'pylab.xlabel', 'p.xlabel', (['"""CPU hours""...
# -*- coding: utf-8 -*- # @Author: jadesauve # @Date: 2020-04-23 12:59:57 # @Last Modified by: jadesauve # @Last Modified time: 2020-04-23 13:50:48 """ read data from 2017-01-0118.ctd save lists of depth and temp plot """ # imports import matplotlib.pyplot as plt import numpy as np # path in_dir = '/Users/jadesa...
[ "matplotlib.pyplot.figure", "numpy.array", "matplotlib.pyplot.plot", "matplotlib.pyplot.show" ]
[((804, 818), 'numpy.array', 'np.array', (['temp'], {}), '(temp)\n', (812, 818), True, 'import numpy as np\n'), ((827, 842), 'numpy.array', 'np.array', (['depth'], {}), '(depth)\n', (835, 842), True, 'import numpy as np\n'), ((851, 863), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (861, 863), True, 'imp...
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy import pi import cv2 import scipy.misc import tensorflow as tf DATA_FOLDER = "/home/ajay/Applied_course/self_driving_car/Autopilot-TensorFlow-master/driving_dataset/" DATA_FILE = os.path.join(DATA_FOLDER, "data.txt") x = [] y ...
[ "tensorflow.reshape", "cv2.warpAffine", "tensorflow.matmul", "tensorflow.Variable", "tensorflow.nn.conv2d", "tensorflow.InteractiveSession", "cv2.imshow", "os.path.join", "cv2.getRotationMatrix2D", "tensorflow.truncated_normal", "tensorflow.placeholder", "cv2.destroyAllWindows", "cv2.resize"...
[((272, 309), 'os.path.join', 'os.path.join', (['DATA_FOLDER', '"""data.txt"""'], {}), "(DATA_FOLDER, 'data.txt')\n", (284, 309), False, 'import os\n'), ((669, 680), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (677, 680), True, 'import numpy as np\n'), ((1238, 1304), 'tensorflow.placeholder', 'tf.placeholder', (['...
import gym import time import numpy as np from absl import flags import sys, os import torch from abp import SADQAdaptive from abp.utils import clear_summary_path from abp.explanations import PDX from tensorboardX import SummaryWriter from gym.envs.registration import register from sc2env.environments.tug_of_war_2p im...
[ "tensorboardX.SummaryWriter", "numpy.set_printoptions", "copy.deepcopy", "abp.utils.clear_summary_path", "time.time", "torch.save", "sc2env.environments.tug_of_war_2p.TugOfWar", "torch.cuda.is_available", "absl.flags.FLAGS" ]
[((477, 509), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(2)'}), '(precision=2)\n', (496, 509), True, 'import numpy as np\n'), ((523, 548), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (546, 548), False, 'import torch\n'), ((1026, 1051), 'absl.flags.FLAGS', 'flags.FL...
from .utils import score_all_prots from copy import copy import numpy as np import pandas as pd import pickle as pkl import random def obj_score(subst, mini=False): """ Objective function to optimize a matrix. Input: substitution matrix for which to test objective score Output: objective score of that ...
[ "random.sample", "numpy.arange", "copy.copy" ]
[((1064, 1087), 'numpy.arange', 'np.arange', (['(0)', '(0.31)', '(0.1)'], {}), '(0, 0.31, 0.1)\n', (1073, 1087), True, 'import numpy as np\n'), ((2355, 2408), 'random.sample', 'random.sample', (['[-5, -4, -3, -2, -1, 1, 2, 3, 4, 5]', '(1)'], {}), '([-5, -4, -3, -2, -1, 1, 2, 3, 4, 5], 1)\n', (2368, 2408), False, 'impor...
from sklearn import metrics from sklearn.utils.multiclass import unique_labels import numpy as np def classification_report(y_true, y_pred, labels=None, target_names=None): """Build a text report showing the main classification metrics Parameters ---------- y_true : array, shape = [n_samples] ...
[ "sklearn.utils.multiclass.unique_labels", "numpy.sum", "numpy.average", "sklearn.metrics.precision_recall_fscore_support" ]
[((1421, 1450), 'sklearn.utils.multiclass.unique_labels', 'unique_labels', (['y_true', 'y_pred'], {}), '(y_true, y_pred)\n', (1434, 1450), False, 'from sklearn.utils.multiclass import unique_labels\n'), ((2164, 2219), 'sklearn.metrics.precision_recall_fscore_support', 'metrics.precision_recall_fscore_support', (['y_tru...
# coding: utf-8 """ Automated Tool for Optimized Modelling (ATOM) Author: Mavs Description: Unit tests for ensembles.py """ import numpy as np import pytest from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.ensemble import ExtraTreesClassifier, ExtraTreesRegressor from sklearn.linear_...
[ "atom.utils.check_is_fitted", "sklearn.preprocessing.StandardScaler", "atom.ensembles.VotingRegressor", "sklearn.model_selection.KFold", "sklearn.linear_model.LinearRegression", "sklearn.ensemble.ExtraTreesClassifier", "pytest.raises", "numpy.array", "sklearn.discriminant_analysis.LinearDiscriminant...
[((3817, 3868), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""voting"""', "['soft', 'hard']"], {}), "('voting', ['soft', 'hard'])\n", (3840, 3868), False, 'import pytest\n'), ((1597, 1626), 'atom.utils.check_is_fitted', 'check_is_fitted', (['stack', '(False)'], {}), '(stack, False)\n', (1612, 1626), False...
import rospy import enum import time import numpy as np from control_node import HiwinRobotInterface from collision_avoidance.srv import collision_avoid, collision_avoidRequest from hand_eye.srv import eye2base, eye2baseRequest from hand_eye.srv import save_pcd, save_pcdRequest pic_pos = \ [[11.5333, 27.6935, 14.07870...
[ "control_node.HiwinRobotInterface", "rospy.ServiceProxy", "hand_eye.srv.save_pcdRequest", "hand_eye.srv.eye2baseRequest", "time.sleep", "numpy.identity", "rospy.is_shutdown", "numpy.array", "rospy.init_node", "rospy.wait_for_service", "numpy.delete" ]
[((3369, 3395), 'rospy.init_node', 'rospy.init_node', (['"""get_pcd"""'], {}), "('get_pcd')\n", (3384, 3395), False, 'import rospy\n'), ((3412, 3500), 'control_node.HiwinRobotInterface', 'HiwinRobotInterface', ([], {'robot_ip': '"""192.168.0.1"""', 'connection_level': '(1)', 'name': '"""manipulator"""'}), "(robot_ip='1...
import numpy as np def full_jacob_pb(jac_t, jac_r): return np.vstack( (jac_t[0], jac_t[1], jac_t[2], jac_r[0], jac_r[1], jac_r[2]))
[ "numpy.vstack" ]
[((64, 135), 'numpy.vstack', 'np.vstack', (['(jac_t[0], jac_t[1], jac_t[2], jac_r[0], jac_r[1], jac_r[2])'], {}), '((jac_t[0], jac_t[1], jac_t[2], jac_r[0], jac_r[1], jac_r[2]))\n', (73, 135), True, 'import numpy as np\n')]
import os from collections import Counter import numpy as np from monty.serialization import loadfn from pymatgen import Composition from pymatgen.core.periodic_table import get_el_sp DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../data") OXIDES_PATH = os.path.join(DATA_DIR, "binary_oxides_en...
[ "os.path.abspath", "pymatgen.core.periodic_table.get_el_sp", "monty.serialization.loadfn", "collections.Counter", "numpy.array", "pymatgen.Composition", "os.path.join" ]
[((280, 337), 'os.path.join', 'os.path.join', (['DATA_DIR', '"""binary_oxides_entries_dict.json"""'], {}), "(DATA_DIR, 'binary_oxides_entries_dict.json')\n", (292, 337), False, 'import os\n'), ((362, 381), 'monty.serialization.loadfn', 'loadfn', (['OXIDES_PATH'], {}), '(OXIDES_PATH)\n', (368, 381), False, 'from monty.s...
import numpy as np import sklearn.metrics def calc_auc(error_array, cutoff=0.25): error_array = error_array.squeeze() error_array = np.sort(error_array) num_values = error_array.shape[0] plot_points = np.zeros((num_values, 2)) midfraction = 1. for i in range(num_values): fraction =...
[ "numpy.argsort", "numpy.sort", "numpy.zeros", "numpy.array" ]
[((143, 163), 'numpy.sort', 'np.sort', (['error_array'], {}), '(error_array)\n', (150, 163), True, 'import numpy as np\n'), ((221, 246), 'numpy.zeros', 'np.zeros', (['(num_values, 2)'], {}), '((num_values, 2))\n', (229, 246), True, 'import numpy as np\n'), ((904, 933), 'numpy.argsort', 'np.argsort', (['plot_points[:, 0...
import torch import torch.nn as nn import unittest from numpy.testing import assert_array_almost_equal from mighty.utils.common import set_seed from sparse.nn.model import Softshrink, LISTA, MatchingPursuit from sparse.nn.solver import BasisPursuitADMM class TestSoftshrink(unittest.TestCase): def test_softshink(...
[ "unittest.main", "sparse.nn.solver.BasisPursuitADMM", "torch.nn.Softshrink", "torch.randn", "mighty.utils.common.set_seed", "sparse.nn.model.Softshrink", "sparse.nn.model.MatchingPursuit", "numpy.testing.assert_array_almost_equal", "torch.no_grad", "sparse.nn.model.LISTA" ]
[((1585, 1600), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1598, 1600), False, 'import unittest\n'), ((335, 347), 'mighty.utils.common.set_seed', 'set_seed', (['(16)'], {}), '(16)\n', (343, 347), False, 'from mighty.utils.common import set_seed\n'), ((389, 413), 'sparse.nn.model.Softshrink', 'Softshrink', ([]...
import numpy as np import sklearn from sklearn.linear_model import Ridge, RidgeCV from sklearn.kernel_ridge import KernelRidge from sklearn.model_selection import GridSearchCV from sklearn.base import RegressorMixin, BaseEstimator from time import time import scipy from .hamiltonians import orbs_base, block_to_feat_ind...
[ "numpy.trace", "numpy.moveaxis", "numpy.random.shuffle", "warnings.filterwarnings", "sklearn.linear_model.Ridge", "sklearn.kernel_ridge.KernelRidge", "numpy.linalg.qr", "numpy.zeros", "numpy.einsum", "scipy.sparse.linalg.eigsh", "time.time", "numpy.vstack", "numpy.where", "numpy.linalg.nor...
[((382, 452), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'scipy.linalg.LinAlgWarning'}), "('ignore', category=scipy.linalg.LinAlgWarning)\n", (405, 452), False, 'import warnings\n'), ((453, 532), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'catego...
from riglib import bmi, plexon, source from riglib.bmi import extractor import numpy as np from riglib.bmi import clda from riglib.bmi import train from riglib.bmi import state_space_models import datetime import matplotlib.pyplot as plt class State(object): '''For compatibility with other BMI decoding implementa...
[ "numpy.sum", "numpy.polyfit", "numpy.argmax", "numpy.floor", "numpy.ones", "numpy.argmin", "numpy.arange", "numpy.exp", "shutil.copy", "sklearn.mixture.GMM", "riglib.bmi.state_space_models.StateSpaceEndptPos1D", "numpy.max", "numpy.linspace", "datetime.datetime.now", "matplotlib.pyplot.s...
[((5607, 5643), 're.compile', 're.compile', (['"""(\\\\d{1,3})\\\\s*(\\\\w{1})"""'], {}), "('(\\\\d{1,3})\\\\s*(\\\\w{1})')\n", (5617, 5643), False, 'import re\n'), ((5875, 5922), 'numpy.logical_or', 'np.logical_or', (['(e1_inds is None)', '(e2_inds is None)'], {}), '(e1_inds is None, e2_inds is None)\n', (5888, 5922),...
import sys, os sys.path.append(os.path.abspath(os.path.join(os.path.dirname('.'), os.path.pardir))) import os import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Circle from matplotlib.patches import Ellipse from matplotlib.patches import Arrow from matplotlib.patches import Wedge class F...
[ "matplotlib.pyplot.show", "os.path.dirname", "matplotlib.patches.Wedge", "matplotlib.patches.Circle", "numpy.sin", "numpy.cos", "matplotlib.patches.Ellipse", "matplotlib.pyplot.subplots" ]
[((10742, 10760), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {}), '(1, 1)\n', (10754, 10760), True, 'import matplotlib.pyplot as plt\n'), ((10865, 10875), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (10873, 10875), True, 'import matplotlib.pyplot as plt\n'), ((11330, 11348), 'matplotlib....
import glob from torchvision import utils from torch.utils.data import DataLoader, Dataset from shutil import copyfile from tqdm import tqdm import os import cv2 from skimage import io import multiprocessing import traceback import numpy as np from skimage import io import torch import webp SKIP_ITEM = 0 SIZE_BLOCK =...
[ "traceback.print_exc", "torch.utils.data.DataLoader", "numpy.argmax", "torch.load", "os.path.exists", "numpy.ones", "classifier.Classifier", "numpy.clip", "os.cpu_count", "multiprocessing.get_context", "numpy.min", "numpy.max", "torch.cuda.is_available", "glob.glob", "torch.no_grad", "...
[((2092, 2111), 'numpy.clip', 'np.clip', (['mask', '(0)', '(1)'], {}), '(mask, 0, 1)\n', (2099, 2111), True, 'import numpy as np\n'), ((2344, 2366), 'numpy.min', 'np.min', (['coords'], {'axis': '(1)'}), '(coords, axis=1)\n', (2350, 2366), True, 'import numpy as np\n'), ((2386, 2408), 'numpy.max', 'np.max', (['coords'],...
from __future__ import print_function, division, absolute_import import numpy as np from ...common.timeseries_output_comp import TimeseriesOutputCompBase class RungeKuttaTimeseriesOutputComp(TimeseriesOutputCompBase): def setup(self): """ Define the independent variables as output variables. ...
[ "numpy.arange", "numpy.prod" ]
[((1172, 1193), 'numpy.prod', 'np.prod', (['segend_shape'], {}), '(segend_shape)\n', (1179, 1193), True, 'import numpy as np\n'), ((1212, 1234), 'numpy.arange', 'np.arange', (['segend_size'], {}), '(segend_size)\n', (1221, 1234), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- import timeit from skimage import io import numpy as np import os import os.path import random start = timeit.default_timer() im = io.imread('specimen1_data/data3_halfbinned_750vol.tif') grid_type = 'cover_all' #'not_cover_all' NumOfImg =3#plus one of number of cubes in 1D z...
[ "numpy.stack", "os.mkdir", "skimage.io.imsave", "timeit.default_timer", "numpy.array", "numpy.linspace", "os.path.join", "skimage.io.imread" ]
[((136, 158), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (156, 158), False, 'import timeit\n'), ((167, 222), 'skimage.io.imread', 'io.imread', (['"""specimen1_data/data3_halfbinned_750vol.tif"""'], {}), "('specimen1_data/data3_halfbinned_750vol.tif')\n", (176, 222), False, 'from skimage import io...
# -*- coding: utf-8 -*- import numpy as np import pytest from ..prediction import StatePrediction, StateMeasurementPrediction from ..detection import Detection from ..track import Track from ..hypothesis import ( SingleHypothesis, SingleDistanceHypothesis, SingleProbabilityHypothesis, JointHypothesis, ...
[ "pytest.raises", "numpy.array" ]
[((411, 431), 'numpy.array', 'np.array', (['[[1], [0]]'], {}), '([[1], [0]])\n', (419, 431), True, 'import numpy as np\n'), ((485, 505), 'numpy.array', 'np.array', (['[[1], [0]]'], {}), '([[1], [0]])\n', (493, 505), True, 'import numpy as np\n'), ((529, 549), 'numpy.array', 'np.array', (['[[1], [0]]'], {}), '([[1], [0]...
############################################################################################### ### Machine learning -- unsupervised (plus supervised nnet model) import numpy as np import pandas as pd ############################################################################################### #### Unsupervised lear...
[ "pandas.DataFrame", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.show", "scipy.cluster.hierarchy.fcluster", "sklearn.manifold.TSNE", "pandas.read_csv", "sklearn.cluster.KMeans", "matplotlib.pyplot.scatter", "scipy.cluster.hierarchy.linkage", "matplotlib.pyplot.bar", "keras.layers.D...
[((483, 499), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (497, 499), False, 'from sklearn.preprocessing import StandardScaler\n'), ((606, 626), 'sklearn.cluster.KMeans', 'KMeans', ([], {'n_clusters': '(3)'}), '(n_clusters=3)\n', (612, 626), False, 'from sklearn.cluster import KMeans\n')...
# -*- coding: utf-8 -*- """ Created on Mon May 27 10:14:38 2019 @author: YQ """ from tensorflow.keras.preprocessing.sequence import pad_sequences import tensorflow as tf import pickle import numpy as np import itertools class load_noteseqs: def __init__(self, path, x_depth, batch_size=16, augment=True): ...
[ "numpy.random.shuffle", "numpy.roll", "tensorflow.Session", "numpy.ones", "time.time", "tensorflow.keras.preprocessing.sequence.pad_sequences", "tensorflow.data.Dataset.from_generator", "numpy.arange", "itertools.chain.from_iterable", "numpy.concatenate" ]
[((2706, 2718), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (2716, 2718), True, 'import tensorflow as tf\n'), ((2793, 2804), 'time.time', 'time.time', ([], {}), '()\n', (2802, 2804), False, 'import time\n'), ((1110, 1130), 'numpy.random.shuffle', 'np.random.shuffle', (['Z'], {}), '(Z)\n', (1127, 1130), True, ...
import numpy as np import matplotlib.pyplot as plt import math #subprocess.call('git clone https://github.com/mikgroup/sigpy.git') #subprocess.call('pip install sigpy') import sigpy as sp import sigpy.mri import matplotlib.animation as manimation import time # Simulation paramaters Tpe = 0.1*1e-3 # Time for...
[ "numpy.abs", "numpy.ones", "matplotlib.pyplot.figure", "numpy.mean", "numpy.exp", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.imshow", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.draw", "numpy.max", "numpy.linspace", "sigpy.backend.Device", "matplotlib.pyplot.pause", "matplot...
[((451, 500), 'numpy.linspace', 'np.linspace', (['(-Nfreq / 2.0)', '(Nfreq / 2.0)', '(Nfreq + 2)'], {}), '(-Nfreq / 2.0, Nfreq / 2.0, Nfreq + 2)\n', (462, 500), True, 'import numpy as np\n'), ((503, 542), 'numpy.linspace', 'np.linspace', (['(-Npe / 2.0)', '(Npe / 2.0)', 'Npe'], {}), '(-Npe / 2.0, Npe / 2.0, Npe)\n', (5...
import pandas as pd import numpy as np #import re import argparse import sys import pickle from cddm_data_simulation import ddm from cddm_data_simulation import ddm_flexbound from cddm_data_simulation import levy_flexbound from cddm_data_simulation import ornstein_uhlenbeck from cddm_data_simulation import full_ddm fr...
[ "cddm_data_simulation.ornstein_uhlenbeck", "cddm_data_simulation.ddm_flexbound_mic2", "numpy.concatenate", "cddm_data_simulation.levy_flexbound", "cddm_data_simulation.lca", "numpy.asarray", "numpy.zeros", "numpy.expand_dims", "numpy.histogram", "cddm_data_simulation.full_ddm", "cddm_data_simula...
[((3449, 3476), 'numpy.zeros', 'np.zeros', (['(nbins, nchoices)'], {}), '((nbins, nchoices))\n', (3457, 3476), True, 'import numpy as np\n'), ((1027, 1046), 'numpy.zeros', 'np.zeros', (['(nbins + 1)'], {}), '(nbins + 1)\n', (1035, 1046), True, 'import numpy as np\n'), ((1070, 1108), 'numpy.linspace', 'np.linspace', (['...
import cv2 import numpy as np image = cv2.imread('pic\car2.jpg') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # 变成灰度图 # 高斯滤波去噪 blurred = cv2.GaussianBlur(gray, (5, 5), 0, 0, cv2.BORDER_DEFAULT) # 形态学处理,开运算 kernel = np.ones((23, 23), np.uint8) opened = cv2.morphologyEx(blurred, cv2.MORPH_OPEN, kernel) # ...
[ "cv2.GaussianBlur", "cv2.Canny", "cv2.contourArea", "numpy.int0", "cv2.cvtColor", "cv2.morphologyEx", "cv2.threshold", "cv2.imwrite", "numpy.ones", "cv2.addWeighted", "cv2.rectangle", "cv2.imread", "cv2.boxPoints", "numpy.min", "numpy.max", "cv2.minAreaRect", "cv2.imshow", "cv2.fin...
[((42, 69), 'cv2.imread', 'cv2.imread', (['"""pic\\\\car2.jpg"""'], {}), "('pic\\\\car2.jpg')\n", (52, 69), False, 'import cv2\n'), ((79, 118), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '(image, cv2.COLOR_BGR2GRAY)\n', (91, 118), False, 'import cv2\n'), ((149, 205), 'cv2.GaussianBlur', 'cv2...
#This model is modified from DeepZip by Goyal et al from sklearn.metrics import mean_squared_error from sklearn.preprocessing import MinMaxScaler from keras.models import Sequential from keras.layers import Dense, Bidirectional from keras.layers import LSTM, Flatten, Conv1D, LocallyConnected1D, MaxPooling1D, GlobalAver...
[ "tensorflow.random.set_seed", "numpy.load", "numpy.random.seed", "argparse.ArgumentParser", "numpy.log", "keras.callbacks.ModelCheckpoint", "keras.backend.categorical_crossentropy", "sklearn.preprocessing.OneHotEncoder", "keras.optimizers.Adam", "numpy.lib.stride_tricks.as_strided", "keras.callb...
[((865, 887), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(42)'], {}), '(42)\n', (883, 887), True, 'import tensorflow as tf\n'), ((888, 905), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (902, 905), True, 'import numpy as np\n'), ((955, 980), 'argparse.ArgumentParser', 'argparse.ArgumentPar...
import numpy as np from scipy.signal import welch from scipy.stats import skew, kurtosis from scipy.interpolate import Rbf from itertools import permutations, combinations import matplotlib.pyplot as plt def normalizacao(VETOR, metodo='std', r=1): """ Normalizes the values of a single feature. INPUT: - VETOR: va...
[ "numpy.median", "numpy.exp", "numpy.union1d", "numpy.delete" ]
[((1717, 1747), 'numpy.union1d', 'np.union1d', (['inferior', 'superior'], {}), '(inferior, superior)\n', (1727, 1747), True, 'import numpy as np\n'), ((1782, 1806), 'numpy.delete', 'np.delete', (['data', 'indexes'], {}), '(data, indexes)\n', (1791, 1806), True, 'import numpy as np\n'), ((1610, 1625), 'numpy.median', 'n...
""" This tutorial shows you how to use Model Predictive Control with the true model. """ from stable_baselines.common import set_global_seeds from causal_world.envs.causalworld import CausalWorld from causal_world.dynamics_model import SimulatorModel from causal_world.utils.mpc_optimizers import \ CrossEntropyMetho...
[ "stable_baselines.common.set_global_seeds", "causal_world.dynamics_model.SimulatorModel", "numpy.array", "causal_world.envs.causalworld.CausalWorld", "gym.wrappers.monitoring.video_recorder.VideoRecorder" ]
[((1404, 1426), 'stable_baselines.common.set_global_seeds', 'set_global_seeds', (['seed'], {}), '(seed)\n', (1420, 1426), False, 'from stable_baselines.common import set_global_seeds\n'), ((1999, 2074), 'causal_world.envs.causalworld.CausalWorld', 'CausalWorld', ([], {'task': 'task', 'skip_frame': '(1)', 'enable_visual...
import numpy as np from numpy.random import default_rng _rng = default_rng() def roller(dice_size=6, dice_number=1): return _rng.integers(1, dice_size, endpoint=True, size=(dice_number,)) def roll_dice(size=6, number=1, modifier=0, reroll=0): rolls = roller(size, number) if isinstance(reroll, str): ...
[ "numpy.random.default_rng", "numpy.argpartition", "argparse.ArgumentParser", "numpy.argmin" ]
[((64, 77), 'numpy.random.default_rng', 'default_rng', ([], {}), '()\n', (75, 77), False, 'from numpy.random import default_rng\n'), ((1690, 1777), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""simple command line utility for dice roller"""'}), "(description=\n 'simple command line u...
""" A set of functions for running prediction in various settings """ import numpy as np def predict_on_generator(model, generator, argmax=False): """ Takes a tf.keras model and uses it to predict on all batches in a generator Stacks the predictions over all batches on axis 0 (vstack) Args: ...
[ "numpy.zeros", "numpy.vstack" ]
[((1186, 1201), 'numpy.vstack', 'np.vstack', (['pred'], {}), '(pred)\n', (1195, 1201), True, 'import numpy as np\n'), ((3489, 3549), 'numpy.zeros', 'np.zeros', ([], {'shape': '([total_seq_length] + s[2:])', 'dtype': 'np.float64'}), '(shape=[total_seq_length] + s[2:], dtype=np.float64)\n', (3497, 3549), True, 'import nu...
import zipfile import numpy as np import torch from torch.utils.data import Dataset import matplotlib.pyplot as plt class wafer_dataset(Dataset): def __init__(self, transform=None, folder_path=None, test_gen=False): """ :param transform: for augmentation :param folder_path: Data set path ...
[ "numpy.load", "matplotlib.pyplot.show", "zipfile.ZipFile", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.transpose", "matplotlib.pyplot.axis", "matplotlib.pyplot.figtext", "matplotlib.pyplot.figure", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.xlabel", "matplotlib.py...
[((3177, 3187), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3185, 3187), True, 'import matplotlib.pyplot as plt\n'), ((3297, 3314), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'num': '(0)'}), '(num=0)\n', (3307, 3314), True, 'import matplotlib.pyplot as plt\n'), ((3319, 3338), 'matplotlib.pyplot.xlabel...
import re import typing import os import copy import numpy import nidigital from enum import Enum from nidigital import enums from datetime import datetime from nidigital.history_ram_cycle_information import HistoryRAMCycleInformation from nitsm.codemoduleapi import SemiconductorModuleContext class SSCDigital(typing....
[ "os.mkdir", "copy.deepcopy", "re.split", "os.path.basename", "os.path.exists", "re.match", "numpy.shape", "nidigital.Session", "datetime.datetime.now", "os.chdir", "nidigital.history_ram_cycle_information.HistoryRAMCycleInformation" ]
[((7448, 7473), 'os.chdir', 'os.chdir', (['destination_dir'], {}), '(destination_dir)\n', (7456, 7473), False, 'import os\n'), ((24769, 24800), 'numpy.shape', 'numpy.shape', (['per_site_waveforms'], {}), '(per_site_waveforms)\n', (24780, 24800), False, 'import numpy\n'), ((54937, 54969), 'copy.deepcopy', 'copy.deepcopy...
from .params import default_params from scipy.interpolate import interp1d import numpy as np from scipy.stats import binned_statistic as binnedstat """ Covariances We implement the Gaussian covariance between bandpowers. """ def bin_annuli(ells,cls,bin_edges): numer = binnedstat(ells,ells*cls,bins=bin_edges,stati...
[ "numpy.nan_to_num", "scipy.stats.binned_statistic", "numpy.diff", "numpy.arange", "scipy.interpolate.interp1d" ]
[((2359, 2379), 'numpy.diff', 'np.diff', (['ellBinEdges'], {}), '(ellBinEdges)\n', (2366, 2379), True, 'import numpy as np\n'), ((275, 341), 'scipy.stats.binned_statistic', 'binnedstat', (['ells', '(ells * cls)'], {'bins': 'bin_edges', 'statistic': 'np.nanmean'}), '(ells, ells * cls, bins=bin_edges, statistic=np.nanmea...
import os import h5py import numpy as np from keras.callbacks import TensorBoard, TerminateOnNaN from random import choices from conf import conf import tqdm SIZE = conf['SIZE'] BATCH_SIZE = conf['TRAIN_BATCH_SIZE'] EPOCHS_PER_SAVE = conf['EPOCHS_PER_SAVE'] NUM_WORKERS = conf['NUM_WORKERS'] VALIDATION_SPLIT = conf['VA...
[ "h5py.File", "keras.callbacks.TerminateOnNaN", "random.choices", "numpy.zeros", "os.path.join" ]
[((1188, 1204), 'keras.callbacks.TerminateOnNaN', 'TerminateOnNaN', ([], {}), '()\n', (1202, 1204), False, 'from keras.callbacks import TensorBoard, TerminateOnNaN\n'), ((1222, 1260), 'os.path.join', 'os.path.join', (['"""games"""', 'game_model_name'], {}), "('games', game_model_name)\n", (1234, 1260), False, 'import o...
import sys graph_folder="./" if sys.version_info.major < 3 or sys.version_info.minor < 4: print("Please using python3.4 or greater!") exit(1) if len(sys.argv) > 1: graph_folder = sys.argv[1] import pyrealsense2 as rs import numpy as np import cv2 from mvnc import mvncapi as mvnc from os import system impo...
[ "cv2.resize", "traceback.print_exc", "cv2.putText", "mvnc.mvncapi.Device", "pyrealsense2.pipeline", "cv2.waitKey", "cv2.getTextSize", "sys.exit", "time.perf_counter", "pyrealsense2.config", "numpy.isfinite", "cv2.namedWindow", "cv2.rectangle", "mvnc.mvncapi.global_set_option", "os.path.j...
[((646, 703), 'mvnc.mvncapi.global_set_option', 'mvnc.global_set_option', (['mvnc.GlobalOption.RW_LOG_LEVEL', '(2)'], {}), '(mvnc.GlobalOption.RW_LOG_LEVEL, 2)\n', (668, 703), True, 'from mvnc import mvncapi as mvnc\n'), ((714, 738), 'mvnc.mvncapi.enumerate_devices', 'mvnc.enumerate_devices', ([], {}), '()\n', (736, 73...
if __name__ == "__main__": import numpy as np # generate the boundary f = lambda x: (5 * x + 1) bd_x = np.linspace(-1.0, 1, 200) bd_y = f(bd_x) # generate the training data input_size = 400* 1024 x = np.random.uniform(-1, 1, input_size) y = f(x) + 2 * np.random.randn(len(x)) # co...
[ "numpy.random.uniform", "numpy.linspace" ]
[((119, 144), 'numpy.linspace', 'np.linspace', (['(-1.0)', '(1)', '(200)'], {}), '(-1.0, 1, 200)\n', (130, 144), True, 'import numpy as np\n'), ((232, 268), 'numpy.random.uniform', 'np.random.uniform', (['(-1)', '(1)', 'input_size'], {}), '(-1, 1, input_size)\n', (249, 268), True, 'import numpy as np\n')]
"""Classes and methods for Multi-output Gaussian process""" import tqdm import numpy as np import pandas as pd import torch import gpytorch from gpytorch.models import ApproximateGP from gpytorch.variational import CholeskyVariationalDistribution, LMCVariationalStrategy, VariationalStrategy from gpytorch.distribution...
[ "gpytorch.variational.VariationalStrategy", "botorch.utils.transforms.t_batch_mode_transform", "numpy.sum", "botorch.posteriors.gpytorch.GPyTorchPosterior", "torch.cat", "torch.vstack", "numpy.arange", "botorch.optim.stopping.ExpMAStoppingCriterion", "torch.utils.data.TensorDataset", "numpy.random...
[((20217, 20408), 'botorch.optim.optimize_acqf', 'optimize_acqf', ([], {'acq_function': 'acq_func', 'bounds': 'standard_bounds', 'q': 'q', 'num_restarts': '(20)', 'raw_samples': '(1024)', 'options': "{'batch_limit': 10, 'maxiter': 200, 'nonnegative': True}", 'sequential': '(True)'}), "(acq_function=acq_func, bounds=sta...
""" Utility functions for configuring ebtel++ simulations """ import os import subprocess import warnings from collections import OrderedDict import tempfile import xml.etree.ElementTree as ET import xml.dom.minidom as xdm import numpy as np __all__ = ['run_ebtel', 'read_xml', 'write_xml'] class EbtelPlusPlusError(...
[ "xml.etree.ElementTree.parse", "tempfile.TemporaryDirectory", "xml.dom.minidom.parseString", "xml.etree.ElementTree.Element", "xml.etree.ElementTree.SubElement", "numpy.loadtxt", "xml.etree.ElementTree.tostring", "collections.OrderedDict", "warnings.warn", "os.path.join" ]
[((2441, 2465), 'xml.etree.ElementTree.parse', 'ET.parse', (['input_filename'], {}), '(input_filename)\n', (2449, 2465), True, 'import xml.etree.ElementTree as ET\n'), ((4583, 4601), 'xml.etree.ElementTree.Element', 'ET.Element', (['"""root"""'], {}), "('root')\n", (4593, 4601), True, 'import xml.etree.ElementTree as E...
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # <NAME> # California Institute of Technology # (C) 2007 All Rights Reserved # # {LicenseText} # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
[ "sampleassembly.cross_sections", "numpy.allclose", "mccomponents.homogeneous_scatterer.registerRendererExtension", "journal.debug" ]
[((414, 462), 'journal.debug', 'journal.debug', (['"""mccomponents.sample.diffraction"""'], {}), "('mccomponents.sample.diffraction')\n", (427, 462), False, 'import journal\n'), ((5172, 5233), 'mccomponents.homogeneous_scatterer.registerRendererExtension', 'registerRendererExtension', (['ComputationEngineRendererExtens...
import os import csv import ipdb import time import yaml import random import argparse from collections import OrderedDict import numpy as np # Local imports from train_baseline import cnn_val_loss if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--config', type=str, ...
[ "yaml.load", "numpy.random.seed", "argparse.ArgumentParser", "os.makedirs", "random.uniform", "numpy.log", "os.path.exists", "time.time", "train_baseline.cnn_val_loss", "collections.OrderedDict", "os.path.join" ]
[((243, 268), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (266, 268), False, 'import argparse\n'), ((756, 781), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (770, 781), True, 'import numpy as np\n'), ((1240, 1253), 'collections.OrderedDict', 'OrderedDict', ([]...
import cv2 as cv import numpy as np import argparse import math import tensorsTools from tensorsTools import Tensor from tensorsTools import VectorField from tensorsTools import Bar def get_args(sigma1,sigma2,p1,p2,n,epsilon,L,coeff,output): parser = argparse.ArgumentParser() parser.add_argument("-i","--image"...
[ "cv2.GaussianBlur", "numpy.uint8", "argparse.ArgumentParser", "tensorsTools.Timer", "tensorsTools.draw_ellipses_G", "tensorsTools.Bar", "numpy.zeros", "tensorsTools.draw_strokes", "tensorsTools.VectorField", "tensorsTools.draw_ellipses_T", "numpy.array", "cv2.eigen", "numpy.float64", "cv2....
[((256, 281), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (279, 281), False, 'import argparse\n'), ((1902, 1939), 'cv2.GaussianBlur', 'cv.GaussianBlur', (['img', '(15, 15)', 'sigma'], {}), '(img, (15, 15), sigma)\n', (1917, 1939), True, 'import cv2 as cv\n'), ((2083, 2126), 'cv2.Sobel', 'cv....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ============================================================================= __author__ = "<NAME>" __email__ = "<EMAIL>" __copyright__ = "Copyright 2020 - <NAME>" __license__ = "MIT" __version__ = "1.0" # ===============================================================...
[ "h5py.File", "tqdm.tqdm", "aertb.core.types.EvSample", "random.Random", "logging.info", "os.path.isfile", "numpy.array", "random.seed", "os.path.splitext", "aertb.core.types.Sample", "click.secho", "os.path.join", "aertb.core.loaders.get_loader", "os.scandir", "os.path.split" ]
[((11934, 11972), 'logging.info', 'logging.info', (['f"""Processing {dir_path}"""'], {}), "(f'Processing {dir_path}')\n", (11946, 11972), False, 'import logging\n'), ((12131, 12168), 'logging.info', 'logging.info', (['f"""Files: {valid_files}"""'], {}), "(f'Files: {valid_files}')\n", (12143, 12168), False, 'import logg...
import numpy as np PROVERMAP = {'Z3-4.4.1': 'Z', 'Z3-4.3.2':'z', 'CVC4':'4', 'CVC3':'3', 'Yices':'y', 'veriT':'v', 'Alt-Ergo-0.95.2':'a', 'Alt-Ergo-1.01':'A'} REV_MAP = {val:key for key, val in PROVERMAP.iteritems()} PROVERS = ['Z3-4.4.1', 'Z3-4.3.2','CVC3','CVC4','Yices','veriT','Alt-Ergo-1.01', 'Alt-Ergo-0.95.2'...
[ "numpy.log2", "numpy.mean", "numpy.array", "numpy.random.choice", "numpy.random.permutation", "numpy.random.shuffle" ]
[((2438, 2458), 'numpy.random.shuffle', 'np.random.shuffle', (['l'], {}), '(l)\n', (2455, 2458), True, 'import numpy as np\n'), ((2575, 2599), 'numpy.random.choice', 'np.random.choice', (['OUTPUT'], {}), '(OUTPUT)\n', (2591, 2599), True, 'import numpy as np\n'), ((4040, 4055), 'numpy.mean', 'np.mean', (['errors'], {}),...