code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!./python27-gcc482/bin/python # coding: utf-8 """ BAIDU CLOUD action """ import os import sys import pickle import json import time import shutil import numpy as np sys.path.append( "/home/aistudio/work/PaddleVideo/applications/TableTennis/predict/action_detect" ) import models.bmn_infer as prop_model from util...
[ "sys.path.append", "logger.info", "os.mkdir", "logger.Logger", "os.fsdecode", "os.path.exists", "models.bmn_infer.predict", "time.time", "json.dumps", "utils.config_utils.parse_config", "numpy.array", "models.bmn_infer.InferModel", "os.fsencode", "utils.config_utils.print_configs", "os.l...
[((169, 276), 'sys.path.append', 'sys.path.append', (['"""/home/aistudio/work/PaddleVideo/applications/TableTennis/predict/action_detect"""'], {}), "(\n '/home/aistudio/work/PaddleVideo/applications/TableTennis/predict/action_detect'\n )\n", (184, 276), False, 'import sys\n'), ((477, 492), 'logger.Logger', 'logge...
import numpy as np def ood_p_value(cost, bound, ubound=True): """Compute p-value""" violations = cost - bound if ubound else bound - cost violation = np.mean(violations) tau = max(violation, 0) m = len(cost) p_val = np.exp(-2 * m * (tau ** 2)) return 1 - p_val def ood_confidence(cost, bo...
[ "numpy.log", "numpy.cumsum", "numpy.max", "numpy.mean", "numpy.exp" ]
[((164, 183), 'numpy.mean', 'np.mean', (['violations'], {}), '(violations)\n', (171, 183), True, 'import numpy as np\n'), ((242, 267), 'numpy.exp', 'np.exp', (['(-2 * m * tau ** 2)'], {}), '(-2 * m * tau ** 2)\n', (248, 267), True, 'import numpy as np\n'), ((447, 466), 'numpy.mean', 'np.mean', (['violations'], {}), '(v...
import numpy as np from matplotlib.path import Path import matplotlib.patches as patches import scipy.linalg as lin import matplotlib.pyplot as plt def plotGMM(Mu, Sigma, color,display_mode, ax): a, nbData = np.shape(Mu) lightcolor = np.asarray(color) + np.asarray([0.6,0.6,0.6]) a = np.nonzero(lightcolor >...
[ "numpy.asarray", "numpy.transpose", "numpy.shape", "numpy.nonzero", "matplotlib.path.Path", "scipy.linalg.sqrtm", "numpy.sin", "numpy.linspace", "numpy.real", "numpy.cos", "matplotlib.patches.PathPatch" ]
[((213, 225), 'numpy.shape', 'np.shape', (['Mu'], {}), '(Mu)\n', (221, 225), True, 'import numpy as np\n'), ((297, 323), 'numpy.nonzero', 'np.nonzero', (['(lightcolor > 1)'], {}), '(lightcolor > 1)\n', (307, 323), True, 'import numpy as np\n'), ((243, 260), 'numpy.asarray', 'np.asarray', (['color'], {}), '(color)\n', (...
""" Created on Wed Jun 17 14:01:23 2020 Correlation matrix of maps, rearranged correlation matrix @author: Jyotika.bahuguna """ import os import glob import numpy as np import pylab as pl import scipy.io as sio from copy import copy, deepcopy import pickle import matplotlib.cm as cm import pdb import h5py import...
[ "os.mkdir", "numpy.abs", "pandas.read_csv", "numpy.isnan", "numpy.arange", "pylab.figure", "numpy.linalg.norm", "graph_prop_funcs_analyze.calc_participation_coef_sign", "numpy.unique", "sys.path.append", "graph_prop_funcs_analyze.calc_module_degree_zscore", "graph_prop_funcs_analyze.get_re_arr...
[((467, 493), 'sys.path.append', 'sys.path.append', (['"""common/"""'], {}), "('common/')\n", (482, 493), False, 'import sys\n'), ((835, 855), 'os.listdir', 'os.listdir', (['data_dir'], {}), '(data_dir)\n', (845, 855), False, 'import os\n'), ((935, 981), 'pandas.read_csv', 'pd.read_csv', (["(data_target_dir + 'meta_dat...
import os import copy import yaml import numpy as np import autumn.post_processing as post_proc from autumn.tool_kit.scenarios import Scenario from ..countries import Country, CountryModel FILE_DIR = os.path.dirname(os.path.abspath(__file__)) OPTI_PARAMS_PATH = os.path.join(FILE_DIR, "opti_params.yml") with open(...
[ "copy.deepcopy", "os.path.abspath", "autumn.post_processing.PostProcessing", "numpy.zeros", "numpy.ones", "autumn.tool_kit.scenarios.Scenario", "yaml.safe_load", "os.path.join" ]
[((267, 308), 'os.path.join', 'os.path.join', (['FILE_DIR', '"""opti_params.yml"""'], {}), "(FILE_DIR, 'opti_params.yml')\n", (279, 308), False, 'import os\n'), ((221, 246), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (236, 246), False, 'import os\n'), ((375, 400), 'yaml.safe_load', 'yaml....
""" Utils operations ---------------- Collection of util operations for timeseries. """ import numpy as np from scipy import signal, interpolate def join_regimes(times, magnitudes): """Join different time series which represents events time series of different regimes and join altogether creating random va...
[ "numpy.argsort", "numpy.arange", "scipy.signal.gaussian", "scipy.signal.convolve", "numpy.concatenate", "numpy.atleast_2d" ]
[((972, 993), 'numpy.concatenate', 'np.concatenate', (['times'], {}), '(times)\n', (986, 993), True, 'import numpy as np\n'), ((1007, 1029), 'numpy.concatenate', 'np.concatenate', (['values'], {}), '(values)\n', (1021, 1029), True, 'import numpy as np\n'), ((1041, 1058), 'numpy.argsort', 'np.argsort', (['times'], {}), ...
import numpy as np x1 = [1, 2, 3] x2 = [1, 1, 1] result = np.subtract(x1, x2) print(result) print(range(4))
[ "numpy.subtract" ]
[((60, 79), 'numpy.subtract', 'np.subtract', (['x1', 'x2'], {}), '(x1, x2)\n', (71, 79), True, 'import numpy as np\n')]
"""Support methods providing available stretching algorithms.""" # type annotations from __future__ import annotations from typing import TYPE_CHECKING # standard libraries import os from dataclasses import dataclass, field, InitVar from functools import partial import importlib # internal libraries from ..resources...
[ "functools.partial", "numpy.arctanh", "importlib.util.spec_from_loader", "numpy.genfromtxt", "numpy.linspace", "os.path.join", "importlib.util.module_from_spec" ]
[((3074, 3109), 'numpy.linspace', 'numpy.linspace', (['low', 'high', '(size + 1)'], {}), '(low, high, size + 1)\n', (3088, 3109), False, 'import numpy\n'), ((5110, 5142), 'functools.partial', 'partial', (['tanh_mid'], {'alpha': 's_alpha'}), '(tanh_mid, alpha=s_alpha)\n', (5117, 5142), False, 'from functools import part...
''' Class for loading data into Pytorch float tensor From: https://gitlab.com/acasamitjana/latentmodels_ad ''' import torch from torch.functional import Tensor from torchvision import transforms from torch.utils.data import Dataset import numpy as np import pandas as pd class MyDataset(Dataset): def __init__(sel...
[ "numpy.shape", "torch.from_numpy" ]
[((603, 625), 'numpy.shape', 'np.shape', (['self.data[0]'], {}), '(self.data[0])\n', (611, 625), True, 'import numpy as np\n'), ((1595, 1617), 'numpy.shape', 'np.shape', (['self.data[0]'], {}), '(self.data[0])\n', (1603, 1617), True, 'import numpy as np\n'), ((789, 808), 'numpy.shape', 'np.shape', (['self.data'], {}), ...
from matplotlib import pyplot as plt import argparse import matplotlib as mpl import numpy as np import cv2 import json from pathlib import Path from datetime import datetime def draw_marker(x, y, img, color=(0, 0, 255), cross_size=5): """Draw marker location on image.""" x, y = int(x), int(y) cv2.line(im...
[ "argparse.ArgumentParser", "cv2.solvePnP", "pathlib.Path", "numpy.linalg.norm", "cv2.imshow", "cv2.line", "cv2.setMouseCallback", "cv2.drawFrameAxes", "cv2.destroyAllWindows", "datetime.datetime.now", "json.dump", "cv2.circle", "cv2.waitKey", "cv2.projectPoints", "cv2.resizeWindow", "j...
[((309, 384), 'cv2.line', 'cv2.line', (['img', '(x - cross_size, y)', '(x + cross_size, y)', 'color'], {'thickness': '(1)'}), '(img, (x - cross_size, y), (x + cross_size, y), color, thickness=1)\n', (317, 384), False, 'import cv2\n'), ((389, 464), 'cv2.line', 'cv2.line', (['img', '(x, y - cross_size)', '(x, y + cross_s...
# -*- coding: utf-8 -*- """ Created on Mon Feb 15 18:24:03 2021 @author: <NAME> """ import os import numpy as np import nibabel as nib # input_path = r'G:\MINCVM\PCLKO\PCP2-DTR\maps\\' # output_path = r'G:\MINCVM\PCLKO\PCP2-DTR\maps\Extracted\\' input_path = r'G:\MINCVM\PCLKO\HOPX-DTR\maps\\' output_path = r'G:\MI...
[ "nibabel.Nifti1Image", "nibabel.load", "numpy.empty", "numpy.asarray", "nibabel.save", "numpy.diag", "os.listdir" ]
[((371, 393), 'os.listdir', 'os.listdir', (['input_path'], {}), '(input_path)\n', (381, 393), False, 'import os\n'), ((486, 519), 'nibabel.load', 'nib.load', (['(input_path + image_name)'], {}), '(input_path + image_name)\n', (494, 519), True, 'import nibabel as nib\n'), ((585, 605), 'numpy.asarray', 'np.asarray', (['i...
import numpy as np import scipy.ndimage as nd def interpolate_nn(data: np.array) -> np.array: """ Function to fill nan values in a 2D array using nearest neighbor interpolation. Source: https://stackoverflow.com/a/27745627 Parameters ---------- data : np.array Data array (2D) in ...
[ "numpy.isnan" ]
[((503, 517), 'numpy.isnan', 'np.isnan', (['data'], {}), '(data)\n', (511, 517), True, 'import numpy as np\n')]
from nose.tools import assert_equal, assert_true from numpy.testing import assert_array_equal import numpy as np import re from seqlearn.evaluation import bio_f_score, SequenceKFold def test_bio_f_score(): # Outputs from with the "conlleval" Perl script from CoNLL 2002. examples = [ ("OBIO", "OBIO",...
[ "numpy.testing.assert_array_equal", "numpy.issubdtype", "re.match", "seqlearn.evaluation.bio_f_score" ]
[((590, 617), 'seqlearn.evaluation.bio_f_score', 'bio_f_score', (['y_true', 'y_pred'], {}), '(y_true, y_pred)\n', (601, 617), False, 'from seqlearn.evaluation import bio_f_score, SequenceKFold\n'), ((1761, 1793), 'numpy.testing.assert_array_equal', 'assert_array_equal', (['(~train)', 'test'], {}), '(~train, test)\n', (...
import numpy as np import pandas as pd from typing import Union def unit_vector(azi:Union[int,float]) -> np.array: """ Get the unit vector2D of a given azimuth Input: azi -> (int,float) Azimuth in Degrees Return: u -> (np.ndarray) numpy array with a shape of (2,1) with the x and y com...
[ "numpy.deg2rad", "numpy.sin", "numpy.array", "numpy.cos", "numpy.dot", "numpy.atleast_1d" ]
[((438, 455), 'numpy.deg2rad', 'np.deg2rad', (['alpha'], {}), '(alpha)\n', (448, 455), True, 'import numpy as np\n'), ((464, 481), 'numpy.cos', 'np.cos', (['alpha_rad'], {}), '(alpha_rad)\n', (470, 481), True, 'import numpy as np\n'), ((490, 507), 'numpy.sin', 'np.sin', (['alpha_rad'], {}), '(alpha_rad)\n', (496, 507),...
import time import numpy as np import analyzer import config as cfg import explots import fileutils import motifutils as motif import visutils def _analysis(analysis_name, audio, fs, length, methods, name='audio', show_plot=(), k=cfg.N_ClUSTERS, title_hook='{}', threshold=cfg.K_THRESH): G_dict = {...
[ "fileutils.write_audio", "numpy.ceil", "analyzer.analyze", "time.time", "visutils.show", "motifutils.pack_motif", "fileutils.load_audio", "explots.draw_results", "numpy.unique" ]
[((6261, 6305), 'fileutils.load_audio', 'fileutils.load_audio', (['name'], {'audio_dir': 'in_dir'}), '(name, audio_dir=in_dir)\n', (6281, 6305), False, 'import fileutils\n'), ((7285, 7300), 'visutils.show', 'visutils.show', ([], {}), '()\n', (7298, 7300), False, 'import visutils\n'), ((2297, 2341), 'motifutils.pack_mot...
""" Synthesize speech from the extracted text. """ import os from os import system import matplotlib.pyplot as plt from tqdm import tqdm from pprint import pformat import logging from scipy.io import wavfile import numpy as np def _remove_if_exists(filepath: str): os.remove(filepath) if os.path.isfile(filepath) ...
[ "tqdm.tqdm", "os.remove", "numpy.abs", "pprint.pformat", "os.system", "scipy.io.wavfile.write", "scipy.io.wavfile.read", "logging.info", "os.path.isfile", "numpy.argwhere", "os.path.join" ]
[((1039, 1074), 'os.system', 'system', (["(tts_command + '> /dev/null')"], {}), "(tts_command + '> /dev/null')\n", (1045, 1074), False, 'from os import system\n'), ((2158, 2180), 'scipy.io.wavfile.read', 'wavfile.read', (['filename'], {}), '(filename)\n', (2170, 2180), False, 'from scipy.io import wavfile\n'), ((2448, ...
# Copyright 2022 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...
[ "mindspore.context.set_context", "numpy.zeros", "mindspore.Tensor", "numpy.array", "numpy.arange", "pytest.mark.parametrize" ]
[((2374, 2468), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""func_name"""', "['update', 'min', 'max', 'add', 'sub', 'mul', 'div']"], {}), "('func_name', ['update', 'min', 'max', 'add', 'sub',\n 'mul', 'div'])\n", (2397, 2468), False, 'import pytest\n'), ((2466, 2570), 'pytest.mark.parametrize', 'pytes...
import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm from numpy.linalg import matrix_power from pre_process import * from eigenfaces import * import copy from pre_process import load_mat, separate_data def save_dataset(): # Load the data from the matrix X, [y] = load_mat('data/face.mat') ...
[ "numpy.save", "pre_process.load_mat", "numpy.load" ]
[((293, 318), 'pre_process.load_mat', 'load_mat', (['"""data/face.mat"""'], {}), "('data/face.mat')\n", (301, 318), False, 'from pre_process import load_mat, separate_data\n'), ((805, 878), 'numpy.save', 'np.save', (["(DATA_DIR + 'processed_raw/data/training.npy')", "dataset['train_x']"], {}), "(DATA_DIR + 'processed_r...
# Harris Algorithm for corner detection and features extracting # R = λ1.λ2 − k(λ1 + λ2)^2 import cv2 as cv import numpy as np if __name__ == "__main__": img = cv.imread('../../assets/test10.jpg') img = cv.resize(img, None, fx=.5, fy=.5) cv.imshow("Original Image", img) # input img of corner har...
[ "cv2.dilate", "cv2.cvtColor", "cv2.waitKey", "numpy.float32", "cv2.destroyAllWindows", "cv2.imread", "cv2.imshow", "cv2.cornerHarris", "cv2.resize" ]
[((167, 203), 'cv2.imread', 'cv.imread', (['"""../../assets/test10.jpg"""'], {}), "('../../assets/test10.jpg')\n", (176, 203), True, 'import cv2 as cv\n'), ((214, 250), 'cv2.resize', 'cv.resize', (['img', 'None'], {'fx': '(0.5)', 'fy': '(0.5)'}), '(img, None, fx=0.5, fy=0.5)\n', (223, 250), True, 'import cv2 as cv\n'),...
#!/usr/bin/env python3 from __future__ import print_function import sys import math import numpy as np #ROS Imports import rospy from sensor_msgs.msg import Image, LaserScan from ackermann_msgs.msg import AckermannDriveStamped, AckermannDrive from visualization_msgs.msg import Marker #RQT reconfigure from dynamic_rec...
[ "rospy.Subscriber", "rospy.Time.now", "rospy.Publisher", "rospy.sleep", "numpy.argmin", "ackermann_msgs.msg.AckermannDriveStamped", "numpy.insert", "numpy.append", "numpy.sin", "numpy.ones", "rospy.init_node", "visualization_msgs.msg.Marker", "numpy.cos", "rospy.spin", "numpy.arctan", ...
[((8326, 8375), 'rospy.init_node', 'rospy.init_node', (['"""FollowGap_node"""'], {'anonymous': '(True)'}), "('FollowGap_node', anonymous=True)\n", (8341, 8375), False, 'import rospy\n'), ((8386, 8431), 'dynamic_reconfigure.server.Server', 'Server', (['gapparamsConfig', 'reconfigure_callback'], {}), '(gapparamsConfig, r...
# import tensorflow as tf # # a = tf.get_variable("a", dtype=tf.int32, shape=[], initializer=tf.zeros_initializer()) # b = tf.get_variable("b", dtype=tf.float32,shape=[], initializer=tf.ones_initializer()) # # # f = tf.constant(6) # # # Definition of condition and body # def cond(a, b, f): # # # a = tf.Print(a,[a, ...
[ "tensorflow.random_uniform", "tensorflow.python.ops.tensor_array_ops.TensorArray", "tensorflow.global_variables_initializer", "tensorflow.add", "tensorflow.Session", "tensorflow.constant", "tensorflow.Variable", "tensorflow.Print", "numpy.array", "tensorflow.while_loop" ]
[((2001, 2111), 'tensorflow.python.ops.tensor_array_ops.TensorArray', 'tensor_array_ops.TensorArray', (['tf.int32'], {'size': '(1)', 'dynamic_size': '(True)', 'infer_shape': '(False)', 'element_shape': '[2, 2]'}), '(tf.int32, size=1, dynamic_size=True,\n infer_shape=False, element_shape=[2, 2])\n', (2029, 2111), Fal...
import unittest import numpy as np import scipy.linalg as la from parla.drivers.interpolative import OSID1, OSID2, TSID1 from parla.comps.sketchers.aware import RS1 import parla.comps.sketchers.oblivious as oblivious import parla.utils.linalg_wrappers as ulaw import parla.tests.matmakers as matmakers from parla.tests.t...
[ "parla.drivers.interpolative.TSID1", "parla.comps.sketchers.oblivious.SkOpGA", "parla.tests.test_drivers.test_lowrank.test_osid.reference_osid", "parla.tests.matmakers.rand_low_rank", "numpy.random.default_rng", "scipy.linalg.norm", "parla.comps.sketchers.aware.RS1", "numpy.eye", "parla.drivers.inte...
[((450, 477), 'numpy.random.default_rng', 'np.random.default_rng', (['seed'], {}), '(seed)\n', (471, 477), True, 'import numpy as np\n'), ((486, 526), 'parla.tests.matmakers.rand_low_rank', 'matmakers.rand_low_rank', (['m', 'n', 'rank', 'rng'], {}), '(m, n, rank, rng)\n', (509, 526), True, 'import parla.tests.matmakers...
# Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved. # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and relate...
[ "xml.etree.ElementTree.parse", "warp.transform_inverse", "warp.transform_identity", "warp.transform_multiply", "numpy.array", "warp.quat_from_matrix", "os.path.splitext", "numpy.fromstring" ]
[((1012, 1030), 'xml.etree.ElementTree.parse', 'ET.parse', (['filename'], {}), '(filename)\n', (1020, 1030), True, 'import xml.etree.ElementTree as ET\n'), ((6674, 6692), 'xml.etree.ElementTree.parse', 'ET.parse', (['filename'], {}), '(filename)\n', (6682, 6692), True, 'import xml.etree.ElementTree as ET\n'), ((1951, 1...
# -*- coding: utf-8 -*- """ Created on Tue Dec 17 18:16:14 2019 @author: Kokkinos """ import numpy as np from base.bci_transducer import Transducer from base.data_setup import * from offline import Offline from Lib.warnings import warn class Simul(Offline): def __init__(self, mode = 'IMvsall', tim_window = ...
[ "offline.Offline.__init__", "scipy.io.loadmat", "numpy.isnan", "time.time", "numpy.where", "numpy.array", "numpy.delete" ]
[((6019, 6041), 'numpy.where', 'np.where', (['(LABELS == -1)'], {}), '(LABELS == -1)\n', (6027, 6041), True, 'import numpy as np\n'), ((6068, 6094), 'numpy.where', 'np.where', (['(tst_labels == -1)'], {}), '(tst_labels == -1)\n', (6076, 6094), True, 'import numpy as np\n'), ((6284, 6295), 'time.time', 'time.time', ([],...
# -*- coding: utf-8 -*- from __future__ import unicode_literals # 导入相关模块 import numpy as np import random from random import shuffle from scipy import io import scipy.io as iso from utils import * # 全局变量,名字库的文件名 DataSet = "name.txt" def preprocess(data_set=DataSet): """ 对名字库进行预处理. 参...
[ "numpy.random.seed", "random.shuffle", "numpy.zeros", "scipy.io.savemat", "numpy.dot" ]
[((1944, 1969), 'numpy.zeros', 'np.zeros', (['(vocab_size, 1)'], {}), '((vocab_size, 1))\n', (1952, 1969), True, 'import numpy as np\n'), ((2018, 2036), 'numpy.zeros', 'np.zeros', (['(n_a, 1)'], {}), '((n_a, 1))\n', (2026, 2036), True, 'import numpy as np\n'), ((2416, 2441), 'numpy.zeros', 'np.zeros', (['(vocab_size, 1...
import numpy as np import gimpact as gi # util functions def gen_cdmesh_vvnf(vertices, vertex_normals, faces): """ generate cdmesh given vertices, _, and faces :return: gimpact.TriMesh (require gimpact to be installed) author: weiwei date: 20210118 """ return gi.TriMesh(vertices, faces.flat...
[ "modeling.collision_model.CollisionModel", "modeling.geometric_model.gen_sphere", "gimpact.trimesh_trimesh_collision", "numpy.array", "visualization.panda.world.World", "os.path.join" ]
[((678, 718), 'gimpact.trimesh_trimesh_collision', 'gi.trimesh_trimesh_collision', (['obj0', 'obj1'], {}), '(obj0, obj1)\n', (706, 718), True, 'import gimpact as gi\n'), ((892, 911), 'numpy.array', 'np.array', (['[0, 0, 1]'], {}), '([0, 0, 1])\n', (900, 911), True, 'import numpy as np\n'), ((3369, 3427), 'visualization...
# -*- coding: utf-8 -*- """ Steps of testing of SuperOperator class """ from behave import * import quantarhei as qr import numpy @given('I have a general superoperator S and two operators A and B') def step_given(context): S = qr.qm.TestSuperOperator("dim-3-AOA") A = qr.Hamiltonian(data=[[0.0, 0.1...
[ "numpy.tensordot", "numpy.testing.assert_allclose", "quantarhei.qm.TestSuperOperator", "quantarhei.Hamiltonian", "quantarhei.eigenbasis_of" ]
[((245, 281), 'quantarhei.qm.TestSuperOperator', 'qr.qm.TestSuperOperator', (['"""dim-3-AOA"""'], {}), "('dim-3-AOA')\n", (268, 281), True, 'import quantarhei as qr\n'), ((290, 362), 'quantarhei.Hamiltonian', 'qr.Hamiltonian', ([], {'data': '[[0.0, 0.1, 0.0], [0.1, 1.0, 0.2], [0.0, 0.2, 1.2]]'}), '(data=[[0.0, 0.1, 0.0...
""" The lidar system, data (2 of 2 datasets) ======================================== Generate a chart of more complex data recorded by the lidar system """ import numpy as np import matplotlib.pyplot as plt waveform_2 = np.load('waveform_2.npy') t = np.arange(len(waveform_2)) fig, ax = plt.subplots(figsize=(8, 6)...
[ "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.subplots" ]
[((224, 249), 'numpy.load', 'np.load', (['"""waveform_2.npy"""'], {}), "('waveform_2.npy')\n", (231, 249), True, 'import numpy as np\n'), ((293, 321), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(8, 6)'}), '(figsize=(8, 6))\n', (305, 321), True, 'import matplotlib.pyplot as plt\n'), ((322, 345), 'ma...
# Copyright (c) 2018-2022, NVIDIA Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
[ "numpy.array", "numpy.random.rand", "numpy.zeros" ]
[((2956, 2972), 'numpy.zeros', 'np.zeros', (['(2, 7)'], {}), '((2, 7))\n', (2964, 2972), True, 'import numpy as np\n'), ((1641, 1699), 'numpy.array', 'np.array', (['[[0, 1, 2, 3], [-2, 3, -1, 5]]'], {'dtype': 'np.float32'}), '([[0, 1, 2, 3], [-2, 3, -1, 5]], dtype=np.float32)\n', (1649, 1699), True, 'import numpy as np...
#!/usr/bin/env python import sys from scipy.stats import t from scipy.special import gammaln import numpy as np from numpy import pi,log,sqrt from numpy.linalg import slogdet,inv ################################ ### Multivariate Student's t ### ################################ ### Multivariate Student's t density (lo...
[ "numpy.log", "numpy.linalg.slogdet", "numpy.linalg.inv", "scipy.special.gammaln", "numpy.sqrt" ]
[((1188, 1198), 'numpy.linalg.inv', 'inv', (['Sigma'], {}), '(Sigma)\n', (1191, 1198), False, 'from numpy.linalg import slogdet, inv\n'), ((937, 964), 'scipy.special.gammaln', 'gammaln', (['(nu / 2.0 + d / 2.0)'], {}), '(nu / 2.0 + d / 2.0)\n', (944, 964), False, 'from scipy.special import gammaln\n'), ((963, 980), 'sc...
import numpy as np def tensor2numpy(img_tensor): """ Helper method to transfer image from torch.tensor to numpy.array :param img_tensor: image in torch.tensor format :return: image in numpy.array format """ img = img_tensor.detach().cpu().numpy().transpose(1,2,0) ### not to take grad of img img= np.cl...
[ "numpy.squeeze", "numpy.clip" ]
[((315, 333), 'numpy.clip', 'np.clip', (['img', '(0)', '(1)'], {}), '(img, 0, 1)\n', (322, 333), True, 'import numpy as np\n'), ((441, 456), 'numpy.squeeze', 'np.squeeze', (['img'], {}), '(img)\n', (451, 456), True, 'import numpy as np\n')]
from __future__ import print_function from __future__ import division import torch import torch.nn as nn import torch.optim as optim import numpy as np print("PyTorch Version: ",torch.__version__) import pickle import os import scipy.io as sio import cv2 from model import * from pano import get_ini_cor from pano_op...
[ "pano_opt_gen.optimize_cor_id", "numpy.amin", "numpy.argmax", "scipy.io.loadmat", "torch.cat", "sklearn.metrics.classification_report", "numpy.ones", "numpy.argsort", "os.path.join", "numpy.round", "torch.nn.BCELoss", "shapely.geometry.Polygon", "torch.load", "os.path.exists", "pano.get_...
[((5674, 5686), 'torch.nn.BCELoss', 'nn.BCELoss', ([], {}), '()\n', (5684, 5686), True, 'import torch.nn as nn\n'), ((5700, 5712), 'torch.nn.BCELoss', 'nn.BCELoss', ([], {}), '()\n', (5710, 5712), True, 'import torch.nn as nn\n'), ((1279, 1302), 'torch.load', 'torch.load', (['weight_path'], {}), '(weight_path)\n', (128...
"""Process images into timed Morse signals.""" import collections import operator import threading import time from Queue import Queue import libmorse import numpy from PIL import ImageFilter from morseus import settings from morseus.settings import LOGGING class Decoder(object): """Interpret black & white i...
[ "threading.Thread", "libmorse.get_translator_results", "Queue.Queue", "numpy.zeros", "libmorse.AlphabetTranslator", "time.sleep", "threading.Lock", "libmorse.translate_morse", "operator.mul", "collections.deque" ]
[((802, 864), 'libmorse.translate_morse', 'libmorse.translate_morse', ([], {'use_logging': 'LOGGING.USE', 'debug': 'debug'}), '(use_logging=LOGGING.USE, debug=debug)\n', (826, 864), False, 'import libmorse\n'), ((1005, 1021), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (1019, 1021), False, 'import threading\n...
# ********************************************************************************************************************** # # brief: Mask R-CNN # Configurations and data loading code for the sun rgbd dataset. # # author: <NAME> # date: 19.04.2020 # # ***************************************************...
[ "sys.path.append", "os.path.abspath", "os.path.join", "numpy.load" ]
[((548, 573), 'os.path.abspath', 'os.path.abspath', (['"""../../"""'], {}), "('../../')\n", (563, 573), False, 'import os\n'), ((594, 619), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (609, 619), False, 'import sys\n'), ((3123, 3165), 'os.path.join', 'os.path.join', (['dataset_dir', "(subs...
# -*- mode: python; coding: utf-8 -*- # Copyright 2016-2017 <NAME> <<EMAIL>> and collaborators # Licensed under the MIT License """Various helpers for X-ray analysis that rely on CIAO tools. """ from __future__ import absolute_import, division, print_function, unicode_literals __all__ = str(''' get_region_area count...
[ "pandas.DataFrame", "numpy.abs", "numpy.log", "tempfile.mkdtemp", "numpy.exp", "scipy.special.gammaln", "shutil.rmtree", "numpy.sqrt" ]
[((3667, 3783), 'pandas.DataFrame', 'pd.DataFrame', (["{'elo': [t[0] for t in ebins], 'ehi': [t[1] for t in ebins], 'nsrc':\n srccounts, 'nbkg': bkgcounts}"], {}), "({'elo': [t[0] for t in ebins], 'ehi': [t[1] for t in ebins],\n 'nsrc': srccounts, 'nbkg': bkgcounts})\n", (3679, 3783), True, 'import pandas as pd\n...
import numpy as np import matplotlib.pyplot as plt np.random.seed(19680801) n_bins = 10 x = np.random.randn(1000, 3) print(x.shape) fig, ((ax0, ax1), (ax2, ax3)) = plt.subplots(nrows=2, ncols=2) colors = ['red', 'tan', 'lime'] ax0.hist(x, n_bins, density=True, histtype='bar', color=colors, label=colors) ax0.legend(p...
[ "matplotlib.pyplot.show", "numpy.random.seed", "matplotlib.pyplot.subplots", "numpy.random.randn" ]
[((52, 76), 'numpy.random.seed', 'np.random.seed', (['(19680801)'], {}), '(19680801)\n', (66, 76), True, 'import numpy as np\n'), ((94, 118), 'numpy.random.randn', 'np.random.randn', (['(1000)', '(3)'], {}), '(1000, 3)\n', (109, 118), True, 'import numpy as np\n'), ((166, 196), 'matplotlib.pyplot.subplots', 'plt.subplo...
# Python modules # 3rd party modules import numpy as np # Our modules def op_rmbadaverages( data, sw, nsd='3', domain='t'): """ USAGE: badAverages, metric = op_rmbadaverages(data, sw, nsd=nsd, domain=domain) DESCRIPTION: Removes motion corrupted averages from a dataset containing multiple ...
[ "numpy.fft.ifft", "numpy.sum", "numpy.logical_and", "numpy.polyfit", "numpy.polyval", "numpy.std", "numpy.median", "numpy.mean", "numpy.arange", "numpy.array", "numpy.exp" ]
[((1365, 1380), 'numpy.arange', 'np.arange', (['nfid'], {}), '(nfid)\n', (1374, 1380), True, 'import numpy as np\n'), ((2392, 2417), 'numpy.polyfit', 'np.polyfit', (['x', 'zmetric', '(2)'], {}), '(x, zmetric, 2)\n', (2402, 2417), True, 'import numpy as np\n'), ((2429, 2448), 'numpy.polyval', 'np.polyval', (['pfit', 'x'...
""" This file contains functions for plotting the performance of the model for censored data. """ import numpy as np import pandas as pd import seaborn as sns from copy import deepcopy import random from .figureCommon import ( getSetup, subplotLabel, commonAnalyze, pi, T, E2, num_data_point...
[ "pandas.DataFrame", "copy.deepcopy", "numpy.isfinite", "seaborn.regplot", "random.seed", "numpy.linspace" ]
[((543, 557), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (554, 557), False, 'import random\n'), ((793, 807), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (804, 807), False, 'import random\n'), ((1719, 1794), 'numpy.linspace', 'np.linspace', (['min_num_lineages', 'max_num_lineages', 'num_data_points'...
__author__ = 'tsungyi' #modified by y2863 on December 20th 2021 import numpy as np import datetime import time from collections import defaultdict import pycocotools.mask as maskUtils from pycocotools.cocoeval import COCOeval, Params import copy class MetaGraspeval(COCOeval): def __init__(self, *args, **kwargs): ...
[ "numpy.count_nonzero", "numpy.multiply", "numpy.logical_not", "numpy.zeros", "numpy.ones", "numpy.searchsorted", "time.time", "numpy.argsort", "numpy.cumsum", "pycocotools.cocoeval.COCOeval.accumulate", "numpy.spacing", "numpy.array", "datetime.datetime.now", "numpy.concatenate", "numpy....
[((1281, 1337), 'numpy.argsort', 'np.argsort', (["[g['_ignore'] for g in gt]"], {'kind': '"""mergesort"""'}), "([g['_ignore'] for g in gt], kind='mergesort')\n", (1291, 1337), True, 'import numpy as np\n'), ((1390, 1447), 'numpy.argsort', 'np.argsort', (["[(-d['score']) for d in dt]"], {'kind': '"""mergesort"""'}), "([...
#!/usr/bin/env python3 # file://mkpy3_finder_chart_tpf_overlay_v6.py # <NAME> # SETI Institute def mkpy3_finder_chart_tpf_overlay_v6( ax=None, survey_wcs=None, tpf=None, frame=None, colors=[None, "cornflowerblue", "red"], lws=[0, 3, 4], zorders=[0, 1, 2], verbose=None, ): """ Fun...
[ "argparse.ArgumentParser", "mkpy3.mkpy3_finder_chart_survey_fits_image_get_v1", "matplotlib.pyplot.suptitle", "lightkurve.read", "matplotlib.pyplot.figure", "mkpy3.mkpy3_util_check_file_exists", "matplotlib.pyplot.close", "lightkurve.log.setLevel", "mkpy3.mkpy3_finder_chart_image_show_v1", "os.pat...
[((2011, 2045), 'numpy.zeros', 'np.zeros', (['tpf_data.size'], {'dtype': 'int'}), '(tpf_data.size, dtype=int)\n', (2019, 2045), True, 'import numpy as np\n'), ((3441, 3513), 'numpy.array', 'np.array', (['[[1.0, 1.0], [1.0, -1.0], [-1.0, -1.0], [-1.0, 1], [1.0, 1.0]]'], {}), '([[1.0, 1.0], [1.0, -1.0], [-1.0, -1.0], [-1...
##### IMPORTING PACKAGES ##### import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from scipy.optimize import minimize from sklearn.preprocessing import PolynomialFeatures # pd.set_option('display.notebook_repr_html', False) # pd.set_option('display.max_columns', None) # pd.s...
[ "scipy.optimize.minimize", "matplotlib.pyplot.show", "numpy.log", "matplotlib.pyplot.scatter", "numpy.round", "numpy.zeros", "numpy.ones", "numpy.isnan", "numpy.square", "sklearn.preprocessing.PolynomialFeatures", "matplotlib.pyplot.contour", "numpy.loadtxt", "numpy.linspace", "matplotlib....
[((1163, 1219), 'numpy.loadtxt', 'np.loadtxt', (['"""LogisticRegressionData1.txt"""'], {'delimiter': '""","""'}), "('LogisticRegressionData1.txt', delimiter=',')\n", (1173, 1219), True, 'import numpy as np\n'), ((1566, 1576), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1574, 1576), True, 'import matplotlib...
import abc import copy import itertools import logging from typing import ( Any, Callable, Dict, Iterable, Iterator, Mapping, Optional, Sequence, Set, Type, TypeVar, Union ) import numpy as np from smqtk_dataprovider import DataElement from smqtk_descriptors import DescriptorGenerator from smqtk_image_io impo...
[ "smqtk_core.configuration.to_config_dict", "copy.deepcopy", "smqtk_image_io.ImageReader.get_impls", "torch.load", "smqtk_descriptors.utils.pytorch_utils.load_state_dict", "numpy.expand_dims", "numpy.linalg.norm", "itertools.islice", "typing.TypeVar", "smqtk_descriptors.utils.parallel.parallel_map"...
[((575, 602), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (592, 602), False, 'import logging\n'), ((1070, 1122), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': '"""TorchModuleDescriptorGenerator"""'}), "('T', bound='TorchModuleDescriptorGenerator')\n", (1077, 1122), False, 'from ...
import logging import numpy as np import os import pandas as pd import sqlite3 root_path = os.path.dirname(os.path.realpath(__file__)) runlog = logging.getLogger('runlog') alglog = logging.getLogger('alglog') def drillinginfo(file): """ Reads the production data file in the drillinginfo.com format. :para...
[ "pandas.read_csv", "os.path.realpath", "sqlite3.connect", "numpy.array", "logging.getLogger" ]
[((145, 172), 'logging.getLogger', 'logging.getLogger', (['"""runlog"""'], {}), "('runlog')\n", (162, 172), False, 'import logging\n'), ((182, 209), 'logging.getLogger', 'logging.getLogger', (['"""alglog"""'], {}), "('alglog')\n", (199, 209), False, 'import logging\n'), ((108, 134), 'os.path.realpath', 'os.path.realpat...
#! /usr/bin/env python2.6 import matplotlib matplotlib.use('Agg') import denudationRateAnalysis as dra import numpy as np data = dra.read_csv('portengadata.csv') del(data[0]) ksn_vec, area_vec = dra.calculate_ksn_for_data(data,1000000,0.6) np.savez_compressed('ksn_area_data_0_6.npz', ksn_vec = ksn_vec, area_vec = a...
[ "numpy.savez_compressed", "matplotlib.use", "denudationRateAnalysis.read_csv", "denudationRateAnalysis.calculate_ksn_for_data" ]
[((45, 66), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (59, 66), False, 'import matplotlib\n'), ((132, 164), 'denudationRateAnalysis.read_csv', 'dra.read_csv', (['"""portengadata.csv"""'], {}), "('portengadata.csv')\n", (144, 164), True, 'import denudationRateAnalysis as dra\n'), ((198, 244),...
"""Generates some data from random gaussian blobs and renders it""" import matplotlib.pyplot as plt import matplotlib.colors as mcolors import pca3dvis.pcs as pcs import pca3dvis.worker as worker import numpy as np FEATURES = 10 """The embedded space of the generated data. Every later snapshot has one more fe...
[ "numpy.random.uniform", "matplotlib.pyplot.get_cmap", "matplotlib.colors.Normalize", "numpy.random.randn", "pca3dvis.worker.generate", "numpy.zeros", "numpy.ones", "pca3dvis.pcs.get_pc_trajectory" ]
[((2019, 2039), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['"""Set1"""'], {}), "('Set1')\n", (2031, 2039), True, 'import matplotlib.pyplot as plt\n'), ((2667, 2701), 'pca3dvis.pcs.get_pc_trajectory', 'pcs.get_pc_trajectory', (['datas', 'lbls'], {}), '(datas, lbls)\n', (2688, 2701), True, 'import pca3dvis.pcs as pc...
import numpy as np from pendulum.pendulum import Pendulum2D import matplotlib.pyplot as plt h = 0.001 # [s] Integration step t0 = 0 # [s] Starting time tf = 10 # [s] End time g = 9.81 # [m/s^2] Gravitational acceleration L = 1 # [m] Pend...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "pendulum.pendulum.Pendulum2D", "matplotlib.pyplot.plot", "numpy.shape", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((668, 709), 'pendulum.pendulum.Pendulum2D', 'Pendulum2D', (['h', 'g', 'L', 'theta_0', 'omega_0', 't0'], {}), '(h, g, L, theta_0, omega_0, t0)\n', (678, 709), False, 'from pendulum.pendulum import Pendulum2D\n'), ((898, 910), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (908, 910), True, 'import matplot...
import numpy as np import math eye_vec = np.array([0, 0, 0]) at_vec = np.array([0, 0, -1]) up_vec = np.array([0, 1, 0]) viewport = np.array([0, 0 , 800, 600]) coordinates = (np.array([10, 20 ,100, 0])) near = 1 far = 100 def norm(vector): return vector/np.sqrt(np.sum(np.square(vector))) def view_matrix(eye, at, ...
[ "numpy.eye", "math.radians", "numpy.empty", "math.tan", "numpy.square", "numpy.cross", "numpy.transpose", "numpy.append", "numpy.array", "numpy.linalg.inv", "numpy.matmul", "numpy.dot" ]
[((42, 61), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (50, 61), True, 'import numpy as np\n'), ((71, 91), 'numpy.array', 'np.array', (['[0, 0, -1]'], {}), '([0, 0, -1])\n', (79, 91), True, 'import numpy as np\n'), ((101, 120), 'numpy.array', 'np.array', (['[0, 1, 0]'], {}), '([0, 1, 0])\n', (109,...
import matplotlib.pyplot as plt import pandas as pd import os import json import urllib.request as request import numpy as np from time import time from datetime import datetime, timedelta from math import log # COSTANTI ############################################################################################ # UR...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.yscale", "pandas.read_csv", "matplotlib.pyplot.style.use", "numpy.arange", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.axvline", "matplotlib.pyplot.close", "os.path.dirname", "matplotlib.pyplot.yticks", "u...
[((9244, 9260), 'pandas.read_csv', 'pd.read_csv', (['url'], {}), '(url)\n', (9255, 9260), True, 'import pandas as pd\n'), ((14836, 14850), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (14848, 14850), True, 'import matplotlib.pyplot as plt\n'), ((15535, 15595), 'matplotlib.pyplot.figtext', 'plt.figtex...
import cv2, numpy as np img = np.zeros((512,512,3),np.uint8) #print(img.shape) #img[200:300,100:300] = 255,0,0 cv2.line(img,(0,0),(img.shape[1],img.shape[0]),(0,255,0),3) cv2.rectangle(img,(0,0),(250,350),(0,0,255),cv2.FILLED) cv2.circle(img,(400,50),30,(255,255,0),5) cv2.putText(img," OPENCV ",(300,200),cv2.FONT_HER...
[ "cv2.line", "cv2.circle", "cv2.putText", "cv2.waitKey", "numpy.zeros", "cv2.rectangle", "cv2.imshow" ]
[((31, 64), 'numpy.zeros', 'np.zeros', (['(512, 512, 3)', 'np.uint8'], {}), '((512, 512, 3), np.uint8)\n', (39, 64), True, 'import cv2, numpy as np\n'), ((113, 180), 'cv2.line', 'cv2.line', (['img', '(0, 0)', '(img.shape[1], img.shape[0])', '(0, 255, 0)', '(3)'], {}), '(img, (0, 0), (img.shape[1], img.shape[0]), (0, 25...
''' Created on April 27, 2018 @author: <NAME> ''' from evaluation.experiment import Experiment import data.load_data as load_data import numpy as np import os gt, annos, doc_start, text, gt_nocrowd, doc_start_nocrowd, text_nocrowd, gt_val, _ = \ load_data.load_ner_data(False) # debug with subset ------- s = 100 ...
[ "os.mkdir", "data.load_data.load_ner_data", "os.path.isdir", "evaluation.experiment.Experiment", "numpy.argwhere", "os.path.join" ]
[((252, 282), 'data.load_data.load_ner_data', 'load_data.load_ner_data', (['(False)'], {}), '(False)\n', (275, 282), True, 'import data.load_data as load_data\n'), ((545, 594), 'os.path.join', 'os.path.join', (['load_data.output_root_dir', '"""ner_al"""'], {}), "(load_data.output_root_dir, 'ner_al')\n", (557, 594), Fal...
import h5py import numpy import numpy as np from pathlib import Path import torch from matplotlib import pyplot title_font = { 'fontsize': 50, 'fontweight': 'bold' } file_path = 'data/raw/MVP_Test_CP.h5' input_file = h5py.File(file_path, 'r') index = 4000 temp = index // 26 incomplete_pcd = np.array(input_...
[ "matplotlib.pyplot.title", "h5py.File", "matplotlib.pyplot.show", "matplotlib.pyplot.figure", "numpy.array" ]
[((228, 253), 'h5py.File', 'h5py.File', (['file_path', '"""r"""'], {}), "(file_path, 'r')\n", (237, 253), False, 'import h5py\n'), ((305, 351), 'numpy.array', 'np.array', (["input_file['incomplete_pcds'][index]"], {}), "(input_file['incomplete_pcds'][index])\n", (313, 351), True, 'import numpy as np\n'), ((367, 410), '...
import numpy as np import pandas as pd import urllib.request import json import time import argparse from youtube_transcript_api import YouTubeTranscriptApi # Note: An API key is only necessary when getting videos from a channel global api_key api_key = '' def get_channel_videos(channel_id, delay=0): if api_k...
[ "pandas.DataFrame", "json.load", "numpy.vectorize", "argparse.ArgumentParser", "pandas.read_csv", "youtube_transcript_api.YouTubeTranscriptApi.get_transcript", "time.sleep", "numpy.array" ]
[((1452, 1476), 'numpy.vectorize', 'np.vectorize', (['clean_link'], {}), '(clean_link)\n', (1464, 1476), True, 'import numpy as np\n'), ((1707, 1732), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1730, 1732), False, 'import argparse\n'), ((690, 707), 'time.sleep', 'time.sleep', (['delay'], {...
from flask import Flask, render_template, jsonify, request, url_for from shapely.geometry import Point as Shapely_point, mapping from geojson import Point as Geoj_point, Polygon as Geoj_polygon, Feature, FeatureCollection from datetime import datetime from sqlalchemy import * import pandas as pd import geopandas as gpd...
[ "datetime.datetime.strftime", "pandas.DataFrame", "netCDF4.Dataset", "numpy.dstack", "flask.request.args.get", "flask.Flask", "timezonefinder.TimezoneFinder", "plotly.express.line", "json.dumps", "geopy.geocoders.Nominatim", "numpy.append", "datetime.datetime.strptime", "flask.jsonify", "p...
[((4628, 4685), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['updatedDtStr', '"""%Y%m%d_%H%M%S"""'], {}), "(updatedDtStr, '%Y%m%d_%H%M%S')\n", (4654, 4685), False, 'import datetime\n'), ((4704, 4760), 'datetime.datetime.strftime', 'datetime.datetime.strftime', (['updatedDt', '"""%Y-%m-%dT%H%M%S"""'], {...
from lenskit import topn import numpy as np import lk_test_utils as lktu def test_unrated(): ratings = lktu.ml_pandas.renamed.ratings unrate = topn.UnratedCandidates(ratings) cs = unrate(100) items = ratings.item.unique() rated = ratings[ratings.user == 100].item.unique() assert len(cs) == ...
[ "lenskit.topn.UnratedCandidates", "numpy.intersect1d" ]
[((155, 186), 'lenskit.topn.UnratedCandidates', 'topn.UnratedCandidates', (['ratings'], {}), '(ratings)\n', (177, 186), False, 'from lenskit import topn\n'), ((359, 384), 'numpy.intersect1d', 'np.intersect1d', (['cs', 'rated'], {}), '(cs, rated)\n', (373, 384), True, 'import numpy as np\n')]
import cv2 as cv import numpy as np import time import matplotlib.pyplot as plt def ntr(vid,n,d): blank_image = np.zeros((1920,1080,3), np.uint8) fps= int(vid.get(cv.CAP_PROP_FPS)) data = [] fm = 0 out = cv.VideoWriter((d + "\\dots" + str(n) + ".avi"),cv.VideoWriter_fourcc('M','J','P','G'...
[ "cv2.GaussianBlur", "cv2.contourArea", "cv2.circle", "cv2.VideoWriter_fourcc", "cv2.cvtColor", "cv2.imwrite", "cv2.threshold", "numpy.savetxt", "numpy.zeros", "numpy.asarray", "cv2.waitKey", "cv2.boundingRect", "cv2.inRange", "cv2.findContours", "numpy.sqrt" ]
[((123, 158), 'numpy.zeros', 'np.zeros', (['(1920, 1080, 3)', 'np.uint8'], {}), '((1920, 1080, 3), np.uint8)\n', (131, 158), True, 'import numpy as np\n'), ((3772, 3857), 'numpy.savetxt', 'np.savetxt', (['nm', 'data'], {'delimiter': '""","""', 'fmt': '"""%.2f"""', 'header': '"""cx,cy,n,v"""', 'comments': '""""""'}), "(...
import time import matplotlib.pyplot as plt import numpy as np import torch import math import pickle plt.style.use('fivethirtyeight') print(f'Imports complete') def sin(x): return math.sin(x*np.pi/180) def cos(x): return math.cos(x*np.pi/180) class Rocket(): def __init__(self, init_pos, init_vel): ...
[ "math.sqrt", "numpy.argmax", "math.sin", "matplotlib.pyplot.style.use", "numpy.arange", "math.cos" ]
[((102, 134), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (115, 134), True, 'import matplotlib.pyplot as plt\n'), ((187, 212), 'math.sin', 'math.sin', (['(x * np.pi / 180)'], {}), '(x * np.pi / 180)\n', (195, 212), False, 'import math\n'), ((234, 259), 'math...
# https://deeplearningcourses.com/c/data-science-supervised-machine-learning-in-python # https://www.udemy.com/data-science-supervised-machine-learning-in-python from __future__ import print_function, division from future.utils import iteritems from builtins import range, input # Note: you may need to update your versi...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "numpy.zeros", "knn.KNN", "builtins.range" ]
[((512, 528), 'numpy.zeros', 'np.zeros', (['(N, 2)'], {}), '((N, 2))\n', (520, 528), True, 'import numpy as np\n'), ((537, 548), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (545, 548), True, 'import numpy as np\n'), ((588, 600), 'builtins.range', 'range', (['width'], {}), '(width)\n', (593, 600), False, 'from buil...
# Copyright 2017 Google 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 ...
[ "tensorflow.einsum", "numpy.sum", "tensorflow.clip_by_value", "tensorflow.cumsum", "numpy.ones", "utility.alrc", "numpy.argsort", "numpy.arange", "utility.auto_name", "numpy.exp", "tensorflow.python.ops.array_ops.shape", "tensorflow.stack", "numpy.max", "tensorflow.python.ops.array_ops.pad...
[((1402, 1475), 'tensorflow.flags.DEFINE_integer', 'tf.flags.DEFINE_integer', (['"""hidden_size"""', '(256)', '"""Size of LSTM hidden layer."""'], {}), "('hidden_size', 256, 'Size of LSTM hidden layer.')\n", (1425, 1475), True, 'import tensorflow as tf\n'), ((1477, 1550), 'tensorflow.flags.DEFINE_integer', 'tf.flags.DE...
import pandas as pd from math import isnan import numpy as np from train import GRUTree from train import visualize import os import cPickle from sklearn.model_selection import train_test_split from sklearn.metrics import roc_auc_score, mean_squared_error, accuracy_score def preprocess(dataset): # complete missin...
[ "os.mkdir", "pandas.read_csv", "pandas.get_dummies", "sklearn.model_selection.train_test_split", "os.path.isdir", "sklearn.metrics.roc_auc_score", "cPickle.dump", "numpy.swapaxes", "train.visualize", "train.GRUTree", "numpy.round", "sklearn.metrics.mean_squared_error" ]
[((2613, 2636), 'pandas.get_dummies', 'pd.get_dummies', (['dataset'], {}), '(dataset)\n', (2627, 2636), True, 'import pandas as pd\n'), ((2682, 2719), 'pandas.read_csv', 'pd.read_csv', (['"""titanic_data/train.csv"""'], {}), "('titanic_data/train.csv')\n", (2693, 2719), True, 'import pandas as pd\n'), ((2905, 2958), 's...
from hetu import get_worker_communicate from hetu.preduce import PartialReduce from hetu import ndarray import hetu as ht import ctypes import argparse import numpy as np from tqdm import tqdm import time import random def test(args): comm = get_worker_communicate() rank = comm.rank() comm.ssp_init(rank ...
[ "hetu.get_worker_communicate", "hetu.worker_finish", "hetu.wrapped_mpi_nccl_init", "argparse.ArgumentParser", "time.sleep", "hetu.preduce.PartialReduce", "hetu.ndarray.gpu", "hetu.worker_init", "numpy.repeat" ]
[((249, 273), 'hetu.get_worker_communicate', 'get_worker_communicate', ([], {}), '()\n', (271, 273), False, 'from hetu import get_worker_communicate\n'), ((490, 505), 'hetu.preduce.PartialReduce', 'PartialReduce', ([], {}), '()\n', (503, 505), False, 'from hetu.preduce import PartialReduce\n'), ((517, 543), 'hetu.wrapp...
"""Image functions for PET data reconstruction and processing.""" import glob import logging import math import multiprocessing import os import re import shutil from subprocess import run import nibabel as nib import numpy as np import pydicom as dcm from niftypet import nimpa from .. import mmraux from .. import ...
[ "os.remove", "numpy.load", "numpy.sum", "niftypet.nipet.lm.mmrhist", "re.finditer", "numpy.floor", "numpy.isnan", "os.path.isfile", "numpy.arange", "shutil.rmtree", "niftypet.nipet.lm.mmrhist.hist", "os.path.join", "multiprocessing.cpu_count", "niftypet.nimpa.dcm2im", "os.path.dirname", ...
[((343, 370), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (360, 370), False, 'import logging\n'), ((388, 413), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (396, 413), True, 'import numpy as np\n'), ((813, 841), 'numpy.transpose', 'np.transpose', (['img'...
""" Usage: kungfu-run -q -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --method CPU kungfu-run -q -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --method NCCL kungfu-run -q -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --method NCCL+CPU mpirun -np 4 python3 -m kungfu.tensorflow.v1.benchmarks --m...
[ "tensorflow.ones", "horovod.tensorflow.local_rank", "kungfu.python._get_cuda_index", "horovod.tensorflow.init", "argparse.ArgumentParser", "horovod.tensorflow.allreduce", "horovod.tensorflow.size", "tensorflow.global_variables_initializer", "kungfu.tensorflow.v1.helpers.utils.show_size", "json.dum...
[((1091, 1101), 'horovod.tensorflow.init', 'hvd.init', ([], {}), '()\n', (1099, 1101), True, 'import horovod.tensorflow as hvd\n'), ((1920, 1936), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (1934, 1936), True, 'import tensorflow as tf\n'), ((2404, 2459), 'argparse.ArgumentParser', 'argparse.ArgumentP...
import numpy as np from shapely.geometry import LineString, Polygon import plotly.graph_objs as go import utils.camera as cam_utils import cv2 import matplotlib import os from os import listdir from os.path import isfile, join, exists import soccer import argparse import utils.io as io from tqdm import tqdm import plo...
[ "cv2.line", "numpy.uint8", "numpy.minimum", "numpy.arctan2", "shapely.geometry.Polygon", "matplotlib.cm.get_cmap", "numpy.zeros", "plotly.offline.plot", "shapely.geometry.LineString", "numpy.sin", "numpy.asmatrix", "numpy.array", "numpy.cos", "cv2.fillConvexPoly", "utils.camera.Camera" ]
[((2573, 2644), 'plotly.offline.plot', 'py.offline.plot', (['fig'], {'filename': '"""/home/bunert/Data/results/players.html"""'}), "(fig, filename='/home/bunert/Data/results/players.html')\n", (2588, 2644), True, 'import plotly as py\n'), ((2706, 2919), 'numpy.array', 'np.array', (['[[0, 1], [1, 2], [2, 3], [3, 4], [1,...
import numpy as np import networkx as nx import matplotlib.pyplot as plt import matplotlib as mpl from .paths import paths_prob_to_edges_flux def flattened(G, scale=1, vertical=False): """Get flattened positions for a genotype-phenotype graph. Parameters ---------- G : GenotypePhenotypeGraph object ...
[ "networkx.draw_networkx_edges", "matplotlib.colors.Normalize", "matplotlib.cm.ScalarMappable", "networkx.draw_networkx", "networkx.draw_networkx_nodes", "numpy.arange", "matplotlib.pyplot.subplots" ]
[((6234, 6264), 'networkx.draw_networkx', 'nx.draw_networkx', (['G'], {}), '(G, **options)\n', (6250, 6264), True, 'import networkx as nx\n'), ((10099, 10296), 'networkx.draw_networkx_edges', 'nx.draw_networkx_edges', ([], {'G': 'G', 'pos': 'pos', 'edgelist': 'edgelist', 'width': 'width', 'edge_color': 'edge_color', 'a...
import numpy as np import tensorflow as tf import random import os from collections import deque from random import randint from envFive import envFive import player.dqn as dqn INPUT_SIZE = 12 OUTPUT_SIZE = 10 DISCOUNT_RATE = 0.99 REPLAY_MEMORY = 50000 MAX_EPISODE = 100000 BATCH_SIZE = 64 # minimum epsilon for ep...
[ "tensorflow.train.Saver", "player.dqn.DQN", "tensorflow.global_variables_initializer", "random.sample", "tensorflow.Session", "numpy.mean", "numpy.array", "numpy.random.rand", "numpy.vstack", "envFive.envFive", "collections.deque" ]
[((1444, 1453), 'envFive.envFive', 'envFive', ([], {}), '()\n', (1451, 1453), False, 'from envFive import envFive\n'), ((794, 832), 'numpy.vstack', 'np.vstack', (['[x[0] for x in train_batch]'], {}), '([x[0] for x in train_batch])\n', (803, 832), True, 'import numpy as np\n'), ((852, 889), 'numpy.array', 'np.array', ([...
from si_prefix import si_format import numpy as np known_units = {"mA" : 1e-3, "uA" : 1e-6, "nA" : 1e-9, "pA" : 1e-12, "fA" : 1e-15, "nV" : 1e-9, "uV" : 1e-6, "mV" : 1e-3, "ns" : 1e-9, "us" : 1e-6, "ms" : 1e-3, "KHz" : 1e3, "MHz" : 1e6, "GHz" : 1e9 } def ...
[ "si_prefix.si_format", "numpy.isnan" ]
[((569, 584), 'numpy.isnan', 'np.isnan', (['value'], {}), '(value)\n', (577, 584), True, 'import numpy as np\n'), ((615, 651), 'si_prefix.si_format', 'si_format', (['(value * scaler)', 'precision'], {}), '(value * scaler, precision)\n', (624, 651), False, 'from si_prefix import si_format\n')]
import cfg import sys import onnx import numpy as np import cv2 import onnxruntime import logging from tool.utils import plot_boxes_cv2, post_processing, load_class_names # Logging Setup logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) file_handler = logging.FileHandler("logs/detector.log") formatte...
[ "cv2.resize", "logging.FileHandler", "cv2.cvtColor", "numpy.transpose", "numpy.expand_dims", "logging.Formatter", "onnxruntime.InferenceSession", "cv2.imread", "tool.utils.load_class_names", "numpy.array", "tool.utils.plot_boxes_cv2", "tool.utils.post_processing", "logging.getLogger" ]
[((197, 224), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (214, 224), False, 'import logging\n'), ((271, 311), 'logging.FileHandler', 'logging.FileHandler', (['"""logs/detector.log"""'], {}), "('logs/detector.log')\n", (290, 311), False, 'import logging\n'), ((324, 391), 'logging.Forma...
# Copyright 2020 Tsinghua University, Author: <NAME> # Apache 2.0. # This script contrains TRF semi-supervised (JRF) training experiments. import tensorflow as tf import numpy as np import json import os from base import * import trf_semi import argparse paser = argparse.ArgumentParser() paser.add_argument('--alpha...
[ "trf_semi.TRF", "json.load", "numpy.random.seed", "argparse.ArgumentParser", "tensorflow.contrib.slim.get_variables_to_restore", "tensorflow.train.Saver", "trf_semi.DefaultOps", "tensorflow.set_random_seed", "tensorflow.get_default_graph", "tensorflow.ConfigProto", "tensorflow.train.latest_check...
[((267, 292), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (290, 292), False, 'import argparse\n'), ((1715, 1744), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['args.seed'], {}), '(args.seed)\n', (1733, 1744), True, 'import tensorflow as tf\n'), ((1745, 1770), 'numpy.random.seed', 'n...
import json import os import pathlib import pickle import unittest from test.test_api.utils import dummy_do_dummy_prediction, dummy_eval_function import ConfigSpace as CS from ConfigSpace.configuration_space import Configuration import numpy as np import pandas as pd import pytest import sklearn import sklearn.da...
[ "autoPyTorch.api.tabular_classification.TabularClassificationTask", "pickle.dump", "numpy.load", "smac.runhistory.runhistory.RunHistory", "sklearn.model_selection.train_test_split", "numpy.ones", "numpy.shape", "pathlib.Path", "pickle.load", "pytest.mark.parametrize", "sklearn.datasets.fetch_ope...
[((1110, 1214), 'unittest.mock.patch', 'unittest.mock.patch', (['"""autoPyTorch.evaluation.train_evaluator.eval_function"""'], {'new': 'dummy_eval_function'}), "('autoPyTorch.evaluation.train_evaluator.eval_function',\n new=dummy_eval_function)\n", (1129, 1214), False, 'import unittest\n'), ((1233, 1279), 'pytest.ma...
import itertools import numpy import tensorflow from tensorflow.python.keras import backend as K from .base_layer import ComplexLayer class ComplexDense(ComplexLayer): def __init__(self, units, activation=None, use_bias=True, kernel_initializer='complex_glorot', bias_initializer='zeros', ...
[ "tensorflow.manip.roll", "tensorflow.python.keras.backend.bias_add", "tensorflow.reshape", "tensorflow.stack", "tensorflow.python.keras.backend.dot", "numpy.prod" ]
[((1768, 1794), 'tensorflow.python.keras.backend.dot', 'K.dot', (['inputs', 'self.kernel'], {}), '(inputs, self.kernel)\n', (1773, 1794), True, 'from tensorflow.python.keras import backend as K\n'), ((2449, 2471), 'numpy.prod', 'numpy.prod', (['input_dims'], {}), '(input_dims)\n', (2459, 2471), False, 'import numpy\n')...
import numpy as np import matplotlib.pyplot as plt class ZSpreadModel: def __init__(self, params, b_t, c_t, T, n_step): self.m_params = params self.m_b_t = b_t self.m_c_t = c_t self.m_time_grid = np.linspace(0, T, n_step) def optimal_portfolio(self, z, t): b_t = sel...
[ "matplotlib.pyplot.show", "numpy.linalg.inv", "numpy.matmul", "numpy.linspace", "matplotlib.pyplot.subplots" ]
[((236, 261), 'numpy.linspace', 'np.linspace', (['(0)', 'T', 'n_step'], {}), '(0, T, n_step)\n', (247, 261), True, 'import numpy as np\n'), ((1474, 1502), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(6, 6)'}), '(figsize=(6, 6))\n', (1486, 1502), True, 'import matplotlib.pyplot as plt\n'), ((1699, 17...
# This code is copied from a github respotry 2020.08.08 8:54 a.m. # This code is copied from a github respotry 2020.08.10 10:00 a.m. # this code is to add logging function and siplify the main file. By Ruibing 2020.08.11.15:11 import argparse import os import random import shutil import time import warnings...
[ "pprint.pformat", "argparse.ArgumentParser", "config.update_config", "numpy.empty", "numpy.clip", "torch.cuda.device_count", "os.path.isfile", "pprint.pprint", "matplotlib.pyplot.gca", "torchvision.transforms.Normalize", "torch.no_grad", "os.path.join", "torch.nn.BCELoss", "torch.utils.dat...
[((921, 993), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MOCT image classification network"""'}), "(description='MOCT image classification network')\n", (944, 993), False, 'import argparse\n'), ((1181, 1204), 'config.update_config', 'update_config', (['args.cfg'], {}), '(args.cfg)\n'...
"""Functions for making lens-shaped surfaces.""" from dataclasses import dataclass from typing import Sequence, Tuple, Callable import numpy as np from .. import functions from ..types import Sequence2, Sequence3 from ..sdb import * __all__ = ['make_spherical_singlet', 'make_toroidal_singlet', 'make_spherical_singlet_...
[ "numpy.asarray" ]
[((1665, 1691), 'numpy.asarray', 'np.asarray', (['vertex0', 'float'], {}), '(vertex0, float)\n', (1675, 1691), True, 'import numpy as np\n'), ((2206, 2225), 'numpy.asarray', 'np.asarray', (['vertex0'], {}), '(vertex0)\n', (2216, 2225), True, 'import numpy as np\n'), ((2749, 2766), 'numpy.asarray', 'np.asarray', (['pitc...
# %%-- Import import torch import copy import torch.nn as nn import torch.nn.parallel import torch.optim as optim import torch.utils.data as Data from torch.autograd import Variable import numpy as np import pandas as pd pd.options.mode.chained_assignment = None # default='warn' import time import datetime import gc ...
[ "torch.nn.Dropout", "seaborn.heatmap", "numpy.argmax", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score", "sklearn.preprocessing.MinMaxScaler", "sklearn.metrics.classification_report", "numpy.shape", "LumiGAN.dataset.Dataset", "numpy.random.randint", "matplotlib.pyplot...
[((1375, 1400), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1398, 1400), False, 'import torch\n'), ((1663, 1680), 'LumiGAN.logger.Logger', 'Logger', (['tracefile'], {}), '(tracefile)\n', (1669, 1680), False, 'from LumiGAN.logger import Logger\n'), ((4128, 4157), 'torch.manual_seed', 'torch....
# -*- coding: utf-8 -*- import numpy from scipy import spatial from numpy import matrix from math import sqrt from panda3d.core import Point3, TransformState from panda3d.bullet import BulletSphereShape, BulletRigidBodyNode from random import uniform, gauss, random from time import time import math from cellpack.mgl_...
[ "cellpack.autopack.helper.toggleDisplay", "numpy.sum", "panda3d.bullet.BulletRigidBodyNode", "numpy.ones", "panda3d.core.Point3", "panda3d.bullet.BulletSphereShape", "numpy.arange", "scipy.spatial.cKDTree", "random.gauss", "cellpack.autopack.helper.host.find", "numpy.copy", "math.radians", "...
[((4183, 4200), 'numpy.identity', 'numpy.identity', (['(4)'], {}), '(4)\n', (4197, 4200), False, 'import numpy\n'), ((7186, 7224), 'numpy.ones', 'numpy.ones', (['self.sphere_points_nb', '"""i"""'], {}), "(self.sphere_points_nb, 'i')\n", (7196, 7224), False, 'import numpy\n'), ((14265, 14303), 'cellpack.autopack.ldSeque...
#!/usr/bin/env python from dipy.data import get_sphere from nose.tools import assert_equal import numpy as np from scipy.spatial.distance import (cosine, euclidean, mahalanobis) from scipy.special import logsumexp, softmax import torch from torch.nn.utils.rnn import PackedSequence from dwi_ml.models.direction_getter_m...
[ "numpy.random.seed", "dwi_ml.models.direction_getter_models.GaussianMixtureDirectionGetter", "numpy.allclose", "dipy.data.get_sphere", "scipy.spatial.distance.mahalanobis", "numpy.random.randint", "dwi_ml.models.direction_getter_models.SingleGaussianDirectionGetter", "dwi_ml.models.utils.fisher_von_mi...
[((1863, 1887), 'numpy.random.randint', 'np.random.randint', (['(1)', '(10)'], {}), '(1, 10)\n', (1880, 1887), True, 'import numpy as np\n'), ((2752, 2773), 'numpy.asarray', 'np.asarray', (['mean_loss'], {}), '(mean_loss)\n', (2762, 2773), True, 'import numpy as np\n'), ((2815, 2835), 'numpy.random.seed', 'np.random.se...
''' Using code learnt from https://www.datacamp.com/community/tutorials ''' from sklearn import datasets, svm, metrics import numpy as np import matplotlib.pyplot as plt import random from sklearn.model_selection import train_test_split # import minst dataset b = datasets.load_digits() # print out the number and l...
[ "sklearn.datasets.load_digits", "matplotlib.pyplot.show", "matplotlib.pyplot.get_cmap", "random.randint", "sklearn.svm.SVC", "matplotlib.pyplot.imshow", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score", "numpy.argsort", "numpy.random.choice" ]
[((268, 290), 'sklearn.datasets.load_digits', 'datasets.load_digits', ([], {}), '()\n', (288, 290), False, 'from sklearn import datasets, svm, metrics\n'), ((580, 617), 'random.randint', 'random.randint', (['(0)', 'number_of_examples'], {}), '(0, number_of_examples)\n', (594, 617), False, 'import random\n'), ((680, 700...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import pickle import sys import matplotlib.pyplot as plt import numpy as np from matplotlib import gridspec # TODO: store in pandas dataframe class Journal: """Journal. Class for representing the Hodgkin-Huxley model. All model parameters can b...
[ "matplotlib.pyplot.subplot", "pickle.dump", "matplotlib.pyplot.show", "numpy.ceil", "numpy.asarray", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.rcParams.update", "pickle.load", "matplotlib.pyplot.rc", "numpy.mean", "matplotlib.pyplot.gca", "matplotlib.gridspec...
[((6530, 6557), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (['params'], {}), '(params)\n', (6549, 6557), True, 'import matplotlib.pyplot as plt\n'), ((6566, 6593), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (6572, 6593), True, 'import matplotlib...
#!/usr/bin/python #-*- coding:utf-8 -*- import sys import struct import numpy as np import tensorflow as tf import random def matmul_f32(): para = [] dim0 = [] dim1 = [] # init the input data and parameters dim_count = int(np.random.randint(4, high=6, size=1)) for i in range(0, dim_count-2):...
[ "tensorflow.Session", "random.choice", "numpy.shape", "tensorflow.matmul", "numpy.random.randint", "numpy.random.normal" ]
[((926, 947), 'random.choice', 'random.choice', (['(0, 1)'], {}), '((0, 1))\n', (939, 947), False, 'import random\n'), ((962, 983), 'random.choice', 'random.choice', (['(0, 1)'], {}), '((0, 1))\n', (975, 983), False, 'import random\n'), ((1724, 1770), 'numpy.random.normal', 'np.random.normal', (['zero_point1', 'std1'],...
#!/usr/bin/env python # encoding: utf-8 import struct from numpy import ( int32, int64, float32, float64, int8, uint8, int16, uint16, uint32, uint64, frombuffer ) import struct _const = { 'i32.const': int32, 'i64.const': int64, 'f32,const': float32, 'f64.const': float64, } _binary = { # 3...
[ "numpy.uint32", "numpy.uint64", "math.sqrt", "numpy.frombuffer", "struct.unpack", "struct.pack", "time.sleep", "numpy.int32", "numpy.int64", "numpy.float64" ]
[((362, 374), 'numpy.int32', 'int32', (['(x + y)'], {}), '(x + y)\n', (367, 374), False, 'from numpy import int32, int64, float32, float64, int8, uint8, int16, uint16, uint32, uint64, frombuffer\n'), ((404, 416), 'numpy.int32', 'int32', (['(x - y)'], {}), '(x - y)\n', (409, 416), False, 'from numpy import int32, int64,...
import sys import matplotlib import matplotlib.pyplot as plt import numpy as np from matplotlib.ticker import MultipleLocator majorLocatorX = MultipleLocator(5) minorLocatorX = MultipleLocator(5) majorLocatorY = MultipleLocator(20) minorLocatorY = MultipleLocator(10) a1985 = [2] a1987 = [3] a1995 = [4, 5] a1996 = [6]...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axis", "matplotlib.pyplot.rc", "numpy.linspace", "numpy.exp", "matplotlib.ticker.MultipleLocator", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((143, 161), 'matplotlib.ticker.MultipleLocator', 'MultipleLocator', (['(5)'], {}), '(5)\n', (158, 161), False, 'from matplotlib.ticker import MultipleLocator\n'), ((178, 196), 'matplotlib.ticker.MultipleLocator', 'MultipleLocator', (['(5)'], {}), '(5)\n', (193, 196), False, 'from matplotlib.ticker import MultipleLoca...
from hazma.vector_mediator import VectorMediator, KineticMixing from hazma.parameters import vh from hazma.parameters import electron_mass as me import numpy as np import os from os import path def e_cm_mw(mx, vrel=1e-3): """Computes DM COM energy, assuming its velocity is much less than c. """ return 2 *...
[ "os.makedirs", "numpy.geomspace", "os.path.dirname", "os.path.exists", "os.path.join" ]
[((514, 536), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (526, 536), False, 'from os import path\n'), ((599, 620), 'os.makedirs', 'os.makedirs', (['data_dir'], {}), '(data_dir)\n', (610, 620), False, 'import os\n'), ((1539, 1566), 'numpy.geomspace', 'np.geomspace', (['(1.0)', 'e_cm', '(10)']...
import torch import sys, os sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "./../../../../"))) sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "./../../../"))) from fedml_api.model.cv.vgg import vgg11_bn, VGG_SNIP from fedml_api.model.cv.resnet import resnet56 from fedml_api.model.cv.wrn.wrn ...
[ "os.getcwd", "torch.load", "numpy.where", "fedml_api.model.cv.vgg.vgg11_bn" ]
[((418, 428), 'fedml_api.model.cv.vgg.vgg11_bn', 'vgg11_bn', ([], {}), '()\n', (426, 428), False, 'from fedml_api.model.cv.vgg import vgg11_bn, VGG_SNIP\n'), ((558, 568), 'fedml_api.model.cv.vgg.vgg11_bn', 'vgg11_bn', ([], {}), '()\n', (566, 568), False, 'from fedml_api.model.cv.vgg import vgg11_bn, VGG_SNIP\n'), ((456...
import sys import os import time import argparse import textwrap import smtplib import numpy import cv2 import movidius import imutils from imutils.video import VideoStream arguments = argparse.ArgumentParser( description="Heimdall AI Camera PoC using Intel Movidius Neural Compute Stick 1.") arguments.add_argumen...
[ "numpy.float16", "imutils.video.VideoStream", "movidius.allocate", "cv2.putText", "argparse.ArgumentParser", "smtplib.SMTP", "cv2.cvtColor", "cv2.waitKey", "cv2.imshow", "time.sleep", "time.time", "cv2.rectangle", "movidius.attach", "movidius.deattach", "cv2.destroyAllWindows" ]
[((186, 297), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Heimdall AI Camera PoC using Intel Movidius Neural Compute Stick 1."""'}), "(description=\n 'Heimdall AI Camera PoC using Intel Movidius Neural Compute Stick 1.')\n", (209, 297), False, 'import argparse\n'), ((3172, 3203), '...
from __future__ import absolute_import import numpy as np from targets.marshalling.marshaller import Marshaller from targets.target_config import FileFormat class NumpyArrayMarshaller(Marshaller): type = np.ndarray file_format = FileFormat.numpy def target_to_value(self, target, **kwargs): """ ...
[ "numpy.load", "numpy.save" ]
[((867, 916), 'numpy.load', 'np.load', (['target.path'], {'allow_pickle': '(True)'}), '(target.path, allow_pickle=True, **kwargs)\n', (874, 916), True, 'import numpy as np\n'), ((982, 1038), 'numpy.save', 'np.save', (['target.path', 'value'], {'allow_pickle': '(True)'}), '(target.path, value, allow_pickle=True, **kwarg...
# <NAME>, April 2020 from helper_fns import * import numpy as np import matplotlib.pyplot as plt import math from bson import objectid data = process_lookup2() # Takes ~10 seconds def flip_state(s): return [1] + s[10:] + s[1:10] def get_cost_per_game(user, game): if game["_id"] == objectid.ObjectId("...
[ "numpy.average", "matplotlib.pyplot.show", "bson.objectid.ObjectId", "matplotlib.pyplot.twinx" ]
[((2468, 2479), 'matplotlib.pyplot.twinx', 'plt.twinx', ([], {}), '()\n', (2477, 2479), True, 'import matplotlib.pyplot as plt\n'), ((2605, 2615), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2613, 2615), True, 'import matplotlib.pyplot as plt\n'), ((1249, 1266), 'numpy.average', 'np.average', (['costs'], {...
import pyrealsense2 as rs import numpy as np import datetime as dt import time import multiprocessing as mp import os # import mpio import cv2 from queue import Queue import threading as th class RecordingJob(th.Thread): def __init__(self, video_name, queue): super(RecordingJob, self).__init__() ...
[ "os.mkdir", "cv2.VideoWriter_fourcc", "pyrealsense2.pipeline", "cv2.waitKey", "numpy.asanyarray", "os.path.exists", "pyrealsense2.config", "time.sleep", "time.time", "threading.Event", "cv2.VideoWriter", "cv2.imshow", "datetime.datetime.now", "queue.Queue" ]
[((1350, 1357), 'queue.Queue', 'Queue', ([], {}), '()\n', (1355, 1357), False, 'from queue import Queue\n'), ((1513, 1526), 'pyrealsense2.pipeline', 'rs.pipeline', ([], {}), '()\n', (1524, 1526), True, 'import pyrealsense2 as rs\n'), ((1540, 1551), 'pyrealsense2.config', 'rs.config', ([], {}), '()\n', (1549, 1551), Tru...
# Copyright (c) 2019-2021 CRS4 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribut...
[ "numpy.zeros", "pytest.mark.parametrize", "pytest.raises", "numpy.array" ]
[((1302, 1355), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ecvl"""', '[ecvl_core, ecvl_py]'], {}), "('ecvl', [ecvl_core, ecvl_py])\n", (1325, 1355), False, 'import pytest\n'), ((1733, 1786), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ecvl"""', '[ecvl_core, ecvl_py]'], {}), "('ecvl', [e...
import numpy as np import pandas as pd class FplusTreeSampling(object): """ F+ tree for sampling from a large population Construct in O(N) time Sample and update in O(log(N)) time """ def __init__(self, dimension, weights=None): self.dimension = dimension self.layers = int(np....
[ "numpy.ceil", "numpy.log2", "numpy.zeros", "numpy.ones", "numpy.array", "numpy.random.sample" ]
[((2227, 2264), 'numpy.zeros', 'np.zeros', (['(batch_size,)'], {'dtype': 'np.int'}), '((batch_size,), dtype=np.int)\n', (2235, 2264), True, 'import numpy as np\n'), ((2283, 2322), 'numpy.zeros', 'np.zeros', (['(batch_size,)'], {'dtype': 'np.float'}), '((batch_size,), dtype=np.float)\n', (2291, 2322), True, 'import nump...
# -*- coding: utf-8 -*- ''' Budget Support Vector Machine under POM6 ''' __author__ = "<NAME>" __date__ = "Apr. 2021" import numpy as np from MMLL.models.Common_to_all_POMs import Common_to_all_POMs from transitions import State from transitions.extensions import GraphMachine #from pympler import asizeof ...
[ "pickle.dump", "numpy.random.seed", "numpy.sum", "numpy.argmax", "numpy.ones", "numpy.linalg.norm", "numpy.exp", "numpy.random.normal", "transitions.extensions.GraphMachine", "numpy.multiply", "skl2onnx.common.data_types.FloatTensorType", "transitions.State", "dill.dumps", "numpy.linalg.in...
[((796, 807), 'time.time', 'time.time', ([], {}), '()\n', (805, 807), False, 'import time\n'), ((859, 884), 'numpy.random.seed', 'np.random.seed', ([], {'seed': 'seed'}), '(seed=seed)\n', (873, 884), True, 'import numpy as np\n'), ((1436, 1472), 'numpy.exp', 'np.exp', (['(-XC2 / 2.0 / self.sigma ** 2)'], {}), '(-XC2 / ...
# -*- coding: utf-8 -*- """ Automated Tool for Optimized Modelling (ATOM) Author: Mavs Description: Module containing the feature engineering estimators. """ # Standard packages import random import numpy as np import pandas as pd from typeguard import typechecked from typing import Optional, Union # Other packages...
[ "pandas.DataFrame", "sklearn.feature_selection.SequentialFeatureSelector", "sklearn.feature_selection.RFECV", "woodwork.column_schema.ColumnSchema", "sklearn.feature_selection.RFE", "featuretools.dfs", "numpy.ones", "numpy.hstack", "numpy.argpartition", "featuretools.EntitySet", "numpy.sin", "...
[((28379, 28464), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['drop_feature', 'correlated_feature', 'correlation_value']"}), "(columns=['drop_feature', 'correlated_feature',\n 'correlation_value'])\n", (28391, 28464), True, 'import pandas as pd\n'), ((15848, 15917), 'featuretools.EntitySet', 'ft.EntitySet...
""" position_analysis.py contains scripts for analyzing position data, as the name might imply. """ import ast import csv import glob import os import signal import sys import time from mpl_toolkits.mplot3d import Axes3D from sensor_msgs.msg import Image import cv2 import matplotlib.pyplot as plt impo...
[ "rospy.Subscriber", "cv2.bitwise_and", "agent.agent_ros.HemiAgentROS", "matplotlib.pyplot.figure", "numpy.sin", "glob.glob", "os.path.join", "psutil.process_iter", "cv2.cvtColor", "matplotlib.pyplot.close", "numpy.reshape", "numpy.fromstring", "mpl_toolkits.mplot3d.Axes3D", "csv.DictReader...
[((1299, 1337), 'cv2.cvtColor', 'cv2.cvtColor', (['hemi', 'cv2.COLOR_BGR2GRAY'], {}), '(hemi, cv2.COLOR_BGR2GRAY)\n', (1311, 1337), False, 'import cv2\n'), ((1357, 1408), 'cv2.threshold', 'cv2.threshold', (['hemi_gray', '(1)', '(255)', 'cv2.THRESH_BINARY'], {}), '(hemi_gray, 1, 255, cv2.THRESH_BINARY)\n', (1370, 1408),...
#!/usr/bin/env python3 import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib')) from support import Database, Config import numpy as np import queue, math, socket, subprocess, support, threading import tensorflow as tf class Learn: def __init__(self, config): graph = tf.Graph(...
[ "sys.stdout.write", "tensorflow.reduce_sum", "tensorflow.nn.rnn_cell.LSTMStateTuple", "tensorflow.trainable_variables", "socket.socket", "tensorflow.merge_all_summaries", "tensorflow.matmul", "os.path.isfile", "numpy.mean", "tensorflow.Variable", "numpy.arange", "tensorflow.nn.rnn_cell.LSTMCel...
[((10832, 10847), 'support.Database.find', 'Database.find', ([], {}), '()\n', (10845, 10847), False, 'from support import Database, Config\n'), ((10866, 10896), 'os.path.dirname', 'os.path.dirname', (['database_path'], {}), '(database_path)\n', (10881, 10896), False, 'import os, sys\n'), ((68, 93), 'os.path.dirname', '...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 7 11:51:53 2019 @author: carsault """ #%% import pickle import torch from utilities import chordUtil from utilities.chordUtil import * from utilities import testFunc from utilities.testFunc import * from utilities import distance from utilities.di...
[ "pickle.dump", "utilities.chordUtil.getDictKey", "utilities.testFunc.computeMat", "numpy.std", "numpy.log2", "numpy.zeros", "ACE_Analyzer.ACEAnalyzer", "numpy.mean", "torch.cuda.is_available", "pickle.load" ]
[((928, 950), 'utilities.chordUtil.getDictKey', 'chordUtil.getDictKey', ([], {}), '()\n', (948, 950), False, 'from utilities import chordUtil\n'), ((25321, 25352), 'pickle.dump', 'pickle.dump', (['dictFinalRes', 'sauv'], {}), '(dictFinalRes, sauv)\n', (25332, 25352), False, 'import pickle\n'), ((514, 539), 'torch.cuda....
# test_yolov3.py # Basic script to test YOLOv3 model. # # Reference: https://machinelearningmastery.com/how-to-perform-object-detection-with-yolov3-in-keras/ from yolo3_one_file_to_detect_them_all import * import numpy as np from keras.models import load_model from keras.preprocessing.image import load_img, img_to_ar...
[ "keras.models.load_model", "matplotlib.pyplot.show", "matplotlib.patches.Rectangle", "matplotlib.pyplot.imshow", "numpy.expand_dims", "matplotlib.pyplot.axis", "matplotlib.pyplot.text", "keras.preprocessing.image.img_to_array", "keras.preprocessing.image.load_img", "matplotlib.pyplot.gca", "matp...
[((1628, 1650), 'keras.models.load_model', 'load_model', (['"""model.h5"""'], {}), "('model.h5')\n", (1638, 1650), False, 'from keras.models import load_model\n'), ((2566, 2584), 'keras.preprocessing.image.load_img', 'load_img', (['filename'], {}), '(filename)\n', (2574, 2584), False, 'from keras.preprocessing.image im...
# Lint as: python3 #!/usr/bin/env python # Copyright 2021 The CARFAC Authors. All Rights Reserved. # # This file is part of an implementation of Lyon's cochlear model: # "Cascade of Asymmetric Resonators with Fast-Acting Compression" # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use...
[ "unittest.main", "numpy.fft.ifft", "tensorflow.ones", "tensorflow.math.conj", "numpy.fft.fft", "tensorflow.keras.layers.RNN", "numpy.zeros", "tensorflow.constant", "tensorflow.cast", "absl.app.run", "tensorflow.zeros", "numpy.exp", "numpy.linspace", "numpy.array", "numpy.testing.assert_a...
[((5852, 5867), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5865, 5867), False, 'import unittest\n'), ((5898, 5911), 'absl.app.run', 'app.run', (['main'], {}), '(main)\n', (5905, 5911), False, 'from absl import app\n'), ((1992, 2041), 'tensorflow.constant', 'tf.constant', (['[1, 2, 3, 4, 5]'], {'dtype': 'tf.co...
from .memory import Memory import collections import random import numpy as np eps = 1e-10 class PrioMemory(Memory): def __init__(self, model, memory_size=65536): self.model = model self.memory_size = memory_size self.memory = collections.OrderedDict() self.max_prio = 1.0 ...
[ "numpy.sum", "numpy.argmax", "numpy.frombuffer", "numpy.array", "collections.OrderedDict" ]
[((258, 283), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (281, 283), False, 'import collections\n'), ((1312, 1373), 'numpy.array', 'np.array', (['[((n * probs[idx]) ** -beta) for idx in chosen_idx]'], {}), '([((n * probs[idx]) ** -beta) for idx in chosen_idx])\n', (1320, 1373), True, 'impor...
import numpy import chainer from chainer import functions from chainer_pointnet.models.conv_block import ConvBlock from chainer_pointnet.utils.grouping import query_ball_by_diff from chainer_pointnet.utils.sampling import farthest_point_sampling class SetAbstractionModule(chainer.Chain): def __init__(self, k, ...
[ "numpy.random.uniform", "chainer_pointnet.utils.grouping.query_ball_by_diff", "chainer_pointnet.models.conv_block.ConvBlock", "chainer.functions.concat", "chainer.functions.max", "chainer.functions.broadcast_to", "cupy.random.uniform", "chainer.functions.transpose" ]
[((2467, 2516), 'chainer.functions.transpose', 'functions.transpose', (['grouped_points', '(0, 3, 2, 1)'], {}), '(grouped_points, (0, 3, 2, 1))\n', (2486, 2516), False, 'from chainer import functions\n'), ((2723, 2762), 'chainer.functions.max', 'functions.max', (['h'], {'axis': '(2)', 'keepdims': '(True)'}), '(h, axis=...
import numpy as np import ScanMatchPy import matlab import brainscore import brainio_collection from brainscore.benchmarks import Benchmark, ceil_score from brainscore.model_interface import BrainModel from brainscore.metrics import Score from brainscore.utils import fullname import logging from tqdm import tqdm clas...
[ "brainscore.benchmarks.ceil_score", "numpy.std", "numpy.asarray", "ScanMatchPy.initialize", "brainscore.utils.fullname", "numpy.max", "numpy.mean", "brainscore.get_assembly", "brainscore.metrics.Score", "numpy.sqrt" ]
[((468, 566), 'brainscore.metrics.Score', 'Score', (['[ceil_score, np.nan]'], {'coords': "{'aggregation': ['center', 'error']}", 'dims': "['aggregation']"}), "([ceil_score, np.nan], coords={'aggregation': ['center', 'error']},\n dims=['aggregation'])\n", (473, 566), False, 'from brainscore.metrics import Score\n'), ...
import csv import cv2 import numpy as np lines = [] with open('/opt/carnd_p3/data/driving_log.csv') as csvfile: reader = csv.reader(csvfile) firstLineRead = False for line in reader: if not firstLineRead: firstLineRead = True else: lines.append(line) images ...
[ "matplotlib.pyplot.title", "csv.reader", "keras.layers.Cropping2D", "keras.layers.Flatten", "matplotlib.pyplot.show", "keras.callbacks.ModelCheckpoint", "keras.layers.Dropout", "matplotlib.pyplot.legend", "keras.applications.inception_v3.InceptionV3", "matplotlib.pyplot.ylabel", "cv2.flip", "m...
[((881, 897), 'numpy.array', 'np.array', (['images'], {}), '(images)\n', (889, 897), True, 'import numpy as np\n'), ((908, 930), 'numpy.array', 'np.array', (['measurements'], {}), '(measurements)\n', (916, 930), True, 'import numpy as np\n'), ((1061, 1073), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (10...