code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# Question 06, Lab 05 # AB Satyaprakash - 180123062 # imports ---------------------------------------------------------------------------- from math import cos, log, sin, pi from sympy.abc import t import numpy as np import pandas as pd import sympy as sp from scipy.integrate import quad # global dictionaries -------...
[ "pandas.DataFrame", "numpy.polysub", "numpy.poly1d", "scipy.integrate.quad", "math.sin", "numpy.polyint", "numpy.linalg.inv", "math.cos", "numpy.polymul", "numpy.dot" ]
[((2515, 2608), 'pandas.DataFrame', 'pd.DataFrame', (['table'], {'columns': "['N', 'Evaluated value using N+1 point Gaussian Quadrature']"}), "(table, columns=['N',\n 'Evaluated value using N+1 point Gaussian Quadrature'])\n", (2527, 2608), True, 'import pandas as pd\n'), ((2631, 2658), 'scipy.integrate.quad', 'quad...
#!/usr/bin/env python """Test Cython interpolation""" from __future__ import division, print_function import argparse import os import sys from viscid_test_common import next_plot_fname from matplotlib import pyplot as plt import numpy as np import viscid from viscid.plot import vpyplot as vlt def run_test(fld, se...
[ "matplotlib.pyplot.title", "argparse.ArgumentParser", "matplotlib.pyplot.clf", "viscid.interp", "viscid_test_common.next_plot_fname", "viscid.arrays2field", "viscid.vutil.common_argparse", "numpy.linspace", "viscid.Volume", "viscid.plot.vpyplot.show", "os.path.join" ]
[((348, 357), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (355, 357), True, 'from matplotlib import pyplot as plt\n'), ((413, 428), 'matplotlib.pyplot.title', 'plt.title', (['kind'], {}), '(kind)\n', (422, 428), True, 'from matplotlib import pyplot as plt\n'), ((532, 576), 'argparse.ArgumentParser', 'argparse...
import random from typing import Union, Tuple, Any, Dict import cv2 import numpy as np from skimage.measure import label from ...core.transforms_interface import DualTransform from ...core.transforms_interface import to_tuple __all__ = ["MaskDropout"] class MaskDropout(DualTransform): """ Image & mask augm...
[ "random.randint", "numpy.zeros", "skimage.measure.label", "cv2.inpaint", "cv2.boundingRect" ]
[((1705, 1733), 'skimage.measure.label', 'label', (['mask'], {'return_num': '(True)'}), '(mask, return_num=True)\n', (1710, 1733), False, 'from skimage.measure import label\n'), ((1839, 1895), 'random.randint', 'random.randint', (['self.max_objects[0]', 'self.max_objects[1]'], {}), '(self.max_objects[0], self.max_objec...
import sys import numpy as np import os import h5py import pickle import re if len(sys.argv) < 2: sys.stderr.write('Usage: %s <annotation_gtf>\n' % sys.argv[0]) sys.exit(1) infile = sys.argv[1] CONF = 2 def get_tags_gtf(tagline): """Extract tags from given tagline""" tags = dict() for t in tagli...
[ "sys.stdout.write", "numpy.unique", "numpy.argsort", "numpy.array", "numpy.arange", "sys.stdout.flush", "sys.exit", "sys.stderr.write", "re.sub", "numpy.vstack" ]
[((1147, 1168), 'numpy.array', 'np.array', (['transcripts'], {}), '(transcripts)\n', (1155, 1168), True, 'import numpy as np\n'), ((1177, 1192), 'numpy.array', 'np.array', (['chrms'], {}), '(chrms)\n', (1185, 1192), True, 'import numpy as np\n'), ((1201, 1216), 'numpy.array', 'np.array', (['exons'], {}), '(exons)\n', (...
import cv2 import subprocess as sp import numpy VIDEO_URL = 'http://iphone-streaming.ustream.tv/watch/playlist.m3u8?cid=16258431&stream=live_3&appType=103&appVersion=3&conn=wifi&group=iphone' cv2.namedWindow("GoPro",cv2.CV_WINDOW_AUTOSIZE) pipe = sp.Popen([ 'ffmpeg.exe', "-i", VIDEO_URL, "-loglevel", "qui...
[ "subprocess.Popen", "cv2.waitKey", "cv2.imshow", "cv2.destroyAllWindows", "numpy.fromstring", "cv2.namedWindow" ]
[((194, 242), 'cv2.namedWindow', 'cv2.namedWindow', (['"""GoPro"""', 'cv2.CV_WINDOW_AUTOSIZE'], {}), "('GoPro', cv2.CV_WINDOW_AUTOSIZE)\n", (209, 242), False, 'import cv2\n'), ((250, 429), 'subprocess.Popen', 'sp.Popen', (["['ffmpeg.exe', '-i', VIDEO_URL, '-loglevel', 'quiet', '-an', '-f',\n 'image2pipe', '-pix_fmt'...
from random import randrange from numpy import log, array, ceil from copy import deepcopy from itertools import permutations import spidev import Color_Match as cm valid_arrangements = ['linear'] valid_update_strategies = ['on-command'] class DotstarDevice: def __init__(self, num_LEDs, arrangement, color_order, t...
[ "copy.deepcopy", "spidev.SpiDev", "numpy.ceil", "numpy.log", "Color_Match.rgb_composition", "itertools.permutations", "random.randrange", "Color_Match.planck_spectrum" ]
[((11584, 11612), 'random.randrange', 'randrange', (['(0)', 'pattern_length'], {}), '(0, pattern_length)\n', (11593, 11612), False, 'from random import randrange\n'), ((12379, 12394), 'copy.deepcopy', 'deepcopy', (['state'], {}), '(state)\n', (12387, 12394), False, 'from copy import deepcopy\n'), ((1582, 1597), 'spidev...
import numpy as np class Gene(object): """ creates lise of genes out of files and can display them in log """ def __init__(self, items_file, logger): self.items = np.loadtxt(items_file) self.logger = logger self.logger.debug('list of items: %s' % self.items) return
[ "numpy.loadtxt" ]
[((189, 211), 'numpy.loadtxt', 'np.loadtxt', (['items_file'], {}), '(items_file)\n', (199, 211), True, 'import numpy as np\n')]
import csv import os import random import numpy as np import torch import tqdm from torch.backends import cudnn from torch.utils import data from torchvision import datasets from torchvision import transforms from nets import nn from utils import util random.seed(42) np.random.seed(42) torch.manual_seed(42) cudnn.be...
[ "torch.cuda.synchronize", "numpy.random.seed", "utils.util.add_weight_decay", "nets.nn.StepLR", "torch.cuda.device_count", "torch.device", "torchvision.transforms.Normalize", "torch.no_grad", "os.path.join", "utils.util.AverageMeter", "csv.DictWriter", "nets.nn.CrossEntropyLoss", "utils.util...
[((255, 270), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (266, 270), False, 'import random\n'), ((271, 289), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (285, 289), True, 'import numpy as np\n'), ((290, 311), 'torch.manual_seed', 'torch.manual_seed', (['(42)'], {}), '(42)\n', (307, 311...
""" MAMBA coil ========== Compact example of a biplanar coil producing homogeneous field in a number of target regions arranged in a grid. Meant to demonstrate the flexibility in target choice, inspired by the technique "multiple-acquisition micro B(0) array" (MAMBA) technique, see https://doi.org/10.1002/mrm.10464 ...
[ "trimesh.Trimesh", "numpy.meshgrid", "numpy.zeros_like", "mayavi.mlab.quiver3d", "bfieldtools.coil_optimize.optimize_streamfunctions", "numpy.asarray", "bfieldtools.utils.combine_meshes", "numpy.array", "bfieldtools.utils.load_example_mesh", "numpy.linspace", "bfieldtools.mesh_conductor.MeshCond...
[((734, 772), 'bfieldtools.utils.load_example_mesh', 'load_example_mesh', (['"""10x10_plane_hires"""'], {}), "('10x10_plane_hires')\n", (751, 772), False, 'from bfieldtools.utils import combine_meshes, load_example_mesh\n'), ((820, 839), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (828, 839), True,...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed u...
[ "numpy.zeros" ]
[((1291, 1311), 'numpy.zeros', 'np.zeros', (['max_values'], {}), '(max_values)\n', (1299, 1311), True, 'import numpy as np\n'), ((2309, 2334), 'numpy.zeros', 'np.zeros', (['self.max_values'], {}), '(self.max_values)\n', (2317, 2334), True, 'import numpy as np\n')]
# Author: <NAME> # Project: Image/video auto-captioning using Deep Learning # This script is executed when the user has uploaded a video to the library to be # processed. The processing involves the following steps: converting the video to mp4 # format if it is not in that format already, extracting key frames and get...
[ "os.remove", "numpy.argmax", "tensorflow.keras.applications.xception.preprocess_input", "os.path.isfile", "glob.glob", "shutil.rmtree", "os.path.join", "shutil.copy", "os.path.exists", "tensorflow.keras.preprocessing.image.load_img", "tensorflow.keras.preprocessing.sequence.pad_sequences", "te...
[((1003, 1026), 'subprocess.run', 'subprocess.run', (['command'], {}), '(command)\n', (1017, 1026), False, 'import subprocess\n'), ((2390, 2413), 'subprocess.run', 'subprocess.run', (['command'], {}), '(command)\n', (2404, 2413), False, 'import subprocess\n'), ((5547, 5620), 'tensorflow.keras.preprocessing.image.load_i...
from functools import partial import numpy as np import pandas as pd import chainer from chainer import functions from chainer import functions as F from chainer.links import Linear from chainer.dataset import to_device from lib.graph import Graph def zero_plus(x): return F.softplus(x) - 0.6931472 class Eleme...
[ "functools.partial", "chainer.functions.softplus", "pandas.read_csv", "chainer.functions.sum", "chainer.functions.exp", "chainer.functions.mean_absolute_error", "chainer.functions.concat", "chainer.functions.reshape", "chainer.functions.expand_dims", "numpy.linspace", "chainer.functions.broadcas...
[((5976, 6020), 'pandas.read_csv', 'pd.read_csv', (['"""../../../input/structures.csv"""'], {}), "('../../../input/structures.csv')\n", (5987, 6020), True, 'import pandas as pd\n'), ((6084, 6123), 'pandas.read_csv', 'pd.read_csv', (['"""../../../input/bonds.csv"""'], {}), "('../../../input/bonds.csv')\n", (6095, 6123),...
import os, sys from os.path import join ROOT_DIR = os.path.abspath(os.curdir) if ROOT_DIR not in sys.path: sys.path.append(ROOT_DIR) sys.path.append(join(ROOT_DIR, 'opmatch')) import match import create_test_data import numpy as np from util import vis X, y, ps = create_test_data.get_test_data(False, 30, 1, .1...
[ "sys.path.append", "os.path.abspath", "numpy.sum", "util.vis.plot_matching", "match.match", "os.path.join", "create_test_data.get_test_data" ]
[((51, 77), 'os.path.abspath', 'os.path.abspath', (['os.curdir'], {}), '(os.curdir)\n', (66, 77), False, 'import os, sys\n'), ((273, 323), 'create_test_data.get_test_data', 'create_test_data.get_test_data', (['(False)', '(30)', '(1)', '(0.15)'], {}), '(False, 30, 1, 0.15)\n', (303, 323), False, 'import create_test_data...
#todo chapter5. pandas 시작하기 from pandas import Series, DataFrame import pandas as pd import numpy as np #todo 5.1 pandas 자료 구조 소개 ''' pandas 에 대해서 알아보려면 Series 와 DataFrame, 이 두 가지 자료 구조에 익숙해질 필요가 있다. 이 두 가지 자료 구조로 모든 문제를 해결할 수는 없지만 대부분의 애플리케이션에서 사용하기 쉽고 탄탄한 기반을 제공한다. ''' #todo 5.1.1 Series ''' Series 는 일련의...
[ "pandas.DataFrame", "numpy.abs", "numpy.random.randn", "pandas.isnull", "pandas.notnull", "numpy.arange", "numpy.exp", "pandas.Series" ]
[((472, 493), 'pandas.Series', 'Series', (['[4, 7, -5, 3]'], {}), '([4, 7, -5, 3])\n', (478, 493), False, 'from pandas import Series, DataFrame\n'), ((791, 840), 'pandas.Series', 'Series', (['[4, 7, -5, 3]'], {'index': "['d', 'b', 'a', 'c']"}), "([4, 7, -5, 3], index=['d', 'b', 'a', 'c'])\n", (797, 840), False, 'from p...
import numpy as np import matplotlib.pyplot as plt x=np.array(["Anmol","Sushant","Arardhya","Aniket","Deepak"]) y=np.array([70,56,83,54,75]) '''plt.plot(x,np.sin(x),"y*") plt.plot(x,np.cos(x),"b^") plt.plot(x,np.tan(x),"r--") plt.plot(x,x*2,"b") plt.title("Graph") plt.xlabel("x") plt.ylabel("y")''' z=np.array([40,85,62...
[ "numpy.array", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((53, 115), 'numpy.array', 'np.array', (["['Anmol', 'Sushant', 'Arardhya', 'Aniket', 'Deepak']"], {}), "(['Anmol', 'Sushant', 'Arardhya', 'Aniket', 'Deepak'])\n", (61, 115), True, 'import numpy as np\n'), ((114, 144), 'numpy.array', 'np.array', (['[70, 56, 83, 54, 75]'], {}), '([70, 56, 83, 54, 75])\n', (122, 144), Tr...
import colorsys import copy import os import numpy as np from PIL import Image import cv2 from BASNET import ModelBASNet # --------------------------------------------# # 使用自己训练好的模型预测需要修改2个参数 # model_path和num_classes都需要修改! # 如果出现shape不匹配 # 一定要注意训练时的model_path和num_classes数的修改 # ---------------------------------...
[ "PIL.Image.new", "copy.deepcopy", "numpy.uint8", "colorsys.hsv_to_rgb", "numpy.expand_dims", "PIL.Image.open", "numpy.array", "BASNET.ModelBASNet", "PIL.Image.blend", "os.listdir" ]
[((5045, 5061), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (5055, 5061), False, 'import os\n'), ((5094, 5116), 'PIL.Image.open', 'Image.open', (['(path + png)'], {}), '(path + png)\n', (5104, 5116), False, 'from PIL import Image\n'), ((1192, 1226), 'BASNET.ModelBASNet', 'ModelBASNet', (['self.model_image_s...
# ########################################################## ## # FlatCAM: 2D Post-processing for Manufacturing # # http://flatcam.org # # Author: <NAME> (c) # # Date: 2/5/2014 # # MIT Lice...
[ "copy.deepcopy", "shapely.geometry.Point", "shapely.affinity.translate", "shapely.affinity.scale", "shapely.affinity.rotate", "shapely.geometry.LineString", "re.findall", "traceback.format_exc", "numpy.interp", "shapely.affinity.skew", "re.search", "logging.getLogger", "re.compile" ]
[((783, 808), 'logging.getLogger', 'logging.getLogger', (['"""base"""'], {}), "('base')\n", (800, 808), False, 'import logging\n'), ((3281, 3301), 'copy.deepcopy', 'deepcopy', (['self.zeros'], {}), '(self.zeros)\n', (3289, 3301), False, 'from copy import deepcopy\n'), ((4904, 4923), 're.compile', 're.compile', (['"""^M...
#! /usr/bin/env python3 import rospy import numpy as np import sys from geometry_msgs.msg import PoseWithCovarianceStamped class SimBall: def __init__(self): rospy.init_node('ball_sim') self.pub_frequency = 20 if len(sys.argv) > 1: self.pub_frequency = int(sys.argv[1]) ...
[ "numpy.random.randn", "numpy.zeros", "rospy.Publisher", "rospy.Rate", "rospy.is_shutdown", "numpy.array", "rospy.init_node", "geometry_msgs.msg.PoseWithCovarianceStamped", "numpy.random.rand" ]
[((173, 200), 'rospy.init_node', 'rospy.init_node', (['"""ball_sim"""'], {}), "('ball_sim')\n", (188, 200), False, 'import rospy\n'), ((418, 434), 'numpy.array', 'np.array', (['[2, 4]'], {}), '([2, 4])\n', (426, 434), True, 'import numpy as np\n'), ((460, 471), 'numpy.zeros', 'np.zeros', (['(2)'], {}), '(2)\n', (468, 4...
""" The way matplotlib does text layout is counter-intuitive to some, so this example is designed to make it a little clearer. The text is aligned by it's bounding box (the rectangular box that surrounds the ink rectangle). The order of operations is basically rotation then alignment, rather than alignment then rotat...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.yticks", "matplotlib.pyplot.text", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.grid" ]
[((1114, 1130), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(211)'], {}), '(211)\n', (1125, 1130), True, 'import matplotlib.pyplot as plt\n'), ((1187, 1201), 'matplotlib.pyplot.xlim', 'plt.xlim', (['(0)', '(5)'], {}), '(0, 5)\n', (1195, 1201), True, 'import matplotlib.pyplot as plt\n'), ((1241, 1270), 'matplotlib.py...
''' k Bandit problem ''' import numpy as np import matplotlib.pyplot as plt class Bandit(): def __init__(self, k): self.k = k # number of bandits self.true_val = np.random.normal(0,1,self.k) # q*(a) def reward(self, t): return np.random.normal(self.true_val[t],1,1) #R_t class Ag...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.argmax", "numpy.zeros", "numpy.random.random", "numpy.array", "numpy.random.randint", "numpy.random.normal", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((1187, 1201), 'numpy.zeros', 'np.zeros', (['(1000)'], {}), '(1000)\n', (1195, 1201), True, 'import numpy as np\n'), ((1435, 1452), 'matplotlib.pyplot.plot', 'plt.plot', (['rewards'], {}), '(rewards)\n', (1443, 1452), True, 'import matplotlib.pyplot as plt\n'), ((1453, 1472), 'matplotlib.pyplot.xlabel', 'plt.xlabel', ...
print('Importing dependencies...', end='') import sys sys.stdout.flush() sys.path.append('/home/pi/.local/lib/python3.7/site-packages') from time import sleep import numpy as np import board import neopixel import scara_arm as arm import scara_imaging as imaging print('done.') def read_config(filen...
[ "sys.path.append", "scara_arm.arm_deinit", "scara_imaging.camera_init", "scara_imaging.find_target", "scara_arm.servo_calibration", "time.sleep", "scara_arm.arm_init", "sys.stdout.flush", "numpy.array", "scara_imaging.calibrate_camera", "scara_imaging.image_capture", "neopixel.NeoPixel", "nu...
[((56, 74), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (72, 74), False, 'import sys\n'), ((76, 138), 'sys.path.append', 'sys.path.append', (['"""/home/pi/.local/lib/python3.7/site-packages"""'], {}), "('/home/pi/.local/lib/python3.7/site-packages')\n", (91, 138), False, 'import sys\n'), ((9704, 9722), 's...
from __future__ import print_function, division import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torch.autograd import Variable import time import os import argparse from torch.autograd import Function import ssenet_resnet import numpy as np import cv2 import mat...
[ "os.mkdir", "xlwt.Workbook", "argparse.ArgumentParser", "ActivationMap.GradCam", "matplotlib.pyplot.figure", "os.path.isfile", "os.path.join", "cv2.cvtColor", "matplotlib.pyplot.imshow", "SimpleITK.ReadImage", "matplotlib.pyplot.close", "numpy.transpose", "torch.load", "SimpleITK.GetArrayF...
[((536, 560), 'SimpleITK.ReadImage', 'sitk.ReadImage', (['img_path'], {}), '(img_path)\n', (550, 560), True, 'import SimpleITK as sitk\n'), ((667, 678), 'numpy.max', 'np.max', (['img'], {}), '(img)\n', (673, 678), True, 'import numpy as np\n'), ((693, 704), 'numpy.min', 'np.min', (['img'], {}), '(img)\n', (699, 704), T...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> import numpy as np # <codecell> def SetInitialConditions(ICs, ICset = 'Howell', ICtestcase = 0, numPoints = 2000): # user inputs #ICset = 'Howell' # 'Sharp' 'Howell' 'Barbee' #ICtestcase = 0 #numPoints = 2000 # assign simul...
[ "numpy.matrix", "numpy.zeros", "numpy.ones", "numpy.array", "numpy.linspace" ]
[((439, 493), 'numpy.linspace', 'np.linspace', (['(0)', "ICs[ICset]['T'][ICtestcase]", 'numPoints'], {}), "(0, ICs[ICset]['T'][ICtestcase], numPoints)\n", (450, 493), True, 'import numpy as np\n'), ((1243, 2435), 'numpy.matrix', 'np.matrix', (['[[0.994, 0.0, -2.1138987966945026, 5.43679543926019], [0.994, 0.0, -\n 2...
""" python test_PETA.py -g 0 -c 61 -b 256 -m GoogLeNetSPP -w ../models/ python test_PETA.py -g 0 -c 61 -b 256 -m GoogLeNet -w ../models/ python test_PETA.py -g 0 -c 61 -b 256 -m GoogLeNet -w ../models/imagenet_models/GoogLeNet_PETA/binary61_depth python test_PETA.py -g 1 -c 68 -b 256 -m OEDCGoogLeNetSPP -w ../models...
[ "keras.preprocessing.image.ImageDataGenerator", "tqdm.tqdm", "network.GoogLenetSPP.GoogLeNetSPP.build", "numpy.save", "argparse.ArgumentParser", "network.GoogleLenet.GoogLeNet.build", "keras.utils.multi_gpu_model", "pandas.read_csv", "numpy.zeros", "re.match", "network.OEDC_GoogLenetSPP.OEDCGoog...
[((1526, 1588), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""training of the WPAL..."""'}), "(description='training of the WPAL...')\n", (1549, 1588), False, 'import argparse\n'), ((2846, 2868), 'numpy.zeros', 'np.zeros', (['(class_num,)'], {}), '((class_num,))\n', (2854, 2868), True, ...
from __future__ import division from itertools import product import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns __alll__ = [ "datasets_from_frame", "categorical_longform", "continuous_longform", "plot_categorical_diff", "plot_continuous_diff", "TrainTestDiff" ] def...
[ "pandas.DataFrame", "numpy.ceil", "seaborn.factorplot", "numpy.empty", "seaborn.barplot", "matplotlib.pyplot.figure", "matplotlib.pyplot.subplots_adjust", "pandas.concat", "numpy.repeat" ]
[((1823, 1837), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1835, 1837), True, 'import pandas as pd\n'), ((1860, 1893), 'numpy.repeat', 'np.repeat', (['name', 'dataset.shape[0]'], {}), '(name, dataset.shape[0])\n', (1869, 1893), True, 'import numpy as np\n'), ((1916, 1952), 'numpy.repeat', 'np.repeat', (['fe...
import numpy as np def load_train_data(dim): from tensorflow.keras.datasets import mnist (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train_convert = [convert_pic(data,dim) for data in x_train] x_test_convert = [convert_pic(data,dim) for data in x_test] return (np.array(x_train_convert),y_train),(...
[ "cv2.imread", "numpy.array", "cv2.resize", "tensorflow.keras.datasets.mnist.load_data" ]
[((132, 149), 'tensorflow.keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (147, 149), False, 'from tensorflow.keras.datasets import mnist\n'), ((402, 453), 'cv2.resize', 'cv2.resize', (['data', 'dim'], {'interpolation': 'cv2.INTER_AREA'}), '(data, dim, interpolation=cv2.INTER_AREA)\n', (412, 453),...
'''Functions for estimating an adjustment to the posterior prediction over subtypes when making predictions online. Author: <NAME> ''' import numpy as np import logging from scipy.optimize import minimize from scipy.misc import logsumexp class OnlineAdjustment: def __init__(self, model, penalty, seed=0): ...
[ "scipy.optimize.minimize", "numpy.zeros_like", "numpy.log", "numpy.zeros", "numpy.ones", "scipy.misc.logsumexp", "numpy.array", "numpy.exp", "numpy.dot", "numpy.round" ]
[((827, 881), 'scipy.optimize.minimize', 'minimize', (['f', 'w0'], {'jac': 'g', 'method': '"""BFGS"""', 'options': 'options'}), "(f, w0, jac=g, method='BFGS', options=options)\n", (835, 881), False, 'from scipy.optimize import minimize\n'), ((1054, 1065), 'numpy.array', 'np.array', (['p'], {}), '(p)\n', (1062, 1065), T...
# -*- coding: utf-8 -*- import os import sys import numpy as np import matplotlib.pyplot as plt import xml.etree.ElementTree as et CLASSES = ('ore carrier', 'bulk cargo carrier', 'container ship', 'general cargo ship', 'fishing boat', 'passenger ship') class BboxAnalyze: def __init__(self, data_root,...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.hist", "numpy.argmax", "numpy.histogram", "numpy.array", "matplotlib.pyplot.xticks", "os.path.join", "numpy.concatenate" ]
[((4887, 4915), 'numpy.concatenate', 'np.concatenate', (['bbox'], {'axis': '(0)'}), '(bbox, axis=0)\n', (4901, 4915), True, 'import numpy as np\n'), ((4932, 4961), 'numpy.concatenate', 'np.concatenate', (['label'], {'axis': '(0)'}), '(label, axis=0)\n', (4946, 4961), True, 'import numpy as np\n'), ((416, 439), 'os.path...
import pandas as pd import numpy as np # some helper methods mostly to improve legibility in main notebooks def load_wdi(data_path='../data/wdi/WDIData.csv', series_path='../data/wdi/WDISeries.csv'): return pd.read_csv(data_path, low_memory=False), pd.read_csv(series_path, low_memory=False) def project_size_USD_cal...
[ "pandas.read_csv", "numpy.any", "numpy.average", "pandas.to_datetime" ]
[((1083, 1123), 'pandas.read_csv', 'pd.read_csv', (['data_path'], {'low_memory': '(False)'}), '(data_path, low_memory=False)\n', (1094, 1123), True, 'import pandas as pd\n'), ((1981, 2049), 'pandas.to_datetime', 'pd.to_datetime', (['df[start_date_col]'], {'format': '"""%d%b%Y"""', 'errors': '"""coerce"""'}), "(df[start...
# -*- coding: utf-8 -*- """ Created on Wed Sep 11 01:26:31 2019 @author: f.divruno """ import numpy as np import pycraf as pycraf from astropy.coordinates import SkyCoord, EarthLocation, AltAz from astropy.time import Time import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import cartopy.crs as ...
[ "matplotlib.pyplot.title", "numpy.abs", "numpy.random.seed", "numpy.sum", "numpy.arctan2", "astropy.coordinates.AltAz", "numpy.einsum", "matplotlib.pyplot.figure", "numpy.sin", "numpy.interp", "numpy.unique", "matplotlib.pyplot.draw", "numpy.max", "numpy.linspace", "numpy.log10", "nump...
[((11518, 11551), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'parallel': '(True)'}), '(nopython=True, parallel=True)\n', (11521, 11551), False, 'from numba import jit\n'), ((614, 625), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (622, 625), True, 'import numpy as np\n'), ((639, 652), 'numpy.abs', 'np.abs', ([...
import numpy as np from scipy.special import kv, iv # Needed for K1 in Well class, and in CircInhom from .aquifer import AquiferData from .element import Element from .equation import InhomEquation class CircInhomData(AquiferData): def __init__(self, model, x0=0, y0=0, R=1, kaq=[1], Haq=[1], c=[1], ...
[ "numpy.ones_like", "numpy.sum", "numpy.zeros", "numpy.ones", "scipy.special.iv", "numpy.sin", "numpy.array", "numpy.arange", "numpy.linspace", "numpy.exp", "numpy.cos", "scipy.special.kv", "numpy.atleast_1d", "numpy.sqrt" ]
[((2073, 2095), 'numpy.arange', 'np.arange', (['self.Nterms'], {}), '(self.Nterms)\n', (2082, 2095), True, 'import numpy as np\n'), ((2183, 2227), 'numpy.ones', 'np.ones', (['(self.Norder, 2 * self.Nterms)', '"""d"""'], {}), "((self.Norder, 2 * self.Nterms), 'd')\n", (2190, 2227), True, 'import numpy as np\n'), ((2246,...
''' Created on 9 de nov de 2020 @author: klaus ''' import jsonlines from folders import DATA_DIR, SUBMISSIONS_DIR import os from os import path import pandas as pd import numpy as np import urllib import igraph as ig from input.read_input import read_item_data, get_emb def create_ratio(mode = 'train',CUTOFF=50, whi...
[ "fasttext.FastText.load_model", "pandas.DataFrame.from_dict", "pandas.read_csv", "numpy.std", "numpy.round", "input.read_input.read_item_data", "pandas.unique", "urllib.request.urlretrieve", "os.path.isfile", "numpy.mean", "numpy.array", "numpy.where", "pandas.qcut", "jsonlines.open", "o...
[((475, 491), 'input.read_input.read_item_data', 'read_item_data', ([], {}), '()\n', (489, 491), False, 'from input.read_input import read_item_data, get_emb\n'), ((515, 547), 'pandas.qcut', 'pd.qcut', (["df['price'].values", '(100)'], {}), "(df['price'].values, 100)\n", (522, 547), True, 'import pandas as pd\n'), ((89...
import os from math import sqrt import numpy as np import scipy.optimize from scipy.stats import chi2 import matplotlib matplotlib.use('Agg') matplotlib.rc('font', **{'family': 'serif', 'serif': ['Computer Modern'], 'size': 15}) matplotlib.rc('text', usetex=False) import matplotlib.pyplot as plt from enrico import util...
[ "matplotlib.rc", "numpy.floor", "enrico.config.get_config", "enrico.submit.call", "os.path.isfile", "matplotlib.pyplot.figure", "enrico.utils._log", "numpy.arange", "numpy.mean", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "enrico.environ.DIRS.get", "enrico.utils.MJD_to_met", ...
[((120, 141), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (134, 141), False, 'import matplotlib\n'), ((142, 232), 'matplotlib.rc', 'matplotlib.rc', (['"""font"""'], {}), "('font', **{'family': 'serif', 'serif': ['Computer Modern'],\n 'size': 15})\n", (155, 232), False, 'import matplotlib\n'...
import subprocess import numpy as np from rsbeams.rsdata.SDDS import readSDDS def obj_f(_): analysis_command = ["sddsanalyzebeam", "run_setup.output.sdds", "output.anb"] subprocess.call(analysis_command) anb = readSDDS("output.anb") anb.read() betax, betax_target = anb.columns['betax'].squeeze()...
[ "numpy.array", "numpy.sqrt", "subprocess.call", "rsbeams.rsdata.SDDS.readSDDS" ]
[((180, 213), 'subprocess.call', 'subprocess.call', (['analysis_command'], {}), '(analysis_command)\n', (195, 213), False, 'import subprocess\n'), ((225, 247), 'rsbeams.rsdata.SDDS.readSDDS', 'readSDDS', (['"""output.anb"""'], {}), "('output.anb')\n", (233, 247), False, 'from rsbeams.rsdata.SDDS import readSDDS\n'), ((...
import numpy as np from ..utils.darray import DependArray class NonPBC(object): def __init__(self, rij, charges, cell_basis=None, exclusion=None, *, dij_inverse=None, dij_inverse_gradient=None): self.charges = charges self.qmmm_coulomb_tensor = DependArray( name="qmmm_coulomb_tensor...
[ "numpy.asarray", "numpy.zeros", "numpy.copy" ]
[((1598, 1635), 'numpy.zeros', 'np.zeros', (['(4, t.shape[0], t.shape[1])'], {}), '((4, t.shape[0], t.shape[1]))\n', (1606, 1635), True, 'import numpy as np\n'), ((1099, 1119), 'numpy.copy', 'np.copy', (['dij_inverse'], {}), '(dij_inverse)\n', (1106, 1119), True, 'import numpy as np\n'), ((1373, 1402), 'numpy.copy', 'n...
# import numpy import pandas # import torch from torch import nn # N = 10_000 data_raw = pandas.DataFrame(data={'A': numpy.array(numpy.arange(N)), # 'A': numpy.random.choice([0, 1], size=(N,)), 'B': numpy.array(numpy.arange(N)) + numpy.random.normal(size=(N,)), ...
[ "new_siege.neuro.Gene", "torch.nn.MSELoss", "new_siege.data.DataHandler", "numpy.arange", "numpy.random.normal" ]
[((803, 832), 'new_siege.data.DataHandler', 'DataHandler', (['data_set', 'target'], {}), '(data_set, target)\n', (814, 832), False, 'from new_siege.data import DataHandler\n'), ((1181, 1288), 'new_siege.neuro.Gene', 'Gene', (['data', 'layers', 'layers_dimensions', 'activators', 'activators_args', 'preprocessors', 'embe...
import faiss import numpy as np from scipy import sparse, special def estimate_pdf(target, emb, C=0.1): """Estimate the density of entities at the given target locations in the embedding space using the density estimator based on the k-nearest neighbors. :param target: Target location at which the de...
[ "scipy.special.loggamma", "numpy.log", "numpy.power", "numpy.max", "faiss.IndexFlatL2" ]
[((1615, 1637), 'faiss.IndexFlatL2', 'faiss.IndexFlatL2', (['dim'], {}), '(dim)\n', (1632, 1637), False, 'import faiss\n'), ((1942, 1967), 'numpy.max', 'np.max', (['distances'], {'axis': '(1)'}), '(distances, axis=1)\n', (1948, 1967), True, 'import numpy as np\n'), ((1901, 1932), 'scipy.special.loggamma', 'special.logg...
import time # from flask import Flask, request import flask from flask import request, Response, render_template, jsonify, send_file, make_response import os import subprocess import sys import pandas from shelljob import proc import csv import json import pandas as pd from copy import deepcopy from ruamel import yam...
[ "subprocess.Popen", "copy.deepcopy", "flask.request.args.get", "ruamel.yaml.dump", "numpy.std", "os.getcwd", "pandas.read_csv", "flask.Flask", "time.sleep", "flask.jsonify", "numpy.mean", "ruamel.yaml.load", "shutil.copytree", "os.listdir" ]
[((340, 361), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (351, 361), False, 'import flask\n'), ((667, 695), 'flask.request.args.get', 'request.args.get', (['"""sentence"""'], {}), "('sentence')\n", (683, 695), False, 'from flask import request, Response, render_template, jsonify, send_file, make_...
from . import Instrument from collections import deque import mido import numpy import itertools import operator SCALE_WEIGHTS = [6, 2, 4, 2, 4, 1, 3] MAX_JUMP = 7 EOLIAN_SCALE = [0, 2, 3, 5, 7, 8, 10] class SynthLead(Instrument): TRACK_NAME_BASE = "Lead Synth" def __init__(self, live_set, role, recordi...
[ "itertools.repeat", "mido.Message", "itertools.count", "itertools.islice", "numpy.random.choice", "itertools.cycle", "mido.open_output", "collections.deque" ]
[((454, 461), 'collections.deque', 'deque', ([], {}), '()\n', (459, 461), False, 'from collections import deque\n'), ((489, 541), 'mido.open_output', 'mido.open_output', (["('IAC Driver Melody %s' % self.role)"], {}), "('IAC Driver Melody %s' % self.role)\n", (505, 541), False, 'import mido\n'), ((4843, 4865), 'itertoo...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import functools import numpy as np from ....tests.helper import pytest from .. import iers from ....table import Table from ....time import Time...
[ "functools.partial", "numpy.array", "numpy.all" ]
[((337, 391), 'functools.partial', 'functools.partial', (['np.allclose'], {'rtol': '(1e-15)', 'atol': '(1e-09)'}), '(np.allclose, rtol=1e-15, atol=1e-09)\n', (354, 391), False, 'import functools\n'), ((865, 930), 'numpy.array', 'np.array', (['[2456108.5, 2456108.5, 2456108.5, 2456109.5, 2456109.5]'], {}), '([2456108.5,...
import socket from time import sleep, strftime, time from typing import Any, List, Optional from numpy import random def log(*args: Any) -> None: print(strftime('%Y-%m-%d %H:%M:%S - hlp - INFO -'), *args) def get_random_bytes(size: int, seed: int) -> bytes: random.seed(seed) result = random.bytes(s...
[ "numpy.random.seed", "socket.socket", "time.strftime", "time.time", "time.sleep", "numpy.random.bytes", "numpy.random.choice" ]
[((275, 292), 'numpy.random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (286, 292), False, 'from numpy import random\n'), ((306, 324), 'numpy.random.bytes', 'random.bytes', (['size'], {}), '(size)\n', (318, 324), False, 'from numpy import random\n'), ((436, 453), 'numpy.random.seed', 'random.seed', (['seed'], {})...
""" 2021 <NAME>, ETHZ, MPI IS Application to train generative model. """ import numpy as np import healthgen.apps.global_parameters from healthgen.apps.base_app import BaseApplication from healthgen.generation import VAEGenModel, MultiVAEGenModel, SRNNGenModel, KVAEGenModel, KVAEMissGenModel, HealthGenModel import tor...
[ "healthgen.generation.VAEGenModel", "healthgen.generation.HealthGenModel", "healthgen.generation.KVAEMissGenModel", "healthgen.generation.MultiVAEGenModel", "absl.app.run", "wandb.init", "torch.cuda.is_available", "healthgen.generation.SRNNGenModel", "healthgen.generation.KVAEGenModel", "numpy.con...
[((5588, 5613), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (5611, 5613), False, 'import torch\n'), ((5619, 5808), 'wandb.init', 'wandb.init', ([], {'project': '"""wand_project"""', 'entity': '"""wandb_user"""', 'group': 'FLAGS.gen_model', 'job_type': "('cluster' if use_cuda else 'local')", ...
# -*- coding: UTF-8 -*- import tensorflow as tf import pandas as pd import numpy as np import matplotlib.pyplot as plt from bokeh.plotting import output_file, figure, show class NeuralNetwork: def __init__(self, input_shape, stock_or_return): self.input_shape = input_shape self.stock_or_return = ...
[ "pandas.DataFrame", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pandas.read_csv", "numpy.std", "tensorflow.keras.layers.InputLayer", "numpy.mean", "numpy.array", "tensorflow.keras.models.Sequential", "numpy.reshape", "tensorflow.keras.regularizers.l2" ]
[((501, 529), 'tensorflow.keras.models.Sequential', 'tf.keras.models.Sequential', ([], {}), '()\n', (527, 529), True, 'import tensorflow as tf\n'), ((562, 618), 'tensorflow.keras.layers.InputLayer', 'tf.keras.layers.InputLayer', ([], {'input_shape': '(1, input_shape)'}), '(input_shape=(1, input_shape))\n', (588, 618), ...
import networkx as nx import numpy as np def _graph2dag(graph): """Converts nx.Graph to an directed, acyclic form. Returns the adjancency matrix""" adj = nx.adj_matrix(graph).todense() adj = adj + adj.T adj = (adj != 0).astype(int) adj = np.tril(adj) assert nx.is_directed_acyclic_graph(nx.fro...
[ "networkx.from_numpy_matrix", "numpy.eye", "networkx.erdos_renyi_graph", "numpy.tril", "networkx.adj_matrix", "numpy.ones", "warnings.warn", "numpy.sqrt" ]
[((260, 272), 'numpy.tril', 'np.tril', (['adj'], {}), '(adj)\n', (267, 272), True, 'import numpy as np\n'), ((767, 815), 'networkx.erdos_renyi_graph', 'nx.erdos_renyi_graph', (['n', 'p', 'seed'], {'directed': '(False)'}), '(n, p, seed, directed=False)\n', (787, 815), True, 'import networkx as nx\n'), ((2573, 2583), 'nu...
''' sample test of pycoq.serlib ''' import logging import os import json import pkg_resources import numpy import pytest import pycoq.log import serlib.parser def with_prefix(s: str) -> str: ''' adds package path as prefix ''' return os.path.join(pkg_resources.resource_filename('pycoq', 'tests'), s) d...
[ "logging.info", "pytest.raises", "numpy.array", "pkg_resources.resource_filename" ]
[((1118, 1195), 'numpy.array', 'numpy.array', (['[1, 2, 3, -3, 4, 1, 2, 3, -3, 5, 6, -2, 7, -5]'], {'dtype': 'numpy.intc'}), '([1, 2, 3, -3, 4, 1, 2, 3, -3, 5, 6, -2, 7, -5], dtype=numpy.intc)\n', (1129, 1195), False, 'import numpy\n'), ((1451, 1528), 'numpy.array', 'numpy.array', (['[1, 2, 3, -3, 4, 1, 2, 3, -3, 5, 6,...
from __future__ import print_function import torch import cv2 import time import numpy as np import os from imutils.video import FPS, WebcamVideoStream from data import BaseTransform from ssd import build_ssd COLORS = [(255, 0, 0), (0, 255, 0), (0, 0, 255)] FONT = cv2.FONT_HERSHEY_SIMPLEX THRESHOLD = 0.2 def slidi...
[ "data.BaseTransform", "cv2.waitKey", "torch.load", "numpy.zeros", "ssd.build_ssd", "cv2.imread", "torch.Tensor", "cv2.imshow", "cv2.resize" ]
[((1564, 1590), 'ssd.build_ssd', 'build_ssd', (['"""test"""', '(300)', '(21)'], {}), "('test', 300, 21)\n", (1573, 1590), False, 'from ssd import build_ssd\n'), ((1699, 1763), 'data.BaseTransform', 'BaseTransform', (['net.size', '(104 / 256.0, 117 / 256.0, 123 / 256.0)'], {}), '(net.size, (104 / 256.0, 117 / 256.0, 123...
""" <NAME>, 2020 """ import numpy as np def ara_backward_induction(energy_cost_current = 1,energy_cost_future = 1,energy_bonus = 0): """ This function implements the backward induction algorithm. The inputs energy_cost_future and energy_cost_current specify the energy costs of the current and future ...
[ "numpy.absolute", "numpy.maximum", "numpy.sum", "numpy.zeros", "numpy.array", "numpy.arange" ]
[((3498, 3540), 'numpy.array', 'np.array', (['[[1, 1], [2, 1], [1, 2], [2, 2]]'], {}), '([[1, 1], [2, 1], [1, 2], [2, 2]])\n', (3506, 3540), True, 'import numpy as np\n'), ((3592, 3614), 'numpy.zeros', 'np.zeros', (['(7, 4, 9, 4)'], {}), '((7, 4, 9, 4))\n', (3600, 3614), True, 'import numpy as np\n'), ((3640, 3665), 'n...
import os import pickle import numpy as np from sklearn.model_selection import GridSearchCV from sklearn.metrics import confusion_matrix from sklearn.preprocessing import StandardScaler from sklearn.svm import SVC from sklearn.externals import joblib from nmapy.classification import * def main(): #n...
[ "pickle.dump", "sklearn.preprocessing.StandardScaler", "numpy.histogram", "numpy.array", "sklearn.svm.SVC", "sklearn.metrics.confusion_matrix", "os.path.join" ]
[((2094, 2120), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {'copy': '(False)'}), '(copy=False)\n', (2108, 2120), False, 'from sklearn.preprocessing import StandardScaler\n'), ((3058, 3125), 'sklearn.svm.SVC', 'SVC', ([], {'C': '(12.041044961603584)', 'kernel': '"""linear"""', 'gamma': '(4.9585726444...
import numpy as np import torch import torch_struct as ts def nk2ts(chart): # chart: batch x time x time x num_classes # need to make indices inclusive to be compatible with torchstruct # and add 1st dimension corresponding to size of semiring return chart[:,:-1, 1:] def batch_marg(chart, semiring=t...
[ "torch.BoolTensor", "numpy.zeros", "torch.arange" ]
[((937, 957), 'numpy.zeros', 'np.zeros', (['x.shape[0]'], {}), '(x.shape[0])\n', (945, 957), True, 'import numpy as np\n'), ((1273, 1299), 'numpy.zeros', 'np.zeros', (['(bsz * len_padded)'], {}), '(bsz * len_padded)\n', (1281, 1299), True, 'import numpy as np\n'), ((1449, 1496), 'torch.arange', 'torch.arange', (['(0)',...
__author__ = ('<NAME>', '<NAME>') import sys import unittest import os import platform import numpy as np import pandas as pd import tables as pt from pypet import SharedPandasFrame, ObjectTable, make_ordinary_result, Result, \ make_shared_result, compact_hdf5_file, SharedCArray, SharedEArray, \ SharedVLArr...
[ "pypet.SharedTable", "pypet.make_shared_result", "numpy.ones", "pypet.SharedEArray", "pypet.ObjectTable", "numpy.random.randint", "pypet.StorageContextManager", "pypet.compact_hdf5_file", "pandas.DataFrame", "tables.atom.FloatAtom", "tables.Int32Col", "pypet.load_trajectory", "pypet.SharedAr...
[((707, 720), 'tables.Int32Col', 'pt.Int32Col', ([], {}), '()\n', (718, 720), True, 'import tables as pt\n'), ((732, 748), 'tables.StringCol', 'pt.StringCol', (['(15)'], {}), '(15)\n', (744, 748), True, 'import tables as pt\n'), ((763, 779), 'tables.StringCol', 'pt.StringCol', (['(15)'], {}), '(15)\n', (775, 779), True...
from collections import Counter, OrderedDict from logging import getLogger from typing import List from typing import OrderedDict as OrderedDictType from typing import Tuple import numpy as np from ordered_set import OrderedSet from pandas import DataFrame from recording_script_generator.core.types import (ReadingPass...
[ "pandas.DataFrame", "tqdm.tqdm", "numpy.median", "recording_script_generator.core.types.get_utterance_duration_s", "text_utils.get_ngrams", "recording_script_generator.core.types.utterance_to_symbols", "recording_script_generator.core.types.utterance_to_str", "numpy.mean", "numpy.array", "collecti...
[((942, 961), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (951, 961), False, 'from logging import getLogger\n'), ((6309, 6352), 'pandas.DataFrame', 'DataFrame', ([], {'data': 'utterances', 'columns': 'columns'}), '(data=utterances, columns=columns)\n', (6318, 6352), False, 'from pandas import ...
#!/usr/bin/python #-*- coding:utf-8 -*- import sys import struct import numpy as np import tensorflow as tf def floor_divide_f32(): para = [] # init the input data and parameters batch = int(np.random.randint(1, high=4, size=1)) in_channel = int(np.random.randint(16, high=64, size=1)) in_h...
[ "numpy.random.randint", "tensorflow.Session", "numpy.random.normal", "tensorflow.math.floordiv" ]
[((771, 848), 'numpy.random.normal', 'np.random.normal', (['zero_point1', 'std1', '(batch, in_channel, in_height, in_width)'], {}), '(zero_point1, std1, (batch, in_channel, in_height, in_width))\n', (787, 848), True, 'import numpy as np\n'), ((904, 981), 'numpy.random.normal', 'np.random.normal', (['zero_point2', 'std2...
# Copyright 2019 ChangyuLiu 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 applica...
[ "numpy.set_printoptions", "tensorflow.keras.layers.Dense", "tensorflow.keras.Input", "tensorflow.reshape", "tensorflow.concat", "tensorflow.keras.Model", "tensorflow.cast", "tensorflow.keras.utils.get_file", "tensorflow.strings.regex_replace", "tensorflow.equal", "tensorflow.data.experimental.ma...
[((1016, 1068), 'tensorflow.keras.utils.get_file', 'tf.keras.utils.get_file', (['"""train.csv"""', 'TRAIN_DATA_URL'], {}), "('train.csv', TRAIN_DATA_URL)\n", (1039, 1068), True, 'import tensorflow as tf\n'), ((1086, 1136), 'tensorflow.keras.utils.get_file', 'tf.keras.utils.get_file', (['"""eval.csv"""', 'TEST_DATA_URL'...
""" Script name: MalGAN_v2.py Reproduced for reader's convenience from the original code available at: https://github.com/yanminglai/Malware-GAN/blob/master/MalGAN_v2.py Released under GPL 3.0 LICENSE: https://github.com/yanminglai/Malware-GAN/blob/master/LICENSE """ from keras.layers import Input, Dense,...
[ "sklearn.model_selection.train_test_split", "numpy.ones", "keras.models.Model", "matplotlib.pyplot.figure", "numpy.random.randint", "keras.layers.Input", "numpy.add", "sklearn.ensemble.RandomForestClassifier", "matplotlib.pyplot.show", "matplotlib.pyplot.legend", "keras.optimizers.Adam", "kera...
[((1089, 1103), 'keras.optimizers.Adam', 'Adam', ([], {'lr': '(0.001)'}), '(lr=0.001)\n', (1093, 1103), False, 'from keras.optimizers import Adam\n'), ((1657, 1693), 'keras.layers.Input', 'Input', ([], {'shape': '(self.apifeature_dims,)'}), '(shape=(self.apifeature_dims,))\n', (1662, 1693), False, 'from keras.layers im...
import csv import numpy as np from mpl_toolkits import mplot3d import matplotlib.pyplot as plt fig = plt.figure() ax = plt.axes(projection='3d') f=open('consensus_line_2.csv') csv_f = csv.reader(f) agent2=[] agent4=[] agent5=[] agent7=[] dt=[] i=0 csv_f=csv.reader(f) for row in csv_f: a=(row[0]) a=a[1:...
[ "csv.reader", "matplotlib.pyplot.show", "matplotlib.pyplot.axes", "matplotlib.pyplot.figure", "numpy.array", "numpy.fromstring" ]
[((108, 120), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (118, 120), True, 'import matplotlib.pyplot as plt\n'), ((126, 151), 'matplotlib.pyplot.axes', 'plt.axes', ([], {'projection': '"""3d"""'}), "(projection='3d')\n", (134, 151), True, 'import matplotlib.pyplot as plt\n'), ((194, 207), 'csv.reader',...
import tensorflow as tf import numpy as np import streamlit as st from PIL import Image import cv2 def app(): filters = st.sidebar.selectbox("Select filters",("Pencil Sketch","Detail Enhancement","Bilateral Filter","Pencil Edges","White Box")) st.write(filters) def resize_crop(image...
[ "cv2.GaussianBlur", "streamlit.image", "cv2.bitwise_and", "cv2.medianBlur", "cv2.adaptiveThreshold", "numpy.clip", "numpy.shape", "cv2.bilateralFilter", "streamlit.sidebar.selectbox", "cv2.cvtColor", "cv2.imwrite", "cv2.detailEnhance", "cv2.divide", "cv2.resize", "cv2.Laplacian", "stre...
[((149, 281), 'streamlit.sidebar.selectbox', 'st.sidebar.selectbox', (['"""Select filters"""', "('Pencil Sketch', 'Detail Enhancement', 'Bilateral Filter', 'Pencil Edges',\n 'White Box')"], {}), "('Select filters', ('Pencil Sketch',\n 'Detail Enhancement', 'Bilateral Filter', 'Pencil Edges', 'White Box'))\n", (16...
import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import os import json from typing import List import pandas as pd import re import ir_thermography.thermometry as irt import matplotlib.ticker as ticker import matplotlib.gridspec as gridspec # base_path = r'C:\Users\erick\OneDrive\Documents\u...
[ "pandas.DataFrame", "json.load", "matplotlib.pyplot.show", "os.path.join", "numpy.abs", "numpy.empty", "matplotlib.rcParams.update", "numpy.empty_like", "matplotlib.pyplot.figure", "os.path.splitext", "numpy.linspace", "ir_thermography.thermometry.PDThermometer", "matplotlib.ticker.MultipleL...
[((943, 974), 'matplotlib.rcParams.update', 'mpl.rcParams.update', (['plot_style'], {}), '(plot_style)\n', (962, 974), True, 'import matplotlib as mpl\n'), ((990, 1004), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1002, 1004), True, 'import matplotlib.pyplot as plt\n'), ((1061, 1102), 'numpy.empty_...
# flake8: noqa import pandas as pd import numpy import anndata import os from scipy import sparse # -----------------------------------------------------------------# # General example information SCHEMA_VERSION = "2.0.0" FIXTURES_ROOT = os.path.join(os.path.dirname(__file__)) # --------------------------------------...
[ "pandas.DataFrame", "os.path.dirname", "numpy.zeros", "scipy.sparse.csr_matrix", "os.path.join", "pandas.concat" ]
[((385, 421), 'os.path.join', 'os.path.join', (['FIXTURES_ROOT', '"""h5ads"""'], {}), "(FIXTURES_ROOT, 'h5ads')\n", (397, 421), False, 'import os\n'), ((435, 479), 'os.path.join', 'os.path.join', (['h5ad_dir', '"""example_valid.h5ad"""'], {}), "(h5ad_dir, 'example_valid.h5ad')\n", (447, 479), False, 'import os\n'), ((4...
import os import json import joblib import numpy as np from scipy.stats import rankdata import scipy.stats from sklearn.metrics import mean_squared_error from .... import logger from ...setup.setup import Session from .... import MODELS_PATH MAX_N = 10 class Predictor(object): def __init__(self, mdl): ...
[ "os.listdir", "numpy.load", "json.load", "numpy.median", "os.path.exists", "numpy.zeros", "scipy.stats.rankdata", "numpy.argsort", "numpy.min", "numpy.max", "numpy.array", "numpy.random.choice", "joblib.load", "os.path.join", "sklearn.metrics.mean_squared_error", "numpy.sqrt" ]
[((498, 509), 'numpy.array', 'np.array', (['p'], {}), '(p)\n', (506, 509), True, 'import numpy as np\n'), ((527, 538), 'numpy.array', 'np.array', (['q'], {}), '(q)\n', (535, 538), True, 'import numpy as np\n'), ((741, 760), 'numpy.sqrt', 'np.sqrt', (['divergence'], {}), '(divergence)\n', (748, 760), True, 'import numpy...
from random import random import gym # os.chdir(os.path.join(os.path.abspath(os.path.curdir), "hw1/")) import load_policy import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import tf_util from keras import Sequential from keras.layers import Dense def roll_out(env_name, policy_fn, render=Fals...
[ "gym.make", "matplotlib.pyplot.plot", "keras.Sequential", "tensorflow.Session", "random.random", "numpy.vstack", "keras.layers.Dense", "numpy.array", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "tf_util.initialize" ]
[((354, 372), 'gym.make', 'gym.make', (['env_name'], {}), '(env_name)\n', (362, 372), False, 'import gym\n'), ((1153, 1165), 'keras.Sequential', 'Sequential', ([], {}), '()\n', (1163, 1165), False, 'from keras import Sequential\n'), ((1515, 1539), 'matplotlib.pyplot.plot', 'plt.plot', (['novice_returns'], {}), '(novice...
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
[ "numpy.append", "logging.getLogger" ]
[((768, 795), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (785, 795), False, 'import logging\n'), ((3478, 3505), 'numpy.append', 'np.append', (['output', 'ext2_out'], {}), '(output, ext2_out)\n', (3487, 3505), True, 'import numpy as np\n')]
import matplotlib.pyplot as plt import numpy as np def plot_curve(data, plot_file, keys=None, clip=True, label_min=True, label_end=True): if not keys: keys = data.keys() plt.figure() for i,key in enumerate(keys): plt.subplot(len(keys),1,i+1) if clip: lim...
[ "numpy.abs", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "numpy.clip", "numpy.argmin", "matplotlib.pyplot.figure", "numpy.min", "matplotlib.pyplot.savefig" ]
[((204, 216), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (214, 216), True, 'import matplotlib.pyplot as plt\n'), ((807, 829), 'matplotlib.pyplot.savefig', 'plt.savefig', (['plot_file'], {}), '(plot_file)\n', (818, 829), True, 'import matplotlib.pyplot as plt\n'), ((834, 845), 'matplotlib.pyplot.close',...
''' Date: Feb, 2020 Author: <NAME> , <NAME> This file is originally from "'Double DIP" (https://github.com/yossigandelsman/DoubleDIP) Some modifications are built to define the baselines ''' import glob import torch import torch.nn as nn import torch.nn.functional as F import torchvision import matplotlib import m...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.clf", "PIL.ImageCms.applyTransform", "numpy.clip", "numpy.mean", "numpy.rot90", "torch.arange", "glob.glob", "os.path.join", "torch.nn.functional.pad", "matplotlib.pyplot.close", "matplotlib.pyplot.imshow", "os.path.exists", "torch.exp", "tor...
[((517, 538), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (531, 538), False, 'import matplotlib\n'), ((1683, 1745), 'torch.nn.functional.pad', 'F.pad', (['x', '(padding, padding, padding, padding)'], {'mode': '"""reflect"""'}), "(x, (padding, padding, padding, padding), mode='reflect')\n", (16...
# BUILD THE PROJECT WITH THE CORRECT PYTHON VERSION # pip install wheel # python setup.py bdist_wheel # OR python setup.py sdist bdist_wheel (to include the source) # for python 3.8 # C:\Users\yoann\AppData\Roaming\Python\Python38\Scripts\twine upload # --verbose --repository testpypi dist/IndexMapping-1.0.3-...
[ "setuptools.Extension", "numpy.get_include", "setuptools.find_packages", "warnings.filterwarnings" ]
[((1154, 1216), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', category=DeprecationWarning)\n", (1177, 1216), False, 'import warnings\n'), ((1218, 1275), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'Futu...
""" Configuration to get the same results every time. https://keras.io/getting-started/faq/#how-can-i-obtain-reproducible-results-using-keras-during-development """ import os import random as rn import numpy as np import tensorflow as tf from keras import backend as K # Set up random seed to # get the same results ...
[ "numpy.random.seed", "tensorflow.compat.v1.get_default_graph", "keras.backend.set_session", "tensorflow.compat.v1.set_random_seed", "random.seed", "tensorflow.compat.v1.ConfigProto" ]
[((532, 550), 'numpy.random.seed', 'np.random.seed', (['rs'], {}), '(rs)\n', (546, 550), True, 'import numpy as np\n'), ((551, 562), 'random.seed', 'rn.seed', (['rs'], {}), '(rs)\n', (558, 562), True, 'import random as rn\n'), ((579, 671), 'tensorflow.compat.v1.ConfigProto', 'tf.compat.v1.ConfigProto', ([], {'intra_op_...
import sys sys.path.insert(0, ".") # from trimesh.exchange.obj import load_obj import trimesh import cv2 import numpy as np from nara.camera import Camera from nara.vis import Plot from nara.rasterizing import rasterizing camera = 10 frame = 250 person = "377" # extri_fpath = f"data/easymocap/extri_{camera}.yml" #...
[ "numpy.load", "trimesh.load", "nara.vis.Plot", "sys.path.insert", "nara.rasterizing.rasterizing", "cv2.imread", "cv2.FileStorage", "numpy.min", "numpy.max", "nara.camera.Camera" ]
[((12, 35), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""."""'], {}), "(0, '.')\n", (27, 35), False, 'import sys\n'), ((975, 1012), 'cv2.FileStorage', 'cv2.FileStorage', (['intri_fpath'], {'flags': '(0)'}), '(intri_fpath, flags=0)\n', (990, 1012), False, 'import cv2\n'), ((1027, 1064), 'cv2.FileStorage', 'cv2.Fil...
import argparse import joblib import os import numpy as np import pandas as pd # sklearn from sklearn.compose import ColumnTransformer from sklearn.compose import make_column_selector as selector from sklearn.pipeline import Pipeline from sklearn.impute import SimpleImputer from sklearn.experimental import enable_iter...
[ "sklearn.impute.SimpleImputer", "sklearn.preprocessing.StandardScaler", "argparse.ArgumentParser", "os.makedirs", "sklearn.compose.make_column_selector", "sklearn.model_selection.train_test_split", "azureml.core.run.Run.get_context", "joblib.dump", "numpy.float", "sklearn.preprocessing.OneHotEncod...
[((969, 994), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (992, 994), False, 'import argparse\n'), ((1659, 1676), 'azureml.core.run.Run.get_context', 'Run.get_context', ([], {}), '()\n', (1674, 1676), False, 'from azureml.core.run import Run\n'), ((2232, 2259), 'numpy.array', 'np.array', (["...
#!/usr/bin/python3.7 import argparse, json, gc, matplotlib, numpy, os, random, sys import tensorflow, tensorly, sklearn.linear_model import tensorflow.keras as keras tensorflow.config.experimental.set_visible_devices (devices=[], device_type='GPU') matplotlib.use ('Agg') import matplotlib.pyplot import scipy.cluster.h...
[ "numpy.absolute", "matplotlib.pyplot.yscale", "os.remove", "tensorflow.keras.layers.MaxPooling2D", "argparse.ArgumentParser", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "numpy.sum", "tensorly.kruskal_tensor.kruskal_to_tensor", "random.shuffle", "numpy.random.random_sampl...
[((167, 253), 'tensorflow.config.experimental.set_visible_devices', 'tensorflow.config.experimental.set_visible_devices', ([], {'devices': '[]', 'device_type': '"""GPU"""'}), "(devices=[], device_type=\n 'GPU')\n", (217, 253), False, 'import tensorflow, tensorly, sklearn.linear_model\n'), ((250, 271), 'matplotlib.us...
# Copyright (c) 2015-2018 by the parties listed in the AUTHORS # file. All rights reserved. Use of this source code is governed # by a BSD-style license that can be found in the LICENSE file. from toast_planck.reproc_modules.destriping import FancyDestriperPol from toast.mpi import MPI from toast.tests.mpi import M...
[ "numpy.random.seed", "toast_planck.reproc_modules.destriping.FancyDestriperPol", "numpy.logical_and", "numpy.sum", "numpy.random.randn", "numpy.abs", "healpy.reorder", "numpy.logical_not", "numpy.zeros", "numpy.ones", "numpy.hstack", "numpy.sin", "numpy.arange", "numpy.array", "numpy.cos...
[((615, 802), 'toast_planck.reproc_modules.destriping.FancyDestriperPol', 'FancyDestriperPol', (['self.npix', 'self.nnz', 'MPI.COMM_WORLD'], {'do_offset': '(True)', 'do_gain': '(True)', 'do_pol_eff': '(True)', 'do_pol_angle': '(True)', 'ndegrade': '(4)', 'fsample': '(1.0)', 'lowpassfreq': '(0.1)', 'dir_out': '"""test""...
import cv2 # Import relevant libraries import numpy as np from pymouse import PyMouse if __name__ == '__main__': # img = cv2.imread('Landscape.jpg', 0) # Read in image img1 = cv2.imread('LandscapeGrey.jpg',0) # Read in image img2 = cv2.imread('LandscapeGrey2.jpg',0) # Read in image dst2 = cv2.resize(i...
[ "cv2.waitKey", "numpy.ones", "pymouse.PyMouse", "cv2.imread", "cv2.imshow", "cv2.resize" ]
[((185, 219), 'cv2.imread', 'cv2.imread', (['"""LandscapeGrey.jpg"""', '(0)'], {}), "('LandscapeGrey.jpg', 0)\n", (195, 219), False, 'import cv2\n'), ((246, 281), 'cv2.imread', 'cv2.imread', (['"""LandscapeGrey2.jpg"""', '(0)'], {}), "('LandscapeGrey2.jpg', 0)\n", (256, 281), False, 'import cv2\n'), ((308, 342), 'cv2.r...
import gc from typing import Tuple import numpy as np import torch def get_embed_dropout(config): if hasattr(config, 'embd_pdrop'): return config.embd_pdrop if hasattr(config, 'embed_dropout'): return config.embed_dropout def get_embed_dim(config): if hasattr(config, "hidden_size"): ...
[ "torch.ones", "gc.collect", "numpy.cumsum", "torch.Tensor", "torch.arange", "torch.cuda.empty_cache", "numpy.argwhere", "torch.sum", "torch.nn.Module" ]
[((1545, 1569), 'torch.cuda.empty_cache', 'torch.cuda.empty_cache', ([], {}), '()\n', (1567, 1569), False, 'import torch\n'), ((1578, 1590), 'gc.collect', 'gc.collect', ([], {}), '()\n', (1588, 1590), False, 'import gc\n'), ((1862, 1886), 'torch.cuda.empty_cache', 'torch.cuda.empty_cache', ([], {}), '()\n', (1884, 1886...
import random import numpy as np from environment import Env from keras.layers.core import Dense from keras.optimizers import Adam from keras.models import Sequential EPISODES = 1000 class DeepSARSAgent: def __init__(self): self.load_model = False # actions which agent can do self.action_...
[ "environment.Env", "numpy.reshape" ]
[((855, 860), 'environment.Env', 'Env', ([], {}), '()\n', (858, 860), False, 'from environment import Env\n'), ((1054, 1080), 'numpy.reshape', 'np.reshape', (['state', '[1, 15]'], {}), '(state, [1, 15])\n', (1064, 1080), True, 'import numpy as np\n'), ((1364, 1395), 'numpy.reshape', 'np.reshape', (['next_state', '[1, 1...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2021 Idiap Research Institute, http://www.idiap.ch/ # Written by <NAME> <<EMAIL>> # # System imports. import arff import argparse import glob import logging import os import shutil import subprocess import sys import tempfile from typing import List, Tu...
[ "os.path.abspath", "logging.debug", "argparse.ArgumentParser", "logging.basicConfig", "idiaptts.misc.normalisation.MeanStdDevExtractor.MeanStdDevExtractor", "os.path.basename", "subprocess.check_output", "numpy.asarray", "tempfile.mkdtemp", "shutil.rmtree", "os.path.join", "sys.exit" ]
[((4757, 4796), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (4776, 4796), False, 'import logging\n'), ((4811, 4914), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter...
import numpy as np def bit_get(val, idx): return (val >> idx) & 1 def create_generic_colormap(n): colormap = np.zeros((n, 3), dtype=int) ind = np.arange(n, dtype=int) for shift in reversed(range(8)): for channel in range(3): colormap[:, channel] |= bit_get(ind, channel) << shift ...
[ "numpy.zeros", "numpy.arange" ]
[((117, 144), 'numpy.zeros', 'np.zeros', (['(n, 3)'], {'dtype': 'int'}), '((n, 3), dtype=int)\n', (125, 144), True, 'import numpy as np\n'), ((155, 178), 'numpy.arange', 'np.arange', (['n'], {'dtype': 'int'}), '(n, dtype=int)\n', (164, 178), True, 'import numpy as np\n')]
# NumCosmo implementation of CLMModeling import gi gi.require_version('NumCosmo', '1.0') gi.require_version('NumCosmoMath', '1.0') from gi.repository import NumCosmo as Nc from gi.repository import NumCosmoMath as Ncm import math import numpy as np from .parent_class import CLMMCosmology __all__ = [] class NumCos...
[ "gi.repository.NumCosmo.Distance.new", "gi.repository.NumCosmo.HICosmo.new_from_name", "gi.require_version", "numpy.vectorize" ]
[((52, 89), 'gi.require_version', 'gi.require_version', (['"""NumCosmo"""', '"""1.0"""'], {}), "('NumCosmo', '1.0')\n", (70, 89), False, 'import gi\n'), ((90, 131), 'gi.require_version', 'gi.require_version', (['"""NumCosmoMath"""', '"""1.0"""'], {}), "('NumCosmoMath', '1.0')\n", (108, 131), False, 'import gi\n'), ((10...
import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm from time import time import os import h5mapper as h5m # last dim of data D = 256 class RandnArray(h5m.Array): def __init__(self, n, **ds_kwargs): self.n = n self.__ds_kwargs__.update(ds_kwargs) def load(self, source)...
[ "os.remove", "tqdm.tqdm", "matplotlib.pyplot.show", "numpy.random.randn", "matplotlib.pyplot.subplots", "time.time", "h5mapper.GetId", "matplotlib.pyplot.tight_layout" ]
[((1930, 1944), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1942, 1944), True, 'import matplotlib.pyplot as plt\n'), ((2274, 2292), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (2290, 2292), True, 'import matplotlib.pyplot as plt\n'), ((2297, 2307), 'matplotlib.pyplot.sho...
import io import sys import numpy as np def read_input_npy(filepath): if not filepath and sys.stdin.isatty(): raise RuntimeError("Please specify the npy_filepath or give npy file via stdin.") data = filepath.read_bytes() if filepath else sys.stdin.buffer.read() buf = io.BytesIO() buf.write(da...
[ "io.BytesIO", "numpy.save", "sys.stdin.isatty", "numpy.load", "sys.stdin.buffer.read" ]
[((291, 303), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (301, 303), False, 'import io\n'), ((351, 382), 'numpy.load', 'np.load', (['buf'], {'allow_pickle': '(True)'}), '(buf, allow_pickle=True)\n', (358, 382), True, 'import numpy as np\n'), ((423, 435), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (433, 435), Fals...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F def hidden_init(layer): fan_in = layer.weight.data.size()[0] lim = 1. / np.sqrt(fan_in) return -lim, lim class ActorNetwork(nn.Module): def __init__(self, observation_size, action_size, use_batch_norm, seed, ...
[ "torch.manual_seed", "torch.nn.BatchNorm1d", "torch.cat", "torch.nn.Linear", "numpy.sqrt" ]
[((168, 183), 'numpy.sqrt', 'np.sqrt', (['fan_in'], {}), '(fan_in)\n', (175, 183), True, 'import numpy as np\n'), ((1275, 1328), 'torch.nn.Linear', 'nn.Linear', (['observation_size', 'fc1_units'], {'bias': 'use_bias'}), '(observation_size, fc1_units, bias=use_bias)\n', (1284, 1328), True, 'import torch.nn as nn\n'), ((...
#' % HW19 - BIOE232 #' % <NAME> #' % May 7, 2015 #' My First Python Script! # For outputting nice HTML file/PDF # import pweave import pprint as pp # All the essentials import numpy as np # np.__version__ import matplotlib.pyplot as plt import math from decimal import * from pylab import * #' Question 1 # Declare ...
[ "matplotlib.pyplot.figure", "math.log10", "pprint.pprint", "numpy.linspace" ]
[((369, 396), 'numpy.linspace', 'np.linspace', (['(0)', '(14)'], {'num': '(140)'}), '(0, 14, num=140)\n', (380, 396), True, 'import numpy as np\n'), ((456, 480), 'pprint.pprint', 'pp.pprint', (["['Ka = ', Ka]"], {}), "(['Ka = ', Ka])\n", (465, 480), True, 'import pprint as pp\n'), ((481, 507), 'pprint.pprint', 'pp.ppri...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Copyright 2020 Huawei Technologies Co., Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unles...
[ "acl.op.cast", "acl.op.create_attr", "numpy.dtype", "numpy.array", "acl.rt.synchronize_stream", "acl.rt.destroy_stream", "acl.op.execute" ]
[((1443, 1462), 'numpy.dtype', 'np.dtype', (['"""float16"""'], {}), "('float16')\n", (1451, 1462), True, 'import numpy as np\n'), ((2577, 2694), 'acl.op.cast', 'acl.op.cast', (['self.tensor_in.desc', 'self.tensor_in.buff', 'self.tensor_out.desc', 'self.tensor_out.buff', '(0)', 'self.stream'], {}), '(self.tensor_in.desc...
# all seam carving helper functions # this file will be used as a custom module import cv2 as cv import numpy as np def draw_vertical_seam(img, seam): img_seam = img.copy() # extracting the points from the seam points = [(index, int(item)) for index, item in enumerate(seam)] x_coords, y_coords = np....
[ "cv2.resize", "cv2.cvtColor", "cv2.waitKey", "cv2.destroyAllWindows", "numpy.transpose", "numpy.zeros", "numpy.argmin", "cv2.addWeighted", "numpy.hstack", "cv2.imread", "cv2.convertScaleAbs", "cv2.imshow", "cv2.Sobel", "numpy.vstack" ]
[((317, 337), 'numpy.transpose', 'np.transpose', (['points'], {}), '(points)\n', (329, 337), True, 'import numpy as np\n'), ((612, 632), 'numpy.transpose', 'np.transpose', (['coords'], {}), '(coords)\n', (624, 632), True, 'import numpy as np\n'), ((787, 822), 'cv2.cvtColor', 'cv.cvtColor', (['img', 'cv.COLOR_BGR2GRAY']...
import os import numpy as np from skimage import io dask_available = True try: from dask import array as da except ImportError: dask_available = False def imread(filenames, *, use_dask=None, stack=True): """Read image files and return an array. If multiple images are selected, they are stacked alon...
[ "numpy.stack", "dask.array.stack", "os.path.splitext", "skimage.io.imread", "dask.array.from_zarr" ]
[((1066, 1085), 'skimage.io.imread', 'io.imread', (['filename'], {}), '(filename)\n', (1075, 1085), False, 'from skimage import io\n'), ((2074, 2104), 'os.path.splitext', 'os.path.splitext', (['filenames[0]'], {}), '(filenames[0])\n', (2090, 2104), False, 'import os\n'), ((1215, 1231), 'dask.array.stack', 'da.stack', (...
""" This is a procedural interface to the yttalab library <EMAIL> The following commands are provided: Design and plot commands dlqr - Discrete linear quadratic regulator d2c - discrete to continous time conversion full_obs - full order observer red_obs - reduced order observer comp_f...
[ "scipy.linalg.logm", "scipy.linalg.eigvals", "numpy.zeros", "numpy.hstack", "numpy.shape", "numpy.around", "numpy.imag", "scipy.linalg.inv", "numpy.real", "numpy.eye", "scipy.finfo", "numpy.mat", "numpy.vstack", "numpy.sqrt" ]
[((1493, 1501), 'numpy.shape', 'shape', (['a'], {}), '(a)\n', (1498, 1501), False, 'from numpy import hstack, vstack, imag, zeros, eye, mat, shape, real, around, sqrt\n'), ((1512, 1520), 'numpy.shape', 'shape', (['b'], {}), '(b)\n', (1517, 1520), False, 'from numpy import hstack, vstack, imag, zeros, eye, mat, shape, r...
# This is automatically-generated code. # Uses the jinja2 library for templating. import cvxpy as cp import numpy as np import scipy as sp # setup problemID = "max_softmax_epigraph_0" prob = None opt_val = None problemID = problemID + "_epigraph" # Variable declarations import scipy.sparse as sps def norma...
[ "numpy.random.seed", "numpy.sum", "numpy.random.randn", "numpy.ones", "numpy.random.randint", "scipy.sparse.rand", "numpy.arange", "cvxpy.Variable", "cvxpy.sum_largest", "cvxpy.sum_squares", "cvxpy.Minimize" ]
[((683, 700), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (697, 700), True, 'import numpy as np\n'), ((805, 831), 'numpy.random.randint', 'np.random.randint', (['(0)', 'k', 'm'], {}), '(0, k, m)\n', (822, 831), True, 'import numpy as np\n'), ((984, 1001), 'cvxpy.Variable', 'cp.Variable', (['n', 'k'],...
#!/bin/env python """ @author: <NAME> Co-authors: <NAME>, <NAME> Creates a customizable image sequence for the spectrum of an audio file. """ from arguments import args, initArgs, processArgs # Handles arguments from styles import renderFrame # Handles styles from audio2numpy import open_audio # Works with ...
[ "os.mkdir", "os.remove", "numpy.load", "numpy.fft.rfft", "cv2.VideoWriter_fourcc", "os.path.isfile", "numpy.mean", "matplotlib.pyplot.imsave", "cv2.VideoWriter", "arguments.initArgs", "styles.renderFrame", "os.path.exists", "numpy.max", "subprocess.Popen", "numpy.ceil", "numpy.log2", ...
[((9213, 9270), 'subprocess.Popen', 'subprocess.Popen', (['arguments'], {'stdout': 'stdout', 'stderr': 'stderr'}), '(arguments, stdout=stdout, stderr=stderr)\n', (9229, 9270), False, 'import subprocess\n'), ((9340, 9377), 'os.remove', 'remove', (["(args.destination + '/vidList')"], {}), "(args.destination + '/vidList')...
from __future__ import print_function from decimal import Decimal from numpy import round, subtract import matplotlib.pyplot as plt class AStarGraph(object): # Define a class board like grid with two barriers def __init__(self, walls): self.barriers = [] for wall in walls: self.b...
[ "numpy.round", "matplotlib.pyplot.plot", "matplotlib.pyplot.show" ]
[((873, 894), 'numpy.round', 'round', (['(pos[0] + dx)', '(2)'], {}), '(pos[0] + dx, 2)\n', (878, 894), False, 'from numpy import round, subtract\n'), ((912, 933), 'numpy.round', 'round', (['(pos[1] + dy)', '(2)'], {}), '(pos[1] + dy, 2)\n', (917, 933), False, 'from numpy import round, subtract\n'), ((1027, 1041), 'num...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 31 16:29:33 2019 @author: jlee """ import time start_time = time.time() import numpy as np import glob, os import g0_init_cfg as ic # ----- Line number (to be revised!) ----- # pk_line = 1400 ''' Line for finding peaks (gfreduce) Line/column fo...
[ "pyraf.iraf.gfdisplay", "pyraf.iraf.sleep", "pyraf.iraf.gfresponse", "os.getcwd", "os.system", "time.time", "numpy.loadtxt", "pyraf.iraf.gfreduce", "pyraf.iraf.unlearn", "pyraf.iraf.gfscatsub", "pyraf.iraf.chdir", "os.chdir", "pyraf.iraf.imdelete" ]
[((133, 144), 'time.time', 'time.time', ([], {}), '()\n', (142, 144), False, 'import time\n'), ((472, 483), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (481, 483), False, 'import glob, os\n'), ((484, 505), 'os.chdir', 'os.chdir', (['ic.dir_iraf'], {}), '(ic.dir_iraf)\n', (492, 505), False, 'import glob, os\n'), ((567, ...
# -*- coding: utf-8 -*- """ The main purpose of this script, is to encapsulate all the functionalities for Exploratory Data Analysis (EDA) problems. Letting the user run simple analysis on input data (CSV format). Credits: ------- Author: <NAME> (@LukeMaxMusic) License: MIT License 2020 Ref...
[ "streamlit.text_input", "pptx.util.Pt", "pandas.read_csv", "nbformat.write", "streamlit.title", "streamlit.sidebar.title", "matplotlib.pyplot.figure", "seaborn.pairplot", "streamlit.sidebar.button", "streamlit.subheader", "streamlit.sidebar.checkbox", "streamlit.button", "streamlit.sidebar.m...
[((686, 746), 'streamlit.set_option', 'st.set_option', (['"""deprecation.showfileUploaderEncoding"""', '(False)'], {}), "('deprecation.showfileUploaderEncoding', False)\n", (699, 746), True, 'import streamlit as st\n'), ((986, 1007), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (997, 1007), Tru...
import numpy as np import time import matplotlib.pyplot as plt from scipy import interpolate from mpl_toolkits.mplot3d import Axes3D import math class InterpolationLine(): def __init__(self, x, y, z=0): self.number_of_point = 25 if not z == 0: "To use 3D plot" points = Poin...
[ "math.fabs", "scipy.interpolate.splprep", "matplotlib.pyplot.figure", "numpy.linspace", "scipy.interpolate.splev" ]
[((760, 809), 'scipy.interpolate.splprep', 'interpolate.splprep', (['[self.x, self.y]'], {'s': '(100)', 'k': '(2)'}), '([self.x, self.y], s=100, k=2)\n', (779, 809), False, 'from scipy import interpolate\n'), ((837, 867), 'scipy.interpolate.splev', 'interpolate.splev', (['tck[0]', 'tck'], {}), '(tck[0], tck)\n', (854, ...
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import argparse import numpy as np import itertools import torch.utils.data import torch.nn.functional as F from torch.optim.lr_sch...
[ "argparse.ArgumentParser", "numpy.ones", "json.dumps", "numpy.arange", "egg.zoo.channel.features.OneHotLoaderCompositionality", "egg.core.reinforce_wrappers.RnnReceiverCompositionality", "egg.core.reinforce_wrappers.CompositionalitySenderImpatientReceiverRnnReinforce", "egg.core.util.dump_sender_recei...
[((1154, 1179), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1177, 1179), False, 'import argparse\n'), ((6035, 6060), 'egg.core.init', 'core.init', (['parser', 'params'], {}), '(parser, params)\n', (6044, 6060), True, 'import egg.core as core\n'), ((10483, 10576), 'egg.core.dump_sender_recei...
#!/usr/bin/env python """ determine whether bitboard, piece-list coordinate or mailbox is best bitboard (12, 8, 8): third order tensor bitboard_vector (768): flattened third order tensor small_bitboard_vector (384): with -1.0 values for black piece_list (384): normalised rank, file, 8-rank and file for pieces in lis...
[ "chess.Board", "numpy.zeros" ]
[((587, 603), 'chess.Board', 'chess.Board', (['fen'], {}), '(fen)\n', (598, 603), False, 'import chess\n'), ((619, 639), 'numpy.zeros', 'np.zeros', (['(12, 8, 8)'], {}), '((12, 8, 8))\n', (627, 639), True, 'import numpy as np\n'), ((1201, 1217), 'chess.Board', 'chess.Board', (['fen'], {}), '(fen)\n', (1212, 1217), Fals...
#!/usr/bin/env python # -*- coding: utf-8 -*- # This software is under a BSD license. See LICENSE.txt for details. import numpy as np def _times_considered_same(t1, t2): """docstring for _times_considered_same""" return abs(t1 - t2) <= 0.000001 * (t1 + t2) class DTSeries(object): """Base class for seri...
[ "numpy.array" ]
[((5816, 5846), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.float64'}), '([], dtype=np.float64)\n', (5824, 5846), True, 'import numpy as np\n')]
import numpy as np import signal_tl as stl a = stl.Predicate("a") > 0 b = stl.Predicate("b") <= 0.5 phi = stl.Until(a, b) t = np.linspace(0, 50, 201) x = np.cos(t) y = np.sin(t) trace = { "a": stl.Signal(x, t), "b": stl.Signal(x, t), } rob = stl.compute_robustness(phi, trace) print(rob.at(0))
[ "signal_tl.Predicate", "signal_tl.Signal", "numpy.sin", "signal_tl.Until", "numpy.cos", "numpy.linspace", "signal_tl.compute_robustness" ]
[((109, 124), 'signal_tl.Until', 'stl.Until', (['a', 'b'], {}), '(a, b)\n', (118, 124), True, 'import signal_tl as stl\n'), ((130, 153), 'numpy.linspace', 'np.linspace', (['(0)', '(50)', '(201)'], {}), '(0, 50, 201)\n', (141, 153), True, 'import numpy as np\n'), ((158, 167), 'numpy.cos', 'np.cos', (['t'], {}), '(t)\n',...
""" File: cartpole.py Created: 2017-03-06 By <NAME>, <EMAIL> Description: -- Python 3.6 -- Solve the CartPole-v0 problem: - observed features are expanded with a random transform to ensure linear separability. - action selection is by dot product of an expanded observation with a weight vector. - a queued history of ...
[ "numpy.random.uniform", "gym.make", "random.shuffle", "numpy.linalg.norm", "statistics.mean", "numpy.random.normal", "collections.deque" ]
[((862, 885), 'gym.make', 'gym.make', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (870, 885), False, 'import gym\n'), ((1855, 1908), 'numpy.random.normal', 'normal', ([], {'scale': '(1.0)', 'size': '(expandedLength, inputLength)'}), '(scale=1.0, size=(expandedLength, inputLength))\n', (1861, 1908), False, 'from n...
import numpy as np from lumi_language_id import LanguageIdentifier, data_file class MultiLayerPerceptron: """ A simple implementation of an MLP classifier. This implementation has no training code, but can be used to run a 'frozen' classifier that was trained by scikit-learn. """ def __init__(sel...
[ "lumi_language_id.data_file", "numpy.load", "lumi_language_id.LanguageIdentifier", "numpy.maximum", "numpy.array", "numpy.exp", "numpy.savez" ]
[((2035, 2063), 'numpy.savez', 'np.savez', (['filename'], {}), '(filename, **arrays)\n', (2043, 2063), True, 'import numpy as np\n'), ((2217, 2234), 'numpy.load', 'np.load', (['filename'], {}), '(filename)\n', (2224, 2234), True, 'import numpy as np\n'), ((3785, 3822), 'lumi_language_id.LanguageIdentifier', 'LanguageId...
import numpy as np from metod_alg import metod_analysis as mt_ays def evaluate_quantities_with_points(beta, x_tr, y_tr, d, g, func_args): """ For trajectories x^(k_x) and y^(k_y), where k_x = (0,...,K_x) and k_y = (0,...,K_y), evaluate quantites. Parameters --...
[ "numpy.round", "numpy.zeros", "numpy.sum", "metod_alg.metod_analysis.check_quantities" ]
[((1627, 1643), 'numpy.zeros', 'np.zeros', (['(4, 2)'], {}), '((4, 2))\n', (1635, 1643), True, 'import numpy as np\n'), ((1659, 1670), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (1667, 1670), True, 'import numpy as np\n'), ((2169, 2218), 'metod_alg.metod_analysis.check_quantities', 'mt_ays.check_quantities', ([...
# pylint: skip-file import numpy as np from nasbench_asr.quiet_tensorflow import tensorflow as tf def preprocess( *, ds, encoder, featurizer, norm_stats=None, epsilon=0.001, num_parallel_calls=tf.data.experimental.AUTOTUNE, deterministic=True, max_feature_size=0 ): """ Args...
[ "numpy.load", "nasbench_asr.quiet_tensorflow.tensorflow.shape", "nasbench_asr.quiet_tensorflow.tensorflow.saturate_cast", "nasbench_asr.quiet_tensorflow.tensorflow.math.sqrt" ]
[((1223, 1242), 'numpy.load', 'np.load', (['norm_stats'], {}), '(norm_stats)\n', (1230, 1242), True, 'import numpy as np\n'), ((1467, 1484), 'nasbench_asr.quiet_tensorflow.tensorflow.shape', 'tf.shape', (['feature'], {}), '(feature)\n', (1475, 1484), True, 'from nasbench_asr.quiet_tensorflow import tensorflow as tf\n')...
#! python3 # -*- encoding: utf-8 -*- ''' @Time : 2021/07/13 @Author : jincheng.lyu 1. Get all categories 2. Generate label for each image 3. All images by using multithreading ''' import cv2 import datetime import glob import imagesize import json import mmcv import numpy as np import os import os.path as osp...
[ "json.dump", "tqdm.tqdm", "imagesize.get", "argparse.ArgumentParser", "os.path.basename", "cv2.imread", "datetime.datetime.utcnow", "numpy.where", "glob.glob", "os.path.join", "os.listdir", "mmdet.core.get_classes" ]
[((917, 939), 'imagesize.get', 'imagesize.get', (['imgpath'], {}), '(imgpath)\n', (930, 939), False, 'import imagesize\n'), ((1055, 1075), 'os.listdir', 'os.listdir', (['dataroot'], {}), '(dataroot)\n', (1065, 1075), False, 'import os\n'), ((1863, 1893), 'glob.glob', 'glob.glob', (["(dataroot + '/*.png')"], {}), "(data...
from os import remove from unittest import TestCase from PIL import Image import numpy as np from requests import get, post from screamshot import bytes_to_file def _rmsd(img1, img2): img1 = (img1 - np.mean(img1)) / (np.std(img1)) img2 = (img2 - np.mean(img2)) / (np.std(img2)) return np.sqrt(np.mean((...
[ "os.remove", "numpy.std", "PIL.Image.open", "numpy.mean", "screamshot.bytes_to_file", "requests.get", "requests.post" ]
[((227, 239), 'numpy.std', 'np.std', (['img1'], {}), '(img1)\n', (233, 239), True, 'import numpy as np\n'), ((278, 290), 'numpy.std', 'np.std', (['img2'], {}), '(img2)\n', (284, 290), True, 'import numpy as np\n'), ((311, 338), 'numpy.mean', 'np.mean', (['((img1 - img2) ** 2)'], {}), '((img1 - img2) ** 2)\n', (318, 338...
import threading import anki_vector from anki_vector import events import numpy as np import argparse import cv2 import torch import anki_vector from anki_vector.events import Events from anki_vector.util import degrees import threading from models.with_mobilenet import PoseEstimationWithMobileNet from modules.keypo...
[ "numpy.ones", "utils.detect_touch", "cv2.rectangle", "cv2.imshow", "utils.detect_hand", "torch.load", "modules.pose.Pose", "threading.Event", "models.with_mobilenet.PoseEstimationWithMobileNet", "cv2.circle", "cv2.waitKey", "utils.detect_face", "cv2.addWeighted", "modules.keypoints.group_k...
[((838, 900), 'demo.infer_fast', 'infer_fast', (['net', 'img', 'height_size', 'stride', 'upsample_ratio', 'cpu'], {}), '(net, img, height_size, stride, upsample_ratio, cpu)\n', (848, 900), False, 'from demo import infer_fast\n'), ((1260, 1315), 'modules.keypoints.group_keypoints', 'group_keypoints', (['all_keypoints_by...