code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#%% import numpy as np from utils import * #%% def lstm_cell_forward(xt, a_prev, c_prev, parameters): """ Implement a single forward step of the LSTM-cell Arguments: xt -- your input data at timestep "t", numpy array of shape (n_x, m) a_prev -- Hidden state at timestep "t-1", numpy array of shape...
[ "numpy.multiply", "numpy.tanh", "numpy.sum", "numpy.zeros", "numpy.dot", "numpy.concatenate" ]
[((2419, 2455), 'numpy.concatenate', 'np.concatenate', (['(a_prev, xt)'], {'axis': '(0)'}), '((a_prev, xt), axis=0)\n', (2433, 2455), True, 'import numpy as np\n'), ((5177, 5200), 'numpy.zeros', 'np.zeros', (['(n_a, m, T_x)'], {}), '((n_a, m, T_x))\n', (5185, 5200), True, 'import numpy as np\n'), ((5209, 5232), 'numpy....
import numpy as np import pytest from sklearn.datasets import make_regression from cartesian import Symbolic from cartesian.sklearn_api import _ensure_1d class TestSymbolic: @pytest.mark.parametrize("n_out", [1, 2]) def test_fit(self, n_out): x, y = make_regression(n_features=2, n_informative=1, n_ta...
[ "cartesian.Symbolic", "cartesian.sklearn_api._ensure_1d", "sklearn.datasets.make_regression", "numpy.ones", "pytest.mark.parametrize" ]
[((182, 222), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n_out"""', '[1, 2]'], {}), "('n_out', [1, 2])\n", (205, 222), False, 'import pytest\n'), ((269, 332), 'sklearn.datasets.make_regression', 'make_regression', ([], {'n_features': '(2)', 'n_informative': '(1)', 'n_targets': 'n_out'}), '(n_features=2...
import sys # import matplotlib.pyplot as plt import numpy as np from PIL import Image from sr_convnet import SRConvNet if len(sys.argv) != 4: print('Usage: python3 {} in.pkl in.xxx(image) ' 'out.xxx(image)'.format(sys.argv[0])) sys.exit(1) fnp = sys.argv[1] fni = sys.argv[2] fno = sys.argv[3] num_...
[ "sr_convnet.SRConvNet", "numpy.empty", "numpy.clip", "PIL.Image.open", "numpy.array", "PIL.Image.fromarray", "sys.exit" ]
[((359, 374), 'PIL.Image.open', 'Image.open', (['fni'], {}), '(fni)\n', (369, 374), False, 'from PIL import Image\n'), ((573, 609), 'numpy.empty', 'np.empty', (['(1, num_ch, height, width)'], {}), '((1, num_ch, height, width))\n', (581, 609), True, 'import numpy as np\n'), ((647, 935), 'sr_convnet.SRConvNet', 'SRConvNe...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 27 12:40:48 2018 @author: BallBlueMeercat """ import numpy as np import os import time from results import load import matplotlib.pyplot as plt import matplotlib as mpl mpl.style.use('default') # has to be switched on to set figure size mpl.style...
[ "matplotlib.pyplot.title", "matplotlib.style.use", "os.walk", "numpy.argmin", "numpy.hsplit", "numpy.isnan", "matplotlib.pyplot.figure", "results.load", "os.path.join", "matplotlib.pyplot.locator_params", "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.subplots", "matplotlib.pyplot.a...
[((243, 267), 'matplotlib.style.use', 'mpl.style.use', (['"""default"""'], {}), "('default')\n", (256, 267), True, 'import matplotlib as mpl\n'), ((311, 343), 'matplotlib.style.use', 'mpl.style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (324, 343), True, 'import matplotlib as mpl\n'), ((465, 513), ...
import json import random import numpy as np import pytest_caprng def test_random_state_serialization(): orig_state = random.getstate() json_transduced = json.loads(json.dumps(orig_state)) bak_state = pytest_caprng.to_random_state(json_transduced) random.random() # Mutate the state. assert orig_...
[ "pytest_caprng.to_random_state", "numpy.random.get_state", "pytest_caprng.to_json_serializable_np_random_state", "json.dumps", "numpy.random.set_state", "random.random", "numpy.random.random", "random.setstate", "random.getstate" ]
[((124, 141), 'random.getstate', 'random.getstate', ([], {}), '()\n', (139, 141), False, 'import random\n'), ((215, 261), 'pytest_caprng.to_random_state', 'pytest_caprng.to_random_state', (['json_transduced'], {}), '(json_transduced)\n', (244, 261), False, 'import pytest_caprng\n'), ((267, 282), 'random.random', 'rando...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import numpy as np from typing import List from .detect import BoundingBox def cast_pn_to_xyz(p_dst, normal, cam_v): """ Cast plane-distance + normal inputs into camera xyz coordinate space Args: p_dst: a float list with s...
[ "numpy.meshgrid", "numpy.sum", "numpy.logical_and", "numpy.zeros", "numpy.ones", "numpy.expand_dims", "numpy.where", "numpy.linalg.norm", "numpy.arange", "numpy.all" ]
[((834, 890), 'numpy.sum', 'np.sum', (['(normal_norm * cam_v_norm)'], {'axis': '(-1)', 'keepdims': '(True)'}), '(normal_norm * cam_v_norm, axis=-1, keepdims=True)\n', (840, 890), True, 'import numpy as np\n'), ((904, 942), 'numpy.where', 'np.where', (['(cosine == 0.0)', '(1e-06)', 'cosine'], {}), '(cosine == 0.0, 1e-06...
import os.path as osp import numpy as np import scipy.sparse as sp import networkx as nx import pandas as pd import os import time import torch from scipy.linalg import fractional_matrix_power, inv import torch_geometric.transforms as T from torch_geometric.data import Data from torch_geometric.utils import to_undirect...
[ "torch.ones", "torch.LongTensor", "torch.FloatTensor", "torch.nonzero", "torch.mm", "torch_geometric.utils.add_self_loops", "torch.Size", "torch_scatter.scatter_add", "torch.isnan", "numpy.vstack", "torch.from_numpy" ]
[((855, 917), 'torch_geometric.utils.add_self_loops', 'add_self_loops', (['edge_index', 'edge_weight', 'fill_value', 'num_nodes'], {}), '(edge_index, edge_weight, fill_value, num_nodes)\n', (869, 917), False, 'from torch_geometric.utils import add_remaining_self_loops, add_self_loops, remove_self_loops, to_dense_adj\n'...
import numpy as np import pandas as pd from tqdm import tqdm import datetime pd.plotting.register_matplotlib_converters() # addresses complaints about Timestamp instead of float for plotting x-values import matplotlib import matplotlib.pyplot as plt from matplotlib.lines import Line2D import joblib from scipy.stats i...
[ "os.mkdir", "matplotlib.pyplot.clf", "joblib.dump", "matplotlib.pyplot.style.use", "os.path.join", "pandas.DataFrame", "matplotlib.pyplot.axvline", "scipy.stats.norm", "matplotlib.lines.Line2D", "numpy.std", "matplotlib.pyplot.close", "os.path.exists", "numpy.cumsum", "datetime.timedelta",...
[((78, 122), 'pandas.plotting.register_matplotlib_converters', 'pd.plotting.register_matplotlib_converters', ([], {}), '()\n', (120, 122), True, 'import pandas as pd\n'), ((343, 376), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-darkgrid"""'], {}), "('seaborn-darkgrid')\n", (356, 376), True, 'import ma...
import ast import contextlib import os from collections import defaultdict from os.path import expandvars from pathlib import Path from time import time import numpy as np import torch import yaml from addict import Dict from comet_ml import Experiment from funkybob import RandomNameGenerator from yaml import safe_loa...
[ "os.remove", "numpy.random.seed", "yaml.safe_dump", "numpy.random.get_state", "torch.optim.lr_scheduler.ReduceLROnPlateau", "time.time", "funkybob.RandomNameGenerator", "numpy.random.set_state", "collections.defaultdict", "pathlib.Path", "numpy.array", "numpy.reshape", "yaml.safe_load", "a...
[((2586, 2602), 'addict.Dict', 'Dict', (['all_params'], {}), '(all_params)\n', (2590, 2602), False, 'from addict import Dict\n'), ((7529, 7556), 'os.remove', 'os.remove', (['sorted_ckpts[-1]'], {}), '(sorted_ckpts[-1])\n', (7538, 7556), False, 'import os\n'), ((7867, 7883), 'numpy.array', 'np.array', (['matrix'], {}), ...
import util.util as util import numpy as np import math def sigmoid(x): """ Logistic function for perceptron :param x: value to pass through logistic function :return: Float between 0.0 and 1.0 """ try: return 1 / (1 + math.exp(-x)) except OverflowError: if x < -50.0: ...
[ "math.exp", "util.util.get_promote_data", "util.util.get_data", "numpy.array", "util.util.add_bias" ]
[((1985, 2010), 'util.util.add_bias', 'util.add_bias', (['activation'], {}), '(activation)\n', (1998, 2010), True, 'import util.util as util\n'), ((3350, 3382), 'util.util.add_bias', 'util.add_bias', (['full_data[lr - 1]'], {}), '(full_data[lr - 1])\n', (3363, 3382), True, 'import util.util as util\n'), ((253, 265), 'm...
import os import numpy as np import open3d as o3d # from TUM_RGBD import load_K_Rt_from_P from vis_cameras import visualize def get_box(vol_bnds): points = [ [vol_bnds[0, 0], vol_bnds[1, 0], vol_bnds[2, 0]], [vol_bnds[0, 1], vol_bnds[1, 0], vol_bnds[2, 0]], [vol_bnds[0, 0], vol_bnds[1, 1],...
[ "os.path.join", "vis_cameras.visualize", "open3d.utility.Vector2iVector", "numpy.array", "open3d.utility.Vector3dVector" ]
[((1063, 1097), 'open3d.utility.Vector3dVector', 'o3d.utility.Vector3dVector', (['colors'], {}), '(colors)\n', (1089, 1097), True, 'import open3d as o3d\n'), ((1876, 1928), 'numpy.array', 'np.array', (['[[xmin, xmax], [ymin, ymax], [zmin, zmax]]'], {}), '([[xmin, xmax], [ymin, ymax], [zmin, zmax]])\n', (1884, 1928), Tr...
#!/usr/bin/env python3 # Copyright 2018 archproj-bmwteam # # 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 ...
[ "jsonparser.search_by_abstraction", "argparse.ArgumentParser", "jsonparser.get_abstraction_layers", "jsonparser.search_by_domain", "graph_analyzer.add_parent", "graph_analyzer.list_shared_sub_vertices", "numpy.savetxt", "jsonparser.get_domains", "jsonparser.search_by_context", "graph_analyzer.sear...
[((9970, 10007), 'jsonparser.get_domains', 'jsonparser.get_domains', (['json_filename'], {}), '(json_filename)\n', (9992, 10007), False, 'import jsonparser\n'), ((10440, 10484), 'jsonparser.get_context_groups', 'jsonparser.get_context_groups', (['json_filename'], {}), '(json_filename)\n', (10469, 10484), False, 'import...
import bpy import numpy as np X = np.loadtxt('/Users/papiit/Desktop/Reinforcement_Learning/Proyecto2/XYZ.txt') A = np.loadtxt('/Users/papiit/Desktop/Reinforcement_Learning/Proyecto2/ang.txt') posiciones, angulos = [],[] for i in range(len(X[0])): posiciones.append([X[0][i],X[1][1],X[2][i]]) angulos.append([...
[ "numpy.loadtxt", "bpy.context.scene.frame_set" ]
[((37, 113), 'numpy.loadtxt', 'np.loadtxt', (['"""/Users/papiit/Desktop/Reinforcement_Learning/Proyecto2/XYZ.txt"""'], {}), "('/Users/papiit/Desktop/Reinforcement_Learning/Proyecto2/XYZ.txt')\n", (47, 113), True, 'import numpy as np\n'), ((118, 194), 'numpy.loadtxt', 'np.loadtxt', (['"""/Users/papiit/Desktop/Reinforcem...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import glob2 import PIL try: import Image except ImportError: from PIL import Image import cv2 from skimage import io, color from tensorflow import keras import tensorflow as tf tf.__version__ from keras.layers import * from tqdm import ...
[ "cv2.cvtColor", "numpy.zeros", "numpy.reshape", "cv2.merge", "matplotlib.pyplot.imread", "cv2.resize" ]
[((395, 417), 'matplotlib.pyplot.imread', 'plt.imread', (['image_path'], {}), '(image_path)\n', (405, 417), True, 'import matplotlib.pyplot as plt\n'), ((2510, 2544), 'numpy.reshape', 'np.reshape', (['resized', '(480, 480, 1)'], {}), '(resized, (480, 480, 1))\n', (2520, 2544), True, 'import numpy as np\n'), ((498, 521)...
import os import argparse import numpy as np import trimesh import pyrender import matplotlib.pyplot as plt import pddlgym from loader import load_scenegraph from pddlgym_planners.fd import FD from pddlgym_planners.planner import (PlanningFailure, PlanningTimeout) def plot_plan(domain_name, model): """Plot the ...
[ "pyrender.camera.PerspectiveCamera", "trimesh.load", "matplotlib.pyplot.show", "argparse.ArgumentParser", "os.path.basename", "pyrender.DirectionalLight", "matplotlib.pyplot.imshow", "pyrender.Viewer", "pddlgym_planners.fd.FD", "matplotlib.pyplot.axis", "pyrender.Mesh.from_trimesh", "matplotli...
[((882, 917), 'pddlgym_planners.fd.FD', 'FD', ([], {'alias_flag': '"""--alias lama-first"""'}), "(alias_flag='--alias lama-first')\n", (884, 917), False, 'from pddlgym_planners.fd import FD\n'), ((2821, 2846), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2844, 2846), False, 'import argparse\...
import numpy as np def maze_7x5(a=-1.0, b=-5.0, goal=15.0): nx, ny = 7, 5 S = np.zeros([nx, ny]) + a # blocks S[1,3] = b S[2,1:3] = b S[4,4:] = b S[4,:2] = b # S[1,4] = b S[6,3] = b # S[6,1] = goal return S def maze_13x13(a=-1.0, b=-5.0, goal=15.0): nx...
[ "numpy.zeros" ]
[((90, 108), 'numpy.zeros', 'np.zeros', (['[nx, ny]'], {}), '([nx, ny])\n', (98, 108), True, 'import numpy as np\n'), ((343, 361), 'numpy.zeros', 'np.zeros', (['[nx, ny]'], {}), '([nx, ny])\n', (351, 361), True, 'import numpy as np\n')]
#!/home/xwu/bin/python #-*- coding:utf-8 -*- from sklearn.linear_model import LogisticRegression from sklearn.externals import joblib from sklearn.model_selection import train_test_split import numpy as np import os class Model(): def __init__(self,filename,suffix,assessment,filteration=None,coefs_file='coefs.txt',)...
[ "sklearn.externals.joblib.dump", "numpy.savetxt", "os.path.exists", "numpy.hstack", "sklearn.linear_model.LogisticRegression", "numpy.array", "numpy.loadtxt", "sklearn.externals.joblib.load", "numpy.vstack" ]
[((598, 674), 'sklearn.linear_model.LogisticRegression', 'LogisticRegression', ([], {'C': '(100000.0)', 'penalty': '"""l2"""', 'tol': '(0.0001)', 'solver': '"""liblinear"""'}), "(C=100000.0, penalty='l2', tol=0.0001, solver='liblinear')\n", (616, 674), False, 'from sklearn.linear_model import LogisticRegression\n'), ((...
#!/bin/sh /cvmfs/icecube.opensciencegrid.org/py2-v1/icetray-start #METAPROJECT /data/user/jbourbeau/metaprojects/icerec/V05-00-00/build import numpy as np import pandas as pd import time import glob import argparse import os from collections import defaultdict from icecube.weighting.weighting import from_simprod from...
[ "composition.checkdir", "argparse.ArgumentParser", "pandas.DataFrame.from_dict", "pandas.HDFStore", "numpy.asarray", "time.time", "collections.defaultdict", "composition.Paths", "composition.simfunctions.sim2comp", "os.path.splitext", "glob.glob", "numpy.sqrt" ]
[((477, 489), 'composition.Paths', 'comp.Paths', ([], {}), '()\n', (487, 489), True, 'import composition as comp\n'), ((494, 530), 'composition.checkdir', 'comp.checkdir', (['mypaths.comp_data_dir'], {}), '(mypaths.comp_data_dir)\n', (507, 530), True, 'import composition as comp\n'), ((540, 619), 'argparse.ArgumentPars...
import unittest import numpy as np import math import rotate3d class TestRotate3dMisc(unittest.TestCase): """A basic test suite for rotate3d helper functions""" def test_normalize_x(self): (x,y,z) = rotate3d.normalize(5,0,0) np.testing.assert_almost_equal(x, 1) np.testing.assert_almost_equal(y, 0) np.testi...
[ "unittest.main", "math.sqrt", "math.radians", "numpy.testing.assert_almost_equal", "numpy.testing.assert_array_equal", "numpy.array", "numpy.testing.assert_array_almost_equal", "rotate3d.normalize" ]
[((6202, 6217), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6215, 6217), False, 'import unittest\n'), ((206, 233), 'rotate3d.normalize', 'rotate3d.normalize', (['(5)', '(0)', '(0)'], {}), '(5, 0, 0)\n', (224, 233), False, 'import rotate3d\n'), ((234, 270), 'numpy.testing.assert_almost_equal', 'np.testing.asser...
from . import params from . import defineCnst as C import numpy as np import torch as tr def placeCars(envCars, traffic_density): # do this for all the cars # index starts from 1 as ego car is car_0 if len(envCars) > 15: MAX_DIST = params.SIM_MAX_DISTANCE*2 else: MAX_DIST = params.SIM_...
[ "numpy.zeros", "numpy.around", "numpy.random.randint", "numpy.array", "numpy.arange", "numpy.exp", "numpy.random.random", "torch.zeros" ]
[((6964, 6995), 'numpy.zeros', 'np.zeros', (['params.CAR_NUM_STATES'], {}), '(params.CAR_NUM_STATES)\n', (6972, 6995), True, 'import numpy as np\n'), ((7010, 7025), 'numpy.arange', 'np.arange', (['(1)', '(7)'], {}), '(1, 7)\n', (7019, 7025), True, 'import numpy as np\n'), ((7526, 7553), 'numpy.around', 'np.around', (['...
from astropy.io import fits, ascii from astropy.table import Table import numpy as NP project_MWA = False project_HERA = False project_beams = False project_drift_scan = True project_global_EoR = False if project_MWA: project_dir = 'project_MWA' if project_HERA: project_dir = 'project_HERA' if project_beams: project_...
[ "astropy.table.Table", "numpy.sum", "numpy.abs", "numpy.angle", "astropy.io.ascii.write", "numpy.arange", "astropy.io.fits.open", "numpy.swapaxes", "numpy.sqrt" ]
[((7202, 7229), 'astropy.io.fits.open', 'fits.open', (["(infile + '.fits')"], {}), "(infile + '.fits')\n", (7211, 7229), False, 'from astropy.io import fits, ascii\n'), ((7665, 7686), 'numpy.arange', 'NP.arange', (['chans.size'], {}), '(chans.size)\n', (7674, 7686), True, 'import numpy as NP\n'), ((8990, 9041), 'numpy....
import pandas as pd from pyqmc.mc import vmc, initial_guess from pyscf import gto, scf, mcscf from pyqmc.slater import PySCFSlater from pyqmc.jastrowspin import JastrowSpin from pyqmc.accumulators import EnergyAccumulator from pyqmc.multiplywf import MultiplyWF from pyqmc.multislater import MultiSlater import numpy as ...
[ "pyqmc.mc.initial_guess", "time.time", "numpy.around", "pyscf.gto.M", "pyscf.scf.RHF", "pyqmc.jastrowspin.JastrowSpin", "pyqmc.slater.PySCFSlater", "pyqmc.accumulators.EnergyAccumulator", "pyqmc.multislater.MultiSlater", "pyscf.mcscf.CASCI" ]
[((363, 438), 'pyscf.gto.M', 'gto.M', ([], {'atom': '"""C 0 0 0 \n C 1 0 0 \n """', 'ecp': '"""bfd"""', 'basis': '"""bfd_vtz"""'}), '(atom="""C 0 0 0 \n C 1 0 0 \n """, ecp=\'bfd\', basis=\'bfd_vtz\')\n', (368, 438), False, 'from pyscf import gto, scf, mcscf\n'), ((528, 553), 'pyqmc.mc.initial_guess',...
"""face_detect_mtcnn is used for aligning faces based on mtcnn algorithm. <NAME> and <NAME> and <NAME> and <NAME>, Face Detection and Alignment Using Multitask Cascaded Convolutional Networks, IEEE Signal Processing Letters """ ### The dataset should have the two level structure: ### Such as Casia-Webface, YoutubeFace:...
[ "numpy.maximum", "argparse.ArgumentParser", "numpy.argmax", "random.shuffle", "tensorflow.ConfigProto", "numpy.random.randint", "scipy.misc.imsave", "detect_face.detect_face", "tensorflow.GPUOptions", "os.path.join", "facenet.to_rgb", "numpy.power", "os.path.exists", "detect_face.create_mt...
[((723, 766), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../lib/facenet/src"""'], {}), "(0, '../../lib/facenet/src')\n", (738, 766), False, 'import sys\n'), ((862, 897), 'os.path.expanduser', 'os.path.expanduser', (['args.output_dir'], {}), '(args.output_dir)\n', (880, 897), False, 'import os\n'), ((1187, 12...
import numpy as np import xml.dom.minidom from shapely.ops import cascaded_union from shapely.geometry import Polygon from itertools import combinations class EnvOpenx(): """根据OpenScenario文件进行测试,目前仅根据轨迹数据进行回放测试 """ def __init__(self): self.car_length = 4.924 self.car_width = 1.872 ...
[ "shapely.geometry.Polygon", "numpy.clip", "itertools.combinations", "numpy.sin", "numpy.tan", "numpy.cos", "numpy.arctan", "numpy.sqrt" ]
[((3125, 3174), 'numpy.clip', 'np.clip', (['self.vehicle_array[:, 0, 2]', '(0)', '(100000.0)'], {}), '(self.vehicle_array[:, 0, 2], 0, 100000.0)\n', (3132, 3174), True, 'import numpy as np\n'), ((5114, 5146), 'numpy.arctan', 'np.arctan', (['(ego[:, 5] / ego[:, 4])'], {}), '(ego[:, 5] / ego[:, 4])\n', (5123, 5146), True...
import numpy as np import sys import os import string import struct def converter_np2r(d, name, data_save): save_name='data'+name + ".bin" # create a binary file binfile = file(os.path.join(data_save,save_name), 'wb') ...
[ "numpy.load", "os.path.join", "struct.pack", "os.path.basename" ]
[((424, 465), 'struct.pack', 'struct.pack', (['"""2I"""', 'd.shape[0]', 'd.shape[1]'], {}), "('2I', d.shape[0], d.shape[1])\n", (435, 465), False, 'import struct\n'), ((825, 843), 'numpy.load', 'np.load', (['data_path'], {}), '(data_path)\n', (832, 843), True, 'import numpy as np\n'), ((261, 295), 'os.path.join', 'os.p...
from argparse import ArgumentParser from numpy import arange, array, atleast_2d, diag, hstack, ones, where from os import mkdir from os.path import isdir,isfile from pickle import load, dump from pandas import read_csv from scipy.integrate import solve_ivp from time import time from multiprocessing import Pool from mod...
[ "os.mkdir", "pickle.dump", "argparse.ArgumentParser", "pandas.read_csv", "os.path.isfile", "pickle.load", "numpy.arange", "examples.temp_bubbles.common.build_mixed_compositions_pairwise", "model.preprocessing.make_initial_condition_by_eigenvector", "model.preprocessing.HouseholdPopulation", "sci...
[((971, 1000), 'os.path.isdir', 'isdir', (['"""outputs/temp_bubbles"""'], {}), "('outputs/temp_bubbles')\n", (976, 1000), False, 'from os.path import isdir, isfile\n'), ((1015, 1044), 'os.mkdir', 'mkdir', (['"""outputs/temp_bubbles"""'], {}), "('outputs/temp_bubbles')\n", (1020, 1044), False, 'from os import mkdir\n'),...
# -*- coding: utf-8 -*- """ Read MODIS and VIIRS NPP SST data during the SPURS-1 deployment cruise. Created on Mon Jul 13 23:21:16 2020 Initially followed Intro_06_Xarray-basics.py tutorial obtained from <NAME> @author: jtomf """ # import sys # sys.path.append('C:/Users/jtomf/Documents/Python/Tom_tools/') import nu...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "pandas.read_csv", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "xarray.open_dataset", "matplotlib.pyplot.axis", "matplotlib.pyplot.colorbar", "Tom_tools_v1.matlab2datetime", "matplotlib.pyplot.figure", "numpy.where", "Tom_tools_v1...
[((530, 546), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (539, 546), True, 'import matplotlib.pyplot as plt\n'), ((1382, 1402), 'xarray.open_dataset', 'xr.open_dataset', (['url'], {}), '(url)\n', (1397, 1402), True, 'import xarray as xr\n'), ((1810, 1836), 'matplotlib.pyplot.figure', 'plt...
import json import numpy as np from matplotlib import pyplot as plt from matplotlib.markers import MarkerStyle from sklearn.decomposition import PCA from sklearn.manifold import TSNE def plot_embeddings(reduced_data, phoneme_list, title): consonants = ['w', 'b', 'ɡ', 'n', 'ʒ', 'ʃ', 'd', 'l', 'θ', 'ŋ', 'f', 'ɾ', ...
[ "matplotlib.pyplot.title", "json.load", "matplotlib.pyplot.show", "sklearn.manifold.TSNE", "matplotlib.pyplot.clf", "matplotlib.pyplot.axis", "matplotlib.pyplot.text", "numpy.array", "sklearn.decomposition.PCA", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.tight_layout", "matplotlib...
[((527, 536), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (534, 536), True, 'from matplotlib import pyplot as plt\n'), ((643, 661), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (659, 661), True, 'from matplotlib import pyplot as plt\n'), ((666, 681), 'matplotlib.pyplot.axis', 'plt.a...
"""Script to create PCA plot to compare similarity of binned CpG methylation.""" import matplotlib.pyplot as plt import pandas as pd import numpy as np from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from scipy.special import logit from functools import reduce KIT = { 'FtubeA...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "pandas.DataFrame", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "pandas.read_csv", "matplotlib.pyplot.close", "pandas.merge", "matplotlib.pyplot.subplots", "scipy.special.logit", "sklearn.decom...
[((2844, 2852), 'scipy.special.logit', 'logit', (['s'], {}), '(s)\n', (2849, 2852), False, 'from scipy.special import logit\n'), ((2865, 2879), 'pandas.Series', 'pd.Series', (['out'], {}), '(out)\n', (2874, 2879), True, 'import pandas as pd\n'), ((3454, 3482), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsiz...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Author: <NAME> # Copyright © 2020 <NAME> # License: MIT # ----------------------------------------------------------------------------- """ Profile experiment ====================== The code is completely determin...
[ "pandas.DataFrame", "numpy.random.seed", "os.makedirs", "pandas.read_csv", "os.path.exists", "logging.info", "sklearn.neighbors.KNeighborsClassifier", "numpy.arange", "os.path.join" ]
[((804, 821), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (818, 821), True, 'import numpy as np\n'), ((2663, 2725), 'os.path.join', 'os.path.join', (['data_dir', 'genre', 'subset', 'f"""{split}-features.csv"""'], {}), "(data_dir, genre, subset, f'{split}-features.csv')\n", (2675, 2725), False, 'impor...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------ # Filename: nlloc.py # Purpose: plugin for reading and writing GridData object into various format # Author: uquake development team # Email: <EMAIL> # # Copyright (C) 2016 uquake development team # ---------------------...
[ "pickle.dump", "uuid.uuid4", "vtk.vtkXMLImageDataWriter", "numpy.fromfile", "pathlib.Path", "numpy.product", "vtk.vtkImageData" ]
[((4231, 4249), 'vtk.vtkImageData', 'vtk.vtkImageData', ([], {}), '()\n', (4247, 4249), False, 'import vtk\n'), ((4977, 5004), 'vtk.vtkXMLImageDataWriter', 'vtk.vtkXMLImageDataWriter', ([], {}), '()\n', (5002, 5004), False, 'import vtk\n'), ((5493, 5516), 'pathlib.Path', 'Path', (['f"""{filename}.hdr"""'], {}), "(f'{fi...
# Example from http://pandas.pydata.org/pandas-docs/stable/visualization.html#visualization import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from numpy.random import randn from pandas import Series, date_range, DataFrame ts = Series(randn(1000), index=date_range('1/1/2000', periods=1000)) ts =...
[ "matplotlib.use", "pandas.date_range", "matplotlib.pyplot.savefig", "numpy.random.randn" ]
[((111, 132), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (125, 132), False, 'import matplotlib\n'), ((343, 366), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""test.png"""'], {}), "('test.png')\n", (354, 366), True, 'import matplotlib.pyplot as plt\n'), ((464, 487), 'matplotlib.pyplot.save...
"""This module contains PlainFrame and PlainColumn tests. """ import collections import datetime import pytest import numpy as np import pandas as pd from numpy.testing import assert_equal as np_assert_equal from pywrangler.util.testing.plainframe import ( NULL, ConverterFromPandas, NaN, PlainColumn...
[ "pandas.api.types.is_float_dtype", "pywrangler.util.testing.plainframe.ConverterFromPandas", "pandas.api.types.LongType", "pandas.api.types.is_object_dtype", "pandas.api.types.is_datetime64_dtype", "pandas.api.types.is_bool_dtype", "pywrangler.util.testing.plainframe.PlainFrame.from_pandas", "pandas.D...
[((573, 632), 'pywrangler.util.testing.plainframe.PlainFrame.from_plain', 'PlainFrame.from_plain', ([], {'data': 'data', 'dtypes': 'cols', 'columns': 'cols'}), '(data=data, dtypes=cols, columns=cols)\n', (594, 632), False, 'from pywrangler.util.testing.plainframe import NULL, ConverterFromPandas, NaN, PlainColumn, Plai...
import numpy as np import pickle as pk import matplotlib.pyplot as pl size = [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] aveheight = [] # Obtain average height f_file = open('T2e_aveheight.pickle', 'rb') aveheight = pk.load(f_file) f_file.close() # Linear fit - find a crude estimate for a_0 para, var =...
[ "matplotlib.pyplot.loglog", "pickle.dump", "numpy.log", "matplotlib.pyplot.plot", "numpy.polyfit", "numpy.logspace", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "pickle.load", "numpy.array", "numpy.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.p...
[((228, 243), 'pickle.load', 'pk.load', (['f_file'], {}), '(f_file)\n', (235, 243), True, 'import pickle as pk\n'), ((321, 361), 'numpy.polyfit', 'np.polyfit', (['size', 'aveheight', '(1)'], {'cov': '(True)'}), '(size, aveheight, 1, cov=True)\n', (331, 361), True, 'import numpy as np\n'), ((372, 398), 'numpy.linspace',...
''' atlas.py: part of pybraincompare package Functions to integrate atlases in image comparison ''' from __future__ import print_function from __future__ import absolute_import from __future__ import division from builtins import str from builtins import range from past.utils import old_div from builtins import objec...
[ "past.utils.old_div", "numpy.shape", "numpy.rot90", "scipy.spatial.distance.pdist", "cairo.SVGSurface", "nilearn.plotting.plot_roi", "numpy.unique", "skimage.segmentation.find_boundaries", "numpy.equal", "builtins.str", "re.compile", "nibabel.load", "cairo.Context", "xml.dom.minidom.parse"...
[((1293, 1317), 'nibabel.load', 'nibabel.load', (['atlas_file'], {}), '(atlas_file)\n', (1305, 1317), False, 'import nibabel\n'), ((1653, 1677), 'xml.dom.minidom.parse', 'minidom.parse', (['atlas_xml'], {}), '(atlas_xml)\n', (1666, 1677), False, 'from xml.dom import minidom\n'), ((2841, 2858), 'pybraincompare.template....
# -*- coding: utf-8 -*- __author__ = "<NAME>" __email__ = "<EMAIL>" __version__ = "1.0.0" import os import sys import yaml ROS_CV = '/opt/ros/kinetic/lib/python2.7/dist-packages' if ROS_CV in sys.path: sys.path.remove(ROS_CV) import cv2 import numpy as np import matplotlib.pyplot as plt from transformations import ...
[ "yaml.load", "sys.path.remove", "cv2.getPerspectiveTransform", "cv2.warpAffine", "numpy.mean", "cv2.imshow", "cv2.getRotationMatrix2D", "cv2.warpPerspective", "matplotlib.pyplot.imshow", "transformations.euler_matrix", "cv2.setMouseCallback", "cv2.destroyAllWindows", "cv2.resize", "numpy.r...
[((205, 228), 'sys.path.remove', 'sys.path.remove', (['ROS_CV'], {}), '(ROS_CV)\n', (220, 228), False, 'import sys\n'), ((6351, 6376), 'cv2.namedWindow', 'cv2.namedWindow', (['win_name'], {}), '(win_name)\n', (6366, 6376), False, 'import cv2\n'), ((6381, 6424), 'cv2.setMouseCallback', 'cv2.setMouseCallback', (['win_nam...
import numpy as np from time import sleep import serial ########## Prepare Arduino code for data output ################## # # remove the /* and */ around the print commands in functions.ino # # /* # Serial.print(dt); Serial.print("\t"); # Serial.print(pitch); Serial.print("\t"); # Serial.print(gyroYrate); Seri...
[ "serial.Serial", "numpy.savetxt", "numpy.array", "time.sleep" ]
[((683, 691), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (688, 691), False, 'from time import sleep\n'), ((994, 1034), 'numpy.savetxt', 'np.savetxt', (['"""T-Bot_FilteredData.dat"""', 'v1'], {}), "('T-Bot_FilteredData.dat', v1)\n", (1004, 1034), True, 'import numpy as np\n'), ((586, 622), 'serial.Serial', 'serial.S...
from torch.utils.data import Dataset import tqdm import json import torch import random import numpy as np from sklearn.utils import shuffle class BERTDataset(Dataset): def __init__(self, corpus_path, word2idx_path, seq_len, hidden_dim=384, on_memory=True): # hidden dimension for positional encoding ...
[ "tqdm.tqdm", "json.load", "random.random", "numpy.random.randint", "torch.tensor" ]
[((942, 954), 'json.load', 'json.load', (['f'], {}), '(f)\n', (951, 954), False, 'import json\n'), ((2559, 2583), 'torch.tensor', 'torch.tensor', (['bert_input'], {}), '(bert_input)\n', (2571, 2583), False, 'import torch\n'), ((2617, 2641), 'torch.tensor', 'torch.tensor', (['bert_label'], {}), '(bert_label)\n', (2629, ...
# !/usr/bin/env python # _*_ coding:utf-8 _*_ import jieba from HyperParameter import HyperParameter import numpy as np import random zero_pad = np.zeros(768,float) padToken, unknownToken, goToken, eosToken = 0, 1, 2, 3 class Batch: def __init__(self): self.encoder_inputs = [] self.encoder_input...
[ "HyperParameter.HyperParameter", "numpy.zeros" ]
[((147, 167), 'numpy.zeros', 'np.zeros', (['(768)', 'float'], {}), '(768, float)\n', (155, 167), True, 'import numpy as np\n'), ((847, 863), 'HyperParameter.HyperParameter', 'HyperParameter', ([], {}), '()\n', (861, 863), False, 'from HyperParameter import HyperParameter\n')]
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Argo, test #12. (10C, 5PSU) """ import logging import numpy as np from numpy import ma from .qctests import QCCheckVar from .rate_of_change import rate_of_change module_logger = logging.getLogger(__name__) class Dig...
[ "numpy.ma.absolute", "numpy.size", "numpy.ma.getmaskarray", "numpy.isfinite", "numpy.shape", "numpy.atleast_1d", "logging.getLogger" ]
[((281, 308), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (298, 308), False, 'import logging\n'), ((908, 952), 'numpy.ma.absolute', 'ma.absolute', (["self.features['rate_of_change']"], {}), "(self.features['rate_of_change'])\n", (919, 952), False, 'from numpy import ma\n'), ((1139, 117...
#!/usr/bin/enum_weights python # -*- coding: utf-8 -*- # Copyright (C) 2019 <NAME>, <NAME>, <NAME> # # All Rights Reserved. # # Authors: <NAME>, <NAME>, <NAME> # # Please cite: # # <NAME>, <NAME>, and <NAME>, "Quasi-Newton Methods for # Deep Learning: Forget the Past, Just Sample." (2019). Lehigh University. #...
[ "numpy.random.seed", "numpy.sum", "numpy.zeros", "time.time", "numpy.linalg.inv", "numpy.matmul", "numpy.squeeze", "numpy.diag", "collections.deque" ]
[((963, 983), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (977, 983), True, 'import numpy as np\n'), ((1363, 1374), 'time.time', 'time.time', ([], {}), '()\n', (1372, 1374), False, 'import time\n'), ((1597, 1626), 'collections.deque', 'collections.deque', ([], {'maxlen': 'mmr'}), '(maxlen=mmr)\n'...
# coding=utf-8 ''' Calculates PSF, jitter and telescope background and transmission ''' import sys import logging import multiprocessing as mp import signal import time import numpy as np import scipy.constants as sp from scipy.signal import fftconvolve from src.config import * from src.modules.create_psf import cr...
[ "numpy.zeros_like", "numpy.sum", "numpy.zeros", "time.sleep", "src.modules.create_psf.create_psf", "logging.info", "sys.stdout.flush", "multiprocessing.Pool", "scipy.signal.fftconvolve", "signal.signal", "src.modules.create_psf.define_psf" ]
[((451, 469), 'numpy.zeros', 'np.zeros', (['(px, py)'], {}), '((px, py))\n', (459, 469), True, 'import numpy as np\n'), ((503, 519), 'src.modules.create_psf.create_psf', 'create_psf', (['lamb'], {}), '(lamb)\n', (513, 519), False, 'from src.modules.create_psf import create_psf, define_psf\n'), ((1174, 1192), 'sys.stdou...
# -*- coding: utf-8 -*- # /usr/bin/python2 ''' By <NAME>. <EMAIL>. https://www.github.com/kyubyong/neurobind. ''' from __future__ import print_function import os import sys from scipy.stats import spearmanr from data_load import get_batch_data, load_vocab, load_data from hyperparams import Hyperparams as hp import ...
[ "os.mkdir", "train.Graph", "scipy.stats.spearmanr", "os.path.exists", "data_load.load_data", "data_load.load_vocab", "tensorflow.train.Supervisor", "matplotlib.pyplot.figure", "tensorflow.train.latest_checkpoint", "numpy.array", "tensorflow.ConfigProto", "os.path.join" ]
[((451, 475), 'train.Graph', 'Graph', ([], {'is_training': '(False)'}), '(is_training=False)\n', (456, 475), False, 'from train import Graph\n'), ((527, 549), 'data_load.load_data', 'load_data', ([], {'mode': '"""test"""'}), "(mode='test')\n", (536, 549), False, 'from data_load import get_batch_data, load_vocab, load_d...
from bricks_modeling.file_IO.model_writer import write_bricks_to_file_with_steps from util.debugger import MyDebugger import os import csv import solvers.brick_heads.bach_render_images as render import solvers.brick_heads.part_selection as p_select from bricks_modeling.file_IO.model_reader import read_bricks_from_file ...
[ "util.debugger.MyDebugger", "os.path.exists", "bricks_modeling.file_IO.model_reader.read_bricks_from_file", "numpy.array", "os.path.join" ]
[((404, 426), 'numpy.array', 'np.array', (['[150, 0, 70]'], {}), '([150, 0, 70])\n', (412, 426), True, 'import numpy as np\n'), ((449, 472), 'numpy.array', 'np.array', (['[-150, 0, 70]'], {}), '([-150, 0, 70])\n', (457, 472), True, 'import numpy as np\n'), ((2298, 2323), 'util.debugger.MyDebugger', 'MyDebugger', (['"""...
# Only about 74% accuratee import tensorflow as tf import nltk import io from nltk.tokenize import word_tokenize from nltk.stem import WordNetLemmatizer # useful for finding roots of words import numpy as np import pickle n_nodes_hl1 = 400 #these can be different and whatever you like n_nodes_hl2 = 400 ...
[ "tensorflow.nn.relu", "tensorflow.train.Saver", "nltk.stem.WordNetLemmatizer", "tensorflow.global_variables_initializer", "tensorflow.argmax", "tensorflow.Session", "tensorflow.constant", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "tensorflow.placeholder", "tensorflow.matmul", "tensor...
[((335, 354), 'nltk.stem.WordNetLemmatizer', 'WordNetLemmatizer', ([], {}), '()\n', (352, 354), False, 'from nltk.stem import WordNetLemmatizer\n'), ((451, 474), 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""'], {}), "('float')\n", (465, 474), True, 'import tensorflow as tf\n'), ((530, 553), 'tensorflow.pla...
import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse import matplotlib.transforms as transforms from matplotlib import rcParams from matplotlib.colors import LinearSegmentedColormap from p3iv_utils_probability.distributions import ( BivariateNormalDistribution, UnivariateNor...
[ "matplotlib.colors.LinearSegmentedColormap.from_list", "numpy.rad2deg", "numpy.max", "numpy.min", "numpy.linspace", "numpy.random.choice", "matplotlib.patches.Ellipse", "numpy.round", "matplotlib.transforms.Affine2D" ]
[((1169, 1198), 'numpy.random.choice', 'np.random.choice', (['self.colors'], {}), '(self.colors)\n', (1185, 1198), True, 'import numpy as np\n'), ((2366, 2444), 'matplotlib.colors.LinearSegmentedColormap.from_list', 'LinearSegmentedColormap.from_list', (["('alpha_gradient_color_map_' + color)", 'colors'], {}), "('alpha...
# todo: Implement Neural Network (or Logistic Regression) From Scratch</h2> # todo: importing libraries import numpy as np from tensorflow import keras import pandas as pd from matplotlib import pyplot as plt # todo: load dataSet df = pd.read_csv("insurance_data.csv") df.head() # todo: Split train and test set from ...
[ "math.exp", "numpy.log", "tensorflow.keras.layers.Dense", "pandas.read_csv", "sklearn.model_selection.train_test_split", "numpy.transpose", "numpy.mean", "numpy.array", "numpy.exp" ]
[((237, 270), 'pandas.read_csv', 'pd.read_csv', (['"""insurance_data.csv"""'], {}), "('insurance_data.csv')\n", (248, 270), True, 'import pandas as pd\n'), ((404, 507), 'sklearn.model_selection.train_test_split', 'train_test_split', (["df[['age', 'affordibility']]", 'df.bought_insurance'], {'test_size': '(0.2)', 'rando...
######################################### # # # <NAME> and <NAME> # # University of Fribourg # # 2019 # # Master's thesis # # # #######################################...
[ "PIL.Image.fromarray", "numpy.min", "numpy.max", "nibabel.load" ]
[((1908, 1927), 'nibabel.load', 'nib.load', (['niftiPath'], {}), '(niftiPath)\n', (1916, 1927), True, 'import nibabel as nib\n'), ((2145, 2165), 'numpy.min', 'np.min', (['niftiNpArray'], {}), '(niftiNpArray)\n', (2151, 2165), True, 'import numpy as np\n'), ((2187, 2207), 'numpy.max', 'np.max', (['niftiNpArray'], {}), '...
# -*- coding: utf-8 -*- """ Created on 15 Jul 2019 19:58:50 @author: jiahuei """ from link_dirs import BASE_DIR, CURR_DIR, pjoin import argparse import os import json import re import numpy as np from time import localtime, strftime from tqdm import tqdm from bisect import bisect_left from common.natural_sort import n...
[ "numpy.stack", "json.load", "bisect.bisect_left", "argparse.ArgumentParser", "numpy.argmax", "os.path.isdir", "os.path.dirname", "numpy.genfromtxt", "numpy.amax", "os.path.isfile", "numpy.mean", "numpy.array", "time.localtime", "os.path.split", "link_dirs.pjoin", "os.listdir", "numpy...
[((395, 421), 're.compile', 're.compile', (['"""[0-9][0-9,]+"""'], {}), "('[0-9][0-9,]+')\n", (405, 421), False, 'import re\n'), ((511, 588), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(formatter_class=argparse.RawDescriptionHelpFormatter)\n...
import numpy as np import torch from torch import nn import torchvision from core import build_graph, cat, to_numpy torch.backends.cudnn.benchmark = True device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") @cat.register(torch.Tensor) def _(*xs): return torch.cat(xs) @to_numpy.register(torch.T...
[ "torch.cuda.synchronize", "torch.utils.data.DataLoader", "torchvision.datasets.CIFAR100", "torch.cat", "core.to_numpy.register", "core.build_graph", "torchvision.datasets.CIFAR10", "torch.nn.BatchNorm2d", "numpy.random.randint", "torch.cuda.is_available", "core.cat.register", "numpy.random.ran...
[((230, 256), 'core.cat.register', 'cat.register', (['torch.Tensor'], {}), '(torch.Tensor)\n', (242, 256), False, 'from core import build_graph, cat, to_numpy\n'), ((295, 326), 'core.to_numpy.register', 'to_numpy.register', (['torch.Tensor'], {}), '(torch.Tensor)\n', (312, 326), False, 'from core import build_graph, ca...
"""Functions to find optimal production strategies.""" # Load packages # Standard library from itertools import product, chain, groupby from collections import namedtuple, defaultdict # External libraries import numpy as np from scipy.optimize import linprog # Local libraries from recipes import Item, Technology fr...
[ "numpy.zeros", "collections.defaultdict", "numpy.isclose", "scipy.optimize.linprog", "collections.namedtuple", "itertools.product", "itertools.chain", "common.update", "recipes.Item" ]
[((378, 419), 'collections.namedtuple', 'namedtuple', (['"""item"""', "['id', *Item._fields]"], {}), "('item', ['id', *Item._fields])\n", (388, 419), False, 'from collections import namedtuple, defaultdict\n'), ((434, 491), 'collections.namedtuple', 'namedtuple', (['"""technology"""', "[*Technology._fields, 'cycles']"]...
from numpy.testing import assert_almost_equal from ctapipe.io.hessio import hessio_event_source from ctapipe.utils import get_dataset from ctapipe.calib.camera.r1 import CameraR1CalibratorFactory, \ HessioR1Calibrator def get_test_event(): filename = get_dataset('gamma_test.simtel.gz') source = hessio_eve...
[ "ctapipe.calib.camera.r1.HessioR1Calibrator", "numpy.testing.assert_almost_equal", "ctapipe.io.hessio.hessio_event_source", "ctapipe.utils.get_dataset", "ctapipe.calib.camera.r1.CameraR1CalibratorFactory" ]
[((261, 296), 'ctapipe.utils.get_dataset', 'get_dataset', (['"""gamma_test.simtel.gz"""'], {}), "('gamma_test.simtel.gz')\n", (272, 296), False, 'from ctapipe.utils import get_dataset\n'), ((310, 379), 'ctapipe.io.hessio.hessio_event_source', 'hessio_event_source', (['filename'], {'requested_event': '(409)', 'use_event...
import numpy as np from itertools import product from . import tensor class Module(object): """Base class for all neural network modules. """ def __init__(self) -> None: """If a module behaves different between training and testing, its init method should inherit from this one.""" ...
[ "numpy.pad", "numpy.sum", "numpy.average", "numpy.square", "numpy.zeros", "numpy.transpose", "numpy.max", "pdb.set_trace", "numpy.random.rand", "numpy.dot", "numpy.repeat" ]
[((17418, 17433), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (17431, 17433), False, 'import pdb\n'), ((2285, 2302), 'numpy.dot', 'np.dot', (['x', 'self.w'], {}), '(x, self.w)\n', (2291, 2302), True, 'import numpy as np\n'), ((3661, 3679), 'numpy.dot', 'np.dot', (['ave_ope', 'x'], {}), '(ave_ope, x)\n', (3667, ...
""" Non-Deterministic Gradient-Boosting ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ We optimize a GradientBoosting on an artificially created binary classification dataset. The results are not deterministic so we need to evaluate each configuration multiple times. To ensure fair comparison, SMAC will only sample from a fixed ...
[ "sklearn.datasets.make_hastie_10_2", "logging.basicConfig", "sklearn.model_selection.cross_val_score", "ConfigSpace.hyperparameters.UniformIntegerHyperparameter", "sklearn.model_selection.KFold", "numpy.random.RandomState", "sklearn.ensemble.GradientBoostingClassifier", "smac.configspace.Configuration...
[((611, 650), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (630, 650), False, 'import logging\n'), ((1279, 1311), 'sklearn.datasets.make_hastie_10_2', 'make_hastie_10_2', ([], {'random_state': '(0)'}), '(random_state=0)\n', (1295, 1311), False, 'from sklearn.d...
import os import os.path as osp import numpy as np from config import cfg import copy import json import scipy.io as sio import cv2 import random import math import torch import transforms3d from pycocotools.coco import COCO from utils.smpl import SMPL from utils.preprocessing import load_img, process_bbox, augmentatio...
[ "numpy.sum", "utils.transforms.cam2pixel", "numpy.tile", "os.path.join", "utils.transforms.transform_joint_to_other_db", "utils.vis.save_obj", "cv2.imwrite", "utils.preprocessing.process_bbox", "torch.FloatTensor", "utils.smpl.SMPL", "copy.deepcopy", "numpy.ones_like", "utils.preprocessing.l...
[((685, 727), 'os.path.join', 'osp.join', (['""".."""', '"""data"""', '"""MSCOCO"""', '"""images"""'], {}), "('..', 'data', 'MSCOCO', 'images')\n", (693, 727), True, 'import os.path as osp\n'), ((754, 801), 'os.path.join', 'osp.join', (['""".."""', '"""data"""', '"""MSCOCO"""', '"""annotations"""'], {}), "('..', 'data'...
import argparse import os import time import numpy as np import torch import torch.optim as optim import torch.nn as nn from torch.utils.data import DataLoader from data_loader import CSV_PNG_Dataset, CSV_PNG_Dataset_2D, PNG_PNG_Dataset from netArchitecture.VGG import VGGModel, VGGModel_2D from netArchitecture.ResNe...
[ "argparse.ArgumentParser", "netArchitecture.VGG.VGGModel", "numpy.mean", "torch.autograd.set_detect_anomaly", "torch.cuda.current_device", "os.path.join", "data_loader.CSV_PNG_Dataset", "visualize.Visualizations", "torch.nn.MSELoss", "torch.nn.BCELoss", "torch.utils.data.DataLoader", "netArchi...
[((404, 436), 'logging.getLogger', 'logging.getLogger', (['"""In train.py"""'], {}), "('In train.py')\n", (421, 436), False, 'import logging\n'), ((519, 591), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""train deep color extraction model"""'}), "(description='train deep color extractio...
import getpass if getpass.getuser()=='RGCGroup': import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # os.environ["CUDA_VISIBLE_DEVICES"] = "-1" #Run with CPU only import pandas as pd import numpy as np from keras.layers import Dense,BatchNormalization,Dropout from keras.models import Sequential f...
[ "tensorflow.random.set_seed", "matplotlib.pyplot.title", "numpy.random.seed", "getpass.getuser", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.metrics.mean_absolute_error", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.close", "os.path.exists", "helpe...
[((945, 967), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {}), "('font', **font)\n", (951, 967), True, 'import matplotlib.pyplot as plt\n'), ((1019, 1033), 'random.seed', 'random.seed', (['(1)'], {}), '(1)\n', (1030, 1033), False, 'import random\n'), ((1058, 1079), 'tensorflow.random.set_seed', 'tf.random.set_se...
import numpy as np from PIL import Image import numbers from collections.abc import Sequence from typing import Tuple, List, Optional import random import torch from torchvision import transforms as T from torchvision.transforms import functional as F def _check_sequence_input(x, name, req_sizes): msg = req_size...
[ "torchvision.transforms.functional.to_tensor", "torch.empty", "torchvision.transforms.functional.adjust_saturation", "torch.clone", "torchvision.transforms.functional.center_crop", "random.randint", "torchvision.transforms.functional.hflip", "torchvision.transforms.ToPILImage", "torchvision.transfor...
[((1155, 1196), 'torchvision.transforms.functional.pad', 'F.pad', (['img', '(0, 0, padw, padh)'], {'fill': 'fill'}), '(img, (0, 0, padw, padh), fill=fill)\n', (1160, 1196), True, 'from torchvision.transforms import functional as F\n'), ((1719, 1763), 'random.randint', 'random.randint', (['self.min_size', 'self.max_size...
from process_lap_data import ProcessData,Evaluate from lstm_crf import BiLSTM_CRF import torch from config import * import torch.nn as nn import numpy as np torch.manual_seed(seed) # 为CPU设置随机种子 torch.cuda.manual_seed(seed) # 为当前GPU设置随机种子 torch.cuda.manual_seed_all(seed) # 为所有GPU设置随机种子 np.random.seed(...
[ "numpy.random.seed", "torch.manual_seed", "process_lap_data.ProcessData", "torch.cuda.manual_seed", "lstm_crf.BiLSTM_CRF", "torch.nn.NLLLoss", "process_lap_data.Evaluate", "torch.cuda.manual_seed_all", "numpy.array", "numpy.reshape", "torch.from_numpy" ]
[((157, 180), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (174, 180), False, 'import torch\n'), ((205, 233), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['seed'], {}), '(seed)\n', (227, 233), False, 'import torch\n'), ((255, 287), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_...
""" Script to synthesize observational data from ground truth factors. """ import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import numpy as np import os from disentanglement_lib.data.ground_truth import dsprites, norb, cars3d, shapes3d from absl import app from absl import flags FLAGS =...
[ "disentanglement_lib.data.ground_truth.norb.SmallNORB", "numpy.load", "numpy.zeros_like", "warnings.simplefilter", "os.path.join", "disentanglement_lib.data.ground_truth.cars3d.Cars3D", "disentanglement_lib.data.ground_truth.dsprites.DSprites", "numpy.transpose", "numpy.zeros", "numpy.random.Rando...
[((91, 153), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (112, 153), False, 'import warnings\n'), ((334, 447), 'absl.flags.DEFINE_enum', 'flags.DEFINE_enum', (['"""data_type"""', '"""dsprites"""', "['dspr...
import os import ubelt as ub import numpy as np import netharn as nh import torch import torchvision import itertools as it import utool as ut import glob from collections import OrderedDict import parse def _auto_argparse(func): """ Transform a function with a Google Style Docstring into an `argparse.Argum...
[ "ubelt.ProgIter", "argparse.ArgumentParser", "glob.glob", "pandas.set_option", "torch.load", "torch.Tensor", "numpy.linspace", "ubelt.ensuredir", "pandas.concat", "parse.log.setLevel", "ubelt.argval", "xdoctest.docscrape_google.split_google_docblocks", "netharn.examples.siam_ibeis.setup_harn...
[((545, 569), 'inspect.getargspec', 'inspect.getargspec', (['func'], {}), '(func)\n', (563, 569), False, 'import inspect\n'), ((1006, 1115), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(description=description,...
import numpy as np from opt_einsum import contract from ..symbol import Symbols from ..base import simplify a, b, c = Symbols("abc") def test_einsum(): contract("i->", np.array([a, b]), backend="qop") simplify( contract( "ijk,i->jk", c * np.ones([3, 3, 3]), np.array([a, b, c]), backend="q...
[ "numpy.array", "numpy.ones" ]
[((175, 191), 'numpy.array', 'np.array', (['[a, b]'], {}), '([a, b])\n', (183, 191), True, 'import numpy as np\n'), ((289, 308), 'numpy.array', 'np.array', (['[a, b, c]'], {}), '([a, b, c])\n', (297, 308), True, 'import numpy as np\n'), ((269, 287), 'numpy.ones', 'np.ones', (['[3, 3, 3]'], {}), '([3, 3, 3])\n', (276, 2...
""" 该DCGAN结构更加符合论文 """ import math import matplotlib.pyplot as plt import numpy as np from data_loader import DataLoader from keras.layers import Dense, Reshape, Conv2D, UpSampling2D, BatchNormalization, ReLU, Activation, Input, LeakyReLU, \ Flatten, Dropout from keras.models import Sequential, Model from keras.o...
[ "numpy.ones", "keras.models.Model", "tensorflow.ConfigProto", "numpy.random.normal", "keras.layers.Input", "keras.layers.Reshape", "matplotlib.pyplot.close", "keras.layers.Flatten", "data_loader.DataLoader", "numpy.add", "matplotlib.pyplot.subplots", "keras.layers.LeakyReLU", "math.ceil", ...
[((460, 476), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (474, 476), True, 'import tensorflow as tf\n'), ((528, 553), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (538, 553), True, 'import tensorflow as tf\n'), ((782, 796), 'keras.backend.mean', 'K.mean', (['y_...
#imports from extra import common import time import csv,cv2, os import numpy as np import matplotlib.pyplot as plt from scipy.ndimage import gaussian_filter1d from sklearn.neighbors import NearestNeighbors import pandas as pd os_path = str(os.path) if 'posix' in os_path: import posixpath as path elif 'nt' in os_pa...
[ "scipy.ndimage.gaussian_filter1d", "matplotlib.pyplot.figure", "extra.common.save_image", "numpy.unique", "pandas.DataFrame", "cv2.cvtColor", "time.clock", "sklearn.neighbors.NearestNeighbors", "numpy.int32", "cv2.resize", "ntpath.join", "csv.writer", "extra.common.displayCoordinates", "nu...
[((655, 667), 'time.clock', 'time.clock', ([], {}), '()\n', (665, 667), False, 'import time\n'), ((1020, 1074), 'extra.common.call_preprocessing', 'common.call_preprocessing', (['firstImage', 'smoothingmethod'], {}), '(firstImage, smoothingmethod)\n', (1045, 1074), False, 'from extra import common\n'), ((2131, 2155), '...
from .IO import read as _read from .QC import qc as _qc from .normalization import normalize as _normalize from .imputation import impute as _impute from .reshaping import reshape as _reshape from .modeling import buildmodel as _buildmodel from .interpretation import explain as _explain import pandas as pd import numpy...
[ "pandas.DataFrame", "captum.attr.visualization.visualize_image_attr", "numpy.random.choice", "pandas.concat", "sys.exit" ]
[((794, 847), 'numpy.random.choice', 'np.random.choice', (['n_all'], {'size': 'n_select', 'replace': '(False)'}), '(n_all, size=n_select, replace=False)\n', (810, 847), True, 'import numpy as np\n'), ((539, 550), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (547, 550), False, 'import sys\n'), ((6035, 6110), 'pandas....
import librosa import pathlib import numpy as np from sklearn.model_selection import train_test_split def get_log_mel_spectrogram(path, n_fft, hop_length, n_mels): """ Extract log mel spectrogram 1) The length of the raw audio used is 8s long, 2) and then get the MelSpectrogram, 2) fin...
[ "numpy.full", "numpy.size", "sklearn.model_selection.train_test_split", "numpy.zeros", "numpy.append", "pathlib.Path", "librosa.load", "numpy.array", "librosa.amplitude_to_db", "librosa.feature.melspectrogram" ]
[((436, 476), 'librosa.load', 'librosa.load', (['path'], {'sr': '(16000)', 'duration': '(8)'}), '(path, sr=16000, duration=8)\n', (448, 476), False, 'import librosa\n'), ((496, 506), 'numpy.size', 'np.size', (['y'], {}), '(y)\n', (503, 506), True, 'import numpy as np\n'), ((630, 722), 'librosa.feature.melspectrogram', ...
""" Copyright (c) Microsoft Corporation. Licensed under the MIT license. """ import os import numpy as np import matplotlib.pyplot as plt import logging from typing import * from typing import List from ilp_common_classes import * logger = logging.getLogger('matplotlib') logger.setLevel(logging.WARNING) def visulai...
[ "os.path.join", "matplotlib.pyplot.close", "numpy.where", "numpy.array", "numpy.mean", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.subplots", "logging.getLogger", "matplotlib.pyplot.grid" ]
[((243, 274), 'logging.getLogger', 'logging.getLogger', (['"""matplotlib"""'], {}), "('matplotlib')\n", (260, 274), False, 'import logging\n'), ((546, 580), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {'figsize': '(8, 4)'}), '(1, 1, figsize=(8, 4))\n', (558, 580), True, 'import matplotlib.pyplot as p...
#!/usr/bin/env python3 # # Author: <NAME> # Copyright 2015-present, NASA-JPL/Caltech # import os import glob import datetime import numpy as np import isce, isceobj import mroipac from mroipac.ampcor.Ampcor import Ampcor from isceobj.Alos2Proc.Alos2ProcPublic import topo from isceobj.Alos2Proc.Alos2ProcPublic import...
[ "os.remove", "numpy.sum", "argparse.ArgumentParser", "mroipac.ampcor.Ampcor.Ampcor", "os.path.join", "os.path.abspath", "isceobj.Alos2Proc.Alos2ProcPublic.geo2rdr", "StackPulic.loadTrack", "isceobj.Alos2Proc.Alos2ProcPublic.topo", "isceobj.Alos2Proc.Alos2ProcPublic.cullOffsets", "StackPulic.acqu...
[((881, 985), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""estimate offset between a pair of SLCs for a number of dates"""'}), "(description=\n 'estimate offset between a pair of SLCs for a number of dates')\n", (904, 985), False, 'import argparse\n'), ((3369, 3392), 'StackPulic.acq...
import numpy as np import matplotlib.pyplot as plt from config import config import logging def plot_from_csv(file_path, output_dir, metric, savefig=True): """ Plot the metric saved in the file_path file """ logging.info("Plotting metrics...") x = np.loadtxt(file_path, delimiter=',') epochs =...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "logging.info", "matplotlib.pyplot.figure", "numpy.array", "numpy.loadtxt", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig" ]
[((227, 262), 'logging.info', 'logging.info', (['"""Plotting metrics..."""'], {}), "('Plotting metrics...')\n", (239, 262), False, 'import logging\n'), ((271, 307), 'numpy.loadtxt', 'np.loadtxt', (['file_path'], {'delimiter': '""","""'}), "(file_path, delimiter=',')\n", (281, 307), True, 'import numpy as np\n'), ((343,...
from .test_abelfunctions import AbelfunctionsTestCase import abelfunctions import numpy import unittest from abelfunctions.abelmap import AbelMap, Jacobian from numpy.linalg import norm from sage.all import I class TestDivisors(AbelfunctionsTestCase): def setUp(self): # cache some items for performance ...
[ "abelfunctions.abelmap.AbelMap", "numpy.array", "abelfunctions.abelmap.Jacobian", "numpy.linalg.norm" ]
[((347, 365), 'abelfunctions.abelmap.Jacobian', 'Jacobian', (['self.X11'], {}), '(self.X11)\n', (355, 365), False, 'from abelfunctions.abelmap import AbelMap, Jacobian\n'), ((634, 644), 'abelfunctions.abelmap.AbelMap', 'AbelMap', (['D'], {}), '(D)\n', (641, 644), False, 'from abelfunctions.abelmap import AbelMap, Jacob...
#!/usr/bin/env python3 # -*- coding = utf-8 -*- import os import sys import json import statistics import cv2 from keras.models import load_model import numpy as np from models.model_factory import load_keras_model from util.constant import fer2013_classes from util.classifyimgops import apply_offsets from util.class...
[ "numpy.argmax", "cv2.rectangle", "util.classifyimgops.preprocess_input", "cv2.imshow", "util.classifyimgops.apply_offsets", "util.info.load_info", "cv2.cvtColor", "os.path.dirname", "models.model_factory.load_keras_model", "numpy.max", "statistics.mode", "cv2.destroyAllWindows", "cv2.resize"...
[((540, 551), 'util.info.load_info', 'load_info', ([], {}), '()\n', (549, 551), False, 'from util.info import load_info\n'), ((965, 1015), 'models.model_factory.load_keras_model', 'load_keras_model', (['"""Model-27-0.6631"""'], {'compile': '(False)'}), "('Model-27-0.6631', compile=False)\n", (981, 1015), False, 'from m...
# -*- coding: utf-8 -*- """ Created on Sun Jul 21 15:02:36 2019 Bresenham画圆法实现 博客教程地址: https://blog.csdn.net/varyshare/article/details/96724103 @author: 知乎@Ai酱 """ import numpy as np import matplotlib.pyplot as plt img = np.zeros((105,105)) # 创建一个105x105的画布 count = 0 def draw(x,y): """ 绘制点(x,y) 注意:需要把(x...
[ "matplotlib.pyplot.imshow", "numpy.zeros" ]
[((222, 242), 'numpy.zeros', 'np.zeros', (['(105, 105)'], {}), '((105, 105))\n', (230, 242), True, 'import numpy as np\n'), ((1167, 1182), 'matplotlib.pyplot.imshow', 'plt.imshow', (['img'], {}), '(img)\n', (1177, 1182), True, 'import matplotlib.pyplot as plt\n')]
from copy import copy from typing import Optional, Union import numpy as np from torch import Tensor from tqdm import tqdm from graphwar.attack.injection.injection_attacker import InjectionAttacker class RandomInjection(InjectionAttacker): r"""Injection nodes into a graph randomly. Example ------- >...
[ "numpy.random.choice" ]
[((3978, 4048), 'numpy.random.choice', 'np.random.choice', (['candidate_nodes', 'self.num_edges_local'], {'replace': '(False)'}), '(candidate_nodes, self.num_edges_local, replace=False)\n', (3994, 4048), True, 'import numpy as np\n')]
from __future__ import division import warnings warnings.filterwarnings("ignore") import numpy as np # linear algebra import pandas as pd from sklearn.utils import shuffle from sklearn.model_selection import train_test_split import logging,sys import lasagne from lasagne import layers from lasagne.updates import neste...
[ "nolearn.lasagne.NeuralNet", "logging.basicConfig", "warnings.filterwarnings", "pandas.read_csv", "sklearn.model_selection.train_test_split", "logging.StreamHandler", "logging.info", "numpy.array" ]
[((48, 81), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (71, 81), False, 'import warnings\n'), ((429, 535), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'format': 'FORMAT', 'level': 'logging.INFO', 'datefmt': '"""%Y-%m-%d %H:%M:%I"""'}), "...
import logging import os from typing import ( Optional, ) import numpy as np import psycopg2 import tensorflow as tf from molecule_game.mol_preprocessor import ( MolPreprocessor, atom_featurizer, bond_featurizer, ) from rdkit.Chem.rdmolfiles import MolFromSmiles from tensorflow.python.keras.preprocessi...
[ "rdkit.Chem.rdmolfiles.MolFromSmiles", "numpy.random.choice", "rlmolecule.molecule.policy.model.build_policy_evaluator", "os.path.abspath", "logging.debug", "tensorflow.nn.softmax", "numpy.expand_dims", "numpy.isclose", "molecule_game.mol_preprocessor.MolPreprocessor", "rlmolecule.molecule.policy....
[((825, 852), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (842, 852), False, 'import logging\n'), ((877, 978), 'molecule_game.mol_preprocessor.MolPreprocessor', 'MolPreprocessor', ([], {'atom_features': 'atom_featurizer', 'bond_features': 'bond_featurizer', 'explicit_hs': '(False)'}), ...
from typing import Iterable, Union import numpy as np class DistributionTransformer: def __init__(self, num_bins: int = 300, use_density: bool = True): """ Instantiate a new distribution transformer that extracts distribution information from input values. Parameters ---------- ...
[ "numpy.empty", "numpy.histogram", "numpy.array", "numpy.isnan" ]
[((1371, 1393), 'numpy.array', 'np.array', (['input_values'], {}), '(input_values)\n', (1379, 1393), True, 'import numpy as np\n'), ((1556, 1629), 'numpy.histogram', 'np.histogram', (['input_array'], {'bins': 'self._num_bins', 'density': 'self._use_density'}), '(input_array, bins=self._num_bins, density=self._use_densi...
# ----------------------------------------------------------------------------- # MIT License # # Copyright (c) 2018 <NAME> # # 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 restricti...
[ "os.remove", "argparse.ArgumentParser", "math.atan2", "os.walk", "xml.Xml", "json.dumps", "cv2.warpAffine", "os.path.isfile", "dlib.rectangle", "dlib.shape_predictor", "os.path.join", "cv2.getRotationMatrix2D", "cv2.imshow", "cv2.line", "math.radians", "math.cos", "cv2.destroyAllWind...
[((13508, 13533), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (13531, 13533), False, 'import argparse\n'), ((15612, 15634), 'os.path.split', 'os.path.split', (['at_path'], {}), '(at_path)\n', (15625, 15634), False, 'import os\n'), ((15782, 15808), 'os.path.join', 'os.path.join', (['folder', ...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import sys import torch import time import torch.optim as optim import torch.nn.functional as F import numpy as np from haversine import haversine from models import get_model from dataProcess import preprocess_data, process_data from utils import sgc_precompute, parse_ar...
[ "numpy.argmax", "numpy.median", "torch.load", "torch.nn.functional.cross_entropy", "haversine.haversine", "dataProcess.process_data", "numpy.hstack", "torch.save", "time.time", "dataProcess.preprocess_data", "numpy.array", "numpy.mean", "utils.sgc_precompute", "utils.parse_args", "torch....
[((3813, 3838), 'numpy.argmax', 'np.argmax', (['y_pred'], {'axis': '(1)'}), '(y_pred, axis=1)\n', (3822, 3838), True, 'import numpy as np\n'), ((4932, 4957), 'numpy.argmax', 'np.argmax', (['y_pred'], {'axis': '(1)'}), '(y_pred, axis=1)\n', (4941, 4957), True, 'import numpy as np\n'), ((6099, 6120), 'dataProcess.preproc...
import numpy as np import sys sys.path.append("../") # sys.path.append("../loaders/") from derive_dataset import get_max_r2, get_max_r2_alt from loaders import pvc1 if __name__ == "__main__": """Only for pvc1. See generate_hyperflow for the method for HyperFlow.""" maxr2s = [] for single_cell in range(23...
[ "sys.path.append", "derive_dataset.get_max_r2", "derive_dataset.get_max_r2_alt", "loaders.pvc1.PVC1", "numpy.concatenate" ]
[((31, 53), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (46, 53), False, 'import sys\n'), ((340, 481), 'loaders.pvc1.PVC1', 'pvc1.PVC1', (['"""/mnt/e/data_derived/crcns-ringach-data/"""'], {'nt': '(1)', 'ntau': '(10)', 'nframedelay': '(0)', 'repeats': '(True)', 'single_cell': 'single_cell', ...
from keras.preprocessing.image import img_to_array import imutils import cv2 from keras.models import load_model import numpy as np import pyttsx3 import pyaudio import matplotlib.pyplot as plt from keras.preprocessing import image from statistics import mode def get_labels(dataset_name): if dataset_name == 'imd...
[ "keras.models.load_model", "cv2.resize", "cv2.putText", "numpy.argmax", "cv2.cvtColor", "cv2.waitKey", "numpy.expand_dims", "cv2.VideoCapture", "cv2.rectangle", "statistics.mode", "cv2.CascadeClassifier", "cv2.imshow", "cv2.namedWindow" ]
[((1935, 1979), 'keras.models.load_model', 'load_model', (['gender_model_path'], {'compile': '(False)'}), '(gender_model_path, compile=False)\n', (1945, 1979), False, 'from keras.models import load_model\n'), ((2195, 2226), 'cv2.namedWindow', 'cv2.namedWindow', (['"""window_frame"""'], {}), "('window_frame')\n", (2210,...
# This is a visualization script for the CSSP results on real datasets. # The visualization is available for the following subsampling functions: ## * Projection DPPs ## * Volume sampling ## * Pivoted QR ## * Double Phase ## * Largest leverage scores import sys sys.path.insert(0, '..') from CSSPy.dataset_tools import ...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.boxplot", "matplotlib.pyplot.yticks", "matplotlib.pyplot.setp", "sys.path.insert", "matplotlib.pyplot.figure", "numpy.loadtxt", "matplotlib.pyplot.gca", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xticks", "matplotlib...
[((263, 287), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (278, 287), False, 'import sys\n'), ((713, 738), 'numpy.loadtxt', 'np.loadtxt', (['savefile_name'], {}), '(savefile_name)\n', (723, 738), True, 'import numpy as np\n'), ((976, 1003), 'matplotlib.pyplot.figure', 'plt.figure', (...
from glob import glob from itertools import chain, product from matplotlib import mlab from matplotlib.animation import ArtistAnimation from scipy.ndimage.morphology import (binary_fill_holes, distance_transform_edt) from scipy.stats import norm from skimage import util from skimag...
[ "csv.reader", "numpy.ravel", "matplotlib.pyplot.figure", "skimage.measure.label", "skimage.morphology.diamond", "matplotlib.pyplot.imshow", "skimage.morphology.binary_erosion", "matplotlib.pyplot.subplots", "skimage.draw.ellipse", "skimage.io.imread", "skimage.exposure.equalize_hist", "numpy.a...
[((2509, 2541), 'skimage.io.imread', 'io.imread', (['filename'], {'plugin': 'None'}), '(filename, plugin=None)\n', (2518, 2541), False, 'from skimage import io, morphology\n'), ((2554, 2578), 'skimage.util.img_as_float', 'util.img_as_float', (['image'], {}), '(image)\n', (2571, 2578), False, 'from skimage import util\n...
import numpy as np class Vector: def __init__(self, x = 0, y = 0): self.x = x self.y = y def magnitude(self): return np.sqrt(self.x * self.x + self.y * self.y) def __repr__(self): return "Vektor({0}.x, {0}.y)".format(self)
[ "numpy.sqrt" ]
[((152, 194), 'numpy.sqrt', 'np.sqrt', (['(self.x * self.x + self.y * self.y)'], {}), '(self.x * self.x + self.y * self.y)\n', (159, 194), True, 'import numpy as np\n')]
import numpy as np import bandits_lab.algorithms as algs import bandits_lab.bandit_definitions as bands import sim_utilities as sim np.random.seed(10) T = 20000 n_tests = 75 """ Definition of the problems considered - the probability set considered is a triangle, - we build a family of bandit pr...
[ "bandits_lab.bandit_definitions.PolytopeConstraints", "numpy.random.seed", "sim_utilities.launch", "sim_utilities.plot_and_save", "bandits_lab.algorithms.DivPUCB", "numpy.array", "bandits_lab.bandit_definitions.DivPBand" ]
[((134, 152), 'numpy.random.seed', 'np.random.seed', (['(10)'], {}), '(10)\n', (148, 152), True, 'import numpy as np\n'), ((940, 986), 'bandits_lab.bandit_definitions.PolytopeConstraints', 'bands.PolytopeConstraints', (['K', 'constraints_list'], {}), '(K, constraints_list)\n', (965, 986), True, 'import bandits_lab.band...
#!/usr/bin/env python # -*- coding: utf-8 -*- import matplotlib.pyplot as plt from scipy import ndimage from PIL import Image import scipy import numpy as np import cv2 import os nomeImagem="muitas_crateras.jpg" def medianBlur(img): img_blur=cv2.medianBlur(img,7); return img_blur def averageBlur(img): ke...
[ "numpy.divide", "cv2.filter2D", "cv2.medianBlur", "numpy.zeros", "numpy.ones", "scipy.ndimage.sobel", "numpy.place", "numpy.hypot", "PIL.Image.open", "numpy.max", "cv2.convertScaleAbs", "PIL.Image.fromarray", "numpy.arctan" ]
[((248, 270), 'cv2.medianBlur', 'cv2.medianBlur', (['img', '(7)'], {}), '(img, 7)\n', (262, 270), False, 'import cv2\n'), ((369, 398), 'cv2.filter2D', 'cv2.filter2D', (['img', '(-1)', 'kernel'], {}), '(img, -1, kernel)\n', (381, 398), False, 'import cv2\n'), ((544, 568), 'cv2.convertScaleAbs', 'cv2.convertScaleAbs', ([...
import os, sys import numpy as np try: import StringIO except ModuleNotFoundError: from io import BytesIO as StringIO import base as wb class NBest(object): def __init__(self, nbest, trans, acscore=None, lmscore=None, gfscore=None): """ construct a nbest class Args: n...
[ "base.io.StringIO", "numpy.zeros_like", "base.LoadScore", "base.GetBest", "base.CmpWER", "numpy.array", "numpy.linspace", "base.file_rmlabel", "base.CmpOracleWER", "StringIO.StringIO" ]
[((1236, 1252), 'base.io.StringIO', 'wb.io.StringIO', ([], {}), '()\n', (1250, 1252), True, 'import base as wb\n'), ((1531, 1556), 'numpy.linspace', 'np.linspace', (['(0.1)', '(1.0)', '(10)'], {}), '(0.1, 1.0, 10)\n', (1542, 1556), True, 'import numpy as np\n'), ((3822, 3841), 'StringIO.StringIO', 'StringIO.StringIO', ...
"""Tests for the policies in the hbaselines/multi_fcnet subdirectory.""" import unittest import numpy as np import tensorflow as tf from gym.spaces import Box from hbaselines.utils.tf_util import get_trainable_vars from hbaselines.multi_fcnet.td3 import MultiFeedForwardPolicy as \ TD3MultiFeedForwardPolicy from hb...
[ "unittest.main", "hbaselines.multi_fcnet.td3.MultiFeedForwardPolicy", "hbaselines.algorithms.off_policy.MULTI_FEEDFORWARD_PARAMS.copy", "hbaselines.utils.tf_util.get_trainable_vars", "hbaselines.multi_fcnet.sac.MultiFeedForwardPolicy", "numpy.testing.assert_almost_equal", "hbaselines.algorithms.off_poli...
[((73124, 73139), 'unittest.main', 'unittest.main', ([], {}), '()\n', (73137, 73139), False, 'import unittest\n'), ((718, 740), 'tensorflow.compat.v1.Session', 'tf.compat.v1.Session', ([], {}), '()\n', (738, 740), True, 'import tensorflow as tf\n'), ((2397, 2431), 'tensorflow.compat.v1.reset_default_graph', 'tf.compat....
#!/usr/bin/env python # -*- code:utf-8 -*- ''' @Author: tyhye.wang @Date: 2018-06-16 08:05:43 @Last Modified by: tyhye.wang @Last Modified time: 2018-06-16 08:05:43 One metric object extend from the Metric. This metric is designed for person re-id retrival ''' from mxnet.metric import EvalMetric from mxn...
[ "numpy.sum", "numpy.setdiff1d", "numpy.argsort", "numpy.append", "numpy.argwhere", "numpy.dot", "numpy.intersect1d", "numpy.concatenate", "numpy.in1d" ]
[((6011, 6028), 'numpy.dot', 'np.dot', (['gf', 'query'], {}), '(gf, query)\n', (6017, 6028), True, 'import numpy as np\n'), ((6061, 6078), 'numpy.argsort', 'np.argsort', (['score'], {}), '(score)\n', (6071, 6078), True, 'import numpy as np\n'), ((6188, 6209), 'numpy.argwhere', 'np.argwhere', (['(gl == ql)'], {}), '(gl ...
# ------------------------------------------------------------------------------------------------------------------- # Method 2 in OpenCv # ------------------------------------------------------------------------------------------------------------------- import numpy as np import cv2 as cv from PIL import Image cap =...
[ "cv2.createBackgroundSubtractorMOG2", "numpy.concatenate", "cv2.cvtColor", "cv2.getStructuringElement", "cv2.morphologyEx", "cv2.waitKey", "cv2.imshow", "cv2.VideoCapture", "PIL.Image.fromarray", "cv2.resizeWindow", "cv2.destroyAllWindows", "cv2.namedWindow" ]
[((321, 395), 'cv2.VideoCapture', 'cv.VideoCapture', (['"""/Users/zhou/Desktop/data/video_clip/train/IMG_00000.MOV"""'], {}), "('/Users/zhou/Desktop/data/video_clip/train/IMG_00000.MOV')\n", (336, 395), True, 'import cv2 as cv\n'), ((403, 474), 'cv2.createBackgroundSubtractorMOG2', 'cv.createBackgroundSubtractorMOG2', ...
import os import os.path as op import numpy as np import matplotlib.pyplot as plt import mne from mne import find_events, Epochs, compute_covariance, make_ad_hoc_cov from mne.datasets import sample from mne.simulation import (simulate_sparse_stc, simulate_raw, add_noise, add_ecg, add_eog) ...
[ "functools.partial", "os.mkdir", "mne.io.read_raw_fif", "os.path.join", "mne.read_labels_from_annot", "os.path.exists", "numpy.random.RandomState", "mne.simulation.simulate_raw", "numpy.arange", "numpy.sin", "itertools.product", "mne.forward.make_forward_solution", "mne.simulation.simulate_s...
[((1084, 1100), 'os.chdir', 'os.chdir', (['topdir'], {}), '(topdir)\n', (1092, 1100), False, 'import os\n'), ((1217, 1247), 'mne.io.read_raw_fif', 'mne.io.read_raw_fif', (['raw_fname'], {}), '(raw_fname)\n', (1236, 1247), False, 'import mne\n'), ((1258, 1282), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)...
import unittest import numpy as np import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from config import OptimizationConfigEuRoC from utils import to_quaternion, to_rotation, Isometry3d from feature import Feature from msckf import CAMState class TestFeature(unittest....
[ "unittest.main", "msckf.CAMState", "numpy.random.randn", "config.OptimizationConfigEuRoC", "os.path.dirname", "numpy.zeros", "numpy.identity", "numpy.random.random", "numpy.linalg.norm", "numpy.array", "feature.Feature" ]
[((3433, 3448), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3446, 3448), False, 'import unittest\n'), ((91, 116), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (106, 116), False, 'import os\n'), ((470, 495), 'config.OptimizationConfigEuRoC', 'OptimizationConfigEuRoC', ([], {}), '()\...
#! /usr/bin/python3 import sys from lxml import etree as ET import xml.etree.cElementTree as ET import pdb import random import logging import xml.dom.minidom import argparse import os import datetime import requests import csv import sqlite3 from xml.dom import minidom from copy import deepcopy from collections impor...
[ "matplotlib.pyplot.title", "csv.reader", "pandas.read_csv", "random.shuffle", "matplotlib.pyplot.bar", "os.walk", "collections.defaultdict", "matplotlib.pyplot.figure", "numpy.rot90", "numpy.mean", "xml.etree.cElementTree.Element", "requests.post", "matplotlib.pyplot.tight_layout", "os.pat...
[((4177, 4190), 'collections.defaultdict', 'defaultdict', ([], {}), '()\n', (4188, 4190), False, 'from collections import defaultdict\n'), ((4434, 4460), 'xml.etree.cElementTree.tostring', 'ET.tostring', (['elem', '"""utf-8"""'], {}), "(elem, 'utf-8')\n", (4445, 4460), True, 'import xml.etree.cElementTree as ET\n'), ((...
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "numpy.min_scalar_type" ]
[((1104, 1126), 'numpy.min_scalar_type', 'onp.min_scalar_type', (['x'], {}), '(x)\n', (1123, 1126), True, 'import numpy as onp\n')]
import numpy as np import pyworld as pw import audio import os from pathlib import Path from scipy.interpolate import interp1d def extract_f0(wav, max_duration, data_cfg): # Compute fundamental frequency f0, t = pw.dio( wav.astype(np.float64), data_cfg.sampling_rate, frame_period=data_...
[ "numpy.load", "numpy.random.seed", "numpy.log", "numpy.sum", "pathlib.Path", "numpy.where", "numpy.random.random", "scipy.interpolate.interp1d", "audio.tools.get_mel_from_wav", "os.listdir" ]
[((1044, 1087), 'audio.tools.get_mel_from_wav', 'audio.tools.get_mel_from_wav', (['wav', 'data_cfg'], {}), '(wav, data_cfg)\n', (1072, 1087), False, 'import audio\n'), ((1184, 1227), 'numpy.log', 'np.log', (['(energy + data_cfg.energy_log_offset)'], {}), '(energy + data_cfg.energy_log_offset)\n', (1190, 1227), True, 'i...
from os.path import abspath, dirname import numpy as np import tensorflow as tf TRAIN = 'train' VAL = 'val' TEST = 'test' """ Available DataSets """ GTSR = 'GTSR' GTSD = 'GTSD' BDD100K = 'BDD100K' MAPILLARY_TS = 'MAPILLARY_TS' COCO = 'COCO' ALL_DETECTION_DATA_SETS = [GTSD, BDD100K, ...
[ "os.path.dirname", "numpy.array", "tensorflow.io.VarLenFeature", "tensorflow.io.FixedLenFeature" ]
[((3649, 3692), 'numpy.array', 'np.array', (['[[6, 7, 8], [3, 4, 5], [0, 1, 2]]'], {}), '([[6, 7, 8], [3, 4, 5], [0, 1, 2]])\n', (3657, 3692), True, 'import numpy as np\n'), ((3942, 3974), 'numpy.array', 'np.array', (['[[3, 4, 5], [0, 1, 2]]'], {}), '([[3, 4, 5], [0, 1, 2]])\n', (3950, 3974), True, 'import numpy as np\...
import unittest import numpy as np from data_structure_collection.matrix import product class TestProduct(unittest.TestCase): def test_product(self): mat1 = [[2, 4], [3, 4]] mat2 = [[1, 2], [1, 3]] m1, m2, n1, n2 = 2, 2, 2, 2 res = product(m1, m2, mat1, n1, n2, mat2) self...
[ "numpy.dot", "data_structure_collection.matrix.product", "numpy.array" ]
[((272, 307), 'data_structure_collection.matrix.product', 'product', (['m1', 'm2', 'mat1', 'n1', 'n2', 'mat2'], {}), '(m1, m2, mat1, n1, n2, mat2)\n', (279, 307), False, 'from data_structure_collection.matrix import product\n'), ((347, 360), 'numpy.array', 'np.array', (['res'], {}), '(res)\n', (355, 360), True, 'import...
import codecs import numpy as np import re from typing import Tuple, List, Dict import model import utils def load_sentences(path: str) -> List[List[List[str]]]: sentences = [] sentence = [] for line in codecs.open(path, 'r', 'utf-8'): line = re.sub(r'[0-9]', '0', line.rstrip()) if not li...
[ "codecs.open", "utils.update_tag_scheme", "utils.create_dico", "utils.create_desc_mapping", "model.cap_feature", "utils.align_char_lists", "utils.get_words_affix_ids", "numpy.sqrt", "utils.get_affix_dict_list" ]
[((218, 249), 'codecs.open', 'codecs.open', (['path', '"""r"""', '"""utf-8"""'], {}), "(path, 'r', 'utf-8')\n", (229, 249), False, 'import codecs\n'), ((774, 817), 'utils.update_tag_scheme', 'utils.update_tag_scheme', (['sentences', '"""iobes"""'], {}), "(sentences, 'iobes')\n", (797, 817), False, 'import utils\n'), ((...
from DataSets.DS.fashion_mnist import FashionMnist from DataSets.DS.svhn_cropped import SVHN from DataSets.DS.cifar10 import Cifar10 from DataSets.DS.mnist import MNIST import numpy as np class GetData: @staticmethod def get_ds(name): """ Get Dataset from DS folder :param name: Name d...
[ "DataSets.DS.svhn_cropped.SVHN", "numpy.nonzero", "DataSets.DS.fashion_mnist.FashionMnist", "DataSets.DS.cifar10.Cifar10", "DataSets.DS.mnist.MNIST" ]
[((416, 423), 'DataSets.DS.mnist.MNIST', 'MNIST', ([], {}), '()\n', (421, 423), False, 'from DataSets.DS.mnist import MNIST\n'), ((1725, 1749), 'numpy.nonzero', 'np.nonzero', (['x_data_index'], {}), '(x_data_index)\n', (1735, 1749), True, 'import numpy as np\n'), ((501, 508), 'DataSets.DS.mnist.MNIST', 'MNIST', ([], {}...
# HASPR - High-Altitude Solar Power Research # Script to calculate aggregate lower bounds and historic variance given a directory of individual expected output # Version 0.1 # Author: neyring import numpy as np from numpy import genfromtxt from os import walk import haspr from haspr import Result # Paramet...
[ "os.walk", "numpy.zeros", "numpy.genfromtxt", "haspr.Result", "numpy.add" ]
[((747, 767), 'os.walk', 'walk', (['inputDirectory'], {}), '(inputDirectory)\n', (751, 767), False, 'from os import walk\n'), ((878, 893), 'numpy.zeros', 'np.zeros', (['(17520)'], {}), '(17520)\n', (886, 893), True, 'import numpy as np\n'), ((915, 930), 'numpy.zeros', 'np.zeros', (['(17520)'], {}), '(17520)\n', (923, 9...
# # Copyright (c) 2020 IBM Corp. # 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 writi...
[ "pyarrow.ExtensionArray.from_storage", "pyarrow.concat_arrays", "pyarrow.ListArray.from_arrays", "pyarrow.types.is_struct", "text_extensions_for_pandas.array.tensor.TensorArray", "numpy.ndarray", "numpy.prod", "numpy.zeros_like", "pyarrow.from_numpy_dtype", "text_extensions_for_pandas.array.token_...
[((4249, 4274), 'pyarrow.array', 'pa.array', (['char_span.begin'], {}), '(char_span.begin)\n', (4257, 4274), True, 'import pyarrow as pa\n'), ((4292, 4315), 'pyarrow.array', 'pa.array', (['char_span.end'], {}), '(char_span.end)\n', (4300, 4315), True, 'import pyarrow as pa\n'), ((4542, 4605), 'pyarrow.DictionaryArray.f...