code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# -*- coding: utf-8 -*- """ Created on Sat Nov 13 10:57:37 2021 @author: marti """ import sys import os from numpy import (array, arange, zeros, ones, full, stack, vstack, tile, concatenate, shape, take, meshgrid, diff, ceil, log2, isinf, dot, ...
[ "numpy.full", "numpy.stack", "numpy.zeros", "numpy.ones", "numpy.isinf", "numpy.shape", "numpy.diff", "numpy.arange", "numpy.tile", "numpy.take", "numpy.dot", "numpy.vstack", "numpy.concatenate" ]
[((398, 419), 'numpy.full', 'full', (['dimensions', 'inf'], {}), '(dimensions, inf)\n', (402, 419), False, 'from numpy import array, arange, zeros, ones, full, stack, vstack, tile, concatenate, shape, take, meshgrid, diff, ceil, log2, isinf, dot, inf, pi\n'), ((435, 458), 'numpy.zeros', 'zeros', (['(*dimensions, 2)'], ...
import cv2 from keras.models import load_model import numpy as np # Load the keras model for classification # trained using google teachablemachine # https://teachablemachine.withgoogle.com/train model = load_model('kerasmodel/keras_model.h5', compile=True) def model_keras(frame=None): # resize the frame to 224x...
[ "keras.models.load_model", "numpy.asarray", "numpy.expand_dims", "cv2.resize" ]
[((205, 258), 'keras.models.load_model', 'load_model', (['"""kerasmodel/keras_model.h5"""'], {'compile': '(True)'}), "('kerasmodel/keras_model.h5', compile=True)\n", (215, 258), False, 'from keras.models import load_model\n'), ((334, 400), 'cv2.resize', 'cv2.resize', (['frame'], {'dsize': '(224, 224)', 'interpolation':...
import os import sys file_path = os.path.abspath(__file__) infer_dir = os.path.dirname(file_path) package_dir = os.path.dirname(infer_dir) sys.path.append(package_dir) import cv2 import torch import numpy as np from cannydet.torch import CannyDetector lower = 2.5 # 最小阈值 upper = 5 # 最大阈值 img_path = 'test_imgs/1-1...
[ "sys.path.append", "os.path.abspath", "cv2.waitKey", "cv2.imwrite", "os.path.dirname", "numpy.transpose", "cv2.imread", "cannydet.torch.CannyDetector", "cv2.imshow", "torch.from_numpy" ]
[((35, 60), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (50, 60), False, 'import os\n'), ((73, 99), 'os.path.dirname', 'os.path.dirname', (['file_path'], {}), '(file_path)\n', (88, 99), False, 'import os\n'), ((114, 140), 'os.path.dirname', 'os.path.dirname', (['infer_dir'], {}), '(infer_d...
import numpy as np import torch from torch.utils.data import TensorDataset from torch.nn import functional as F from torch.distributions import kl_divergence, Normal from torch.optim.lr_scheduler import ExponentialLR class MinExponentialLR(ExponentialLR): def __init__(self, optimizer, gamma, minimum, l...
[ "torch.ones", "numpy.zeros", "torch.distributions.kl_divergence", "torch.cuda.is_available", "numpy.array", "torch.utils.data.TensorDataset", "torch.zeros", "torch.from_numpy" ]
[((710, 740), 'numpy.array', 'np.array', (['[d[0] for d in data]'], {}), '([d[0] for d in data])\n', (718, 740), True, 'import numpy as np\n'), ((751, 781), 'numpy.array', 'np.array', (['[d[1] for d in data]'], {}), '([d[1] for d in data])\n', (759, 781), True, 'import numpy as np\n'), ((792, 822), 'numpy.array', 'np.a...
import matplotlib.animation as animation import matplotlib.pyplot as plt import matplotlib.patches as patches import cv2 import numpy as np import os import json def vis_segment_vid(vid_path, gt_labels, action_list, bar_height=0.25, output_path=None, output_filename=None, fps=25): """ Visualize a video with an...
[ "matplotlib.pyplot.show", "matplotlib.patches.Rectangle", "numpy.argmax", "cv2.cvtColor", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "matplotlib.animation.FuncAnimation", "cv2.VideoCapture", "numpy.equal", "matplotlib.pyplot.figure", "numpy.diff", "numpy.where", "cv2.convertScaleAb...
[((638, 666), 'numpy.argmax', 'np.argmax', (['gt_labels'], {'axis': '(0)'}), '(gt_labels, axis=0)\n', (647, 666), True, 'import numpy as np\n'), ((800, 826), 'cv2.VideoCapture', 'cv2.VideoCapture', (['vid_path'], {}), '(vid_path)\n', (816, 826), False, 'import cv2\n'), ((1021, 1056), 'matplotlib.pyplot.figure', 'plt.fi...
from network.Model import ModelNet as model_net from utils import * from network.ops import * from data_processing.data_processing import save_images import numpy as np from scipy import misc class Train(object): def __init__(self, args): self.gpu_id = args['GPU_ID'] self.epoch = args['epoch'] ...
[ "network.Model.ModelNet", "re.finditer", "numpy.mod", "numpy.clip", "numpy.array", "scipy.misc.imresize" ]
[((856, 890), 'network.Model.ModelNet', 'model_net', ([], {'mode': '"""train"""', 'args': 'args'}), "(mode='train', args=args)\n", (865, 890), True, 'from network.Model import ModelNet as model_net\n'), ((3074, 3100), 'numpy.mod', 'np.mod', (['idx', 'self.log_freq'], {}), '(idx, self.log_freq)\n', (3080, 3100), True, '...
import cv2 import numpy as np def prepareImage(img): # load the image image = img #https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_core/py_basic_ops/py_basic_ops.html chans = cv2.split(image) #declare variables colors = ('b', 'g', 'r') features = [] feature_data = '' counter...
[ "cv2.calcHist", "cv2.split", "numpy.argmax" ]
[((198, 214), 'cv2.split', 'cv2.split', (['image'], {}), '(image)\n', (207, 214), False, 'import cv2\n'), ((494, 542), 'cv2.calcHist', 'cv2.calcHist', (['[chan]', '[0]', 'None', '[256]', '[0, 256]'], {}), '([chan], [0], None, [256], [0, 256])\n', (506, 542), False, 'import cv2\n'), ((642, 657), 'numpy.argmax', 'np.argm...
import skimage import os import random import matplotlib.pylab as plt from glob import glob import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from skimage import io from skimage.transform import rescale, resize def proc_image_dir(Images_Path): image_classes = sorted([...
[ "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Dense", "sklearn.model_selection.train_test_split", "numpy.ones", "skimage.transform.resize", "tensorflow.keras.models.Sequential", "os.path.join", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.BatchNormalization", "cv2...
[((2161, 2229), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x2', 'y2'], {'test_size': '(0.4)', 'random_state': '(1)', 'stratify': 'y2'}), '(x2, y2, test_size=0.4, random_state=1, stratify=y2)\n', (2177, 2229), False, 'from sklearn.model_selection import train_test_split\n'), ((2314, 2407), 'sklea...
from osgeo import gdal from pathlib import Path from datetime import datetime from subprocess import run, PIPE from numpy import ceil, uint8, where, array, dstack from PIL import Image as PILimage import sys import csv import shutil sys.path.append(str(Path(__file__).parent.parent)) from configs import server_config f...
[ "numpy.dstack", "subprocess.run", "utils.common.clear", "numpy.uint8", "numpy.ceil", "csv.writer", "osgeo.gdal.UseExceptions", "pathlib.Path", "numpy.where", "shutil.rmtree", "osgeo.gdal.Open", "datetime.datetime.now" ]
[((351, 371), 'osgeo.gdal.UseExceptions', 'gdal.UseExceptions', ([], {}), '()\n', (369, 371), False, 'from osgeo import gdal\n'), ((3062, 3080), 'utils.common.clear', 'clear', (['merged_path'], {}), '(merged_path)\n', (3067, 3080), False, 'from utils.common import clear\n'), ((3295, 3328), 'subprocess.run', 'run', (['c...
import sys, glob, os import math import argparse import numpy as np import cv2 from cv2 import aruco from GhostScan.Calibrations.Camera2ScreenCalib import calib # from Camera2ScreenCalib import calib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def geoCalibII(geoCalibImgUndistortFile, displa...
[ "matplotlib.pyplot.show", "cv2.cvtColor", "matplotlib.pyplot.imshow", "os.getcwd", "numpy.zeros", "cv2.imread", "matplotlib.pyplot.figure", "cv2.flip", "numpy.round" ]
[((631, 667), 'cv2.imread', 'cv2.imread', (['geoCalibImgUndistortFile'], {}), '(geoCalibImgUndistortFile)\n', (641, 667), False, 'import cv2\n'), ((685, 725), 'cv2.cvtColor', 'cv2.cvtColor', (['rawImg', 'cv2.COLOR_BGR2GRAY'], {}), '(rawImg, cv2.COLOR_BGR2GRAY)\n', (697, 725), False, 'import cv2\n'), ((740, 770), 'cv2.i...
"""Class for managing a single population""" from environment.utils import get_logistic_growth_rate import numpy as np from scipy.stats import poisson class Population(object): def __init__(self, params): self.t = 0 self.infected = np.zeros( shape=(params['dur'])) # Number of infecte...
[ "numpy.zeros", "numpy.sum", "scipy.stats.poisson.pmf" ]
[((255, 284), 'numpy.zeros', 'np.zeros', ([], {'shape': "params['dur']"}), "(shape=params['dur'])\n", (263, 284), True, 'import numpy as np\n'), ((461, 490), 'numpy.zeros', 'np.zeros', ([], {'shape': "params['dur']"}), "(shape=params['dur'])\n", (469, 490), True, 'import numpy as np\n'), ((611, 640), 'numpy.zeros', 'np...
import time import numpy as np import pandas as pd from collections import defaultdict import json person_category_list = ["Person", "Man", "Woman", "Boy", "Girl"] all_category_list = person_category_list + "None" train_label_json = "D:\\open_images\\1human\\oidv6-train-annotations-human-imagelabels.json" # get ...
[ "pandas.read_csv", "numpy.array" ]
[((347, 374), 'pandas.read_csv', 'pd.read_csv', (['label_map_path'], {}), '(label_map_path)\n', (358, 374), True, 'import pandas as pd\n'), ((387, 412), 'numpy.array', 'np.array', (["df['LabelName']"], {}), "(df['LabelName'])\n", (395, 412), True, 'import numpy as np\n'), ((427, 454), 'numpy.array', 'np.array', (["df['...
import cv2 import numpy as np from afqa_toolbox.features import FeatFDA, FeatLCS, FeatOCL, FeatRVU, FeatOFL, FeatStats, FeatGabor, \ FeatRDI, covcoef, orient, slanted_block_properties, FeatS3PG, FeatSEP, FeatMOW, FeatACUT, FeatSF from afqa_toolbox.tools import normed from time import time # Fingerprint latent = "...
[ "afqa_toolbox.features.FeatOFL.ofl_blocks", "afqa_toolbox.features.FeatOCL.ocl_block", "numpy.ones", "numpy.isnan", "afqa_toolbox.features.slanted_block_properties", "afqa_toolbox.features.FeatMOW.mow_block", "afqa_toolbox.features.FeatSEP.sep_block", "afqa_toolbox.features.FeatLCS.lcs_block", "nump...
[((433, 454), 'cv2.imread', 'cv2.imread', (['latent', '(0)'], {}), '(latent, 0)\n', (443, 454), False, 'import cv2\n'), ((959, 1036), 'afqa_toolbox.features.slanted_block_properties', 'slanted_block_properties', (['image.shape', 'BLK_SIZE', 'SL_BLK_SIZE_X', 'SL_BLK_SIZE_Y'], {}), '(image.shape, BLK_SIZE, SL_BLK_SIZE_X,...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Trains a neural network. For usage information, call with --help. Author: <NAME> """ from __future__ import print_function import os import sys import time from argparse import ArgumentParser from collections import OrderedDict from functools import reduce import...
[ "apex.amp.state_dict", "os.remove", "definitions.config.prepare_argument_parser", "argparse.ArgumentParser", "numpy.iinfo", "torch.autograd.set_detect_anomaly", "definitions.datasets.iterate_infinitely", "torch.device", "torch.no_grad", "definitions.metrics.AverageMetrics", "definitions.models.p...
[((1029, 1062), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': 'descr'}), '(description=descr)\n', (1043, 1062), False, 'from argparse import ArgumentParser\n'), ((2185, 2223), 'definitions.config.prepare_argument_parser', 'config.prepare_argument_parser', (['parser'], {}), '(parser)\n', (2215, 2223)...
import numpy as np import xarray as xr import os import tempfile from segmentation.utils import segmentation_utils, plot_utils import importlib importlib.reload(segmentation_utils) def _generate_deepcell_ouput(fov_num=2): fovs = ["fov" + str(i) for i in range(fov_num)] models = ["pixelwise_interior", "wate...
[ "tempfile.TemporaryDirectory", "numpy.sum", "numpy.zeros", "segmentation.utils.segmentation_utils.segment_images", "numpy.expand_dims", "segmentation.utils.segmentation_utils.extract_single_cell_data", "importlib.reload", "numpy.array_equal", "segmentation.utils.segmentation_utils.watershed_transfor...
[((147, 183), 'importlib.reload', 'importlib.reload', (['segmentation_utils'], {}), '(segmentation_utils)\n', (163, 183), False, 'import importlib\n'), ((3060, 3093), 'numpy.zeros', 'np.zeros', (['(40, 40)'], {'dtype': '"""int16"""'}), "((40, 40), dtype='int16')\n", (3068, 3093), True, 'import numpy as np\n'), ((3271, ...
""" Example program on how to generate a NetCDF file via Python This script contains an example of how to write data to a NetCDF file. This tool can be used to generate NetCDF3 or NetCDF4 with either fixed or unlimited dimensions. This example uses the json files in this directory to configure the NetCDF metadata. Th...
[ "netCDF_utilities.ncgen", "numpy.random.random", "numpy.array", "numpy.linspace" ]
[((759, 779), 'numpy.linspace', 'np.linspace', (['(-90)', '(90)'], {}), '(-90, 90)\n', (770, 779), True, 'import numpy as np\n'), ((787, 806), 'numpy.linspace', 'np.linspace', (['(0)', '(359)'], {}), '(0, 359)\n', (798, 806), True, 'import numpy as np\n'), ((814, 856), 'numpy.array', 'np.array', (['[123456, 123457]'], ...
# coding=utf-8 # Copyright 2021 TUNiB Inc. # Copyright (c) 2020, 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/licens...
[ "numpy.array", "numpy.zeros", "numpy.sum", "oslo.fused_kernels_utils.get_datasets_builder" ]
[((1851, 1886), 'numpy.zeros', 'np.zeros', (['self.size'], {'dtype': 'np.int32'}), '(self.size, dtype=np.int32)\n', (1859, 1886), True, 'import numpy as np\n'), ((1923, 1958), 'numpy.zeros', 'np.zeros', (['self.size'], {'dtype': 'np.int64'}), '(self.size, dtype=np.int64)\n', (1931, 1958), True, 'import numpy as np\n'),...
import cv2 import numpy as np import dlib import time from math import hypot import pyglet # load sound sound = pyglet.media.load("sound.wav",streaming=False) l_sound = pyglet.media.load("left.wav", streaming=False) r_sound = pyglet.media.load("right.wav", streaming=False) # load video cap = cv2.VideoCapture(0) board...
[ "math.hypot", "cv2.bitwise_and", "pyglet.media.load", "cv2.fillPoly", "cv2.rectangle", "cv2.imshow", "dlib.shape_predictor", "cv2.cvtColor", "numpy.max", "cv2.destroyAllWindows", "cv2.resize", "cv2.countNonZero", "cv2.waitKey", "time.sleep", "numpy.min", "dlib.get_frontal_face_detector...
[((113, 160), 'pyglet.media.load', 'pyglet.media.load', (['"""sound.wav"""'], {'streaming': '(False)'}), "('sound.wav', streaming=False)\n", (130, 160), False, 'import pyglet\n'), ((170, 216), 'pyglet.media.load', 'pyglet.media.load', (['"""left.wav"""'], {'streaming': '(False)'}), "('left.wav', streaming=False)\n", (1...
""" <NAME> Date: June 21, 2021 flatten continuum intensity images to correct for limb-darkening use fifth order polynomial and constants from Allen 1973 IDL code here: https://hesperia.gsfc.nasa.gov/ssw/gen/idl/solar/darklimb_correct.pro """ import os import sys import astropy.units as u import sunpy.map from sunp...
[ "SolAster.tools.coord_funcs.get_scales_from_map", "numpy.meshgrid", "sunpy.net.attrs.Sample", "os.path.dirname", "sunpy.net.Fido.fetch", "numpy.arcsin", "SolAster.tools.coord_funcs.get_coordinates", "numpy.isnan", "sunpy.net.attrs.Time", "numpy.where", "numpy.array", "numpy.arange", "numpy.s...
[((537, 558), 'sunpy.net.attrs.Sample', 'a.Sample', (['(24 * u.hour)'], {}), '(24 * u.hour)\n', (545, 558), True, 'from sunpy.net import attrs as a\n'), ((950, 968), 'sunpy.net.Fido.fetch', 'Fido.fetch', (['result'], {}), '(result)\n', (960, 968), False, 'from sunpy.net import Fido\n'), ((1474, 1507), 'SolAster.tools.c...
# -*- coding:utf-8 -*- import json from io import SEEK_CUR, BytesIO from os.path import abspath, join, pardir from struct import unpack import numpy as np from importlib_resources import open_binary from numpy import dtype, fromfile from .global_settings import DTYPE_FORMAT_H, NR_BYTES_H, NR_SHORTCUTS_PER_LAT, TIMEZO...
[ "importlib_resources.open_binary", "numpy.dtype", "os.path.join", "argparse.ArgumentParser" ]
[((2657, 2721), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""parse training parameters"""'}), "(description='parse training parameters')\n", (2680, 2721), False, 'import argparse\n'), ((1523, 1541), 'importlib_resources.open_binary', 'open_binary', (['*args'], {}), '(*args)\n', (1534, ...
#!/usr/bin/env python """ Evaluate deep surface features by computing the minimum distance from each label border vertex to all of the feature vertices in the same sulcus. The label borders run along the deepest parts of many sulci and correspond to fundi in the DKT cortical labeling protocol. Results have been saved ...
[ "mindboggle.guts.mesh.find_neighbors", "numpy.sum", "pandas.read_csv", "numpy.ones", "numpy.isnan", "numpy.shape", "bokeh.plotting.output_file", "numpy.mean", "mindboggle.guts.compute.source_to_target_distances", "bokeh.plotting.save", "os.path.join", "numpy.unique", "mindboggle.mio.vtks.wri...
[((2913, 2926), 'mindboggle.mio.labels.DKTprotocol', 'DKTprotocol', ([], {}), '()\n', (2924, 2926), False, 'from mindboggle.mio.labels import DKTprotocol\n'), ((3209, 3242), 'mindboggle.mio.vtks.read_vtk', 'read_vtk', (['labels_file', '(True)', '(True)'], {}), '(labels_file, True, True)\n', (3217, 3242), False, 'from m...
# Imports import os import data import kmers import numpy import matrix import joblib from sklearn.svm import SVC from sklearn.metrics import classification_report # Function to build the ensemble prediction model def fit(parameters): # Load the training data D_train = data.loadData(parameters["training_fasta"]) # ...
[ "numpy.empty", "joblib.dump", "sklearn.metrics.classification_report", "matrix.generateSamplesTargets", "data.loadData", "kmers.loadKmers", "numpy.max", "numpy.where", "sklearn.svm.SVC", "joblib.load", "os.listdir" ]
[((273, 316), 'data.loadData', 'data.loadData', (["parameters['training_fasta']"], {}), "(parameters['training_fasta'])\n", (286, 316), False, 'import data\n'), ((366, 403), 'os.listdir', 'os.listdir', (["parameters['k_mers_path']"], {}), "(parameters['k_mers_path'])\n", (376, 403), False, 'import os\n'), ((1340, 1361)...
# -*- coding: utf-8 -*- """ code for detecting Spatially Co-evolving Orthologous Modules (SCOMs) <NAME>, Tuller Lab. """ import os import sys import warnings import scipy.io as sio import numpy as np from collections import namedtuple from copy import deepcopy import time ### for the sake of the ex...
[ "numpy.sum", "numpy.random.seed", "scipy.io.loadmat", "numpy.argmax", "numpy.ones", "numpy.argsort", "numpy.arange", "numpy.full", "numpy.max", "numpy.random.shuffle", "numpy.fill_diagonal", "copy.deepcopy", "numpy.minimum", "numpy.isinf", "numpy.sort", "numpy.delete", "numpy.concate...
[((687, 724), 'numpy.random.seed', 'np.random.seed', (["DefModes['rand_seed']"], {}), "(DefModes['rand_seed'])\n", (701, 724), True, 'import numpy as np\n'), ((772, 790), 'copy.deepcopy', 'deepcopy', (['DefModes'], {}), '(DefModes)\n', (780, 790), False, 'from copy import deepcopy\n'), ((1479, 1501), 'numpy.zeros', 'np...
''' A collection of omega-potentials for Dual Averaging @date: May 27, 2015 ''' import numpy as np class OmegaPotential(object): """ Base class for omega potentials """ def phi(self, u): """ Returns phi(u), the value of the zero-potential at the points u""" raise NotImplementedError def...
[ "numpy.zeros_like", "numpy.ones_like", "numpy.log", "numpy.abs", "numpy.maximum", "numpy.minimum", "numpy.exp", "numpy.sqrt" ]
[((1284, 1369), 'numpy.sqrt', 'np.sqrt', (['(C * lpsi * (1 + n * epsilon) / M ** 2 / v ** epsilon / (2 + n * epsilon))'], {}), '(C * lpsi * (1 + n * epsilon) / M ** 2 / v ** epsilon / (2 + n *\n epsilon))\n', (1291, 1369), True, 'import numpy as np\n'), ((1929, 1942), 'numpy.exp', 'np.exp', (['(u - 1)'], {}), '(u - ...
import bisect import cmath import datetime import math import numpy from scipy.optimize import curve_fit def harmonic_model(x, harmonics): return sum( (abs(coef) * math.cos(2 * math.pi * freq * x + cmath.phase(coef))) for freq, coef in harmonics ) class LinearPlusHarmonicPeakModel: ...
[ "numpy.fft.rfft", "numpy.abs", "cmath.phase", "numpy.angle", "math.sin", "scipy.optimize.curve_fit", "numpy.argsort", "numpy.exp", "math.cos", "datetime.datetime.fromtimestamp", "bisect.bisect_left" ]
[((2294, 2323), 'scipy.optimize.curve_fit', 'curve_fit', (['linear_model', 'x', 'y'], {}), '(linear_model, x, y)\n', (2303, 2323), False, 'from scipy.optimize import curve_fit\n'), ((1153, 1197), 'numpy.exp', 'numpy.exp', (['(-(x - mu) ** 2 / (2 * sigma ** 2))'], {}), '(-(x - mu) ** 2 / (2 * sigma ** 2))\n', (1162, 119...
from __future__ import print_function from __future__ import division import cv2 as cv import numpy as np # Create an image r = 100 src = np.zeros((4*r, 4*r), dtype=np.uint8) # Create a sequence of points to make a contour vert = [None]*6 vert[0] = (3*r//2, int(1.34*r)) vert[1] = (1*r, 2*r) vert[2] = (3*...
[ "cv2.line", "cv2.waitKey", "numpy.empty", "numpy.zeros", "cv2.minMaxLoc", "cv2.pointPolygonTest", "cv2.imshow", "cv2.findContours" ]
[((146, 186), 'numpy.zeros', 'np.zeros', (['(4 * r, 4 * r)'], {'dtype': 'np.uint8'}), '((4 * r, 4 * r), dtype=np.uint8)\n', (154, 186), True, 'import numpy as np\n'), ((561, 619), 'cv2.findContours', 'cv.findContours', (['src', 'cv.RETR_TREE', 'cv.CHAIN_APPROX_SIMPLE'], {}), '(src, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)...
import numpy as np from blimpy import GuppiRaw from tests.data import voyager_raw, voyager_block1 def test_guppi(): gr = GuppiRaw(voyager_raw) h1, data_block_x1, data_block_y1 = gr.read_next_data_block_int8() h2, data_block_x2, data_block_y2 = gr.read_next_data_block_int8() assert not np.array_equal...
[ "numpy.array_equal", "numpy.append", "numpy.load", "blimpy.GuppiRaw" ]
[((128, 149), 'blimpy.GuppiRaw', 'GuppiRaw', (['voyager_raw'], {}), '(voyager_raw)\n', (136, 149), False, 'from blimpy import GuppiRaw\n'), ((474, 495), 'blimpy.GuppiRaw', 'GuppiRaw', (['voyager_raw'], {}), '(voyager_raw)\n', (482, 495), False, 'from blimpy import GuppiRaw\n'), ((575, 598), 'numpy.load', 'np.load', (['...
# -*- coding: utf-8 -*- """ ICRH T-resonator Solve the short-circuit lengths at a given frequency. """ import tresonator as T import matplotlib.pyplot as plt import numpy as np f = 62.64e6 # Hz P_in = 20e3 # W add_loss = 1.0 # setup the initial resonator configuration, in which L_DUT and L_CEA # are not the necess...
[ "numpy.asarray", "numpy.imag", "numpy.real", "numpy.linspace", "tresonator.Configuration", "matplotlib.pyplot.subplots" ]
[((384, 454), 'tresonator.Configuration', 'T.Configuration', (['f', 'P_in', 'Lsc_DUT', 'Lsc_CEA'], {'additional_losses': 'add_loss'}), '(f, P_in, Lsc_DUT, Lsc_CEA, additional_losses=add_loss)\n', (399, 454), True, 'import tresonator as T\n'), ((775, 815), 'numpy.linspace', 'np.linspace', (['(61000000.0)', '(64000000.0)...
import cv2 import numpy as np from ir_tracker.utils import calibration_manager import glob calibartion_read = calibration_manager.ImageCalibration.load_yaml( "calibration/picamera_calibration.yml") mtx = calibartion_read.mtx dist = calibartion_read.dist def draw(img, corners, imgpts): corner = tuple(corners[...
[ "cv2.findChessboardCorners", "cv2.cvtColor", "cv2.waitKey", "numpy.float32", "cv2.solvePnP", "numpy.zeros", "cv2.imshow", "cv2.cornerSubPix", "cv2.projectPoints", "cv2.imread", "glob.glob", "ir_tracker.utils.calibration_manager.ImageCalibration.load_yaml", "cv2.destroyAllWindows" ]
[((111, 202), 'ir_tracker.utils.calibration_manager.ImageCalibration.load_yaml', 'calibration_manager.ImageCalibration.load_yaml', (['"""calibration/picamera_calibration.yml"""'], {}), "(\n 'calibration/picamera_calibration.yml')\n", (157, 202), False, 'from ir_tracker.utils import calibration_manager\n'), ((697, 76...
""" This is project utils file. """ import numpy as np import pandas as pd import reference class ProjectUtils(object): """ This is project utils class """ def __init__(self): self.attribute_list = [func for func in dir(ProjectUtils) if callable(getattr(Projec...
[ "textblob.en.sentiments.PatternAnalyzer", "sklearn.ensemble.RandomForestClassifier", "textblob.en.sentiments.NaiveBayesAnalyzer", "sklearn.preprocessing.StandardScaler", "numpy.sum", "pandas.read_csv", "pandas.merge", "sklearn.ensemble.GradientBoostingClassifier", "sklearn.linear_model.LogisticRegre...
[((3971, 3991), 'textblob.en.sentiments.NaiveBayesAnalyzer', 'NaiveBayesAnalyzer', ([], {}), '()\n', (3989, 3991), False, 'from textblob.en.sentiments import NaiveBayesAnalyzer\n'), ((5861, 5878), 'textblob.en.sentiments.PatternAnalyzer', 'PatternAnalyzer', ([], {}), '()\n', (5876, 5878), False, 'from textblob.en.senti...
#!/usr/bin/env python3 import numpy as np from yateto import Tensor, Scalar from yateto.input import parseXMLMatrixFile, parseJSONMatrixFile, memoryLayoutFromFile from yateto.ast.transformer import DeduceIndices, EquivalentSparsityPattern from aderdg import LinearADERDG from multSim import OptionalDimTensor def c...
[ "yateto.Tensor", "yateto.Scalar", "numpy.zeros", "numpy.arange", "numpy.eye", "yateto.input.memoryLayoutFromFile" ]
[((349, 372), 'numpy.arange', 'np.arange', (['n', '(n - k)', '(-1)'], {}), '(n, n - k, -1)\n', (358, 372), True, 'import numpy as np\n'), ((388, 407), 'numpy.arange', 'np.arange', (['(1)', '(k + 1)'], {}), '(1, k + 1)\n', (397, 407), True, 'import numpy as np\n'), ((905, 953), 'yateto.input.memoryLayoutFromFile', 'memo...
import os import sys import numpy as np import pandas as pd from functools import partial # tf.keras definition # these may change depending on your install environments from tensorflow.contrib.keras.api.keras import backend, callbacks from tensorflow.contrib.keras.api.keras.models import Model, load_mode...
[ "pandas.read_csv", "model.real_fake", "os.path.isfile", "tensorflow.contrib.keras.api.keras.backend.clear_session", "model.prediction", "tensorflow.contrib.keras.api.keras.layers.Input", "model.discriminator", "preprocess.normalize_for_train", "model.RandomWeightedAverage", "preprocess.compute_bag...
[((1684, 1719), 'preprocess.normalize_for_train', 'pre.normalize_for_train', (['train_data'], {}), '(train_data)\n', (1707, 1719), True, 'import preprocess as pre\n'), ((1780, 1817), 'preprocess.normalize_for_train', 'pre.normalize_for_train', (['train_labels'], {}), '(train_labels)\n', (1803, 1817), True, 'import prep...
from math import floor import numpy as np def get_voxel_index(position, voxel_size, offset): index = np.array([0,0,0]) index[0] = (floor((position[0] - offset[0]) / voxel_size[0]) + 0) index[1] = (floor((position[1] - offset[1]) / voxel_size[1]) + 0) index[2] = (floor((position[2] - offset[2]) / voxel_size[2])...
[ "numpy.array", "math.floor" ]
[((104, 123), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (112, 123), True, 'import numpy as np\n'), ((136, 184), 'math.floor', 'floor', (['((position[0] - offset[0]) / voxel_size[0])'], {}), '((position[0] - offset[0]) / voxel_size[0])\n', (141, 184), False, 'from math import floor\n'), ((204, 252...
"""Principal Components Analysis autoencoder baseline""" import numpy as np from sklearn.decomposition import PCA from sklearn.preprocessing import scale import argparse class Batcher: """ For batching data too large to fit into memory. Written for one pass on data!!! """ def __init__(self, datafile...
[ "argparse.ArgumentParser", "sklearn.preprocessing.scale", "numpy.square", "numpy.mean", "numpy.array", "sklearn.decomposition.PCA", "numpy.dot" ]
[((2716, 2758), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""PCA autoencoder"""'], {}), "('PCA autoencoder')\n", (2739, 2758), False, 'import argparse\n'), ((1539, 1556), 'numpy.array', 'np.array', (['matlist'], {}), '(matlist)\n', (1547, 1556), True, 'import numpy as np\n'), ((1984, 2011), 'sklearn.prep...
import pandas as pd import numpy as np import sys import math as m # from collections import defaultdict def topsis(): if len(sys.argv)!=5 : raise Exception("please enter four parameters") if sys.argv[1].endswith(('.csv')): pass else: raise Exception("imput file should be of type -...
[ "numpy.amin", "math.sqrt", "pandas.read_csv", "numpy.amax", "sys.exit" ]
[((1744, 1765), 'numpy.amax', 'np.amax', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (1751, 1765), True, 'import numpy as np\n'), ((1806, 1827), 'numpy.amin', 'np.amin', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (1813, 1827), True, 'import numpy as np\n'), ((734, 755), 'pandas.read_csv', 'pd.read_csv', (['f...
import pandas as pd import numpy as np import sys # Intersection data between bed file with coords and common variants intersectFileInput=str(sys.argv[1]) # Yes or no string to only use single variants for common variants onlyIncludeSNPs = str(sys.argv[2]) # Read in the intersecting sites intersectingSites = pd.read_...
[ "pandas.read_csv", "numpy.min", "numpy.median" ]
[((312, 366), 'pandas.read_csv', 'pd.read_csv', (['intersectFileInput'], {'sep': '"""\t"""', 'header': 'None'}), "(intersectFileInput, sep='\\t', header=None)\n", (323, 366), True, 'import pandas as pd\n'), ((1482, 1494), 'numpy.min', 'np.min', (['mafs'], {}), '(mafs)\n', (1488, 1494), True, 'import numpy as np\n'), ((...
# # # 0=================================0 # | Kernel Point Convolutions | # 0=================================0 # # # ---------------------------------------------------------------------------------------------------------------------- # # Class handling ModelNet40 dataset # # ---------------...
[ "pickle.dump", "numpy.sum", "numpy.isnan", "tensorflow.ConfigProto", "numpy.argpartition", "pickle.load", "tensorflow.Variable", "os.path.join", "numpy.prod", "tensorflow.abs", "datasets.common.Dataset.__init__", "os.path.exists", "tensorflow.concat", "numpy.equal", "cpp_wrappers.cpp_sub...
[((1843, 1910), 'cpp_wrappers.cpp_subsampling.grid_subsampling.compute', 'cpp_subsampling.compute', (['points'], {'sampleDl': 'sampleDl', 'verbose': 'verbose'}), '(points, sampleDl=sampleDl, verbose=verbose)\n', (1866, 1910), True, 'import cpp_wrappers.cpp_subsampling.grid_subsampling as cpp_subsampling\n'), ((2804, 28...
import gym from DDQN_Agent import Agent import torch as T import matplotlib.pyplot as plt import numpy as np if __name__ =='__main__': env = gym.make('CartPole-v1') brain = Agent(gamma=0.99, epsilon=1.0, batchSize=16, nActions=2, inputDims=[4], lr=0.001, memSize=50000) scores = [] episodes = 200 l...
[ "matplotlib.pyplot.show", "gym.make", "matplotlib.pyplot.plot", "DDQN_Agent.Agent", "torch.save", "numpy.mean" ]
[((146, 169), 'gym.make', 'gym.make', (['"""CartPole-v1"""'], {}), "('CartPole-v1')\n", (154, 169), False, 'import gym\n'), ((182, 283), 'DDQN_Agent.Agent', 'Agent', ([], {'gamma': '(0.99)', 'epsilon': '(1.0)', 'batchSize': '(16)', 'nActions': '(2)', 'inputDims': '[4]', 'lr': '(0.001)', 'memSize': '(50000)'}), '(gamma=...
from dataclasses import dataclass import json import os import numpy as np import pytest from scipy.optimize import Bounds, root # type: ignore from python_helpers import json_coders class Dummy(json_coders.JsonSerializable): def __init__(self, **kwargs): self.__dict__.update(kwargs) @classmethod ...
[ "os.remove", "json.loads", "python_helpers.json_coders.combine_encoders", "json.dumps", "python_helpers.json_coders.combine_decoders", "scipy.optimize.Bounds", "numpy.random.random", "numpy.array", "scipy.optimize.root", "numpy.all" ]
[((756, 776), 'os.remove', 'os.remove', (['file_path'], {}), '(file_path)\n', (765, 776), False, 'import os\n'), ((888, 935), 'json.dumps', 'json.dumps', (['com'], {'cls': 'json_coders.ComplexEncoder'}), '(com, cls=json_coders.ComplexEncoder)\n', (898, 935), False, 'import json\n'), ((947, 1010), 'json.loads', 'json.lo...
# coding=utf-8 import numpy as np from pypint.problems.i_problem import IProblem from tests import NumpyAwareTestCase class IProblemTest(NumpyAwareTestCase): def setUp(self): self._default = IProblem() def test_takes_a_function(self): def _test_func(): return np.array([np.pi]).re...
[ "unittest.main", "numpy.ones", "pypint.problems.i_problem.IProblem", "numpy.arange", "numpy.array" ]
[((2751, 2766), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2764, 2766), False, 'import unittest\n'), ((206, 216), 'pypint.problems.i_problem.IProblem', 'IProblem', ([], {}), '()\n', (214, 216), False, 'from pypint.problems.i_problem import IProblem\n'), ((365, 407), 'pypint.problems.i_problem.IProblem', 'IPro...
import numpy as np from mahotas.io import error_imread, error_imsave from os import path import mahotas as mh import pytest filename = path.join( path.dirname(__file__), 'data', 'rgba.png') def skip_on(etype): from functools import wraps def skip_on2(test): @wraps(t...
[ "mahotas.demos.load", "os.path.dirname", "pytest.skip", "pytest.raises", "mahotas.io.error_imread", "mahotas.io.pil.imread", "functools.wraps", "mahotas.imread", "numpy.arange" ]
[((159, 181), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (171, 181), False, 'from os import path\n'), ((1061, 1091), 'mahotas.imread', 'mh.imread', (['filename'], {'as_grey': '(1)'}), '(filename, as_grey=1)\n', (1070, 1091), True, 'import mahotas as mh\n'), ((1326, 1347), 'mahotas.demos.load...
import argparse import numpy as np import agent, constants, environment, racetracks TRAINING_EPISODES = 100000 EVALUATION_EPISODES = 100 EVALUATION_FREQUENCY = 10000 def main(args): # validate input assert args.racetrack in racetracks.TRACKS.keys() # create environment track = racetracks.TRACKS[args.racetr...
[ "argparse.ArgumentParser", "agent.MonteCarlo", "numpy.mean", "environment.RacetrackStrict", "racetracks.TRACKS.keys", "environment.Racetrack" ]
[((460, 486), 'agent.MonteCarlo', 'agent.MonteCarlo', (['env', '(0.1)'], {}), '(env, 0.1)\n', (476, 486), False, 'import agent, constants, environment, racetracks\n'), ((1576, 1619), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Solve racetrack."""'], {}), "('Solve racetrack.')\n", (1599, 1619), False, 'i...
import sys import matplotlib.pyplot as plt from networkx import nx import numpy as np import random n = 50 # 10 nodes m = 110 # 20 edges G = nx.gnm_random_graph(n, m) mu = 4 # degree of cheating ec = 0.483/n #level of effort (cooperators) #level of effort (defectors) ed = mu*ec #state of node # if 0 = cooperator (b...
[ "matplotlib.pyplot.show", "random.randint", "numpy.zeros", "networkx.nx.gnm_random_graph", "networkx.nx.draw_networkx", "numpy.exp" ]
[((143, 168), 'networkx.nx.gnm_random_graph', 'nx.gnm_random_graph', (['n', 'm'], {}), '(n, m)\n', (162, 168), False, 'from networkx import nx\n'), ((359, 370), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (367, 370), True, 'import numpy as np\n'), ((1292, 1378), 'networkx.nx.draw_networkx', 'nx.draw_networkx', (['...
import MDAnalysis import numpy as np import matplotlib.pyplot as plt from spectrum import arma_estimate, arma, arma2psd from MDAnalysis.analysis.leaflet import LeafletFinder u = MDAnalysis.Universe('/ExtDrive/maya/Data/Simulation/pepg_bilayer/step7_1/bilayer.gro', '/ExtDrive/maya/Data/Simulatio...
[ "matplotlib.pyplot.loglog", "matplotlib.pyplot.subplot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "spectrum.arma2psd", "MDAnalysis.analysis.leaflet.LeafletFinder", "matplotlib.pyplot.legend", "MDAnalysis.U...
[((179, 341), 'MDAnalysis.Universe', 'MDAnalysis.Universe', (['"""/ExtDrive/maya/Data/Simulation/pepg_bilayer/step7_1/bilayer.gro"""', '"""/ExtDrive/maya/Data/Simulation/pepg_bilayer/step7_1/bilayer.xtc"""'], {}), "(\n '/ExtDrive/maya/Data/Simulation/pepg_bilayer/step7_1/bilayer.gro',\n '/ExtDrive/maya/Data/Simul...
# -*- coding: utf-8 -*- # ''' Created on Thu Jun 8 14:00:08 2017 @author: grizolli ''' import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np from wavepy.utils import rocking_3d_figure import glob import os def plot_whatever(npoints): fig = plt.figure() ax = fig.add...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "wavepy.utils.rocking_3d_figure", "matplotlib.pyplot.figure", "numpy.sinc", "numpy.exp", "numpy.random.rand", "matplotlib.pyplot.pause" ]
[((1429, 1443), 'matplotlib.pyplot.pause', 'plt.pause', (['(0.5)'], {}), '(0.5)\n', (1438, 1443), True, 'import matplotlib.pyplot as plt\n'), ((1994, 2117), 'wavepy.utils.rocking_3d_figure', 'rocking_3d_figure', (['ax', '"""out_050.ogv"""'], {'elevAmp': '(60)', 'azimAmpl': '(60)', 'elevOffset': '(10)', 'azimOffset': '(...
#======================================================================================== # Author: thundercomb # Description: Script to detect similarity between autoencoder model of a text and a text # provided as input to the script. Provides a similarity score (percentage) # indicat...
[ "argparse.ArgumentParser", "torch.autograd.Variable", "torch.load", "os.path.exists", "torch.cat", "pickle.load", "numpy.random.randint", "torch.cuda.is_available", "torch.zeros", "torch.no_grad", "torch.sort", "torch.tensor" ]
[((1387, 1442), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch char-rnn"""'}), "(description='PyTorch char-rnn')\n", (1410, 1442), False, 'import argparse\n'), ((3493, 3524), 'os.path.exists', 'os.path.exists', (['args.checkpoint'], {}), '(args.checkpoint)\n', (3507, 3524), False...
import numpy as np import matplotlib.pyplot as plt from astropy.io import fits from astropy.table import Table from astropy import units as u from astropy.coordinates import SkyCoord import glob import clear.plots def get_footprints(): from mastquery import query, overlaps #CLEAR parent = query.run_query...
[ "astropy.table.Table.read", "mastquery.query.run_query", "clear.plots.polysplit", "numpy.abs", "matplotlib.pyplot.ioff", "mastquery.overlaps.find_overlaps", "numpy.unique", "numpy.log10", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "numpy.array", "numpy.cos", "glob.glob", "...
[((305, 398), 'mastquery.query.run_query', 'query.run_query', ([], {'box': 'None', 'proposal_id': '[14227]', 'instruments': "['WFC3/IR']", 'filters': "['G102']"}), "(box=None, proposal_id=[14227], instruments=['WFC3/IR'],\n filters=['G102'])\n", (320, 398), False, 'from mastquery import query, overlaps\n'), ((413, 5...
import numpy as np import argparse import subprocess POV_Atom_Parameters = {'H': [1, 0.324], 'C': [12, 0.417], 'N': [14, 0.417], 'O': [16, 0.378], 'S': [32, 0.501], 'Ti': [44, 0.8], 'Cu': [58, 0.65], 'Ag': [104, 0.7],...
[ "subprocess.run", "argparse.ArgumentParser", "numpy.around", "numpy.array", "numpy.linalg.norm" ]
[((2102, 2114), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (2110, 2114), True, 'import numpy as np\n'), ((2423, 2448), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (2431, 2448), True, 'import numpy as np\n'), ((2576, 2602), 'numpy.around', 'np.around', (['CoM'], {'decimals': '(2)...
import numpy as np from functools import reduce import random from .builders import build_squares, build_rows, build_columns class ConsistencyError(Exception): pass class DeadLockError(Exception): pass def from_string(input_str, dimension=3): """Build a SudokuBoard from a 81 chars string""" symbols = np.arange(...
[ "numpy.array2string", "numpy.equal", "numpy.any", "numpy.arange", "numpy.argwhere" ]
[((310, 358), 'numpy.arange', 'np.arange', (['(1)', '(dimension ** 2 + 1)'], {'dtype': 'np.int32'}), '(1, dimension ** 2 + 1, dtype=np.int32)\n', (319, 358), True, 'import numpy as np\n'), ((2233, 2261), 'numpy.argwhere', 'np.argwhere', (['(self.board == 0)'], {}), '(self.board == 0)\n', (2244, 2261), True, 'import num...
from models.layers import * import numpy as np import models.utils as utils class GraphVDEncoder(nn.Module): def __init__(self, input_n=[96, 10], act_fn=nn.GELU(), device="cuda", batch_norm=False, p_dropout=0.0): """ :param input_feature: num of input feature :param hidden_feature: num o...
[ "models.utils.define_neurons_layers", "numpy.array" ]
[((6259, 6275), 'numpy.array', 'np.array', (['layers'], {}), '(layers)\n', (6267, 6275), True, 'import numpy as np\n'), ((4189, 4288), 'models.utils.define_neurons_layers', 'utils.define_neurons_layers', (['self.encoder_output_sizes[i]', 'self.encoder_output_sizes[i + 1]', '(2)'], {}), '(self.encoder_output_sizes[i], s...
import midiout import sequence import noteMsg import util import random from Sequence2CmdBlock import Sequence2CmdBlock from collections import defaultdict import numpy as np # 在这里设置传入的mid路径 # midifile = r'E:\Minecraft1.11\.minecraft\saves\DEMO 4-4 Hack - old\data\functions\Toilet Story 4(black remix 262278 notes) .mi...
[ "noteMsg.MsgList", "midiout.toCmd", "Sequence2CmdBlock.Sequence2CmdBlock", "midiout.pitchwheel", "midiout.setprogram", "util.noteParticle", "numpy.array", "sequence.Seq", "fallingEntity.FallingBlock", "midiout.controlchange" ]
[((2263, 2277), 'fallingEntity.FallingBlock', 'FallingBlock', ([], {}), '()\n', (2275, 2277), False, 'from fallingEntity import FallingBlock\n'), ((2523, 2537), 'sequence.Seq', 'sequence.Seq', ([], {}), '()\n', (2535, 2537), False, 'import sequence\n'), ((2548, 2567), 'Sequence2CmdBlock.Sequence2CmdBlock', 'Sequence2Cm...
from keras.datasets import boston_housing from keras import models from keras import layers import numpy as np import matplotlib.pyplot as plt (train_data, train_targets), (test_data, test_targets) = boston_housing.load_data() # Normalize mean = train_data.mean(axis=0) std = train_data.std(axis=0) train_data -= me...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.mean", "keras.layers.Dense", "keras.models.Sequential", "matplotlib.pyplot.xlabel", "numpy.concatenate", "keras.datasets.boston_housing.load_data" ]
[((203, 229), 'keras.datasets.boston_housing.load_data', 'boston_housing.load_data', ([], {}), '()\n', (227, 229), False, 'from keras.datasets import boston_housing\n'), ((1714, 1734), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Epochs"""'], {}), "('Epochs')\n", (1724, 1734), True, 'import matplotlib.pyplot as plt\...
# Copyright (C) 2017 TU Dresden # Licensed under the ISC license (see LICENSE.txt) # # Authors: <NAME>, <NAME> from mocasin.representations.embeddings import ( MetricSpaceEmbeddingBase, MetricSpaceEmbedding, _f_emb_approx, ) from mocasin.representations.metric_spaces import FiniteMetricSpaceLP import nump...
[ "mocasin.representations.metric_spaces.FiniteMetricSpaceLP", "numpy.allclose", "mocasin.representations.embeddings.MetricSpaceEmbeddingBase.calculateEmbeddingMatrix", "mocasin.representations.embeddings.MetricSpaceEmbeddingBase", "numpy.around", "mocasin.representations.embeddings.MetricSpaceEmbedding", ...
[((526, 553), 'mocasin.representations.embeddings.MetricSpaceEmbeddingBase', 'MetricSpaceEmbeddingBase', (['M'], {}), '(M)\n', (550, 553), False, 'from mocasin.representations.embeddings import MetricSpaceEmbeddingBase, MetricSpaceEmbedding, _f_emb_approx\n'), ((922, 960), 'mocasin.representations.metric_spaces.FiniteM...
# License: MIT License import typing import networkx as nx import numpy as np from .structure import Structure class NetworkGraph(object): """Abstracts the infos contained in the Structure class in the form of a directed graph. Has the task of creating all the necessary filtering and indexing structures ...
[ "numpy.meshgrid", "numpy.append", "numpy.array", "networkx.get_node_attributes", "networkx.DiGraph" ]
[((1393, 1405), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (1403, 1405), True, 'import networkx as nx\n'), ((7350, 7373), 'numpy.array', 'np.array', (['[node_states]'], {}), '([node_states])\n', (7358, 7373), True, 'import numpy as np\n'), ((7393, 7426), 'numpy.append', 'np.append', (['T_vector', 'parents_vals...
""" Module containing class representing a distribution whose drawn values are sorted draws from a univariate distribution. Its PDF is represented by: $$f(x_1,x_2,\\ldots,x_N) = \\begin{cases} N!\\ \\prod_{k=1}^Ng(x_k) &\ x_1\\le x_2 \\le \\ldots \\le x_N \\\\ 0 & \\text{otherwise} \\end{cases},$$ where \\(g\\) is the ...
[ "numpy.zeros", "numpy.array", "scipy.special.gammaln", "numpy.diag", "numpy.all" ]
[((6045, 6063), 'numpy.array', 'np.array', (['unsorted'], {}), '(unsorted)\n', (6053, 6063), True, 'import numpy as np\n'), ((13315, 13346), 'numpy.all', 'np.all', (['(point[1:] >= point[:-1])'], {}), '(point[1:] >= point[:-1])\n', (13321, 13346), True, 'import numpy as np\n'), ((14892, 14923), 'numpy.all', 'np.all', (...
import cv2 import torch import torch.nn as nn import numpy.linalg as LA import numpy as np if __name__ == '__main__': f_gt = "test/gt_normal.png" f_pred = "test/pred_normal.png" f_silhou = "test/pred_silhou.png" f_gt_depth = "test/gt_depth.png" f_pred_depth = "test/pred_depth.png" img_gt = cv2.imread(f_gt) ...
[ "cv2.imwrite", "numpy.zeros", "cv2.imread", "numpy.linalg.norm", "numpy.dot" ]
[((302, 318), 'cv2.imread', 'cv2.imread', (['f_gt'], {}), '(f_gt)\n', (312, 318), False, 'import cv2\n'), ((371, 391), 'cv2.imread', 'cv2.imread', (['f_silhou'], {}), '(f_silhou)\n', (381, 391), False, 'import cv2\n'), ((467, 485), 'cv2.imread', 'cv2.imread', (['f_pred'], {}), '(f_pred)\n', (477, 485), False, 'import c...
from typing import List import torch import torch.nn as nn import torch.optim as optim import torch.optim.lr_scheduler as lr_scheduler from torch.utils.data import DataLoader from valence.utils.sascorer import calculateScore as synth_score import rdkit from rdkit import Chem, DataStructs from rdkit.Chem import AllChem...
[ "argparse.ArgumentParser", "random.shuffle", "rdkit.RDLogger.logger", "hgraph.HierVAE", "torch.device", "hgraph.MoleculeDataset", "torch.no_grad", "hgraph.PairVocab", "os.path.join", "torch.utils.data.DataLoader", "torch.load", "rdkit.DataStructs.BulkTanimotoSimilarity", "random.seed", "va...
[((3107, 3130), 'rdkit.RDLogger.logger', 'rdkit.RDLogger.logger', ([], {}), '()\n', (3128, 3130), False, 'import rdkit\n'), ((3186, 3211), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3209, 3211), False, 'import argparse\n'), ((4772, 4800), 'torch.manual_seed', 'torch.manual_seed', (['args.s...
# -*- coding: utf-8 -*- from surprise import NormalPredictor, Reader, Dataset, KNNBasic, KNNBaseline, accuracy from surprise.model_selection import train_test_split, LeaveOneOut from collections import defaultdict import csv, sys, os import numpy as np import itertools import random class Endorsem...
[ "surprise.KNNBaseline", "numpy.random.seed", "surprise.Dataset.load_from_file", "csv.reader", "surprise.Reader", "os.path.dirname", "collections.defaultdict", "itertools.combinations", "surprise.KNNBasic", "random.seed", "surprise.NormalPredictor", "surprise.accuracy.mae", "surprise.model_se...
[((16507, 16524), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (16521, 16524), True, 'import numpy as np\n'), ((16526, 16540), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (16537, 16540), False, 'import random\n'), ((16776, 16836), 'surprise.KNNBasic', 'KNNBasic', ([], {'sim_options': "{'name...
import time import numpy as np import tensorflow as tf from helpers import console_logger _NUM_SAMPLES = 2 _DATA_SHAPE = (10, 5) # time, num_features _BATCH_SIZE = 1 _NUM_INSTANCES = 1 # > 1 not supported _BANDWIDTH_RANGE = (2, 5) _AXIS = 1 LOGGER = console_logger('tensorflow', "INFO") # TODO: # # DONE: # - Time...
[ "tensorflow.ones", "tensorflow.random.uniform", "tensorflow.transpose", "time.sleep", "numpy.random.standard_normal", "tensorflow.data.Dataset.from_generator", "helpers.console_logger", "tensorflow.zeros", "tensorflow.boolean_mask" ]
[((255, 291), 'helpers.console_logger', 'console_logger', (['"""tensorflow"""', '"""INFO"""'], {}), "('tensorflow', 'INFO')\n", (269, 291), False, 'from helpers import console_logger\n'), ((462, 478), 'time.sleep', 'time.sleep', (['(0.03)'], {}), '(0.03)\n', (472, 478), False, 'import time\n'), ((734, 865), 'tensorflow...
import sys import numpy as np if __name__ == "__main__": if len(sys.argv) != 2: print("Usage: inp_basis") sys.exit(1) inp = sys.argv[1] out = "" buf = [] with open(inp, "r") as f: out += f.readline() buf = [line for line in f] n = len(buf) # grep exp...
[ "numpy.argsort", "sys.exit" ]
[((128, 139), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (136, 139), False, 'import sys\n'), ((427, 443), 'numpy.argsort', 'np.argsort', (['exps'], {}), '(exps)\n', (437, 443), True, 'import numpy as np\n')]
#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().run_line_magic("matplotlib", "inline") import cv2, matplotlib import numpy as np from skimage.morphology import ( skeletonize, skeletonize_3d, medial_axis, thin, local_minima, local_maxima, ) from skimage.transform import rescale, ...
[ "floorplan_analysis.get_unit_mask", "skimage.transform.rescale", "pandas.read_csv", "matplotlib.pyplot.figure", "numpy.rot90", "cv2.erode", "numpy.unique", "cv2.cvtColor", "matplotlib.pyplot.imshow", "numpy.bitwise_or.reduce", "skimage.morphology.skeletonize", "cv2.connectedComponents", "flo...
[((1023, 1044), 'pandas.read_csv', 'pd.read_csv', (['path_csv'], {}), '(path_csv)\n', (1034, 1044), True, 'import pandas as pd\n'), ((1121, 1170), 'floorplan_analysis.read_bgr_from_image_unicode', 'read_bgr_from_image_unicode', (['f"""/fp_img/{id_}.jpg"""'], {}), "(f'/fp_img/{id_}.jpg')\n", (1148, 1170), False, 'from f...
# Copyright (c) 2021 PaddlePaddle 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 applic...
[ "paddle.nn.Embedding", "onnxbase.APIOnnx", "numpy.arange" ]
[((1353, 1397), 'onnxbase.APIOnnx', 'APIOnnx', (['op', '"""nn_Embedding"""', '[9, 10, 11, 12]'], {}), "(op, 'nn_Embedding', [9, 10, 11, 12])\n", (1360, 1397), False, 'from onnxbase import APIOnnx\n'), ((850, 969), 'paddle.nn.Embedding', 'paddle.nn.Embedding', ([], {'num_embeddings': '(10)', 'embedding_dim': '(3)', 'pad...
import time import torch import random import numpy as np from itertools import chain from torch import nn, optim import torch.utils.data as data import torch.nn.functional as F from corpus_process import Corpus, create_embedding_matrix, MyDataset from sklearn.metrics import roc_auc_score, precision_score, recall_score...
[ "torch.mean", "torch.utils.data.DataLoader", "random.shuffle", "sklearn.metrics.accuracy_score", "numpy.zeros", "sklearn.metrics.recall_score", "time.time", "sklearn.metrics.roc_auc_score", "corpus_process.MyDataset", "sklearn.metrics.f1_score", "random.random", "torch.cuda.is_available", "t...
[((4811, 4859), 'sklearn.metrics.accuracy_score', 'accuracy_score', (['true_labels', 'current_pred_labels'], {}), '(true_labels, current_pred_labels)\n', (4825, 4859), False, 'from sklearn.metrics import roc_auc_score, precision_score, recall_score, accuracy_score, f1_score\n'), ((4870, 4919), 'sklearn.metrics.precisio...
"""Testing DB insert values.""" import os from numpy import genfromtxt from ideotype import WeaData, Sims, Params from ideotype.data import DATA_PATH # point to test files fpath_wea = os.path.join(DATA_PATH, 'test_data', 'wea', '725300_1964.txt') fpath_sim = os.path.join(DATA_PATH, 'test_data', 'sims', 'test', '1964'...
[ "os.path.join", "numpy.genfromtxt" ]
[((186, 248), 'os.path.join', 'os.path.join', (['DATA_PATH', '"""test_data"""', '"""wea"""', '"""725300_1964.txt"""'], {}), "(DATA_PATH, 'test_data', 'wea', '725300_1964.txt')\n", (198, 248), False, 'import os\n'), ((261, 364), 'os.path.join', 'os.path.join', (['DATA_PATH', '"""test_data"""', '"""sims"""', '"""test"""'...
# -*- coding: utf-8 -*- """ Store and calculate various statistic of kmer (1). (1) Viral Phylogenomics using an alignment-free method: A three step approach to determine optimal length of k-mer """ import math import h5py import numpy as np from scipy.interpolate import interp1d import scipy.sparse as sp import...
[ "ksiga.kmerutil.trimFront", "numpy.ones", "numpy.clip", "numpy.argsort", "numpy.arange", "ksiga.kmerutil.trimBack", "scipy.interpolate.interp1d", "ksiga.sparse_util.has_indices", "numpy.insert", "ksiga.kmerutil.create_kmer_loc_fn", "numpy.linspace", "math.log", "ksiga.sparse_util.searchsorte...
[((790, 818), 'ksiga.ksignature.KmerSignature', 'KmerSignature', (['indexFilename'], {}), '(indexFilename)\n', (803, 818), False, 'from ksiga.ksignature import KmerSignature\n'), ((1465, 1503), 'ksiga.kmerutil.create_kmer_loc_fn', 'kmerutil.create_kmer_loc_fn', (['(ksize - 1)'], {}), '(ksize - 1)\n', (1492, 1503), Fals...
""" Supplement for Embodied AI exercise Simplified version of DAC example from lecture slides Lecture 6 (part ii) 2017 <NAME> Environment: 1-dimensional arena enclosed by two boundaries Robot: Velocity controlled robot moving back and forth in the arena Sensors: Collision, Proximity, unused: Velocity, Velocity pr...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "numpy.random.uniform", "numpy.outer", "matplotlib.pyplot.show", "argparse.ArgumentParser", "matplotlib.pyplot.plot", "numpy.abs", "matplotlib.pyplot.suptitle", "numpy.sum", "matplotlib.pyplot.legend", "numpy.zeros", "numpy.mean", "nu...
[((2389, 2449), 'matplotlib.pyplot.suptitle', 'plt.suptitle', (['"""Hebbian learning quasi-DAC / fixed delay ISO"""'], {}), "('Hebbian learning quasi-DAC / fixed delay ISO')\n", (2401, 2449), True, 'import matplotlib.pyplot as plt\n'), ((2454, 2470), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(411)'], {}), '(411)\n...
import unittest import numpy import chainer from chainer import cuda from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition from fcis import functions class TestPSROIPolling2D(unittest.TestCase): def setUp(self): self.N = 3...
[ "chainer.Variable", "numpy.random.uniform", "fcis.functions.psroi_pooling_2d", "fcis.functions.PSROIPooling2D", "chainer.cuda.to_cpu", "numpy.array", "chainer.cuda.to_gpu", "numpy.arange", "chainer.testing.run_module", "chainer.testing.condition.retry", "numpy.random.shuffle" ]
[((2667, 2705), 'chainer.testing.run_module', 'testing.run_module', (['__name__', '__file__'], {}), '(__name__, __file__)\n', (2685, 2705), False, 'from chainer import testing\n'), ((1766, 1784), 'chainer.testing.condition.retry', 'condition.retry', (['(3)'], {}), '(3)\n', (1781, 1784), False, 'from chainer.testing imp...
import numpy as np import femnurbs.SplineUsefulFunctions as SUF class BaseSpline: def __doc__(self): """ This function is recursivly determined like N_{i, 0}(u) = { 1 if U[i] <= u < U[i+1] { 0 else u - U[i] N_{...
[ "numpy.zeros", "numpy.ones", "numpy.any", "numpy.arange", "femnurbs.SplineUsefulFunctions.isValidU", "numpy.array" ]
[((1422, 1454), 'femnurbs.SplineUsefulFunctions.isValidU', 'SUF.isValidU', (['U'], {'throwError': '(True)'}), '(U, throwError=True)\n', (1434, 1454), True, 'import femnurbs.SplineUsefulFunctions as SUF\n'), ((1953, 1987), 'numpy.zeros', 'np.zeros', (['(self.n + 1, self.p + 1)'], {}), '((self.n + 1, self.p + 1))\n', (19...
#!/usr/bin/python # -*- coding: utf-8 -*- import os import gym import json import numpy as np import lugarrl.envs as deeprm EPISODES = 1 MAX_EPISODE_LENGTH = 200 def sjf_action(observation): "Selects the job SJF (Shortest Job First) would select." current, wait, _, _ = observation best = wait.shape[2] ...
[ "json.load", "numpy.sum", "gym.make", "os.path.exists", "numpy.ones", "numpy.hstack", "numpy.all" ]
[((1103, 1144), 'numpy.hstack', 'np.hstack', (['(current, wait, backlog, time)'], {}), '((current, wait, backlog, time))\n', (1112, 1144), True, 'import numpy as np\n'), ((1202, 1236), 'os.path.exists', 'os.path.exists', (['"""config/test.json"""'], {}), "('config/test.json')\n", (1216, 1236), False, 'import os\n'), ((...
# Copyright (C) 2017 <NAME> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or (at # your option) any later version. # This program is distributed in the hope ...
[ "subprocess.Popen", "gzip.open", "argparse.ArgumentParser", "prody.parsePDBStream", "substructures.find_substructures", "numpy.zeros", "Bio.pairwise2.align.globalms", "numpy.max", "substructures.calc_co", "numpy.linalg.norm", "itertools.product" ]
[((3689, 3705), 'numpy.zeros', 'np.zeros', (['(n, n)'], {}), '((n, n))\n', (3697, 3705), True, 'import numpy as np\n'), ((5036, 5056), 'numpy.zeros', 'np.zeros', (['(wtn, wtn)'], {}), '((wtn, wtn))\n', (5044, 5056), True, 'import numpy as np\n'), ((5070, 5090), 'numpy.zeros', 'np.zeros', (['(wtn, wtn)'], {}), '((wtn, w...
import sys import numpy as np import chainer import chainer.functions as F import chainer.links as L from chainer import cuda from chainer import initializers from chainer.functions.loss import softmax_cross_entropy from chainer.functions.math import minmax import constants import util import models.util from models...
[ "chainer.links.EmbedID", "chainer.Variable", "models.common.BiaffineCombination", "chainer.functions.math.minmax.argmax", "numpy.float32", "chainer.cuda.get_array_module", "numpy.zeros", "chainer.cuda.to_cpu", "chainer.functions.dropout", "chainer.functions.concat", "chainer.no_backprop_mode", ...
[((14018, 14049), 'chainer.Variable', 'chainer.Variable', (['mat[n_dummy:]'], {}), '(mat[n_dummy:])\n', (14034, 14049), False, 'import chainer\n'), ((14264, 14287), 'numpy.zeros', 'np.zeros', (['n1'], {'dtype': '"""i"""'}), "(n1, dtype='i')\n", (14272, 14287), True, 'import numpy as np\n'), ((6459, 6487), 'chainer.cuda...
"""Tool for solving systems of linear equations using Cholesky decomposition Functions: solve_system(A, b) -> ndarray decomposition(matrix) -> ndarray print_log() -> None """ import numpy as np import cmath from os.path import abspath as os_abspath, join as os_join lib_path = os_abspath(os_join(__file__,...
[ "sys.path.append", "numpy.conj", "gaussel.solve_system", "numpy.zeros", "os.path.join" ]
[((390, 415), 'sys.path.append', 'sys_path.append', (['lib_path'], {}), '(lib_path)\n', (405, 415), True, 'from sys import path as sys_path\n'), ((303, 355), 'os.path.join', 'os_join', (['__file__', '""".."""', '""".."""', '"""GaussianElimination"""'], {}), "(__file__, '..', '..', 'GaussianElimination')\n", (310, 355),...
# -*- coding: utf-8 -*- """ Repair strategy for guide based blending """ __version__ = '1.0' __author__ = '<NAME>' import sys import numpy as np sys.path.append(r'C:\BELLA') #from src.divers.pretty_print import print_lampam, print_ss, print_list_ss from src.BELLA.format_pdl import convert_ss_to_sst from ...
[ "sys.path.append", "src.RELAY.thick_to_thin.repair_thick_to_thin", "numpy.copy", "src.RELAY.thin_to_thick.repair_thin_to_thick", "src.RELAY.repair_reference_panel.repair_reference_panel", "src.BELLA.format_pdl.convert_ss_to_sst" ]
[((157, 185), 'sys.path.append', 'sys.path.append', (['"""C:\\\\BELLA"""'], {}), "('C:\\\\BELLA')\n", (172, 185), False, 'import sys\n'), ((1936, 2047), 'src.RELAY.repair_reference_panel.repair_reference_panel', 'repair_reference_panel', (['multipanel', 'reduced_ss', 'constraints', 'parameters', 'obj_func_param', 'redu...
# -*- coding: utf-8 -*- from __future__ import absolute_import import numpy as np import scipy.signal from keras.models import Sequential from keras.layers.convolutional import Convolution1D from keras.layers import Input, Lambda, merge, Permute, Reshape from keras.models import Model from keras import backend as K d...
[ "keras.backend.max", "numpy.multiply", "keras.models.Model", "keras.backend.image_dim_ordering", "keras.backend.log", "numpy.sin", "keras.layers.Lambda", "keras.backend.maximum", "numpy.cos", "keras.layers.Permute", "keras.layers.Input", "keras.models.Sequential", "keras.layers.Reshape", "...
[((1609, 1650), 'numpy.multiply', 'np.multiply', (['dft_real_kernels', 'dft_window'], {}), '(dft_real_kernels, dft_window)\n', (1620, 1650), True, 'import numpy as np\n'), ((1674, 1715), 'numpy.multiply', 'np.multiply', (['dft_imag_kernels', 'dft_window'], {}), '(dft_imag_kernels, dft_window)\n', (1685, 1715), True, 'i...
import numpy as np def foldAt(time, period, T0=0.0, sortphase=False, centralzero=False, getEpoch=False): """ Fold time series with a particular period. Calculate the phase, P, from time, period, and reference point, T0, according to .. math:: P = (time - T0)/period - [(time-T0)/per...
[ "numpy.argsort", "numpy.floor", "numpy.where" ]
[((2035, 2065), 'numpy.floor', 'np.floor', (['((time - T0) / period)'], {}), '((time - T0) / period)\n', (2043, 2065), True, 'import numpy as np\n'), ((2238, 2255), 'numpy.argsort', 'np.argsort', (['phase'], {}), '(phase)\n', (2248, 2255), True, 'import numpy as np\n'), ((2147, 2169), 'numpy.where', 'np.where', (['(pha...
import numpy as np import logging from numpy import fft as ft import functions as fn from scipy import integrate from scipy import interpolate """ Functions for k-space (power spectrum) calculations """ def real_to_powsph(func, x, y, z): """ Convert real function to a spherically averaged power spectrum, ...
[ "numpy.conj", "numpy.meshgrid", "numpy.abs", "numpy.ceil", "numpy.count_nonzero", "numpy.allclose", "numpy.fft.rfftn", "numpy.fft.rfftfreq", "numpy.fft.fftfreq", "numpy.mean", "numpy.histogram", "numpy.real", "numpy.linspace", "numpy.sqrt" ]
[((1725, 1739), 'numpy.real', 'np.real', (['power'], {}), '(power)\n', (1732, 1739), True, 'import numpy as np\n'), ((2175, 2189), 'numpy.real', 'np.real', (['power'], {}), '(power)\n', (2182, 2189), True, 'import numpy as np\n'), ((2763, 2819), 'numpy.abs', 'np.abs', (['((x[-1] - x[0]) * (y[-1] - y[0]) * (z[-1] - z[0]...
import numpy as np class MultipleShootingNode: """ Data structure used for multiple shooting. """ def __init__(self, size_y, size_z, size_p): self.size_y = size_y self.size_z = size_z self.size_p = size_p self.A = np.zeros(0) self.C = np.zeros(0) self.H ...
[ "numpy.zeros", "numpy.copy" ]
[((264, 275), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (272, 275), True, 'import numpy as np\n'), ((293, 304), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (301, 304), True, 'import numpy as np\n'), ((322, 333), 'numpy.zeros', 'np.zeros', (['(0)'], {}), '(0)\n', (330, 333), True, 'import numpy as np\n')...
import numpy as np from pyomo.environ import * # 导入该模块所有函数 from pyomo.dae import * import math class Walk: def __init__(self, state, reference): # state be a 1 * 8 array # reference be a 4 * predict_step array, which concludes theta fy and x reference m = ConcreteModel() length4re...
[ "math.log", "numpy.size" ]
[((330, 351), 'numpy.size', 'np.size', (['reference', '(1)'], {}), '(reference, 1)\n', (337, 351), True, 'import numpy as np\n'), ((7502, 7523), 'numpy.size', 'np.size', (['reference', '(1)'], {}), '(reference, 1)\n', (7509, 7523), True, 'import numpy as np\n'), ((15479, 15493), 'math.log', 'math.log', (['m.l2'], {}), ...
import numpy as np from astropy.table import Table import tau_eff print("---------calculating tau_eff--------") low_tau, low_z, low_mask, low_zmed = tau_eff.composite("lowz") print("the lowz bin found",len(low_tau), "valid indicies from which to measure tau_eff") hi_tau, hi_z, hi_mask, hi_zmed = tau_eff.composite("...
[ "tau_eff.composite", "numpy.save", "numpy.append", "tau_eff.bootstrap", "numpy.array", "numpy.concatenate" ]
[((151, 176), 'tau_eff.composite', 'tau_eff.composite', (['"""lowz"""'], {}), "('lowz')\n", (168, 176), False, 'import tau_eff\n'), ((301, 325), 'tau_eff.composite', 'tau_eff.composite', (['"""hiz"""'], {}), "('hiz')\n", (318, 325), False, 'import tau_eff\n'), ((491, 539), 'tau_eff.bootstrap', 'tau_eff.bootstrap', (['"...
import json import os import re from collections import defaultdict import numpy import torch from matplotlib import pyplot as plt from tqdm import tqdm from transformers import AutoModelForCausalLM, AutoTokenizer from util import nethook def main(): import argparse parser = argparse.ArgumentParser(descript...
[ "numpy.load", "argparse.ArgumentParser", "transformers.AutoModelForCausalLM.from_pretrained", "collections.defaultdict", "os.path.isfile", "util.nethook.set_requires_grad", "torch.no_grad", "matplotlib.pyplot.close", "os.path.dirname", "numpy.random.RandomState", "torch.softmax", "matplotlib.p...
[((288, 341), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Causal Tracing"""'}), "(description='Causal Tracing')\n", (311, 341), False, 'import argparse\n'), ((946, 984), 'os.makedirs', 'os.makedirs', (['result_dir'], {'exist_ok': '(True)'}), '(result_dir, exist_ok=True)\n', (957, 984)...
import chainer from chainer.dataset.convert import concat_examples from chainer import link, cuda from chainer.iterators import SerialIterator import numpy def _to_tuple(x): if not isinstance(x, tuple): x = (x,) return x def _extract_numpy(x): if isinstance(x, chainer.Variable): x = x.da...
[ "chainer.cuda.get_device_from_id", "numpy.concatenate", "chainer.cuda.to_cpu", "chainer.iterators.SerialIterator" ]
[((334, 348), 'chainer.cuda.to_cpu', 'cuda.to_cpu', (['x'], {}), '(x)\n', (345, 348), False, 'from chainer import link, cuda\n'), ((2813, 2884), 'chainer.iterators.SerialIterator', 'SerialIterator', (['data'], {'batch_size': 'batchsize', 'repeat': '(False)', 'shuffle': '(False)'}), '(data, batch_size=batchsize, repeat=...
#!/usr/bin/env python # coding: utf-8 # # Gale-Shapley (Deferred Acceptance Algorithm) # In[845]: import pandas as pd import numpy as np import matplotlib.pyplot as plt get_ipython().run_line_magic('matplotlib', 'inline') # ## 1. Generate Preferences of Men and Women # In[864]: n_m = 200 #number of men n_w ...
[ "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.zeros", "numpy.arange", "numpy.random.shuffle" ]
[((377, 412), 'numpy.zeros', 'np.zeros', (['(n_m, n_w + 1)'], {'dtype': 'int'}), '((n_m, n_w + 1), dtype=int)\n', (385, 412), True, 'import numpy as np\n'), ((414, 449), 'numpy.zeros', 'np.zeros', (['(n_w, n_m + 1)'], {'dtype': 'int'}), '((n_w, n_m + 1), dtype=int)\n', (422, 449), True, 'import numpy as np\n'), ((615, ...
import sequence from numpy import random from sequence.kernel.timeline import Timeline from sequence.topology.topology import Topology from sequence.topology.node import * import math, sys import networkx as nx import matplotlib.pyplot as plt random.seed(0) network_config = "../example/test_topology.json" tl = Timeli...
[ "sequence.topology.topology.Topology", "numpy.random.seed", "sequence.kernel.timeline.Timeline" ]
[((244, 258), 'numpy.random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (255, 258), False, 'from numpy import random\n'), ((314, 339), 'sequence.kernel.timeline.Timeline', 'Timeline', (['(4000000000000.0)'], {}), '(4000000000000.0)\n', (322, 339), False, 'from sequence.kernel.timeline import Timeline\n'), ((344, 372)...
import cv2 import numpy as np import os from csv import reader import config as cfg def get_calibration_point_intervals(location, recording="000", starting_frame=10): """ Returns calibration point intervals as a list for the given calibration video. location is the path to video result root folder ...
[ "cv2.warpPerspective", "os.path.abspath", "csv.reader", "os.path.isdir", "cv2.waitKey", "numpy.float32", "numpy.zeros", "cv2.VideoCapture", "numpy.min", "numpy.array", "os.path.join", "os.listdir" ]
[((449, 495), 'os.path.join', 'os.path.join', (['location', 'recording', '"""world.mp4"""'], {}), "(location, recording, 'world.mp4')\n", (461, 495), False, 'import os\n'), ((508, 541), 'cv2.VideoCapture', 'cv2.VideoCapture', (['video_file_path'], {}), '(video_file_path)\n', (524, 541), False, 'import cv2\n'), ((563, 6...
import os from glob import glob import argparse import numpy as np import pandas as pd import csv from lifelines import CoxPHFitter def array2dataframe(A, names): assert A.shape[1] == len(names), 'columns of array should match length of names' dict_ = dict() for idx, name in enumerate(names): dic...
[ "pandas.DataFrame", "numpy.load", "csv.reader", "argparse.ArgumentParser", "lifelines.CoxPHFitter", "numpy.zeros", "numpy.concatenate" ]
[((352, 371), 'pandas.DataFrame', 'pd.DataFrame', (['dict_'], {}), '(dict_)\n', (364, 371), True, 'import pandas as pd\n'), ((1557, 1582), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1580, 1582), False, 'import argparse\n'), ((2525, 2571), 'numpy.zeros', 'np.zeros', (['(N_train, 2)'], {'dty...
import functools import numpy as np import random from typing import List from federatedml.util import consts from federatedml.secureprotol import PaillierEncrypt from federatedml.ensemble.basic_algorithms import HeteroDecisionTreeGuest, HeteroDecisionTreeHost, \ HeteroFastDecisionTreeGuest, HeteroFastDecisionTreeH...
[ "numpy.stack", "functools.partial", "federatedml.util.LOGGER.info", "numpy.sum", "random.SystemRandom", "numpy.zeros", "numpy.max", "numpy.array", "federatedml.secureprotol.PaillierEncrypt" ]
[((894, 931), 'numpy.zeros', 'np.zeros', (['tree_num'], {'dtype': 'np_int_type'}), '(tree_num, dtype=np_int_type)\n', (902, 931), True, 'import numpy as np\n'), ((954, 987), 'numpy.zeros', 'np.zeros', (['tree_num'], {'dtype': 'np.bool'}), '(tree_num, dtype=np.bool)\n', (962, 987), True, 'import numpy as np\n'), ((2489,...
import numpy as np import argparse import json from engine.pyalice import Application, Cask from engine.pyalice.Composite import create_composite_message ''' Moves a robot arm based on joint waypoints to pickup and dropoff a box between two pre-defined locations repeatedly. In the UR10 use case it also visualizes 3d p...
[ "json.load", "engine.pyalice.Composite.create_composite_message", "argparse.ArgumentParser", "numpy.dtype", "engine.pyalice.Application", "engine.pyalice.Cask" ]
[((602, 646), 'engine.pyalice.Composite.create_composite_message', 'create_composite_message', (['quantities', 'values'], {}), '(quantities, values)\n', (626, 646), False, 'from engine.pyalice.Composite import create_composite_message\n'), ((936, 966), 'engine.pyalice.Cask', 'Cask', (['cask_root'], {'writable': '(True)...
import argparse from argparse import Namespace from collections import Counter import itertools from pathlib import Path import pickle import gluonnlp as nlp import numpy as np from omegaconf import OmegaConf import pandas as pd from src.utils.preprocessing import PadSequence, PreProcessor from src.utils.tokenization...
[ "itertools.chain.from_iterable", "numpy.random.uniform", "src.utils.vocab.Vocab", "omegaconf.OmegaConf.save", "pickle.dump", "argparse.ArgumentParser", "src.utils.preprocessing.PadSequence", "pandas.read_csv", "omegaconf.OmegaConf.load", "pathlib.Path", "gluonnlp.Vocab", "numpy.var", "gluonn...
[((444, 456), 'pathlib.Path', 'Path', (['"""conf"""'], {}), "('conf')\n", (448, 456), False, 'from pathlib import Path\n'), ((729, 765), 'omegaconf.OmegaConf.load', 'OmegaConf.load', (['pipeline_config_path'], {}), '(pipeline_config_path)\n', (743, 765), False, 'from omegaconf import OmegaConf\n'), ((962, 1002), 'omega...
from __future__ import print_function import json from pprint import pprint import time import itertools import operator from mpi4py import MPI import numpy as np # get start time start_time = time.time() comm = MPI.COMM_WORLD size = comm.Get_size() rank = comm.Get_rank() def construct_melb_grid(file_name): """P...
[ "numpy.array_split", "json.load", "pprint.pprint", "time.time" ]
[((195, 206), 'time.time', 'time.time', ([], {}), '()\n', (204, 206), False, 'import time\n'), ((449, 461), 'json.load', 'json.load', (['f'], {}), '(f)\n', (458, 461), False, 'import json\n'), ((2671, 2704), 'numpy.array_split', 'np.array_split', (['coords_data', 'size'], {}), '(coords_data, size)\n', (2685, 2704), Tru...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import argparse import sys import tensorflow as tf from sklearn.model_selection import KFold # Parameters batch_size = 5 training_epochs = 10 display_step = 1 window_size = 11 internal_chan...
[ "numpy.load", "numpy.argmax", "tensorflow.Variable", "tensorflow.nn.conv1d", "tensorflow.InteractiveSession", "tensorflow.truncated_normal", "tensorflow.nn.softmax", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.placeholder_with_default", "tensorflow.placeholder", "numpy.average...
[((586, 609), 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""'], {}), "('float')\n", (600, 609), True, 'import tensorflow as tf\n'), ((4942, 4969), 'numpy.load', 'np.load', (['"""data/cullpdb.npy"""'], {}), "('data/cullpdb.npy')\n", (4949, 4969), True, 'import numpy as np\n'), ((5070, 5129), 'numpy.concatena...
import numpy as np import pyx def linear_x(shell, x_min: float, x_max: float, y_min: float, y_max: float, inc: float): """ Creates a linear infill along the x axis """ mesh_lines = [] for x in np.arange(x_min, x_max, inc): line = pyx.path.line(x, y_min, x, y_max) intersects, _ = line.intersect(shell) if ...
[ "numpy.arange", "pyx.path.line" ]
[((200, 228), 'numpy.arange', 'np.arange', (['x_min', 'x_max', 'inc'], {}), '(x_min, x_max, inc)\n', (209, 228), True, 'import numpy as np\n'), ((240, 273), 'pyx.path.line', 'pyx.path.line', (['x', 'y_min', 'x', 'y_max'], {}), '(x, y_min, x, y_max)\n', (253, 273), False, 'import pyx\n'), ((435, 464), 'pyx.path.line', '...
import os import numpy as np from tkinter import * from tkinter import ttk, font from tkinter.filedialog import askopenfilename from AppFunctions import loadModels from HMM.Viterbi import concatModels, performViterbiForPrediction, trackBackwardPointerForPrediction from AppStyling import styleElements # Setup Print Opti...
[ "numpy.set_printoptions", "HMM.Viterbi.concatModels", "os.path.basename", "os.getcwd", "tkinter.ttk.Radiobutton", "numpy.genfromtxt", "tkinter.font.Font", "tkinter.ttk.Style", "tkinter.ttk.Treeview", "AppStyling.styleElements", "HMM.Viterbi.performViterbiForPrediction", "AppFunctions.loadModel...
[((324, 371), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(2)', 'suppress': '(True)'}), '(precision=2, suppress=True)\n', (343, 371), True, 'import numpy as np\n'), ((478, 531), 'tkinter.font.Font', 'font.Font', ([], {'family': '"""Helvetica"""', 'size': '(16)', 'weight': '"""bold"""'}), "(fami...
import mayavi.mlab as mlab import numpy as np def plot3Dboxes(corners): for i in range(corners.shape[0]): corner = corners[i] plot3Dbox(corner) def plot3Dbox(corner): idx = np.array([0, 1, 2, 3, 0, 4, 5, 6, 7, 4, 5, 1, 2, 6, 7, 3]) x = corner[0, idx] y = corner[1, idx] z = corner[2...
[ "mayavi.mlab.show", "mayavi.mlab.plot3d", "numpy.array" ]
[((515, 612), 'numpy.array', 'np.array', (['[[[0.0, 1, 1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 0, 0, 1, 1], [0, 0, 0, 0, 1, 1, \n 1, 1]]]'], {}), '([[[0.0, 1, 1, 0, 0, 1, 1, 0], [0, 0, 1, 1, 0, 0, 1, 1], [0, 0, 0, \n 0, 1, 1, 1, 1]]])\n', (523, 612), True, 'import numpy as np\n'), ((199, 257), 'numpy.array', 'np.array', ...
import numpy as np import vigra from ilastikrag import Rag from ilastikrag.util import generate_random_voronoi from ilastikrag.accumulators.edgeregion import EdgeRegionEdgeAccumulator class TestEdgeRegionEdgeAccumulator(object): def test1(self): superpixels = generate_random_voronoi((100,200), 200) ...
[ "ilastikrag.accumulators.edgeregion.EdgeRegionEdgeAccumulator", "numpy.zeros_like", "vigra.defaultAxistags", "pandas.merge", "numpy.zeros", "ilastikrag.Rag", "pytest.main", "numpy.isclose", "numpy.arange", "numpy.testing.assert_allclose", "ilastikrag.util.generate_random_voronoi", "os.path.spl...
[((7204, 7280), 'pytest.main', 'pytest.main', (["['-s', '--tb=native', '--pyargs', f'ilastikrag.tests.{module}']"], {}), "(['-s', '--tb=native', '--pyargs', f'ilastikrag.tests.{module}'])\n", (7215, 7280), False, 'import pytest\n'), ((275, 315), 'ilastikrag.util.generate_random_voronoi', 'generate_random_voronoi', (['(...
""" This file contains tests for the reading and processing of .sim files defined in 'gprof_nn.data.sim.py'. """ from pathlib import Path import numpy as np import pytest import xarray as xr from gprof_nn import sensors from gprof_nn.data import get_test_data_path from gprof_nn.data.l1c import L1CFile from gprof_nn.d...
[ "numpy.isnan", "pathlib.Path", "pytest.mark.skipif", "numpy.isclose", "gprof_nn.data.get_test_data_path", "gprof_nn.data.preprocessor.PreprocessorFile", "gprof_nn.data.sim.apply_orographic_enhancement", "gprof_nn.data.sim.process_sim_file", "gprof_nn.data.sim.SimFile.find_files", "numpy.isfinite",...
[((767, 787), 'gprof_nn.data.get_test_data_path', 'get_test_data_path', ([], {}), '()\n', (785, 787), False, 'from gprof_nn.data import get_test_data_path\n'), ((8669, 8744), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not HAS_ARCHIVES)'], {'reason': '"""Data archives not available."""'}), "(not HAS_ARCHIVES, reaso...
import numpy as np import cv2 import os from utils import linear_mapping, pre_process, random_warp """ This module implements the basic correlation filter based tracking algorithm -- MOSSE Date: 2018-05-28 """ # flags: 是否手动 # dir_path: datasets/ # sub_dir_path: datasets目录下各个目录 class mosse: def __init__(self, ar...
[ "os.mkdir", "numpy.clip", "numpy.mean", "numpy.arange", "numpy.exp", "cv2.rectangle", "cv2.imshow", "os.path.join", "numpy.fft.ifft2", "cv2.selectROI", "cv2.cvtColor", "utils.pre_process", "os.path.exists", "numpy.max", "cv2.resize", "cv2.waitKey", "numpy.square", "utils.linear_map...
[((431, 467), 'os.path.join', 'os.path.join', (['dir_path', 'sub_dir_path'], {}), '(dir_path, sub_dir_path)\n', (443, 467), False, 'import os\n'), ((981, 1012), 'cv2.imread', 'cv2.imread', (['self.frame_lists[0]'], {}), '(self.frame_lists[0])\n', (991, 1012), False, 'import cv2\n'), ((1034, 1076), 'cv2.cvtColor', 'cv2....
from __future__ import absolute_import import numpy as np from collections import OrderedDict from inspect import signature from . import BaseDataset from ..data import load_image _supported_filetypes = [ 'image', 'label', 'mask', ] _default_dtypes = OrderedDict({ 'image': np.float32, 'label': n...
[ "collections.OrderedDict", "numpy.transpose", "numpy.squeeze", "inspect.signature" ]
[((267, 338), 'collections.OrderedDict', 'OrderedDict', (["{'image': np.float32, 'label': np.int32, 'mask': np.uint8}"], {}), "({'image': np.float32, 'label': np.int32, 'mask': np.uint8})\n", (278, 338), False, 'from collections import OrderedDict\n'), ((376, 508), 'collections.OrderedDict', 'OrderedDict', (["{'image':...
''' Collection of classes for RF active and passive device modeling __author__ = "<NAME>" ''' import skrf as rf import numpy as np class rfnpn(): '''Class to create NPN transistor object using scikit RF Network object Instance Variables: dut = SciKit RF Network object containing raw NPN DUT ...
[ "skrf.Network", "numpy.absolute", "numpy.dstack", "numpy.size", "numpy.einsum", "numpy.array", "numpy.asscalar", "numpy.sqrt" ]
[((1575, 1591), 'skrf.Network', 'rf.Network', (['pads'], {}), '(pads)\n', (1585, 1591), True, 'import skrf as rf\n'), ((1608, 1624), 'skrf.Network', 'rf.Network', (['pado'], {}), '(pado)\n', (1618, 1624), True, 'import skrf as rf\n'), ((1641, 1657), 'skrf.Network', 'rf.Network', (['duto'], {}), '(duto)\n', (1651, 1657)...
# -*- coding: utf-8 -*- """ Created on Sat Feb 16 09:50:42 2019 @author: michaelek """ import os import numpy as np import pandas as pd import yaml from allotools.data_io import get_permit_data, get_usage_data, allo_filter from allotools.allocation_ts import allo_ts from allotools.utils import grp_ts_agg # from alloto...
[ "pandas.DataFrame", "allotools.data_io.allo_filter", "pandas.Timestamp", "allotools.data_io.get_usage_data", "os.path.dirname", "allotools.data_io.get_permit_data", "pandas.merge", "allotools.utils.grp_ts_agg", "yaml.safe_load", "pandas.Timestamp.now", "os.path.join", "pandas.concat", "allot...
[((590, 615), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (605, 615), False, 'import os\n'), ((693, 714), 'yaml.safe_load', 'yaml.safe_load', (['param'], {}), '(param)\n', (707, 714), False, 'import yaml\n'), ((628, 669), 'os.path.join', 'os.path.join', (['base_path', '"""parameters.yml"""...
#Simulando a jogada de 10 dados de 6 faces #Em cada jogada, os valores nos dados são somados #Um histograma é criado com X=valores possíveis de 'soma' (0 à 60), Y=frequência na qual 'soma' ocorreu import random import numpy as np import matplotlib.pyplot as plt num_dados = 10 num_jogadas = 10000 ys = [] for i in range...
[ "matplotlib.pyplot.show", "numpy.sum", "matplotlib.pyplot.hist", "random.choice", "numpy.random.randint" ]
[((481, 493), 'matplotlib.pyplot.hist', 'plt.hist', (['ys'], {}), '(ys)\n', (489, 493), True, 'import matplotlib.pyplot as plt\n'), ((494, 504), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (502, 504), True, 'import matplotlib.pyplot as plt\n'), ((510, 546), 'numpy.random.randint', 'np.random.randint', (['(1...