code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
"""Multiple comparison corrections.""" import numpy as np from numpy import concatenate as cat from scipy.interpolate import interp1d from scipy.special import betaln, gammaln, gamma from scipy.linalg import toeplitz from scipy.sparse import csr_matrix import math import copy from brainstat.stats.utils import interp1, ...
[ "math.isinf", "numpy.sum", "brainstat.mesh.utils.mesh_edges", "brainstat.stats.utils.row_ismember", "numpy.fmax", "numpy.abs", "numpy.ones", "numpy.isnan", "numpy.shape", "scipy.special.betaln", "numpy.histogram", "numpy.sin", "numpy.arange", "numpy.exp", "brainstat.stats.utils.colon", ...
[((685, 701), 'numpy.shape', 'np.shape', (['self.t'], {}), '(self.t)\n', (693, 701), True, 'import numpy as np\n'), ((786, 802), 'numpy.zeros', 'np.zeros', (['(2, 2)'], {}), '((2, 2))\n', (794, 802), True, 'import numpy as np\n'), ((1428, 1445), 'numpy.cumsum', 'np.cumsum', (['r_sort'], {}), '(r_sort)\n', (1437, 1445),...
''' Module for offline spike sorting. This work is based on: * <NAME>, <NAME> - first version ''' import copy from . import pyqtgraph as pg from .pyqtgraph.Qt import QtCore, QtGui, QtWidgets from .pyqtgraph import Qt from .pyqtgraph import dockarea import numpy as np from math import floor,ceil import time import s...
[ "os.remove", "sklearn.preprocessing.StandardScaler", "numpy.ones", "numpy.isnan", "numpy.argsort", "os.path.isfile", "numpy.mean", "numpy.arange", "os.path.join", "numpy.unique", "shutil.copy", "platform.architecture", "numpy.std", "numpy.savetxt", "numpy.apply_along_axis", "numpy.int"...
[((14959, 15054), 'numpy.apply_along_axis', 'np.apply_along_axis', (['self.__in_select_line', '(1)', 'self.waveforms_pk0', 'pk0_roi0_h0', 'pk0_roi0_h1'], {}), '(self.__in_select_line, 1, self.waveforms_pk0,\n pk0_roi0_h0, pk0_roi0_h1)\n', (14978, 15054), True, 'import numpy as np\n'), ((15126, 15165), 'numpy.array',...
# Copyright (c) 2017-present, Facebook, Inc. # # 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...
[ "numpy.ceil", "numpy.zeros", "numpy.hstack", "numpy.min", "numpy.max", "numpy.array", "numpy.round", "cv2.resize" ]
[((1733, 1804), 'numpy.zeros', 'np.zeros', (['(num_images, max_shape[0], max_shape[1], 3)'], {'dtype': 'np.float32'}), '((num_images, max_shape[0], max_shape[1], 3), dtype=np.float32)\n', (1741, 1804), True, 'import numpy as np\n'), ((2713, 2734), 'numpy.min', 'np.min', (['im_shape[0:2]'], {}), '(im_shape[0:2])\n', (27...
import argparse import os import numpy as np from sklearn import mixture from sklearn.cluster import DBSCAN from enphaseAI.utils.constants import DATA_DIR from enphaseAI.utils.gaussian_generator import generate_multivariate_gaussian from enphaseAI.utils.matplotlib_plotter import basic_plot def main(args...
[ "argparse.ArgumentParser", "numpy.zeros", "sklearn.mixture.GaussianMixture", "enphaseAI.utils.matplotlib_plotter.basic_plot", "enphaseAI.utils.gaussian_generator.generate_multivariate_gaussian", "os.path.join", "sklearn.cluster.DBSCAN" ]
[((913, 936), 'numpy.zeros', 'np.zeros', (['data.shape[0]'], {}), '(data.shape[0])\n', (921, 936), True, 'import numpy as np\n'), ((942, 992), 'enphaseAI.utils.matplotlib_plotter.basic_plot', 'basic_plot', (['"""generated_clusters.png"""', 'data', 'labels'], {}), "('generated_clusters.png', data, labels)\n", (952, 992)...
""" * Assignment: Numpy Round Clip * Complexity: medium * Lines of code: 2 lines * Time: 5 min English: 1. Create `result: np.ndarray` copy of `DATA` 2. Clip numbers only in first column to 50 (inclusive) to 80 (exclusive) 3. Print `result` 4. Run doctests - all must succeed Polish: 1. Stwórz `res...
[ "numpy.array" ]
[((1015, 1127), 'numpy.array', 'np.array', (['[[44, 47, 64], [67, 67, 9], [83, 21, 36], [87, 70, 88], [88, 12, 58], [65, \n 39, 87], [46, 88, 81]]'], {}), '([[44, 47, 64], [67, 67, 9], [83, 21, 36], [87, 70, 88], [88, 12, \n 58], [65, 39, 87], [46, 88, 81]])\n', (1023, 1127), True, 'import numpy as np\n')]
from graphics import graphic import numpy as np from sim import * from net import * from graphics import graphic import warnings warnings.filterwarnings("ignore") EPOCHS_SIM = 5 POPULATION_SIM = 5_000 ENV_STEPS = 50 REPS = 20 # repetitions of the same atk position with some randomness for gk position RANDOMNESS = 15...
[ "warnings.filterwarnings", "numpy.std", "numpy.max", "numpy.mean", "numpy.array", "graphics.graphic", "numpy.random.choice" ]
[((130, 163), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (153, 163), False, 'import warnings\n'), ((1755, 1773), 'numpy.array', 'np.array', (['[[x, y]]'], {}), '([[x, y]])\n', (1763, 1773), True, 'import numpy as np\n'), ((3326, 3343), 'graphics.graphic', 'graphic', ([...
import itertools import numpy as np import pandas as pd def related_trends(search_terms, main_terms, trends, r_list): df_related_trends_avg = [] for r in r_list: # Get related trend _, related_trend_avg, trend_name = get_related_trend(search_terms, main_terms, trends, r) # save ...
[ "pandas.DataFrame", "numpy.average", "pandas.to_datetime", "pandas.concat" ]
[((585, 617), 'pandas.concat', 'pd.concat', (['df_related_trends_avg'], {}), '(df_related_trends_avg)\n', (594, 617), True, 'import pandas as pd\n'), ((1463, 1490), 'pandas.concat', 'pd.concat', (['df_related_terms'], {}), '(df_related_terms)\n', (1472, 1490), True, 'import pandas as pd\n'), ((1591, 1605), 'pandas.Data...
import numpy as np from matplotlib import pyplot as plt O_TRAJ_PROB = 0.01 # 1 means all trajectories are shown. lowering this number randomly removes trajs S = 30 # markersize in points def truncate_colormap(cmap, minval=0.0, maxval=1.0, n=100): # from stackoverflow how-to-extract-a-subset-of-a-colormap-as-a-...
[ "os.path.expanduser", "numpy.sum", "os.path.join", "navrep.tools.commonargs.parse_plotting_args", "pandas.read_pickle", "numpy.clip", "matplotlib.pyplot.subplots", "navrep.envs.ianenv.IANEnv", "matplotlib.pyplot.ion", "numpy.min", "numpy.max", "numpy.array", "matplotlib.pyplot.Circle", "nu...
[((594, 610), 'numpy.random.rand', 'np.random.rand', ([], {}), '()\n', (608, 610), True, 'import numpy as np\n'), ((670, 690), 'numpy.clip', 'np.clip', (['u', '(0.0)', '(1.0)'], {}), '(u, 0.0, 1.0)\n', (677, 690), True, 'import numpy as np\n'), ((722, 738), 'numpy.random.rand', 'np.random.rand', ([], {}), '()\n', (736,...
import pandas as pd import numpy as np from keras.preprocessing.sequence import pad_sequences from sklearn.model_selection import train_test_split def load_raw_data(file_path): df = pd.read_csv(file_path, sep='\t') sentences = df['sentences'].values labels = df['labels'].values return senten...
[ "numpy.load", "pandas.read_csv", "keras.preprocessing.sequence.pad_sequences", "sklearn.model_selection.train_test_split", "numpy.random.RandomState" ]
[((195, 227), 'pandas.read_csv', 'pd.read_csv', (['file_path'], {'sep': '"""\t"""'}), "(file_path, sep='\\t')\n", (206, 227), True, 'import pandas as pd\n'), ((411, 429), 'numpy.load', 'np.load', (['file_path'], {}), '(file_path)\n', (418, 429), True, 'import numpy as np\n'), ((548, 575), 'numpy.random.RandomState', 'n...
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from .train_funcs import load_datasets, load_state, load_results, evaluate, infer from .GAT import GAT, SpGAT from .preprocessing_funcs import load_pickle, save_as_pickle import matplotlib.pyplot...
[ "logging.basicConfig", "logging.getLogger", "matplotlib.pyplot.figure", "numpy.array", "torch.cuda.is_available", "torch.no_grad", "os.path.join", "torch.tensor", "torch.optim.lr_scheduler.MultiStepLR" ]
[((375, 501), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s [%(levelname)s]: %(message)s"""', 'datefmt': '"""%m/%d/%Y %I:%M:%S %p"""', 'level': 'logging.INFO'}), "(format='%(asctime)s [%(levelname)s]: %(message)s',\n datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO)\n", (394, 501), ...
import markov_speaking import re import random import numpy as np import os import keras from rhyme_searching import * from keras.models import Sequential from keras.layers import LSTM from keras.layers.core import Dense # training depth depth = 4 train_mode = False artist = "chinese_rappers" rap_fi...
[ "markov_speaking.Markov", "keras.layers.LSTM", "numpy.array", "keras.models.Sequential", "os.listdir" ]
[((376, 388), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (386, 388), False, 'from keras.models import Sequential\n'), ((1753, 1769), 'numpy.array', 'np.array', (['x_data'], {}), '(x_data)\n', (1761, 1769), True, 'import numpy as np\n'), ((1781, 1797), 'numpy.array', 'np.array', (['y_data'], {}), '(y_dat...
''' The cache object is introduced to reduce memory usage by storing the values of terms/factors of the discovered equations. Functions: upload_simple_tokens : uploads the basic factor into the cache with its value in ndimensional numpy.array download_variable : download a variable from the disc by its and its...
[ "numpy.moveaxis", "numpy.load", "numpy.abs", "psutil.virtual_memory", "numpy.ndenumerate", "numpy.floor", "numpy.empty_like", "numpy.isclose", "numpy.arange", "numpy.reshape", "numpy.all" ]
[((3404, 3441), 'numpy.moveaxis', 'np.moveaxis', (['var_tensor', 'time_axis', '(0)'], {}), '(var_tensor, time_axis, 0)\n', (3415, 3441), True, 'import numpy as np\n'), ((5017, 5038), 'numpy.load', 'np.load', (['var_filename'], {}), '(var_filename)\n', (5024, 5038), True, 'import numpy as np\n'), ((5052, 5075), 'numpy.l...
""" .. See the NOTICE file distributed with this work for additional information regarding copyright ownership. 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....
[ "h5py.File", "numpy.zeros", "basic_modules.tool.Tool.__init__", "utils.dummy_pycompss.task", "pytadbit.parsers.genome_parser.parse_fasta" ]
[((1992, 2090), 'utils.dummy_pycompss.task', 'task', ([], {'adjlist_file': 'FILE_IN', 'adj_hdf5': 'FILE_INOUT', 'normalized': 'IN', 'resolution': 'IN', 'chromosomes': 'IN'}), '(adjlist_file=FILE_IN, adj_hdf5=FILE_INOUT, normalized=IN, resolution=\n IN, chromosomes=IN)\n', (1996, 2090), False, 'from utils.dummy_pycom...
import copy import os import logging import pytz from types import MappingProxyType import numpy as np import netCDF4 as nc from smrf.framework.model_framework import run_smrf class SMRFConnector(): # map function from these values to the ones required by snobal MAP_INPUTS = MappingProxyType({ 'air_...
[ "copy.deepcopy", "numpy.ones_like", "smrf.framework.model_framework.run_smrf", "types.MappingProxyType", "pytz.timezone", "netCDF4.date2index", "logging.getLogger" ]
[((288, 541), 'types.MappingProxyType', 'MappingProxyType', (["{'air_temp': 'T_a', 'net_solar': 'S_n', 'thermal': 'I_lw', 'vapor_pressure':\n 'e_a', 'wind_speed': 'u', 'soil_temp': 'T_g', 'precip': 'm_pp',\n 'percent_snow': 'percent_snow', 'snow_density': 'rho_snow',\n 'precip_temp': 'T_pp'}"], {}), "({'air_te...
import os import pickle import unittest import numpy as np from pymoo.algorithms.ctaea import (CADASurvival, RestrictedMating, comp_by_cv_dom_then_random) from pymoo.factory import get_reference_directions from pymoo.model.evaluator import Evaluator from pymoo.model.population impo...
[ "unittest.main", "pymoo.model.population.Population.merge", "tests.path_to_test_resources", "numpy.random.seed", "pymoo.algorithms.ctaea.RestrictedMating", "pymoo.algorithms.ctaea.CADASurvival", "pymoo.util.nds.non_dominated_sorting.NonDominatedSorting", "numpy.all", "pymoo.problems.many.C1DTLZ1", ...
[((10498, 10513), 'unittest.main', 'unittest.main', ([], {}), '()\n', (10511, 10513), False, 'import unittest\n'), ((830, 841), 'pymoo.model.evaluator.Evaluator', 'Evaluator', ([], {}), '()\n', (839, 841), False, 'from pymoo.model.evaluator import Evaluator\n'), ((893, 919), 'pymoo.problems.many.C1DTLZ3', 'C1DTLZ3', ([...
import collections import warnings from math import sqrt from typing import Union, Tuple import nolds import numpy as np import pandas as pd import scipy as sp import scipy.stats from arch import unitroot from numpy.linalg import LinAlgError from pandas.tseries.frequencies import to_offset from scipy impo...
[ "util.get_overridden_methods", "util.transform_func_result", "numpy.abs", "numpy.argmax", "pandas.tseries.frequencies.to_offset", "tsfresh.feature_extraction.feature_calculators.longest_strike_below_mean", "tsfresh.feature_extraction.feature_calculators.binned_entropy", "arch.unitroot.KPSS", "nolds....
[((8013, 8044), 'util.copy_doc_from', 'util.copy_doc_from', (['fc.kurtosis'], {}), '(fc.kurtosis)\n', (8031, 8044), False, 'import util\n'), ((8153, 8184), 'util.copy_doc_from', 'util.copy_doc_from', (['fc.skewness'], {}), '(fc.skewness)\n', (8171, 8184), False, 'import util\n'), ((11053, 11130), 'util.copy_doc_from', ...
import os from PIL import Image import sys import numpy as np import cv2 import fnmatch input_folder = '/home/samik/ProcessDet/wdata/train/masks2m/' # input_folder = '/home/samik/ProcessDet/wdata/Process/annotV/' input_folder2 = '/home/samik/ProcessDet/wdata/train/images/' files = os.listdir(input_folder) files2 = os....
[ "PIL.Image.fromarray", "fnmatch.fnmatch", "numpy.zeros", "os.listdir" ]
[((283, 307), 'os.listdir', 'os.listdir', (['input_folder'], {}), '(input_folder)\n', (293, 307), False, 'import os\n'), ((317, 342), 'os.listdir', 'os.listdir', (['input_folder2'], {}), '(input_folder2)\n', (327, 342), False, 'import os\n'), ((814, 853), 'numpy.zeros', 'np.zeros', (['(512, 512, 3)'], {'dtype': 'np.uin...
# This example shows a bug where pySNOPT wouldn't optimize a model that has # only equality constraints because it thought the problem was trivial. The # problem is a simple paraboloid. The minimum should be at (7.166667, # -7.833334), but with the bug, x and y stay at zero. import unittest import numpy as np from nu...
[ "unittest.main", "pyoptsparse.Optimization", "numpy.ones", "numpy.array", "unittest.SkipTest", "numpy.testing.assert_allclose", "pyoptsparse.SNOPT" ]
[((1665, 1679), 'numpy.array', 'np.array', (['(-1.0)'], {}), '(-1.0)\n', (1673, 1679), True, 'import numpy as np\n'), ((1695, 1708), 'numpy.array', 'np.array', (['(1.0)'], {}), '(1.0)\n', (1703, 1708), True, 'import numpy as np\n'), ((5391, 5406), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5404, 5406), False,...
import numpy as np from fpypeline.polygon import Polygon class Rectangle(Polygon): def __init__(self, side_lengths): super().__init__(side_lengths) assert ( len(self.side_lengths) == 2 ), "A rectangle can only have 2 different sides." assert ( self.side_le...
[ "numpy.prod" ]
[((447, 473), 'numpy.prod', 'np.prod', (['self.side_lengths'], {}), '(self.side_lengths)\n', (454, 473), True, 'import numpy as np\n')]
import numpy as np from scipy.stats import beta from matplotlib.pyplot import hist, plot, show q = beta(5, 5) # Beta(a, b), with a = b = 5 obs = q.rvs(2000) # 2000 observations hist(obs, bins=40, normed=True) grid = np.linspace(0.01, 0.99, 100) plot(grid, q.pdf(grid), 'k-', linewidth=2) show()
[ "numpy.linspace", "matplotlib.pyplot.show", "matplotlib.pyplot.hist", "scipy.stats.beta" ]
[((99, 109), 'scipy.stats.beta', 'beta', (['(5)', '(5)'], {}), '(5, 5)\n', (103, 109), False, 'from scipy.stats import beta\n'), ((184, 215), 'matplotlib.pyplot.hist', 'hist', (['obs'], {'bins': '(40)', 'normed': '(True)'}), '(obs, bins=40, normed=True)\n', (188, 215), False, 'from matplotlib.pyplot import hist, plot, ...
import os import pickle import numpy as np from decorators import auto_init_args, lazy_execute VOCAB_SIZE = 50000 class data_holder: @auto_init_args def __init__(self, train_data, test_data, sent_vocab, doc_title_vocab, sec_title_vocab): self.inv_vocab = {i: w for w, i in sent_voc...
[ "numpy.random.choice", "numpy.random.shuffle", "os.walk", "numpy.zeros", "pickle.load", "numpy.array", "decorators.lazy_execute", "numpy.random.permutation", "os.path.join", "numpy.concatenate", "numpy.sqrt" ]
[((4542, 4575), 'decorators.lazy_execute', 'lazy_execute', (['"""_load_from_pickle"""'], {}), "('_load_from_pickle')\n", (4554, 4575), False, 'from decorators import auto_init_args, lazy_execute\n'), ((1085, 1109), 'os.walk', 'os.walk', (['self.train_path'], {}), '(self.train_path)\n', (1092, 1109), False, 'import os\n...
#!/usr/bin/env python ''' This script reads in seismic noise data from March 2017 and earthquake data. It shifts the data by time for clustering It determined earthquake times by looking at peaks in data It clusters earthquake channels using kmeans and dbscan. It compares the clusters around the earthquake times to de...
[ "scipy.io.loadmat", "astropy.time.Time", "numpy.floor", "sklearn.cluster.KMeans", "numpy.zeros", "numpy.shape", "numpy.append", "matplotlib.use", "numpy.array", "matplotlib.pyplot.rc", "numpy.arange", "scipy.signal.find_peaks_cwt", "numpy.vstack" ]
[((896, 917), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (910, 917), False, 'import matplotlib\n'), ((1060, 1087), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (1066, 1087), True, 'import matplotlib.pyplot as plt\n'), ((1092, 1159), 'mat...
# -*- coding: utf-8 -*- """ HISTORY: Created on Tue May 26 22:32:49 2020 Project: Vortex GUI Author: DIVE-LINK (www.dive-link.net), <EMAIL> <NAME> (SemperAnte), <EMAIL> TODO: [ ] change to more model-view structure DESCRIPTION: TransferWidget signals: imageLoaded ...
[ "PyQt5.QtCore.pyqtSignal", "PyQt5.QtWidgets.QLabel", "matplotlib.image.imread", "numpy.uint8", "numpy.uint32", "PyQt5.QtWidgets.QRadioButton", "PyQt5.QtWidgets.QWidget", "numpy.ravel", "PyQt5.QtWidgets.QGridLayout", "utility.runManualTest", "PyQt5.QtWidgets.QPushButton", "PyQt5.QtWidgets.QHBox...
[((585, 611), 'PyQt5.QtCore.pyqtSignal', 'qtc.pyqtSignal', (['np.ndarray'], {}), '(np.ndarray)\n', (599, 611), True, 'from PyQt5 import QtCore as qtc\n'), ((634, 660), 'PyQt5.QtCore.pyqtSignal', 'qtc.pyqtSignal', (['np.ndarray'], {}), '(np.ndarray)\n', (648, 660), True, 'from PyQt5 import QtCore as qtc\n'), ((683, 699)...
import numpy as np from collections import OrderedDict from string import ascii_uppercase from gips.utils._read_ext import read_gist_ext from gips.datastrc.gist import gist from gips.utils.misc import are_you_numpy from gips import FLOAT from gips import DOUBLE ### Written by <NAME> @ Klebe Lab, Marburg University #...
[ "numpy.stack", "numpy.fill_diagonal", "gips.utils.misc.are_you_numpy", "numpy.zeros", "numpy.isnan", "numpy.min", "numpy.where", "numpy.array", "numpy.loadtxt", "numpy.max", "gips.utils._read_ext.read_gist_ext", "collections.OrderedDict" ]
[((374, 387), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (385, 387), False, 'from collections import OrderedDict\n'), ((2583, 2596), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2594, 2596), False, 'from collections import OrderedDict\n'), ((4808, 4821), 'collections.OrderedDict', 'Orde...
# coding: utf-8 # 模块状态信息的输出 from global_data import Bases, Trucks, Orders, Destinations import numpy as np from model.base_model.base import Base from model.base_model.base_.type import Truck_status from model.base_model.order import Order from model.base_model.truck import Truck from model.base_model.base_.data_recor...
[ "model.base_model.base_.data_record.model_time_to_date_time", "global_data.Bases.items", "global_data.Trucks.values", "numpy.around", "global_data.Orders.values", "sys.setdefaultencoding", "model.base_model.base_.data_record.Writer", "global_data.Trucks.items" ]
[((385, 415), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf8"""'], {}), "('utf8')\n", (407, 415), False, 'import sys\n'), ((729, 742), 'global_data.Bases.items', 'Bases.items', ([], {}), '()\n', (740, 742), False, 'from global_data import Bases, Trucks, Orders, Destinations\n'), ((2186, 2200), 'global_d...
import matplotlib.pyplot as plt import numpy as np from sklearn.svm import SVC from sklearn.datasets import make_blobs from sklearn.externals.joblib import Memory from .plot_2d_separator import plot_2d_separator def make_handcrafted_dataset(): # a carefully hand-designed dataset lol X, y = make_blobs(centers=2...
[ "IPython.html.widgets.interactive", "sklearn.svm.SVC", "sklearn.datasets.make_blobs", "numpy.array", "matplotlib.pyplot.gca", "IPython.html.widgets.FloatSlider", "matplotlib.pyplot.subplots" ]
[((300, 351), 'sklearn.datasets.make_blobs', 'make_blobs', ([], {'centers': '(2)', 'random_state': '(4)', 'n_samples': '(30)'}), '(centers=2, random_state=4, n_samples=30)\n', (310, 351), False, 'from sklearn.datasets import make_blobs\n'), ((593, 628), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(3)'], {'f...
import sys import nltk nltk.download(['punkt', 'wordnet', 'averaged_perceptron_tagger']) import re import numpy as np import pandas as pd from nltk.tokenize import word_tokenize from nltk.stem import WordNetLemmatizer from sqlalchemy import create_engine from sklearn.metrics import classification_report from sklearn.m...
[ "nltk.download", "numpy.array" ]
[((23, 88), 'nltk.download', 'nltk.download', (["['punkt', 'wordnet', 'averaged_perceptron_tagger']"], {}), "(['punkt', 'wordnet', 'averaged_perceptron_tagger'])\n", (36, 88), False, 'import nltk\n'), ((2262, 2286), 'numpy.array', 'np.array', (['st_words_count'], {}), '(st_words_count)\n', (2270, 2286), True, 'import n...
import collections import copy import functools import importlib import inspect import math import pickle import random import statistics from river import stats import numpy as np import pytest from scipy import stats as sp_stats def load_stats(): for _, obj in inspect.getmembers(importlib.import_module("river....
[ "river.stats.Var", "river.stats.Shift", "river.stats.RollingCov", "river.stats.RollingMean", "collections.deque", "inspect.signature", "numpy.cov", "river.stats.Kurtosis", "river.stats.Cov", "pickle.dumps", "functools.partial", "copy.deepcopy", "importlib.import_module", "river.stats.Mean"...
[((1753, 1789), 'numpy.warnings.filterwarnings', 'np.warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (1779, 1789), True, 'import numpy as np\n'), ((2318, 2354), 'numpy.warnings.filterwarnings', 'np.warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (2344, 2354), True, 'import numpy as n...
# Copyright 2019 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.ops.variables.global_variables_initializer", "tensorflow.python.ipu.scopes.ipu_scope", "tensorflow.python.client.session.Session", "tensorflow.python.ops.tensor_array_ops.TensorArray", "tensorflow.python.ipu.config.IPUConfig", "tensorflow.python.ops.math_ops.add", "tensorflow.python.i...
[((1496, 1525), 'test_utils.test_uses_ipus', 'tu.test_uses_ipus', ([], {'num_ipus': '(1)'}), '(num_ipus=1)\n', (1513, 1525), True, 'import test_utils as tu\n'), ((3562, 3579), 'tensorflow.python.platform.googletest.main', 'googletest.main', ([], {}), '()\n', (3577, 3579), False, 'from tensorflow.python.platform import ...
import torch from torch import nn from models.Net import Net import numpy as np import os from functools import partial from utils.bicubic import BicubicDownSample from datasets.image_dataset import ImagesDataset from losses.embedding_loss import EmbeddingLossBuilder from torch.utils.data import DataLoader from tqdm im...
[ "functools.partial", "datasets.image_dataset.ImagesDataset", "tqdm.tqdm", "numpy.save", "os.makedirs", "torch.utils.data.DataLoader", "losses.embedding_loss.EmbeddingLossBuilder", "torch.stack", "utils.bicubic.BicubicDownSample", "torch.manual_seed", "numpy.load", "torchvision.transforms.ToPIL...
[((415, 450), 'torchvision.transforms.ToPILImage', 'torchvision.transforms.ToPILImage', ([], {}), '()\n', (448, 450), False, 'import torchvision\n'), ((597, 611), 'models.Net.Net', 'Net', (['self.opts'], {}), '(self.opts)\n', (600, 611), False, 'from models.Net import Net\n'), ((790, 822), 'utils.bicubic.BicubicDownSam...
import os import sys import random import math import numpy as np import skimage.io import matplotlib import matplotlib.pyplot as plt from flask import Flask, request, Response import jsonpickle import cv2 import skimage.io from PIL import Image ROOT_DIR = os.path.abspath("../") sys.path.append(ROOT_DIR) from mrcnn i...
[ "sys.path.append", "mrcnn.utils.download_trained_weights", "os.path.abspath", "cv2.cvtColor", "flask.Response", "flask.Flask", "os.path.exists", "cv2.imdecode", "os.walk", "random.choice", "numpy.array", "PIL.Image.fromarray", "mrcnn.model.MaskRCNN", "os.path.join", "numpy.fromstring", ...
[((258, 280), 'os.path.abspath', 'os.path.abspath', (['"""../"""'], {}), "('../')\n", (273, 280), False, 'import os\n'), ((282, 307), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (297, 307), False, 'import sys\n'), ((499, 529), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""logs"""'], {}...
############################################## # TrainModels ############################################## from sklearnex import patch_sklearn patch_sklearn() import csv import pandas as pd import numpy as np from os.path import join, exists import os from imblearn.pipeline import Pipeline from sklearn.base import (...
[ "sklearn.preprocessing.LabelBinarizer", "numpy.sum", "pandas.read_csv", "hyperopt.hp.choice", "joblib.dump", "numpy.isnan", "numpy.mean", "os.path.join", "sklearn.base.clone", "numpy.nanmean", "imblearn.pipeline.Pipeline", "sklearn.model_selection.check_cv", "sklearn.utils.check_array", "s...
[((145, 160), 'sklearnex.patch_sklearn', 'patch_sklearn', ([], {}), '()\n', (158, 160), False, 'from sklearnex import patch_sklearn\n'), ((1592, 1602), 'numpy.mean', 'np.mean', (['y'], {}), '(y)\n', (1599, 1602), True, 'import numpy as np\n'), ((1823, 1833), 'numpy.mean', 'np.mean', (['y'], {}), '(y)\n', (1830, 1833), ...
#!/usr/bin/env python3 # Copyright (c) 2021, NVIDIA CORPORATION. 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 ...
[ "argparse.ArgumentParser", "os.getcwd", "code.common.image_preprocessor.ImagePreprocessor", "code.common.logging.info", "numpy.asarray", "PIL.Image.open", "numpy.array", "os.path.join" ]
[((822, 833), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (831, 833), False, 'import os\n'), ((2895, 2931), 'code.common.image_preprocessor.ImagePreprocessor', 'ImagePreprocessor', (['loader', 'quantizer'], {}), '(loader, quantizer)\n', (2912, 2931), False, 'from code.common.image_preprocessor import ImagePreprocessor\...
import numpy as np import scipy.linalg class rls(object): """docstring for ClassName""" def __init__(self, lbd, theta, nn_dim, output_dim): self.lbd = lbd self.nn_dim = nn_dim self.y_dim = output_dim self.draw = [] self.theta = theta * np.ones([self.nn_dim, self.y_di...
[ "numpy.eye", "numpy.ones" ]
[((289, 323), 'numpy.ones', 'np.ones', (['[self.nn_dim, self.y_dim]'], {}), '([self.nn_dim, self.y_dim])\n', (296, 323), True, 'import numpy as np\n'), ((431, 450), 'numpy.eye', 'np.eye', (['self.nn_dim'], {}), '(self.nn_dim)\n', (437, 450), True, 'import numpy as np\n'), ((716, 731), 'numpy.ones', 'np.ones', (['[1, 1]...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from gym.spaces import Box, Discrete def count_vars(module): return sum(p.numel() for p in module.parameters() if p.requires_grad) def linearly_decaying_epsilon(decay_period, step, warmup_steps, epsilon): steps_left = deca...
[ "torch.nn.ModuleList", "torch.argmax", "torch.empty", "torch.randn", "torch.nn.functional.linear", "numpy.clip", "torch.nn.functional.softmax", "torch.nn.init.zeros_", "torch.nn.functional.log_softmax", "torch.linspace", "numpy.sqrt" ]
[((419, 453), 'numpy.clip', 'np.clip', (['bonus', '(0.0)', '(1.0 - epsilon)'], {}), '(bonus, 0.0, 1.0 - epsilon)\n', (426, 453), True, 'import numpy as np\n'), ((1879, 1896), 'torch.randn', 'torch.randn', (['size'], {}), '(size)\n', (1890, 1896), False, 'import torch\n'), ((2328, 2454), 'torch.nn.functional.linear', 'F...
import torch import torch.nn as nn import torch.nn.functional as F import math import numpy as np import os from torch import optim from . import network from transformers import BertTokenizer, BertModel, BertForMaskedLM, BertForSequenceClassification, RobertaModel, RobertaTokenizer, RobertaForSequenceClassification c...
[ "transformers.BertForSequenceClassification.from_pretrained", "transformers.RobertaTokenizer.from_pretrained", "numpy.zeros", "transformers.RobertaModel.from_pretrained", "torch.nn.Module.__init__", "transformers.BertTokenizer.from_pretrained", "transformers.RobertaForSequenceClassification.from_pretrai...
[((498, 522), 'torch.nn.Module.__init__', 'nn.Module.__init__', (['self'], {}), '(self)\n', (516, 522), True, 'import torch.nn as nn\n'), ((1583, 1624), 'numpy.zeros', 'np.zeros', (['self.max_length'], {'dtype': 'np.int32'}), '(self.max_length, dtype=np.int32)\n', (1591, 1624), True, 'import numpy as np\n'), ((1642, 16...
import torch import numpy as np from . import covid19_v3, covid19_v2, covid19_v1, QB from src import utils as ut import os import os import numpy as np import torch def get_dataset(dataset_dict, split, datadir, exp_dict, dataset_size=None): name = dataset_dict['name'] if name == "QB": dataset = QB.QBD...
[ "torch.ones", "numpy.flip", "torch.LongTensor", "numpy.unique", "os.path.exists", "torch.FloatTensor", "torchvision.transforms.ToTensor", "numpy.min", "numpy.where", "numpy.array", "numpy.max", "torch.zeros", "torch.as_tensor", "torch.tensor", "torch.from_numpy" ]
[((4131, 4146), 'numpy.unique', 'np.unique', (['mask'], {}), '(mask)\n', (4140, 4146), True, 'import numpy as np\n'), ((4811, 4854), 'torch.as_tensor', 'torch.as_tensor', (['boxes'], {'dtype': 'torch.float32'}), '(boxes, dtype=torch.float32)\n', (4826, 4854), False, 'import torch\n'), ((5207, 5248), 'torch.as_tensor', ...
import argparse import json import logging import os import numpy as np import pandas as pd import pickle as pkl import xgboost as xgb from sklearn.metrics import accuracy_score, precision_score, f1_score from smexperiments.tracker import Tracker def model_fn(model_dir): """Deserialize and return fitted model. ...
[ "argparse.ArgumentParser", "xgboost.train", "os.environ.get", "logging.info", "numpy.rint", "smexperiments.tracker.Tracker.load", "numpy.loadtxt", "smexperiments.tracker.Tracker.create", "os.path.join", "xgboost.DMatrix" ]
[((612, 637), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (635, 637), False, 'import argparse\n'), ((2358, 2394), 'logging.info', 'logging.info', (['"""Extracting arguments"""'], {}), "('Extracting arguments')\n", (2370, 2394), False, 'import logging\n'), ((2427, 2445), 'logging.info', 'logg...
"""Ref to HeteroFL pre-activated ResNet18""" import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.batchnorm import _BatchNorm from torch.nn.modules.instancenorm import _InstanceNorm from ..models import ScalableModule hidden_size = [64, 128, 256, 512] class Blo...
[ "torch.rand", "torch.nn.Sequential", "torch.nn.Conv2d", "nets.profile_func.profile_model", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.BatchNorm2d", "torch.nn.Linear", "numpy.prod" ]
[((7628, 7662), 'nets.profile_func.profile_model', 'profile_model', (['model'], {'verbose': '(True)'}), '(model, verbose=True)\n', (7641, 7662), False, 'from nets.profile_func import profile_model\n'), ((3883, 3959), 'torch.nn.Conv2d', 'nn.Conv2d', (['(3)', 'hidden_size[0]'], {'kernel_size': '(3)', 'stride': '(1)', 'pa...
#!/usr/bin/env python3 """ Usage: analyze_ss.py FILE [options] Analyze feature importance using stability selection. Options: -g, --lambda-grid SPEC Grid of lambda values (regularization parameter) to iterate over, given as parameters for np.logspace ...
[ "numpy.random.seed", "numpy.triu", "numpy.abs", "docopt.docopt", "numpy.logspace", "logzero.LogFormatter", "pyconll.load_from_file", "sklearn.metrics.precision_recall_fscore_support", "sklearn.dummy.DummyClassifier", "warnings.simplefilter", "sklearn.preprocessing.LabelEncoder", "warnings.catc...
[((2003, 2034), 'logzero.loglevel', 'logzero.loglevel', (['logging.DEBUG'], {}), '(logging.DEBUG)\n', (2019, 2034), False, 'import logzero\n'), ((2035, 2055), 'numpy.random.seed', 'np.random.seed', (['(2300)'], {}), '(2300)\n', (2049, 2055), True, 'import numpy as np\n'), ((1952, 2001), 'logzero.LogFormatter', 'logzero...
import numpy as np from pymoo.core.crossover import Crossover from pymoo.core.mutation import Mutation from pymoo.core.sampling import Sampling def prepare_processing(mask, operators): process = [] # create a numpy array of mask if it is not yet mask = np.array(mask) for val in np.unique(mask): ...
[ "numpy.full", "numpy.array", "numpy.unique" ]
[((269, 283), 'numpy.array', 'np.array', (['mask'], {}), '(mask)\n', (277, 283), True, 'import numpy as np\n'), ((300, 315), 'numpy.unique', 'np.unique', (['mask'], {}), '(mask)\n', (309, 315), True, 'import numpy as np\n'), ((1733, 1790), 'numpy.full', 'np.full', (['(n_rows, problem.n_var)', 'np.nan'], {'dtype': 'np.o...
import os import json import csv import numpy as np import voltagebudget from copy import deepcopy from voltagebudget.util import mad # def _create_target(ts, percent_change): # initial = mad(ts) # target = initial - (initial * percent_change) # return initial, target def uniform(ts, initial, target): ...
[ "numpy.nanargmin", "numpy.absolute", "copy.deepcopy", "numpy.zeros_like", "voltagebudget.util.mad", "numpy.ones_like", "numpy.abs", "numpy.argmax", "numpy.asarray", "numpy.argsort", "numpy.sort", "numpy.isclose", "numpy.mean" ]
[((463, 477), 'numpy.asarray', 'np.asarray', (['ts'], {}), '(ts)\n', (473, 477), True, 'import numpy as np\n'), ((527, 556), 'numpy.absolute', 'np.absolute', (['(initial - target)'], {}), '(initial - target)\n', (538, 556), True, 'import numpy as np\n'), ((582, 593), 'numpy.mean', 'np.mean', (['ts'], {}), '(ts)\n', (58...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # This file defines tests for the Backtester classes import statistics import unittest import unittest.mock as mock from typing import Any,...
[ "unittest.mock.MagicMock", "unittest.mock.call.fit", "kats.data.utils.load_air_passengers", "kats.utils.backtesters.BackTesterSimple", "kats.utils.backtesters.BackTesterExpandingWindow", "kats.metrics.metrics.core_metric", "unittest.mock.call", "numpy.array", "kats.utils.backtesters.BackTesterFixedW...
[((1962, 1980), 'kats.metrics.metrics.core_metric', 'core_metric', (['error'], {}), '(error)\n', (1973, 1980), False, 'from kats.metrics.metrics import core_metric\n'), ((2260, 2278), 'kats.metrics.metrics.core_metric', 'core_metric', (['error'], {}), '(error)\n', (2271, 2278), False, 'from kats.metrics.metrics import ...
import os import numpy as np from scipy import io as sio from skimage import io, transform, color from skimage.util import img_as_ubyte from pycocotools.coco import COCO def get_png_compress_ratio(image_shape, image_size): (_h, _w) = image_shape[:2] channel = 1 if len(image_shape) > 2: channel = ...
[ "os.stat", "numpy.seterr", "numpy.asarray", "pycocotools.coco.COCO", "numpy.array", "skimage.transform.resize", "skimage.color.gray2rgb", "os.path.join", "skimage.io.imread" ]
[((1608, 1631), 'numpy.seterr', 'np.seterr', ([], {'all': '"""ignore"""'}), "(all='ignore')\n", (1617, 1631), True, 'import numpy as np\n'), ((1768, 1781), 'pycocotools.coco.COCO', 'COCO', (['annFile'], {}), '(annFile)\n', (1772, 1781), False, 'from pycocotools.coco import COCO\n'), ((751, 780), 'os.path.join', 'os.pat...
""" test.py: an example demonstrating how to run FM-Track. It runs on the example data placed inside of the examples folder of FM-Track. This file is intended to be: (1) a demonstration of how to use FM-Track in its most simplistic form (2) a sample script to test whether your installation has ...
[ "numpy.array", "fmtrack.inputinfo.InputInfo" ]
[((3279, 3312), 'numpy.array', 'np.array', (['[149.95, 149.95, 140.0]'], {}), '([149.95, 149.95, 140.0])\n', (3287, 3312), True, 'import numpy as np\n'), ((3857, 3882), 'fmtrack.inputinfo.InputInfo', 'InputInfo', (['root_directory'], {}), '(root_directory)\n', (3866, 3882), False, 'from fmtrack.inputinfo import InputIn...
import numpy as np from numpy import int8,int16,int32,int64,float32,float64,complex64,complex128 import os numpy_ctypes={float32:"float",float64:"double",complex64:"npy_cfloat_wrapper",complex128:"npy_cdouble_wrapper", int32:"npy_int32",int64:"npy_int64",int8:"npy_int8",int16:"npy_int16"} numpy...
[ "os.path.dirname", "numpy.can_cast" ]
[((4117, 4142), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (4132, 4142), False, 'import os\n'), ((1446, 1465), 'numpy.can_cast', 'np.can_cast', (['T1', 'T3'], {}), '(T1, T3)\n', (1457, 1465), True, 'import numpy as np\n'), ((3180, 3199), 'numpy.can_cast', 'np.can_cast', (['T1', 'T3'], {})...
import versions import testing from testing import divert_nexus_log,restore_nexus_log from testing import value_eq,object_eq associated_files = dict() def get_files(): return testing.collect_unit_test_file_paths('qmcpack_input',associated_files) #end def get_files def format_value(v): import numpy as np ...
[ "nexus.generate_qmcpack_input", "testing.divert_nexus_log", "os.path.join", "testing.object_eq", "qmcpack_input.meta", "testing.collect_unit_test_file_paths", "qmcpack_input.spindensity", "testing.setup_unit_test_output_directory", "generic.obj", "numpy.array", "testing.restore_nexus_log", "qm...
[((182, 253), 'testing.collect_unit_test_file_paths', 'testing.collect_unit_test_file_paths', (['"""qmcpack_input"""', 'associated_files'], {}), "('qmcpack_input', associated_files)\n", (218, 253), False, 'import testing\n'), ((23938, 24049), 'numpy.array', 'np.array', (['[0.44140587, 0.26944819, 0.15547533, 0.08413778...
import numpy as np import scipy.sparse as sp import openmdao.api as om from ...grid_data import GridData from ....utils.misc import get_rate_units class StateInterpComp(om.ExplicitComponent): r""" Provide interpolated state values and/or rates for pseudospectral transcriptions. When the transcription is *gau...
[ "scipy.sparse.find", "scipy.sparse.eye", "numpy.reciprocal", "numpy.zeros", "scipy.sparse.csr_matrix", "numpy.arange", "numpy.reshape", "numpy.prod", "numpy.repeat" ]
[((9045, 9078), 'numpy.reciprocal', 'np.reciprocal', (["inputs['dt_dstau']"], {}), "(inputs['dt_dstau'])\n", (9058, 9078), True, 'import numpy as np\n'), ((9897, 9930), 'numpy.reciprocal', 'np.reciprocal', (["inputs['dt_dstau']"], {}), "(inputs['dt_dstau'])\n", (9910, 9930), True, 'import numpy as np\n'), ((4857, 4871)...
import argparse import functools import logging import sys import gym import gym.wrappers import numpy as np import torch from torch import distributions, nn import pfrl #from diayn.discriminator import Discriminator #from diayn.vecwrapper import DIAYNWrapper from pfrl import experiments, replay_buffers, utils from p...
[ "utils.get_squashed_diagonal_gaussian_head_fun", "numpy.random.uniform", "utils.make_n_hidden_layers", "torch.nn.ReLU", "torch.nn.init.xavier_uniform_", "pfrl.nn.ConcatObsAndAction", "pfrl.nn.lmbda.Lambda", "pfrl.agents.SoftActorCritic", "pfrl.replay_buffers.ReplayBuffer", "torch.nn.Linear" ]
[((551, 603), 'utils.get_squashed_diagonal_gaussian_head_fun', 'get_squashed_diagonal_gaussian_head_fun', (['action_size'], {}), '(action_size)\n', (590, 603), False, 'from utils import get_squashed_diagonal_gaussian_head_fun\n'), ((982, 1029), 'torch.nn.init.xavier_uniform_', 'torch.nn.init.xavier_uniform_', (['policy...
from ase import Atoms import numpy as np from ase.units import Hartree, mol, kJ, Bohr, nm from .hessian import VibrationsData from .matching import matcher def hesmatch(ref_hessian, match_hessians, masses=None, ref_format='2d', match_format='2d', ref_unit=1, match_unit=1): """ Parameters ----...
[ "numpy.ones" ]
[((1189, 1205), 'numpy.ones', 'np.ones', (['n_atoms'], {}), '(n_atoms)\n', (1196, 1205), True, 'import numpy as np\n')]
""" Backend for graphing predicted disorder values in dssp.py. """ # code for graphing IDRs. # Import stuff import numpy as np import matplotlib import matplotlib.pyplot as plt import metapredict as meta from PredictDSSP.dssp_predict import predict_dssp import alphaPredict as alpha def graph(sequence, titl...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "PredictDSSP.dssp_predict.predict_dssp", "matplotlib.pyplot.figure", "numpy.arange", "alphaPredict.predict", "metapredict.predict_disorder", "matplotlib.pyplot.savefig" ]
[((2625, 2690), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'num': 'title', 'figsize': '[8, 3]', 'dpi': 'DPI', 'edgecolor': '"""black"""'}), "(num=title, figsize=[8, 3], dpi=DPI, edgecolor='black')\n", (2635, 2690), True, 'import matplotlib.pyplot as plt\n'), ((2994, 3017), 'numpy.arange', 'np.arange', (['(1)', '(n...
from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Conv2D, MaxPool2D, Dense, Flatten, BatchNormalization, Activation, Dropout, Input, \ LeakyReLU, ZeroPadding2D, UpSampling2D from tensorflow.keras import callbacks from tensorflow.keras.utils import to_categorical, plot_model import n...
[ "json.load", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.utils.to_categorical", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "tensorflow.keras.applications.vgg16.VGG16", "numpy.array", "tensorflow.keras.models.Sequential", ...
[((1150, 1162), 'tensorflow.keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1160, 1162), False, 'from tensorflow.keras.models import Sequential\n'), ((2225, 2242), 'numpy.array', 'np.array', (['X_train'], {}), '(X_train)\n', (2233, 2242), True, 'import numpy as np\n'), ((2785, 2807), 'tensorflow.keras.utils....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 23 15:31 2021 @author: <NAME> (Gory) """ import glob import time import argparse import numpy as np from dipy.io.streamline import load_tractogram from dipy.viz import window, actor clusters_labels = { 'AC': 0, # 'AF_L': 1, 'AF_R': 2,...
[ "numpy.save", "numpy.sum", "argparse.ArgumentParser", "dipy.viz.actor.line", "dipy.io.streamline.load_tractogram", "numpy.floor", "numpy.ones", "numpy.argmin", "time.time", "dipy.viz.window.Scene", "numpy.array", "glob.glob", "dipy.viz.window.show" ]
[((1514, 1539), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1537, 1539), False, 'import argparse\n'), ((2140, 2151), 'time.time', 'time.time', ([], {}), '()\n', (2149, 2151), False, 'import time\n'), ((2265, 2276), 'time.time', 'time.time', ([], {}), '()\n', (2274, 2276), False, 'import tim...
import argparse import numpy as np import matplotlib.pyplot as plt from auto_utils import ( get_kw_count, get_word_count, load_keywords, get_wset, get_wlen, get_wfreq, CAP, CUP, arrange_into_freq_bins, ) PRE = "/home/santosh/tools/kaldi/egs/indic/" PATHS = { "tel": [ "te...
[ "auto_utils.get_wfreq", "auto_utils.load_keywords", "auto_utils.get_kw_count", "auto_utils.get_wset", "matplotlib.pyplot.show", "argparse.ArgumentParser", "matplotlib.pyplot.legend", "matplotlib.pyplot.style.use", "matplotlib.pyplot.figure", "matplotlib.pyplot.rc", "matplotlib.pyplot.ylabel", ...
[((622, 654), 'auto_utils.load_keywords', 'load_keywords', (['args.keyword_file'], {}), '(args.keyword_file)\n', (635, 654), False, 'from auto_utils import get_kw_count, get_word_count, load_keywords, get_wset, get_wlen, get_wfreq, CAP, CUP, arrange_into_freq_bins\n'), ((717, 756), 'auto_utils.get_kw_count', 'get_kw_co...
from cgp.functionset import FunctionSet import tetris_learning_environment.gym as gym import configurations.tetris_heuristic as heuristic import numpy as np from random import randint class HeuristicTrainer: FRAME_SKIP = 60 GAME_MARGIN_X = 16 GAME_HEIGHT = 144 GAME_WIDTH = 80 GRID_HEIGHT = 18 ...
[ "configurations.tetris_heuristic.estimate_value", "numpy.argmax", "tetris_learning_environment.gym.TetrisEnvironment", "numpy.zeros", "numpy.mean", "cgp.functionset.FunctionSet" ]
[((2547, 2560), 'cgp.functionset.FunctionSet', 'FunctionSet', ([], {}), '()\n', (2558, 2560), False, 'from cgp.functionset import FunctionSet\n'), ((516, 579), 'tetris_learning_environment.gym.TetrisEnvironment', 'gym.TetrisEnvironment', (['self.romPath'], {'frame_skip': 'self.FRAME_SKIP'}), '(self.romPath, frame_skip=...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Utilities for BOLD fMRI imaging.""" import numpy as np import nibabel as nb from nipype import logging from nipype.interfaces.base import ( traits, TraitedSpec, BaseInterfaceInputSpec, Si...
[ "nipype.interfaces.base.traits.Range", "nibabel.load", "numpy.zeros", "nipype.interfaces.base.traits.Int", "nipype.interfaces.base.File", "nipype.interfaces.base.traits.Bool", "numpy.percentile", "numpy.mean", "nipype.interfaces.base.traits.List", "nipype.logging.getLogger" ]
[((357, 394), 'nipype.logging.getLogger', 'logging.getLogger', (['"""nipype.interface"""'], {}), "('nipype.interface')\n", (374, 394), False, 'from nipype import logging\n'), ((476, 538), 'nipype.interfaces.base.File', 'File', ([], {'exists': '(True)', 'mandatory': '(True)', 'desc': '"""BOLD fMRI timeseries"""'}), "(ex...
from logging import getLogger import numpy as np import scipy.stats as stats from .controller import Controller from ..envs.cost import calc_cost logger = getLogger(__name__) class RandomShooting(Controller): """ Random Shooting Method for linear and nonlinear method Attributes: history_u (list[num...
[ "numpy.random.uniform", "numpy.random.seed", "numpy.argmin", "numpy.tile", "logging.getLogger" ]
[((158, 177), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (167, 177), False, 'from logging import getLogger\n'), ((1074, 1122), 'numpy.tile', 'np.tile', (['config.INPUT_UPPER_BOUND', 'self.pred_len'], {}), '(config.INPUT_UPPER_BOUND, self.pred_len)\n', (1081, 1122), True, 'import numpy as np\n...
import pandas as pd import numpy as np import tensorflow as tf from keras.models import Sequential from keras.layers import Dense from keras.callbacks import ModelCheckpoint from keras.callbacks import Callback from keras.layers import Activation, Dropout import json from keras import backend as K import keras.losses i...
[ "keras.models.load_model", "json.load", "numpy.random.seed", "keras.backend.sign", "keras.layers.Activation", "keras.layers.Dropout", "keras.backend.abs", "keras.backend.less", "keras.layers.Dense", "keras.backend.mean", "numpy.array", "keras.models.Sequential", "keras.backend.square" ]
[((333, 351), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (347, 351), True, 'import numpy as np\n'), ((1040, 1061), 'keras.backend.mean', 'K.mean', (['loss'], {'axis': '(-1)'}), '(loss, axis=-1)\n', (1046, 1061), True, 'from keras import backend as K\n'), ((1205, 1217), 'json.load', 'json.load', ([...
import json import numpy as np from ampligraph.datasets import load_from_csv from ampligraph.evaluation import evaluate_performance, select_best_model_ranking from ampligraph.evaluation import mr_score, mrr_score, hits_at_n_score from ampligraph.evaluation import train_test_split_no_unseen from ampligraph.latent_featu...
[ "ampligraph.evaluation.mr_score", "ampligraph.evaluation.hits_at_n_score", "json.dump", "json.dumps", "ampligraph.utils.save_model", "ampligraph.datasets.load_from_csv", "ampligraph.evaluation.mrr_score", "ampligraph.evaluation.evaluate_performance", "ampligraph.evaluation.select_best_model_ranking"...
[((569, 624), 'ampligraph.datasets.load_from_csv', 'load_from_csv', (['DATASET_LOCATION', 'DATASET_FILE'], {'sep': '"""\t"""'}), "(DATASET_LOCATION, DATASET_FILE, sep='\\t')\n", (582, 624), False, 'from ampligraph.datasets import load_from_csv\n'), ((734, 811), 'ampligraph.evaluation.train_test_split_no_unseen', 'train...
import numpy as np from random import choice def lorentz(beta, fourVector): """ Takes as input relative beta from O -> O' and calculates fourVector -> fourVector' """ beta2 = np.dot(beta, beta) gamma = 1./np.sqrt(1. - beta2) Lambda = np.array([ [gamma, -gamma*beta[0], -gamma*beta[1], -gamma*b...
[ "random.choice", "numpy.sin", "numpy.array", "numpy.cos", "numpy.random.rand", "numpy.dot", "numpy.sqrt" ]
[((189, 207), 'numpy.dot', 'np.dot', (['beta', 'beta'], {}), '(beta, beta)\n', (195, 207), True, 'import numpy as np\n'), ((261, 810), 'numpy.array', 'np.array', (['[[gamma, -gamma * beta[0], -gamma * beta[1], -gamma * beta[2]], [-gamma *\n beta[0], 1 + (gamma - 1) * beta[0] ** 2 / beta2, (gamma - 1) * beta[0] *\n ...
""" Model Trainer. """ import numpy as np from seqeval.metrics import f1_score, classification_report, accuracy_score from tqdm import tqdm from entitypedia.labeling.preprocess import batch_iter class Trainer(object): def __init__(self, model, preprocessor, classes, max_epoch=5, batch_size=32): self.mod...
[ "seqeval.metrics.accuracy_score", "seqeval.metrics.classification_report", "numpy.asarray", "entitypedia.labeling.preprocess.batch_iter", "seqeval.metrics.f1_score" ]
[((710, 811), 'entitypedia.labeling.preprocess.batch_iter', 'batch_iter', (['x_train', 'y_train'], {'batch_size': 'self.batch_size', 'preprocess': 'self.preprocessor.transform'}), '(x_train, y_train, batch_size=self.batch_size, preprocess=self.\n preprocessor.transform)\n', (720, 811), False, 'from entitypedia.label...
# -*- coding: utf-8 -*- """ Created on Fri Dec 4 17:53:50 2020 @author: behnood """ from __future__ import print_function import matplotlib.pyplot as plt #%matplotlib inline import os #os.environ['CUDA_VISIBLE_DEVICES'] = '3' import numpy as np from models import * import torch import torch.opti...
[ "torch.nn.MSELoss", "numpy.zeros", "numpy.clip", "numpy.reshape", "numpy.diag" ]
[((1257, 1273), 'numpy.zeros', 'np.zeros', (['(1, 3)'], {}), '((1, 3))\n', (1265, 1273), True, 'import numpy as np\n'), ((1527, 1551), 'numpy.clip', 'np.clip', (['img_np_gt', '(0)', '(1)'], {}), '(img_np_gt, 0, 1)\n', (1534, 1551), True, 'import numpy as np\n'), ((1719, 1760), 'numpy.reshape', 'np.reshape', (['img_nois...
import numpy as np import torch from scipy.special import softmax from tqdm import tqdm from core.utils import union from core.mmd import mmd_neg_biased_batched def v_update_batch(x, X, Y, S_X, S_XY, k): """ Calculates v when we add a batch of points to a set with an already calculated v. Updating...
[ "numpy.amin", "core.mmd.mmd_neg_biased_batched", "numpy.ceil", "numpy.zeros", "numpy.amax", "core.utils.union", "scipy.special.softmax", "numpy.squeeze", "torch.no_grad", "numpy.delete", "torch.tensor" ]
[((779, 794), 'torch.tensor', 'torch.tensor', (['x'], {}), '(x)\n', (791, 794), False, 'import torch\n'), ((809, 824), 'torch.tensor', 'torch.tensor', (['X'], {}), '(X)\n', (821, 824), False, 'import torch\n'), ((839, 854), 'torch.tensor', 'torch.tensor', (['Y'], {}), '(Y)\n', (851, 854), False, 'import torch\n'), ((33...
import stk from os.path import join import numpy as np def test_xtb_extractor(): known_output_file = join('../data', 'xtb_energy.output') # Get properties from output_file. xtbext = stk.XTBExtractor(output_file=known_output_file) total_energy = xtbext.total_energy homo_lumo_gap = xtbext.homo_lumo...
[ "numpy.isclose", "os.path.join", "stk.XTBExtractor", "numpy.allclose" ]
[((107, 143), 'os.path.join', 'join', (['"""../data"""', '"""xtb_energy.output"""'], {}), "('../data', 'xtb_energy.output')\n", (111, 143), False, 'from os.path import join\n'), ((197, 244), 'stk.XTBExtractor', 'stk.XTBExtractor', ([], {'output_file': 'known_output_file'}), '(output_file=known_output_file)\n', (213, 24...
#!/usr/bin/env python # coding: utf-8 # Noise model selection on NANOGrav pulsars import json, pickle, copy import logging import numpy as np from enterprise_extensions.models import model_singlepsr_noise from enterprise_extensions.hypermodel import HyperModel from enterprise.signals import parameter, gp_signals, det...
[ "json.dump", "copy.deepcopy", "json.load", "enterprise_extensions.models.model_singlepsr_noise", "logging.basicConfig", "enterprise_extensions.gp_kernels.linear_interp_basis_dm", "enterprise_extensions.hypermodel.HyperModel", "enterprise_extensions.chromatic.solar_wind.solar_wind_block", "enterprise...
[((603, 624), 'pta_sim.parse_sim.arguments', 'parse_sim.arguments', ([], {}), '()\n', (622, 624), True, 'import pta_sim.parse_sim as parse_sim\n'), ((625, 667), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.WARNING'}), '(level=logging.WARNING)\n', (644, 667), False, 'import logging\n'), ((1156, ...
import numpy as np import cv2 import glob import yaml class CalibrationCamera: def __init__(self, x=0, y=0): # termination criteria criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp =...
[ "cv2.findChessboardCorners", "cv2.cvtColor", "cv2.waitKey", "numpy.asarray", "yaml.dump", "numpy.zeros", "cv2.imshow", "cv2.cornerSubPix", "cv2.imread", "cv2.calibrateCamera", "glob.glob", "cv2.drawChessboardCorners", "cv2.destroyAllWindows" ]
[((321, 353), 'numpy.zeros', 'np.zeros', (['(7 * 7, 3)', 'np.float32'], {}), '((7 * 7, 3), np.float32)\n', (329, 353), True, 'import numpy as np\n'), ((606, 631), 'glob.glob', 'glob.glob', (['"""images/*.jpg"""'], {}), "('images/*.jpg')\n", (615, 631), False, 'import glob\n'), ((1962, 1985), 'cv2.destroyAllWindows', 'c...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "tensorflow.reshape", "os.path.join", "libml.utils.get_available_gpus", "tensorflow.gfile.Glob", "absl.flags.DEFINE_bool", "tensorflow.pad", "libml.utils.get_config", "tensorflow.cast", "numpy.max", "absl.flags.DEFINE_integer", "numpy.stack", "functools.partial", "tensorflow.constant", "te...
[((1315, 1389), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""dataset"""', '"""cifar10.1@4000-5000"""', '"""Data to train on."""'], {}), "('dataset', 'cifar10.1@4000-5000', 'Data to train on.')\n", (1334, 1389), False, 'from absl import flags\n'), ((1390, 1448), 'absl.flags.DEFINE_integer', 'flags.DEFINE_int...
""" Comparing different samplers on a correlated bivariate normal distribution. This example will sample a bivariate normal with Metropolis, NUTS and DEMetropolis at two correlations (0, 0.9) and print out the effective sample sizes, runtime and normalized effective sampling rates. """ import numpy as np import time...
[ "pandas.DataFrame", "pymc3.Model", "pymc3.MvNormal.dist", "time.time", "pymc3.MvNormal", "numpy.mean", "numpy.array", "pymc3.Flat", "pymc3.ess", "pymc3.Potential", "theano.tensor.stack" ]
[((2144, 2179), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "(['p'] + names)"}), "(columns=['p'] + names)\n", (2156, 2179), True, 'import pandas as pd\n'), ((785, 795), 'pymc3.Model', 'pm.Model', ([], {}), '()\n', (793, 795), True, 'import pymc3 as pm\n'), ((841, 853), 'pymc3.Flat', 'pm.Flat', (['"""x"""'], {}...
import numpy as np def random_index_based_on_weights(weights, random_state): """ random_index_based_on_weights Generates a random index, based on index weights and a random generator instance. Parameters ---------- weights: list The weights of the centroid's indexes. ...
[ "numpy.sum" ]
[((475, 490), 'numpy.sum', 'np.sum', (['weights'], {}), '(weights)\n', (481, 490), True, 'import numpy as np\n')]
# Image Processing Intro import numpy as np import argparse import imutils import cv2 ap = argparse.ArgumentParser() ap.add_argument("-i","--image", required = True, help = "Path to image") args = vars(ap.parse_args()) image = cv2.imread(args["image"]) cv2.imshow("original",image) cv2.waitKey(0) M = np.float32([[1,0...
[ "argparse.ArgumentParser", "cv2.waitKey", "numpy.float32", "cv2.imread", "cv2.warpAffine", "imutils.translate", "cv2.imshow" ]
[((92, 117), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (115, 117), False, 'import argparse\n'), ((229, 254), 'cv2.imread', 'cv2.imread', (["args['image']"], {}), "(args['image'])\n", (239, 254), False, 'import cv2\n'), ((255, 284), 'cv2.imshow', 'cv2.imshow', (['"""original"""', 'image'], ...
import logging import os import shutil import sys # These have to be before we do any import from keras. It would be nice to be able to pass in a # value for this, but that makes argument passing a whole lot more complicated. If/when we change # how arguments work (e.g., loading a file), then we can think about sett...
[ "numpy.random.seed", "keras.backend.clear_session", "logging.basicConfig", "deep_qa.common.tee_logger.TeeLogger", "logging.FileHandler", "os.path.dirname", "deep_qa.common.checks.ensure_pythonhashseed_set", "logging.Formatter", "deep_qa.common.params.replace_none", "random.seed", "deep_qa.common...
[((372, 390), 'random.seed', 'random.seed', (['(13370)'], {}), '(13370)\n', (383, 390), False, 'import random\n'), ((391, 414), 'numpy.random.seed', 'numpy.random.seed', (['(1337)'], {}), '(1337)\n', (408, 414), False, 'import numpy\n'), ((1062, 1089), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__n...
# SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ # SPDX-FileCopyrightText: 2021 <NAME> # SPDX-License-Identifier: MIT import unittest import numpy as np import matplotlib.pyplot as plt from simpa.core.simulation_modules.reconstruction_module.reconstruction_utils import tukey_bandpass_filter...
[ "matplotlib.pyplot.title", "numpy.random.seed", "numpy.abs", "numpy.allclose", "simpa.core.simulation_modules.reconstruction_module.reconstruction_utils.tukey_bandpass_filtering", "numpy.sin", "numpy.arange", "matplotlib.pyplot.tight_layout", "simpa.core.simulation_modules.reconstruction_module.reco...
[((645, 655), 'simpa.utils.Settings', 'Settings', ([], {}), '()\n', (653, 655), False, 'from simpa.utils import Settings, Tags\n'), ((1002, 1056), 'simpa.core.device_digital_twins.LinearArrayDetectionGeometry', 'LinearArrayDetectionGeometry', ([], {'sampling_frequency_mhz': '(1)'}), '(sampling_frequency_mhz=1)\n', (103...
import numpy as np from numpy.testing import assert_array_equal import pytest from ProcessOptimizer import gp_minimize from ProcessOptimizer.benchmarks import bench1 from ProcessOptimizer.benchmarks import bench2 from ProcessOptimizer.benchmarks import bench3 from ProcessOptimizer.benchmarks import bench4 from Process...
[ "ProcessOptimizer.utils.cook_estimator", "pytest.mark.parametrize", "ProcessOptimizer.gp_minimize", "numpy.testing.assert_array_equal" ]
[((871, 912), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""search"""', 'SEARCH'], {}), "('search', SEARCH)\n", (894, 912), False, 'import pytest\n'), ((914, 957), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""acq"""', 'ACQUISITION'], {}), "('acq', ACQUISITION)\n", (937, 957), False, 'import...
""" A simple implementation for plotting a Probe or ProbeGroup using matplotlib. Depending on Probe.ndim, the plotting is done in 2D or 3D """ import numpy as np from matplotlib import path as mpl_path def plot_probe(probe, ax=None, contacts_colors=None, with_channel_index=False, with_contact_id=Fal...
[ "matplotlib.collections.PolyCollection", "mpl_toolkits.mplot3d.art3d.Poly3DCollection", "numpy.min", "matplotlib.pyplot.figure", "numpy.max", "numpy.array", "matplotlib.path.Path", "matplotlib.pyplot.subplots" ]
[((2230, 2296), 'matplotlib.collections.PolyCollection', 'PolyCollection', (['vertices'], {'color': 'contacts_colors'}), '(vertices, color=contacts_colors, **_contacts_kargs)\n', (2244, 2296), False, 'from matplotlib.collections import PolyCollection\n'), ((7429, 7452), 'numpy.min', 'np.min', (['positions[:, 0]'], {}),...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- '''display_analog2.py illustrates the general usage of package phypidaq prints and displays data read from 2 analog channels ''' import time, numpy as np # import module controlling readout device from phypidaq.ADS1115Config import * # import display from phypi...
[ "numpy.array", "time.time" ]
[((689, 709), 'numpy.array', 'np.array', (['[0.0, 0.0]'], {}), '([0.0, 0.0])\n', (697, 709), True, 'import time, numpy as np\n'), ((782, 793), 'time.time', 'time.time', ([], {}), '()\n', (791, 793), False, 'import time, numpy as np\n'), ((885, 896), 'time.time', 'time.time', ([], {}), '()\n', (894, 896), False, 'import...
""" tsp.py: read standard instances of the traveling salesman problem Functions provided: * read_tsplib - read a symmetric tsp instance Copyright (c) by <NAME> and <NAME>, 2012 """ import gzip import math import numpy as np def distL2(x1,y1,x2,y2): """Compute the L2-norm (Euclidean) distance between t...
[ "gzip.open", "math.sqrt", "numpy.zeros", "math.acos", "math.cos" ]
[((1278, 1315), 'math.sqrt', 'math.sqrt', (['((xd * xd + yd * yd) / 10.0)'], {}), '((xd * xd + yd * yd) / 10.0)\n', (1287, 1315), False, 'import math\n'), ((2087, 2110), 'math.cos', 'math.cos', (['(long1 - long2)'], {}), '(long1 - long2)\n', (2095, 2110), False, 'import math\n'), ((2120, 2141), 'math.cos', 'math.cos', ...
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ "tensorflow.test.main", "tensorflow.python.framework.test_util.run_in_graph_and_eager_modes", "tensorflow.ones", "tensorflow.TensorShape", "numpy.array", "tensorflow_probability.python.bijectors.FillTriangular" ]
[((1124, 1164), 'tensorflow.python.framework.test_util.run_in_graph_and_eager_modes', 'test_util.run_in_graph_and_eager_modes', ([], {}), '()\n', (1162, 1164), False, 'from tensorflow.python.framework import test_util\n'), ((1698, 1738), 'tensorflow.python.framework.test_util.run_in_graph_and_eager_modes', 'test_util.r...
""" Optuna example that optimizes a classifier configuration for cancer dataset using LightGBM. In this example, we optimize the validation accuracy of cancer detection using LightGBM. We optimize both the choice of booster model and their hyperparameters. We have following two ways to execute this example: (1) Exec...
[ "lightgbm.train", "lightgbm.Dataset", "sklearn.model_selection.train_test_split", "numpy.rint", "optuna.create_study" ]
[((1065, 1111), 'sklearn.model_selection.train_test_split', 'train_test_split', (['data', 'target'], {'test_size': '(0.25)'}), '(data, target, test_size=0.25)\n', (1081, 1111), False, 'from sklearn.model_selection import train_test_split\n'), ((1125, 1160), 'lightgbm.Dataset', 'lgb.Dataset', (['train_x'], {'label': 'tr...
""" ============================ Simple Differential Rotation ============================ The Sun is known to rotate differentially, meaning that the rotation rate near the poles (rotation period of approximately 35 days) is not the same as the rotation rate near the equator (rotation period of approximately 25 days)...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.xlim", "numpy.zeros_like", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "sunpy.physics.differential_rotation.solar_rotate_coordinate", "astropy.time.TimeDelta", "matplotlib.pyplot.figure", "numpy.sin", "numpy.arang...
[((1449, 1461), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1459, 1461), True, 'import matplotlib.pyplot as plt\n'), ((1546, 1562), 'matplotlib.pyplot.ylim', 'plt.ylim', (['(38)', '(24)'], {}), '(38, 24)\n', (1554, 1562), True, 'import matplotlib.pyplot as plt\n'), ((1631, 1658), 'matplotlib.pyplot.xla...
""" Copyright 2020 The OneFlow 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 applicable law or agr...
[ "unittest.main", "oneflow.compatible.single_client.function_config", "oneflow.compatible.single_client.FixedTensorDef", "oneflow.compatible.single_client.clear_default_session", "numpy.ones", "oneflow.compatible.single_client.global_function", "numpy.random.random", "oneflow.compatible.single_client.m...
[((689, 711), 'oneflow.compatible.single_client.function_config', 'flow.function_config', ([], {}), '()\n', (709, 711), True, 'from oneflow.compatible import single_client as flow\n'), ((3370, 3385), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3383, 3385), False, 'import unittest\n'), ((1214, 1242), 'oneflow.c...
# 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...
[ "logging.StreamHandler", "nums.core.compute.compute_manager.ComputeManager.create", "nums.core.systems.systems.SerialSystem", "nums.core.compute.compute_manager.ComputeManager.destroy", "numpy.product", "nums.core.systems.filesystem.FileSystem", "nums.core.systems.systems.RaySystem", "nums.core.array....
[((2591, 2649), 'nums.core.compute.compute_manager.ComputeManager.create', 'ComputeManager.create', (['system', 'compute_module', 'device_grid'], {}), '(system, compute_module, device_grid)\n', (2612, 2649), False, 'from nums.core.compute.compute_manager import ComputeManager\n'), ((2659, 2673), 'nums.core.systems.file...
""" Copyright (C) 2019 <NAME>, ETH Zurich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
[ "tensorflow.python.keras.layers.Dense", "tensorflow.keras.backend.squeeze", "tensorflow.keras.backend.int_shape", "numpy.isclose", "tensorflow.python.keras.layers.BatchNormalization", "tensorflow.python.keras.layers.Dropout", "tensorflow.python.keras.layers.Embedding" ]
[((2529, 2553), 'tensorflow.keras.backend.int_shape', 'K.int_shape', (['input_layer'], {}), '(input_layer)\n', (2540, 2553), True, 'import tensorflow.keras.backend as K\n'), ((3096, 3187), 'tensorflow.python.keras.layers.Embedding', 'Embedding', (['self.embedding_size', 'self.embedding_dimension'], {'input_length': 'in...
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt y = np.arange(0, 11) ** 3 plt.plot(y, 'r') plt.axis([0, 10, -50, 1050]) plt.show()
[ "numpy.arange", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.plot" ]
[((102, 118), 'matplotlib.pyplot.plot', 'plt.plot', (['y', '"""r"""'], {}), "(y, 'r')\n", (110, 118), True, 'import matplotlib.pyplot as plt\n'), ((119, 147), 'matplotlib.pyplot.axis', 'plt.axis', (['[0, 10, -50, 1050]'], {}), '([0, 10, -50, 1050])\n', (127, 147), True, 'import matplotlib.pyplot as plt\n'), ((148, 158)...
from typing import List import numpy as np import torch import torch.nn as nn from sklearn.metrics.pairwise import cosine_similarity from transformers import AutoModel, AutoTokenizer from transformers.models.bert.modeling_bert import BertModel from transformers.models.bert.tokenization_bert_fast import BertTokenizerFas...
[ "sklearn.metrics.pairwise.cosine_similarity", "numpy.argmax", "transformers.AutoModel.from_pretrained", "transformers.AutoTokenizer.from_pretrained", "torch.cuda.is_available", "numpy.array", "torch.no_grad" ]
[((581, 622), 'transformers.AutoTokenizer.from_pretrained', 'AutoTokenizer.from_pretrained', (['MODEL_NAME'], {}), '(MODEL_NAME)\n', (610, 622), False, 'from transformers import AutoModel, AutoTokenizer\n'), ((642, 679), 'transformers.AutoModel.from_pretrained', 'AutoModel.from_pretrained', (['MODEL_NAME'], {}), '(MODE...
""" Unit tests to verify mcda module. """ import unittest import pymcdm import numpy as np from mcda import MCDA, SortingType from utility_rank import UtilityNormalization, NormalizationMethod class TestMCDA(unittest.TestCase): """ Unit test class for testing mcda module """ def setUp(self): s...
[ "unittest.main", "pymcdm.methods.PROMETHEE_II", "mcda.MCDA", "numpy.testing.assert_array_equal", "mcda.SortingType", "numpy.min", "numpy.max", "numpy.array", "pymcdm.helpers.rrankdata", "utility_rank.UtilityNormalization", "pymcdm.helpers.rankdata", "numpy.testing.assert_array_almost_equal", ...
[((5292, 5307), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5305, 5307), False, 'import unittest\n'), ((334, 382), 'numpy.array', 'np.array', (['[0.039, 0.373, 0.0572, 0.0556, 0.4753]'], {}), '([0.039, 0.373, 0.0572, 0.0556, 0.4753])\n', (342, 382), True, 'import numpy as np\n'), ((454, 528), 'numpy.array', 'n...
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
[ "unittest.main", "qiskit.QuantumCircuit", "qiskit.circuit.library.templates.template_nct_2a_2", "qiskit.converters.circuit_to_dagdependency.circuit_to_dagdependency", "qiskit.circuit.Parameter", "qiskit.circuit.library.templates.template_nct_5a_3", "qiskit.converters.circuit_to_dag.circuit_to_dag", "n...
[((12752, 12767), 'unittest.main', 'unittest.main', ([], {}), '()\n', (12765, 12767), False, 'import unittest\n'), ((1484, 1502), 'qiskit.QuantumRegister', 'QuantumRegister', (['(3)'], {}), '(3)\n', (1499, 1502), False, 'from qiskit import QuantumRegister, QuantumCircuit\n'), ((1524, 1542), 'qiskit.QuantumCircuit', 'Qu...
from rl_with_teachers.teachers.base import TeacherPolicy import numpy as np class OptimalPickPlaceAgent(TeacherPolicy): """ For Fetch reach environment with single start and goal. This agent reaches for the goal position unconditionally. """ def __init__(self, goal, noise=None): self.goal =...
[ "numpy.abs", "numpy.max", "numpy.array", "numpy.linalg.norm", "numpy.concatenate" ]
[((2103, 2126), 'numpy.linalg.norm', 'np.linalg.norm', (['delta_x'], {}), '(delta_x)\n', (2117, 2126), True, 'import numpy as np\n'), ((2388, 2411), 'numpy.linalg.norm', 'np.linalg.norm', (['delta_x'], {}), '(delta_x)\n', (2402, 2411), True, 'import numpy as np\n'), ((2687, 2710), 'numpy.linalg.norm', 'np.linalg.norm',...
import logging from comprex.code_table import CT import numpy as np rng = np.random.RandomState(2018) class FeatureSet: def __init__(self, features_list, patterns_list, features_usage_count, n, X=None, grouped=N...
[ "numpy.log2", "logging.StreamHandler", "numpy.random.RandomState", "logging.Formatter", "comprex.code_table.CT", "logging.getLogger" ]
[((75, 102), 'numpy.random.RandomState', 'np.random.RandomState', (['(2018)'], {}), '(2018)\n', (96, 102), True, 'import numpy as np\n'), ((502, 529), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (519, 529), False, 'import logging\n'), ((3281, 3328), 'comprex.code_table.CT', 'CT', (['se...
import torch import librosa import numpy as np from kospeech.models import ResnetVADModel class VoiceActivityDetection(object): """ Voice activity detection (VAD), also known as speech activity detection or speech detection, is the detection of the presence or absence of human speech, used in speech proc...
[ "kospeech.models.ResnetVADModel", "librosa.feature.rms", "librosa.feature.delta", "numpy.asarray", "torch.load", "numpy.transpose", "librosa.feature.melspectrogram", "numpy.expand_dims", "numpy.array", "librosa.load", "torch.max", "torch.device", "numpy.memmap", "librosa.feature.mfcc", "...
[((715, 731), 'kospeech.models.ResnetVADModel', 'ResnetVADModel', ([], {}), '()\n', (729, 731), False, 'from kospeech.models import ResnetVADModel\n'), ((1037, 1141), 'librosa.feature.mfcc', 'librosa.feature.mfcc', ([], {'y': 'signal', 'sr': 'self.sample_rate', 'n_mfcc': 'self.n_mfcc', 'n_fft': 'size', 'hop_length': 's...
import cv2 import numpy image = cv2.imread('images/lab3.6.in.jpg') grayScale = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) for x in range(1, 30, 5): kernel = numpy.ones((x, x), numpy.uint8) top_hat = cv2.morphologyEx(image, cv2.MORPH_TOPHAT, kernel) cv2.imwrite("images/lab3.6.out_{}.jpg".format(x), top_hat)
[ "cv2.cvtColor", "cv2.imread", "cv2.morphologyEx", "numpy.ones" ]
[((33, 67), 'cv2.imread', 'cv2.imread', (['"""images/lab3.6.in.jpg"""'], {}), "('images/lab3.6.in.jpg')\n", (43, 67), False, 'import cv2\n'), ((80, 119), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '(image, cv2.COLOR_BGR2GRAY)\n', (92, 119), False, 'import cv2\n'), ((159, 190), 'numpy.ones', ...
""" pyndl.ndl --------- *pyndl.ndl* provides functions in order to train NDL models """ from collections import defaultdict, OrderedDict import copy import getpass import os from queue import Queue import socket import sys import tempfile import threading import time import warnings import cython import pandas as pd...
[ "sys.platform.startswith", "getpass.getuser", "time.strftime", "collections.defaultdict", "sys.stdout.flush", "os.path.join", "tempfile.TemporaryDirectory", "warnings.simplefilter", "time.process_time", "threading.Lock", "socket.gethostname", "threading.Thread", "copy.deepcopy", "os.path.b...
[((550, 601), 'warnings.simplefilter', 'warnings.simplefilter', (['"""always"""', 'DeprecationWarning'], {}), "('always', DeprecationWarning)\n", (571, 601), False, 'import warnings\n'), ((484, 517), 'sys.platform.startswith', 'sys.platform.startswith', (['"""darwin"""'], {}), "('darwin')\n", (507, 517), False, 'import...
''' <NAME>, <NAME> MSc student in Artificial Intelligence @ Alma Mater Studiorum, University of Bologna March, 2021 ''' from pycocotools.coco import COCO import os import numpy as np from PIL import Image from tqdm import tqdm from shutil import copyfile # Choose the right path annFile = './train/annotations.json' #...
[ "os.makedirs", "numpy.zeros", "os.path.exists", "PIL.Image.fromarray", "pycocotools.coco.COCO", "os.path.isfile", "shutil.copyfile", "os.path.join", "os.listdir" ]
[((373, 386), 'pycocotools.coco.COCO', 'COCO', (['annFile'], {}), '(annFile)\n', (377, 386), False, 'from pycocotools.coco import COCO\n'), ((647, 674), 'os.listdir', 'os.listdir', (['image_directory'], {}), '(image_directory)\n', (657, 674), False, 'import os\n'), ((1596, 1629), 'os.listdir', 'os.listdir', (['"""./tra...
import keras from keras.layers import Activation,Dense from keras.models import Sequential import numpy as np def parse_acas_nnet(filename, h5name): f = open('{}.nnet'.format(filename), 'r') """ Read comment lines """ line = f.readline() while line[0] == '/': line = f.readline() ""...
[ "keras.models.Sequential", "keras.layers.Dense", "numpy.empty" ]
[((1971, 1983), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1981, 1983), False, 'from keras.models import Sequential\n'), ((1007, 1046), 'numpy.empty', 'np.empty', ([], {'shape': 'shape', 'dtype': 'np.float32'}), '(shape=shape, dtype=np.float32)\n', (1015, 1046), True, 'import numpy as np\n'), ((1062, 1...
import logging import numpy as np from ..common.zndsolver import ZNDSolver from .config import Config from ..common.scaleconverter import ScaleConverter from .solution import Solution class RHSEvaluator(object): """Evaluate the right-hand side for the linearized Euler1D problem. Parameters ---------- ...
[ "numpy.copy", "logging.getLogger", "numpy.sqrt" ]
[((654, 681), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (671, 681), False, 'import logging\n'), ((2311, 2349), 'numpy.sqrt', 'np.sqrt', (['(gamma * znd.p[-1] * znd.v[-1])'], {}), '(gamma * znd.p[-1] * znd.v[-1])\n', (2318, 2349), True, 'import numpy as np\n'), ((4152, 4175), 'numpy.c...
""" =============================================== vidgear library source-code is deployed under the Apache 2.0 License: Copyright (c) 2019 <NAME>(@abhiTronix) <<EMAIL>> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may ob...
[ "requests.packages.urllib3.util.retry.Retry", "cv2.putText", "os.path.basename", "requests.Session", "cv2.getTextSize", "numpy.zeros", "os.path.exists", "logging.getLogger", "os.path.join", "os.listdir", "cv2.resize" ]
[((1283, 1312), 'logging.getLogger', 'log.getLogger', (['"""Helper_Async"""'], {}), "('Helper_Async')\n", (1296, 1312), True, 'import logging as log\n'), ((2655, 2689), 'numpy.zeros', 'np.zeros', (['frame.shape', 'frame.dtype'], {}), '(frame.shape, frame.dtype)\n', (2663, 2689), True, 'import numpy as np\n'), ((4708, 4...
""" This example displays the routine used to obtain a proper result from a FFT-analysis Choosing a sampling space T as a certain particle of 2 * pi or many samples will result in best signal. Also a number of samples equal to a power of 2 (e.g. 16,32,64 ...) wil improve the results Just the first part {range 0...
[ "scipy.fftpack.rfft", "matplotlib.pyplot.show", "numpy.abs", "numpy.power", "numpy.sin", "numpy.arange", "numpy.linspace", "matplotlib.pyplot.subplots", "numpy.sqrt" ]
[((1194, 1236), 'numpy.linspace', 'np.linspace', (['(0)', '(2)', '(2 * f_s)'], {'endpoint': '(False)'}), '(0, 2, 2 * f_s, endpoint=False)\n', (1205, 1236), True, 'import numpy as np\n'), ((1283, 1297), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1295, 1297), True, 'import matplotlib.pyplot as plt\n...
from __future__ import absolute_import, division, unicode_literals import numpy as np import param from bokeh.models import ColumnDataSource from bokeh.models.widgets import ( DataTable, TableColumn, NumberEditor, NumberFormatter, DateFormatter, DateEditor, StringFormatter, StringEditor, IntEditor ) from ..v...
[ "param.Integer", "bokeh.models.ColumnDataSource", "param.List", "bokeh.models.widgets.NumberEditor", "bokeh.models.widgets.StringEditor", "bokeh.models.widgets.NumberFormatter", "bokeh.models.ColumnDataSource.from_df", "param.Dict", "param.Boolean", "param.Parameter", "numpy.asarray", "bokeh.m...
[((443, 601), 'param.Dict', 'param.Dict', ([], {'default': '{}', 'doc': '"""\n Bokeh CellEditor to use for a particular column\n (overrides the default chosen based on the type)."""'}), '(default={}, doc=\n """\n Bokeh CellEditor to use for a particular column\n (overrides the default cho...
""" .. role:: bash(code) :language: bash This is a test module for the Random Multitone Signal Generator. |br| It tests the generator with a number of test cases, and analyzes all of the generated signals. |br| The following tests are performed on the generated signals: - if the number of generated signals is c...
[ "numpy.abs", "numpy.sum", "rxcs.console.info", "rxcs.console.module_progress", "numpy.fft.fftn", "numpy.zeros", "numpy.angle", "numpy.isnan", "rxcs.sig.randMult", "numpy.argsort", "numpy.sort", "numpy.isinf", "numpy.array", "numpy.arange", "numpy.round", "rxcs.console.note", "rxcs.co...
[((2767, 2852), 'rxcs.console.progress', 'rxcs.console.progress', (['"""Function under test"""', '"""Random multitone signal generator"""'], {}), "('Function under test',\n 'Random multitone signal generator')\n", (2788, 2852), False, 'import rxcs\n'), ((3081, 3112), 'rxcs.console.info', 'rxcs.console.info', (['"""c...
""" Experiments with PCA source code to duplicate results with numpy.svd >>> from nlpia.book.examples.ch04_catdog_lsa_sorted import lsa_models, prettify_tdm >>> bow_svd, tfidf_svd = lsa_models() # <1> >>> prettify_tdm(**bow_svd) lion dog nyc cat love apple text 0 ...
[ "numpy.abs", "numpy.searchsorted", "six.moves.xrange", "numpy.linalg.svd", "numpy.mean", "numpy.array" ]
[((4727, 5645), 'numpy.array', 'np.array', (['[[-0.09090909, -0.09090909, -0.09090909, -0.09090909, -0.09090909, -\n 0.09090909, -0.09090909, 0.90909091, -0.09090909, -0.09090909, -\n 0.09090909], [-0.09090909, -0.09090909, -0.09090909, -0.09090909, -\n 0.09090909, -0.09090909, -0.09090909, -0.09090909, -0.090...
import numpy as onp import autograd.numpy as np from autograd import grad try: from autograd.core import vspace, VJPNode, backward_pass from autograd.tracer import trace, new_box MASTER_BRANCH = False except ImportError: from autograd.core import (vspace, forward_pass, backward_pass, ...
[ "autograd.numpy.sum", "autograd.numpy.dot", "autograd.core.forward_pass", "autograd.tracer.new_box", "autograd.core.vspace", "autograd.numpy.random.randn", "autograd.numpy.array", "autograd.grad", "autograd.numpy.exp", "autograd.core.new_progenitor", "numpy.exp", "autograd.core.backward_pass",...
[((2064, 2091), 'autograd.numpy.array', 'np.array', (['[[1.0, 2.0, 3.0]]'], {}), '([[1.0, 2.0, 3.0]])\n', (2072, 2091), True, 'import autograd.numpy as np\n'), ((1495, 1504), 'autograd.numpy.sum', 'np.sum', (['x'], {}), '(x)\n', (1501, 1504), True, 'import autograd.numpy as np\n'), ((2048, 2059), 'autograd.core.vspace'...