code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import math, copy, time from torch.autograd import Variable from utils import outputActivation import pdb # Customizations # - DONE Embeddings: linear transform d_feats -> d_model features # - DONE Generator # - DONE Batching # D...
[ "torch.nn.Dropout", "torch.sin", "math.sqrt", "torch.from_numpy", "utils.outputActivation", "math.log", "numpy.array", "torch.cos", "torch.cuda.is_available", "torch.squeeze", "copy.deepcopy", "torch.nn.init.xavier_uniform", "copy.copy", "torch.repeat_interleave", "torch.nn.functional.so...
[((4461, 4486), 'torch.nn.functional.softmax', 'F.softmax', (['scores'], {'dim': '(-1)'}), '(scores, dim=-1)\n', (4470, 4486), True, 'import torch.nn.functional as F\n'), ((735, 753), 'copy.copy', 'copy.copy', (['d_model'], {}), '(d_model)\n', (744, 753), False, 'import math, copy, time\n'), ((2080, 2115), 'torch.nn.Li...
import numpy as np import time import ray import ray.autoscaler.sdk from ray._private.test_utils import Semaphore import json import os from time import perf_counter from tqdm import trange, tqdm MAX_ARGS = 10000 MAX_RETURNS = 3000 MAX_RAY_GET_ARGS = 10000 MAX_QUEUED_TASKS = 1_000_000 MAX_RAY_GET_SIZE = 100 * 2**30 ...
[ "ray.init", "ray.cluster_resources", "ray.get", "numpy.arange", "tqdm.tqdm", "time.perf_counter", "time.sleep", "ray._private.test_utils.Semaphore.remote", "numpy.zeros", "ray.put", "ray.remote", "ray.available_resources", "tqdm.trange", "json.dump" ]
[((3347, 3371), 'ray.init', 'ray.init', ([], {'address': '"""auto"""'}), "(address='auto')\n", (3355, 3371), False, 'import ray\n'), ((3386, 3400), 'time.perf_counter', 'perf_counter', ([], {}), '()\n', (3398, 3400), False, 'from time import perf_counter\n'), ((3429, 3443), 'time.perf_counter', 'perf_counter', ([], {})...
import cv2 import numpy as np import matplotlib.pyplot as plt IMAGE = "b&w2.jpg" prototxt = "./Models/colorization_deploy_v2.prototxt.txt" model = "./Models/colorization_release_v2.caffemodel" points = "./Models/pts_in_hull.npy" image = "./input_images/"+IMAGE net = cv2.dnn.readNetFromCaffe(prototxt, mod...
[ "numpy.clip", "matplotlib.pyplot.imshow", "cv2.dnn.blobFromImage", "numpy.full", "cv2.dnn.readNetFromCaffe", "cv2.cvtColor", "numpy.concatenate", "cv2.split", "matplotlib.pyplot.axis", "cv2.resize", "numpy.load", "cv2.imread", "matplotlib.pyplot.show" ]
[((282, 323), 'cv2.dnn.readNetFromCaffe', 'cv2.dnn.readNetFromCaffe', (['prototxt', 'model'], {}), '(prototxt, model)\n', (306, 323), False, 'import cv2\n'), ((331, 346), 'numpy.load', 'np.load', (['points'], {}), '(points)\n', (338, 346), True, 'import numpy as np\n'), ((610, 627), 'cv2.imread', 'cv2.imread', (['image...
import numpy as np from netCDF4 import Dataset from datetime import datetime from datetime import timedelta import os import sys import matplotlib.pyplot as plt from matplotlib import gridspec import matplotlib.colors as mcolors import matplotlib.patches as patches from matplotlib.colors import BoundaryNorm from to...
[ "tools_LT.setup_12p", "numpy.array", "datetime.timedelta", "numpy.arange", "datetime.datetime", "numpy.where", "netCDF4.Dataset", "matplotlib.colors.ListedColormap", "matplotlib.pyplot.close", "numpy.meshgrid", "matplotlib.pyplot.cla", "matplotlib.pyplot.cm.get_cmap", "matplotlib.pyplot.show...
[((17338, 17372), 'numpy.arange', 'np.arange', (['(DX * 0.5)', '(DX * XDIM)', 'DX'], {}), '(DX * 0.5, DX * XDIM, DX)\n', (17347, 17372), True, 'import numpy as np\n'), ((17375, 17409), 'numpy.arange', 'np.arange', (['(DY * 0.5)', '(DY * YDIM)', 'DY'], {}), '(DY * 0.5, DY * YDIM, DY)\n', (17384, 17409), True, 'import nu...
from abc import abstractmethod import numpy as np from pymoo.core.population import Population # --------------------------------------------------------------------------------------------------------- # Survival # ----------------------------------------------------------------------------------------------------...
[ "numpy.median", "pymoo.core.population.Population", "numpy.where", "numpy.argsort", "pymoo.core.population.Population.merge" ]
[((2429, 2442), 'numpy.median', 'np.median', (['cv'], {}), '(cv)\n', (2438, 2442), True, 'import numpy as np\n'), ((2183, 2194), 'numpy.where', 'np.where', (['b'], {}), '(b)\n', (2191, 2194), True, 'import numpy as np\n'), ((2215, 2227), 'numpy.where', 'np.where', (['(~b)'], {}), '(~b)\n', (2223, 2227), True, 'import n...
""" Copyright (c) 2016, <NAME> .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 conditions and the foll...
[ "numpy.ones", "nibabel.load", "scipy.io.loadmat", "numpy.issubdtype", "ImgOperations.imgOp.applyPadding", "numpy.empty", "numpy.rint", "numpy.random.shuffle" ]
[((1511, 1534), 'nibabel.load', 'nib.load', (['imageFileName'], {}), '(imageFileName)\n', (1519, 1534), True, 'import nibabel as nib\n'), ((1987, 2013), 'scipy.io.loadmat', 'sio.loadmat', (['imageFileName'], {}), '(imageFileName)\n', (1998, 2013), True, 'import scipy.io as sio\n'), ((5928, 5951), 'numpy.random.shuffle'...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Collection of helper methods for rdm module @author: baihan """ import numpy as np from scipy.spatial.distance import squareform def batch_to_vectors(x): """converts a *stack* of RDMs in vector or matrix form into vector form Args: x: stack of RDMs ...
[ "scipy.spatial.distance.squareform", "numpy.sqrt", "numpy.unique", "numpy.array", "numpy.ndarray", "numpy.arange" ]
[((2313, 2338), 'numpy.unique', 'np.unique', (['pattern_select'], {}), '(pattern_select)\n', (2322, 2338), True, 'import numpy as np\n'), ((1457, 1492), 'numpy.ndarray', 'np.ndarray', (['(n_rdm, n_cond, n_cond)'], {}), '((n_rdm, n_cond, n_cond))\n', (1467, 1492), True, 'import numpy as np\n'), ((1512, 1528), 'numpy.ara...
import pandas as pd import numpy as np from catboost import CatBoostClassifier import xgboost as xgb import lightgbm as lgb from sklearn.utils import class_weight from abc import ABC, abstractmethod class predict_model(ABC): """ Abstract class for working with classifiers. """ @abstractmethod def...
[ "numpy.unique", "lightgbm.LGBMClassifier", "pandas.DataFrame", "catboost.CatBoostClassifier", "xgboost.XGBClassifier" ]
[((2413, 2443), 'pandas.DataFrame', 'pd.DataFrame', ([], {'index': 'test.index'}), '(index=test.index)\n', (2425, 2443), True, 'import pandas as pd\n'), ((3233, 3285), 'catboost.CatBoostClassifier', 'CatBoostClassifier', ([], {'class_weights': 'c_w'}), '(**self.params, class_weights=c_w)\n', (3251, 3285), False, 'from ...
""" @authors: # ============================================================================= Information: The functions in this script are used to export and create array files todo: Something is wrong with: Store_temp_GLl # ============================================================================= """...
[ "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.ones" ]
[((2905, 2923), 'matplotlib.pyplot.figure', 'plt.figure', (['fignum'], {}), '(fignum)\n', (2915, 2923), True, 'import matplotlib.pyplot as plt\n'), ((3062, 3093), 'matplotlib.pyplot.savefig', 'plt.savefig', (['file_name'], {'dpi': 'dpi'}), '(file_name, dpi=dpi)\n', (3073, 3093), True, 'import matplotlib.pyplot as plt\n...
import numpy as np from scipy import optimize from sklearn.metrics import euclidean_distances from ashic.utils import rotation, fill_array3d def prepare_data(x, tab, alpha, beta, mask, loci, bias): n = int(x.shape[0]/2) x1 = x[:n, :][loci, :] x2 = x[n:, :][loci, :] # find the centroids of x1, x2 c...
[ "numpy.repeat", "numpy.power", "sklearn.metrics.euclidean_distances", "numpy.log", "ashic.utils.rotation", "numpy.outer", "numpy.concatenate", "ashic.utils.fill_array3d" ]
[((658, 685), 'sklearn.metrics.euclidean_distances', 'euclidean_distances', (['x1', 'x2'], {}), '(x1, x2)\n', (677, 685), False, 'from sklearn.metrics import euclidean_distances\n'), ((1009, 1044), 'ashic.utils.rotation', 'rotation', (['thetaxm', 'thetaym', 'thetazm'], {}), '(thetaxm, thetaym, thetazm)\n', (1017, 1044)...
#Schrodinger 1D equation solved in an infinite potential well by Numerov's algorithm and the shooting method #Not generalized to any potential yet as I'm not sure about the boundary conditions. from __future__ import division import numpy as np from matplotlib import pyplot as plt hbar = 1 m = 1 xmin = -1 xmax = 1 N...
[ "matplotlib.pyplot.legend", "numpy.linspace", "matplotlib.pyplot.grid", "numpy.zeros" ]
[((437, 477), 'numpy.linspace', 'np.linspace', (['xmin', 'xmax', 'N'], {'retstep': '(True)'}), '(xmin, xmax, N, retstep=True)\n', (448, 477), True, 'import numpy as np\n'), ((506, 517), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (514, 517), True, 'import numpy as np\n'), ((739, 750), 'numpy.zeros', 'np.zeros', ([...
#!/usr/bin/env python # coding: utf-8 # import torch.nn.functional as F # import torch.optim as optim # from apex import amp # from tqdm import tqdm # from skimage import io as img # import torchvision.models as models # from torchsummaryX import summary as modelsummary # import nni import time import os import warni...
[ "configs.get_configs", "torch.nn.L1Loss", "utils_functions.data_augmenter", "torch.cuda.synchronize", "torch.nn.MSELoss", "utils_functions.ran_gen", "training_functions.organise_models", "argparse.ArgumentParser", "training_functions.VGGPerceptualLoss", "evaluation.calculate_sifid_given_paths", ...
[((995, 1028), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (1018, 1028), False, 'import warnings\n'), ((1029, 1050), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (1043, 1050), False, 'import matplotlib\n'), ((1171, 1196), 'argparse.ArgumentParse...
# -*- coding: utf-8 -*- """ Created on Thu Apr 30 14:22:15 2020 @author: paras """ import pandas as pd import numpy as np from sklearn.externals import joblib from flask import Flask, jsonify, request import json import flask from keras.preprocessing import image from keras.preprocessing.image import ImageDataGene...
[ "flask.render_template", "keras.preprocessing.image.img_to_array", "flask.Flask", "sklearn.externals.joblib.load", "flask.request.form.to_dict", "numpy.expand_dims", "urllib.request.urlopen" ]
[((552, 567), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (557, 567), False, 'from flask import Flask, jsonify, request\n'), ((520, 543), 'keras.preprocessing.image.img_to_array', 'image.img_to_array', (['img'], {}), '(img)\n', (538, 543), False, 'from keras.preprocessing import image\n'), ((626, 661), ...
import numpy as np import pygenome as pg # fitness function: measures the sortness of a permutation def sorted_permutation(vector): unsorted = vector.size for i in range(vector.size): if vector[i] == i: unsorted -= 1 return unsorted permutation_size = 10 # GA 1 def generational_n...
[ "pygenome.genetic_algorithm_permutation", "numpy.random.seed", "pygenome.best_individual" ]
[((337, 355), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (351, 355), True, 'import numpy as np\n'), ((366, 462), 'pygenome.genetic_algorithm_permutation', 'pg.genetic_algorithm_permutation', (['sorted_permutation', 'permutation_size'], {'total_generations': '(25)'}), '(sorted_permutation, permutat...
"""Structure classes.""" import numpy as np import rmsd import math import warnings from collections import Counter, OrderedDict, defaultdict from .base import StructureClass, query, StructureSet class AtomStructure: """A structure made of atoms. This contains various useful methods that rely on a ``atoms()``...
[ "numpy.sqrt", "math.ceil", "math.floor", "numpy.asarray", "numpy.sum", "numpy.array", "numpy.dot", "collections.defaultdict", "numpy.cos", "numpy.linalg.norm", "numpy.sin", "rmsd.kabsch_rmsd", "warnings.warn", "numpy.round" ]
[((2860, 2890), 'numpy.sqrt', 'np.sqrt', (['mean_square_deviation'], {}), '(mean_square_deviation)\n', (2867, 2890), True, 'import numpy as np\n'), ((30474, 30493), 'numpy.array', 'np.array', (['[x, y, z]'], {}), '([x, y, z])\n', (30482, 30493), True, 'import numpy as np\n'), ((32562, 32578), 'numpy.asarray', 'np.asarr...
# import the necessary packages from imutils.video import VideoStream import numpy as np import argparse import imutils import time import cv2 import os import torch from PIL import Image import torch.nn as nn import torch.nn.functional as F from torchvision import transforms from torch.autograd import Variable import ...
[ "cv2.rectangle", "torch.nn.ReLU", "torch.max", "time.sleep", "cv2.imshow", "numpy.array", "cv2.destroyAllWindows", "torch.nn.BatchNorm2d", "imutils.video.VideoStream", "argparse.ArgumentParser", "cv2.dnn.readNetFromCaffe", "torchvision.transforms.ToTensor", "torch.autograd.Variable", "cv2....
[((2149, 2174), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2172, 2174), False, 'import argparse\n'), ((2660, 2717), 'cv2.dnn.readNetFromCaffe', 'cv2.dnn.readNetFromCaffe', (["args['prototxt']", "args['model']"], {}), "(args['prototxt'], args['model'])\n", (2684, 2717), False, 'import cv2\n...
# based on tut_mission_B737.py and Vehicle.py from Regional Jet Optimization # # Created: Aug 2014, SUAVE Team # Modified: Aug 2017, SUAVE Team # Modified: Jul 2018, geo # ---------------------------------------------------------------------- # Imports # ------------------------------------------------------------...
[ "SUAVE.Input_Output.Results.print_parasite_drag", "numpy.sqrt", "pylab.savefig", "SUAVE.Components.Energy.Converters.Compression_Nozzle", "SUAVE.Components.Landing_Gear.Landing_Gear", "SUAVE.Analyses.Vehicle", "SUAVE.Components.Energy.Converters.Compressor", "SUAVE.Input_Output.Results.print_mission_b...
[((1246, 1359), 'SUAVE.Methods.Center_of_Gravity.compute_aircraft_center_of_gravity', 'SUAVE.Methods.Center_of_Gravity.compute_aircraft_center_of_gravity', (['weights.vehicle'], {'nose_load_fraction': '(0.06)'}), '(weights.\n vehicle, nose_load_fraction=0.06)\n', (1312, 1359), False, 'import SUAVE\n'), ((1834, 1908)...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "numpy.linspace" ]
[((3580, 3655), 'numpy.linspace', 'np.linspace', (['self._min_rate', 'self._max_rate', 'self._num_rates'], {'endpoint': '(True)'}), '(self._min_rate, self._max_rate, self._num_rates, endpoint=True)\n', (3591, 3655), True, 'import numpy as np\n')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Remade on Sun 30 May 2021 22:32 @author: <NAME> - <EMAIL> """ #%% # ============================================================================= # Dependencies # ============================================================================= ## Importing modules im...
[ "datetime.datetime.today", "numpy.array", "pandas.read_csv", "xarray.Dataset" ]
[((527, 889), 'numpy.array', 'np.array', (["['1979', '1980', '1981', '1982', '1983', '1984', '1985', '1986', '1987',\n '1988', '1989', '1990', '1991', '1992', '1993', '1994', '1995', '1996',\n '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005',\n '2006', '2007', '2008', '2009', '2010', '201...
""" Mask R-CNN Copyright (c) 2018 Matterport, Inc. Licensed under the MIT License (see LICENSE for details) Written by <NAME> ------------------------------------------------------------ Minor Changes applied from <NAME> Applied for: IEEE Intelligent Vehicles Symposium - IV2020: "Vehicle Position Estimation with A...
[ "mrcnn.model.MaskRCNN", "scipy.io.savemat", "mrcnn.utils.download_trained_weights", "mrcnn.visualize.display_instances", "sys.path.append", "os.walk", "os.path.exists", "numpy.mean", "mrcnn.model.mold_image", "argparse.ArgumentParser", "matplotlib.pyplot.close", "mrcnn.utils.compute_ap_range",...
[((1186, 1211), 'os.path.abspath', 'os.path.abspath', (['"""../../"""'], {}), "('../../')\n", (1201, 1211), False, 'import os\n'), ((1232, 1257), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (1247, 1257), False, 'import sys\n'), ((1644, 1687), 'os.path.join', 'os.path.join', (['ROOT_DIR', '...
import torch import torch.backends.cudnn as cudnn import torch.nn.functional as F import torch.nn as nn from torch.quantization import QuantStub, DeQuantStub import torch.optim as optim from torchvision import models, datasets, transforms import torch.utils.data.distributed as distributed import torch.multiprocessing a...
[ "custom_modules.resnet.imagenet_resnet50", "torch.eq", "horovod.torch.size", "torch.cuda.is_available", "torch.utils.tensorboard.SummaryWriter", "os.path.exists", "utils.meters.TimeMeter", "argparse.ArgumentParser", "horovod.torch.rank", "torchvision.datasets.ImageFolder", "pruning.pruning.apply...
[((22867, 22934), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Imagenet_ResNet50 experiment"""'}), "(description='Imagenet_ResNet50 experiment')\n", (22890, 22934), False, 'import argparse\n'), ((1319, 1338), 'custom_modules.resnet.imagenet_resnet50', 'imagenet_resnet50', ([], {}), '()...
import ctypes import numpy import pygame import time from OpenGL.GL import * from OpenGL.GL.shaders import * from pygame.locals import * width = 1024 height = 768 def getFileContents(filename): return open(filename, 'r').read() def init(): vertexShader = compileShader(getFileContents("data/shaders/triangl...
[ "pygame.init", "pygame.quit", "pygame.event.get", "pygame.display.set_mode", "pygame.display.flip", "numpy.array", "ctypes.c_void_p" ]
[((2208, 2247), 'numpy.array', 'numpy.array', (['vertex_list', 'numpy.float32'], {}), '(vertex_list, numpy.float32)\n', (2219, 2247), False, 'import numpy\n'), ((2844, 2865), 'pygame.display.flip', 'pygame.display.flip', ([], {}), '()\n', (2863, 2865), False, 'import pygame\n'), ((2889, 2902), 'pygame.init', 'pygame.in...
#/usr/bin/python #coding:utf8 import numpy as np def Cosine(x, y): return 1.0*np.dot(x, y)/np.sqrt(np.dot(x,x))/np.sqrt(np.dot(y,y)) def Sigmoid(x): return 1.0 / (1.0 + np.exp(-1.0 * x)) def SigmoidGradient(x): return Sigmoid(x) * (1 - Sigmoid(x)) #平方误差,2范式的正则化项 def SquareErrorFunction2F(target_matrix_y, output...
[ "numpy.random.random_sample", "numpy.sqrt", "numpy.log", "numpy.diag", "numpy.exp", "numpy.sum", "numpy.dot", "numpy.linalg.inv", "numpy.array", "numpy.linalg.det" ]
[((1051, 1071), 'numpy.linalg.inv', 'np.linalg.inv', (['sigma'], {}), '(sigma)\n', (1064, 1071), True, 'import numpy as np\n'), ((1111, 1132), 'numpy.dot', 'np.dot', (['e', '(x - mu).T'], {}), '(e, (x - mu).T)\n', (1117, 1132), True, 'import numpy as np\n'), ((1085, 1104), 'numpy.dot', 'np.dot', (['(x - mu)', 'inv'], {...
import matplotlib.pyplot as plt import numpy from PIL import Image import sys import cv2 import time from sklearn.cluster import KMeans from sklearn.mixture import GaussianMixture import glob import os method = 'threshold' #method = 'threshold_adp' #method = 'backSub' #method = 'kmeans' dataset = 'beach' save_frame = ...
[ "cv2.createBackgroundSubtractorMOG2", "numpy.logical_not", "numpy.array", "sys.exit", "matplotlib.pyplot.imshow", "os.path.exists", "numpy.mean", "cv2.threshold", "cv2.medianBlur", "glob.glob", "numpy.argmax", "numpy.nonzero", "matplotlib.pyplot.pause", "matplotlib.pyplot.title", "time.t...
[((646, 682), 'cv2.createBackgroundSubtractorMOG2', 'cv2.createBackgroundSubtractorMOG2', ([], {}), '()\n', (680, 682), False, 'import cv2\n'), ((749, 777), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20, 30)'}), '(figsize=(20, 30))\n', (759, 777), True, 'import matplotlib.pyplot as plt\n'), ((1072, 11...
import csv import os import random import numpy as np import sys from sklearn import svm from keras.models import Sequential, model_from_yaml from keras.layers import Dropout, Dense from keras.callbacks import EarlyStopping def open_csv(file_path): # Input read as f_wh, f_wmt, f_posh, f_posmt, f_len, y asser...
[ "sklearn.externals.joblib.load", "numpy.subtract", "os.path.isfile", "numpy.array", "csv.reader", "numpy.divide" ]
[((322, 347), 'os.path.isfile', 'os.path.isfile', (['file_path'], {}), '(file_path)\n', (336, 347), False, 'import os\n'), ((818, 838), 'numpy.subtract', 'np.subtract', (['a', 'mean'], {}), '(a, mean)\n', (829, 838), True, 'import numpy as np\n'), ((847, 864), 'numpy.divide', 'np.divide', (['b', 'std'], {}), '(b, std)\...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/02_transformer_fingerprints.ipynb (unless otherwise specified). __all__ = ['RXNBERTFingerprintGenerator', 'RXNBERTMinhashFingerprintGenerator', 'get_default_model_and_tokenizer', 'generate_fingerprints'] # Cell import torch import pkg_resources import numpy a...
[ "itertools.islice", "pkg_resources.resource_filename", "transformers.BertModel.from_pretrained", "numpy.array", "torch.cuda.is_available", "torch.no_grad", "tmap.Minhash" ]
[((3781, 3853), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['"""rxnfp"""', 'f"""models/transformers/{model}"""'], {}), "('rxnfp', f'models/transformers/{model}')\n", (3812, 3853), False, 'import pkg_resources\n'), ((3938, 4024), 'pkg_resources.resource_filename', 'pkg_resources.resource_file...
import numpy as np import cv2 as cv class opencv_camera(): def __init__(self, render, name, frame_interval): self.frame_int = frame_interval self.render = render window_size = (self.render.win.getXSize(), self.render.win.getYSize()) self.buffer = self.render.win.makeTextureB...
[ "numpy.frombuffer", "cv2.resize", "cv2.flip" ]
[((867, 895), 'numpy.frombuffer', 'np.frombuffer', (['img', 'np.uint8'], {}), '(img, np.uint8)\n', (880, 895), True, 'import numpy as np\n'), ((1018, 1058), 'cv2.resize', 'cv.resize', (['image', '(0, 0)'], {'fx': '(0.5)', 'fy': '(0.5)'}), '(image, (0, 0), fx=0.5, fy=0.5)\n', (1027, 1058), True, 'import cv2 as cv\n'), (...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
[ "numpy.array", "jieba.cut" ]
[((1430, 1466), 'numpy.array', 'np.array', (['example[-1]'], {'dtype': '"""int64"""'}), "(example[-1], dtype='int64')\n", (1438, 1466), True, 'import numpy as np\n'), ((5254, 5290), 'numpy.array', 'np.array', (['[label]'], {'dtype': 'label_dtype'}), '([label], dtype=label_dtype)\n', (5262, 5290), True, 'import numpy as...
import collections import contextlib import sys import wave import webrtcvad import librosa def read_wave(path): with contextlib.closing(wave.open(path, 'rb')) as wf: num_channels = wf.getnchannels() assert num_channels == 1 sample_width = wf.getsampwidth() assert sample_width ==...
[ "sklearn.cluster.SpectralClustering", "wave.open", "sklearn.mixture.GaussianMixture", "collections.deque", "copy.deepcopy", "librosa.feature.delta", "sys.stdout.write", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.dot", "numpy.vstack", "webrtcvad.Vad", "numpy.shape", "librosa.load" ...
[((3983, 3999), 'webrtcvad.Vad', 'webrtcvad.Vad', (['(2)'], {}), '(2)\n', (3996, 3999), False, 'import webrtcvad\n'), ((4540, 4568), 'librosa.load', 'librosa.load', (['test_file_path'], {}), '(test_file_path)\n', (4552, 4568), False, 'import librosa\n'), ((4723, 4750), 'librosa.feature.delta', 'librosa.feature.delta', ...
import unittest import numpy as np import logging from dsbox.ml.neural_networks.keras_factory.text_models import LSTMFactory from dsbox.ml.neural_networks.processing.workflow import TextNeuralNetPipeline, ImageNeuralNetPipeline logging.getLogger("tensorflow").setLevel(logging.WARNING) np.random.seed(42) class T...
[ "logging.getLogger", "dsbox.ml.neural_networks.processing.workflow.ImageNeuralNetPipeline", "numpy.array", "dsbox.ml.neural_networks.processing.workflow.TextNeuralNetPipeline", "numpy.random.seed" ]
[((292, 310), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (306, 310), True, 'import numpy as np\n'), ((233, 264), 'logging.getLogger', 'logging.getLogger', (['"""tensorflow"""'], {}), "('tensorflow')\n", (250, 264), False, 'import logging\n'), ((461, 546), 'numpy.array', 'np.array', (["['this is re...
import numpy as np from pipeline.input_provider.base_input_provider import BaseInputProvider class NormalizedOneHotInputProvider(BaseInputProvider): def __init__(self): BaseInputProvider.__init__(self) self.__game_state = None self.__screen_shot = None def store(self, game_state, scr...
[ "numpy.array", "numpy.zeros", "pipeline.input_provider.base_input_provider.BaseInputProvider.__init__" ]
[((184, 216), 'pipeline.input_provider.base_input_provider.BaseInputProvider.__init__', 'BaseInputProvider.__init__', (['self'], {}), '(self)\n', (210, 216), False, 'from pipeline.input_provider.base_input_provider import BaseInputProvider\n'), ((676, 692), 'numpy.zeros', 'np.zeros', (['length'], {}), '(length)\n', (68...
# Copyright 2017-2018 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in t...
[ "six.moves.range", "os.environ.get", "os.path.join", "numpy.zeros", "unittest.main" ]
[((1604, 1633), 'os.environ.get', 'os.environ.get', (['"""TEST_SRCDIR"""'], {}), "('TEST_SRCDIR')\n", (1618, 1633), False, 'import os\n'), ((1763, 1778), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1776, 1778), False, 'import unittest\n'), ((1279, 1308), 'numpy.zeros', 'np.zeros', (['(7,)'], {'dtype': 'np.intc...
from itertools import tee import numpy as np import scipy.interpolate as intp from scipy.signal import savgol_filter def get_edge_bin(array): """Detect the edge indcies of a binary 1-D array. Args: array (:class:`numpy.ndarray`): A list or Numpy 1d array, with binary (0/1) or boolean (True...
[ "numpy.insert", "numpy.ones_like", "numpy.int64", "numpy.roll", "scipy.interpolate.InterpolatedUnivariateSpline", "numpy.logical_and", "numpy.where", "numpy.diff", "numpy.append", "numpy.array", "numpy.zeros", "numpy.nonzero", "itertools.tee", "numpy.matrix", "numpy.arange" ]
[((745, 760), 'numpy.int64', 'np.int64', (['array'], {}), '(array)\n', (753, 760), True, 'import numpy as np\n'), ((774, 797), 'numpy.insert', 'np.insert', (['array1', '(0)', '(0)'], {}), '(array1, 0, 0)\n', (783, 797), True, 'import numpy as np\n'), ((811, 831), 'numpy.append', 'np.append', (['array1', '(0)'], {}), '(...
"""Option helper functions""" __docformat__ = "numpy" import argparse from typing import List import pandas as pd import numpy as np from gamestonk_terminal.helper_funcs import ( parse_known_args_and_warn, check_non_negative, ) # pylint: disable=R1710 def load(other_args: List[str]) -> str: """Load ti...
[ "numpy.array", "gamestonk_terminal.helper_funcs.parse_known_args_and_warn", "argparse.ArgumentParser" ]
[((491, 657), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'add_help': '(False)', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter', 'prog': '"""opload"""', 'description': '"""Load a ticker into option menu"""'}), "(add_help=False, formatter_class=argparse.\n ArgumentDefaultsHelpFormatter, p...
""" Our modification of the OpenAI Gym Continuous Mountain Car by <NAME>: https://github.com/openai/gym/blob/master/gym/envs/classic_control/continuous_mountain_car.py which was (ultimately) based on Sutton's implementation: http://incompleteideas.net/sutton/MountainCar/MountainCar1.cp """ from pilco.errors import En...
[ "numpy.clip", "gym.envs.classic_control.rendering.make_circle", "gym.envs.classic_control.rendering.Line", "gym.spaces.Box", "numpy.array", "gym.envs.classic_control.rendering.Viewer", "numpy.linspace", "gym.envs.classic_control.rendering.Transform", "numpy.cos", "pilco.errors.EnvironmentError", ...
[((903, 967), 'numpy.array', 'np.array', (['[self.min_position, -self.max_speed]'], {'dtype': 'np.float32'}), '([self.min_position, -self.max_speed], dtype=np.float32)\n', (911, 967), True, 'import numpy as np\n'), ((1029, 1092), 'numpy.array', 'np.array', (['[self.max_position, self.max_speed]'], {'dtype': 'np.float32...
import chainer import numpy as np from test.util import generate_kernel_test_case, wrap_template from webdnn.graph.placeholder import Placeholder from webdnn.frontend.chainer.converter import ChainerConverter from webdnn.frontend.chainer.placeholder_variable import PlaceholderVariable @wrap_template def template(n=2...
[ "numpy.random.rand", "test.util.generate_kernel_test_case", "webdnn.graph.placeholder.Placeholder", "chainer.links.Convolution2D", "webdnn.frontend.chainer.converter.ChainerConverter", "webdnn.frontend.chainer.placeholder_variable.PlaceholderVariable" ]
[((423, 520), 'chainer.links.Convolution2D', 'chainer.links.Convolution2D', (['c_in', 'c_out'], {'ksize': 'ksize', 'stride': 'stride', 'pad': 'pad', 'nobias': 'nobias'}), '(c_in, c_out, ksize=ksize, stride=stride, pad=\n pad, nobias=nobias)\n', (450, 520), False, 'import chainer\n'), ((723, 881), 'test.util.generate...
import numpy as np from scipy.optimize import fmin_l_bfgs_b import time import argparse import cv2 from tensorflow.keras.models import load_model import numpy as np import csv import sys from matplotlib import pyplot as plt from PIL import Image from keras.preprocessing.image import img_to_array img = cv2.imread('po...
[ "keras.preprocessing.image.img_to_array", "PIL.Image.open", "numpy.where", "PIL.Image.new", "cv2.grabCut", "numpy.zeros", "cv2.imread" ]
[((306, 364), 'cv2.imread', 'cv2.imread', (['"""pokemonimages/Groudon.jpg"""', 'cv2.COLOR_BGR2RGB'], {}), "('pokemonimages/Groudon.jpg', cv2.COLOR_BGR2RGB)\n", (316, 364), False, 'import cv2\n'), ((387, 426), 'PIL.Image.open', 'Image.open', (['"""pokemonimages/Groudon.jpg"""'], {}), "('pokemonimages/Groudon.jpg')\n", (...
import os import json import torch import sys import time import random import numpy as np from tqdm import tqdm, trange import torch.multiprocessing as mp import torch.distributed as dist from torch.utils.tensorboard import SummaryWriter from apex.parallel import DistributedDataParallel as DDP from apex import amp s...
[ "wandb.log", "wandb.init", "sys.path.append", "wandb.config.update", "numpy.random.seed", "os.getpid", "os.path.dirname", "util.gqa_train.data_reader.DataReader", "time.time", "models_gqa.model.LCGNwrapper", "torch.cuda.manual_seed_all", "torch.manual_seed", "os.makedirs", "torch.multiproc...
[((319, 340), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (334, 340), False, 'import sys\n'), ((1205, 1846), 'util.gqa_train.data_reader.DataReader', 'DataReader', (['imdb_file', 'rank', 'gpu', 'num_replicas'], {'shuffle': '(True)', 'max_num': 'max_num', 'batch_size': 'cfg.TRAIN.BATCH_SIZE', '...
from sys import platform from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize import numpy ext_modules = [ Extension( "src.libs.cutils", ["src/libs/cutils.pyx"], extra_compile_args=['/openmp' if platform == "win32" else '-fopenmp'] ...
[ "Cython.Build.cythonize", "distutils.extension.Extension", "numpy.get_include" ]
[((170, 299), 'distutils.extension.Extension', 'Extension', (['"""src.libs.cutils"""', "['src/libs/cutils.pyx']"], {'extra_compile_args': "['/openmp' if platform == 'win32' else '-fopenmp']"}), "('src.libs.cutils', ['src/libs/cutils.pyx'], extra_compile_args=[\n '/openmp' if platform == 'win32' else '-fopenmp'])\n",...
import numpy as np from nnfs.layers import Linear from nnfs.optimizers import SGD class Model: def __init__(self, layers, loss, optimizer=SGD(lr=0.01)): self.layers = layers self.loss = loss self.optimizer = optimizer def save_weights(self, filename): weights = [] for ...
[ "numpy.savez", "numpy.load", "nnfs.optimizers.SGD" ]
[((144, 156), 'nnfs.optimizers.SGD', 'SGD', ([], {'lr': '(0.01)'}), '(lr=0.01)\n', (147, 156), False, 'from nnfs.optimizers import SGD\n'), ((443, 471), 'numpy.savez', 'np.savez', (['filename', '*weights'], {}), '(filename, *weights)\n', (451, 471), True, 'import numpy as np\n'), ((529, 546), 'numpy.load', 'np.load', (...
# -*- coding: utf-8 -*- import os, sys, pdb import torch from torch.autograd import Variable import torch.nn.functional as F import torch.utils.data as data from torchvision import datasets, transforms import numpy as np import cv2, copy, time import matplotlib.pyplot as plt from scipy.ndimage import binary_fill_hol...
[ "skimage.morphology.remove_small_objects", "copy.deepcopy", "numpy.ones", "loader.PatchDataset", "scipy.ndimage.binary_fill_holes", "numpy.floor", "cv2.contourArea", "numpy.argsort", "numpy.zeros", "torch.utils.data.DataLoader", "cv2.findContours", "torch.no_grad", "skimage.transform.resize"...
[((661, 686), 'scipy.ndimage.binary_fill_holes', 'binary_fill_holes', (['binary'], {}), '(binary)\n', (678, 686), False, 'from scipy.ndimage import binary_fill_holes, binary_closing, binary_dilation\n'), ((734, 797), 'skimage.morphology.remove_small_objects', 'remove_small_objects', (['binary'], {'min_size': 'min_size'...
import os import subprocess from inspect import isclass import configargparse import numpy as np import sqlalchemy import yaml from IPython import embed from angular_solver import solve from database import Config, ConfigHolder, Graph, Task, get_session, DatabaseGraphGenome from genetic_algorithm import (GeneticAlgo...
[ "database.ConfigHolder.fromNamespace", "database.Task", "genetic_algorithm.SaveCallback", "database.DatabaseGraphGenome.generation.desc", "configargparse.Parser", "database.get_session", "genetic_algorithm.GeneticAlgorithm", "IPython.embed", "database.ConfigHolder", "numpy.zeros", "configargpars...
[((5499, 5525), 'configargparse.Namespace', 'configargparse.Namespace', ([], {}), '()\n', (5523, 5525), False, 'import configargparse\n'), ((5562, 5585), 'configargparse.Parser', 'configargparse.Parser', ([], {}), '()\n', (5583, 5585), False, 'import configargparse\n'), ((5846, 5878), 'database.get_session', 'get_sessi...
from __future__ import print_function, division import os import sys import pytest import warnings import numpy from galpy.util import galpyWarning from test_actionAngle import reset_warning_registry _TRAVIS= bool(os.getenv('TRAVIS')) PY2= sys.version < '3' # Print all galpyWarnings always for tests of warnings warning...
[ "galpy.actionAngle.actionAngleTorus", "numpy.array", "galpy.potential.IsochronePotential", "galpy.potential.interpRZPotential", "galpy.potential.PowerSphericalPotential", "test_potential.BurkertPotentialNoC", "galpy.potential.JaffePotential", "galpy.actionAngle.actionAngleStaeckel", "numpy.linspace"...
[((313, 358), 'warnings.simplefilter', 'warnings.simplefilter', (['"""always"""', 'galpyWarning'], {}), "('always', galpyWarning)\n", (334, 358), False, 'import warnings\n'), ((214, 233), 'os.getenv', 'os.getenv', (['"""TRAVIS"""'], {}), "('TRAVIS')\n", (223, 233), False, 'import os\n'), ((689, 722), 'galpy.actionAngle...
import numpy as np from scipy import ndimage __all__ = ['gabor_kernel', 'gabor_filter'] def _sigma_prefactor(bandwidth): b = bandwidth # See http://www.cs.rug.nl/~imaging/simplecell.html return 1.0 / np.pi * np.sqrt(np.log(2)/2.0) * (2.0**b + 1) / (2.0**b - 1) def gabor_kernel(frequency, theta=0, band...
[ "numpy.log", "numpy.exp", "numpy.real", "numpy.zeros", "numpy.cos", "numpy.sin", "numpy.imag" ]
[((2221, 2256), 'numpy.zeros', 'np.zeros', (['y.shape'], {'dtype': 'np.complex'}), '(y.shape, dtype=np.complex)\n', (2229, 2256), True, 'import numpy as np\n'), ((2268, 2336), 'numpy.exp', 'np.exp', (['(-0.5 * (rotx ** 2 / sigma_x ** 2 + roty ** 2 / sigma_y ** 2))'], {}), '(-0.5 * (rotx ** 2 / sigma_x ** 2 + roty ** 2 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # connectivity.py # definitions of connectivity characters import math import warnings import networkx as nx import numpy as np from tqdm import tqdm __all__ = [ "node_degree", "meshedness", "mean_node_dist", "cds_length", "mean_node_degree", "pro...
[ "networkx.degree", "numpy.mean", "math.sqrt", "networkx.Graph", "networkx.ego_graph", "collections.Counter", "networkx.square_clustering", "networkx.closeness_centrality", "networkx.set_edge_attributes", "functools.partial", "networkx.set_node_attributes", "networkx.betweenness_centrality", ...
[((1223, 1265), 'networkx.set_node_attributes', 'nx.set_node_attributes', (['netx', 'degree', 'name'], {}), '(netx, degree, name)\n', (1245, 1265), True, 'import networkx as nx\n'), ((9377, 9404), 'collections.Counter', 'collections.Counter', (['values'], {}), '(values)\n', (9396, 9404), False, 'import collections\n'),...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "paddle.is_compiled_with_xpu", "paddle.is_compiled_with_rocm", "numpy.array", "numpy.split", "paddle.is_compiled_with_cuda", "paddle.is_compiled_with_npu" ]
[((3596, 3626), 'paddle.is_compiled_with_cuda', 'paddle.is_compiled_with_cuda', ([], {}), '()\n', (3624, 3626), False, 'import paddle\n'), ((5717, 5732), 'numpy.array', 'np.array', (['probs'], {}), '(probs)\n', (5725, 5732), True, 'import numpy as np\n'), ((3658, 3687), 'paddle.is_compiled_with_npu', 'paddle.is_compile...
import os from tqdm import tqdm from mmdet.apis import init_detector, inference_detector import numpy as np import torch import mmcv import cv2 import json import PIL testset_dir = '/home/xiekaiyu/ocr/dataset/ICDAR2019ArT/test_task13' output_dir = '/home/xiekaiyu/ocr/dataset/ICDAR2019ArT/output/preds' model_name = '...
[ "os.listdir", "PIL.Image.open", "numpy.where", "mmdet.apis.init_detector", "os.path.join", "cv2.findContours", "mmcv.concat_list", "numpy.vstack", "numpy.concatenate", "numpy.random.seed", "json.load", "numpy.full", "mmdet.apis.inference_detector", "torch.cuda.empty_cache", "json.dump" ]
[((518, 578), 'mmdet.apis.init_detector', 'init_detector', (['config_file', 'checkpoint_file'], {'device': '"""cuda:0"""'}), "(config_file, checkpoint_file, device='cuda:0')\n", (531, 578), False, 'from mmdet.apis import init_detector, inference_detector\n'), ((639, 662), 'os.listdir', 'os.listdir', (['testset_dir'], {...
#!/usr/bin/env python import rospy import cv2 import numpy as np from std_msgs.msg import String from sensor_msgs.msg import Image, CompressedImage from cv_bridge import CvBridge, CvBridgeError bridge = CvBridge() class ImageAverager: def __init__(self): self.publisher = rospy.Publisher("~topic_out", Imag...
[ "rospy.Subscriber", "rospy.init_node", "numpy.fromstring", "cv_bridge.CvBridge", "cv2.addWeighted", "rospy.spin", "cv2.imdecode", "rospy.Publisher" ]
[((204, 214), 'cv_bridge.CvBridge', 'CvBridge', ([], {}), '()\n', (212, 214), False, 'from cv_bridge import CvBridge, CvBridgeError\n'), ((1372, 1425), 'rospy.init_node', 'rospy.init_node', (['"""image_average_node"""'], {'anonymous': '(True)'}), "('image_average_node', anonymous=True)\n", (1387, 1425), False, 'import ...
from collections import defaultdict import numpy as np class MetricsAccumulator: def __init__(self) -> None: self.accumulator = defaultdict(lambda: []) def update_metric(self, metric_name, metric_value): self.accumulator[metric_name].append(metric_value) def print_average_metric(self): ...
[ "numpy.array", "collections.defaultdict" ]
[((143, 167), 'collections.defaultdict', 'defaultdict', (['(lambda : [])'], {}), '(lambda : [])\n', (154, 167), False, 'from collections import defaultdict\n'), ((390, 401), 'numpy.array', 'np.array', (['v'], {}), '(v)\n', (398, 401), True, 'import numpy as np\n')]
#! -*- coding:utf-8 -*- ''' @Author: ZM @Date and Time: 2020/12/15 20:27 @File: ToOneHot.py ''' import numpy as np class ToOneHot: def __init__(self, num_classes): self.num_classes = num_classes def __call__(self, data): data_size = data.size if data_size > 1: ...
[ "numpy.zeros", "numpy.arange" ]
[((335, 391), 'numpy.zeros', 'np.zeros', (['(data_size, self.num_classes)'], {'dtype': '"""float32"""'}), "((data_size, self.num_classes), dtype='float32')\n", (343, 391), True, 'import numpy as np\n'), ((481, 524), 'numpy.zeros', 'np.zeros', (['self.num_classes'], {'dtype': '"""float32"""'}), "(self.num_classes, dtype...
import contextlib import numbers import typing import numpy as np import pandas as pd from river import base from river import optim from river import utils __all__ = [ 'LinearRegression', 'LogisticRegression', 'Perceptron' ] class GLM: """Generalized Linear Model. This serves as a base class...
[ "numpy.clip", "river.utils.pretty.print_table", "river.optim.schedulers.Constant", "river.optim.SGD", "river.utils.VectorDict", "river.optim.losses.Log", "river.utils.math.clamp", "numpy.argsort", "river.optim.losses.Squared", "numpy.einsum", "river.optim.initializers.Zeros", "pandas.DataFrame...
[((865, 887), 'river.utils.VectorDict', 'utils.VectorDict', (['None'], {}), '(None)\n', (881, 887), False, 'from river import utils\n'), ((3188, 3251), 'numpy.clip', 'np.clip', (['loss_gradient', '(-self.clip_gradient)', 'self.clip_gradient'], {}), '(loss_gradient, -self.clip_gradient, self.clip_gradient)\n', (3195, 32...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
[ "logging.getLogger", "logging.StreamHandler", "logging.Formatter", "tensorflow.Session", "numpy.zeros" ]
[((6029, 6056), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (6046, 6056), False, 'import logging\n'), ((6156, 6232), 'logging.Formatter', 'logging.Formatter', ([], {'fmt': '"""%(asctime)s %(levelname)s %(filename)s: %(message)s"""'}), "(fmt='%(asctime)s %(levelname)s %(filename)s: %(me...
import sys import argparse import os import cv2 import yaml from PIL import Image from importlib.machinery import SourceFileLoader import torch from torch import nn from tqdm import tqdm import numpy as np import matplotlib.pyplot as plt import pandas import numpy __filedir__ = os.path.dirname(os.path.realpath(__file_...
[ "feature_graph.models.dtoid.network.Network", "PIL.Image.fromarray", "os.listdir", "pandas.read_csv", "numpy.where", "torch.load", "tqdm.tqdm", "os.path.join", "os.path.realpath", "numpy.stack", "torch.cat" ]
[((296, 322), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (312, 322), False, 'import os\n'), ((668, 692), 'feature_graph.models.dtoid.network.Network', 'network_module.Network', ([], {}), '()\n', (690, 692), True, 'import feature_graph.models.dtoid.network as network_module\n'), ((860, 9...
import os import random import numpy as np import tensorflow as tf random.seed(1234) def load_or_initialize_model(sess, saver, model_name, model_path): sess.run(tf.global_variables_initializer()) if os.path.isfile(model_path+model_name+'/'+model_name+'.ckpt.meta'): saver.restore(sess, model_path+mo...
[ "numpy.mean", "random.choice", "random.shuffle", "os.makedirs", "random.seed", "os.path.isfile", "tensorflow.global_variables_initializer", "numpy.array", "os.path.isdir" ]
[((69, 86), 'random.seed', 'random.seed', (['(1234)'], {}), '(1234)\n', (80, 86), False, 'import random\n'), ((212, 285), 'os.path.isfile', 'os.path.isfile', (["(model_path + model_name + '/' + model_name + '.ckpt.meta')"], {}), "(model_path + model_name + '/' + model_name + '.ckpt.meta')\n", (226, 285), False, 'import...
import numpy as np def class_count(data_holder): unique, counts = np.unique(data_holder.target, return_counts=True) return unique, counts
[ "numpy.unique" ]
[((71, 120), 'numpy.unique', 'np.unique', (['data_holder.target'], {'return_counts': '(True)'}), '(data_holder.target, return_counts=True)\n', (80, 120), True, 'import numpy as np\n')]
from collections import namedtuple import jax.numpy as jnp import pytest from numpy.testing import assert_allclose from numpyro.infer.einstein.kernels import ( RBFKernel, RandomFeatureKernel, GraphicalKernel, IMQKernel, LinearKernel, MixtureKernel, HessianPrecondMatrix, PrecondMatrixKe...
[ "collections.namedtuple", "numpyro.infer.einstein.kernels.RBFKernel", "numpy.testing.assert_allclose", "jax.numpy.array", "pytest.mark.parametrize", "numpyro.infer.einstein.kernels.HessianPrecondMatrix" ]
[((332, 409), 'collections.namedtuple', 'namedtuple', (['"""TestSteinKernel"""', "['kernel', 'particle_info', 'loss_fn', 'kval']"], {}), "('TestSteinKernel', ['kernel', 'particle_info', 'loss_fn', 'kval'])\n", (342, 409), False, 'from collections import namedtuple\n'), ((426, 487), 'jax.numpy.array', 'jnp.array', (['[[...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 5 13:38:43 2022 @author: Dartoon """ import numpy as np from scipy import ndimage import scipy.optimize as op from galight.tools.astro_tools import plt_fits import matplotlib.pyplot as plt def shift_img(img, shift_pix, order=1): shift_pix = s...
[ "scipy.ndimage.interpolation.shift", "numpy.flip", "numpy.intc", "numpy.sqrt", "galight.tools.measure_tools.detect_obj", "galight.tools.measure_tools.mask_obj", "scipy.optimize.minimize", "numpy.asarray", "numpy.sum", "galight.tools.astro_tools.plt_fits", "numpy.around", "numpy.zeros_like" ]
[((432, 466), 'scipy.ndimage.interpolation.shift', 'shift', (['img', 'shift_pix'], {'order': 'order'}), '(img, shift_pix, order=order)\n', (437, 466), False, 'from scipy.ndimage.interpolation import shift\n'), ((663, 678), 'numpy.flip', 'np.flip', (['shift_'], {}), '(shift_)\n', (670, 678), True, 'import numpy as np\n'...
""" Tests for error conditions. """ import unittest import tempfile import os import platform import struct import numpy as np import kastore as kas import kastore.store as store IS_WINDOWS = platform.system() == "Windows" class InterfaceMixin(object): """ Exercise the low-level interface. """ def ...
[ "os.path.getsize", "kastore.store.write_file", "os.close", "kastore.dump", "kastore.load", "struct.pack", "os.rmdir", "platform.system", "numpy.zeros", "tempfile.mkdtemp", "os.unlink", "kastore.store.pack_items", "tempfile.mkstemp", "numpy.arange" ]
[((195, 212), 'platform.system', 'platform.system', ([], {}), '()\n', (210, 212), False, 'import platform\n'), ((352, 394), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {'prefix': '"""kas_test_errors"""'}), "(prefix='kas_test_errors')\n", (368, 394), False, 'import tempfile\n'), ((403, 415), 'os.close', 'os.close', (['...
import yaml import numpy as np from os import path from absl import flags from pysc2.env import sc2_env from pysc2.lib import features from pysc2.lib import actions sc2_f_path = path.abspath(path.join(path.dirname(__file__), "..", "configs", "sc2_config.yml")) with open(sc2_f_path, 'r') as ymlfile: sc2_cfg = yam...
[ "numpy.intersect1d", "pysc2.lib.actions.FunctionCall", "pysc2.env.sc2_env.SC2Env", "numpy.asarray", "yaml.load", "numpy.log", "os.path.dirname", "numpy.array", "numpy.zeros", "numpy.concatenate", "numpy.expand_dims" ]
[((317, 335), 'yaml.load', 'yaml.load', (['ymlfile'], {}), '(ymlfile)\n', (326, 335), False, 'import yaml\n'), ((788, 1000), 'pysc2.env.sc2_env.SC2Env', 'sc2_env.SC2Env', ([], {'map_name': 'map_name', 'step_mul': "sc2_cfg[mode]['step_mul']", 'screen_size_px': "((sc2_cfg[mode]['resl'],) * 2)", 'minimap_size_px': "((sc2_...
from utils.path import * from utils.audio.tools import get_mel from tqdm import tqdm import numpy as np import glob, os, sys from multiprocessing import Pool from scipy.io.wavfile import write import librosa, ffmpeg from sklearn.preprocessing import StandardScaler def job(wav_filename): original_wav_filename, prep...
[ "os.path.exists", "ffmpeg.input", "sklearn.preprocessing.StandardScaler", "numpy.array", "utils.audio.tools.get_mel", "multiprocessing.Pool", "numpy.save" ]
[((971, 986), 'multiprocessing.Pool', 'Pool', (['n_workers'], {}), '(n_workers)\n', (975, 986), False, 'from multiprocessing import Pool\n'), ((1002, 1028), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {'copy': '(False)'}), '(copy=False)\n', (1016, 1028), False, 'from sklearn.preprocessing import Stan...
import numpy as np from PyNeuronToolbox.morphology import allsec_preorder def ez_record(h,var='v',sections=None,order=None,\ targ_names=None,cust_labels=None): """ Records state variables across segments Args: h = hocObject to interface with neuron var = string specifying sta...
[ "PyNeuronToolbox.morphology.allsec_preorder", "numpy.linspace" ]
[((1381, 1412), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(sec.nseg + 2)'], {}), '(0, 1, sec.nseg + 2)\n', (1392, 1412), True, 'import numpy as np\n'), ((1004, 1022), 'PyNeuronToolbox.morphology.allsec_preorder', 'allsec_preorder', (['h'], {}), '(h)\n', (1019, 1022), False, 'from PyNeuronToolbox.morphology impo...
import numpy as np from numpy.linalg import eig from scipy.linalg import fractional_matrix_power from sklearn.preprocessing import normalize from kmeans import KMeans class Spectral: def cluster(self, x, k, delta=2.): def dist(i, j): if i == j: return 0. return np.exp(-delta * np....
[ "kmeans.KMeans", "numpy.linalg.eig", "numpy.matmul", "sklearn.preprocessing.normalize", "scipy.linalg.fractional_matrix_power", "numpy.vectorize" ]
[((511, 543), 'scipy.linalg.fractional_matrix_power', 'fractional_matrix_power', (['D', '(-0.5)'], {}), '(D, -0.5)\n', (534, 543), False, 'from scipy.linalg import fractional_matrix_power\n'), ((627, 633), 'numpy.linalg.eig', 'eig', (['L'], {}), '(L)\n', (630, 633), False, 'from numpy.linalg import eig\n'), ((764, 795)...
import csv import io import tempfile import unittest from io import IOBase from collections import defaultdict import json import numpy as np from requests import Response from lightly.openapi_generated.swagger_client.models.datasource_processed_until_timestamp_response import DatasourceProcessedUntilTimestampResponse...
[ "lightly.openapi_generated.swagger_client.models.write_csv_url_data.WriteCSVUrlData", "lightly.openapi_generated.swagger_client.models.datasource_raw_samples_data.DatasourceRawSamplesData", "lightly.openapi_generated.swagger_client.api.mappings_api.MappingsApi.__init__", "lightly.openapi_generated.swagger_cli...
[((17020, 17030), 'requests.Response', 'Response', ([], {}), '()\n', (17028, 17030), False, 'from requests import Response\n'), ((3407, 3458), 'lightly.openapi_generated.swagger_client.api.embeddings_api.EmbeddingsApi.__init__', 'EmbeddingsApi.__init__', (['self'], {'api_client': 'api_client'}), '(self, api_client=api_...
#!/usr/bin/env python3 import matplotlib.pyplot as plt import numpy as np import os, sys if len( sys.argv ) < 2: print( "Please specify the folder containing the benchmark logs!" ) folder = sys.argv[1] suffix = '-full-first-read.log' benchmarkLogs = [ os.path.join( folder, file ) for file in os.listdir( folder ) ...
[ "numpy.mean", "os.listdir", "os.path.join", "numpy.max", "numpy.array", "matplotlib.pyplot.figure", "numpy.min", "matplotlib.pyplot.show" ]
[((1634, 1661), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 6)'}), '(figsize=(10, 6))\n', (1644, 1661), True, 'import matplotlib.pyplot as plt\n'), ((2475, 2485), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2483, 2485), True, 'import matplotlib.pyplot as plt\n'), ((258, 284), 'os.path....
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from builtins import * from future.utils import iteritems import numpy as np from pandas import DataFrame, Series import scipy.sparse as sparse from sqlalchemy.sql import...
[ "pandas.Series", "sqlalchemy.sql.bindparam", "pandas.DataFrame", "sqlalchemy.sql.select", "scipy.sparse.issparse", "numpy.array", "numpy.zeros", "numpy.vstack", "numpy.ravel", "numpy.arange" ]
[((24435, 24460), 'numpy.ravel', 'np.ravel', (['marginals[:, 1]'], {}), '(marginals[:, 1])\n', (24443, 24460), True, 'import numpy as np\n'), ((20898, 20917), 'numpy.array', 'np.array', (['marginals'], {}), '(marginals)\n', (20906, 20917), True, 'import numpy as np\n'), ((21102, 21139), 'numpy.vstack', 'np.vstack', (['...
""" Class to construct parabolas from 3 points. ADW: Need to move all of the plotting stuff """ import numpy import scipy.stats import scipy.interpolate ############################################################ class Parabola: def __init__(self, x, y): """ INPUTS x = variable of inte...
[ "numpy.allclose", "numpy.sqrt", "numpy.argmax", "numpy.min", "numpy.max", "numpy.argsort", "numpy.array", "numpy.linspace", "numpy.linalg.inv", "numpy.concatenate", "numpy.nonzero", "numpy.argmin", "numpy.cumsum", "numpy.matrix" ]
[((9052, 9092), 'numpy.linspace', 'numpy.linspace', (['ts_min', 'ts_max', 'ts_steps'], {}), '(ts_min, ts_max, ts_steps)\n', (9066, 9092), False, 'import numpy\n'), ((413, 429), 'numpy.argsort', 'numpy.argsort', (['x'], {}), '(x)\n', (426, 429), False, 'import numpy\n'), ((529, 549), 'numpy.argmax', 'numpy.argmax', (['s...
import numpy as np from numpy.random import rand from numpy import * from pathlib import Path import csv # activation function? if we'd use ReLU with grayscale images the value stays # the same # This script creates a .csv file in the work directory # containing integer numbers in the following form # Input X : x1, ...
[ "csv.writer", "numpy.random.rand" ]
[((1691, 1710), 'csv.writer', 'csv.writer', (['csvFile'], {}), '(csvFile)\n', (1701, 1710), False, 'import csv\n'), ((1109, 1130), 'numpy.random.rand', 'rand', (['(1)', 'N_inputlayer'], {}), '(1, N_inputlayer)\n', (1113, 1130), False, 'from numpy.random import rand\n'), ((1188, 1221), 'numpy.random.rand', 'rand', (['N_...
from keras.utils import to_categorical from keras.models import load_model import matplotlib.pyplot as plt '''lib loading error prevention''' import os os.environ['KMP_DUPLICATE_LIB_OK']='True' '''========================''' '''tensorflow configuration''' '''========================''' import tensorflow as tf from k...
[ "keras.models.load_model", "tensorflow.Session", "matplotlib.pyplot.plot", "keras.backend.set_session", "numpy.argmax", "keras.utils.to_categorical", "numpy.array", "tensorflow.ConfigProto", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((395, 571), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'intra_op_parallelism_threads': 'num_cores', 'inter_op_parallelism_threads': 'num_cores', 'allow_soft_placement': '(True)', 'device_count': "{'CPU': num_CPU, 'GPU': num_GPU}"}), "(intra_op_parallelism_threads=num_cores,\n inter_op_parallelism_threads=nu...
"""1. Calculate Cp from LES data different wind farm "extractability" 2. Predict Cp using two scale momentum theory 3. Plot results """ import numpy as np import scipy.optimize as sp import matplotlib.pyplot as plt #wind farm parameters #momentum `extractability' factor zeta=[0,5,10,15,20,25] #bottom friction exponen...
[ "scipy.optimize.bisect", "matplotlib.pyplot.savefig", "numpy.sqrt", "numpy.delete", "numpy.zeros", "numpy.linspace", "matplotlib.pyplot.tight_layout", "numpy.genfromtxt", "matplotlib.pyplot.subplots" ]
[((367, 384), 'numpy.zeros', 'np.zeros', (['(50, 6)'], {}), '((50, 6))\n', (375, 384), True, 'import numpy as np\n'), ((407, 419), 'numpy.zeros', 'np.zeros', (['(50)'], {}), '(50)\n', (415, 419), True, 'import numpy as np\n'), ((433, 450), 'numpy.zeros', 'np.zeros', (['(50, 6)'], {}), '((50, 6))\n', (441, 450), True, '...
import numpy as np import pdb class History: def __init__(self, data_format, batch_size, history_length, screen_dims): self.data_format = data_format self.history = np.zeros([history_length] + list(screen_dims), dtype=np.float32) def add(self, screen): self.history[:-1] = self.history[1:] self...
[ "numpy.transpose" ]
[((483, 520), 'numpy.transpose', 'np.transpose', (['self.history', '(1, 2, 0)'], {}), '(self.history, (1, 2, 0))\n', (495, 520), True, 'import numpy as np\n')]
""" This modules performs spectral analysis of EEG signals (sometimes refered as quantitative EEG) on a mne object. EEG Sleep EEG is ideally suited to frequency and time-frequency analysis, since different stages or micro-elements (such as spindles, K-complexes, slow waves) have specific frequency characteristics [1]. ...
[ "numpy.hstack", "psga.features.time_features.compute_maximum_value_epochs", "numpy.log", "numpy.column_stack", "psga.features.utils.power_spectrum", "numpy.arange", "numpy.asarray", "psga.features.time_features.compute_zero_crossings", "pandas.DataFrame.from_dict", "psga.features.utils._psd_params...
[((14328, 14395), 'numpy.asarray', 'np.asarray', (["(Stages['onset'].values * raw.info['sfreq'])"], {'dtype': '"""int"""'}), "(Stages['onset'].values * raw.info['sfreq'], dtype='int')\n", (14338, 14395), True, 'import numpy as np\n'), ((14406, 14476), 'numpy.asarray', 'np.asarray', (["(Stages['duration'].values * raw.i...
# -*- coding: utf-8 -*- import numpy as np from numpy import ndarray from numba import njit, prange __cache = True @njit(nogil=True, cache=__cache) def shape_function_values(x, L): """ Evaluates the shape functions at a point x in the range [-1, 1]. """ return np.array([ [ 0.5 * x ...
[ "numpy.array", "numpy.zeros", "numba.njit", "numba.prange" ]
[((118, 149), 'numba.njit', 'njit', ([], {'nogil': '(True)', 'cache': '__cache'}), '(nogil=True, cache=__cache)\n', (122, 149), False, 'from numba import njit, prange\n'), ((1148, 1179), 'numba.njit', 'njit', ([], {'nogil': '(True)', 'cache': '__cache'}), '(nogil=True, cache=__cache)\n', (1152, 1179), False, 'from numb...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = '<NAME>' import warnings from random import shuffle from time import time import numpy as np import pandas as pd import xgboost as xgb from xgboost.callback import reset_learning_rate import lightgbm as lgb from catboost import Pool, CatBoostClassifier from it...
[ "lightgbm.train", "gbm_utils.get_one_hot_data", "lightgbm.Dataset", "catboost.CatBoostClassifier", "xgboost.DMatrix", "pandas.HDFStore", "gbm_utils.get_holdout_set", "gbm_utils.factorize_cats", "pandas.set_option", "numpy.exp", "numpy.random.seed", "gbm_utils.OneStepTimeSeriesSplit", "pandas...
[((561, 610), 'pandas.set_option', 'pd.set_option', (['"""display.expand_frame_repr"""', '(False)'], {}), "('display.expand_frame_repr', False)\n", (574, 610), True, 'import pandas as pd\n'), ((611, 644), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (634, 644), False, 'i...
import paddle import paddle.fluid as fluid from paddle.fluid.contrib import sparsity import numpy as np paddle.enable_static() def main(): train_program = fluid.Program() startup_prog = fluid.Program() with fluid.program_guard(train_program, startup_prog): input_data = fluid.layers.data( ...
[ "paddle.fluid.DataFeeder", "paddle.fluid.contrib.sparsity.create_mask", "paddle.fluid.Program", "numpy.multiply", "paddle.fluid.contrib.sparsity.check_mask_2d", "paddle.fluid.layers.fc", "paddle.fluid.contrib.sparsity.ASPHelper.replace_dense_to_sparse_op", "paddle.fluid.global_scope", "paddle.fluid....
[((105, 127), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (125, 127), False, 'import paddle\n'), ((161, 176), 'paddle.fluid.Program', 'fluid.Program', ([], {}), '()\n', (174, 176), True, 'import paddle.fluid as fluid\n'), ((196, 211), 'paddle.fluid.Program', 'fluid.Program', ([], {}), '()\n', (209...
from unittest import TestCase import numpy as np from athena import NonlinearLevelSet, ForwardNet, BackwardNet, Normalizer import torch import os from contextlib import contextmanager import matplotlib.pyplot as plt @contextmanager def assert_plot_figures_added(): """ Assert that the number of figures is high...
[ "os.path.exists", "torch.as_tensor", "athena.ForwardNet", "numpy.ones", "athena.NonlinearLevelSet", "matplotlib.pyplot.gcf", "athena.BackwardNet", "athena.Normalizer", "numpy.loadtxt" ]
[((1052, 1095), 'torch.as_tensor', 'torch.as_tensor', (['inputs'], {'dtype': 'torch.double'}), '(inputs, dtype=torch.double)\n', (1067, 1095), False, 'import torch\n'), ((1109, 1155), 'torch.as_tensor', 'torch.as_tensor', (['grad_lift'], {'dtype': 'torch.double'}), '(grad_lift, dtype=torch.double)\n', (1124, 1155), Fal...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "numpy.clip", "ldif.util.path_util.gaps_path", "ldif.representation.structured_implicit_function.get_effective_element_count", "tensorflow.linalg.inv", "ldif.inference.extract_mesh.marching_cubes", "tensorflow.gradients", "ldif.util.file_util.log.verbose", "numpy.arange", "numpy.reshape", "tensorf...
[((1619, 1649), 'importlib.reload', 'importlib.reload', (['extract_mesh'], {}), '(extract_mesh)\n', (1635, 1649), False, 'import importlib\n'), ((1650, 1696), 'importlib.reload', 'importlib.reload', (['structured_implicit_function'], {}), '(structured_implicit_function)\n', (1666, 1696), False, 'import importlib\n'), (...
import os import sys import bokeh.layouts as bkl import bokeh.palettes import bokeh.plotting as bkp import numpy as np # make it so we can import models/etc from parent folder sys.path.insert(1, os.path.join(sys.path[0], '../common')) from plotting import * fig_err_g = bkp.figure(y_axis_type='log', x_axis_type='log'...
[ "bokeh.plotting.figure", "os.path.join", "bokeh.layouts.gridplot", "numpy.random.randint", "numpy.percentile", "numpy.load" ]
[((273, 434), 'bokeh.plotting.figure', 'bkp.figure', ([], {'y_axis_type': '"""log"""', 'x_axis_type': '"""log"""', 'y_axis_label': '"""Error"""', 'x_axis_label': '"""Coreset Construction Iterations"""', 'plot_width': '(1250)', 'plot_height': '(1250)'}), "(y_axis_type='log', x_axis_type='log', y_axis_label='Error',\n ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Various tools for calculating statistics """ #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- from __future__ import absolute_import, division, pri...
[ "numpy.insert", "pygeostat.z_percentile", "numpy.reshape", "numpy.ones", "scipy.stats.rankdata", "numpy.average", "rpy2.robjects.r.toString", "rpy2.robjects.packages.importr", "rpy2.robjects.r.matrix", "numpy.array", "numpy.var", "numpy.concatenate", "pandas.DataFrame", "pygeostat.cdf", ...
[((619, 647), 'numpy.average', 'np.average', (['var'], {'weights': 'wts'}), '(var, weights=wts)\n', (629, 647), True, 'import numpy as np\n'), ((1749, 1760), 'scipy.stats.rankdata', 'rankdata', (['x'], {}), '(x)\n', (1757, 1760), False, 'from scipy.stats import rankdata\n'), ((1769, 1780), 'scipy.stats.rankdata', 'rank...
import gym from gym import error, spaces, utils import numpy as np from gym.utils import seeding from ctypes import * raisim_dll = CDLL("../gym_learn_wbc/envs/raisim_dll/build/libstoch3_raisim.so") def init_raisim_dll_functions(): raisim_dll._sim.restype = None raisim_dll._sim.argtypes = [c_double*10,c_long,c_double...
[ "numpy.clip", "numpy.abs", "numpy.absolute", "gym.spaces.Box", "numpy.exp", "numpy.array" ]
[((1290, 1351), 'numpy.abs', 'np.abs', (['(self.target_velocity[0] - self.avg_velocity_limits[0])'], {}), '(self.target_velocity[0] - self.avg_velocity_limits[0])\n', (1296, 1351), True, 'import numpy as np\n'), ((1367, 1428), 'numpy.abs', 'np.abs', (['(self.target_velocity[0] - self.avg_velocity_limits[1])'], {}), '(s...
"""Core functionality for foamPy.""" from __future__ import division, print_function import numpy as np import os import re import datetime import sys import time import subprocess import pandas import glob from .dictionaries import * from .templates import * def gen_stripped_lines(fpath): with open(fpath) as f:...
[ "time.sleep", "numpy.array", "numpy.sin", "datetime.timedelta", "os.listdir", "numpy.asarray", "numpy.linspace", "subprocess.call", "pandas.DataFrame", "glob.glob", "numpy.trapz", "os.path.isfile", "numpy.interp", "re.findall", "pandas.Series", "os.path.join", "os.getcwd", "os.chdi...
[((776, 794), 'pandas.DataFrame', 'pandas.DataFrame', ([], {}), '()\n', (792, 794), False, 'import pandas\n'), ((2130, 2165), 're.findall', 're.findall', (['"""# Probe \\\\d.*\\\\n"""', 'txt'], {}), "('# Probe \\\\d.*\\\\n', txt)\n", (2140, 2165), False, 'import re\n'), ((2341, 2359), 'pandas.DataFrame', 'pandas.DataFr...
import torch import torch_geometric #torch_geometric == 2.5 import community import numpy as np import networkx import argparse from torch_geometric.datasets import TUDataset from torch_geometric.data import DataLoader from torch_geometric.data import Batch from Sign_OPT import * import torch_geometric.transforms as T ...
[ "numpy.abs", "torch_geometric.datasets.TUDataset", "argparse.ArgumentParser", "torch.load", "torch.tensor", "torch.cuda.is_available", "torch.save", "Gin.GIN", "torch_geometric.transforms.Constant", "time.time", "torch.device" ]
[((393, 495), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Pytorch graph isomorphism network for graph classification"""'}), "(description=\n 'Pytorch graph isomorphism network for graph classification')\n", (416, 495), False, 'import argparse\n'), ((6121, 6191), 'torch.save', 'torc...
import h5py import os, sys, glob import numpy as np import plotly.offline as offline from preprocessing import analysis_pp from analysis.general_utils import aqua_utils, saving_utils, plotly_utils, general_utils, compare_astro_utils, correlation_utils, stat_utils from scipy.stats.stats import power_divergence from scip...
[ "analysis.general_utils.compare_astro_utils.get_fake_astrocyte_sample_from_areas", "analysis.general_utils.saving_utils.save_pickle", "analysis.general_utils.plotly_utils.apply_fun_axis_fig", "analysis.general_utils.aqua_utils.get_event_subsets", "analysis.general_utils.plotly_utils.plot_point_box_revised",...
[((9180, 9222), 'os.path.join', 'os.path.join', (['output_folder', 'experiment_id'], {}), '(output_folder, experiment_id)\n', (9192, 9222), False, 'import os, sys, glob\n'), ((10663, 10730), 'os.path.join', 'os.path.join', (['output_experiment_path', '"""plots"""', '"""behaviour_heatmaps"""'], {}), "(output_experiment_...
#!/usr/bin/env python3 import argparse import asyncio import os import sys import discord import numpy as np import sounddevice as sd class SoundDeviceSource(discord.AudioSource): def __init__(self, device): self.stream = sd.InputStream(samplerate=48000, channels=1, ...
[ "sounddevice.InputStream", "numpy.repeat", "argparse.ArgumentParser", "os.environ.get", "sounddevice.query_devices", "sys.exit", "asyncio.get_running_loop" ]
[((3713, 3813), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Patch a pair of audio devices to a Discord voice channel"""'}), "(description=\n 'Patch a pair of audio devices to a Discord voice channel')\n", (3736, 3813), False, 'import argparse\n'), ((238, 331), 'sounddevice.InputStr...
from collections import Mapping, Iterable import copy as copy_ import numpy as np import datetime as dt from . import misc def select_var(d, name, sel): var_dims = list(d['.'][name]['.dims']) d['.'][name]['.dims'] = var_dims for key, value in sel.items(): if isinstance(value, Mapping): if len(sel) > 1: raise V...
[ "datetime.datetime.strptime", "numpy.take", "numpy.stack", "numpy.array", "numpy.empty", "numpy.concatenate", "copy.deepcopy", "numpy.nonzero" ]
[((2638, 2659), 'copy.deepcopy', 'copy_.deepcopy', (['meta0'], {}), '(meta0)\n', (2652, 2659), True, 'import copy as copy_\n'), ((4084, 4106), 'copy.deepcopy', 'copy_.deepcopy', (["d['.']"], {}), "(d['.'])\n", (4098, 4106), True, 'import copy as copy_\n'), ((1785, 1799), 'numpy.array', 'np.array', (['data'], {}), '(dat...
import os import pandas as pd import csv import pickle import numpy as np import torch import argparse def write_answer_to_file(answer, args): if not os.path.exists(args.output): os.mkdir(args.output) file_path = os.path.join(args.output, "subtask2.csv") # turn to Int answer = answer.astype(int) ...
[ "os.path.exists", "argparse.ArgumentParser", "os.path.join", "pickle.load", "torch.tensor", "os.mkdir", "pandas.DataFrame", "os.system", "numpy.zeros_like" ]
[((225, 266), 'os.path.join', 'os.path.join', (['args.output', '"""subtask2.csv"""'], {}), "(args.output, 'subtask2.csv')\n", (237, 266), False, 'import os\n'), ((814, 848), 'numpy.zeros_like', 'np.zeros_like', (["answer[0]['answer']"], {}), "(answer[0]['answer'])\n", (827, 848), True, 'import numpy as np\n'), ((1052, ...
# -*- coding: utf-8 -*- """ Created on Thu May 20 15:49:11 2021 @author: ANalundasan DTC - Categorical Naive Bayes """ from sklearn.naive_bayes import GaussianNB import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.naive_bayes import CategoricalNB from ...
[ "numpy.abs", "pandas.read_csv", "sklearn.naive_bayes.CategoricalNB", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((448, 510), 'pandas.read_csv', 'pd.read_csv', (['"""raw_data_numerical_target_features.csv"""'], {'sep': '""","""'}), "('raw_data_numerical_target_features.csv', sep=',')\n", (459, 510), True, 'import pandas as pd\n'), ((656, 693), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'Y'], {'test_si...
""" Color palette choices ===================== """ import numpy as np import seaborn as sns import matplotlib.pyplot as plt sns.set(style="white", context="talk") rs = np.random.RandomState(7) x = np.array(list("ABCDEFGHI")) f, (ax1, ax2, ax3) = plt.subplots(3, 1, figsize=(8, 6), sharex=True) y1 = np.arange(1, 10)...
[ "matplotlib.pyplot.setp", "seaborn.set", "seaborn.despine", "numpy.arange", "matplotlib.pyplot.tight_layout", "seaborn.barplot", "matplotlib.pyplot.subplots", "numpy.random.RandomState" ]
[((126, 164), 'seaborn.set', 'sns.set', ([], {'style': '"""white"""', 'context': '"""talk"""'}), "(style='white', context='talk')\n", (133, 164), True, 'import seaborn as sns\n'), ((170, 194), 'numpy.random.RandomState', 'np.random.RandomState', (['(7)'], {}), '(7)\n', (191, 194), True, 'import numpy as np\n'), ((250, ...
import numpy as np import io from PIL import Image import tensorflow as tf from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing.image import img_to_array import matplotlib.pyplot as plt from flask import Flask,render_template,redirect,url_for,request import urllib3 from tensorflow.keras.p...
[ "tensorflow.keras.preprocessing.image.load_img", "matplotlib.pyplot.imshow", "flask.Flask", "os.path.join", "os.getcwd", "tensorflow.keras.models.load_model", "numpy.expand_dims", "matplotlib.pyplot.axis", "tensorflow.keras.preprocessing.image.img_to_array", "matplotlib.pyplot.show" ]
[((364, 379), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (369, 379), False, 'from flask import Flask, render_template, redirect, url_for, request\n'), ((389, 412), 'tensorflow.keras.models.load_model', 'load_model', (['"""shape2.h5"""'], {}), "('shape2.h5')\n", (399, 412), False, 'from tensorflow.keras...
from collections import defaultdict import matplotlib.pyplot as plt import numpy as np import pandas as pd import random from sklearn.decomposition import PCA from sklearn.manifold import TSNE import scipy import scipy.spatial.distance from scipy.stats import spearmanr import torch import utils __author__...
[ "numpy.log", "numpy.array", "scipy.spatial.distance.cosine", "sklearn.decomposition.PCA", "torch.mean", "sklearn.manifold.TSNE", "numpy.dot", "pandas.DataFrame", "scipy.stats.spearmanr", "numpy.isinf", "numpy.maximum", "matplotlib.pyplot.savefig", "numpy.outer", "numpy.linalg.svd", "matp...
[((417, 455), 'scipy.spatial.distance.euclidean', 'scipy.spatial.distance.euclidean', (['u', 'v'], {}), '(u, v)\n', (449, 455), False, 'import scipy\n'), ((606, 641), 'scipy.spatial.distance.cosine', 'scipy.spatial.distance.cosine', (['u', 'v'], {}), '(u, v)\n', (635, 641), False, 'import scipy\n'), ((2434, 2458), 'num...
import os, sys from os import system import tensorflow as tf import numpy as np np.set_printoptions(threshold=sys.maxsize) ############################################################################## ############################################################################## ## System Paths ## path ...
[ "tensorflow.get_variable", "sys.exit", "os.listdir", "tensorflow.placeholder", "tensorflow.Session", "tensorflow.concat", "tensorflow.layers.dropout", "tensorflow.matmul", "tensorflow.square", "tensorflow.ConfigProto", "tensorflow.train.AdamOptimizer", "tensorflow.nn.conv2d", "tensorflow.var...
[((81, 123), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'sys.maxsize'}), '(threshold=sys.maxsize)\n', (100, 123), True, 'import numpy as np\n'), ((6996, 7012), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (7010, 7012), True, 'import tensorflow as tf\n'), ((4940, 4983), 'numpy.z...
import numpy as np from scipy.stats import norm def make_grid(xx, yy): """ Returns two n-by-n matrices. The first one contains all the x values and the second all the y values of a cartesian product between `xx` and `yy`. """ n = len(xx) xx, yy = np.meshgrid(xx, yy) grid = np.array([xx.r...
[ "numpy.meshgrid", "numpy.log", "scipy.stats.norm.pdf", "numpy.sum" ]
[((275, 294), 'numpy.meshgrid', 'np.meshgrid', (['xx', 'yy'], {}), '(xx, yy)\n', (286, 294), True, 'import numpy as np\n'), ((673, 747), 'scipy.stats.norm.pdf', 'norm.pdf', (['yy[:, None, None]'], {'loc': 'mus[None, :, :]', 'scale': 'sigmas[None, :, :]'}), '(yy[:, None, None], loc=mus[None, :, :], scale=sigmas[None, :,...
#import torch.nn as nn import torch from torch.nn import functional as F #from PIL import Image import numpy as np import pandas as pd #import os import os.path as osp import shutil #import math def save_checkpoint(state,best_pred, epoch,is_best,checkpoint_path,filename='./checkpoint/checkpoint.pth.tar'): torch.sa...
[ "numpy.histogram", "torch.max", "numpy.asarray", "torch.sigmoid", "numpy.equal", "numpy.stack", "numpy.sum", "numpy.array", "torch.save", "numpy.all", "torch.argmax" ]
[((312, 339), 'torch.save', 'torch.save', (['state', 'filename'], {}), '(state, filename)\n', (322, 339), False, 'import torch\n'), ((1371, 1402), 'numpy.stack', 'np.stack', (['semantic_map'], {'axis': '(-1)'}), '(semantic_map, axis=-1)\n', (1379, 1402), True, 'import numpy as np\n'), ((4205, 4223), 'numpy.sum', 'np.su...
import json import math import multiprocessing import os import tempfile from pathlib import Path import gym import numpy as np import pandas as pd from ray import tune from ray.rllib.models import ModelCatalog from ray.rllib.utils import try_import_tf from examples.rllib_agent import TrainingModel from smarts.core.a...
[ "tempfile.TemporaryDirectory", "smarts.core.agent_interface.AgentInterface.from_type", "json.loads", "smarts.env.custom_observations.lane_ttc_observation_adapter.transform", "pathlib.Path", "ray.rllib.models.ModelCatalog.get_preprocessor_for_space", "os.path.join", "math.sqrt", "pandas.DataFrame.fro...
[((562, 577), 'ray.rllib.utils.try_import_tf', 'try_import_tf', ([], {}), '()\n', (575, 577), False, 'from ray.rllib.utils import try_import_tf\n'), ((1718, 1773), 'smarts.env.custom_observations.lane_ttc_observation_adapter.transform', 'lane_ttc_observation_adapter.transform', (['env_observation'], {}), '(env_observat...
""" MIT License Copyright (c) 2017 s0hvaperuna 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, d...
[ "logging.getLogger", "utils.utilities.get_image", "bot.bot.command", "PIL.Image.new", "bot.bot.bot_has_permissions", "io.BytesIO", "sys.exc_info", "utils.imagetools.create_shadow", "numpy.sin", "utils.imagetools.get_color", "collections.OrderedDict.fromkeys", "utils.utilities.get_picture_from_...
[((2206, 2235), 'logging.getLogger', 'logging.getLogger', (['"""terminal"""'], {}), "('terminal')\n", (2223, 2235), False, 'import logging\n'), ((8207, 8233), 'bot.bot.command', 'command', ([], {'aliases': "['stand']"}), "(aliases=['stand'])\n", (8214, 8233), False, 'from bot.bot import command, cooldown, bot_has_permi...
# -*- coding: utf-8 -*- """ Created on Sun Jul 30 09:08:26 2017 @author: hp """ ''' SeriousDlqin2yrsY/N超过90天或更糟的逾期拖欠 RevolvingUtilizationOfUnsecuredLines 无担保放款的循环利用:除了不动产和像车贷那样除以信用额度总和的无分期付款债务的信用卡和个人信用额度总额 NumberOfTime30-59DaysPastDueNotWorse35-59天逾期但不糟糕次数 DebtRatio负债比率 NumberOfOpenCreditLinesAndLoans 开放式信贷和贷款数量,开放式贷款...
[ "pandas.read_csv", "matplotlib.pyplot.ylabel", "sklearn.metrics.auc", "numpy.log", "sklearn.metrics.roc_auc_score", "sklearn.metrics.roc_curve", "numpy.arange", "numpy.mean", "scipy.interp", "pandas.qcut", "sklearn.cross_validation.cross_val_score", "matplotlib.pyplot.xlabel", "matplotlib.py...
[((1955, 1988), 'pandas.read_csv', 'pd.read_csv', (['"""...cs-training.csv"""'], {}), "('...cs-training.csv')\n", (1966, 1988), True, 'import pandas as pd\n'), ((1999, 2028), 'pandas.read_csv', 'pd.read_csv', (['"""...cs-test.csv"""'], {}), "('...cs-test.csv')\n", (2010, 2028), True, 'import pandas as pd\n'), ((2094, 2...
import cdd import numpy as np class Cone_on_Plane(object): """Attributes: Quadratic_Form (list of lists, 2x2 matrix): The quadratic form of the cone. Linear_Form (list, 2x1 vector): The linear form of the matrix. """ def __init__(self, a, b, plane_flag): self.Quadratic_Form = [[-2*n...
[ "numpy.cos", "numpy.sin", "numpy.shape", "cdd.Polyhedron", "cdd.Matrix" ]
[((1886, 1931), 'cdd.Matrix', 'cdd.Matrix', (['cdd_vertices'], {'number_type': '"""float"""'}), "(cdd_vertices, number_type='float')\n", (1896, 1931), False, 'import cdd\n'), ((1983, 2002), 'cdd.Polyhedron', 'cdd.Polyhedron', (['mat'], {}), '(mat)\n', (1997, 2002), False, 'import cdd\n'), ((2791, 2836), 'cdd.Matrix', '...
# coding: utf-8 # import sys,os,os.path # os.environ['CUDA_VISIBLE_DEVICES']='' import json import os import sys from collections import Counter import tqdm import numpy as np import tensorflow as tf from tensorflow.contrib import layers from tensorflow.python.ops import array_ops import random import pickle import ed...
[ "tensorflow.local_variables_initializer", "tensorflow.shape", "numpy.argsort", "numpy.array", "tensorflow.contrib.layers.bias_add", "tensorflow.reduce_mean", "tensorflow.nn.embedding_lookup", "tensorflow.slice", "tensorflow.placeholder", "tensorflow.concat", "tensorflow.nn.pool", "tensorflow.C...
[((3406, 3450), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32'], {'shape': '[None, None]'}), '(tf.int32, shape=[None, None])\n', (3420, 3450), True, 'import tensorflow as tf\n'), ((3464, 3508), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32'], {'shape': '[None, None]'}), '(tf.int32, shape=[None, None...
import numpy as np import pytest from docarray import DocumentArray, Document from docarray.array.qdrant import DocumentArrayQdrant from docarray.array.sqlite import DocumentArraySqlite from docarray.array.annlite import DocumentArrayAnnlite, AnnliteConfig from docarray.array.storage.qdrant import QdrantConfig from do...
[ "docarray.array.annlite.AnnliteConfig", "docarray.array.storage.qdrant.QdrantConfig", "pytest.mark.parametrize", "docarray.Document", "pytest.fixture", "docarray.array.storage.weaviate.WeaviateConfig", "numpy.testing.assert_array_equal" ]
[((433, 465), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (447, 465), False, 'import pytest\n'), ((611, 657), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""min_freq"""', '[1, 2, 3]'], {}), "('min_freq', [1, 2, 3])\n", (634, 657), False, 'import pytest\n')...
from __future__ import division from __future__ import absolute_import from __future__ import print_function import numpy as np import os class Memory(object): """ An implementation of the replay memory. This is essential when dealing with DRL algorithms that are not multi-threaded as in A3C. """ ...
[ "os.path.exists", "os.makedirs", "os.path.join", "numpy.random.randint", "numpy.empty" ]
[((721, 763), 'numpy.empty', 'np.empty', ([], {'shape': '((memory_size,) + state_dim)'}), '(shape=(memory_size,) + state_dim)\n', (729, 763), True, 'import numpy as np\n'), ((812, 854), 'numpy.empty', 'np.empty', ([], {'shape': '((memory_size,) + state_dim)'}), '(shape=(memory_size,) + state_dim)\n', (820, 854), True, ...
import numpy as np from proteus import Domain, Context, Comm from proteus.mprans import SpatialTools as st import proteus.TwoPhaseFlow.TwoPhaseFlowProblem as TpFlow from proteus import WaveTools as wt from proteus.Profiling import logEvent from proteus.mbd import CouplingFSI as fsi import os import pychrono rho_0 = 99...
[ "proteus.TwoPhaseFlow.TwoPhaseFlowProblem.OutputStepping", "proteus.mbd.CouplingFSI.ProtChSystem", "proteus.ctransportCoefficients.smoothedHeaviside_integral", "proteus.TwoPhaseFlow.TwoPhaseFlowProblem.TwoPhaseFlowProblem", "proteus.ctransportCoefficients.smoothedHeaviside", "proteus.mprans.SpatialTools.T...
[((728, 765), 'proteus.Domain.PiecewiseLinearComplexDomain', 'Domain.PiecewiseLinearComplexDomain', ([], {}), '()\n', (763, 765), False, 'from proteus import Domain, Context, Comm\n'), ((805, 832), 'proteus.mprans.SpatialTools.Tank3D', 'st.Tank3D', (['domain', 'tank_dim'], {}), '(domain, tank_dim)\n', (814, 832), True,...