code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
""" Tests for cram.py """ import unittest import numpy as np import scipy.sparse as sp from opendeplete.integrator import CRAM16, CRAM48 class TestCram(unittest.TestCase): """ Tests for cram.py Compares a few Mathematica matrix exponentials to CRAM16/CRAM48. """ def test_CRAM16(self): """ ...
[ "unittest.main", "scipy.sparse.csr_matrix", "numpy.array", "opendeplete.integrator.CRAM48", "numpy.linalg.norm", "opendeplete.integrator.CRAM16" ]
[((1069, 1084), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1082, 1084), False, 'import unittest\n'), ((355, 375), 'numpy.array', 'np.array', (['[1.0, 1.0]'], {}), '([1.0, 1.0])\n', (363, 375), True, 'import numpy as np\n'), ((390, 432), 'scipy.sparse.csr_matrix', 'sp.csr_matrix', (['[[-1.0, 0.0], [-2.0, -3.0]...
import numpy as np import datetime from datetime import timedelta import matplotlib.pyplot as plt import matplotlib.dates as mdates import matplotlib.cbook as cbook from util.app_util import AppUtil from matplotlib.font_manager import FontProperties class CapitalCurve(object): @staticmethod def draw_curve_demo...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "util.app_util.AppUtil.format_date", "matplotlib.font_manager.FontProperties", "matplotlib.pyplot.plot", "util.app_util.AppUtil.parse_date", "matplotlib.dates.WeekdayLocator", "matplotlib.dates.DateFormatter", "datetime.datetime.strptime", "date...
[((377, 400), 'util.app_util.AppUtil.get_today_obj', 'AppUtil.get_today_obj', ([], {}), '()\n', (398, 400), False, 'from util.app_util import AppUtil\n'), ((421, 451), 'util.app_util.AppUtil.parse_date', 'AppUtil.parse_date', (['"""20190101"""'], {}), "('20190101')\n", (439, 451), False, 'from util.app_util import AppU...
""" Converter for the Kojak XL-MS search engine output formats. """ from itertools import chain import numpy as np import pandas as pd def kojak(kojak_txt: str, perc_inter: str, perc_intra: str, out_file: str, version: str = "2.0-dev", max_charge: int = 8, decoy_prefix: str = "decoy_", to_pin: bool...
[ "pandas.DataFrame", "pandas.read_csv", "pandas.merge", "numpy.finfo", "pandas.Series", "itertools.chain.from_iterable", "pandas.concat" ]
[((1610, 1635), 'pandas.concat', 'pd.concat', (['[inter, intra]'], {}), '([inter, intra])\n', (1619, 1635), True, 'import pandas as pd\n'), ((1649, 1725), 'pandas.merge', 'pd.merge', (['perc_df', 'kojak_df'], {'how': '"""inner"""', 'on': 'key_cols', 'validate': '"""one_to_one"""'}), "(perc_df, kojak_df, how='inner', on...
import numpy as np import pandas as pd import re from skimage import io from skimage.util import img_as_float from skimage.measure import label, regionprops, regionprops_table from skimage.color import label2rgb import matplotlib.pyplot as plt from typing import List import time def measureTime(func): def wrapper(...
[ "pandas.DataFrame", "skimage.measure.regionprops_table", "pandas.read_csv", "numpy.zeros", "time.perf_counter", "numpy.any", "skimage.measure.label", "numpy.array", "numpy.linalg.norm", "skimage.io.imread", "re.compile" ]
[((1617, 1639), 'numpy.array', 'np.array', (['barcode_list'], {}), '(barcode_list)\n', (1625, 1639), True, 'import numpy as np\n'), ((2904, 2925), 'pandas.read_csv', 'pd.read_csv', (['codebook'], {}), '(codebook)\n', (2915, 2925), True, 'import pandas as pd\n'), ((4533, 4566), 're.compile', 're.compile', (['f"""{img_pr...
import numpy as np import pandas as pd def bin_array_along_axis(x, num_bins, axis): """ Creates equally spaced bins with respective labels for the bins from a given array x for each column along given axis. num_bins gives the number of created bins. x: Array to bin. num_bins: the number of bi...
[ "numpy.stack", "pandas.DataFrame", "numpy.empty", "numpy.empty_like", "pandas.cut", "numpy.linspace" ]
[((860, 895), 'numpy.empty', 'np.empty', (['(x.shape[axis], num_bins)'], {}), '((x.shape[axis], num_bins))\n', (868, 895), True, 'import numpy as np\n'), ((2369, 2414), 'numpy.empty', 'np.empty', (['(num_prop1, num_prop2, num_bins, 2)'], {}), '((num_prop1, num_prop2, num_bins, 2))\n', (2377, 2414), True, 'import numpy ...
import pickle import torch import time import glob from torch import nn, optim from torchvision import transforms from torch.utils.data import Dataset, DataLoader from PIL import Image import numpy as np from skimage.color import rgb2lab, lab2rgb from matplotlib import cm import matplotlib.pyplot as plt fro...
[ "torch.nn.Dropout", "numpy.random.seed", "torch.cat", "matplotlib.pyplot.figure", "pickle.load", "torch.nn.init.constant_", "glob.glob", "torch.no_grad", "skimage.color.rgb2lab", "torch.nn.MSELoss", "torch.nn.init.kaiming_normal_", "torch.utils.data.DataLoader", "torch.load", "numpy.random...
[((620, 641), 'pickle.load', 'pickle.load', (['train_in'], {}), '(train_in)\n', (631, 641), False, 'import pickle\n'), ((902, 943), 'glob.glob', 'glob.glob', (["('E:/COCO/train2014' + '/*.jpg')"], {}), "('E:/COCO/train2014' + '/*.jpg')\n", (911, 943), False, 'import glob\n'), ((981, 1000), 'numpy.random.seed', 'np.rand...
import os import numpy as np import torch import matplotlib.pyplot as plt import matplotlib from lib.growth_net import GrowthNet import lib.utils as utils from lib.viz_scrna import trajectory_to_video, save_vectors from lib.viz_scrna import ( save_trajectory_density, save_2d_trajectory, save_2d_trajectory_...
[ "matplotlib.cm.get_cmap", "matplotlib.pyplot.clf", "torch.cat", "matplotlib.pyplot.figure", "train_misc.set_cnf_options", "dataset.SCData.factory", "torch.arange", "numpy.exp", "torch.device", "torch.no_grad", "os.path.join", "matplotlib.colors.LinearSegmentedColormap.from_list", "numpy.mesh...
[((1169, 1193), 'numpy.linspace', 'np.linspace', (['(-4)', '(4)', 'npts'], {}), '(-4, 4, npts)\n', (1180, 1193), True, 'import numpy as np\n'), ((1207, 1230), 'numpy.meshgrid', 'np.meshgrid', (['side', 'side'], {}), '(side, side)\n', (1218, 1230), True, 'import numpy as np\n'), ((9340, 9375), 'os.path.join', 'os.path.j...
import torch import numpy as np import v2.mesh_op as mesh_op from lie_learn.spaces import S2 DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu' def e2f(torch_edges, torch_faces): """ Calculate the intersection point from the edge to the face Args: torch_edges (Tensor): a m x 2 x 3 array, m is ...
[ "torch.mean", "numpy.stack", "torch.ones", "torch.stack", "torch.diagonal", "lie_learn.spaces.S2.meshgrid", "torch.norm", "numpy.einsum", "numpy.ones", "numpy.zeros", "lie_learn.spaces.S2.change_coordinates", "torch.cuda.is_available", "numpy.linalg.norm", "v2.mesh_op.rotmat", "torch.cro...
[((114, 139), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (137, 139), False, 'import torch\n'), ((658, 688), 'torch.mean', 'torch.mean', (['torch_faces'], {'dim': '(1)'}), '(torch_faces, dim=1)\n', (668, 688), False, 'import torch\n'), ((803, 822), 'torch.cross', 'torch.cross', (['e1', 'e2']...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import sys from random import shuffle import numpy as np parser = argparse.ArgumentParser() parser.add_argument( '--file', type=str, required=1, help='Absolute path to the csv f...
[ "numpy.asarray", "argparse.ArgumentParser" ]
[((204, 229), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (227, 229), False, 'import argparse\n'), ((856, 875), 'numpy.asarray', 'np.asarray', (['samples'], {}), '(samples)\n', (866, 875), True, 'import numpy as np\n')]
import sys from os import path current_dir = path.dirname(path.abspath(__file__)) while path.split(current_dir)[-1] != r'Heron': current_dir = path.dirname(current_dir) sys.path.insert(0, path.dirname(current_dir)) import numpy as np import h5py from datetime import datetime from Heron.communication....
[ "os.path.abspath", "h5py.File", "numpy.copy", "os.path.dirname", "Heron.communication.socket_for_serialization.Socket.reconstruct_array_from_bytes_message", "numpy.dtype", "numpy.expand_dims", "Heron.general_utils.start_the_sink_worker_process", "numpy.array", "os.path.split", "datetime.datetime...
[((64, 86), 'os.path.abspath', 'path.abspath', (['__file__'], {}), '(__file__)\n', (76, 86), False, 'from os import path\n'), ((155, 180), 'os.path.dirname', 'path.dirname', (['current_dir'], {}), '(current_dir)\n', (167, 180), False, 'from os import path\n'), ((201, 226), 'os.path.dirname', 'path.dirname', (['current_...
import math import numpy as np import scipy as sp from scipy import pi as PI import scipy.integrate as integrate J = sp.sqrt(-1) ''' ecgsyn implementation function [s, ipeaks] = ecgsyn(sfecg,N,Anoise,hrmean,hrstd,lfhfratio,sfint,ti,ai,bi) sfecg: sampling freq ecg N: heart beat number anoise: additive noise hrmean h...
[ "scipy.cos", "numpy.argmax", "numpy.ones", "scipy.random.rand", "numpy.arange", "scipy.log2", "numpy.exp", "numpy.interp", "scipy.ceil", "numpy.round", "scipy.exp", "scipy.integrate.odeint", "numpy.max", "scipy.arctan2", "numpy.add", "math.sqrt", "numpy.remainder", "numpy.min", "...
[((120, 131), 'scipy.sqrt', 'sp.sqrt', (['(-1)'], {}), '(-1)\n', (127, 131), True, 'import scipy as sp\n'), ((1881, 1903), 'math.sqrt', 'math.sqrt', (['(hrmean / 60)'], {}), '(hrmean / 60)\n', (1890, 1903), False, 'import math\n'), ((1918, 1935), 'math.sqrt', 'math.sqrt', (['hrfact'], {}), '(hrfact)\n', (1927, 1935), F...
import numpy as np from multiprocessing.dummy import Pool as ThreadPool from math import exp try: import numba as nb nonumba = False except: nonumba = True def avgKernel(envKernelDict,zeta): ''' Compute the average global kernel. :param envKernelDict: dictionary of environmental kernel whose ...
[ "math.exp", "numpy.sum", "multiprocessing.dummy.Pool", "numpy.power", "numpy.zeros", "numpy.ones", "numpy.array", "numpy.exp", "numba.jit", "numpy.dot", "numpy.diag", "numba.double", "numpy.sqrt" ]
[((578, 612), 'numpy.array', 'np.array', (['[key[0] for key in keys]'], {}), '([key[0] for key in keys])\n', (586, 612), True, 'import numpy as np\n'), ((624, 658), 'numpy.array', 'np.array', (['[key[1] for key in keys]'], {}), '([key[1] for key in keys])\n', (632, 658), True, 'import numpy as np\n'), ((722, 756), 'num...
import warnings import spikewarp as sw """ ANGLE HELPERS Helper functions for calculating bootstrap correlation angles and confidence intervals """ import math import numpy as np from sklearn.decomposition import PCA def run_pca_and_get_positive_first_component_angle(spikes): pca = PCA(n_components=2) pca.fit_t...
[ "scipy.stats.combine_pvalues", "numpy.linalg.eigvals", "shapely.geometry.point.Point", "numpy.arctan2", "math.atan2", "spikewarp.run_pca_and_get_positive_first_component_angle", "spikewarp.string_with_pval_lessthan_to_lower_limit", "numpy.mean", "spikewarp.convert_expanded_360_xy_to_180_angle_degree...
[((290, 309), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': '(2)'}), '(n_components=2)\n', (293, 309), False, 'from sklearn.decomposition import PCA\n'), ((653, 697), 'math.radians', 'math.radians', (['pca_angle_half_expanded_to_360'], {}), '(pca_angle_half_expanded_to_360)\n', (665, 697), False, 'import ma...
import cv2 import numpy as np from pasportrecogniotion.util.docdescription import DocDescription from pasportrecogniotion.util.pipeline import Pipeline from datavalidation.passportdata import PassportData def show(img): cv2.imshow("test", img) cv2.waitKey(0) class OpenCVPreProc(object): """Preperocessing...
[ "cv2.GaussianBlur", "numpy.absolute", "cv2.waitKey", "cv2.getStructuringElement", "cv2.cvtColor", "cv2.morphologyEx", "cv2.threshold", "numpy.min", "numpy.max", "pasportrecogniotion.util.docdescription.DocDescription", "datavalidation.passportdata.PassportData", "cv2.erode", "cv2.imshow", ...
[((225, 248), 'cv2.imshow', 'cv2.imshow', (['"""test"""', 'img'], {}), "('test', img)\n", (235, 248), False, 'import cv2\n'), ((253, 267), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (264, 267), False, 'import cv2\n'), ((453, 503), 'cv2.getStructuringElement', 'cv2.getStructuringElement', (['cv2.MORPH_RECT', ...
import numpy as np import pandas as pd import das_utils import constants as CC import re def testTableDefs(schema,tables): """ Function searches the dimensions of the tables to show cases where the same dimension is used in multiple recodes. The output is printed, and this function is useful for develo...
[ "pandas.DataFrame", "numpy.ndindex", "re.split", "das_utils.aslist", "numpy.zeros", "numpy.unique" ]
[((6357, 6385), 'das_utils.aslist', 'das_utils.aslist', (['querynames'], {}), '(querynames)\n', (6373, 6385), False, 'import das_utils\n'), ((2321, 2349), 'das_utils.aslist', 'das_utils.aslist', (['querynames'], {}), '(querynames)\n', (2337, 2349), False, 'import das_utils\n'), ((4409, 4437), 'das_utils.aslist', 'das_u...
import numpy from orangecontrib.shadow.als.widgets.gui.ow_als_generic_analyzer import ALSGenericAnalyzer class ALSCurvedElementAnalyzer(ALSGenericAnalyzer): name = "ALS Curved Element Analyzer" description = "Shadow Utility: ALS Curved Element Analyzer" icon = "icons/curved_element_analyzer.png" prio...
[ "numpy.abs", "numpy.sqrt" ]
[((3632, 3667), 'numpy.sqrt', 'numpy.sqrt', (['(AXMAJ ** 2 - AXMIN ** 2)'], {}), '(AXMAJ ** 2 - AXMIN ** 2)\n', (3642, 3667), False, 'import numpy\n'), ((3764, 3802), 'numpy.sqrt', 'numpy.sqrt', (['(1 - YCEN ** 2 / AXMAJ ** 2)'], {}), '(1 - YCEN ** 2 / AXMAJ ** 2)\n', (3774, 3802), False, 'import numpy\n'), ((3920, 394...
################## # Model Training # ################## # Imports import os import pandas as pd import numpy as np import joblib from sklearn.ensemble import ExtraTreesClassifier import yaml # Parameters params = { 'n_estimators': yaml.safe_load(open('params.yaml'))['train']['n_estimators'], 'max_leaf_nodes...
[ "sklearn.ensemble.ExtraTreesClassifier", "os.path.join", "os.makedirs", "numpy.ravel" ]
[((642, 815), 'sklearn.ensemble.ExtraTreesClassifier', 'ExtraTreesClassifier', ([], {'random_state': '(42)', 'n_jobs': '(-1)', 'n_estimators': "params['n_estimators']", 'max_leaf_nodes': "params['max_leaf_nodes']", 'max_features': "params['max_features']"}), "(random_state=42, n_jobs=-1, n_estimators=params[\n 'n_es...
import abc import math import numpy as np import numpy.fft as npf import scipy.linalg as spl """ Discrete to Continuous symbol mappers. TX architecture: discrete symbols -> [mapper] -> continuous symbols -> [modulator] -> continuous signal RX architecture: continuous signal -> [modulator] -> continuous symb...
[ "numpy.pad", "numpy.fft.ifft", "scipy.linalg.solve", "numpy.sum", "math.sqrt", "numpy.fft.fft", "numpy.zeros", "numpy.argmin", "numpy.fft.fftfreq", "numpy.arange", "numpy.exp", "numpy.eye", "numpy.broadcast_to", "numpy.concatenate" ]
[((14212, 14251), 'numpy.pad', 'np.pad', (['x', '(0, mapper._N_active_ch - r)'], {}), '(x, (0, mapper._N_active_ch - r))\n', (14218, 14251), True, 'import numpy as np\n'), ((18113, 18148), 'numpy.exp', 'np.exp', (['(-1.0j * 2 * np.pi * k * tau)'], {}), '(-1.0j * 2 * np.pi * k * tau)\n', (18119, 18148), True, 'import nu...
''' IKI Bangladesh (MIOASI): Plotting functions Plotting scripts and helper functions relating to the IKI Bangladesh project. Note: Python 3 compatible only Author: HS Created: 7/3/19 ''' import cartopy import cartopy.crs as ccrs import cartopy.geodesic as cgeo import iris import iris.plot as iplt import matplotlib...
[ "iris.plot.pcolormesh", "cartopy.mpl.ticker.LongitudeFormatter", "iris.util.mask_cube", "numpy.asarray", "cartopy.feature.NaturalEarthFeature", "numpy.sin", "numpy.linalg.norm", "cartopy.geodesic.Geodesic", "matplotlib.pyplot.gca", "cartopy.crs.PlateCarree", "numpy.cos", "cartopy.mpl.ticker.La...
[((1522, 1566), 'iris.util.mask_cube', 'iris.util.mask_cube', (['cube', '(cube.data <= vmin)'], {}), '(cube, cube.data <= vmin)\n', (1541, 1566), False, 'import iris\n'), ((1582, 1688), 'cartopy.feature.NaturalEarthFeature', 'cartopy.feature.NaturalEarthFeature', (['"""physical"""', '"""land"""', '"""10m"""'], {'edgeco...
""" .. moduleauthor:: <NAME> <<EMAIL>> """ from numpy import abs, exp, log, dot, sqrt, argmin, diagonal, ndarray, arange from numpy import zeros, ones, array, where, pi, diag, eye, maximum from numpy import sum as npsum from numpy.random import random from scipy.special import erf, erfcx from numpy.linalg import inv,...
[ "numpy.sum", "scipy.linalg.solve_triangular", "numpy.abs", "scipy.special.erfcx", "numpy.ones", "matplotlib.pyplot.figure", "numpy.exp", "numpy.diag", "numpy.linalg.solve", "scipy.optimize.minimize", "inspect.isclass", "matplotlib.pyplot.close", "itertools.product", "numpy.linalg.cholesky"...
[((2534, 2547), 'numpy.exp', 'exp', (['theta[0]'], {}), '(theta[0])\n', (2537, 2547), False, 'from numpy import abs, exp, log, dot, sqrt, argmin, diagonal, ndarray, arange\n'), ((2560, 2574), 'numpy.exp', 'exp', (['theta[1:]'], {}), '(theta[1:])\n', (2563, 2574), False, 'from numpy import abs, exp, log, dot, sqrt, argm...
# coding:utf-8 ''' Created on 2017/12/19 @author: sunyihuan ''' import pandas as pd import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from sklearn.model_selection import train_test_split import scipy.io as scio def one_hot(y, classes): # m, _ = y.reshape(-1, 1).shape return np.eye(cl...
[ "tensorflow.train.Coordinator", "tensorflow.contrib.layers.l2_regularizer", "tensorflow.train.shuffle_batch", "tensorflow.contrib.layers.flatten", "tensorflow.maximum", "tensorflow.reshape", "tensorflow.constant_initializer", "tensorflow.decode_raw", "tensorflow.Variable", "tensorflow.layers.max_p...
[((1212, 1236), 'tensorflow.reshape', 'tf.reshape', (['labels', '[-1]'], {}), '(labels, [-1])\n', (1222, 1236), True, 'import tensorflow as tf\n'), ((1299, 1325), 'tensorflow.gather', 'tf.gather', (['centers', 'labels'], {}), '(centers, labels)\n', (1308, 1325), True, 'import tensorflow as tf\n'), ((1580, 1609), 'tenso...
import os import numpy as np import sympy from matplotlib import pyplot as plt import scipy from datastorage import DataStorage as ds import datastorage from .. import undulator #from .abcd import from .optics import hard_aperture from .optics import lens from .useful_beams import id18h from ..crl import LensBlock, ...
[ "numpy.zeros_like", "numpy.abs", "numpy.floor_divide", "numpy.asarray", "datastorage.read", "os.path.isfile", "numpy.arange", "numpy.argwhere", "datastorage.DataStorage", "numpy.gradient" ]
[((2103, 2126), 'numpy.arange', 'np.arange', (['(5)', '(50.5)', '(0.5)'], {}), '(5, 50.5, 0.5)\n', (2112, 2126), True, 'import numpy as np\n'), ((2184, 2197), 'numpy.asarray', 'np.asarray', (['s'], {}), '(s)\n', (2194, 2197), True, 'import numpy as np\n'), ((2712, 2734), 'numpy.arange', 'np.arange', (['(0)', '(230)', '...
#T# relational operators are used to do relational operations, i.e. operations in which there is testing of the values of numbers, by comparing them against each other #T# the equality == operator compares if two numbers are equal a = 5; b = 3 bool1 = a == b # False a = 4; b = 4 bool1 = a == b # True #T# the not equa...
[ "numpy.less_equal", "numpy.less", "numpy.greater", "numpy.not_equal", "numpy.equal", "numpy.array", "numpy.array_equal", "numpy.greater_equal" ]
[((1436, 1475), 'numpy.array', 'np.array', (['[[6, 9, 4, 4], [8, 1, 9, 10]]'], {}), '([[6, 9, 4, 4], [8, 1, 9, 10]])\n', (1444, 1475), True, 'import numpy as np\n'), ((1483, 1522), 'numpy.array', 'np.array', (['[[6, 9, 4, 4], [8, 1, 9, 10]]'], {}), '([[6, 9, 4, 4], [8, 1, 9, 10]])\n', (1491, 1522), True, 'import numpy ...
import os import glob import math from functools import partial from multiprocessing import Pool from typing import Union, Optional, List, Tuple, Dict import xarray as xr import numpy as np from tqdm import tqdm from climart.data_wrangling.constants import INPUT_RAW_SUBDIR, DATA_CREATION_SEED from climart.data_wrang...
[ "climart.utils.utils.get_year_to_canam_files_dict", "climart.utils.utils.get_logger", "climart.utils.utils.compute_absolute_level_height", "xarray.open_dataset", "math.sin", "xarray.concat", "numpy.random.default_rng", "multiprocessing.Pool", "climart.utils.utils.compute_temperature_diff", "numpy....
[((684, 704), 'climart.utils.utils.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (694, 704), False, 'from climart.utils.utils import compute_absolute_level_height, get_year_to_canam_files_dict, get_logger, compute_temperature_diff\n'), ((3066, 3175), 'xarray.open_dataset', 'xr.open_dataset', (['input_f...
from config import paths import re import sys import os import tokens import numpy as np TOKEN_SPECIFICATION = {} # (token id, regex) # 0: TokenInfo('root', 1, 0, '\\sqrt{{{}}}'), TOKEN_SPECIFICATION[0] = r'sqrt' # 1: TokenInfo('fac', 1, 1, '{}!'), TOKEN_SPECIFICATION[1] = r'!' # 2: TokenInfo('max', 1, 2, 'max {}...
[ "numpy.sum", "re.finditer", "os.path.exists", "tokens.possibilities", "numpy.array", "os.scandir" ]
[((11807, 11839), 're.finditer', 're.finditer', (['TOKEN_REGEX', 'string'], {}), '(TOKEN_REGEX, string)\n', (11818, 11839), False, 'import re\n'), ((12119, 12140), 'os.scandir', 'os.scandir', (['directory'], {}), '(directory)\n', (12129, 12140), False, 'import os\n'), ((13696, 13724), 'os.scandir', 'os.scandir', (['pat...
# Copyright 2018 <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, software...
[ "numpy.pad", "pydrobert.kaldi.logging.register_logger_for_kaldi", "logging.StreamHandler", "pydrobert.kaldi.io.argparse.KaldiParser", "numpy.array", "pydrobert.kaldi.io.open", "logging.getLogger" ]
[((1108, 1197), 'pydrobert.kaldi.io.argparse.KaldiParser', 'KaldiParser', ([], {'description': 'normalize_feat_lens.__doc__', 'add_verbose': '(True)', 'logger': 'logger'}), '(description=normalize_feat_lens.__doc__, add_verbose=True,\n logger=logger)\n', (1119, 1197), False, 'from pydrobert.kaldi.io.argparse import ...
# Main script to run the PLAN tool import argparse import math import numpy as np import operator import os import pickle as pk import re import subprocess import sys import time from datetime import datetime from itertools import combinations from scipy.stats.stats import pearsonr from tqdm import tqdm from Verilog_...
[ "pickle.dump", "numpy.sum", "argparse.ArgumentParser", "numpy.abs", "scipy.stats.stats.pearsonr", "numpy.bitwise_xor", "pickle.load", "numpy.transpose", "numpy.linspace", "tqdm.tqdm", "math.isnan", "re.split", "datetime.datetime.today", "os.listdir", "Verilog_VCD.Verilog_VCD.parse_vcd", ...
[((865, 889), 'numpy.array', 'np.array', (['a'], {'dtype': '"""int"""'}), "(a, dtype='int')\n", (873, 889), True, 'import numpy as np\n'), ((1048, 1070), 'numpy.bitwise_xor', 'np.bitwise_xor', (['ip1', 'k'], {}), '(ip1, k)\n', (1062, 1070), True, 'import numpy as np\n'), ((2649, 2693), 'Verilog_VCD.Verilog_VCD.parse_vc...
import numpy as np import os import pickle from scipy import linalg from distutils.util import strtobool from inception import InceptionV3 import torchvision.transforms as transforms from transform import TranformDynamicRange import torch from dataset import TrainDataset from base_layer import BaseLayer import argparse...
[ "pickle.dump", "numpy.trace", "numpy.abs", "argparse.ArgumentParser", "torch.cat", "os.path.isfile", "numpy.mean", "pickle.load", "numpy.random.normal", "os.path.join", "datasource.get_dataloader", "numpy.isfinite", "numpy.cov", "numpy.diagonal", "base_layer.BaseLayer.restore_model", "...
[((5021, 5046), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5044, 5046), False, 'import argparse\n'), ((6636, 6697), 'datasource.get_dataloader', 'get_dataloader', (['opt.data_path', 'opt.resolution', 'opt.batch_size'], {}), '(opt.data_path, opt.resolution, opt.batch_size)\n', (6650, 6697),...
# %tensorflow_version 2.x from tensorflow.python.client import device_lib # print(device_lib.list_local_devices()) # <codecell> import numpy as np import tensorflow as tf from tensorflow.keras import layers import binary_net seed = 0 batch_size = 100 momentum = .9 units = 4096 # units = 2048 # units = 128 hidden_lay...
[ "tensorflow.random.set_seed", "binary_net.Dense", "tensorflow.one_hot", "numpy.random.seed", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Dropout", "tensorflow.keras.metrics.CategoricalAccuracy", "tensorflow.keras.Input", "tensorflow.keras.datasets.mnist.load_data", "tens...
[((550, 570), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (564, 570), True, 'import numpy as np\n'), ((571, 595), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['seed'], {}), '(seed)\n', (589, 595), True, 'import tensorflow as tf\n'), ((650, 701), 'tensorflow.keras.datasets.mnist.load_data...
#implemnet Logistic Regression via Numpy import numpy as np def initialize_with_zeros(dim): """ This function creates a vector of zeros of shape (dim, 1) for w and initializes b to 0. Argument: dim -- number of features in a given example Returns: w -- initialized vector of shape (di...
[ "numpy.sum", "numpy.log", "numpy.abs", "numpy.zeros", "numpy.exp", "numpy.squeeze", "numpy.dot" ]
[((396, 414), 'numpy.zeros', 'np.zeros', (['[dim, 1]'], {}), '([dim, 1])\n', (404, 414), True, 'import numpy as np\n'), ((1522, 1538), 'numpy.squeeze', 'np.squeeze', (['cost'], {}), '(cost)\n', (1532, 1538), True, 'import numpy as np\n'), ((3656, 3672), 'numpy.zeros', 'np.zeros', (['(1, m)'], {}), '((1, m))\n', (3664, ...
""" This is an attempt to recreate the deepmind DDQN algorithm to beat atari games: https://arxiv.org/pdf/1509.06461.pdf article and code that guided this attempt: https://towardsdatascience.com/tutorial-double-deep-q-learning-with-dueling-network-architectures-4c1b3fb7f756 https://github.com/fg91/Deep-Q-Learning/blob...
[ "argparse.ArgumentParser", "tensorflow.trainable_variables", "tensorflow.reset_default_graph", "numpy.mean", "numpy.random.randint", "utils.ExperienceBuffer.ExpBuf", "tensorflow.get_default_graph", "tensorflow.split", "os.path.join", "resource.getrusage", "tensorflow.variable_scope", "tensorfl...
[((738, 763), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (761, 763), False, 'import gym, os, argparse, sys, time\n'), ((607, 637), 'sys.path.insert', 'sys.path.insert', (['(1)', 'parent_dir'], {}), '(1, parent_dir)\n', (622, 637), False, 'import gym, os, argparse, sys, time\n'), ((11690, 11...
""" HeurOSPF proposed in <NAME> and <NAME>. Internet traffic engineering by optimizing OSPF weights. In Proc. IEEE INFOCOM, volume 2, pages 519–528. IEEE, 2000. doi:10.1109/INFCOM.2000. 832225. """ import random import time import networkit as nk import numpy as np from algorithm.generic_...
[ "networkit.Graph", "numpy.random.uniform", "numpy.random.seed", "random.randint", "numpy.sum", "time.process_time", "numpy.zeros", "time.time", "numpy.random.randint", "numpy.array", "algorithm.segment_routing.sr_utility.SRUtility.get_segmented_demands", "networkit.distance.SPSP" ]
[((960, 987), 'numpy.random.seed', 'np.random.seed', (['self.__seed'], {}), '(self.__seed)\n', (974, 987), True, 'import numpy as np\n'), ((4353, 4388), 'numpy.zeros', 'np.zeros', (['(2 ** self.__l)'], {'dtype': 'bool'}), '(2 ** self.__l, dtype=bool)\n', (4361, 4388), True, 'import numpy as np\n'), ((4580, 4616), 'nump...
"""A package for processing and analysis of non-hierarchical gate-level VLSI designs. The kyupy package itself contains a logger and other simple utility functions. In addition, it defines a ``numba`` and a ``cuda`` objects that point to the actual packages if they are available and otherwise point to mocks. """ impo...
[ "numpy.sum", "time.perf_counter", "gzip.open" ]
[((553, 578), 'numpy.sum', 'np.sum', (['_pop_count_lut[a]'], {}), '(_pop_count_lut[a])\n', (559, 578), True, 'import numpy as np\n'), ((2199, 2218), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (2216, 2218), False, 'import time\n'), ((3228, 3247), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n...
import numpy as np def iou(box_group1, box_group2): """ Calculates the intersection over union (aka. Jaccard Index) between two boxes. Boxes are assumed to be in corners format (xmin, ymin, xmax, ymax) Args: - box_group1: boxes in group 1 - box_group2: boxes in group 2 Returns: - A numpy...
[ "numpy.minimum", "numpy.maximum" ]
[((787, 837), 'numpy.maximum', 'np.maximum', (['box_group1[..., 0]', 'box_group2[..., 0]'], {}), '(box_group1[..., 0], box_group2[..., 0])\n', (797, 837), True, 'import numpy as np\n'), ((859, 909), 'numpy.maximum', 'np.maximum', (['box_group1[..., 1]', 'box_group2[..., 1]'], {}), '(box_group1[..., 1], box_group2[..., ...
""" First run this 'extractEmbeddings.py' for extract embeddings Second run this 'trainModel.py' for traine classification mode Third run this file along with image path to recognize facess in image Note: 1) We are using state of the art Face Detection Model called Retina-Face to detect facess acuuretly 2) This Fac...
[ "os.mkdir", "torchvision.transforms.functional.to_tensor", "numpy.argmax", "torch.device", "cv2.rectangle", "torch.cuda.current_device", "cv2.imshow", "os.path.join", "retina_face.RetinaFace", "torch.load", "os.path.exists", "numpy.max", "torch.Tensor", "cv2.destroyAllWindows", "cv2.wait...
[((1193, 1204), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1202, 1204), False, 'import os\n'), ((1257, 1314), 'os.path.join', 'os.path.join', (['currentDir', '"""output/FinalEmbeddings.pickle"""'], {}), "(currentDir, 'output/FinalEmbeddings.pickle')\n", (1269, 1314), False, 'import os\n'), ((1373, 1430), 'os.path.joi...
#!/usr/bin/env python import os import re import cv2 import sys import logging import argparse import subprocess import numpy as np from utils import * def read(path): """ Unpack the .LJPEG image using the jpegdir library. Sample output: GW:1979 GH:4349 R:0 C:1 N:xx.ljpe...
[ "os.remove", "numpy.uint8", "argparse.ArgumentParser", "os.path.basename", "logging.warn", "cv2.imwrite", "subprocess.check_output", "os.path.dirname", "os.path.exists", "numpy.interp", "numpy.fromfile", "os.path.splitext", "cv2.normalize", "sys.exit", "re.compile" ]
[((449, 513), 're.compile', 're.compile', (['"""\\\\sC:(\\\\d+)\\\\s+N:(\\\\S+)\\\\s+W:(\\\\d+)\\\\s+H:(\\\\d+)\\\\s"""'], {}), "('\\\\sC:(\\\\d+)\\\\s+N:(\\\\S+)\\\\s+W:(\\\\d+)\\\\s+H:(\\\\d+)\\\\s')\n", (459, 513), False, 'import re\n'), ((551, 591), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {'...
#-*- coding: UTF-8 -*- import copy import numpy from keras.preprocessing.sequence import pad_sequences def genBatch(data): m = 820 maxsentencenum = len(data[0]) for doc in data: for sentence in doc: if len(sentence) > m: m = len(sentence) for i in xrange(maxs...
[ "copy.deepcopy", "keras.preprocessing.sequence.pad_sequences", "numpy.asarray", "numpy.float32", "numpy.concatenate" ]
[((552, 570), 'numpy.asarray', 'numpy.asarray', (['tmp'], {}), '(tmp)\n', (565, 570), False, 'import numpy\n'), ((884, 908), 'copy.deepcopy', 'copy.deepcopy', (['docsbatch'], {}), '(docsbatch)\n', (897, 908), False, 'import copy\n'), ((991, 1031), 'numpy.asarray', 'numpy.asarray', (['mask'], {'dtype': 'numpy.float32'})...
datapath = '../d/' import numpy as np import pandas as pd import matplotlib.pyplot as plt from itertools import product as iterp from skimage.transform import warp_polar from skimage.io import imread as rdtif train = pd.read_csv(f'{datapath}train-unique.csv') etrain = pd.read_csv(f'{datapath}extra_train.csv') trai...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.tight_layout", "numpy.arctan2", "matplotlib.pyplot.ylim", "pandas.read_csv", "matplotlib.pyplot.scatter", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.subplots", ...
[((222, 264), 'pandas.read_csv', 'pd.read_csv', (['f"""{datapath}train-unique.csv"""'], {}), "(f'{datapath}train-unique.csv')\n", (233, 264), True, 'import pandas as pd\n'), ((274, 315), 'pandas.read_csv', 'pd.read_csv', (['f"""{datapath}extra_train.csv"""'], {}), "(f'{datapath}extra_train.csv')\n", (285, 315), True, '...
# -*- coding: utf-8 -*- """ @author: sreimond """ import pytest from picasso.utils.analysis import special_functions import numpy as np def test_legendre1_degree2_order1_x02(): """ Test if the fully normalized associated Legendre function of the first kind of degree 2 and order 1 for the argument x = 0.2 is equal...
[ "picasso.utils.analysis.special_functions.legendre1", "numpy.sin", "numpy.cos", "pytest.approx", "numpy.sqrt" ]
[((461, 496), 'picasso.utils.analysis.special_functions.legendre1', 'special_functions.legendre1', (['(2)', '(0.2)'], {}), '(2, 0.2)\n', (488, 496), False, 'from picasso.utils.analysis import special_functions\n'), ((557, 568), 'numpy.cos', 'np.cos', (['(0.2)'], {}), '(0.2)\n', (563, 568), True, 'import numpy as np\n')...
import sys import os from glob import glob import random import tempfile import numpy as np import pandas as pd from scipy import stats import pyBigWig import click from rpy2 import robjects as robj from rpy2.robjects.packages import importr from rpy2.robjects import pandas2ri pandas2ri.activate() derfinder = im...
[ "rpy2.robjects.pandas2ri.ri2py", "rpy2.robjects.packages.importr", "numpy.abs", "rpy2.robjects.pandas2ri.activate", "click.option", "rpy2.robjects.r", "click.command", "click.Choice", "tempfile.mkdtemp", "pyBigWig.open", "rpy2.robjects.DataFrame", "numpy.log10", "os.path.join", "pandas.con...
[((283, 303), 'rpy2.robjects.pandas2ri.activate', 'pandas2ri.activate', ([], {}), '()\n', (301, 303), False, 'from rpy2.robjects import pandas2ri\n'), ((318, 338), 'rpy2.robjects.packages.importr', 'importr', (['"""derfinder"""'], {}), "('derfinder')\n", (325, 338), False, 'from rpy2.robjects.packages import importr\n'...
import numpy as np import pickle import numpy as np import pickle from itertools import chain from collections import OrderedDict from sklearn.model_selection import train_test_split import matplotlib.pylab as plt import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable import ...
[ "matplotlib.pyplot.title", "AI_scientist.variational.variational_meta_learning.load_model_dict", "matplotlib.pyplot.axes", "matplotlib.pyplot.subplot2grid", "matplotlib.widgets.Slider", "torch.cat", "AI_scientist.variational.variational_meta_learning.plot_task_ensembles", "numpy.random.randint", "ma...
[((15737, 15808), 'AI_scientist.variational.variational_meta_learning.get_tasks', 'get_tasks', (['task_id_list', '(1)', 'num_test_tasks'], {'task_settings': 'task_settings'}), '(task_id_list, 1, num_test_tasks, task_settings=task_settings)\n', (15746, 15808), False, 'from AI_scientist.variational.variational_meta_learn...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 6 08:58:18 2020 @author: jasonsteffener """ import pandas as pd import os import matplotlib.pyplot as plt import numpy as np BaseDir = '/Users/jasonsteffener/Documents/GitHub/PowerMediationResults' FileName = 'SummaryDataFile.csv' df = pd.read_csv...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "os.path.join", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "numpy.round", "numpy.zeros", "numpy.where", "numpy.arange", "numpy.interp", "matplotlib.pyplot.ylabel", "matplotli...
[((1865, 1914), 'matplotlib.pyplot.plot', 'plt.plot', (["df21['N']", "df21['IEBCaPow']"], {'label': 'Str1'}), "(df21['N'], df21['IEBCaPow'], label=Str1)\n", (1873, 1914), True, 'import matplotlib.pyplot as plt\n'), ((1966, 2015), 'matplotlib.pyplot.plot', 'plt.plot', (["df22['N']", "df22['IEBCaPow']"], {'label': 'Str2'...
from random import randint import numpy as np import pandas as pd from math import log import scipy.stats.distributions from sklearn.preprocessing import MinMaxScaler def scale(x): return np.log(x + 1) class customScaler(): def __init__(self, feature_range=(0,100)): self.feature_range = feature_...
[ "pandas.DataFrame", "numpy.sum", "numpy.log", "numpy.argmax", "sklearn.preprocessing.MinMaxScaler", "numpy.min", "numpy.max", "numpy.array", "numpy.digitize", "numpy.vstack" ]
[((195, 208), 'numpy.log', 'np.log', (['(x + 1)'], {}), '(x + 1)\n', (201, 208), True, 'import numpy as np\n'), ((2343, 2363), 'numpy.min', 'np.min', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (2349, 2363), True, 'import numpy as np\n'), ((2375, 2395), 'numpy.max', 'np.max', (['data'], {'axis': '(0)'}), '(data, a...
import math import numpy as np import torch import torch.nn as nn import torch.distributions as tdist from .invgamma import InverseGamma from .kl import kl_normal_invgamma, kl_normal_laplace class GaussianVar(object): def __init__(self, mean, var): self.mean = mean self.var = var self.sha...
[ "torch.ones", "math.sqrt", "torch.randn", "torch.distributions.kl_divergence", "torch.exp", "torch.Tensor", "torch.zeros", "torch.log", "numpy.sqrt" ]
[((2658, 2679), 'torch.exp', 'torch.exp', (['log_stddev'], {}), '(log_stddev)\n', (2667, 2679), False, 'import torch\n'), ((3452, 3471), 'torch.zeros', 'torch.zeros', (['*shape'], {}), '(*shape)\n', (3463, 3471), False, 'import torch\n'), ((3924, 3945), 'torch.exp', 'torch.exp', (['log_stddev'], {}), '(log_stddev)\n', ...
import numpy as np import cvxpy as cp import pandas as pd from scoring import * # %% def main(): year = int(input('Enter Year: ')) week = int(input('Enter Week: ')) budget = int(input('Enter Budget: ')) source = 'NFL' print(f'Source = {source}') df = read_data(year=year, week=week, source=sourc...
[ "pandas.read_csv", "pandas.get_dummies", "cvxpy.sum", "numpy.random.randint", "cvxpy.Problem", "cvxpy.Variable", "pandas.concat" ]
[((1407, 1440), 'cvxpy.Variable', 'cp.Variable', (['(N, 1)'], {'boolean': '(True)'}), '((N, 1), boolean=True)\n', (1418, 1440), True, 'import cvxpy as cp\n'), ((2184, 2208), 'cvxpy.Problem', 'cp.Problem', (['obj', 'constrs'], {}), '(obj, constrs)\n', (2194, 2208), True, 'import cvxpy as cp\n'), ((941, 980), 'pandas.rea...
# encoding: utf-8 # Sample-based Monte Carlo Denoising using a Kernel-Splatting Network # <NAME> <NAME> # Siggraph 2019 # # Copyright (c) 2019 <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 Lice...
[ "numpy.random.exponential", "numpy.ones", "numpy.sin", "numpy.linalg.norm", "numpy.exp", "numpy.random.randint", "numpy.random.normal", "os.path.join", "ttools.get_logger", "numpy.random.poisson", "numpy.random.choice", "numpy.random.shuffle", "bridson.poisson_disc_samples", "numpy.linalg....
[((9444, 9464), 'numpy.exp', 'np.exp', (['log_aperture'], {}), '(log_aperture)\n', (9450, 9464), True, 'import numpy as np\n'), ((1825, 1867), 'ttools.get_logger', 'ttools.get_logger', (['self.__class__.__name__'], {}), '(self.__class__.__name__)\n', (1842, 1867), False, 'import ttools\n'), ((2533, 2560), 'numpy.random...
""" Copyright 2018 The Johns Hopkins University Applied Physics Laboratory. 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 applicabl...
[ "numpy.load", "json.load", "numpy.random.seed", "time.time", "intern.remote.boss.BossRemote", "image_handler.load_nii" ]
[((668, 688), 'numpy.random.seed', 'np.random.seed', (['(9999)'], {}), '(9999)\n', (682, 688), True, 'import numpy as np\n'), ((1529, 1547), 'intern.remote.boss.BossRemote', 'BossRemote', (['config'], {}), '(config)\n', (1539, 1547), False, 'from intern.remote.boss import BossRemote\n'), ((4692, 4703), 'time.time', 'ti...
import dash import dash_core_components as dcc import dash_html_components as html import dash_table as dt import plotly.graph_objs as go from dash.dependencies import Input, Output, State from datetime import datetime, date, timedelta import json, csv, dash_table, time, operator from connect import norm_records, rec_l...
[ "dash_core_components.DatePickerSingle", "time.strftime", "dash_core_components.Input", "numpy.arange", "pandas.DataFrame", "dash.Dash", "dash_html_components.Div", "dash_html_components.Label", "numpy.isfinite", "connect.rec_lows.to_json", "scipy.stats.linregress", "datetime.timedelta", "da...
[((570, 641), 'pandas.DataFrame', 'pd.DataFrame', (['all_temps'], {'columns': "['dow', 'sta', 'Date', 'TMAX', 'TMIN']"}), "(all_temps, columns=['dow', 'sta', 'Date', 'TMAX', 'TMIN'])\n", (582, 641), True, 'import pandas as pd\n'), ((649, 675), 'pandas.DataFrame', 'pd.DataFrame', (['norm_records'], {}), '(norm_records)\...
import numpy as np # Individual heatmap for each ID computed for a batch of frames, offline processing # Watershed to see the networks of connected entities per frame # answer # Rework the data dump from yolox.swarm_metrics.swarm_metrics_utils import dump_frame_swarm_metrics_in_database from yolox.swarm_metrics.swar...
[ "numpy.zeros_like", "yolox.swarm_metrics.swarm_metrics_GUI.SWARMMetricsGUI", "yolox.swarm_metrics.swarm_metrics_utils.dump_frame_swarm_metrics_in_database", "matplotlib.pyplot.ion", "numpy.linspace", "yolox.tracking_utils.timer.Timer", "matplotlib.pyplot.subplots", "collections.deque", "matplotlib.p...
[((1551, 1584), 'collections.deque', 'deque', ([], {'maxlen': 'self.max_queue_size'}), '(maxlen=self.max_queue_size)\n', (1556, 1584), False, 'from collections import deque\n'), ((1615, 1648), 'collections.deque', 'deque', ([], {'maxlen': 'self.max_trail_size'}), '(maxlen=self.max_trail_size)\n', (1620, 1648), False, '...
# -*- coding: cp1252 -*- # Minimize a continuous differentialble multivariate function. Starting point # is given by "X" (D by 1), and the function named in the string "f", must # return a function value and a vector of partial derivatives. The Polack- # Ribiere flavour of conjugate gradients is used to compute search...
[ "math.isnan", "math.isinf", "numpy.multiply", "numpy.transpose", "numpy.array", "numpy.dot" ]
[((3734, 3746), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (3742, 3746), True, 'import numpy as np\n'), ((3996, 4011), 'numpy.dot', 'np.dot', (['(-s.T)', 's'], {}), '(-s.T, s)\n', (4002, 4011), True, 'import numpy as np\n'), ((4670, 4686), 'numpy.dot', 'np.dot', (['df2.T', 's'], {}), '(df2.T, s)\n', (4676, 4686...
# ****数据预处理代码-第一步:数据清洗**** # import pandas as pd import numpy as np import random from collections import Counter from sklearn import preprocessing from matplotlib import pyplot as plt import seaborn as sns import missingno from scipy import stats import math # 绘图预处理 plt.rcParams['font.sans-serif'] = ['...
[ "matplotlib.pyplot.title", "math.isnan", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.hist", "matplotlib.pyplot.bar", "matplotlib.pyplot.legend", "matplotlib.pyplot.axis", "scipy.stats.pearsonr", "pandas.read_excel", "numpy.arange", "numpy.exp", "matplotlib.pyplot.y...
[((11418, 11463), 'pandas.read_excel', 'pd.read_excel', (['"""../data/train_sales_data.xls"""'], {}), "('../data/train_sales_data.xls')\n", (11431, 11463), True, 'import pandas as pd\n'), ((11490, 11536), 'pandas.read_excel', 'pd.read_excel', (['"""../data/train_search_data.xls"""'], {}), "('../data/train_search_data.x...
#!/usr/bin/env python import os import argparse import collections import json import numpy as np import pandas as pd import h5py # import sklearn.metrics import Cell_BLAST as cb import utils def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("-r", "--ref", dest="ref", type=str, nargs="...
[ "argparse.Namespace", "json.dump", "h5py.File", "numpy.vectorize", "argparse.ArgumentParser", "numpy.logical_and", "pandas.read_csv", "utils.na_mask", "numpy.unique", "collections.defaultdict", "Cell_BLAST.metrics.class_specific_accuracy", "numpy.repeat", "Cell_BLAST.data.read_clean", "pan...
[((226, 251), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (249, 251), False, 'import argparse\n'), ((947, 1023), 'argparse.Namespace', 'argparse.Namespace', ([], {'ref': 'cmd_args.ref', 'true': 'cmd_args.true', 'pred': 'cmd_args.pred'}), '(ref=cmd_args.ref, true=cmd_args.true, pred=cmd_args....
import os import argparse import numpy as np import cv2 from PIL import Image import caffe def get_files_in_dir(path): folder = os.fsencode(path) filenames = [] for file in os.listdir(folder): filename = os.fsdecode(file) if filename.endswith(('jpg', '.jpeg', '.png', '.gif')): ...
[ "argparse.ArgumentParser", "numpy.ones", "cv2.erode", "numpy.multiply", "cv2.dilate", "os.fsdecode", "cv2.copyMakeBorder", "os.path.exists", "caffe.set_device", "cv2.resize", "caffe.set_mode_gpu", "numpy.min", "os.fsencode", "caffe.Net", "os.listdir", "os.makedirs", "numpy.ptp", "P...
[((136, 153), 'os.fsencode', 'os.fsencode', (['path'], {}), '(path)\n', (147, 153), False, 'import os\n'), ((189, 207), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (199, 207), False, 'import os\n'), ((431, 450), 'caffe.set_device', 'caffe.set_device', (['(0)'], {}), '(0)\n', (447, 450), False, 'import c...
# ---------------------------------------------------- # Name : smoothline.py # Author : E.Taskesen # Contact : <EMAIL> # Licence : MIT # ---------------------------------------------------- import numpy as np from scipy.interpolate import make_interp_spline def smoothline(xs, ys=None, interpol=3,...
[ "numpy.convolve", "numpy.ones" ]
[((2108, 2140), 'numpy.convolve', 'np.convolve', (['X', 'box'], {'mode': '"""same"""'}), "(X, box, mode='same')\n", (2119, 2140), True, 'import numpy as np\n'), ((2068, 2083), 'numpy.ones', 'np.ones', (['window'], {}), '(window)\n', (2075, 2083), True, 'import numpy as np\n')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import pickle import os, sys import math BOARD_ROWS = 3 BOARD_COLS = 3 class State: def __init__(self, p1, p2): self.board = np.zeros(( BOARD_ROWS, BOARD_COLS )) self.p1 = p1 self.p2 = p2 self.isEnd = False ...
[ "numpy.random.uniform", "pickle.dump", "math.ceil", "numpy.zeros", "os.path.exists", "numpy.flipud", "numpy.fliplr", "pickle.load", "numpy.rot90" ]
[((207, 241), 'numpy.zeros', 'np.zeros', (['(BOARD_ROWS, BOARD_COLS)'], {}), '((BOARD_ROWS, BOARD_COLS))\n', (215, 241), True, 'import numpy as np\n'), ((513, 547), 'numpy.zeros', 'np.zeros', (['(BOARD_ROWS, BOARD_COLS)'], {}), '((BOARD_ROWS, BOARD_COLS))\n', (521, 547), True, 'import numpy as np\n'), ((8537, 8571), 'p...
# -*- coding: utf-8 -*- """ Created on Tue Jul 13 20:12:18 2021 @author: arnep """ from kalman import state_spacer as StateSpacer import numpy as np class eStateSpacer(StateSpacer): """Class which implements the extended Kalman Filter. This technique uses a Taylor transformation of the first ord...
[ "numpy.matrix", "numpy.ones", "numpy.isnan", "numpy.array", "numpy.linalg.inv", "numpy.sqrt", "numpy.linalg.cholesky" ]
[((6287, 6299), 'numpy.isnan', 'np.isnan', (['yt'], {}), '(yt)\n', (6295, 6299), True, 'import numpy as np\n'), ((8873, 8889), 'numpy.linalg.inv', 'np.linalg.inv', (['F'], {}), '(F)\n', (8886, 8889), True, 'import numpy as np\n'), ((9010, 9021), 'numpy.isnan', 'np.isnan', (['v'], {}), '(v)\n', (9018, 9021), True, 'impo...
#! encoding=<utf8> from __future__ import division import numpy as np from fastkde import fastKDE from warnings import warn import pymc3 as pm __all__ = ['find_mode'] def make_indices(dimensions): # Generates complete set of indices for given dimensions level = len(dimensions) if level == 1: retu...
[ "corner.corner", "matplotlib.pyplot.show", "numpy.resize", "numpy.argmax", "numpy.floor", "numpy.asarray", "numpy.zeros", "fastkde.fastKDE.fastKDE", "numpy.argmin", "numpy.shape", "numpy.sort", "numpy.array", "numpy.random.normal", "warnings.warn", "numpy.all" ]
[((1120, 1145), 'numpy.argmin', 'np.argmin', (['interval_width'], {}), '(interval_width)\n', (1129, 1145), True, 'import numpy as np\n'), ((4269, 4294), 'numpy.zeros', 'np.zeros', (['trace.shape[-1]'], {}), '(trace.shape[-1])\n', (4277, 4294), True, 'import numpy as np\n'), ((5655, 5699), 'corner.corner', 'corner', (['...
# Copyright 2020 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "dice_rl.utils.common.is_categorical_spec", "tensorflow.compat.v2.nest.map_structure", "tensorflow.compat.v2.gather", "tensorflow.compat.v2.GradientTape", "numpy.zeros", "tensorflow.compat.v2.nn.softmax", "tensorflow.compat.v2.nn.log_softmax", "tensorflow.compat.v2.shape", "tensorflow.compat.v2.rang...
[((2804, 2852), 'numpy.zeros', 'np.zeros', (['[self._num_states * self._num_actions]'], {}), '([self._num_states * self._num_actions])\n', (2812, 2852), True, 'import numpy as np\n'), ((2872, 2900), 'numpy.zeros', 'np.zeros', (['[self._num_states]'], {}), '([self._num_states])\n', (2880, 2900), True, 'import numpy as n...
""" CSfrag: build a dynamic library of analogous fragments, given a list of assigned chemical shifts. """ import os import numpy import multiprocessing import csb.io import csb.apps from csb.bio.io.wwpdb import FileSystemStructureProvider, StructureNotFoundError, PDBParseError from csb.bio.nmr import RandomCoil, Ch...
[ "csb.bio.nmr.RandomCoil.get", "csb.bio.nmr.ChemShiftScoringModel", "os.path.isdir", "csb.bio.io.wwpdb.FileSystemStructureProvider", "csb.bio.fragments.RosettaFragsetFactory", "os.path.isfile", "numpy.array", "csb.bio.io.cs.ChemShiftReader", "csb.bio.fragments.ChemShiftAssignment", "multiprocessing...
[((941, 968), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (966, 968), False, 'import multiprocessing\n'), ((4166, 4182), 'csb.bio.nmr.RandomCoil.get', 'RandomCoil.get', ([], {}), '()\n', (4180, 4182), False, 'from csb.bio.nmr import RandomCoil, ChemShiftScoringModel\n'), ((5735, 5759), '...
""" .. module:: single_conn :synopsis: Module for visualization of C. Elegans' neural connections with a GUI .. moduleauthor:: <NAME> """ from os.path import dirname HERE = dirname(__file__) import pandas as pd import numpy as np import networkx as nx import matplotlib.pyplot as plt from matplotlib.patches impor...
[ "numpy.sum", "networkx.draw_networkx_edges", "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", "pandas.read_csv", "os.path.dirname", "matplotlib.pyplot.axis", "numpy.argmin", "numpy.hstack", "matplotlib.pyplot.figure", "networkx.layout.circular_layout", "numpy.array", "networkx.draw_netw...
[((179, 196), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (186, 196), False, 'from os.path import dirname\n'), ((340, 397), 'pandas.read_csv', 'pd.read_csv', (["(HERE + '/data/Neuro279_Syn.csv')"], {'index_col': '(0)'}), "(HERE + '/data/Neuro279_Syn.csv', index_col=0)\n", (351, 397), True, 'import...
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "numpy.zeros", "mindspore.train.serialization.load_checkpoint", "src.squeezenet.SqueezeNet_Residual", "mindspore.train.serialization.export", "mindspore.train.serialization.load_param_into_net" ]
[((1465, 1500), 'src.squeezenet.SqueezeNet_Residual', 'squeezenet', ([], {'num_classes': 'num_classes'}), '(num_classes=num_classes)\n', (1475, 1500), True, 'from src.squeezenet import SqueezeNet_Residual as squeezenet\n'), ((1604, 1648), 'mindspore.train.serialization.load_checkpoint', 'load_checkpoint', (['config.che...
import os import random import argparse import functools from math import e, log import numpy as np import torch from torch.backends import cudnn import torchvision import torch.nn as nn import torch.nn.functional as F from torchvision import transforms from nni.algorithms.compression.pytorch.pruning \ import L1F...
[ "numpy.random.seed", "argparse.ArgumentParser", "cdp.calculate_cdp", "nets.vgg.VGG_CIFAR", "torchvision.datasets.CIFAR10", "utils.train_util.test", "torchvision.transforms.Normalize", "os.path.join", "argparse.ArgumentTypeError", "utils.counter.count_flops_params", "torch.utils.data.DataLoader",...
[((1212, 1261), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""CDP Pruner"""'}), "(description='CDP Pruner')\n", (1235, 1261), False, 'import argparse\n'), ((3533, 3572), 'os.path.join', 'os.path.join', (['args.savepath', 'args.model'], {}), '(args.savepath, args.model)\n', (3545, 3572),...
'''Module for GS and Jacobi smoothers for the Poisson (classical) obstacle problem.''' __all__ = ['PsmootherPoisson'] import numpy as np from smoothers.base import SmootherObstacleProblem def _pde2alpha(x): return 2.0 + np.sin(2.0 * np.pi * x) class PsmootherPoisson(SmootherObstacleProblem): '''Class for th...
[ "numpy.random.seed", "numpy.random.randn", "numpy.shape", "numpy.sin", "numpy.array", "numpy.exp", "numpy.cos" ]
[((227, 250), 'numpy.sin', 'np.sin', (['(2.0 * np.pi * x)'], {}), '(2.0 * np.pi * x)\n', (233, 250), True, 'import numpy as np\n'), ((620, 656), 'numpy.random.seed', 'np.random.seed', (['self.args.randomseed'], {}), '(self.args.randomseed)\n', (634, 656), True, 'import numpy as np\n'), ((1150, 1177), 'numpy.array', 'np...
# coding: utf-8 # python 3.5 from itertools import product from sklearn.metrics import accuracy_score from multiprocessing import Pool from multiprocessing import freeze_support import numpy as np import sys import os sys.path.append(os.path.dirname(os.path.abspath(__file__))+'/../MLEM2') import logging logging.basicCo...
[ "os.path.abspath", "numpy.std", "numpy.mean", "multiprocessing.Pool", "mlem2.getRulesByMLEM2", "multiprocessing.freeze_support" ]
[((1218, 1228), 'multiprocessing.Pool', 'Pool', (['proc'], {}), '(proc)\n', (1222, 1228), False, 'from multiprocessing import Pool\n'), ((1645, 1686), 'mlem2.getRulesByMLEM2', 'mlem2.getRulesByMLEM2', (['"""hayes-roth"""', '(2)', '(2)'], {}), "('hayes-roth', 2, 2)\n", (1666, 1686), False, 'import mlem2\n'), ((1959, 197...
#util.py # A module that contains various small functions that the main engine makes use of. import funs.learning as learning import funs.inference as inference import funs.engine as engine import numpy as np import scipy as sp import scipy.io as sio import scipy.optimize as op from scipy.optimize import approx_fprime ...
[ "sys.stdout.write", "pickle.dump", "numpy.random.seed", "numpy.sum", "scipy.io.loadmat", "numpy.floor", "numpy.ones", "numpy.argmin", "matplotlib.pylab.gca", "numpy.shape", "numpy.argsort", "pickle.load", "sys.stdout.flush", "numpy.arange", "numpy.mean", "numpy.histogram", "numpy.exp...
[((753, 787), 'numpy.dot', 'np.dot', (["params['C']", "params['C'].T"], {}), "(params['C'], params['C'].T)\n", (759, 787), True, 'import numpy as np\n'), ((904, 920), 'numpy.zeros', 'np.zeros', (['[n, n]'], {}), '([n, n])\n', (912, 920), True, 'import numpy as np\n'), ((1745, 1754), 'matplotlib.pylab.gca', 'plt.gca', (...
import numpy as np input_dir = '/datahouse/yurl/TalkingData/P3-resample/' output_dir = '/datahouse/yurl/TalkingData/P3-resample/' filename = 'test-10000-15-800-2-100-13' def sample_encoder_decoder(arr, percent, mode='random'): import math n = int(math.ceil(len(arr) * percent)) # if n == 1: # return [arr[0]...
[ "numpy.random.choice" ]
[((533, 576), 'numpy.random.choice', 'np.random.choice', (['en_inds', 'n'], {'replace': '(False)'}), '(en_inds, n, replace=False)\n', (549, 576), True, 'import numpy as np\n')]
import random import numpy as np def display_cave(matrix): for i in range(matrix.shape[0]): for j in range(matrix.shape[1]): char = "#" if matrix[i][j] == WALL else "." print(char, end='') print() # the cave size shape = (15,30) # walls will be 0 # floors wil...
[ "numpy.ones", "random.uniform" ]
[((379, 393), 'numpy.ones', 'np.ones', (['shape'], {}), '(shape)\n', (386, 393), True, 'import numpy as np\n'), ((470, 490), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (484, 490), False, 'import random\n')]
import os import torch import time import contextlib import copy import numpy as np from . import nest # from src.utils.logging import INFO, WARN __all__ = [ 'batch_open', 'GlobalNames', 'Timer', 'Collections', 'build_vocab_shortlist', 'to_gpu', 'should_trigger_by_steps', 'Saver', ...
[ "os.mkdir", "copy.deepcopy", "os.remove", "os.path.basename", "os.path.dirname", "os.path.exists", "numpy.mod", "time.time", "torch.save", "numpy.array", "torch.device", "os.path.join" ]
[((1402, 1413), 'time.time', 'time.time', ([], {}), '()\n', (1411, 1413), False, 'import time\n'), ((1483, 1494), 'time.time', 'time.time', ([], {}), '()\n', (1492, 1494), False, 'import time\n'), ((3055, 3080), 'copy.deepcopy', 'copy.deepcopy', (['state_dict'], {}), '(state_dict)\n', (3068, 3080), False, 'import copy\...
import numpy as np import cvgutils.Viz as viz import matplotlib.pyplot as plt import cv2 import cvgutils.Linalg as lin if __name__ == "__main__": p = np.linspace(0,2*np.pi,100) x = np.cos(p) y = np.sin(p) f,t = lin.xyz2pt(x,y,0) # f = np.arctan2(y,x) # f[f<0] += 2*np.pi im = viz.scatter(p,f)...
[ "cvgutils.Viz.scatter", "cvgutils.Linalg.xyz2pt", "matplotlib.pyplot.close", "numpy.sin", "numpy.cos", "numpy.linspace", "cvgutils.Viz.get_img_from_fig", "numpy.concatenate" ]
[((154, 184), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(100)'], {}), '(0, 2 * np.pi, 100)\n', (165, 184), True, 'import numpy as np\n'), ((189, 198), 'numpy.cos', 'np.cos', (['p'], {}), '(p)\n', (195, 198), True, 'import numpy as np\n'), ((207, 216), 'numpy.sin', 'np.sin', (['p'], {}), '(p)\n', (213, 2...
import torch import numpy as np import models.model as model import config as c from utils.eval_functions import err_3dpe_parallel from utils.data_utils import reinsert_root_joint_torch, root_center_poses import data.data_h36m as data from scipy.cluster.vq import kmeans print("Program is running on: ", c.device) pri...
[ "data.data_h36m.H36MDataset", "utils.eval_functions.err_3dpe_parallel", "torch.cat", "torch.randn", "torch.std", "torch.no_grad", "torch.median", "torch.utils.data.DataLoader", "models.model.poseINN", "utils.data_utils.reinsert_root_joint_torch", "torch.zeros", "utils.data_utils.root_center_po...
[((597, 612), 'models.model.poseINN', 'model.poseINN', ([], {}), '()\n', (610, 612), True, 'import models.model as model\n'), ((991, 1011), 'torch.zeros', 'torch.zeros', (['(3, 17)'], {}), '((3, 17))\n', (1002, 1011), False, 'import torch\n'), ((10460, 10492), 'torch.mean', 'torch.mean', (['std_dev_in_mm'], {'dim': '(1...
"""Dataset class for dSprites ref) https://github.com/google-research/disentanglement_lib/blob/master/disentanglement_lib/data/ground_truth/dsprites.py """ from typing import Optional import pathlib import numpy as np import torch from .base_data import BaseDataset class DSpritesDataset(BaseDataset): """DSp...
[ "pathlib.Path", "torch.tensor", "numpy.load" ]
[((1206, 1234), 'pathlib.Path', 'pathlib.Path', (['root', 'filename'], {}), '(root, filename)\n', (1218, 1234), False, 'import pathlib\n'), ((1248, 1299), 'numpy.load', 'np.load', (['path'], {'encoding': '"""latin1"""', 'allow_pickle': '(True)'}), "(path, encoding='latin1', allow_pickle=True)\n", (1255, 1299), True, 'i...
# coding=utf-8 # Copyright 2022 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...
[ "absl.testing.absltest.main", "tensorflow.compat.v1.io.gfile.GFile", "symbolic_functionals.syfes.xc.xc.make_eval_xc", "symbolic_functionals.syfes.symbolic.xc_functionals.wb97mv_short.make_eval_xc", "symbolic_functionals.syfes.xc.utils.get_hybrid_rsh_params", "symbolic_functionals.syfes.scf.scf.run_scf_for...
[((1105, 1146), 'jax.config.update', 'jax.config.update', (['"""jax_enable_x64"""', '(True)'], {}), "('jax_enable_x64', True)\n", (1122, 1146), False, 'import jax\n'), ((1745, 2518), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (["('pbe,pbe', 0, 0, (17812,), (6, 17812), {'Etot': -1.1601348451265...
# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. import argparse import copy import math import random import sys import time import numpy as np import multiprocessing as mp...
[ "copy.deepcopy", "math.exp", "numpy.sum", "random.randint", "argparse.ArgumentParser", "numpy.ones", "time.time", "random.random", "numpy.array", "random.seed", "multiprocessing.Queue", "multiprocessing.Event", "multiprocessing.Process.__init__" ]
[((348, 359), 'time.time', 'time.time', ([], {}), '()\n', (357, 359), False, 'import time\n'), ((465, 518), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""deal with args"""'}), "(description='deal with args')\n", (488, 518), False, 'import argparse\n'), ((13881, 13905), 'random.randint',...
#!/bin/python import argparse from osgeo import gdal import numpy as np import os parser = argparse.ArgumentParser() parser.add_argument('infile', type=str, help='Input file') parser.add_argument('outfile', type=str, help='Output file') parser.add_argument('--scale', type=int, nargs=4, default=[0, 32767, 1, 255], hel...
[ "argparse.ArgumentParser", "numpy.log2", "numpy.nanstd", "numpy.nanmin", "osgeo.gdal.Open", "osgeo.gdal.GetDriverByName", "numpy.nanmax", "numpy.nanmean" ]
[((92, 117), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (115, 117), False, 'import argparse\n'), ((631, 671), 'osgeo.gdal.Open', 'gdal.Open', (['args.infile', 'gdal.GA_ReadOnly'], {}), '(args.infile, gdal.GA_ReadOnly)\n', (640, 671), False, 'from osgeo import gdal\n'), ((1205, 1234), 'osgeo...
# -*- coding: utf-8 -*- """ Created on Fri Dec 7 16:27:27 2018 @author: <NAME> """ import numpy as np import matplotlib.pyplot as plt import math from sklearn.metrics import mean_squared_error from keras.models import Model from keras.layers import Input import keras.backend as K from keras.callbacks imp...
[ "numpy.random.seed", "keras.backend.set_value", "keras.models.Model", "matplotlib.pyplot.figure", "keras.callbacks.LearningRateScheduler", "keras.layers.Input", "numpy.empty_like", "dual_attention.second_attention", "numpy.reshape", "sklearn.metrics.mean_squared_error", "numpy.size", "matplotl...
[((827, 844), 'numpy.random.seed', 'np.random.seed', (['(8)'], {}), '(8)\n', (841, 844), True, 'import numpy as np\n'), ((1236, 1275), 'data_creation.read_data', 'read_data', (['path', 'sample_step', 'in_column'], {}), '(path, sample_step, in_column)\n', (1245, 1275), False, 'from data_creation import create_dataset, r...
import cv2 import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from .colors import label_color def draw_box(image, box, color, thickness=2): """ Draws a box on an image with a given color. # Arguments image : The image to draw on. box ...
[ "cv2.line", "numpy.meshgrid", "cv2.putText", "matplotlib.pyplot.show", "scipy.interpolate.griddata", "cv2.circle", "numpy.argmax", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.figure", "numpy.array", "cv2.rectangle" ]
[((524, 603), 'cv2.rectangle', 'cv2.rectangle', (['image', '(b[0], b[1])', '(b[2], b[3])', 'color', 'thickness', 'cv2.LINE_AA'], {}), '(image, (b[0], b[1]), (b[2], b[3]), color, thickness, cv2.LINE_AA)\n', (537, 603), False, 'import cv2\n'), ((618, 676), 'numpy.array', 'np.array', (['[17, 22, 27, 42, 48, 31, 36, 68]'],...
import numpy as np from ya_glm.opt.concave_penalty import scad_prox, mcp_prox def gen_thresh(values, pen_val, thresh='hard', thresh_kws={}): """ Applies a generalized thresholding operator to an array. Parameters ---------- values: array-like The values to threshold. pen_val: float ...
[ "numpy.zeros_like", "ya_glm.opt.concave_penalty.mcp_prox", "ya_glm.opt.concave_penalty.scad_prox", "numpy.array", "numpy.sign" ]
[((1715, 1731), 'numpy.array', 'np.array', (['values'], {}), '(values)\n', (1723, 1731), True, 'import numpy as np\n'), ((1742, 1763), 'numpy.zeros_like', 'np.zeros_like', (['values'], {}), '(values)\n', (1755, 1763), True, 'import numpy as np\n'), ((2191, 2207), 'numpy.array', 'np.array', (['values'], {}), '(values)\n...
# --- Day 8: Two-Factor Authentication --- # https://adventofcode.com/2016/day/8 import numpy import re import time simple = False verbose = 1 if simple: # noinspection SpellCheckingInspection data = ['rect 3x2', 'rotate column x=1 by 1', 'rotate row y=0 by 4', 'rotate column x=1 by 1'] size =...
[ "numpy.full", "re.compile", "time.time" ]
[((485, 496), 'time.time', 'time.time', ([], {}), '()\n', (494, 496), False, 'import time\n'), ((511, 564), 're.compile', 're.compile', (['"""rect (\\\\d+)x(\\\\d+)"""'], {'flags': 're.IGNORECASE'}), "('rect (\\\\d+)x(\\\\d+)', flags=re.IGNORECASE)\n", (521, 564), False, 'import re\n'), ((576, 645), 're.compile', 're.c...
import re import numpy # Wells Path/Deviation file reader def read_dev_file(filename): # ----- # Pre-calc for lines counting and arrays pre-init file = open(filename) lines_count = -1 # minus data names line while 1: lines = file.readlines(100000) if not lines: break for line...
[ "numpy.zeros", "re.sub", "re.split" ]
[((862, 885), 're.sub', 're.sub', (['"""\\\\n"""', '""""""', 'line'], {}), "('\\\\n', '', line)\n", (868, 885), False, 'import re\n'), ((981, 1006), 're.split', 're.split', (['"""[ \\\\t]+"""', 'line'], {}), "('[ \\\\t]+', line)\n", (989, 1006), False, 'import re\n'), ((1209, 1233), 'numpy.zeros', 'numpy.zeros', (['lin...
from rich import print from pyembroidery import * from svgpathtools import svg2paths, wsvg import numpy as np OUTPUT_PES = "pes_tests/" OUTPUT_SVG = "svg_tests/" INPUT_SVG = "tests_input/" class Embryoid: def __init__(self): self.pattern = EmbPattern() def save_svg(self, fname=OUTPUT_SVG + "design....
[ "svgpathtools.svg2paths", "rich.print", "embroiderTurtle.hilbert", "numpy.linspace" ]
[((1250, 1285), 'numpy.linspace', 'np.linspace', (['(0)', 'y_len', 'num_stitches'], {}), '(0, y_len, num_stitches)\n', (1261, 1285), True, 'import numpy as np\n'), ((785, 801), 'svgpathtools.svg2paths', 'svg2paths', (['fname'], {}), '(fname)\n', (794, 801), False, 'from svgpathtools import svg2paths, wsvg\n'), ((810, 8...
from pgfutils import save, setup_figure setup_figure(width=1, height=1) import base64 from pathlib import Path import tempfile from matplotlib import pyplot as plt import numpy as np t = np.linspace(0, 10, 201) s = np.sin(2 * np.pi * 0.5 * t) with open(Path(tempfile.gettempdir()) / "test_nonproject.png", "wb") a...
[ "pgfutils.setup_figure", "matplotlib.pyplot.plot", "tempfile.gettempdir", "pgfutils.save", "base64.b64decode", "numpy.sin", "numpy.linspace" ]
[((42, 73), 'pgfutils.setup_figure', 'setup_figure', ([], {'width': '(1)', 'height': '(1)'}), '(width=1, height=1)\n', (54, 73), False, 'from pgfutils import save, setup_figure\n'), ((193, 216), 'numpy.linspace', 'np.linspace', (['(0)', '(10)', '(201)'], {}), '(0, 10, 201)\n', (204, 216), True, 'import numpy as np\n'),...
#!/usr/bin/env python # coding: utf-8 from numpy import exp, dot, random, array """Python code for simple Artificial Neural Network with one hidden layer""" def initialize_weights(): # Generate random numbers random.seed(1) # Assign random weights to a 3 x 1 matrix synaptic_weights = random.uniform...
[ "numpy.random.uniform", "numpy.random.seed", "numpy.array", "numpy.exp", "numpy.dot" ]
[((221, 235), 'numpy.random.seed', 'random.seed', (['(1)'], {}), '(1)\n', (232, 235), False, 'from numpy import exp, dot, random, array\n'), ((306, 349), 'numpy.random.uniform', 'random.uniform', ([], {'low': '(-1)', 'high': '(1)', 'size': '(3, 1)'}), '(low=-1, high=1, size=(3, 1))\n', (320, 349), False, 'from numpy im...
from sklearn.datasets import fetch_openml from sklearn.linear_model import SGDClassifier import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np mnist = fetch_openml('mnist_784', version=1) mnist.keys() x, y = mnist["data"], mnist["target"] x.shape y.shape y = y.astype(np.uint8) some_digit = ...
[ "sklearn.ensemble.RandomForestClassifier", "numpy.fill_diagonal", "matplotlib.pyplot.show", "sklearn.preprocessing.StandardScaler", "sklearn.linear_model.SGDClassifier", "numpy.argmax", "matplotlib.pyplot.imshow", "sklearn.model_selection.cross_val_score", "matplotlib.pyplot.matshow", "matplotlib....
[((176, 212), 'sklearn.datasets.fetch_openml', 'fetch_openml', (['"""mnist_784"""'], {'version': '(1)'}), "('mnist_784', version=1)\n", (188, 212), False, 'from sklearn.datasets import fetch_openml\n'), ((371, 444), 'matplotlib.pyplot.imshow', 'plt.imshow', (['some_digit_image'], {'cmap': 'mpl.cm.binary', 'interpolatio...
#!/usr/bin/env python import numpy as np import scipy as sp import collections def scalar_len(a): """ Return """ if isinstance(a, collections.Iterable): return len(a) else: return 1 def complex_polarToCartesian(r, theta): """ Convert a polar representation of a complex nu...
[ "numpy.angle", "numpy.asarray", "numpy.abs", "numpy.exp" ]
[((566, 586), 'numpy.exp', 'np.exp', (['(theta * 1.0j)'], {}), '(theta * 1.0j)\n', (572, 586), True, 'import numpy as np\n'), ((921, 930), 'numpy.abs', 'np.abs', (['x'], {}), '(x)\n', (927, 930), True, 'import numpy as np\n'), ((932, 943), 'numpy.angle', 'np.angle', (['x'], {}), '(x)\n', (940, 943), True, 'import numpy...
import os import json import numpy as np from bert_serving.client import BertClient class WordEmbedding(): """A class that implements some basic functionalities over word embeddings. """ def __init__(self, lang, dim): """Initializes a new :class:`Embedding` with for language ``lang``. :param lang: Language of...
[ "json.load", "numpy.empty", "faiss.IndexFlatIP", "numpy.mean", "numpy.linalg.norm", "numpy.array", "bert_serving.client.BertClient", "numpy.fromstring", "numpy.concatenate" ]
[((5411, 5433), 'faiss.IndexFlatIP', 'faiss.IndexFlatIP', (['dim'], {}), '(dim)\n', (5428, 5433), False, 'import faiss\n'), ((1217, 1261), 'numpy.empty', 'np.empty', (['[nmax, self.dim]'], {'dtype': 'np.float32'}), '([nmax, self.dim], dtype=np.float32)\n', (1225, 1261), True, 'import numpy as np\n'), ((3655, 3667), 'be...
# Copyright (c) 2016, <NAME> # All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the BSD license. See the accompanying LICENSE file # or read the terms at https://opensource.org/licenses/BSD-3-Clause. from __future__ import absolute_import, pri...
[ "tensorflow.reshape", "numpy.ones", "tensorflow.compat.v1.assign", "tensorflow.floor", "tensorflow.Variable", "tensorflow.sqrt", "deepmedic.neuralnet.ops.pool_3d", "numpy.prod", "deepmedic.neuralnet.ops.relu", "tensorflow.nn.moments", "tensorflow.compat.v1.placeholder", "tensorflow.concat", ...
[((2221, 2311), 'deepmedic.neuralnet.ops.pool_3d', 'ops.pool_3d', (['input', 'self._window_size', 'self._strides', 'self._pad_mode', 'self._pool_mode'], {}), '(input, self._window_size, self._strides, self._pad_mode, self.\n _pool_mode)\n', (2232, 2311), True, 'import deepmedic.neuralnet.ops as ops\n'), ((3795, 3841...
import os import sys import random import shutil import cv2 import time import math import pprint import numpy as np import pandas as pd from tensorboardX import SummaryWriter from dataset import Dataset, BatchGenerator import tensorflow as tf from utils.experiments import LabelSmoother from utils.tools import Average...
[ "tensorflow.random.set_seed", "dataset.BatchGenerator", "numpy.random.seed", "warnings.filterwarnings", "tensorflow.keras.metrics.Mean", "tensorflow.keras.callbacks.ModelCheckpoint", "time.time", "utils.tools.Logger", "utils.tools.AverageMeter", "tensorflow.cast", "tensorflow.keras.optimizers.Ad...
[((1143, 1157), 'utils.tools.AverageMeter', 'AverageMeter', ([], {}), '()\n', (1155, 1157), False, 'from utils.tools import AverageMeter, Logger\n'), ((1171, 1185), 'utils.tools.AverageMeter', 'AverageMeter', ([], {}), '()\n', (1183, 1185), False, 'from utils.tools import AverageMeter, Logger\n'), ((1199, 1213), 'utils...
# Example command: # python /scratch/imb/Xiao/HEMnet/HEMnet/train.py -b /scratch/imb/Xiao/HE_test/10x/ -t train_dataset_10x_19_12_19_strict_Reinhard/tiles_10x/ -l valid_Reinhard/tiles_10x -o HEMnet_14_01_2020 -g 2 -e 10 -s -m vgg16 -a 64 -v import argparse import numpy as np import os import time from pathlib import Pa...
[ "tensorflow.keras.preprocessing.image.ImageDataGenerator", "model.HEMnetModel", "os.makedirs", "argparse.ArgumentParser", "pathlib.Path", "numpy.unique" ]
[((704, 729), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (727, 729), False, 'import argparse\n'), ((3409, 3525), 'model.HEMnetModel', 'HEMnetModel', ([], {'cnn_base': 'CNN_BASE', 'num_gpus': 'NUM_GPUS', 'transfer_learning': 'TRANSFER_LEARNING', 'fine_tuning': 'FINE_TUNING'}), '(cnn_base=CNN...
""" Copyright 2019 Akvelon 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 to in writing, soft...
[ "pandas.DataFrame", "sklearn.externals.joblib.dump", "tensorflow.keras.models.load_model", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "pandas.read_csv", "sklearn.preprocessing.RobustScaler", "numpy.floor", "numpy.median", "tensorflow.keras.layers.PReLU", "pathlib.Path", ...
[((1313, 1347), 'pathlib.Path', 'Path', (['PredictorTrainer.SCALER_PATH'], {}), '(PredictorTrainer.SCALER_PATH)\n', (1317, 1347), False, 'from pathlib import Path\n'), ((2439, 2478), 'pandas.read_csv', 'pd.read_csv', (['PredictorTrainer.DATA_PATH'], {}), '(PredictorTrainer.DATA_PATH)\n', (2450, 2478), True, 'import pan...
import binascii import logging from concurrent.futures import ProcessPoolExecutor from functools import partial from typing import Callable, Iterable, List, Tuple import numpy as np from .common import S_BOX, State from .key_expension import get_first_key SQUARE_ROUNDS = 4 REVERSED_S_BOX = {v: k for k, v in S_BOX.it...
[ "numpy.full", "functools.partial", "binascii.hexlify", "concurrent.futures.ProcessPoolExecutor", "logging.info" ]
[((781, 829), 'logging.info', 'logging.info', (['"""Gathering encrypted delta set..."""'], {}), "('Gathering encrypted delta set...')\n", (793, 829), False, 'import logging\n'), ((912, 949), 'functools.partial', 'partial', (['guess_position', 'encrypted_ds'], {}), '(guess_position, encrypted_ds)\n', (919, 949), False, ...
import pandas as pd import numpy as np import os import plotly.graph_objects as go from scipy.spatial import Delaunay import pymatgen.core as mg from pymatgen.ext.matproj import MPRester from pymatgen.symmetry.analyzer import SpacegroupAnalyzer from pymatgen.analysis.local_env import IsayevNN, MinimumDistanceNN, Crysta...
[ "os.mkdir", "numpy.sum", "networkx.MultiGraph", "matplotlib.pyplot.figure", "pymatgen.analysis.local_env.MinimumDistanceNN", "matplotlib.pyplot.gca", "networkx.draw_networkx_edge_labels", "pymatgen.ext.matproj.MPRester", "pymatgen.analysis.local_env.CrystalNN", "scipy.spatial.Delaunay", "pandas....
[((615, 643), 'pymatgen.ext.matproj.MPRester', 'MPRester', (['"""UP0x1rTAXR52g7pi"""'], {}), "('UP0x1rTAXR52g7pi')\n", (623, 643), False, 'from pymatgen.ext.matproj import MPRester\n'), ((1310, 1343), 'pymatgen.symmetry.analyzer.SpacegroupAnalyzer', 'SpacegroupAnalyzer', (['structure_tmp'], {}), '(structure_tmp)\n', (1...
""" ---------------------------------------------------------------------------------------- Copyright (c) 2020 - see AUTHORS file This file is part of the ARTHuS software. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by...
[ "torch.ones", "torch.from_numpy", "numpy.abs", "utils.filterOperations.morphological_dilation", "torch.where", "cv2.imread", "torch.Tensor", "glob.glob", "torch.zeros", "torch.sum", "utils.filterOperations.morphological_erosion" ]
[((2693, 2708), 'torch.Tensor', 'torch.Tensor', (['(2)'], {}), '(2)\n', (2705, 2708), False, 'import torch\n'), ((4925, 4996), 'utils.filterOperations.morphological_erosion', 'filterOperations.morphological_erosion', (['mask', '(2 * inner_border_size + 1)'], {}), '(mask, 2 * inner_border_size + 1)\n', (4963, 4996), Tru...
from typing import Union from subsurface.structs import PointSet, TriSurf, LineSet, TetraMesh, StructuredGrid from subsurface.structs.common import Common from subsurface.structs.errors import PyVistaImportError import numpy as np try: import pyvista as pv except ImportError: raise ImportError() def pv_plot...
[ "numpy.full", "matplotlib.pyplot.show", "pyvista.StructuredGrid", "matplotlib.pyplot.imshow", "pyvista.UnstructuredGrid", "pyvista.Plotter", "matplotlib.pyplot.axis", "numpy.array", "pyvista.PolyData" ]
[((903, 952), 'pyvista.Plotter', 'pv.Plotter', ([], {'off_screen': 'image_2d'}), '(**plotter_kwargs, off_screen=image_2d)\n', (913, 952), True, 'import pyvista as pv\n'), ((1625, 1659), 'pyvista.PolyData', 'pv.PolyData', (['point_set.data.vertex'], {}), '(point_set.data.vertex)\n', (1636, 1659), True, 'import pyvista a...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from typing import Union import numpy from draugr.torch_utilities import to_tensor __author__ = "<NAME>" import torch __all__ = ["torch_advantage_estimate", "torch_compute_gae"] def torch_advantage_estimate( signal, non_terminal, value_estimate, *, ...
[ "numpy.random.seed", "torch.zeros_like", "numpy.zeros", "numpy.ones", "numpy.random.random", "torch.zeros", "draugr.torch_utilities.to_tensor" ]
[((1035, 1074), 'torch.zeros_like', 'torch.zeros_like', (['signal'], {'device': 'device'}), '(signal, device=device)\n', (1051, 1074), False, 'import torch\n'), ((1085, 1124), 'torch.zeros', 'torch.zeros', (['num_workers'], {'device': 'device'}), '(num_workers, device=device)\n', (1096, 1124), False, 'import torch\n'),...
# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil -*- # ROS imports import roslib; roslib.load_manifest('freemovr_engine') import rosbag # standard Python stuff import json import numpy as np import freemovr_engine.fixup_path as fixup_path class Vec3: def __init__(self,x=0, y=0, z=0): self.x=x ...
[ "numpy.arctan2", "numpy.sum", "numpy.floor", "numpy.ones", "numpy.isnan", "numpy.sin", "numpy.arange", "roslib.load_manifest", "numpy.arcsin", "freemovr_engine.fixup_path.fixup_path", "numpy.max", "numpy.arccos", "numpy.broadcast_arrays", "numpy.fmod", "numpy.cross", "numpy.isinf", "...
[((90, 129), 'roslib.load_manifest', 'roslib.load_manifest', (['"""freemovr_engine"""'], {}), "('freemovr_engine')\n", (110, 129), False, 'import roslib\n'), ((18247, 18270), 'numpy.array', 'np.array', (['c'], {'copy': '(False)'}), '(c, copy=False)\n', (18255, 18270), True, 'import numpy as np\n'), ((18347, 18370), 'nu...
from abc import ABC from collections import namedtuple from enum import IntEnum, auto import numpy as np import pygame as pg pg.init() font_style = pg.font.SysFont("bahnschrift", 13) GameAction = namedtuple('GameAction', ['cell_id', 'dx', 'dy']) def find_cell(game, xr, yr): for cell in game.cells: if ...
[ "pygame.font.SysFont", "pygame.event.get", "pygame.display.set_mode", "pygame.Color", "pygame.init", "pygame.display.flip", "numpy.random.randint", "collections.namedtuple", "enum.auto", "pygame.time.Clock", "numpy.random.shuffle" ]
[((127, 136), 'pygame.init', 'pg.init', ([], {}), '()\n', (134, 136), True, 'import pygame as pg\n'), ((150, 184), 'pygame.font.SysFont', 'pg.font.SysFont', (['"""bahnschrift"""', '(13)'], {}), "('bahnschrift', 13)\n", (165, 184), True, 'import pygame as pg\n'), ((200, 249), 'collections.namedtuple', 'namedtuple', (['"...
# -*- coding: utf-8 -*- """ LAS file processing """ # !pip install rasterio # !pip install laspy import glob, os, zipfile import numpy as np import rasterio as rio from rasterio import warp import laspy las_path = '007.zip' L8_NLCD_path = 'L8_NLCD.zip' def prep_file(las_path, L8_NLCD_path, siteID=6): '''extract...
[ "rasterio.open", "zipfile.ZipFile", "laspy.file.File", "numpy.logical_and", "numpy.zeros", "rasterio.warp.transform", "numpy.where", "os.path.splitext", "numpy.vstack", "os.path.join", "rasterio.crs.CRS.from_epsg" ]
[((424, 450), 'os.path.splitext', 'os.path.splitext', (['las_path'], {}), '(las_path)\n', (440, 450), False, 'import glob, os, zipfile\n'), ((1193, 1220), 'rasterio.crs.CRS.from_epsg', 'rio.crs.CRS.from_epsg', (['(4326)'], {}), '(4326)\n', (1214, 1220), True, 'import rasterio as rio\n'), ((1248, 1278), 'rasterio.crs.CR...
# Created by <NAME> import numpy as np import torch from agents.random_agent import RandomAgent from game import Game def evaluate_random(tasks, agent_type, models, num_trials=50, compare_agent=None): """ Evaluate an agent against 3 random agents on a list of tasks :param tasks: list of task classes to e...
[ "numpy.asarray", "torch.no_grad", "game.Game" ]
[((1112, 1127), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1125, 1127), False, 'import torch\n'), ((1397, 1502), 'game.Game', 'Game', (['task', '([agent_type] + [RandomAgent] * 3)', '[models, {}, {}, {}]', "{'epsilon': 0, 'verbose': False}"], {}), "(task, [agent_type] + [RandomAgent] * 3, [models, {}, {}, {}]...
from __future__ import print_function, division caffe_root = '/TUB/robo/caffe-master/' import sys sys.path.insert(0, caffe_root+'python') import caffe import numpy as np #load the data file data_file = np.load('vgg_net_19_112.npy') #get the weights and biases out of the array #the weights have to be transposed beca...
[ "numpy.load", "caffe.Net", "sys.path.insert" ]
[((100, 141), 'sys.path.insert', 'sys.path.insert', (['(0)', "(caffe_root + 'python')"], {}), "(0, caffe_root + 'python')\n", (115, 141), False, 'import sys\n'), ((205, 234), 'numpy.load', 'np.load', (['"""vgg_net_19_112.npy"""'], {}), "('vgg_net_19_112.npy')\n", (212, 234), True, 'import numpy as np\n'), ((2369, 2413)...
"""Description of Pd class.""" __author__ = 'ikibalin' __version__ = "2020_08_19" import numpy from typing import NoReturn from cryspy.A_functions_base.function_2_crystallography_base import \ calc_cos_ang from cryspy.A_functions_base.matrix_operations import calc_m1_m2_m1t from cryspy.A_functions_base.unit_cell...
[ "numpy.ones", "numpy.isnan", "numpy.sin", "numpy.exp", "cryspy.C_item_loop_classes.cl_1_refln.ReflnL", "cryspy.B_parent_classes.preocedures.take_items_by_class", "numpy.round", "numpy.meshgrid", "numpy.logical_not", "cryspy.C_item_loop_classes.cl_1_tof_peak.TOFPeakL", "cryspy.A_functions_base.un...
[((4709, 4719), 'cryspy.C_item_loop_classes.cl_1_tof_proc.TOFProcL', 'TOFProcL', ([], {}), '()\n', (4717, 4719), False, 'from cryspy.C_item_loop_classes.cl_1_tof_proc import TOFProcL\n'), ((5506, 5545), 'numpy.zeros', 'numpy.zeros', (['time.shape[0]'], {'dtype': 'float'}), '(time.shape[0], dtype=float)\n', (5517, 5545)...