code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import pims import os import numpy as np from semtracking import util from semtracking import usercheckfits from semtracking import report from semtracking import plot import re import sys def main(argv): """ :param argv: """ directory = util.get_directory_from_command_line(argv, os.path.basename(__f...
[ "os.remove", "semtracking.usercheckfits.UserCheckFits", "os.path.basename", "numpy.flipud", "os.path.isfile", "pims.Bioformats", "semtracking.report.save_circles_to_csv_grouped", "semtracking.plot.save_fits", "os.path.normpath", "semtracking.util.gen_img_paths", "semtracking.report.save_circles_...
[((388, 417), 'semtracking.util.gen_img_paths', 'util.gen_img_paths', (['directory'], {}), '(directory)\n', (406, 417), False, 'from semtracking import util\n'), ((300, 326), 'os.path.basename', 'os.path.basename', (['__file__'], {}), '(__file__)\n', (316, 326), False, 'import os\n'), ((434, 467), 'os.path.join', 'os.p...
"""This expert maximizes the Sharpe ratio of a portfolio.""" import time import logging from typing import Optional from concurrent.futures.thread import ThreadPoolExecutor import pandas as pd import numpy as np from scipy.optimize import minimize from modules.instruments import Portfolio, Stock from modules.server ...
[ "numpy.stack", "scipy.optimize.minimize", "concurrent.futures.thread.ThreadPoolExecutor", "numpy.sum", "modules.utils.fill_like", "numpy.std", "numpy.empty_like", "time.perf_counter", "numpy.mean", "pandas.Timedelta", "logging.getLogger" ]
[((387, 424), 'logging.getLogger', 'logging.getLogger', (['"""ibkr-algotrading"""'], {}), "('ibkr-algotrading')\n", (404, 424), False, 'import logging\n'), ((647, 676), 'numpy.empty_like', 'np.empty_like', (['norm_port_vals'], {}), '(norm_port_vals)\n', (660, 676), True, 'import numpy as np\n'), ((2608, 2627), 'time.pe...
import PyQt5 from PyQt5.QtCore import pyqtSignal from PyQt5.QtWidgets import QMainWindow, QVBoxLayout, QLabel, QHBoxLayout, QFormLayout import pyqtgraph as pg from sklearn.preprocessing import OneHotEncoder import config from utils.GUI_main_window import init_view from utils.GUI_operation_tab import init_scroll_area, ...
[ "PyQt5.QtCore.pyqtSignal", "PyQt5.QtWidgets.QLabel", "utils.GUI_operation_tab.create_plot_widget", "numpy.concatenate" ]
[((432, 454), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['np.ndarray'], {}), '(np.ndarray)\n', (442, 454), False, 'from PyQt5.QtCore import pyqtSignal\n'), ((1488, 1524), 'utils.GUI_operation_tab.create_plot_widget', 'create_plot_widget', ([], {'y_lim': '(0.0, 1.0)'}), '(y_lim=(0.0, 1.0))\n', (1506, 1524), False, 'from...
import netsquid as ns import numpy as np import matplotlib.pyplot as plt from qkd.networks import TwoPartyNetwork from qkd.protocols.bb84 import KeySenderProtocol as BB84Sender, KeyReceiverProtocol as BB84Receiver from qkd.protocols.e91 import KeySenderProtocol as E91Sender, KeyReceiverProtocol as E91Receiver from qkd...
[ "matplotlib.pyplot.title", "netsquid.sim_run", "matplotlib.pyplot.show", "qkd.networks.TwoPartyNetwork", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "qkd.reconciliation.cascade.ReceiverProtocol", "netsquid.sim_reset", "qkd.reconciliation.cascade.SenderProtocol",...
[((2041, 2062), 'numpy.linspace', 'np.linspace', (['(0)', '(10)', '(6)'], {}), '(0, 10, 6)\n', (2052, 2062), True, 'import numpy as np\n'), ((2076, 2099), 'numpy.linspace', 'np.linspace', (['(0)', '(0.01)', '(5)'], {}), '(0, 0.01, 5)\n', (2087, 2099), True, 'import numpy as np\n'), ((3031, 3041), 'matplotlib.pyplot.sho...
#! /usr/bin/env python -W ignore """ This script demos the use of tfgroupfitter. It determines the most likely origin point of a set of stars assuming a (separate) spherical distribution in position and velocity space. Call with: python perform_synth_fit.py [age] [dX] [dV] [nstars] [prec..] [path_to_chronostar] or mpi...
[ "numpy.load", "numpy.mean", "numpy.std", "chronostar.retired2.converter.convertMeasurementsToCartesian", "emcee.utils.MPIPool", "numpy.save", "chronostar.retired2.datatool.calcMedAndSpan", "chronostar.traceorbit.trace_cartesian_orbit", "numpy.hstack", "matplotlib.use", "chronostar.retired2.datat...
[((946, 970), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (961, 970), False, 'import sys\n'), ((2664, 2758), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'filemode': '"""a"""', 'filename': "(rdir + 'fed_synth_fit.log')"}), "(level=logging.INFO, filemod...
"""Provide some utilities.""" import heapq import logging import sys from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union import matplotlib import matplotlib.pyplot as plt import numpy as np from matplotlib import cm from hoqunm.data_tools.base import OUTPUT_DIR MODEL_COLORS = [ c...
[ "hoqunm.data_tools.base.OUTPUT_DIR.joinpath", "logging.FileHandler", "matplotlib.cm.get_cmap", "heapq.heapify", "matplotlib.ticker.StrMethodFormatter", "heapq.heappush", "numpy.asarray", "logging.StreamHandler", "heapq.heappushpop", "heapq.nlargest", "logging.Formatter", "numpy.arange", "mat...
[((427, 457), 'hoqunm.data_tools.base.OUTPUT_DIR.joinpath', 'OUTPUT_DIR.joinpath', (['"""logging"""'], {}), "('logging')\n", (446, 457), False, 'from hoqunm.data_tools.base import OUTPUT_DIR\n'), ((5718, 5734), 'numpy.asarray', 'np.asarray', (['data'], {}), '(data)\n', (5728, 5734), True, 'import numpy as np\n'), ((707...
''' Main point of entry to perform all experimental tasks Handlings saving files and results of experiments This is quite complicated code due to being backwards compatible with very old experiments Author: <NAME> https://github.com/dscarmo ''' from sys import argv from matplotlib import pyplot as plt import os impo...
[ "matplotlib.pyplot.savefig", "torchvision.models.vgg11", "utils.get_device", "train_results.TrainResults.load", "os.path.isfile", "os.path.join", "matplotlib.pyplot.tight_layout", "transforms.get_data_transforms", "multiprocessing.cpu_count", "utils.get_memory_state", "matplotlib.pyplot.close", ...
[((1252, 1290), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 16}"], {}), "({'font.size': 16})\n", (1271, 1290), True, 'from matplotlib import pyplot as plt\n'), ((1307, 1323), 'utils.parse_argv', 'parse_argv', (['argv'], {}), '(argv)\n', (1317, 1323), False, 'from utils import parse_argv...
from __future__ import print_function import h5py, numpy, sys, glob try: from builtins import range except: pass from pyglib.estructure.dos import get_bands import matplotlib.pyplot as plt def get_greek_label(kname): '''return the possible greek label. ''' if kname.upper() in ['LAMBDA', 'GAMMA', ...
[ "matplotlib.pyplot.title", "h5py.File", "matplotlib.pyplot.show", "builtins.range", "pyglib.estructure.dos.get_bands", "numpy.array", "sys.argv.index", "glob.glob", "numpy.argwhere", "matplotlib.pyplot.subplots", "sys.exit", "numpy.sqrt" ]
[((1816, 1840), 'glob.glob', 'glob.glob', (['"""GBANDS_*.h5"""'], {}), "('GBANDS_*.h5')\n", (1825, 1840), False, 'import h5py, numpy, sys, glob\n'), ((2887, 2911), 'glob.glob', 'glob.glob', (['"""GBANDS_*.h5"""'], {}), "('GBANDS_*.h5')\n", (2896, 2911), False, 'import h5py, numpy, sys, glob\n'), ((4837, 4848), 'pyglib....
from typing import Any, List, Iterable, Tuple, Union import numpy as np import torch import trimesh from detectron2.modeling import build_model from detectron2.structures import Instances from roca.config import roca_config from roca.data import CADCatalog from roca.data.constants import CAD_TAXONOMY, COLOR_BY_CLASS...
[ "trimesh.load", "roca.data.datasets.register_scan2cad", "roca.data.CADCatalog.get", "torch.load", "numpy.asarray", "detectron2.modeling.build_model", "sys.path.insert", "roca.utils.alignment_errors.translation_diff", "numpy.sin", "numpy.linalg.inv", "numpy.cos", "torch.no_grad", "roca.config...
[((537, 571), 'sys.path.insert', 'sys.path.insert', (['(-1)', '"""../renderer"""'], {}), "(-1, '../renderer')\n", (552, 571), False, 'import sys\n'), ((2636, 2651), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2649, 2651), False, 'import torch\n'), ((863, 898), 'roca.config.roca_config', 'roca_config', (['"""Sc...
import os dirname = os.path.dirname(__file__) import astropy.table as at from collections import OrderedDict import matplotlib.pyplot as plt import numpy as np from scipy import interpolate import astropy.table as at import pandas as pd from glob import glob from copy import deepcopy from scipy.optimize import minim...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.arange", "os.path.join", "numpy.round", "scipy.optimize.minimize", "os.path.dirname", "scipy.interpolate.UnivariateSpline", "os.path.exists", "numpy.isfinite", "numpy.nansum", "copy.deepcopy", "matplotlib.pyplot.legend", "matplo...
[((20, 45), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (35, 45), False, 'import os\n'), ((1485, 1511), 'numpy.sqrt', 'np.sqrt', (['(xx ** 2 + yy ** 2)'], {}), '(xx ** 2 + yy ** 2)\n', (1492, 1511), True, 'import numpy as np\n'), ((1568, 1589), 'numpy.nanmin', 'np.nanmin', (['dd'], {'axis'...
# coding: utf-8 # In[11]: # First of all, we import all the necessary libs import nltk import re import unicodedata import string from nltk.corpus import stopwords from nltk.stem import LancasterStemmer, WordNetLemmatizer import pandas as pd import inflect import pickle import math from scipy.spatial import distan...
[ "inflect.engine", "pickle.dump", "folium.features.CustomIcon", "pandas.read_csv", "numpy.arange", "folium.Map", "geopy.distance.distance", "nltk.word_tokenize", "nltk.stem.LancasterStemmer", "pandas.DataFrame", "heapq._heapify_max", "unicodedata.normalize", "heapq.nlargest", "re.sub", "p...
[((700, 738), 'geopy.geocoders.GeoNames', 'geocoders.GeoNames', ([], {'username': '"""clabat9"""'}), "(username='clabat9')\n", (718, 738), False, 'from geopy import geocoders\n'), ((747, 791), 'geopy.geocoders.Nominatim', 'geocoders.Nominatim', ([], {'user_agent': '"""<PASSWORD>"""'}), "(user_agent='<PASSWORD>')\n", (7...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ "tensorflow.python.platform.test.main", "numpy.array", "absl.testing.parameterized.parameters", "tensorflow.python.ops.string_ops.substr" ]
[((11244, 11288), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['np.int32', 'np.int64'], {}), '(np.int32, np.int64)\n', (11268, 11288), False, 'from absl.testing import parameterized\n'), ((11864, 11875), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (11873, 11875), Fal...
import numpy as np from pyspedas.utilities.interpol import interpol def gsm2lmn(times, Rxyz, Bxyz, swdata=None): ''' Transforms vector field from GSM to LMN (boundary-normal) coordinate system for the magnetopause using the Shue et al. (1998) magnetopause model ''' if swdata is None: # ...
[ "numpy.log", "numpy.square", "pyspedas.utilities.interpol.interpol", "numpy.cross", "numpy.isnan", "numpy.sin", "numpy.array", "numpy.matmul", "numpy.cos", "numpy.sqrt" ]
[((928, 959), 'pyspedas.utilities.interpol.interpol', 'interpol', (['dparr', 'timessw', 'times'], {}), '(dparr, timessw, times)\n', (936, 959), False, 'from pyspedas.utilities.interpol import interpol\n'), ((977, 1008), 'pyspedas.utilities.interpol.interpol', 'interpol', (['bzarr', 'timessw', 'times'], {}), '(bzarr, ti...
""" Fill lat/lng raster nodata """ import argparse import glob import logging import multiprocessing import os import shutil import warnings import threading import time warnings.filterwarnings('error') from osgeo import gdal import ecoshard import pygeoprocessing import numpy import scipy.ndimage import taskgraph gd...
[ "argparse.ArgumentParser", "numpy.ones", "osgeo.gdal.SetCacheMax", "numpy.isclose", "glob.glob", "shutil.rmtree", "os.path.join", "multiprocessing.cpu_count", "pygeoprocessing.convolve_2d", "numpy.copy", "os.path.dirname", "numpy.isfinite", "pygeoprocessing.numpy_array_to_raster", "pygeopr...
[((170, 202), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""error"""'], {}), "('error')\n", (193, 202), False, 'import warnings\n'), ((318, 343), 'osgeo.gdal.SetCacheMax', 'gdal.SetCacheMax', (['(2 ** 26)'], {}), '(2 ** 26)\n', (334, 343), False, 'from osgeo import gdal\n'), ((352, 379), 'multiprocessing....
import numpy as np from numba import guvectorize from pygama.dsp.errors import DSPFatal def cusp_filter(length, sigma, flat, decay): """ Apply a CUSP filter to the waveform. Note that it is composed of a factory function that is called using the init_args argument and that the function the waveforms a...
[ "numpy.power", "numpy.zeros", "numpy.isnan", "pygama.dsp.errors.DSPFatal", "numpy.exp", "numba.guvectorize", "numpy.convolve", "numpy.sinh" ]
[((1603, 1619), 'numpy.zeros', 'np.zeros', (['length'], {}), '(length)\n', (1611, 1619), True, 'import numpy as np\n'), ((1975, 2005), 'numpy.convolve', 'np.convolve', (['cusp', 'den', '"""same"""'], {}), "(cusp, den, 'same')\n", (1986, 2005), True, 'import numpy as np\n'), ((2016, 2124), 'numba.guvectorize', 'guvector...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from copy import deepcopy import numpy as np """Nonlinear functions to simulate: using :class:`.newmark.Newmark`. New nonlinear elements should derive :class:`Nonlinear_Element` and implement :: def fnl(q,u) # nonlinear force def dfdq(q,u) # der...
[ "copy.deepcopy", "numpy.outer", "numpy.tanh", "numpy.zeros", "numpy.inner", "numpy.atleast_1d" ]
[((1652, 1666), 'numpy.zeros', 'np.zeros', (['ndof'], {}), '(ndof)\n', (1660, 1666), True, 'import numpy as np\n'), ((2374, 2396), 'numpy.zeros', 'np.zeros', (['(ndof, ndof)'], {}), '((ndof, ndof))\n', (2382, 2396), True, 'import numpy as np\n'), ((2415, 2437), 'numpy.zeros', 'np.zeros', (['(ndof, ndof)'], {}), '((ndof...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import print_function, division import numpy as np from numpy.testing import assert_allclose from astropy.tests.helper import pytest from astropy.units import Quantity from astropy.coordinates import Angle from astropy.utils.data import get...
[ "astropy.units.Quantity", "astropy.utils.data.get_pkg_data_filename", "numpy.diff", "astropy.tests.helper.pytest.mark.skipif", "numpy.linspace", "numpy.testing.assert_allclose", "astropy.coordinates.Angle" ]
[((570, 605), 'astropy.tests.helper.pytest.mark.skipif', 'pytest.mark.skipif', (['"""not HAS_SCIPY"""'], {}), "('not HAS_SCIPY')\n", (588, 605), False, 'from astropy.tests.helper import pytest\n'), ((920, 955), 'astropy.tests.helper.pytest.mark.skipif', 'pytest.mark.skipif', (['"""not HAS_SCIPY"""'], {}), "('not HAS_SC...
"""Collection of functions dealing with retrieving/calculating various instrument properties Authors ------- - <NAME> Uses ---- This module can be imported and used as such: :: from jwql.utils import instrument_properties as inst amps = inst.amplifier_info('my_files.fits') """ from co...
[ "copy.deepcopy", "astropy.io.fits.getheader", "numpy.min", "numpy.where", "numpy.isclose", "astropy.io.fits.open", "numpy.max" ]
[((1507, 1531), 'astropy.io.fits.getheader', 'fits.getheader', (['filename'], {}), '(filename)\n', (1521, 1531), False, 'from astropy.io import fits\n'), ((2039, 2081), 'copy.deepcopy', 'deepcopy', (['AMPLIFIER_BOUNDARIES[instrument]'], {}), '(AMPLIFIER_BOUNDARIES[instrument])\n', (2047, 2081), False, 'from copy import...
import argparse import json import logging import math from abc import ABC, abstractmethod from collections import defaultdict from glob import glob from typing import Callable import numpy as np from housing_data.analysis.json_to_df import standardize_data from housing_model.data.data import Data, prepare_data from ...
[ "argparse.ArgumentParser", "logging.basicConfig", "math.fabs", "numpy.median", "numpy.std", "housing_data.analysis.json_to_df.standardize_data", "json.dumps", "housing_model.models.baselines.HouseSigmaModel", "collections.defaultdict", "numpy.mean", "glob.glob", "housing_model.data.data.prepar...
[((477, 504), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (494, 504), False, 'import logging\n'), ((2209, 2232), 'glob.glob', 'glob', (['eval_file_pattern'], {}), '(eval_file_pattern)\n', (2213, 2232), False, 'from glob import glob\n'), ((2252, 2275), 'housing_data.analysis.json_to_df....
''' maths.py: part of pybraincompare package Simple math functions ''' from __future__ import print_function from __future__ import absolute_import from __future__ import division from builtins import str from builtins import range from past.utils import old_div from .mrutils import ( apply_threshold, do_mask...
[ "pandas.DataFrame", "scipy.stats.norm.ppf", "nibabel.load", "scipy.stats.spearmanr", "numpy.zeros", "os.path.exists", "numpy.isnan", "nibabel.save", "scipy.stats.pearsonr", "numpy.where", "builtins.str", "builtins.range", "scipy.stats.t.cdf", "numpy.unique" ]
[((6573, 6591), 'pandas.DataFrame', 'pandas.DataFrame', ([], {}), '()\n', (6589, 6591), False, 'import pandas\n'), ((7578, 7588), 'builtins.range', 'range', (['(100)'], {}), '(100)\n', (7583, 7588), False, 'from builtins import range\n'), ((8268, 8292), 'nibabel.load', 'nibabel.load', (['t_stat_map'], {}), '(t_stat_map...
# -*- coding: utf-8 -*- from collections import OrderedDict import numpy as np import tensorflow as tf class YoloParser: def __init__(self, cfg_path, weights_path, output_path, input_dims=3): self._input_dims = input_dims self._cfg_path = cfg_path self._weights_path = weights_path self._output_path...
[ "tensorflow.train.Saver", "tensorflow.global_variables_initializer", "tensorflow.Session", "numpy.transpose", "tensorflow.variable_scope", "numpy.product", "tensorflow.Variable", "collections.OrderedDict" ]
[((738, 751), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (749, 751), False, 'from collections import OrderedDict\n'), ((5609, 5633), 'tensorflow.train.Saver', 'tf.train.Saver', (['var_list'], {}), '(var_list)\n', (5623, 5633), True, 'import tensorflow as tf\n'), ((5645, 5678), 'tensorflow.global_variab...
import numpy from sklearn.base import BaseEstimator, TransformerMixin class EmbeddingsExtractor(BaseEstimator, TransformerMixin): def __init__(self, word_indices, max_lengths=None, add_tokens=None, unk_policy="random", **kwargs): """ :param word_...
[ "numpy.asarray", "numpy.zeros" ]
[((818, 862), 'numpy.zeros', 'numpy.zeros', (['(X.size, length)'], {'dtype': '"""int32"""'}), "((X.size, length), dtype='int32')\n", (829, 862), False, 'import numpy\n'), ((3059, 3076), 'numpy.asarray', 'numpy.asarray', (['Xs'], {}), '(Xs)\n', (3072, 3076), False, 'import numpy\n')]
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
[ "os.remove", "numpy.amin", "numpy.std", "numpy.median", "os.system", "scipy.io.wavfile.read", "numpy.amax", "numpy.append", "numpy.mean", "python_speech_features.logfbank", "python_speech_features.ssc", "python_speech_features.mfcc" ]
[((3005, 3019), 'scipy.io.wavfile.read', 'wav.read', (['file'], {}), '(file)\n', (3013, 3019), True, 'import scipy.io.wavfile as wav\n'), ((3036, 3051), 'python_speech_features.mfcc', 'mfcc', (['sig', 'rate'], {}), '(sig, rate)\n', (3040, 3051), False, 'from python_speech_features import mfcc\n'), ((3068, 3087), 'pytho...
#!/usr/bin/python import matplotlib; matplotlib.use('Agg') # for systems without X11 from matplotlib.backends.backend_pdf import PdfPages import sys, os, argparse, subprocess, json, pylab, numpy from itertools import cycle from re import search """ python parse-shadow.py --help """ pylab.rcParams.update({ 'backe...
[ "pylab.close", "argparse.ArgumentParser", "numpy.isnan", "numpy.mean", "pylab.figure", "numpy.convolve", "itertools.cycle", "argparse.ArgumentTypeError", "pylab.title", "pylab.ylabel", "os.path.exists", "numpy.max", "pylab.ylim", "pylab.xlabel", "re.search", "pylab.legend", "subproce...
[((38, 59), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (52, 59), False, 'import matplotlib\n'), ((286, 1062), 'pylab.rcParams.update', 'pylab.rcParams.update', (["{'backend': 'PDF', 'font.size': 16, 'figure.figsize': (6, 4.5),\n 'figure.dpi': 100.0, 'figure.subplot.left': 0.15,\n 'figur...
import os import cv2 from flask import request, url_for from flask_login import login_required from werkzeug.urls import url_parse import subprocess from app import app ALLOWED_EXTENSIONS = set(['png','jpg']) import time from datetime import timedelta app.send_file_max_age_default = timedelta(seconds=5) def allowed...
[ "os.mkdir", "flask.flash", "pandas.read_csv", "flask.url_for", "werkzeug.urls.url_parse", "os.path.join", "numpy.round", "app.models.User", "flask.request.args.get", "flask.redirect", "os.path.dirname", "os.path.exists", "app.models.User.query.filter_by", "datetime.timedelta", "app.db.se...
[((287, 307), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(5)'}), '(seconds=5)\n', (296, 307), False, 'from datetime import timedelta\n'), ((441, 455), 'app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (450, 455), False, 'from app import app\n'), ((457, 476), 'app.app.route', 'app.route', (['"""/inde...
#!/usr/bin/env python """ Gibbs Sampler Data Class """ import numpy as np import pandas as pd import logging from ep_clustering._utils import Map # Author Information __author__ = "<NAME>" # Modify the root logger logger = logging.getLogger(name=__name__) class GibbsData(Map): """ Data for GibbsSampler ...
[ "numpy.random.rand", "numpy.cumsum", "logging.getLogger" ]
[((228, 260), 'logging.getLogger', 'logging.getLogger', ([], {'name': '__name__'}), '(name=__name__)\n', (245, 260), False, 'import logging\n'), ((1202, 1219), 'numpy.random.rand', 'np.random.rand', (['(1)'], {}), '(1)\n', (1216, 1219), True, 'import numpy as np\n'), ((1222, 1238), 'numpy.cumsum', 'np.cumsum', (['probs...
# Standard library from __future__ import print_function, with_statement from time import time import re import os import copy import random import csv # Dependencies import numpy as np import h5py from PIL import Image def to_categorical(y, nb_classes=None): """ Convert class vector (integers from 0 to nb_cl...
[ "random.shuffle", "copy.deepcopy", "numpy.array", "h5py.File" ]
[((4065, 4093), 'copy.deepcopy', 'copy.deepcopy', (['self._indices'], {}), '(self._indices)\n', (4078, 4093), False, 'import copy\n'), ((4102, 4125), 'random.shuffle', 'random.shuffle', (['indices'], {}), '(indices)\n', (4116, 4125), False, 'import random\n'), ((7383, 7406), 'random.shuffle', 'random.shuffle', (['indic...
# coding: utf-8 # # Function applylut # # ## Synopse # # Intensity image transform. # # - **g = applylut(fi, it)** # # - **g**: Image. # # - **fi**: Image. input image, gray scale or index image. # - **it**: Image. Intensity transform. Table of one or three columns. # In[ ]: import numpy as np def appl...
[ "sys.path.append", "matplotlib.image.imread", "os.path.abspath", "numpy.zeros", "ea979.src.adshow", "numpy.array", "ea979.src.applylut", "numpy.swapaxes", "numpy.arange" ]
[((1407, 1432), 'os.path.abspath', 'os.path.abspath', (['"""../../"""'], {}), "('../../')\n", (1422, 1432), False, 'import sys, os\n'), ((1902, 1934), 'numpy.array', 'np.array', (['[[0, 1, 2], [3, 4, 5]]'], {}), '([[0, 1, 2], [3, 4, 5]])\n', (1910, 1934), True, 'import numpy as np\n'), ((2052, 2070), 'ea979.src.applylu...
import matplotlib.pyplot as plt import numpy as np import sys n_tau = 600 n_t = 1400 data = np.loadtxt("res/spec_2d_ 4_2.dat") w_tau_lower, w_tau_upper = -40000.0, 40000.0 w_t_lower, w_t_upper = -40000.0, +40000.0 # w_tau_lower, w_tau_upper = 15000.0, 17000.0 # w_t_lower, w_t_upper = 15000.0, 17000.0 font = { ...
[ "matplotlib.pyplot.title", "numpy.size", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplotlib.pyplot.colorbar", "numpy.nonzero", "matplotlib.pyplot.contour", "numpy.loadtxt", "numpy.reshape", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matp...
[((96, 130), 'numpy.loadtxt', 'np.loadtxt', (['"""res/spec_2d_ 4_2.dat"""'], {}), "('res/spec_2d_ 4_2.dat')\n", (106, 130), True, 'import numpy as np\n'), ((502, 561), 'numpy.nonzero', 'np.nonzero', (['((w_tau >= w_tau_lower) & (w_tau <= w_tau_upper))'], {}), '((w_tau >= w_tau_lower) & (w_tau <= w_tau_upper))\n', (512,...
""" Data utilities. File adapted from https://github.com/ds4dm/ecole by <NAME> @Sandbergo May 2021 """ import gzip import pickle import numpy as np import torch import torch_geometric class BipartiteNodeData(torch_geometric.data.Data): """ This class encode a node bipartite graph observation as returned ...
[ "gzip.open", "torch.where", "torch.FloatTensor", "pickle.load", "numpy.array" ]
[((3208, 3265), 'torch.FloatTensor', 'torch.FloatTensor', (['[sample_scores[j] for j in candidates]'], {}), '([sample_scores[j] for j in candidates])\n', (3225, 3265), False, 'import torch\n'), ((2276, 2317), 'gzip.open', 'gzip.open', (['self.sample_files[index]', '"""rb"""'], {}), "(self.sample_files[index], 'rb')\n",...
import numpy as np from numpy import log, exp from scipy.stats import norm, lognorm from scipy.special import gammaln from .GGPutils import GGPsumrnd # when sigma < 0, this is not a valid log density of v def log_density_v(v, n, abs_pi, alpha, sigma, tau): return v * n - (n - alpha * abs_pi) * log(exp(v) + tau) ...
[ "numpy.log", "scipy.stats.norm.logpdf", "numpy.zeros", "numpy.isinf", "numpy.isnan", "numpy.random.gamma", "numpy.random.random", "numpy.exp", "numpy.random.normal", "scipy.special.gammaln", "scipy.stats.lognorm.logpdf", "numpy.sqrt" ]
[((4730, 4741), 'numpy.zeros', 'np.zeros', (['C'], {}), '(C)\n', (4738, 4741), True, 'import numpy as np\n'), ((1197, 1298), 'numpy.random.gamma', 'np.random.gamma', (['(alpha_a + abs_pi)', '(1.0 / (alpha_b + ((u + tau) ** sigma - tau ** sigma) / sigma))'], {}), '(alpha_a + abs_pi, 1.0 / (alpha_b + ((u + tau) ** sigma ...
# -*- coding: utf-8 -*- """Camp_car_classifier.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1u42_Y0QVSHjM0iHRzpOBUKB3bNTjBWF1 """ import keras from keras import backend as k from keras.models import Sequential from keras.preprocessing.image i...
[ "zipfile.ZipFile", "keras.backend.image_data_format", "random.shuffle", "sklearn.model_selection.train_test_split", "google.colab.patches.cv2_imshow", "keras.layers.MaxPooling2D", "keras.layers.Flatten", "keras.layers.Dropout", "cv2.imread", "keras.layers.Dense", "numpy.array", "keras.layers.C...
[((1873, 1889), 'random.shuffle', 'shuffle', (['healthy'], {}), '(healthy)\n', (1880, 1889), False, 'from random import shuffle\n'), ((2358, 2405), 'sklearn.model_selection.train_test_split', 'train_test_split', (['images', 'labels'], {'test_size': '(0.2)'}), '(images, labels, test_size=0.2)\n', (2374, 2405), False, 'f...
import numpy as np import sys import matplotlib.pyplot as plt from UTILS.Calculus import Calculus from UTILS.SetAxisLimit import SetAxisLimit from UTILS.Tools import Tools from UTILS.Errors import Errors # Theoretical background https://arxiv.org/abs/1401.5176 # Mocak, Meakin, Viallet, Arnett, 2014, Compressible Hyd...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.axvline", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.figure", "matplotlib.pyplot.gca", "sys.exit", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.sav...
[((7395, 7421), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(7, 6)'}), '(figsize=(7, 6))\n', (7405, 7421), True, 'import matplotlib.pyplot as plt\n'), ((7695, 7735), 'matplotlib.pyplot.title', 'plt.title', (["('Xflux Y for ' + self.element)"], {}), "('Xflux Y for ' + self.element)\n", (7704, 7735), True...
# coding=utf-8 # Copyright 2019 The Google Research 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 applicab...
[ "stacked_capsule_autoencoders.capsules.data.nlu.return_labels", "tensorflow_datasets.load", "tensorflow.nest.flatten", "tensorflow.data.Dataset.from_generator", "sonnet.TileByDim", "numpy.random.choice", "os.path.join" ]
[((3462, 3493), 'os.path.join', 'os.path.join', (['directory', '"""bd_l"""'], {}), "(directory, 'bd_l')\n", (3474, 3493), False, 'import os\n'), ((5014, 5126), 'tensorflow.data.Dataset.from_generator', 'tf.data.Dataset.from_generator', (['g'], {'output_types': '(tf.int32, tf.int32, tf.int32)', 'output_shapes': 'output_...
#!/usr/bin/python # SSAML # This code is designed to calculate the number of patients (or events) needed for a clinical # validation study of a machine learning algorithm. Choose your dataset wisely, because # inadequate data will give you wrong answers. Use at your own risk. # <NAME>, MD, PhD # USAGE: #power.py <runM...
[ "numpy.isin", "numpy.sum", "pandas.read_csv", "lifelines.CoxPHFitter", "numpy.floor", "numpy.isnan", "os.chdir", "numpy.nanmean", "pandas.DataFrame", "numpy.std", "numpy.savetxt", "numpy.isfinite", "numpy.cumsum", "numpy.reshape", "matplotlib.pyplot.subplots", "pandas.concat", "sklea...
[((1148, 1169), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (1162, 1169), False, 'import matplotlib\n'), ((14717, 14728), 'time.time', 'time.time', ([], {}), '()\n', (14726, 14728), False, 'import time\n'), ((14729, 14744), 'os.chdir', 'os.chdir', (['mydir'], {}), '(mydir)\n', (14737, 14744), ...
""" Sample script that runs numpy functions logged by recipy. """ # Copyright (c) 2016 University of Edinburgh. from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import recipy import os impo...
[ "numpy.load", "numpy.save", "os.remove", "numpy.fromfile", "numpy.savetxt", "numpy.genfromtxt", "integration_test.packages.base.Base.__init__", "numpy.savez_compressed", "numpy.arange", "numpy.loadtxt", "numpy.savez", "os.path.join" ]
[((1024, 1043), 'integration_test.packages.base.Base.__init__', 'Base.__init__', (['self'], {}), '(self)\n', (1037, 1043), False, 'from integration_test.packages.base import Base\n'), ((1068, 1115), 'os.path.join', 'os.path.join', (['self.current_dir', '"""data"""', '"""numpy"""'], {}), "(self.current_dir, 'data', 'num...
import os import numpy as np import csv from prettytable import PrettyTable from bokeh.plotting import figure, output_file, show from bokeh.palettes import magma from bokeh.models.widgets import Panel, Tabs from bokeh.io import output_file, show import math from prettytable import PrettyTable def read_csv(f...
[ "bokeh.models.widgets.Tabs", "numpy.divide", "math.exp", "numpy.multiply", "bokeh.plotting.figure", "bokeh.io.show", "bokeh.io.output_file", "prettytable.PrettyTable", "numpy.linspace", "bokeh.models.widgets.Panel", "os.listdir" ]
[((978, 1012), 'numpy.linspace', 'np.linspace', (['t0', '(t0 + 0.9)'], {'num': '(900)'}), '(t0, t0 + 0.9, num=900)\n', (989, 1012), True, 'import numpy as np\n'), ((1055, 1080), 'numpy.multiply', 'np.multiply', (['y_inf', '(1 - e)'], {}), '(y_inf, 1 - e)\n', (1066, 1080), True, 'import numpy as np\n'), ((1195, 1216), '...
#Copied from bmi_tasks_analysis (same filename) - HS 20211026 from riglib.bmi import kfdecoder import numpy as np from riglib.experiment import traits from .bmimultitasks import SimpleEndpointAssister import pickle import os from datetime import date class CurlFieldKalmanFilter(kfdecoder.KalmanFilter): d...
[ "pickle.dump", "copy.deepcopy", "numpy.zeros_like", "numpy.deg2rad", "os.getcwd", "random.shuffle", "numpy.zeros", "datetime.date.today", "numpy.sin", "numpy.arange", "numpy.array", "numpy.cos", "numpy.dot", "riglib.experiment.traits.Float", "os.chdir" ]
[((2164, 2250), 'riglib.experiment.traits.Float', 'traits.Float', (['(10.0)'], {'desc': '"""scaling factor from speed to rotation angle in degrees"""'}), "(10.0, desc=\n 'scaling factor from speed to rotation angle in degrees')\n", (2176, 2250), False, 'from riglib.experiment import traits\n'), ((8530, 8616), 'rigli...
""" This script goes through the image folder (for image indices in good_indices) and saves the aspect ratio information in ../../Data/images_size.npy """ from PIL import Image import numpy as np def main(): path = "../../data/photonet_dataset/images/" subset_indices = list(np.load('../../data/good_indices.n...
[ "numpy.load", "numpy.save", "numpy.array", "PIL.Image.open" ]
[((561, 611), 'numpy.save', 'np.save', (['"""../../Data/image_sizes.npy"""', 'image_sizes'], {}), "('../../Data/image_sizes.npy', image_sizes)\n", (568, 611), True, 'import numpy as np\n'), ((286, 324), 'numpy.load', 'np.load', (['"""../../data/good_indices.npy"""'], {}), "('../../data/good_indices.npy')\n", (293, 324)...
import GMatElastic as gmat import GooseMPL as gplt import matplotlib.pyplot as plt import numpy as np plt.style.use(["goose", "goose-latex"]) def ddot42(A4, B2): return np.einsum("ijkl,lk->ij", A4, B2) def ddot22(A2, B2): return np.einsum("ij,ji", A2, B2) def norm(A2): return np.abs(np.einsum("ij,ji"...
[ "matplotlib.pyplot.show", "numpy.logspace", "GMatElastic.Cartesian3d.Elastic", "numpy.zeros", "numpy.einsum", "matplotlib.pyplot.style.use", "GooseMPL.plot_powerlaw", "numpy.array", "numpy.random.random", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((103, 142), 'matplotlib.pyplot.style.use', 'plt.style.use', (["['goose', 'goose-latex']"], {}), "(['goose', 'goose-latex'])\n", (116, 142), True, 'import matplotlib.pyplot as plt\n'), ((339, 374), 'GMatElastic.Cartesian3d.Elastic', 'gmat.Cartesian3d.Elastic', (['(10.0)', '(1.0)'], {}), '(10.0, 1.0)\n', (363, 374), Tr...
# coding: utf-8 # # Function phasecorr # ## Synopse # Computes the phase correlation of two images. # # - **g = phasecorr(f,h)** # - **OUTPUT** # - **g**: Image. Phase correlation map. # - **INPUT** # - **f**: Image. n-dimensional. # - **h**: Image. n-dimensional. # ## Description ...
[ "sys.path.append", "os.path.abspath", "matplotlib.image.imread", "numpy.zeros_like", "numpy.abs", "ea979.src.normalize", "numpy.argmax", "ea979.src.phasecorr", "numpy.fft.fftn", "ea979.src.ptrans", "numpy.unravel_index", "numpy.fft.ifftn", "numpy.array", "numpy.random.rand", "numpy.conju...
[((732, 746), 'numpy.fft.fftn', 'np.fft.fftn', (['f'], {}), '(f)\n', (743, 746), True, 'import numpy as np\n'), ((755, 769), 'numpy.fft.fftn', 'np.fft.fftn', (['h'], {}), '(h)\n', (766, 769), True, 'import numpy as np\n'), ((826, 841), 'numpy.fft.ifftn', 'np.fft.ifftn', (['R'], {}), '(R)\n', (838, 841), True, 'import n...
# TEST GPU SET UP via commands # run commands below: # 1. nvcc -V --> nvidia cuda compiler driver # 2. nvidia-smi --> about GPU # cudNN version can be found at C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include\cudnn.h as below: #define CUDNN_MAJOR 7 #define CUDNN_MINOR 6 #define CUDNN_PATCHL...
[ "tensorflow.keras.preprocessing.image.ImageDataGenerator", "tensorflow._api.v2.compat.v1.InteractiveSession", "tensorflow.keras.applications.resnet50.ResNet50", "numpy.argmax", "glob.glob", "tensorflow.keras.applications.resnet50.preprocess_input", "tensorflow.keras.layers.Flatten", "tensorflow.test.i...
[((454, 482), 'tensorflow.test.is_built_with_cuda', 'tf.test.is_built_with_cuda', ([], {}), '()\n', (480, 482), True, 'import tensorflow as tf\n'), ((519, 594), 'tensorflow.test.is_gpu_available', 'tf.test.is_gpu_available', ([], {'cuda_only': '(False)', 'min_cuda_compute_capability': 'None'}), '(cuda_only=False, min_c...
import numpy as np import loop import speed def apply(i,state) : zM = (state.z[i+1,:] > state.zmax) zm = (state.z[i+1,:] < state.zmin) indM = np.where(zM)[0] indm = np.where(zm)[0] state.bdy_bot[indM] += 1 state.bdy_top[indm] += 1 #Bottom boundary if indM.size > 0 : ds = (sta...
[ "speed.get_der", "loop.ray_step", "numpy.where" ]
[((155, 167), 'numpy.where', 'np.where', (['zM'], {}), '(zM)\n', (163, 167), True, 'import numpy as np\n'), ((182, 194), 'numpy.where', 'np.where', (['zm'], {}), '(zm)\n', (190, 194), True, 'import numpy as np\n'), ((385, 416), 'loop.ray_step', 'loop.ray_step', (['i', 'zM', 'ds', 'state'], {}), '(i, zM, ds, state)\n', ...
import numpy as np def make_sua_datum_token_frequency_fn(D): data_set = D.get_data() token_counts = dict() for d in data_set: utts = d.get("utterances") for utt in utts: strs = utt["nlp"]["clean_strs"]["strs"] for s in strs: if s not in toke...
[ "numpy.log" ]
[((497, 524), 'numpy.log', 'np.log', (['token_counts[token]'], {}), '(token_counts[token])\n', (503, 524), True, 'import numpy as np\n')]
""" convert pth to ply under {scannet_dir}/Ply """ import torch import numpy as np import glob import os import time import sys from plyfile import PlyData, PlyElement # ------ Configuration ------ scannet_dir = "/home/dtc/Backup/Data/ScanNet" # --- end of Configuration --- # path to Pth Pth_dir = os.path.joi...
[ "plyfile.PlyElement.describe", "os.makedirs", "os.path.basename", "torch.load", "os.path.exists", "plyfile.PlyData", "time.time", "numpy.array", "os.path.join" ]
[((309, 350), 'os.path.join', 'os.path.join', (['scannet_dir', '"""Pth/Original"""'], {}), "(scannet_dir, 'Pth/Original')\n", (321, 350), False, 'import os\n'), ((425, 457), 'os.path.join', 'os.path.join', (['scannet_dir', '"""Ply"""'], {}), "(scannet_dir, 'Ply')\n", (437, 457), False, 'import os\n'), ((581, 592), 'tim...
from dolfin import * from numpy import pi,ceil,sin #from multiprocessing import Pool from pathos.multiprocessing import ProcessingPool as Pool pc = PETScPreconditioner("icc") solver = PETScKrylovSolver("cg",pc) def solve_subproblem(j,A,B,b,V,k,kappa,beta): y = j*k w = Function(V) solver.so...
[ "numpy.sin", "pathos.multiprocessing.ProcessingPool" ]
[((1788, 1799), 'pathos.multiprocessing.ProcessingPool', 'Pool', (['procs'], {}), '(procs)\n', (1792, 1799), True, 'from pathos.multiprocessing import ProcessingPool as Pool\n'), ((1876, 1898), 'numpy.sin', 'sin', (['(pi * problem.beta)'], {}), '(pi * problem.beta)\n', (1879, 1898), False, 'from numpy import pi, ceil, ...
"""This file gets 2D affine transformation-invariant keypoints for a given image. It's really just a bunch of hacks thrown together that works well enough for the proof of concept. The whole proof of concept would be drastically better with a well designed 2D affine transformation-invariant keypointing algorithm. """ ...
[ "cv2.GaussianBlur", "json.dump", "cv2.contourArea", "cv2.cvtColor", "cv2.threshold", "cv2.moments", "numpy.identity", "cv2.imread", "cv2.split", "numpy.array", "cv2.findContours" ]
[((1705, 1742), 'numpy.array', 'np.array', (['PIXEL_VALS'], {'dtype': 'img.dtype'}), '(PIXEL_VALS, dtype=img.dtype)\n', (1713, 1742), True, 'import numpy as np\n'), ((1932, 1984), 'cv2.GaussianBlur', 'cv2.GaussianBlur', (['img', '(gauss_width, gauss_width)', '(0)'], {}), '(img, (gauss_width, gauss_width), 0)\n', (1948,...
import torch import torch.nn as nn import torch.multiprocessing as mp from scipy.io import wavfile import numpy as np import hparams as hp import os import argparse import re from string import punctuation from fastspeech2 import FastSpeech2 from vocoder import vocgan_generator from text import text_t...
[ "numpy.absolute", "argparse.ArgumentParser", "torch.device", "fastspeech2.FastSpeech2", "os.path.join", "torch.load", "g2pk.G2p", "os.path.exists", "utils.de_norm", "scipy.io.wavfile.write", "hparams.vocoder.lower", "re.sub", "numpy.stack", "numpy.hstack", "torch.from_numpy", "jamo.h2j...
[((459, 479), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (471, 479), False, 'import torch\n'), ((1406, 1411), 'g2pk.G2p', 'G2p', ([], {}), '()\n', (1409, 1411), False, 'from g2pk import G2p\n'), ((1480, 1490), 'jamo.h2j', 'h2j', (['phone'], {}), '(phone)\n', (1483, 1490), False, 'from jamo impo...
from time import time import numpy as np import matplotlib.pyplot as plt from skimage.io import imread from utils.block_matching import compute_ssd, compute_aggregation from utils.plot_utils import plot_images if __name__ == "__main__": max_disp_steps = 50 # maximum disparity to consider window_size = 7 # ...
[ "utils.block_matching.compute_aggregation", "utils.block_matching.compute_ssd", "matplotlib.pyplot.show", "utils.plot_utils.plot_images", "numpy.argmin", "time.time", "skimage.io.imread" ]
[((665, 686), 'skimage.io.imread', 'imread', (['left_img_path'], {}), '(left_img_path)\n', (671, 686), False, 'from skimage.io import imread\n'), ((703, 725), 'skimage.io.imread', 'imread', (['right_img_path'], {}), '(right_img_path)\n', (709, 725), False, 'from skimage.io import imread\n'), ((779, 785), 'time.time', '...
import numpy as np from scipy import linalg as sciLinalg from dataio import DataIO class ClosedForm(object): """ Closed Form solution of regression problem. Polynomial Fitting y(x, w) = w0 + w1 x^1 + w2 x^2 ... wM x^M (order M) -> compute weights wj SOLVE - read input and target vector ...
[ "scipy.linalg.solve", "numpy.vectorize", "dataio.DataIO.write_data", "numpy.empty", "numpy.mean", "numpy.exp", "numpy.linspace", "dataio.DataIO.read_data" ]
[((896, 930), 'numpy.empty', 'np.empty', (['[self.M + 1, self.M + 1]'], {}), '([self.M + 1, self.M + 1])\n', (904, 930), True, 'import numpy as np\n'), ((944, 966), 'numpy.empty', 'np.empty', (['[self.M + 1]'], {}), '([self.M + 1])\n', (952, 966), True, 'import numpy as np\n'), ((1454, 1481), 'dataio.DataIO.read_data',...
import numpy as np from pycqed.measurement.randomized_benchmarking import \ randomized_benchmarking as rb import pycqed.measurement.openql_experiments.openql_helpers as oqh def CW_tone(qubit_idx: int, platf_cfg: str): """ Sequence to generate an "always on" pulse or "ContinuousWave" (CW) tone. This i...
[ "pycqed.measurement.randomized_benchmarking.randomized_benchmarking.randomized_benchmarking_sequence", "numpy.floor", "pycqed.measurement.openql_experiments.openql_helpers.add_single_qubit_cal_points", "numpy.arange", "numpy.round", "pycqed.measurement.openql_experiments.openql_helpers.create_program", ...
[((397, 437), 'pycqed.measurement.openql_experiments.openql_helpers.create_program', 'oqh.create_program', (['"""CW_tone"""', 'platf_cfg'], {}), "('CW_tone', platf_cfg)\n", (415, 437), True, 'import pycqed.measurement.openql_experiments.openql_helpers as oqh\n'), ((447, 475), 'pycqed.measurement.openql_experiments.open...
from __future__ import print_function, division import os import sys root = os.path.join(os.getcwd().split('src')[0], 'src') if root not in sys.path: sys.path.append(root) from utils import * from old.Prediction import rforest from data.handler import get_all_projects from matching.match_metrics import match_metr...
[ "sys.path.append", "matching.match_metrics.match_metrics", "old.stats.ABCD", "os.getcwd", "matching.match_metrics.list2dataframe", "data.handler.get_all_projects", "numpy.mean", "oracle.models.rf_model", "numpy.var" ]
[((155, 176), 'sys.path.append', 'sys.path.append', (['root'], {}), '(root)\n', (170, 176), False, 'import sys\n'), ((3869, 3887), 'data.handler.get_all_projects', 'get_all_projects', ([], {}), '()\n', (3885, 3887), False, 'from data.handler import get_all_projects\n'), ((5247, 5257), 'numpy.mean', 'np.mean', (['v'], {...
"""This file contains a number of silhouettes and sets of baseblocks.""" # set up imports from os.path import isfile, join from os import listdir from io import open import json import utils.blockworld as blockworld import numpy as np import os proj_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) st...
[ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "numpy.ndenumerate", "utils.blockworld.BaseBlock", "os.path.realpath", "numpy.zeros", "matplotlib.pyplot.subplots", "numpy.array", "numpy.tile", "io.open", "os.path.join" ]
[((332, 365), 'os.path.join', 'os.path.join', (['proj_dir', '"""stimuli"""'], {}), "(proj_dir, 'stimuli')\n", (344, 365), False, 'import os\n'), ((1683, 2956), 'numpy.array', 'np.array', (['[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,\n 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Last update 2021 Mar 14 @author: tacurrier and mhturner """ from visprotocol.protocol import clandinin_protocol import numpy as np from flystim.trajectory import Trajectory class BaseProtocol(clandinin_protocol.BaseProtocol): def __init__(self, cfg): s...
[ "numpy.sum", "numpy.hstack" ]
[((12743, 12763), 'numpy.hstack', 'np.hstack', (['all_stims'], {}), '(all_stims)\n', (12752, 12763), True, 'import numpy as np\n'), ((12596, 12605), 'numpy.sum', 'np.sum', (['n'], {}), '(n)\n', (12602, 12605), True, 'import numpy as np\n')]
#! /usr/bin/env python import os import numpy as np from landlab import RasterModelGrid from landlab.io import read_esri_ascii from landlab.io.netcdf import read_netcdf def test_save_esri_ascii(tmpdir): grid = RasterModelGrid((4, 5), xy_spacing=2.0) grid.add_field("node", "air__temperature", np.arange(20.0)...
[ "landlab.RasterModelGrid", "os.path.isfile", "numpy.arange", "landlab.io.netcdf.read_netcdf", "landlab.io.read_esri_ascii" ]
[((218, 257), 'landlab.RasterModelGrid', 'RasterModelGrid', (['(4, 5)'], {'xy_spacing': '(2.0)'}), '((4, 5), xy_spacing=2.0)\n', (233, 257), False, 'from landlab import RasterModelGrid\n'), ((487, 526), 'landlab.RasterModelGrid', 'RasterModelGrid', (['(4, 5)'], {'xy_spacing': '(2.0)'}), '((4, 5), xy_spacing=2.0)\n', (5...
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE """ This module defines an :doc:`uproot.interpretation.Interpretation` for several numerical types: * :doc:`uproot.interpretation.numerical.AsDtype`: numbers, which can simply be described as a ``numpy.dtype``. * :doc:`uproot.interp...
[ "uproot._util.awkward_form", "numpy.dtype", "uproot.extras.awkward", "uproot._util.isint", "numpy.add" ]
[((5586, 5609), 'numpy.dtype', 'numpy.dtype', (['from_dtype'], {}), '(from_dtype)\n', (5597, 5609), False, 'import numpy\n'), ((8229, 8252), 'uproot.extras.awkward', 'uproot.extras.awkward', ([], {}), '()\n', (8250, 8252), False, 'import uproot\n'), ((8311, 8400), 'uproot._util.awkward_form', 'uproot._util.awkward_form...
#!/usr/bin/env python # coding: UTF-8 # author: <NAME> time:2019/12/29 from skimage.measure import compare_ssim, compare_psnr import numpy as np import cv2 img1 = cv2.imread('D:/img_002_SRF.png') # 读取图像 img2 = cv2.imread('x2.5_SR.png') # 读取图像 img2 = np.resize(img2, (img1.shape[0], img1.shape[1], img1....
[ "cv2.imread", "skimage.measure.compare_ssim", "skimage.measure.compare_psnr", "numpy.resize" ]
[((175, 207), 'cv2.imread', 'cv2.imread', (['"""D:/img_002_SRF.png"""'], {}), "('D:/img_002_SRF.png')\n", (185, 207), False, 'import cv2\n'), ((224, 249), 'cv2.imread', 'cv2.imread', (['"""x2.5_SR.png"""'], {}), "('x2.5_SR.png')\n", (234, 249), False, 'import cv2\n'), ((268, 330), 'numpy.resize', 'np.resize', (['img2',...
''' Copyright 2017 <NAME> 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...
[ "tensorflow.train.BytesList", "json.load", "os.path.join", "tensorflow.train.Int64List", "numpy.zeros", "tensorflow.gfile.GFile", "tensorflow.train.FloatList", "tensorflow.app.run" ]
[((1675, 1702), 'numpy.zeros', 'np.zeros', (['(1, num_boxes, 4)'], {}), '((1, num_boxes, 4))\n', (1683, 1702), True, 'import numpy as np\n'), ((3594, 3638), 'os.path.join', 'os.path.join', (['image_dir', "example['filename']"], {}), "(image_dir, example['filename'])\n", (3606, 3638), False, 'import os\n'), ((5792, 5804...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2020-07-19 15:18:52 # @Author : helingjie-maskmind (<EMAIL>) # @Link : ${link} # @Version : $Id$ import os import numpy as np import sys from matplotlib.pyplot import plot from matplotlib.pyplot import show x=np.arange(5) print("exp",np.exp(x)) print("lin...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.arange", "numpy.exp", "numpy.loadtxt", "numpy.linspace", "numpy.convolve" ]
[((274, 286), 'numpy.arange', 'np.arange', (['(5)'], {}), '(5)\n', (283, 286), True, 'import numpy as np\n'), ((476, 540), 'numpy.loadtxt', 'np.loadtxt', (['"""data.csv"""'], {'delimiter': '""","""', 'usecols': '(6,)', 'unpack': '(True)'}), "('data.csv', delimiter=',', usecols=(6,), unpack=True)\n", (486, 540), True, '...
""" * This file is part of PYSLAM * * Copyright (C) 2016-present <NAME> <luigi dot freda at gmail dot com> * * PYSLAM 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 y...
[ "numpy.count_nonzero", "cv2.recoverPose", "math.fabs", "numpy.sum", "cv2.findEssentialMat", "numpy.zeros", "numpy.ones", "math.sin", "math.copysign", "numpy.linalg.svd", "numpy.linalg.norm", "numpy.array", "numpy.where", "math.cos", "numpy.eye", "cv2.triangulatePoints" ]
[((798, 817), 'math.copysign', 'math.copysign', (['(1)', 'x'], {}), '(1, x)\n', (811, 817), False, 'import math\n'), ((1438, 1453), 'math.fabs', 'math.fabs', (['diff'], {}), '(diff)\n', (1447, 1453), False, 'import math\n'), ((2102, 2117), 'math.fabs', 'math.fabs', (['diff'], {}), '(diff)\n', (2111, 2117), False, 'impo...
# coding=utf-8 # Copyright (C) 2020 NumS Development Team. # # 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...
[ "numpy.lib.stride_tricks.broadcast_to", "numpy.broadcast", "numpy.zeros", "numpy.__getattribute__", "numpy.min", "numpy.product", "numpy.array", "itertools.product", "nums.core.settings.np_ufunc_map.get" ]
[((1019, 1043), 'numpy.array', 'np.array', (['(1)'], {'dtype': 'dtype'}), '(1, dtype=dtype)\n', (1027, 1043), True, 'import numpy as np\n'), ((1201, 1227), 'numpy.array', 'np.array', (['(1)'], {'dtype': 'dtype_a'}), '(1, dtype=dtype_a)\n', (1209, 1227), True, 'import numpy as np\n'), ((1236, 1262), 'numpy.array', 'np.a...
"""Defines an circle.""" import numpy as np from .base_classes import Shape3D from .utils import translate_inertia_tensor class Sphere(Shape3D): """A sphere with the given radius. Args: radius (float): Radius of the sphere. center (Sequence[float]): The coordinates o...
[ "numpy.sum", "numpy.empty", "numpy.asarray", "numpy.isclose", "numpy.sinc", "numpy.linalg.norm", "numpy.cos", "numpy.dot", "numpy.diag", "numpy.sqrt", "numpy.atleast_2d" ]
[((988, 1006), 'numpy.asarray', 'np.asarray', (['center'], {}), '(center)\n', (998, 1006), True, 'import numpy as np\n'), ((1563, 1580), 'numpy.asarray', 'np.asarray', (['value'], {}), '(value)\n', (1573, 1580), True, 'import numpy as np\n'), ((2812, 2839), 'numpy.diag', 'np.diag', (['[i_xx, i_xx, i_xx]'], {}), '([i_xx...
import gym, gym.spaces, gym.utils, gym.utils.seeding import numpy as np class SimpleEnv(gym.Env): def __init__(self): self.action_space = gym.spaces.box.Box(low=0,high=1, shape=(2,), dtype=np.float32) self.observation_space = gym.spaces.box.Box(low=0,high=10, shape=(4,), dtype=np.float32) ...
[ "gym.spaces.box.Box", "numpy.array", "gym.utils.seeding.np_random" ]
[((157, 220), 'gym.spaces.box.Box', 'gym.spaces.box.Box', ([], {'low': '(0)', 'high': '(1)', 'shape': '(2,)', 'dtype': 'np.float32'}), '(low=0, high=1, shape=(2,), dtype=np.float32)\n', (175, 220), False, 'import gym, gym.spaces, gym.utils, gym.utils.seeding\n'), ((253, 317), 'gym.spaces.box.Box', 'gym.spaces.box.Box',...
def test_loss_regression(): import numpy as np from statsmodels.api import add_constant from sklearn.datasets import load_boston from sklearn.linear_model import LinearRegression from rosey.models import LossRegression x, y = load_boston(return_X_y=True) x = add_constant(x) print((x @ ...
[ "numpy.ones", "sklearn.linear_model.LinearRegression", "sklearn.datasets.load_boston", "statsmodels.api.add_constant", "rosey.models.LossRegression" ]
[((251, 279), 'sklearn.datasets.load_boston', 'load_boston', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (262, 279), False, 'from sklearn.datasets import load_boston\n'), ((288, 303), 'statsmodels.api.add_constant', 'add_constant', (['x'], {}), '(x)\n', (300, 303), False, 'from statsmodels.api import add_con...
import gym import math import random import numpy as np import matplotlib import matplotlib.pyplot as plt from collections import namedtuple from itertools import count from PIL import Image import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torchvision.transforms as T...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.clf", "random.sample", "torch.cat", "matplotlib.pyplot.figure", "torch.no_grad", "matplotlib.pyplot.imshow", "torchvision.transforms.ToPILImage", "torch.nn.Linear", "torch.zeros", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "torch.zeros_...
[((1370, 1439), 'collections.namedtuple', 'namedtuple', (['"""Experience"""', "('state', 'action', 'next_state', 'reward')"], {}), "('Experience', ('state', 'action', 'next_state', 'reward'))\n", (1380, 1439), False, 'from collections import namedtuple\n'), ((7297, 7309), 'matplotlib.pyplot.figure', 'plt.figure', ([], ...
import unittest import numpy as np from PCAfold import preprocess from PCAfold import reduction from PCAfold import analysis from sys import modules try: from sklearn.metrics import mean_absolute_error except ImportError: pass class Analysis(unittest.TestCase): def test_analysis__mean_absolute_error__all...
[ "PCAfold.reduction.PCA", "sklearn.metrics.mean_absolute_error", "numpy.finfo", "numpy.random.rand", "PCAfold.analysis.mean_absolute_error" ]
[((351, 373), 'numpy.random.rand', 'np.random.rand', (['(100)', '(5)'], {}), '(100, 5)\n', (365, 373), True, 'import numpy as np\n'), ((389, 437), 'PCAfold.reduction.PCA', 'reduction.PCA', (['X'], {'scaling': '"""auto"""', 'n_components': '(2)'}), "(X, scaling='auto', n_components=2)\n", (402, 437), False, 'from PCAfol...
''' Created on July 02, 2018 @author: <NAME> ''' from spn.algorithms import add_node_mpe from spn.structure.leaves.conditional.Conditional import Conditional_Gaussian, Conditional_Poisson, \ Conditional_Bernoulli import numpy as np from spn.structure.leaves.conditional.utils import get_scipy_obj_params def get_...
[ "numpy.sum", "numpy.floor", "numpy.isnan", "spn.structure.leaves.conditional.utils.get_scipy_obj_params", "spn.algorithms.add_node_mpe" ]
[((508, 546), 'numpy.isnan', 'np.isnan', (['data[input_vals, node.scope]'], {}), '(data[input_vals, node.scope])\n', (516, 546), True, 'import numpy as np\n'), ((560, 577), 'numpy.sum', 'np.sum', (['data_nans'], {}), '(data_nans)\n', (566, 577), True, 'import numpy as np\n'), ((641, 698), 'spn.structure.leaves.conditio...
from __future__ import division import unittest from resippy.image_objects.earth_overhead.earth_overhead_point_calculators.fixtured_camera import FixturedCamera from resippy.image_objects.earth_overhead.earth_overhead_point_calculators.pinhole_camera import PinholeCamera from resippy.image_objects.earth_overhead.earth...
[ "unittest.main", "resippy.image_objects.earth_overhead.earth_overhead_point_calculators.pinhole_camera.PinholeCamera", "resippy.image_objects.earth_overhead.earth_overhead_point_calculators.ideal_pinhole_fpa_local_utm_point_calc.IdealPinholeFpaLocalUtmPointCalc.init_from_wgs84_params", "resippy.utils.photogra...
[((17487, 17502), 'unittest.main', 'unittest.main', ([], {}), '()\n', (17500, 17502), False, 'import unittest\n'), ((664, 680), 'resippy.image_objects.earth_overhead.earth_overhead_point_calculators.fixtured_camera.FixturedCamera', 'FixturedCamera', ([], {}), '()\n', (678, 680), False, 'from resippy.image_objects.earth...
import sys import os import numpy as np import json import copy sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) def sample_config_distributions(config, num_single_runs): # Set a new sampled value from the config distribution as the mean value of the config for a certain number of runs...
[ "numpy.random.uniform", "bin.analyseIC.save_and_plot_IC", "os.path.abspath", "copy.deepcopy", "json.loads", "bin.corona_esmda.single_run_mean", "src.io_func.load_data", "bin.corona_esmda.run_esmda_model", "numpy.where", "src.api_nl_data.get_and_save_nl_data", "numpy.random.normal", "numpy.conc...
[((11892, 11916), 'json.loads', 'json.loads', (['config_input'], {}), '(config_input)\n', (11902, 11916), False, 'import json\n'), ((11928, 11945), 'src.io_func.load_data', 'load_data', (['config'], {}), '(config)\n', (11937, 11945), False, 'from src.io_func import load_data\n'), ((382, 459), 'numpy.random.normal', 'np...
#!/usr/bin/env python import os import numpy as np import time import copy import sys import argparse ang_2_bohr = 1.0/0.52917721067 hart_2_ev = 27.21138602 import cp2k_spm_tools.cp2k_grid_orbitals as cgo from cp2k_spm_tools import common, cube from mpi4py import MPI comm = MPI.COMM_WORLD mpi_rank = comm.Get_rank(...
[ "numpy.abs", "argparse.ArgumentParser", "numpy.savetxt", "numpy.einsum", "cp2k_spm_tools.cp2k_grid_orbitals.Cp2kGridOrbitals", "cp2k_spm_tools.common.parse_eval_region_input", "time.time", "cp2k_spm_tools.cube.Cube", "sys.stdout.flush", "numpy.reshape", "os.listdir", "numpy.prod" ]
[((359, 450), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Runs bond order analysis based on Bader basins."""'}), "(description=\n 'Runs bond order analysis based on Bader basins.')\n", (382, 450), False, 'import argparse\n'), ((2026, 2037), 'time.time', 'time.time', ([], {}), '()\n...
""" Here, the firing rates for in and outside the focus of attention are obtained for the different attentional mechanisms and the neutral model. """ import os import joblib import numpy as np from asn.utils import load_pickle from asn.evaluation.generators import coco_squared from keras.models import model_from_json...
[ "numpy.random.seed", "numpy.sum", "asn.evaluation.wrappers.predict_generator", "numpy.floor", "joblib.dump", "numpy.ones", "keras.models.Model", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "os.path.abspath", "scipy.spatial.distance.euclidean", "numpy.identity", "numpy.max", ...
[((921, 940), 'os.path.abspath', 'os.path.abspath', (['""""""'], {}), "('')\n", (936, 940), False, 'import os\n'), ((1097, 1114), 'numpy.random.seed', 'np.random.seed', (['(3)'], {}), '(3)\n', (1111, 1114), True, 'import numpy as np\n'), ((1293, 1378), 'asn.utils.load_pickle', 'load_pickle', (["(dir_path + '/Datasets/'...
from PIL import Image import numpy as np class ConvertImage: def __init__(self, image, size, gradation): self.image = image self.size = size self.step = 255 // gradation def convert_image(self): height = len(self.image) width = len(self.image[1]) for...
[ "PIL.Image.fromarray", "numpy.array" ]
[((967, 991), 'numpy.array', 'np.array', (['original_image'], {}), '(original_image)\n', (975, 991), True, 'import numpy as np\n'), ((552, 579), 'PIL.Image.fromarray', 'Image.fromarray', (['self.image'], {}), '(self.image)\n', (567, 579), False, 'from PIL import Image\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- """Description """ import copy import numpy as np from itertools import product import torch import torch.nn.functional as F from ptranking.eval.parameter import ModelParameter from ptranking.ltr_adversarial.base.ad_player import AdversarialPlayer from ptranking.ltr_a...
[ "torch.ones", "copy.deepcopy", "torch.multinomial", "torch.where", "torch.squeeze", "torch.sigmoid", "torch.max", "itertools.product", "numpy.squeeze", "torch.log" ]
[((2668, 2697), 'copy.deepcopy', 'copy.deepcopy', (['g_sf_para_dict'], {}), '(g_sf_para_dict)\n', (2681, 2697), False, 'import copy\n'), ((12265, 12388), 'itertools.product', 'product', (['choice_d_g_epoches', 'choice_samples_per_query', 'choice_ad_training_order', 'choice_temperatures', 'choice_losstype_d'], {}), '(ch...
""" Mesothelioma prediction The data is from: https://archive.ics.uci.edu/ml/datasets/Mesothelioma%C3%A2%E2%82%AC%E2%84%A2s+disease+data+set+ """ import numpy as np import networkx as nx import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.preprocessin...
[ "matplotlib.pyplot.title", "numpy.random.seed", "sklearn.preprocessing.StandardScaler", "sklearn.model_selection.train_test_split", "strat_models.logistic_loss", "utils.latexify", "numpy.arange", "networkx.empty_graph", "strat_models.utils.cartesian_product", "strat_models.BaseModel", "sys.path....
[((356, 377), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (371, 377), False, 'import sys\n'), ((518, 535), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (532, 535), True, 'import numpy as np\n'), ((560, 610), 'pandas.read_excel', 'pd.read_excel', (['"""./data/Mesothelioma data...
# -*- coding: utf-8 -*- """ @author: <NAME> Affiliation: TU Delft and Deltares, Delft, The Netherlands Preparing daily/monthly/yearly averages """ #============================================================================== #Import import scipy.io import os import pandas as pd import numpy as np #imp...
[ "numpy.save", "pandas.read_csv", "numpy.zeros", "pandas.concat", "os.path.join", "os.listdir" ]
[((504, 528), 'os.listdir', 'os.listdir', (['csv_mainpath'], {}), '(csv_mainpath)\n', (514, 528), False, 'import os\n'), ((1541, 1568), 'numpy.zeros', 'np.zeros', (['(91, 7, 10, 5, 2)'], {}), '((91, 7, 10, 5, 2))\n', (1549, 1568), True, 'import numpy as np\n'), ((1649, 1678), 'numpy.zeros', 'np.zeros', (['(1092, 7, 10,...
# coding: utf-8 # ## Preparation, Imports and Function Declarations # In[ ]: get_ipython().run_line_magic('config', 'IPCompleter.greedy = True') # In[ ]: # Install GGPLOT get_ipython().system('python -m pip install ggplot') # In[ ]: from pprint import pprint import geopy.distance import datetime import pan...
[ "pandas.DataFrame", "sklearn.ensemble.RandomForestClassifier", "csv.writer", "sklearn.manifold.TSNE", "numpy.ravel", "pandas.read_csv", "pandas.get_dummies", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.LabelEncoder", "sklearn.preprocessing.minmax_scale", "sklearn.ensemble....
[((1218, 1250), 'pandas.read_csv', 'pd.read_csv', (['"""dataset/train.csv"""'], {}), "('dataset/train.csv')\n", (1229, 1250), True, 'import pandas as pd\n'), ((4866, 4880), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (4878, 4880), False, 'from sklearn.preprocessing import LabelEncoder\n'), (...
""" Example membership inference attack against a deep net classifier on the CIFAR10 dataset """ import numpy as np from absl import app from absl import flags import tensorflow as tf from tensorflow.keras import layers from sklearn.model_selection import train_test_split from mia.estimators import ShadowModelBundl...
[ "tensorflow.keras.backend.backend", "mia.estimators.AttackModelBundle", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.backend.softmax", "sklearn.model_selection.train_test_split", "tensorflow.keras.backend.zeros_like", "tensorflow.keras.backend.relu", "numpy.m...
[((771, 871), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""target_epochs"""', '(50)', '"""Number of epochs to train target and shadow models."""'], {}), "('target_epochs', 50,\n 'Number of epochs to train target and shadow models.')\n", (791, 871), False, 'from absl import flags\n'), ((874, 963), 'absl...
# -*- coding: utf-8 -*- """ Created on Fri May 21 11:11:59 2021 @author: sarangbhagwat """ from biorefineries.TAL.system_split import * import numpy as np import pandas as pd # from matplotlib import pyplot as plt from datetime import datetime spec.load_spec_1 = spec.load_yield spec.load_spec_2 = spec.load_titer spe...
[ "pandas.DataFrame", "pandas.ExcelWriter", "datetime.datetime.now", "numpy.linspace" ]
[((405, 433), 'numpy.linspace', 'np.linspace', (['(0.0)', '(0.5)', 'steps'], {}), '(0.0, 0.5, steps)\n', (416, 433), True, 'import numpy as np\n'), ((709, 812), 'pandas.DataFrame', 'pd.DataFrame', (["{'waste all retained TAL': additional_costs}"], {'index': 'cellmass_TAL_retention_gpg_array'}), "({'waste all retained T...
# fmt: off from operator import attrgetter from typing import ( TYPE_CHECKING, Iterable, Iterator, List, Optional, Union, cast ) import numpy as np import pandas as pd from shapely.geometry import LineString, MultiLineString, Polygon from ..core.geodesy import destination from ..core.iterator import flight_itera...
[ "numpy.radians", "pandas.Timestamp", "typing.cast", "operator.attrgetter", "numpy.tan", "pandas.Timedelta" ]
[((1773, 1793), 'typing.cast', 'cast', (['"""Flight"""', 'self'], {}), "('Flight', self)\n", (1777, 1793), False, 'from typing import TYPE_CHECKING, Iterable, Iterator, List, Optional, Union, cast\n'), ((2883, 2903), 'typing.cast', 'cast', (['"""Flight"""', 'self'], {}), "('Flight', self)\n", (2887, 2903), False, 'from...
import numpy as np from init_args_serializer.serializable import Serializable from pyrado.environment_wrappers.base import EnvWrapperObs from pyrado.environments.sim_base import SimEnv class GaussianObsNoiseWrapper(EnvWrapperObs, Serializable): """ Environment wrapper which adds normally distributed i.i.d. noise...
[ "numpy.zeros", "numpy.array", "numpy.random.randn" ]
[((883, 903), 'numpy.array', 'np.array', (['noise_mean'], {}), '(noise_mean)\n', (891, 903), True, 'import numpy as np\n'), ((1003, 1033), 'numpy.zeros', 'np.zeros', (['self.obs_space.shape'], {}), '(self.obs_space.shape)\n', (1011, 1033), True, 'import numpy as np\n'), ((1092, 1111), 'numpy.array', 'np.array', (['nois...
#!/usr/bin/env python3 # <Copyright 2019, Argo AI, LLC. Released under the MIT license.> """ Utility to load the Argoverse vector map from disk, where it is stored in an XML format. We release our Argoverse vector map in a modified OpenStreetMap (OSM) form. We also provide the map data loader. OpenStreetMap (OSM) pro...
[ "numpy.zeros", "os.fspath", "argoverse.map_representation.lane_segment.LaneSegment", "numpy.array", "logging.getLogger" ]
[((2280, 2307), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2297, 2307), False, 'import logging\n'), ((3985, 4173), 'argoverse.map_representation.lane_segment.LaneSegment', 'LaneSegment', (['lane_id', 'has_traffic_control', "lane_dictionary['turn_direction']", 'is_intersection', 'l_ne...
import numpy as np # Double negation of vector elements def vnegneg(V): R = np.negative(np.negative(V))
[ "numpy.negative" ]
[((94, 108), 'numpy.negative', 'np.negative', (['V'], {}), '(V)\n', (105, 108), True, 'import numpy as np\n')]
import numpy as np import matplotlib.pyplot as plt x = np.array([1, 2, 3, 4, 5]) y = np.array([1, 3, 2, 3, 5]) plt.scatter(x, y) plt.axis([0, 6, 0, 6]) plt.show() x_mean = np.mean(x) y_mean = np.mean(y) num = 0.0 d = 0.0 for i, j in zip(x, y): num += (i - x_mean) * (j - y_mean) d += (i - x_mean) ** 2 a = ...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.scatter", "matplotlib.pyplot.axis", "numpy.mean", "numpy.array" ]
[((56, 81), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (64, 81), True, 'import numpy as np\n'), ((86, 111), 'numpy.array', 'np.array', (['[1, 3, 2, 3, 5]'], {}), '([1, 3, 2, 3, 5])\n', (94, 111), True, 'import numpy as np\n'), ((113, 130), 'matplotlib.pyplot.scatter', 'plt.scatter', ([...
import numpy as np from scipy.stats import ttest_ind as ttest from scipy.stats import t as tpdf import scipy from math import * import seaborn as sns import pandas as pd import matplotlib.pyplot as plt def generate_data(true_value:float, inter_cluster_SD:float, \ intra_cluster_SD:float, N_clusters:...
[ "pandas.DataFrame", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "numpy.random.randn", "numpy.zeros", "scipy.stats.ttest_ind", "numpy.mean", "numpy.array", "matplotlib.pyplot.xlabel", "scipy.stats.t.cdf", "numpy.concatenate", "numpy.sqrt" ]
[((1578, 1600), 'numpy.sqrt', 'np.sqrt', (['(item2 / item3)'], {}), '(item2 / item3)\n', (1585, 1600), True, 'import numpy as np\n'), ((8057, 8110), 'numpy.zeros', 'np.zeros', (['(MAX_N_clusters - 1, MAX_N_per_cluster - 1)'], {}), '((MAX_N_clusters - 1, MAX_N_per_cluster - 1))\n', (8065, 8110), True, 'import numpy as n...
import json import time import boto3 import numpy as np import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import time # change this to use other models from model import KimCNN # You will need to setup your own dynamoDB and table client = boto3.client('dynamodb'...
[ "json.loads", "boto3.client", "torch.autograd.Variable", "torch.load", "json.dumps", "time.time", "numpy.append", "torch.max", "numpy.random.rand" ]
[((297, 321), 'boto3.client', 'boto3.client', (['"""dynamodb"""'], {}), "('dynamodb')\n", (309, 321), False, 'import boto3\n'), ((2099, 2110), 'time.time', 'time.time', ([], {}), '()\n', (2108, 2110), False, 'import time\n'), ((2123, 2148), 'json.loads', 'json.loads', (["event['body']"], {}), "(event['body'])\n", (2133...
# Copyright 2017 <NAME>. All Rights Reserved. # # DeepNovo is publicly available for non-commercial uses. # ============================================================================== """TODO(nh2tran): docstring.""" from __future__ import absolute_import from __future__ import division from __future__ import print...
[ "numpy.less_equal", "pyteomics.parser.cleave", "Bio.SeqIO.parse", "random.shuffle", "numpy.nditer", "tensorflow.Session", "numpy.zeros", "numpy.array", "numpy.greater_equal", "deepnovo_debug.get_candidate_intensity", "numpy.repeat" ]
[((4137, 4160), 'numpy.zeros', 'np.zeros', (['peptide_count'], {}), '(peptide_count)\n', (4145, 4160), True, 'import numpy as np\n'), ((4188, 4211), 'numpy.zeros', 'np.zeros', (['peptide_count'], {}), '(peptide_count)\n', (4196, 4211), True, 'import numpy as np\n'), ((5377, 5389), 'tensorflow.Session', 'tf.Session', ([...
import csv import torch import wandb import numpy as np import torch.nn import torchvision from tqdm import tqdm from torchvision import datasets, transforms import resnet import model as M import custom_optimizers as OP def getNumCorrect(correct, outputs, labels): # For computing Accuracy _,...
[ "wandb.log", "numpy.random.seed", "custom_optimizers.SC_RMSprop", "torchvision.transforms.Normalize", "torch.utils.data.DataLoader", "model.Layer4NN", "torchvision.transforms.RandomHorizontalFlip", "resnet.ResNet18", "torch.manual_seed", "custom_optimizers.SC_Adagrad", "custom_optimizers.SAdam",...
[((333, 359), 'torch.max', 'torch.max', (['outputs.data', '(1)'], {}), '(outputs.data, 1)\n', (342, 359), False, 'import torch\n'), ((2598, 2618), 'torch.manual_seed', 'torch.manual_seed', (['(1)'], {}), '(1)\n', (2615, 2618), False, 'import torch\n'), ((2624, 2649), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', ...
import h5py import numpy as np import torch from sklearn.preprocessing import OneHotEncoder from sciml_bench.benchmarks.dms_structure.model import DMSNet from sciml_bench.benchmarks.dms_structure.model import learn def train_model(dataset, args, smlb_in, smlb_out): ''' Trains a CNN to classify the DMS data ...
[ "sciml_bench.benchmarks.dms_structure.model.DMSNet", "h5py.File", "numpy.atleast_3d", "sklearn.preprocessing.OneHotEncoder", "sciml_bench.benchmarks.dms_structure.model.learn", "torch.cuda.is_available", "numpy.swapaxes", "numpy.array", "torch.from_numpy" ]
[((969, 994), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (992, 994), False, 'import torch\n'), ((1065, 1088), 'h5py.File', 'h5py.File', (['dataset', '"""r"""'], {}), "(dataset, 'r')\n", (1074, 1088), False, 'import h5py\n'), ((1132, 1154), 'numpy.swapaxes', 'np.swapaxes', (['img', '(1)', '(...
import time import numpy as np import crocoddyl from crocoddyl.utils import LQRDerived NX = 37 NU = 12 N = 100 # number of nodes T = int(5e3) # number of trials MAXITER = 1 def runBenchmark(model): x0 = np.matrix(np.zeros(NX)).T runningModels = [model(NX, NU)] * N terminalModel = model(NX, NU) xs...
[ "crocoddyl.SolverDDP", "numpy.zeros", "crocoddyl.ShootingProblem", "time.time" ]
[((394, 453), 'crocoddyl.ShootingProblem', 'crocoddyl.ShootingProblem', (['x0', 'runningModels', 'terminalModel'], {}), '(x0, runningModels, terminalModel)\n', (419, 453), False, 'import crocoddyl\n'), ((464, 492), 'crocoddyl.SolverDDP', 'crocoddyl.SolverDDP', (['problem'], {}), '(problem)\n', (483, 492), False, 'impor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # s_fa...
[ "arpym.estimation.factor_analysis_mlf", "numpy.diagflat", "arpym.estimation.factor_analysis_paf", "numpy.zeros", "numpy.array", "numpy.linalg.norm", "arpym.views.rel_entropy_normal" ]
[((916, 985), 'numpy.array', 'np.array', (['[[1.2, 0.46, 0.77], [0.46, 2.31, 0.08], [0.77, 0.08, 0.98]]'], {}), '([[1.2, 0.46, 0.77], [0.46, 2.31, 0.08], [0.77, 0.08, 0.98]])\n', (924, 985), True, 'import numpy as np\n'), ((1223, 1257), 'arpym.estimation.factor_analysis_paf', 'factor_analysis_paf', (['sigma2'], {'k_': ...
from abc import ABC, abstractmethod from dataclasses import dataclass, field from typing import ( Any, Dict, Generator, List, Mapping, Optional, Sequence, Tuple, Type, Union, ) import numpy as np import numpy.typing as npt EntityID = Any EntityType = str ActionType = str @dat...
[ "dataclasses.field", "numpy.array" ]
[((3855, 3882), 'dataclasses.field', 'field', ([], {'default_factory': 'dict'}), '(default_factory=dict)\n', (3860, 3882), False, 'from dataclasses import dataclass, field\n'), ((5170, 5240), 'numpy.array', 'np.array', (['[id_to_index[id] for id in action.actor_ids]'], {'dtype': 'np.int64'}), '([id_to_index[id] for id ...
from collections import OrderedDict import numpy as np from bokeh.layouts import column from bokeh.models import CustomJS, ColumnDataSource from bokeh.models import HoverTool from bokeh.models.widgets import RadioButtonGroup from bokeh.plotting import figure def display_confusion_matrix(conf_mats, labels, text_angle...
[ "bokeh.models.ColumnDataSource", "bokeh.plotting.figure", "numpy.deg2rad", "bokeh.layouts.column", "collections.OrderedDict" ]
[((1902, 1936), 'bokeh.models.ColumnDataSource', 'ColumnDataSource', ([], {'data': 'source_data'}), '(data=source_data)\n', (1918, 1936), False, 'from bokeh.models import CustomJS, ColumnDataSource\n'), ((1945, 2065), 'bokeh.plotting.figure', 'figure', ([], {'title': '"""Confusion Matrix"""', 'x_axis_location': '"""abo...
""" Plot planes from joint analysis files. Usage: plot_slices.py <files>... [--output=<dir>] Options: --output=<dir> Output directory [default: ./frames] """ import h5py from os import path import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.axes_gri...
[ "h5py.File", "numpy.abs", "numpy.vectorize", "matplotlib.pyplot.ioff", "docopt.docopt", "numpy.average", "numpy.angle", "dedalus.tools.parallel.Sync", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.close", "dedalus.tools.post.visit_writes", "matplotlib.pyplot.figure", "matplotlib.use", "...
[((247, 261), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (254, 261), True, 'import matplotlib as mpl\n'), ((382, 392), 'matplotlib.pyplot.ioff', 'plt.ioff', ([], {}), '()\n', (390, 392), True, 'import matplotlib.pyplot as plt\n'), ((459, 468), 'numpy.abs', 'np.abs', (['z'], {}), '(z)\n', (465, 468),...
""" Smoke tests. """ from nose.tools import * from nose import SkipTest import dit import buhmm import numpy as np class TestSmoke: def setUp(cls): global machines try: from cmpy import machines except ImportError: raise SkipTest('cmpy not available') def tes...
[ "numpy.testing.assert_almost_equal", "buhmm.Infer", "nose.SkipTest", "cmpy.machines.Even" ]
[((349, 364), 'cmpy.machines.Even', 'machines.Even', ([], {}), '()\n', (362, 364), False, 'from cmpy import machines\n'), ((398, 415), 'buhmm.Infer', 'buhmm.Infer', (['m', 'd'], {}), '(m, d)\n', (409, 415), False, 'import buhmm\n'), ((547, 591), 'numpy.testing.assert_almost_equal', 'np.testing.assert_almost_equal', (['...
import numpy as np from config import UNAME, TOKEN from pyghthouse import Pyghthouse def image_gen(): image = np.zeros((14, 28, 3)) yield image while True: for x in range(14): for y in range(28): for j in range(3): image[x, y, j] = 255 ...
[ "pyghthouse.Pyghthouse", "numpy.zeros" ]
[((117, 138), 'numpy.zeros', 'np.zeros', (['(14, 28, 3)'], {}), '((14, 28, 3))\n', (125, 138), True, 'import numpy as np\n'), ((559, 625), 'pyghthouse.Pyghthouse', 'Pyghthouse', (['UNAME', 'TOKEN'], {'image_callback': 'g.__next__', 'frame_rate': '(60)'}), '(UNAME, TOKEN, image_callback=g.__next__, frame_rate=60)\n', (5...
import os import numpy as np import argparse import time import librosa import glob from preprocess import * from model import * from sklearn.utils import shuffle from sklearn.preprocessing import LabelEncoder, OneHotEncoder from utility import * def get_files_labels(pattern: str): files = glob.glob(pattern) ...
[ "numpy.random.choice", "pickle.dump", "numpy.load", "argparse.ArgumentParser", "os.makedirs", "numpy.concatenate", "librosa.output.write_wav", "numpy.ascontiguousarray", "os.path.exists", "sklearn.preprocessing.LabelEncoder", "time.time", "librosa.load", "numpy.reshape", "glob.glob", "sk...
[((297, 315), 'glob.glob', 'glob.glob', (['pattern'], {}), '(pattern)\n', (306, 315), False, 'import glob\n'), ((719, 733), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (731, 733), False, 'from sklearn.preprocessing import LabelEncoder, OneHotEncoder\n'), ((11707, 11753), 'os.makedirs', 'os.m...
""" Explore 4D interpolation on the computational grid (or mildly aggregated form thereof) """ import numpy as np import pandas as pd import logging log=logging.getLogger(__name__) from .. import utils from ..grid import unstructured_grid from ..model import unstructured_diffuser ## def interp_to_time_per_ll(df,t...
[ "numpy.abs", "numpy.isfinite", "logging.getLogger", "pandas.Series", "numpy.interp", "numpy.all" ]
[((155, 182), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (172, 182), False, 'import logging\n'), ((3412, 3425), 'numpy.all', 'np.all', (['(W > 0)'], {}), '(W > 0)\n', (3418, 3425), True, 'import numpy as np\n'), ((538, 571), 'numpy.isfinite', 'np.isfinite', (['df[value_col].values'], ...
""" A compendium of useful get-parameters-functions base on observations and investigation not intended for the main distribution. These functions are found here because they cannot be included in the main distribution of the module but are valuable to for investigations and development of new algorithms """ from __fu...
[ "numpy.clip" ]
[((1384, 1414), 'numpy.clip', 'np.clip', (['(imsize * 9e-05)', '(3)', '(50)'], {}), '(imsize * 9e-05, 3, 50)\n', (1391, 1414), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- # This file is part of gameoflife. # Copyright 2015, wlof. # # 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 r...
[ "numpy.random.uniform", "numpy.logical_not", "numpy.zeros", "numpy.array", "scipy.ndimage.filters.convolve", "numpy.int8" ]
[((1153, 1197), 'numpy.array', 'np.array', (['[[1, 1, 1], [1, 10, 1], [1, 1, 1]]'], {}), '([[1, 1, 1], [1, 10, 1], [1, 1, 1]])\n', (1161, 1197), True, 'import numpy as np\n'), ((1461, 1511), 'numpy.zeros', 'np.zeros', (['(self.width, self.height)'], {'dtype': 'np.int8'}), '((self.width, self.height), dtype=np.int8)\n',...
import pytest import numpy as np from privileged_residues import geometry from numpy.testing import assert_allclose c = geometry.create_ray(np.zeros(3), -np.ones(3)) d = geometry.create_ray(np.array([1.0, 0.0, 0.0]), np.array([0.0, 1.0, 0.0])) @pytest.mark.parametrize("a,b", [ (c, d), pytest.param( ...
[ "numpy.zeros", "numpy.ones", "pytest.mark.filterwarnings", "numpy.linalg.det", "numpy.array", "numpy.testing.assert_allclose", "privileged_residues.geometry.rays_to_transform", "pytest.mark.xfail" ]
[((144, 155), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (152, 155), True, 'import numpy as np\n'), ((194, 219), 'numpy.array', 'np.array', (['[1.0, 0.0, 0.0]'], {}), '([1.0, 0.0, 0.0])\n', (202, 219), True, 'import numpy as np\n'), ((221, 246), 'numpy.array', 'np.array', (['[0.0, 1.0, 0.0]'], {}), '([0.0, 1.0,...