code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python # coding: utf-8 'import the libiary and function' import os import csv import re import pandas as pd import cv2 import numpy as np import tensorflow as tf import math import matplotlib.pyplot as plt import sklearn from keras.utils import normalize from sklearn.model_selection import train_test_spl...
[ "csv.reader", "keras.layers.Cropping2D", "sklearn.model_selection.train_test_split", "numpy.arange", "keras.layers.core.Flatten", "matplotlib.pyplot.imread", "pandas.DataFrame", "cv2.cvtColor", "os.path.exists", "keras.layers.core.Dropout", "cv2.resize", "keras.layers.core.Dense", "keras.cal...
[((645, 674), 'os.listdir', 'os.listdir', (['"""SimulationData/"""'], {}), "('SimulationData/')\n", (655, 674), False, 'import os\n'), ((2826, 2866), 'sklearn.model_selection.train_test_split', 'train_test_split', (['samples'], {'test_size': '(0.2)'}), '(samples, test_size=0.2)\n', (2842, 2866), False, 'from sklearn.mo...
"""***************************************************************************************** MIT License Copyright (c) 2019 <NAME>, <NAME>, <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 So...
[ "numpy.sum", "numpy.abs", "numpy.einsum", "numpy.ones", "numpy.argmin", "numpy.linalg.svd", "numpy.arange", "sklearn.linear_model.RidgeCV", "sklearn.linear_model.ElasticNetCV", "numpy.append", "math.ceil", "sklearn.linear_model.LinearRegression", "numpy.min", "numpy.concatenate", "sklear...
[((3996, 4005), 'numpy.sum', 'np.sum', (['u'], {}), '(u)\n', (4002, 4005), True, 'import numpy as np\n'), ((4041, 4057), 'math.ceil', 'math.ceil', (['(n / m)'], {}), '(n / m)\n', (4050, 4057), False, 'import math\n'), ((4073, 4098), 'math.ceil', 'math.ceil', (['(n / chunk_size)'], {}), '(n / chunk_size)\n', (4082, 4098...
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of the udkm1Dsimpy module. # # udkm1Dsimpy is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your opti...
[ "numpy.conj", "numpy.zeros_like", "numpy.isscalar", "numpy.zeros", "time.time", "numpy.array", "numpy.exp" ]
[((2914, 2929), 'numpy.isscalar', 'np.isscalar', (['qz'], {}), '(qz)\n', (2925, 2929), True, 'import numpy as np\n'), ((3557, 3563), 'time.time', 'time', ([], {}), '()\n', (3561, 3563), False, 'from time import time\n'), ((3714, 3737), 'numpy.zeros_like', 'np.zeros_like', (['self._qz'], {}), '(self._qz)\n', (3727, 3737...
"""This is a test script for tracing back beta Pictoris stars. This code is redundant. Some bits can be incorporated into other sections. """ from __future__ import print_function, division import numpy as np import matplotlib.pyplot as plt from astropy.table import Table from chronostar.retired.error_ellipse import ...
[ "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.ion", "chronostar.traceback.TraceBack", "numpy.array", "numpy.linspace", "chronostar.retired.error_ellipse.plot_cov_ellipse", "astropy.table.Table.read" ]
[((378, 387), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (385, 387), True, 'import matplotlib.pyplot as plt\n'), ((481, 511), 'astropy.table.Table.read', 'Table.read', (['"""data/betaPic.csv"""'], {}), "('data/betaPic.csv')\n", (491, 511), False, 'from astropy.table import Table\n'), ((676, 698), 'numpy.lins...
import unittest from setup.settings import * from numpy.testing import * from pandas.util.testing import * import numpy as np import dolphindb_numpy as dnp import pandas as pd import orca class FunctionAmaxTest(unittest.TestCase): @classmethod def setUpClass(cls): # connect to a DolphinDB server ...
[ "unittest.main", "pandas.DataFrame", "dolphindb_numpy.array", "orca.connect", "orca.Series", "numpy.amax", "numpy.array", "pandas.Series", "dolphindb_numpy.amax", "orca.DataFrame" ]
[((2082, 2097), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2095, 2097), False, 'import unittest\n'), ((324, 367), 'orca.connect', 'orca.connect', (['HOST', 'PORT', '"""admin"""', '"""123456"""'], {}), "(HOST, PORT, 'admin', '123456')\n", (336, 367), False, 'import orca\n'), ((799, 837), 'numpy.amax', 'np.amax...
import os import tensorflow as tf from PIL import Image import sys import numpy as np import matplotlib.pyplot as plt def creat_tf(imgpath): cwd = os.getcwd() classes = os.listdir(cwd + imgpath) writer = tf.python_io.TFRecordWriter("New 3 labels.tfrecords") for index, name in...
[ "tensorflow.train.Coordinator", "tensorflow.train.shuffle_batch", "tensorflow.reshape", "tensorflow.decode_raw", "numpy.arange", "tensorflow.python_io.tf_record_iterator", "tensorflow.train.Example", "matplotlib.pyplot.imshow", "tensorflow.train.start_queue_runners", "tensorflow.cast", "tensorfl...
[((164, 175), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (173, 175), False, 'import os\n'), ((191, 216), 'os.listdir', 'os.listdir', (['(cwd + imgpath)'], {}), '(cwd + imgpath)\n', (201, 216), False, 'import os\n'), ((237, 290), 'tensorflow.python_io.TFRecordWriter', 'tf.python_io.TFRecordWriter', (['"""New 3 labels.t...
# Copyright (c) <NAME>, 2020. Distributed under MIT license """ The MPDS workflow for AiiDA that gets structure with MPDS query """ import os import time import random import numpy as np from aiida_crystal_dft.utils import get_data_class from mpds_client import MPDSDataRetrieval, APIError from .crystal import MPDSCry...
[ "numpy.sum", "mpds_client.MPDSDataRetrieval", "numpy.median", "os.getenv", "aiida_crystal_dft.utils.get_data_class" ]
[((1033, 1054), 'os.getenv', 'os.getenv', (['"""MPDS_KEY"""'], {}), "('MPDS_KEY')\n", (1042, 1054), False, 'import os\n'), ((1153, 1187), 'mpds_client.MPDSDataRetrieval', 'MPDSDataRetrieval', ([], {'api_key': 'api_key'}), '(api_key=api_key)\n', (1170, 1187), False, 'from mpds_client import MPDSDataRetrieval, APIError\n...
# coding=utf-8 # Copyright 2018 Ubisoft La Forge 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 r...
[ "functools.partial", "json.dump", "utils.launch_multi_process", "pickle.dump", "argparse.ArgumentParser", "os.makedirs", "utils.get_nb_jobs", "os.path.realpath", "os.path.dirname", "numpy.zeros", "time.time", "utils.get_artificial_factors_dataset", "pickle.load", "numpy.mean", "utils.get...
[((1056, 1074), 'utils.get_nb_jobs', 'get_nb_jobs', (['"""max"""'], {}), "('max')\n", (1067, 1074), False, 'from utils import estimate_required_time, get_artificial_factors_dataset, get_experiment_seeds, get_nb_jobs, get_score, launch_multi_process, plot_curves\n'), ((1374, 1501), 'utils.get_artificial_factors_dataset'...
# Lint as: python3 # Copyright 2019 DeepMind Technologies Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # #...
[ "ferminet.utils.system.Atom", "absl.testing.absltest.main", "ferminet.utils.scf.Scf", "numpy.random.randn" ]
[((3267, 3282), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (3280, 3282), False, 'from absl.testing import absltest\n'), ((2801, 2825), 'numpy.random.randn', 'np.random.randn', (['npts', '(3)'], {}), '(npts, 3)\n', (2816, 2825), True, 'import numpy as np\n'), ((2835, 2907), 'ferminet.utils.scf.Scf'...
import os import pygame import torch import numpy as np from PIL import Image from lib.CAModel2 import CAModel2 from lib.displayer import displayer from lib.utils import mat_distance from lib.CAModel import CAModel from lib.utils_vis import to_rgb, make_seed from unpad import replicate_edges def get_mask(mask_path='...
[ "lib.utils.mat_distance", "lib.CAModel2.CAModel2", "pygame.event.get", "lib.utils_vis.make_seed", "numpy.expand_dims", "PIL.Image.open", "numpy.array", "lib.displayer.displayer", "numpy.arange", "torch.device", "PIL.Image.fromarray", "unpad.replicate_edges", "torch.from_numpy" ]
[((376, 397), 'PIL.Image.open', 'Image.open', (['mask_path'], {}), '(mask_path)\n', (386, 397), False, 'from PIL import Image\n'), ((441, 453), 'numpy.array', 'np.array', (['im'], {}), '(im)\n', (449, 453), True, 'import numpy as np\n'), ((575, 601), 'numpy.expand_dims', 'np.expand_dims', (['im_arr', '(-1)'], {}), '(im...
import os from operator import itemgetter from collections import defaultdict import numpy as np from tqdm import tqdm from .base import Base from ..utils.misc import time_block, colorize from ..evaluation.evaluate import EvalMixin from ..embedding import Item2Vec class KnnEmbedding(Base, EvalMixin): def __init__...
[ "numpy.stack", "numpy.partition", "numpy.asarray", "numpy.transpose", "collections.defaultdict", "numpy.argpartition", "os.cpu_count", "numpy.mean", "numpy.arange", "numpy.linalg.norm", "hnswlib.Index", "operator.itemgetter" ]
[((3303, 3328), 'collections.defaultdict', 'defaultdict', (['(lambda : 0.0)'], {}), '(lambda : 0.0)\n', (3314, 3328), False, 'from collections import defaultdict\n'), ((4972, 4989), 'numpy.asarray', 'np.asarray', (['top_k'], {}), '(top_k)\n', (4982, 4989), True, 'import numpy as np\n'), ((7513, 7536), 'numpy.arange', '...
import numpy from PIL import Image, ImageDraw # polygon = [(x1,y1),(x2,y2),...] or [x1,y1,x2,y2,...] # width = ? # height = ? img = Image.new('L', (width, height), 0) ImageDraw.Draw(img).polygon(polygon, outline=1, fill=1) mask = numpy.array(img)
[ "PIL.ImageDraw.Draw", "PIL.Image.new", "numpy.array" ]
[((134, 168), 'PIL.Image.new', 'Image.new', (['"""L"""', '(width, height)', '(0)'], {}), "('L', (width, height), 0)\n", (143, 168), False, 'from PIL import Image, ImageDraw\n'), ((232, 248), 'numpy.array', 'numpy.array', (['img'], {}), '(img)\n', (243, 248), False, 'import numpy\n'), ((169, 188), 'PIL.ImageDraw.Draw', ...
""" =============================== Save a 2D static flatmap as SVG =============================== Plot a 2D static flatmap and save it as SVG file. **Some words on the `rechache` parameter before we begin:** Setting the `recache=True` parameter recaches the flatmap cache located in <filestore>/<subject>/cache. By ...
[ "matplotlib.pyplot.show", "numpy.random.seed", "cortex.Volume.random", "cortex.quickflat.make_png", "cortex.quickflat.make_figure" ]
[((892, 912), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (906, 912), True, 'import numpy as np\n'), ((957, 1011), 'cortex.Volume.random', 'cortex.Volume.random', ([], {'subject': '"""S1"""', 'xfmname': '"""fullhead"""'}), "(subject='S1', xfmname='fullhead')\n", (977, 1011), False, 'import cort...
import cv2 import numpy as np import pyk4a from pyk4a import Config, PyK4A def main(): k4a = PyK4A( Config( color_resolution=pyk4a.ColorResolution.RES_720P, depth_mode=pyk4a.DepthMode.NFOV_UNBINNED, synchronized_images_only=True, ) ) k4a.start() # ...
[ "cv2.waitKey", "cv2.destroyAllWindows", "numpy.any", "pyk4a.Config", "cv2.imshow" ]
[((115, 248), 'pyk4a.Config', 'Config', ([], {'color_resolution': 'pyk4a.ColorResolution.RES_720P', 'depth_mode': 'pyk4a.DepthMode.NFOV_UNBINNED', 'synchronized_images_only': '(True)'}), '(color_resolution=pyk4a.ColorResolution.RES_720P, depth_mode=pyk4a.\n DepthMode.NFOV_UNBINNED, synchronized_images_only=True)\n',...
from torch.utils.data import Dataset from torchvision import transforms, utils import numpy as np from scipy import ndimage import torch from PIL import Image class ICLRDataset(Dataset): def __init__(self, imgs, gts, split_type, index, transform, img_mix_enable = True): if index is None: self.i...
[ "PIL.Image.fromarray", "numpy.random.random" ]
[((720, 739), 'numpy.random.random', 'np.random.random', (['(1)'], {}), '(1)\n', (736, 739), True, 'import numpy as np\n'), ((1182, 1202), 'PIL.Image.fromarray', 'Image.fromarray', (['img'], {}), '(img)\n', (1197, 1202), False, 'from PIL import Image\n'), ((957, 992), 'PIL.Image.fromarray', 'Image.fromarray', (['self.i...
import random import json import numpy as np from tensorflow.keras.models import Sequential, load_model from tensorflow.keras.layers import Dense from tensorflow.keras.utils import plot_model from tensorflow.keras.metrics import AUC from tensorflow.keras.losses import MeanSquaredError from tensorflow.keras.callbacks i...
[ "tensorflow.keras.metrics.AUC", "tensorflow.keras.models.load_model", "tensorflow.keras.losses.MeanSquaredError", "numpy.argmax", "tensorflow.keras.layers.Dense", "tensorflow.keras.backend.clear_session", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.utils.plot_model", "numpy.array...
[((6064, 6076), 'tensorflow.keras.models.Sequential', 'Sequential', ([], {}), '()\n', (6074, 6076), False, 'from tensorflow.keras.models import Sequential, load_model\n'), ((7066, 7129), 'numpy.concatenate', 'np.concatenate', (['(current_table, next_table, goal_table)'], {'axis': '(0)'}), '((current_table, next_table, ...
import numpy as np import pandas as pd from scipy import sparse, ndimage as ndi from scipy.sparse import csgraph from scipy import spatial import numba from .nputil import pad, raveled_steps_to_neighbors ## NBGraph and Numba-based implementation csr_spec = [ ('indptr', numba.int32[:]), ('indices', numba.int...
[ "numpy.sum", "numpy.maximum", "numpy.empty", "numpy.ones", "numpy.add.reduceat", "numpy.clip", "numpy.argsort", "numpy.arange", "scipy.sparse.csgraph.connected_components", "numpy.unique", "numpy.full", "pandas.DataFrame", "numpy.transpose", "numpy.cumsum", "numpy.max", "scipy.sparse.c...
[((437, 461), 'numba.jitclass', 'numba.jitclass', (['csr_spec'], {}), '(csr_spec)\n', (451, 461), False, 'import numba\n'), ((1819, 1867), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)', 'cache': '(True)', 'nogil': '(True)'}), '(nopython=True, cache=True, nogil=True)\n', (1828, 1867), False, 'import numba\n'), ((...
#!/usr/bin/env python #################################################################### ### This is the PYTHON version of program 6.4 from page 203 of # ### "Modeling Infectious Disease in humans and animals" # ### by Keeling & Rohani. # ### # ### It is the SIR model (in...
[ "pylab.ceil", "pylab.show", "pylab.ylabel", "numpy.zeros", "pylab.floor", "pylab.subplot", "pylab.find", "numpy.array", "numpy.arange", "pylab.xlabel", "numpy.random.poisson", "pylab.plot" ]
[((1310, 1334), 'pylab.ceil', 'pl.ceil', (['(mu * N0 / gamma)'], {}), '(mu * N0 / gamma)\n', (1317, 1334), True, 'import pylab as pl\n'), ((1340, 1367), 'pylab.floor', 'pl.floor', (['(gamma * N0 / beta)'], {}), '(gamma * N0 / beta)\n', (1348, 1367), True, 'import pylab as pl\n'), ((1404, 1426), 'numpy.array', 'np.array...
import numpy as np arr1 = np.array([1, 2, 3, 4, 5, 6, 7, 8]) new_arr = np.array_split(arr1, 3) print(new_arr) ## Note: We also have the method split() available but it will not adjust the elements when elements are less in source array for # splitting like in example above, array_split() worked properly but split()...
[ "numpy.array_split", "numpy.array", "numpy.hsplit" ]
[((27, 61), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6, 7, 8]'], {}), '([1, 2, 3, 4, 5, 6, 7, 8])\n', (35, 61), True, 'import numpy as np\n'), ((72, 95), 'numpy.array_split', 'np.array_split', (['arr1', '(3)'], {}), '(arr1, 3)\n', (86, 95), True, 'import numpy as np\n'), ((457, 518), 'numpy.array', 'np.array', (['...
# Copyright 2017 Battelle Energy Alliance, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
[ "AMSC.AMSC_Object.AMSC_Object", "utils.InputData.parameterInputFactory", "numpy.zeros", "time.sleep", "PySide2.QtCore.Signal" ]
[((1936, 2011), 'utils.InputData.parameterInputFactory', 'InputData.parameterInputFactory', (['"""graph"""'], {'contentType': 'InputTypes.StringType'}), "('graph', contentType=InputTypes.StringType)\n", (1967, 2011), False, 'from utils import InputData, InputTypes\n'), ((2079, 2157), 'utils.InputData.parameterInputFact...
""" Copyright 2018 Johns Hopkins University (Author: <NAME>) Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """ import logging import numpy as np from scipy.special import gammaln from ..hyp_defs import float_cpu from ..hyp_model import HypModel from ..utils.math import int2onehot, logdet_pdmat, invert_p...
[ "numpy.outer", "logging.debug", "numpy.log", "numpy.sum", "numpy.max", "scipy.special.gammaln", "numpy.dot" ]
[((5791, 5813), 'logging.debug', 'logging.debug', (['self.nu'], {}), '(self.nu)\n', (5804, 5813), False, 'import logging\n'), ((5822, 5838), 'logging.debug', 'logging.debug', (['c'], {}), '(c)\n', (5835, 5838), False, 'import logging\n'), ((5847, 5872), 'logging.debug', 'logging.debug', (['self.x_dim'], {}), '(self.x_d...
import numpy as np from pathlib import Path from typing import List from tensorflow.keras.models import load_model from tensorflow.keras.layers import Input, Conv1D, BatchNormalization from tensorflow.keras.layers import MaxPooling1D, Dropout, Flatten, Dense from tensorflow.keras.losses import Reduction from tensorfl...
[ "tensorflow.keras.models.load_model", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "tensorflow.keras.regularizers.l2", "tensorflow.keras.layers.MaxPooling1D", "tensorflow_addons.optimizers.LazyAdam", "tensorflow.keras.Model", "nump...
[((1847, 1867), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '(81, 4)'}), '(shape=(81, 4))\n', (1852, 1867), False, 'from tensorflow.keras.layers import Input, Conv1D, BatchNormalization\n'), ((3115, 3151), 'tensorflow.keras.Model', 'Model', ([], {'inputs': 'input_', 'outputs': 'output'}), '(inputs=input_, ...
# -*- coding: utf-8 -*- ''' 该文件为可视化界面定义文件,设置基本布局样式及功能响应 ''' from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QMessageBox from PyQt5.QtWidgets import * from PyQt5.QtCore import * import pandas as pd import numpy as np class Ui_Form(object): def ...
[ "PyQt5.QtWidgets.QLabel", "PyQt5.QtWidgets.QSizePolicy", "PyQt5.QtGui.QIcon", "PyQt5.QtWidgets.QWidget", "PyQt5.QtWidgets.QTableWidget", "PyQt5.QtWidgets.QTextEdit", "PyQt5.QtWidgets.QFileDialog.getExistingDirectory", "PyQt5.QtCore.QRect", "PyQt5.QtWidgets.QLineEdit", "PyQt5.QtWidgets.QPushButton"...
[((425, 438), 'PyQt5.QtGui.QFont', 'QtGui.QFont', ([], {}), '()\n', (436, 438), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((580, 606), 'PyQt5.QtWidgets.QTabWidget', 'QtWidgets.QTabWidget', (['Form'], {}), '(Form)\n', (600, 606), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((696, 788), 'PyQt5.Q...
from nisnap.utils.aseg import basal_ganglia_labels, cortical_labels from nisnap.utils.aseg import amygdala_nuclei, hippocampal_subfields __format__ = '.png' def pick_labels(data, labels): """Replaces all values by zero in a Numpy array (`data`) except values passed in `labels`. Used to select some specific l...
[ "numpy.isin", "numpy.argmax", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "numpy.arange", "os.close", "matplotlib.pyplot.contour", "nisnap.utils.montage.__montage__", "numpy.unique", "matplotlib.colors.Normalize", "logging.warning", "matplotlib.cm.ScalarMappable", "os.path.dir...
[((925, 938), 'numpy.array', 'np.array', (['LUT'], {}), '(LUT)\n', (933, 938), True, 'import numpy as np\n'), ((1414, 1450), 'numpy.arange', 'np.arange', (['num_labels'], {'dtype': '"""int16"""'}), "(num_labels, dtype='int16')\n", (1423, 1450), True, 'import numpy as np\n'), ((1513, 1565), 'matplotlib.colors.Normalize'...
import pathlib import shutil import tempfile import numpy as np from PyQt5.QtTest import QTest from PyQt5.QtCore import Qt, QPoint, QTimer, QSettings from PyQt5.QtWidgets import QToolBar, QComboBox from OpenGL.plugins import FormatHandler from sscanss.app.dialogs import (InsertPrimitiveDialog, TransformDialog, SampleMa...
[ "tests.helpers.edit_line_edit_text", "tests.helpers.click_list_widget_item", "PyQt5.QtTest.QTest.mouseClick", "sscanss.config.settings.value", "shutil.rmtree", "numpy.testing.assert_array_almost_equal", "sscanss.config.setup_logging", "sscanss.config.settings.setValue", "tests.helpers.click_check_bo...
[((1228, 1263), 'logging.disable', 'logging.disable', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (1243, 1263), False, 'import logging\n'), ((1611, 1721), 'OpenGL.plugins.FormatHandler', 'FormatHandler', (['"""sscanss"""', '"""OpenGL.arrays.numpymodule.NumpyHandler"""', "['sscanss.core.math.matrix.Matrix...
#!/usr/bin/env python """ sampling funtion for 10_phase segment, it takes as argument: 1. start time/pos/vel 2. jerk value and duration of each phase 3. the time instant at which we need to calculate pos, vel, acc, jrk and returns pos, vel, acc, jrk at that time instant """ import numpy as np def find_phase(t, phase...
[ "numpy.asarray", "numpy.searchsorted" ]
[((499, 522), 'numpy.asarray', 'np.asarray', (['phase_times'], {}), '(phase_times)\n', (509, 522), True, 'import numpy as np\n'), ((532, 576), 'numpy.searchsorted', 'np.searchsorted', (['phase_times', 't'], {'side': '"""left"""'}), "(phase_times, t, side='left')\n", (547, 576), True, 'import numpy as np\n')]
# references: # https://github.com/weigq/3d_pose_baseline_pytorch/blob/master/src/datasets/human36m.py # https://github.com/una-dinosauria/3d-pose-baseline/blob/master/src/linear_model.py#L247 import numpy as np import torch from torch.utils.data import Dataset class Human36M(Dataset): def __init__(self, pose_se...
[ "numpy.array", "numpy.vstack", "torch.from_numpy" ]
[((1415, 1439), 'numpy.vstack', 'np.vstack', (['self.poses_2d'], {}), '(self.poses_2d)\n', (1424, 1439), True, 'import numpy as np\n'), ((1479, 1503), 'numpy.vstack', 'np.vstack', (['self.poses_3d'], {}), '(self.poses_3d)\n', (1488, 1503), True, 'import numpy as np\n'), ((1548, 1570), 'numpy.array', 'np.array', (['self...
""" Dataset generation file for the training of the neural network Section [3.1] of project report. Author: <NAME> """ import numpy as np import tqdm outputdir="C:\\Users\\Eliott\\Desktop\\cse-project\\reportdata\\" #%% initial functions & schemes def fstep(x, x1): return (1 + np.tanh(100*(x-x1)))/2 def fwall...
[ "matplotlib.pyplot.show", "numpy.tanh", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.array", "numpy.arange", "numpy.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((1371, 1398), 'numpy.linspace', 'np.linspace', (['(0.1)', '(0.7)', 'size'], {}), '(0.1, 0.7, size)\n', (1382, 1398), True, 'import numpy as np\n'), ((1585, 1612), 'numpy.linspace', 'np.linspace', (['(0.2)', '(0.4)', 'size'], {}), '(0.2, 0.4, size)\n', (1596, 1612), True, 'import numpy as np\n'), ((1618, 1645), 'numpy...
from pypy.module.micronumpy.test.test_base import BaseNumpyAppTest class AppTestSorting(BaseNumpyAppTest): def test_argsort_dtypes(self): from numpy import array, arange assert array(2.0).argsort() == 0 nnp = self.non_native_prefix for dtype in ['int', 'float', 'int16', 'float32', '...
[ "math.isnan", "numpy.empty", "numpy.dtype", "numpy.zeros", "_random.Random", "numpy.array", "numpy.arange", "numpy.fromstring" ]
[((904, 927), 'numpy.array', 'array', (['[[4, 2], [1, 3]]'], {}), '([[4, 2], [1, 3]])\n', (909, 927), False, 'from numpy import array, dtype\n'), ((1607, 1616), '_random.Random', 'Random', (['(1)'], {}), '(1)\n', (1613, 1616), False, 'from _random import Random\n'), ((1786, 1795), 'numpy.array', 'array', (['[]'], {}), ...
###################################################################### # # # Copyright 2009 <NAME>. # # This file is part of gdspy, distributed under the terms of the # # Boost Software License - Version 1.0. See the accom...
[ "numpy.arctan2", "future.standard_library.install_aliases", "numpy.empty", "gdspy.clipper._chop", "builtins.round", "numpy.sin", "numpy.arange", "numpy.inner", "numpy.round", "builtins.range", "numpy.full_like", "numpy.format_float_positional", "struct.pack", "numpy.tan", "numpy.linspace...
[((1502, 1526), 'numpy.array', 'numpy.array', (['(-1.0, 1.0)'], {}), '((-1.0, 1.0))\n', (1513, 1526), False, 'import numpy\n'), ((96425, 96449), 'numpy.array', 'numpy.array', (['(1.0, -1.0)'], {}), '((1.0, -1.0))\n', (96436, 96449), False, 'import numpy\n'), ((970, 1004), 'future.standard_library.install_aliases', 'sta...
import sys from model import TransformerDST from pytorch_transformers import BertTokenizer, AdamW, WarmupLinearSchedule, BertConfig from utils.data_utils import prepare_dataset, MultiWozDataset from utils.data_utils import ( make_slot_meta, domain2id, OP_SET, make_turn_label, postprocessing, ) from ...
[ "os.mkdir", "numpy.random.seed", "argparse.ArgumentParser", "pytorch_transformers.BertConfig.from_json_file", "evaluation.model_evaluation", "torch.cuda.device_count", "sys.stdout.flush", "pytorch_transformers.BertTokenizer", "torch.device", "os.path.join", "torch.gather", "random.Random", "...
[((878, 900), 'torch.log', 'torch.log', (['logits_flat'], {}), '(logits_flat)\n', (887, 900), False, 'import torch\n'), ((1969, 2011), 'torch.load', 'torch.load', (['model_file'], {'map_location': '"""cpu"""'}), "(model_file, map_location='cpu')\n", (1979, 2011), False, 'import torch\n'), ((2116, 2162), 'torch.load', '...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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...
[ "paddle.nn.functional.softmax", "numpy.zeros", "paddle.no_grad", "numpy.array", "paddle.to_tensor" ]
[((2109, 2127), 'numpy.array', 'np.array', (['bboxlist'], {}), '(bboxlist)\n', (2117, 2127), True, 'import numpy as np\n'), ((3567, 3585), 'numpy.array', 'np.array', (['bboxlist'], {}), '(bboxlist)\n', (3575, 3585), True, 'import numpy as np\n'), ((895, 920), 'numpy.array', 'np.array', (['[104, 117, 123]'], {}), '([104...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import datetime import os import glob import random import imgaug from imgaug import augmenters as iaa from PIL import Image from tqdm import tqdm import matplotlib.pyplot as plt import openslid...
[ "matplotlib.pyplot.title", "numpy.random.seed", "numpy.sum", "ipdb.set_trace", "numpy.ones", "tensorflow.ConfigProto", "gc.collect", "matplotlib.pyplot.figure", "cv2.rectangle", "numpy.round", "os.path.join", "openslide.OpenSlide", "models.deeplabv3p_original.Deeplabv3", "numpy.zeros_like"...
[((1430, 1447), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1444, 1447), True, 'import numpy as np\n'), ((1448, 1462), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (1459, 1462), False, 'import random\n'), ((1463, 1484), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(0)'], {}), '(0)...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy.testing import assert_allclose from astropy import units as u from astropy.coordinates import SkyCoord from astropy.io import fits from gammapy.maps import HpxGeom, HpxMap, HpxNDMap, Map, MapAxis from gammapy.uti...
[ "numpy.logspace", "numpy.arange", "pytest.mark.parametrize", "gammapy.utils.testing.requires_dependency", "gammapy.maps.HpxGeom", "gammapy.maps.MapAxis.from_bounds", "gammapy.maps.HpxNDMap", "numpy.max", "numpy.testing.assert_allclose", "gammapy.maps.HpxGeom.create", "numpy.nansum", "numpy.one...
[((390, 419), 'pytest.importorskip', 'pytest.importorskip', (['"""healpy"""'], {}), "('healpy')\n", (409, 419), False, 'import pytest\n'), ((1282, 1373), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('nside', 'nested', 'frame', 'region', 'axes')", 'hpx_test_geoms'], {}), "(('nside', 'nested', 'frame', 'regi...
from config import get_config from Learner import face_learner import argparse import random import glob import os import json import gen_params, transforms from data.online_dataset import OnlineFontDataset from data.hook_dataloader import HookDataLoader from pathlib import Path # python train.py -net mobilefacenet -b...
[ "data.online_dataset.OnlineFontDataset", "numpy.random.seed", "argparse.ArgumentParser", "transforms.get_simple_transforms", "Learner.face_learner", "torch.manual_seed", "data.hook_dataloader.HookDataLoader", "torch.cuda.manual_seed", "pathlib.Path", "random.seed", "config.get_config", "os.pat...
[((371, 442), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""for common image metric learning"""'}), "(description='for common image metric learning')\n", (394, 442), False, 'import argparse\n'), ((5896, 5908), 'config.get_config', 'get_config', ([], {}), '()\n', (5906, 5908), False, 'fr...
import numpy as np # https://stats.stackexchange.com/questions/179835/how-to-build-a-confusion-matrix-for-a-multiclass-classifier def calculate_miou(confusion_matrix): MIoU = np.divide(np.diag(confusion_matrix), ( np.sum(confusion_matrix, axis=1) + np.sum(confusion_matrix, axis=0) - np.diag(confus...
[ "numpy.save", "numpy.sum", "numpy.seterr", "numpy.zeros", "numpy.array", "numpy.diag", "numpy.bincount", "numpy.nanmean" ]
[((345, 361), 'numpy.nanmean', 'np.nanmean', (['MIoU'], {}), '(MIoU)\n', (355, 361), True, 'import numpy as np\n'), ((191, 216), 'numpy.diag', 'np.diag', (['confusion_matrix'], {}), '(confusion_matrix)\n', (198, 216), True, 'import numpy as np\n'), ((448, 492), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
[ "numpy.einsum", "pyscf.dft.numint._dot_ao_ao", "pyscf.lib.current_memory", "pyscf.dft.RKS", "pyscf.dft.numint._rks_gga_wv2", "time.clock", "pyscf.grad.rks._gga_grad_sum_", "pyscf.tddft.TDDFT", "pyscf.scf.cphf.solve", "pyscf.dft.numint._rks_gga_wv1", "numpy.vstack", "pyscf.lib.logger.new_logger...
[((13423, 13453), 'pyscf.lib.class_as_method', 'lib.class_as_method', (['Gradients'], {}), '(Gradients)\n', (13442, 13453), False, 'from pyscf import lib\n'), ((1474, 1509), 'pyscf.lib.logger.new_logger', 'logger.new_logger', (['td_grad', 'verbose'], {}), '(td_grad, verbose)\n', (1491, 1509), False, 'from pyscf.lib imp...
from collections import OrderedDict import numpy as np np.random.seed(123) def softmax(z): # Numerically stable softmax. Already implemented. z = z - np.max(z, axis=1, keepdims=True) _exp = np.exp(z) _sum = np.sum(_exp, axis=1, keepdims=True) sm = _exp / _sum return sm def conv...
[ "numpy.pad", "numpy.zeros_like", "numpy.sum", "numpy.random.seed", "numpy.random.randn", "numpy.zeros", "numpy.shape", "numpy.max", "numpy.exp", "collections.OrderedDict", "numpy.sqrt" ]
[((59, 78), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (73, 78), True, 'import numpy as np\n'), ((212, 221), 'numpy.exp', 'np.exp', (['z'], {}), '(z)\n', (218, 221), True, 'import numpy as np\n'), ((234, 269), 'numpy.sum', 'np.sum', (['_exp'], {'axis': '(1)', 'keepdims': '(True)'}), '(_exp, axis...
from utils import calculate_variance import numpy as np from math import sqrt def display_as_percentage(val): return '{:.1f}%'.format(val * 100) returns_disney = [0.10, 0.12, 0.15, 0.05, 0.04] returns_cbs = [-0.80, -0.15, 0.31, -0.06, -0.29] stddev_disney = np.std(returns_disney) stddev_cbs = np.std(r...
[ "numpy.std", "utils.calculate_variance", "math.sqrt" ]
[((275, 297), 'numpy.std', 'np.std', (['returns_disney'], {}), '(returns_disney)\n', (281, 297), True, 'import numpy as np\n'), ((312, 331), 'numpy.std', 'np.std', (['returns_cbs'], {}), '(returns_cbs)\n', (318, 331), True, 'import numpy as np\n'), ((412, 439), 'utils.calculate_variance', 'calculate_variance', (['datas...
"""Fast-Weights Q&A Network Multi-layered bi-directional implementation of the Fast-Weights RNN using the cell from lnfw_rnn_cell.py. The framework for this implementation (including sentence and question encoders) is based on the end-to-end memory network, but the actual memory network module is replaced with a Fas...
[ "tensorflow.op_scope", "tensorflow.reduce_sum", "tensorflow.maximum", "numpy.ones", "tensorflow.matmul", "tensorflow.Variable", "tensorflow.layers.max_pooling1d", "tensorflow.nn.softmax", "six.moves.range", "tensorflow.placeholder_with_default", "numpy.transpose", "tensorflow.variable_scope", ...
[((680, 738), 'numpy.ones', 'np.ones', (['(embedding_size, sentence_size)'], {'dtype': 'np.float32'}), '((embedding_size, sentence_size), dtype=np.float32)\n', (687, 738), True, 'import numpy as np\n'), ((803, 815), 'six.moves.range', 'range', (['(1)', 'le'], {}), '(1, le)\n', (808, 815), False, 'from six.moves import ...
import torch import numpy as np import pandas as pd import math import analysis.distances as distances def sim_check( model, in_set, batch_set, in_dis_measure='hamming', spk_hidden_measure='euclidean', msg_dis_measure='edit', lis_hidden_measure='euclidean', corr_measure='pearson', label_mod...
[ "pandas.DataFrame", "analysis.distances.in_edit_dis", "numpy.argmax", "analysis.distances.msg_ham_dis", "numpy.asarray", "analysis.distances.in_ham_dis", "analysis.distances.sum", "analysis.distances.label2np_array", "analysis.distances.instr2np_array", "analysis.distances.editdistance.eval", "a...
[((1356, 1382), 'numpy.asarray', 'np.asarray', (['mean_distances'], {}), '(mean_distances)\n', (1366, 1382), True, 'import numpy as np\n'), ((1405, 1445), 'numpy.asarray', 'np.asarray', (['spk_h_distances'], {'dtype': 'float'}), '(spk_h_distances, dtype=float)\n', (1415, 1445), True, 'import numpy as np\n'), ((1466, 15...
# Copyright (c) 1996-2015 PSERC. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Tests for code in C{modcost}. """ from numpy import array from pypower.totcost import totcost from pypower.modcost import modcost from pypower.t.t_begin impo...
[ "pypower.t.t_end.t_end", "pypower.t.t_begin.t_begin", "numpy.array", "pypower.modcost.modcost" ]
[((531, 554), 'pypower.t.t_begin.t_begin', 't_begin', (['n_tests', 'quiet'], {}), '(n_tests, quiet)\n', (538, 554), False, 'from pypower.t.t_begin import t_begin\n'), ((730, 945), 'numpy.array', 'array', (['[[2, 0, 0, 3, 0.01, 0.1, 1, 0, 0, 0, 0, 0], [2, 0, 0, 5, 0.0006, 0.005, \n 0.04, 0.3, 2, 0, 0, 0], [1, 0, 0, 4...
# Anatomical ontology management # Author: <NAME>, 2019 """Handle ontology lookup. """ import os from collections import OrderedDict from enum import Enum import json import numpy as np import pandas as pd from magmap.settings import config from magmap.io import libmag NODE = "node" PARENT_IDS = "parent_ids" MIRROR...
[ "numpy.isin", "json.load", "numpy.multiply", "numpy.subtract", "numpy.copy", "numpy.less", "pandas.read_csv", "numpy.lexsort", "magmap.io.libmag.printv", "numpy.greater", "magmap.io.libmag.coords_for_indexing", "numpy.around", "numpy.where", "os.path.splitext", "collections.OrderedDict",...
[((846, 868), 'os.path.splitext', 'os.path.splitext', (['path'], {}), '(path)\n', (862, 868), False, 'import os\n'), ((1437, 1531), 'pandas.read_csv', 'pd.read_csv', (['path'], {'sep': '"""\\\\s+"""', 'comment': '"""#"""', 'names': '[e.value for e in config.ItkSnapLabels]'}), "(path, sep='\\\\s+', comment='#', names=[e...
from copy import deepcopy import numpy as np from numpy.random import randint from numpy.random import random def GenerateRandomTree(functions, terminals, max_height, curr_height=0): if curr_height == max_height: idx = randint(len(terminals)) n = deepcopy( terminals[idx] ) else: # Make sure that there is no ...
[ "copy.deepcopy", "numpy.random.random" ]
[((255, 279), 'copy.deepcopy', 'deepcopy', (['terminals[idx]'], {}), '(terminals[idx])\n', (263, 279), False, 'from copy import deepcopy\n'), ((499, 523), 'copy.deepcopy', 'deepcopy', (['functions[idx]'], {}), '(functions[idx])\n', (507, 523), False, 'from copy import deepcopy\n'), ((379, 387), 'numpy.random.random', '...
from __future__ import absolute_import, division, print_function import math import six # we want a round function which does the same on Python 2.7 and 3.x if six.PY2: from numpy import around as round def format_float_with_standard_uncertainty(value, standard_uncertainty, minimum=1e-12): """ Formats ...
[ "numpy.around", "math.log10", "math.pow" ]
[((792, 808), 'numpy.around', 'round', (['value', 'dp'], {}), '(value, dp)\n', (797, 808), True, 'from numpy import around as round\n'), ((931, 954), 'math.pow', 'math.pow', (['(10)', 'precision'], {}), '(10, precision)\n', (939, 954), False, 'import math\n'), ((966, 978), 'numpy.around', 'round', (['su', '(1)'], {}), ...
import numpy as np import function import random """ RNN化バージョン0509作成s-PFCのための層内結合ありのネットワーク rnn_neuronの複製0519 """ # ニューロン単独 # このプログラムでは行列で定義されたニューロンの出力結果を返す # ユニットの定義は上層で行う # 引数として上から結合加重Wとバイアスbを受け取る # forによる繰り返しは行わないあくまで一回のみ計算 """ 基本パラメーター ************************** """ Tau = 10 dt = 0.01 random...
[ "numpy.dot", "function.function", "random.random" ]
[((552, 571), 'function.function', 'function.function', ([], {}), '()\n', (569, 571), False, 'import function\n'), ((1034, 1049), 'random.random', 'random.random', ([], {}), '()\n', (1047, 1049), False, 'import random\n'), ((1101, 1114), 'numpy.dot', 'np.dot', (['si', 'W'], {}), '(si, W)\n', (1107, 1114), True, 'import...
#!/usr/bin/env python # Import Libraries from zipfile import ZipFile import cv2 import math import numpy as np import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf from skimage import util, exposure from sklearn.utils import shuffle from tensorflow.keras import models, layers # Setup the parame...
[ "tensorflow.keras.layers.Cropping2D", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Dense", "pandas.read_csv", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.Flatten", "cv2.cvtColor", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.layers.Dropout", "numpy.a...
[((508, 545), 'pandas.read_csv', 'pd.read_csv', (['"""./data/driving_log.csv"""'], {}), "('./data/driving_log.csv')\n", (519, 545), True, 'import pandas as pd\n'), ((393, 417), 'zipfile.ZipFile', 'ZipFile', (['"""data.zip"""', '"""r"""'], {}), "('data.zip', 'r')\n", (400, 417), False, 'from zipfile import ZipFile\n'), ...
import numpy as np import copy def loss_func(af0, af1, vf0, vf1, confi): # 权重越大越重要,基础权重要将2种特征的影响力调到等额 weight0_base = 3 # 强度的基础权重,差距很小则权重有奖励,强度差得越大则权重有惩罚 weight1_base = 1 # 碰撞边的基础权重,置信系数=0则权重很小 # 特征0的损失函数 # 第1列为差值区间,第2列为附加权重 feat0_loss_ref = np.array([[0, 0.05, 0.1, 0.5, 0.8, 1], [0.4, 0.6, ...
[ "copy.deepcopy", "numpy.array", "numpy.delete" ]
[((270, 337), 'numpy.array', 'np.array', (['[[0, 0.05, 0.1, 0.5, 0.8, 1], [0.4, 0.6, 0.8, 1, 3, 100]]'], {}), '([[0, 0.05, 0.1, 0.5, 0.8, 1], [0.4, 0.6, 0.8, 1, 3, 100]])\n', (278, 337), True, 'import numpy as np\n'), ((3465, 3507), 'numpy.array', 'np.array', (['video_feat_list'], {'dtype': '"""float64"""'}), "(video_f...
import cv2 import math import numpy as np """ #图像编码模块: run_length_encode: 将mask图像转换为rle编码。</br> run_length_decode: 将rle编码还原为mask图像。</br> """ def run_length_encode(mask): """ Descripition: Convert mask image into run-length enconde. Args ----- mask: A simple of gray image. The simple...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "numpy.zeros", "cv2.imread", "numpy.where", "numpy.reshape" ]
[((1631, 1646), 'numpy.zeros', 'np.zeros', (['shape'], {}), '(shape)\n', (1639, 1646), True, 'import numpy as np\n'), ((2458, 2473), 'matplotlib.pyplot.imshow', 'plt.imshow', (['img'], {}), '(img)\n', (2468, 2473), True, 'import matplotlib.pyplot as plt\n'), ((2542, 2552), 'matplotlib.pyplot.show', 'plt.show', ([], {})...
from blocks.bricks import ( Initializable, Linear, Random) from blocks.bricks.base import lazy, application from blocks.bricks.lookup import LookupTable from blocks.bricks.parallel import Fork from blocks.bricks.recurrent import GatedRecurrent, Bidirectional from blocks.roles import add_role, INITIAL_STATE, PARAMET...
[ "theano.tensor.tensor3", "blocks.bricks.Linear", "theano.tensor.extra_ops.repeat", "theano.tensor.sqrt", "theano.tensor.shape_padleft", "theano.tensor.max", "theano.tensor.scalar", "models.conditional.three_tier.generate_and_save_samples", "theano.tensor.log", "blocks.bricks.parallel.Fork", "mod...
[((489, 512), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""."""'], {}), "(1, '.')\n", (504, 512), False, 'import sys\n'), ((513, 546), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""./sampleRNN"""'], {}), "(1, './sampleRNN')\n", (528, 546), False, 'import sys\n'), ((936, 975), 'theano.tensor.max', 'tensor.max...
#!/usr/bin/env python # Copyright (c) 2011-2020, wradlib developers. # Distributed under the MIT License. See LICENSE.txt for more info. import sys import tempfile from distutils.version import LooseVersion import matplotlib as mpl # isort:skip mpl.use("Agg") # noqa: E402 import matplotlib.pyplot as pl import nump...
[ "wradlib.georef.create_osr", "wradlib.vis.plot_max_plan_and_vert", "wradlib.vis.plot_ppi_crosshair", "wradlib.vis.plot_rhi", "matplotlib.pyplot.figure", "pytest.mark.skipif", "numpy.arange", "numpy.zeros_like", "wradlib.vis.add_patches", "pytest.warns", "pytest.raises", "matplotlib.pyplot.subp...
[((249, 263), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (256, 263), True, 'import matplotlib as mpl\n'), ((439, 470), 'wradlib.util.import_optional', 'util.import_optional', (['"""cartopy"""'], {}), "('cartopy')\n", (459, 470), False, 'from wradlib import georef, util, vis\n'), ((504, 541), 'numpy....
import os import torch import torchvision import glob import numpy as np import torch.optim as optim import cv2 import matplotlib import matplotlib.pyplot as plt from skimage import io, transform from skimage.transform import resize from torch.autograd import Variable import d_net import config import time import va...
[ "torch.cat", "torchvision.transforms.Normalize", "numpy.sqrt", "os.path.join", "torch.nn.init.xavier_normal", "torch.ones", "torch.utils.data.DataLoader", "torchvision.transforms.Scale", "loss_funs.combined_loss", "os.path.exists", "torch.nn.functional.relu", "numpy.rollaxis", "torch.zeros",...
[((21354, 21441), 'numpy.zeros', 'np.zeros', (['(cell_h * nrows, cell_w * ncols, channels)'], {'dtype': 'generated_images.dtype'}), '((cell_h * nrows, cell_w * ncols, channels), dtype=generated_images\n .dtype)\n', (21362, 21441), True, 'import numpy as np\n'), ((22450, 22486), 'os.path.join', 'os.path.join', (['"""...
import numpy as np import pytest from stable_baselines import PPO, TD3 from stable_baselines.common.noise import NormalActionNoise action_noise = NormalActionNoise(np.zeros(1), 0.1 * np.ones(1)) def test_td3(): model = TD3( 'MlpPolicy', 'Pendulum-v0', policy_kwargs=dict(net_arch=[64, 64])...
[ "pytest.mark.parametrize", "numpy.zeros", "numpy.ones" ]
[((608, 653), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""model_class"""', '[PPO]'], {}), "('model_class', [PPO])\n", (631, 653), False, 'import pytest\n'), ((655, 720), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""env_id"""', "['CartPole-v1', 'Pendulum-v0']"], {}), "('env_id', ['CartPole...
from matplotlib.patches import RegularPolygon, Arc, Circle, Rectangle, Ellipse import numpy as np from pandapower.plotting.plotting_toolbox import _rotate_dim2, get_color_list, get_angle_list, \ get_linewidth_list try: import pplog as logging except ImportError: import logging logger = logging.getLogger(_...
[ "matplotlib.patches.RegularPolygon", "numpy.sum", "matplotlib.patches.Rectangle", "logging.getLogger", "matplotlib.patches.Circle", "numpy.array", "matplotlib.patches.Ellipse", "numpy.all", "numpy.sqrt" ]
[((301, 328), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (318, 328), False, 'import logging\n'), ((17143, 17155), 'numpy.array', 'np.array', (['p1'], {}), '(p1)\n', (17151, 17155), True, 'import numpy as np\n'), ((17169, 17181), 'numpy.array', 'np.array', (['p2'], {}), '(p2)\n', (1717...
import matplotlib matplotlib.use('Agg') import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.style.use('seaborn-poster') from datetime import datetime as dt from datetime import timedelta import glob from scipy.stats import gamma import sys sys.path.insert(0,'model') # I hate this too but i...
[ "helper_functions.read_in_NNDSS", "numpy.isnat", "numpy.isnan", "numpy.random.gamma", "matplotlib.pyplot.style.use", "numpy.mean", "numpy.tile", "numpy.convolve", "pandas.DataFrame", "numpy.std", "numpy.cumsum", "matplotlib.pyplot.subplots", "pandas.concat", "scipy.stats.gamma.pdf", "pan...
[((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((112, 143), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-poster"""'], {}), "('seaborn-poster')\n", (125, 143), True, 'import matplotlib.pyplot as plt\n'), ((270, 297), 'sys.path.i...
import gym from datetime import datetime from collections import deque import numpy as np class Monitor: def __init__( self, monitor_param, agent_prototype, model_prototype, memory_prototype, env_prototype, ): self.logger = monitor_param.logger s...
[ "numpy.transpose", "numpy.mean", "numpy.array", "datetime.datetime.now", "collections.deque" ]
[((2922, 2939), 'collections.deque', 'deque', ([], {'maxlen': '(100)'}), '(maxlen=100)\n', (2927, 2939), False, 'from collections import deque\n'), ((4570, 4584), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (4582, 4584), False, 'from datetime import datetime\n'), ((4611, 4628), 'collections.deque', 'dequ...
from __future__ import division, print_function, absolute_import import argparse import functools import json import logging import math import os import random import numpy as np import pandas as pd import tensorflow as tf import tqdm try: tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) except: ...
[ "os.mkdir", "numpy.abs", "argparse.ArgumentParser", "dotenv.find_dotenv", "tensorflow.identity", "json.dumps", "numpy.mean", "os.path.join", "pandas.read_hdf", "random.randint", "os.path.exists", "tensorflow.set_random_seed", "tensorflow.placeholder", "functools.partial", "json.dump", ...
[((248, 310), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (282, 310), True, 'import tensorflow as tf\n'), ((535, 562), 'dotenv.find_dotenv', 'de.find_dotenv', ([], {'usecwd': '(True)'}), '(usecwd=True)\n', (5...
import dgl import torch as th import numpy as np import itertools import time from collections import * Graph = namedtuple('Graph', ['g', 'src', 'tgt', 'tgt_y', 'nids', 'eids', 'nid_arr', 'n_nodes', 'n_edges', 'n_tokens']) def graph_to_device(g, device): if g.tgt_y is not None: tgt_y = ...
[ "torch.ones", "dgl.batch", "numpy.zeros", "torch.cat", "dgl.DGLGraph", "time.time", "torch.arange", "torch.zeros", "torch.tensor" ]
[((1968, 1979), 'time.time', 'time.time', ([], {}), '()\n', (1977, 1979), False, 'import time\n'), ((4387, 4404), 'dgl.batch', 'dgl.batch', (['g_list'], {}), '(g_list)\n', (4396, 4404), False, 'import dgl\n'), ((7174, 7191), 'dgl.batch', 'dgl.batch', (['g_list'], {}), '(g_list)\n', (7183, 7191), False, 'import dgl\n'),...
import tempfile import numpy as np from sklearn.base import TransformerMixin from biom.util import biom_open from skbio.stats.composition import clr from skbio.stats import subsample_counts from skbio.stats.ordination import pcoa from friendly_guacamole.utils import as_dense import pandas as pd from unifrac import ssu ...
[ "tempfile.NamedTemporaryFile", "skbio.stats.composition.clr", "biom.util.biom_open", "numpy.ix_", "skbio.stats.subsample_counts", "unifrac.ssu", "friendly_guacamole.utils.as_dense", "numpy.argwhere", "skbio.stats.ordination.pcoa", "numpy.delete", "numpy.vstack" ]
[((996, 1007), 'friendly_guacamole.utils.as_dense', 'as_dense', (['X'], {}), '(X)\n', (1004, 1007), False, 'from friendly_guacamole.utils import as_dense\n'), ((2501, 2523), 'numpy.ix_', 'np.ix_', (['X_idx', 'ref_idx'], {}), '(X_idx, ref_idx)\n', (2507, 2523), True, 'import numpy as np\n'), ((7218, 7244), 'numpy.argwhe...
import numpy as np from gym.spaces import Box from sequential_inference.envs.sawyer.asset_path_utils import full_v2_path_for from sequential_inference.envs.sawyer.mujoco.sawyer_xyz.sawyer_xyz_env import ( SawyerXYZEnv, _assert_task_is_set, ) from sequential_inference.envs.sawyer.mujoco.utils.rotation import eu...
[ "numpy.abs", "numpy.random.seed", "numpy.tanh", "numpy.zeros", "sequential_inference.envs.sawyer.mujoco.utils.rotation.euler2quat", "numpy.flipud", "numpy.linalg.norm", "numpy.array", "sequential_inference.envs.sawyer.asset_path_utils.full_v2_path_for" ]
[((1113, 1140), 'numpy.array', 'np.array', (['[-0.3, 0.85, 0.0]'], {}), '([-0.3, 0.85, 0.0])\n', (1121, 1140), True, 'import numpy as np\n'), ((2736, 2784), 'sequential_inference.envs.sawyer.asset_path_utils.full_v2_path_for', 'full_v2_path_for', (['"""sawyer_xyz/sawyer_hammer.xml"""'], {}), "('sawyer_xyz/sawyer_hammer...
import os import numpy as np from tqdm import trange from pynvml import * from nibabel import load as load_nii import nibabel as nib from utils.patch_dataloader import * def test_scan_uncertainty(model, test_x_data, scan, options, intermediate=None, save_nifti=False, uncertainty=True, candidate_mask=None, T=20): ...
[ "numpy.stack", "os.mkdir", "nibabel.Nifti1Image", "numpy.zeros_like", "nibabel.load", "os.path.exists", "numpy.zeros", "numpy.var", "numpy.mean", "numpy.arange", "os.path.split", "os.path.join" ]
[((1781, 1807), 'numpy.zeros_like', 'np.zeros_like', (['flair_image'], {}), '(flair_image)\n', (1794, 1807), True, 'import numpy as np\n'), ((1824, 1850), 'numpy.zeros_like', 'np.zeros_like', (['flair_image'], {}), '(flair_image)\n', (1837, 1850), True, 'import numpy as np\n'), ((1870, 1896), 'numpy.zeros_like', 'np.ze...
from tqdm import tqdm from interne.constants import * from interne.Awele import Awele from interne.CPUPlayer import CPUPlayer from interne.algo_base import est_terminale import numpy as np def cpu_vs_cpu(niv_sud: int, niv_nord: int): position = Awele(TAILLE) sud = CPUPlayer(niv_sud, JOEUR_SUD) nord = CPUPlayer(niv_...
[ "interne.algo_base.est_terminale", "interne.CPUPlayer.CPUPlayer", "numpy.unique", "interne.Awele.Awele" ]
[((247, 260), 'interne.Awele.Awele', 'Awele', (['TAILLE'], {}), '(TAILLE)\n', (252, 260), False, 'from interne.Awele import Awele\n'), ((268, 297), 'interne.CPUPlayer.CPUPlayer', 'CPUPlayer', (['niv_sud', 'JOEUR_SUD'], {}), '(niv_sud, JOEUR_SUD)\n', (277, 297), False, 'from interne.CPUPlayer import CPUPlayer\n'), ((306...
import numpy as np def scalling(scallingFactor): return (scallingFactor* (np.identity(2))) # return scalling matrix def rotation(angle): arr = np.empty([2, 2]) c = np.cos(angle) s = np.sin(angle) arr[0][0] = c arr[0][1] = -s arr[1][0] = s arr[1][1] = c return arr #return arr rotat...
[ "numpy.empty", "numpy.sin", "numpy.identity", "numpy.cos" ]
[((153, 169), 'numpy.empty', 'np.empty', (['[2, 2]'], {}), '([2, 2])\n', (161, 169), True, 'import numpy as np\n'), ((178, 191), 'numpy.cos', 'np.cos', (['angle'], {}), '(angle)\n', (184, 191), True, 'import numpy as np\n'), ((200, 213), 'numpy.sin', 'np.sin', (['angle'], {}), '(angle)\n', (206, 213), True, 'import num...
import tensorflow as tf import time,logging,glob import numpy as np import h5py logger = logging.getLogger(__name__) config = None def get_datasets(config_file): global config config = config_file train = simple_dataset_from_glob(config['data']['train_glob']) valid = simple_dataset_from_glob(config['dat...
[ "tensorflow.contrib.data.shuffle_and_repeat", "h5py.File", "numpy.random.shuffle", "tensorflow.py_func", "numpy.random.get_state", "numpy.float32", "tensorflow.data.Dataset.from_tensor_slices", "numpy.random.set_state", "tensorflow.data.Dataset.list_files", "numpy.int32", "logging.getLogger" ]
[((89, 116), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (106, 116), False, 'import time, logging, glob\n'), ((452, 491), 'tensorflow.data.Dataset.list_files', 'tf.data.Dataset.list_files', (['glob_string'], {}), '(glob_string)\n', (478, 491), True, 'import tensorflow as tf\n'), ((1201...
import os import sys import pickle import copy from malpi.ui.DriveFormat import DriveFormat from collections import defaultdict import numpy as np import json import re from donkeycar.parts.datastore import Tub def atoi(text): return int(text) if text.isdigit() else text def natural_keys(text): ''' alist....
[ "malpi.ui.DriveFormat.DriveFormat.registerFormat", "argparse.ArgumentParser", "numpy.clip", "collections.defaultdict", "numpy.mean", "sys.exc_info", "os.path.join", "donkeycar.parts.datastore.Tub", "numpy.std", "os.path.exists", "numpy.max", "numpy.repeat", "json.dump", "re.split", "donk...
[((11052, 11102), 'malpi.ui.DriveFormat.DriveFormat.registerFormat', 'DriveFormat.registerFormat', (['"""TubFormat"""', 'TubFormat'], {}), "('TubFormat', TubFormat)\n", (11078, 11102), False, 'from malpi.ui.DriveFormat import DriveFormat\n'), ((11130, 11190), 'malpi.ui.DriveFormat.DriveFormat.testFormat', 'DriveFormat....
import math import textwrap import sys import pytest import threading import traceback import time import numpy as np from numpy.testing import IS_PYPY from . import util class TestF77Callback(util.F2PyTest): sources = [util.getpath("tests", "src", "callback", "foo.f")] @pytest.mark.parametrize("name", "t,t...
[ "textwrap.dedent", "threading.Thread", "numpy.zeros", "time.sleep", "pytest.mark.skipif", "numpy.array", "traceback.format_exc", "math.degrees", "numpy.all", "pytest.mark.xfail" ]
[((405, 491), 'pytest.mark.xfail', 'pytest.mark.xfail', (['IS_PYPY'], {'reason': '"""PyPy cannot modify tp_doc after PyType_Ready"""'}), "(IS_PYPY, reason=\n 'PyPy cannot modify tp_doc after PyType_Ready')\n", (422, 491), False, 'import pytest\n'), ((2040, 2140), 'pytest.mark.skipif', 'pytest.mark.skipif', (["(sys.p...
import numpy as np import cv2 import matplotlib.image as mpimg def perspect_transform(img, src, dst): # Get transform matrix using cv2.getPerspectivTransform() M = cv2.getPerspectiveTransform(src, dst) # Warp image using cv2.warpPerspective() # keep same size as input image warped = cv2.warpPerspe...
[ "matplotlib.image.imread", "cv2.warpPerspective", "numpy.zeros_like", "cv2.getPerspectiveTransform", "numpy.float32" ]
[((1073, 1099), 'matplotlib.image.imread', 'mpimg.imread', (['"""sample.jpg"""'], {}), "('sample.jpg')\n", (1085, 1099), True, 'import matplotlib.image as mpimg\n'), ((1495, 1552), 'numpy.float32', 'np.float32', (['[[14, 140], [301, 140], [200, 96], [118, 96]]'], {}), '([[14, 140], [301, 140], [200, 96], [118, 96]])\n'...
import numpy as np from numpy.random import seed from sklearn.model_selection import train_test_split import pandas as pd # pca_dims = 50 # TESTING_DATASET_SIZE = 0.3 # the path of HAPT_Data_Set dir ROOT = "Acti-tracker Data Set/" # config path and intermediate files # REDUCED_FEATURE_FILE = str(pca_dims...
[ "pandas.read_csv", "sklearn.model_selection.train_test_split", "numpy.random.seed" ]
[((1446, 1489), 'pandas.read_csv', 'pd.read_csv', (['datafile'], {'sep': '""" """', 'header': 'None'}), "(datafile, sep=' ', header=None)\n", (1457, 1489), True, 'import pandas as pd\n'), ((1643, 1653), 'numpy.random.seed', 'seed', (['(2020)'], {}), '(2020)\n', (1647, 1653), False, 'from numpy.random import seed\n'), (...
#!/usr/bin/env python3 import argparse import numpy as np parser = argparse.ArgumentParser() parser.add_argument('input') parser.add_argument('output') parser.add_argument('-n', type=int, default=10) args = parser.parse_args() with open(args.input, 'rb') as input_file, open(args.output, 'wb') as output_file: n, ...
[ "numpy.load", "numpy.save", "argparse.ArgumentParser" ]
[((68, 93), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (91, 93), False, 'import argparse\n'), ((326, 345), 'numpy.load', 'np.load', (['input_file'], {}), '(input_file)\n', (333, 345), True, 'import numpy as np\n'), ((373, 403), 'numpy.save', 'np.save', (['output_file', '(n, dim)'], {}), '(o...
# uniform content loss + adaptive threshold + per_class_input + recursive G # improvement upon cqf37 # Use learning to see in the dark CNN # test BIT Fu Ying noise model, who claims that synthetic noise can outperform real noise from __future__ import division import os, time, scipy.io import tensorflow as tf import ...
[ "numpy.maximum", "tensorflow.trainable_variables", "tensorflow.maximum", "zmf.tukeylambda", "numpy.random.randint", "glob.glob", "tensorflow.truncated_normal", "tensorflow.contrib.slim.conv2d", "zmf.poisson", "tensorflow.abs", "zmf.normal", "numpy.transpose", "tensorflow.concat", "tensorfl...
[((575, 603), 'glob.glob', 'glob.glob', (["(gt_dir + '0*.ARW')"], {}), "(gt_dir + '0*.ARW')\n", (584, 603), False, 'import glob\n'), ((5678, 5690), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (5688, 5690), True, 'import tensorflow as tf\n'), ((5702, 5751), 'tensorflow.placeholder', 'tf.placeholder', (['tf.flo...
""" Collection of Numpy linear algebra functions, wrapped to fit Ivy syntax and signature. """ # global import numpy as _np import ivy as _ivy from typing import Union, Tuple def matrix_norm(x, p=2, axes=None, keepdims=False): axes = (-2, -1) if axes is None else axes if isinstance(axes, int): raise...
[ "numpy.linalg.qr", "numpy.zeros", "numpy.expand_dims", "numpy.linalg.norm", "numpy.concatenate" ]
[((822, 849), 'numpy.expand_dims', '_np.expand_dims', (['vector', '(-1)'], {}), '(vector, -1)\n', (837, 849), True, 'import numpy as _np\n'), ((1010, 1041), 'numpy.zeros', '_np.zeros', (['(batch_shape + [1, 1])'], {}), '(batch_shape + [1, 1])\n', (1019, 1041), True, 'import numpy as _np\n'), ((1070, 1106), 'numpy.conca...
import json import numpy as np # Returns the Euclidean distance score between user1 and user2 def euclidean_score(dataset, user1, user2): if user1 not in dataset: raise TypeError('User ' + user1 + ' not present in the dataset') if user2 not in dataset: raise TypeError('User ' + user2 + ' not...
[ "numpy.square", "numpy.sum" ]
[((779, 833), 'numpy.square', 'np.square', (['(dataset[user1][item] - dataset[user2][item])'], {}), '(dataset[user1][item] - dataset[user2][item])\n', (788, 833), True, 'import numpy as np\n'), ((872, 899), 'numpy.sum', 'np.sum', (['squared_differences'], {}), '(squared_differences)\n', (878, 899), True, 'import numpy ...
import random import numpy as np def play(board, column, mark, config): EMPTY = 0 columns = config.columns rows = config.rows row = max([r for r in range(rows) if board[column + (r * columns)] == EMPTY]) board[column + (row * columns)] = mark def is_win(board, column, mark, config, has_played=Tru...
[ "numpy.asarray", "numpy.zeros", "random.choice" ]
[((7769, 7796), 'numpy.zeros', 'np.zeros', (['(config.inarow + 1)'], {}), '(config.inarow + 1)\n', (7777, 7796), True, 'import numpy as np\n'), ((9351, 9378), 'numpy.zeros', 'np.zeros', (['(config.inarow + 1)'], {}), '(config.inarow + 1)\n', (9359, 9378), True, 'import numpy as np\n'), ((11492, 11515), 'random.choice',...
import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from statsmodels.stats.multitest import multipletests from sklearn.ensemble import IsolationForest from sklearn.svm import OneClassSVM from scipy import stats from sklearn.metrics import mean_squared_error, mean_absolute_error from ...
[ "scripts.python.pheno.datasets.filter.filter_pheno", "pyod.models.suod.SUOD", "sklearn.preprocessing.StandardScaler", "numpy.abs", "pyod.models.copod.COPOD", "sklearn.neighbors.LocalOutlierFactor", "sklearn.metrics.mean_absolute_error", "pathlib.Path", "numpy.mean", "scripts.python.routines.plot.s...
[((8060, 8119), 'pandas.read_excel', 'pd.read_excel', (['f"""{path}/datasets.xlsx"""'], {'index_col': '"""dataset"""'}), "(f'{path}/datasets.xlsx', index_col='dataset')\n", (8073, 8119), True, 'import pandas as pd\n'), ((8181, 8203), 'scripts.python.routines.manifest.get_manifest', 'get_manifest', (['platform'], {}), '...
from __future__ import division, print_function, absolute_import import os import numpy as np from numpy.testing import assert_array_almost_equal import pytest from pytest import raises as assert_raises from scipy.linalg import solve_sylvester from scipy.linalg import solve_continuous_lyapunov, solve_discrete_lyapun...
[ "numpy.load", "numpy.ones", "pytest.xfail", "numpy.arange", "scipy.linalg.solve_sylvester", "numpy.diag", "numpy.atleast_2d", "numpy.zeros_like", "os.path.dirname", "scipy.linalg.solve_continuous_lyapunov", "scipy.linalg.solve_discrete_are", "pytest.raises", "numpy.ones_like", "scipy.linal...
[((21939, 21958), 'numpy.diag', 'np.diag', (['[-10, 0.1]'], {}), '([-10, 0.1])\n', (21946, 21958), True, 'import numpy as np\n'), ((21963, 22023), 'pytest.raises', 'assert_raises', (['LinAlgError', 'solve_continuous_are', 'A', 'B', 'Q', 'R'], {}), '(LinAlgError, solve_continuous_are, A, B, Q, R)\n', (21976, 22023), Tru...
# -*- coding: utf-8 -* import numpy as np import torch import torch.nn.functional as F from torch import nn from ...module_base import ModuleBase from ..loss_base import TRACK_LOSSES from .utils import SafeLog eps = np.finfo(np.float32).tiny @TRACK_LOSSES.register class SigmoidCrossEntropyCenterness(ModuleBase): ...
[ "IPython.embed", "numpy.finfo", "numpy.random.randint", "numpy.random.rand", "torch.abs", "torch.tensor" ]
[((219, 239), 'numpy.finfo', 'np.finfo', (['np.float32'], {}), '(np.float32)\n', (227, 239), True, 'import numpy as np\n'), ((3044, 3051), 'IPython.embed', 'embed', ([], {}), '()\n', (3049, 3051), False, 'from IPython import embed\n'), ((2494, 2531), 'numpy.random.randint', 'np.random.randint', (['(2)'], {'size': '(B, ...
import warnings from typing import Any, Callable, Iterable, List, Optional, Union import numpy as np import sympy from openfermion import SymbolicOperator from .circuits import Circuit from .estimation import ( estimate_expectation_values_by_averaging, evaluate_estimation_circuits, ) from .gradients import fi...
[ "numpy.random.default_rng", "numpy.sum", "numpy.sqrt" ]
[((7047, 7080), 'numpy.sum', 'np.sum', (['expectation_values.values'], {}), '(expectation_values.values)\n', (7053, 7080), True, 'import numpy as np\n'), ((12640, 12687), 'numpy.random.default_rng', 'np.random.default_rng', (['parameter_precision_seed'], {}), '(parameter_precision_seed)\n', (12661, 12687), True, 'impor...
import keras.backend as K import numpy as np import tensorflow as tf from tensorflow.python.platform import flags from attack_utils import gen_adv_loss from keras.models import save_model import time import sys FLAGS = flags.FLAGS EVAL_FREQUENCY = 1000 BATCH_SIZE = 64 BATCH_EVAL_NUM = 100 def batch_eval(tf_inputs, t...
[ "numpy.sum", "keras.backend.learning_phase", "numpy.argmax", "keras.backend.get_session", "attack_utils.gen_adv_loss", "time.time", "tensorflow.constant", "tensorflow.placeholder", "tensorflow.global_variables", "keras.backend.softmax", "sys.stdout.flush", "tensorflow.stack", "tensorflow.tra...
[((2134, 2151), 'keras.backend.softmax', 'K.softmax', (['logits'], {}), '(logits)\n', (2143, 2151), True, 'import keras.backend as K\n'), ((2161, 2195), 'attack_utils.gen_adv_loss', 'gen_adv_loss', (['logits', 'y'], {'mean': '(True)'}), '(logits, y, mean=True)\n', (2173, 2195), False, 'from attack_utils import gen_adv_...
from __future__ import annotations __all__ = ["ComponentNumberInvalidError", "BaseDistribution", "normal_frequency", "NormalDistribution", "weibull_frequency", "WeibullDistribution", "skew_normal_frequency", "SkewNormalDistribution"] import ...
[ "scipy.stats.skewnorm.pdf", "numpy.sum", "numpy.abs", "scipy.stats.weibull_min.stats", "numpy.square", "scipy.stats.weibull_min.pdf", "scipy.stats.norm.pdf", "numpy.equal", "threading.Lock", "scipy.stats.skewnorm.stats", "numpy.array", "scipy.stats.norm.stats", "numpy.random.rand", "numpy....
[((755, 761), 'threading.Lock', 'Lock', ([], {}), '()\n', (759, 761), False, 'from threading import Lock\n'), ((7108, 7149), 'scipy.stats.norm.pdf', 'norm.pdf', (['classes_φ'], {'loc': 'loc', 'scale': 'scale'}), '(classes_φ, loc=loc, scale=scale)\n', (7116, 7149), False, 'from scipy.stats import norm, skewnorm, weibull...
import numpy as np import tensorflow as tf tf.logging.set_verbosity(0) import time import matplotlib.pyplot as plt from gpflow.likelihoods import Gaussian from gpflow.kernels import RBF, White from gpflow.mean_functions import Constant from gpflow.models.sgpr import SGPR, GPRFITC from gpflow.models.svgp import SVGP ...
[ "gpflow.likelihoods.Gaussian", "numpy.average", "gpflow.kernels.White", "scipy.stats.norm.logpdf", "tensorflow.logging.set_verbosity", "gpflow.actions.Loop", "gpflow.training.AdamOptimizer", "scipy.cluster.vq.kmeans2", "gpflow.kernels.RBF", "gpflow.training.NatGradOptimizer", "numpy.array_split"...
[((43, 70), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['(0)'], {}), '(0)\n', (67, 70), True, 'import tensorflow as tf\n'), ((657, 685), 'datasets.Datasets', 'Datasets', ([], {'data_path': '"""/data/"""'}), "(data_path='/data/')\n", (665, 685), False, 'from datasets import Datasets\n'), ((1268, 12...
"""Generate plot of the mean vowel sample spectra """ import torch import wavetorch from torch.utils.data import TensorDataset, DataLoader import argparse import yaml import time import os import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.gridspec import GridSpec import pan...
[ "matplotlib.pyplot.show", "numpy.std", "librosa.core.fft_frequencies", "wavetorch.data.load_all_vowels", "helpers.plot.mpl_set_latex", "numpy.mean", "warnings.warn", "matplotlib.pyplot.subplots" ]
[((732, 796), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {'constrained_layout': '(True)', 'figsize': '(3.5, 2.75)'}), '(1, 1, constrained_layout=True, figsize=(3.5, 2.75))\n', (744, 796), True, 'import matplotlib.pyplot as plt\n'), ((1811, 1832), 'matplotlib.pyplot.show', 'plt.show', ([], {'block': ...
# -------------------------------------------------------- # Relation Networks for Object Detection # Copyright (c) 2017 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME>, <NAME> # -------------------------------------------------------- """ Nms Multi-thresh Target Operator select...
[ "numpy.stack", "numpy.argmax", "numpy.zeros", "mxnet.operator.register", "numpy.where", "numpy.tile", "numpy.eye", "numpy.intersect1d", "numpy.fromstring" ]
[((3614, 3654), 'mxnet.operator.register', 'mx.operator.register', (['"""nms_multi_target"""'], {}), "('nms_multi_target')\n", (3634, 3654), True, 'import mxnet as mx\n'), ((3846, 3902), 'numpy.fromstring', 'np.fromstring', (['target_thresh[1:-1]'], {'dtype': 'float', 'sep': '""" """'}), "(target_thresh[1:-1], dtype=fl...
""" Geometric methods to compute volumes, areas, distances of the mesh entities """ # Geoemtric Module # Created by <NAME>, <NAME> and <NAME>. import numpy as np from pymoab import topo_util, types, rng def normal_vec_2d(coords0, coords1): vec = coords1 - coords0 vec_norm = np.linalg.norm(vec, axis = 1) r...
[ "pymoab.topo_util.MeshTopoUtil", "pymoab.rng.Range", "numpy.zeros", "numpy.cross", "pymoab.rng.subtract", "numpy.linalg.norm", "numpy.array", "numpy.dot" ]
[((285, 312), 'numpy.linalg.norm', 'np.linalg.norm', (['vec'], {'axis': '(1)'}), '(vec, axis=1)\n', (299, 312), True, 'import numpy as np\n'), ((518, 538), 'numpy.cross', 'np.cross', (['vec1', 'vec2'], {}), '(vec1, vec2)\n', (526, 538), True, 'import numpy as np\n'), ((1091, 1102), 'numpy.zeros', 'np.zeros', (['(3)'], ...
# -*- coding: utf-8 -*- """ Created on Fri Mar 20 12:22:58 2020 This code computes average maps from individual synaptic maps AMPLITUDE way : inputs are amplitude (pA) based maps @author: ludov """ #----------------------------Check this info----------------------------------- #General directory to fin...
[ "numpy.nansum", "numpy.abs", "numpy.concatenate", "numpy.nanmedian", "numpy.count_nonzero", "numpy.nanmax", "numpy.asarray", "numpy.zeros", "numpy.isnan", "numpy.arange", "numpy.reshape", "matplotlib.pyplot.subplots", "os.listdir", "numpy.vstack", "numpy.nanmean" ]
[((2002, 2043), 'numpy.nanmedian', 'np.nanmedian', (['a'], {'axis': 'axis', 'keepdims': '(True)'}), '(a, axis=axis, keepdims=True)\n', (2014, 2043), True, 'import numpy as np\n'), ((2191, 2242), 'numpy.vstack', 'np.vstack', (['(_list[0], _list[1], _list[2], _list[3])'], {}), '((_list[0], _list[1], _list[2], _list[3]))\...
from causal_world.intervention_actors.base_actor import \ BaseInterventionActorPolicy import numpy as np class JointsInterventionActorPolicy(BaseInterventionActorPolicy): def __init__(self, **kwargs): """ This class indicates the joint intervention actor which intervenes on the joints...
[ "numpy.random.uniform", "numpy.zeros" ]
[((1447, 1515), 'numpy.random.uniform', 'np.random.uniform', (['self._stage_bb[0]', 'self._stage_bb[1]'], {'size': '[3, 3]'}), '(self._stage_bb[0], self._stage_bb[1], size=[3, 3])\n', (1464, 1515), True, 'import numpy as np\n'), ((1794, 1805), 'numpy.zeros', 'np.zeros', (['(9)'], {}), '(9)\n', (1802, 1805), True, 'impo...
#!/usr/bin/env python u""" convert_harmonics.py Written by <NAME> (12/2021) Converts a file from the spatial domain into the spherical harmonic domain CALLING SEQUENCE: python convert_harmonics.py -F 2 --lmax 60 -U 1 infile outfile COMMAND LINE OPTIONS: --help: list the command line options -l X, --lmax X...
[ "argparse.ArgumentParser", "gravity_toolkit.gen_stokes.gen_stokes", "gravity_toolkit.utilities.get_data_path", "os.getppid", "gravity_toolkit.harmonics.harmonics", "numpy.copy", "gravity_toolkit.read_love_numbers.read_love_numbers", "os.path.dirname", "numpy.ndim", "gravity_toolkit.time.calendar_t...
[((4527, 4545), 'logging.info', 'logging.info', (['args'], {}), '(args)\n', (4539, 4545), False, 'import logging\n'), ((6885, 7006), 'gravity_toolkit.read_love_numbers.read_love_numbers', 'read_love_numbers', (['love_numbers_file'], {'LMAX': 'LMAX', 'HEADER': 'header', 'COLUMNS': 'columns', 'REFERENCE': 'REFERENCE', 'F...
#!/usr/bin/env python3 import argparse, os, glob, math import subprocess import numpy as np os.system('export GMX_MAXBACKUP=-1') def parseArguments(): parser = argparse.ArgumentParser() parser.add_argument("-gmx", "--gmx_path", type=str, default="gmx") args = parser.parse_args() return args box_size_...
[ "numpy.absolute", "os.remove", "os.mkdir", "argparse.ArgumentParser", "os.system", "os.chdir" ]
[((94, 130), 'os.system', 'os.system', (['"""export GMX_MAXBACKUP=-1"""'], {}), "('export GMX_MAXBACKUP=-1')\n", (103, 130), False, 'import argparse, os, glob, math\n'), ((165, 190), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (188, 190), False, 'import argparse, os, glob, math\n'), ((1399, ...
""" pyart.io.nexrad_level2 ====================== .. autosummary:: :toctree: generated/ :template: dev_template.rst NEXRADLevel2File .. autosummary:: :toctree: generated/ _decompress_records _get_record_from_buf _get_msg31_data_block _structure_size _unpack_from_buf _unpack_s...
[ "bz2.BZ2Decompressor", "numpy.float32", "numpy.ma.masked_less_equal", "struct.unpack", "numpy.ones", "datetime.datetime", "numpy.where", "numpy.array", "numpy.arange", "numpy.fromstring", "numpy.concatenate" ]
[((16597, 16618), 'bz2.BZ2Decompressor', 'bz2.BZ2Decompressor', ([], {}), '()\n', (16616, 16618), False, 'import bz2\n'), ((19926, 19952), 'struct.unpack', 'struct.unpack', (['fmt', 'string'], {}), '(fmt, string)\n', (19939, 19952), False, 'import struct\n'), ((5800, 5870), 'numpy.array', 'np.array', (["[m['msg31_heade...
import numpy as np from .base import BASE # 继承于BASE类 class DETECTION(BASE): # 只重写了初始化函数 def __init__(self, db_config): super(DETECTION, self).__init__() # Configs for training # 训练时参数[类别、一般的尺度、最小尺度、最大尺度、步长] self._configs["categories"] = 10 self._configs["rand_sc...
[ "numpy.arange" ]
[((2632, 2745), 'numpy.arange', 'np.arange', (["self._configs['rand_scale_min']", "self._configs['rand_scale_max']", "self._configs['rand_scale_step']"], {}), "(self._configs['rand_scale_min'], self._configs['rand_scale_max'],\n self._configs['rand_scale_step'])\n", (2641, 2745), True, 'import numpy as np\n')]
import pickle import numpy as np filename = 'Full_os_results.pickle' with open(filename, 'rb') as f: x = pickle.load(f) MSE = {"ASVI": (np.mean([np.sqrt(error) for error in x["PE"]["MSE"]]), np.std([np.sqrt(error) for error in x["PE"]["MSE"]])/np.sqrt(len(x["PE"]["MSE"]))), "ADVI (MF)": (np.mean([np.sqrt(error) ...
[ "pickle.load", "numpy.sqrt" ]
[((111, 125), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (122, 125), False, 'import pickle\n'), ((152, 166), 'numpy.sqrt', 'np.sqrt', (['error'], {}), '(error)\n', (159, 166), True, 'import numpy as np\n'), ((305, 319), 'numpy.sqrt', 'np.sqrt', (['error'], {}), '(error)\n', (312, 319), True, 'import numpy as n...
import os, sys import numpy as np from astropy.io import fits sys.path.append('../') import diskdictionary as disk targets = ['RULup', 'Elias20', 'Sz129', 'GWLup', 'Elias24', 'AS209'] for i in range(len(targets)): # beam solid angle idir = '../CSD_modeling/data/' hdu = fits.open(idir+'deep_'+targets[i]+...
[ "sys.path.append", "numpy.log", "astropy.io.fits.open" ]
[((62, 84), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (77, 84), False, 'import os, sys\n'), ((286, 347), 'astropy.io.fits.open', 'fits.open', (["(idir + 'deep_' + targets[i] + '_data.JvMcorr.fits')"], {}), "(idir + 'deep_' + targets[i] + '_data.JvMcorr.fits')\n", (295, 347), False, 'from a...
#!/usr/bin/python3 # -*- coding: utf8 -*- # Copyright (c) 2021 Baidu, Inc. 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...
[ "Quanlse.Scheduler.SchedulerPipeline.findMaxT", "Quanlse.Scheduler.SchedulerPipeline.SchedulerProcess", "Quanlse.Scheduler.SchedulerPipeline.addToJob", "Quanlse.Scheduler.SchedulerPipeline.reverseFillUp", "Quanlse.Scheduler.SchedulerPipeline.leftAlignSingleGates", "numpy.array", "Quanlse.Scheduler.Sched...
[((2617, 2670), 'Quanlse.Scheduler.SchedulerPipeline.SchedulerProcess', 'SchedulerProcess', (['"""CenterAligned"""', '_centerAlignedCore'], {}), "('CenterAligned', _centerAlignedCore)\n", (2633, 2670), False, 'from Quanlse.Scheduler.SchedulerPipeline import SchedulerProcess, reverseToLayer, reverseFillUp, leftAlignSing...
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "pandas.DataFrame", "absl.testing.absltest.main", "pandas.testing.assert_frame_equal", "sklearn.datasets.load_iris", "gps_building_blocks.ml.statistical_inference.data_preparation.InferenceData", "unittest.mock.patch.object", "sklearn.model_selection.KFold", "numpy.array", "sklearn.model_selection.G...
[((1017, 1123), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': '[[np.nan, 0.0], [0.6, 0.0], [0.4, 3.0], [0.2, np.nan]]', 'columns': "['first', 'second']"}), "(data=[[np.nan, 0.0], [0.6, 0.0], [0.4, 3.0], [0.2, np.nan]],\n columns=['first', 'second'])\n", (1029, 1123), True, 'import pandas as pd\n'), ((10291, 1046...
"""Evaluate the density (defined as ratio between zero and non-zero values) in matrices.""" import os import itertools import matplotlib.pyplot as plt import numpy as np import scipy.stats as stats import scipy.signal as sig from tqdm import tqdm import common as com_xp def convolution(x, y): return np.convolve...
[ "numpy.abs", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "scipy.signal.correlate", "numpy.std", "common.load_aligned_models", "scipy.stats.pearsonr", "itertools.combinations", "numpy.mean", "numpy.array", "numpy.correlate", "numpy.convolve" ]
[((665, 698), 'scipy.signal.correlate', 'sig.correlate', (['x', 'y'], {'mode': '"""valid"""'}), "(x, y, mode='valid')\n", (678, 698), True, 'import scipy.signal as sig\n'), ((710, 726), 'numpy.abs', 'np.abs', (['xcorr[0]'], {}), '(xcorr[0])\n', (716, 726), True, 'import numpy as np\n'), ((1198, 1229), 'numpy.correlate'...
import csv import os import logging import random import shelve import numpy import arrow import matplotlib as mpl from matplotlib import pyplot as plt from platypus import NSGAII, OMOPSO, EpsNSGAII, SMPSO, GDE3, SPEA2, nondominated from eflows_optimization import settings from belleflopt import models from belleflop...
[ "matplotlib.pyplot.title", "belleflopt.comet.log_metric", "matplotlib.pyplot.savefig", "belleflopt.models.SegmentComponent.objects.get", "belleflopt.optimize.StreamNetworkProblem", "matplotlib.pyplot.margins", "platypus.nondominated", "belleflopt.models.ModelRun.objects.get", "belleflopt.optimize.St...
[((374, 422), 'logging.getLogger', 'logging.getLogger', (['"""eflows.optimization.support"""'], {}), "('eflows.optimization.support')\n", (391, 422), False, 'import logging\n'), ((696, 725), 'arrow.Arrow', 'arrow.Arrow', (['year', 'month', 'day'], {}), '(year, month, day)\n', (707, 725), False, 'import arrow\n'), ((880...
# Copyright 1999-2020 Alibaba Group Holding 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 a...
[ "functools.partial", "cupy.zeros", "numpy.zeros", "time.time", "collections.OrderedDict", "logging.getLogger" ]
[((1035, 1062), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1052, 1062), False, 'import logging\n'), ((1289, 1302), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1300, 1302), False, 'from collections import OrderedDict\n'), ((3424, 3435), 'time.time', 'time.time', ([], ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 30 15:33:38 2020 @author: enzo """ import matplotlib.pyplot as plt import numpy as np import cv2 print(f"CV2 Version: {cv2.__version__}") from pathlib import Path #%% Detector1 def calculate_keypoints(img, method, single_channel, graphics=False):...
[ "matplotlib.pyplot.title", "cv2.GaussianBlur", "pickle.dump", "numpy.sum", "cv2.bitwise_and", "skimage.exposure.rescale_intensity", "numpy.argsort", "collections.defaultdict", "pathlib.Path", "matplotlib.pyplot.figure", "numpy.around", "numpy.mean", "numpy.lib.recfunctions.unstructured_to_st...
[((16544, 16589), 'cv2.imread', 'cv2.imread', (["(path_query + 'aswana_cropped.jpg')"], {}), "(path_query + 'aswana_cropped.jpg')\n", (16554, 16589), False, 'import cv2\n'), ((16621, 16643), 'matplotlib.pyplot.imshow', 'plt.imshow', (['queryImage'], {}), '(queryImage)\n', (16631, 16643), True, 'import matplotlib.pyplot...
# <NAME> import os import numpy as np from os import listdir from scipy.misc import imread, imresize # Settings: img_size = 64 channel_size = 1 # 1: Grayscale, 3: RGB def get_img(data_path): # Getting image array from path: img = imread(data_path, flatten= True if channel_size == 1 else False) img = imr...
[ "numpy.load", "numpy.save", "os.makedirs", "os.path.exists", "numpy.array", "scipy.misc.imresize", "os.listdir", "scipy.misc.imread" ]
[((242, 305), 'scipy.misc.imread', 'imread', (['data_path'], {'flatten': '(True if channel_size == 1 else False)'}), '(data_path, flatten=True if channel_size == 1 else False)\n', (248, 305), False, 'from scipy.misc import imread, imresize\n'), ((317, 366), 'scipy.misc.imresize', 'imresize', (['img', '(img_size, img_si...
import logging import numpy as np from rl_agents.agents.common.factory import safe_deepcopy_env from rl_agents.agents.tree_search.olop import OLOP, OLOPAgent, OLOPNode from rl_agents.utils import max_expectation_under_constraint, kl_upper_bound logger = logging.getLogger(__name__) class MDPGapE(OLOP): """ ...
[ "rl_agents.agents.common.factory.safe_deepcopy_env", "numpy.log", "rl_agents.utils.max_expectation_under_constraint", "rl_agents.utils.kl_upper_bound", "numpy.array", "logging.getLogger" ]
[((256, 283), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (273, 283), False, 'import logging\n'), ((12150, 12214), 'numpy.array', 'np.array', (['[(c.mu_ucb + gamma * c.value_upper) for c in children]'], {}), '([(c.mu_ucb + gamma * c.value_upper) for c in children])\n', (12158, 12214), ...
from abc import ABCMeta, abstractmethod from six import with_metaclass from os.path import join import numpy as np from MCEq.misc import theta_rad from MCEq.misc import info import mceq_config as config class EarthsAtmosphere(with_metaclass(ABCMeta)): """ Abstract class containing common methods on atmosphe...
[ "matplotlib.pyplot.title", "MCEq.misc.info", "matplotlib.pyplot.figure", "numpy.sin", "numpy.exp", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "six.with_metaclass", "numpy.zeros_like", "MCEq.geometry.nrlmsise00_mceq.cNRLMSISE00", "MCEq.misc.theta_rad", "scipy.interpolate.Univari...
[((230, 253), 'six.with_metaclass', 'with_metaclass', (['ABCMeta'], {}), '(ABCMeta)\n', (244, 253), False, 'from six import with_metaclass\n'), ((46292, 46318), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(5, 4)'}), '(figsize=(5, 4))\n', (46302, 46318), True, 'import matplotlib.pyplot as plt\n'), ((4632...