code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import cv2 import numpy as np import scipy def gabor_filter(im, orient, freq, kx=0.65, ky=0.65): #Gabor filtresi, kenar algılama için kullanılan doğrusal bir filtredir #Gauss ile modüle edilmis, belirli frekans ve yönelimdeki sinüzoidal düzlem angleInc = 3 im = np.double(im) #im double türüne cevrilir ...
[ "numpy.meshgrid", "numpy.double", "numpy.power", "numpy.zeros", "numpy.shape", "numpy.max", "numpy.where", "numpy.array", "numpy.linspace", "numpy.cos", "numpy.round", "scipy.ndimage.rotate", "numpy.unique" ]
[((276, 289), 'numpy.double', 'np.double', (['im'], {}), '(im)\n', (285, 289), True, 'import numpy as np\n'), ((398, 420), 'numpy.zeros', 'np.zeros', (['(rows, cols)'], {}), '((rows, cols))\n', (406, 420), True, 'import numpy as np\n'), ((818, 851), 'numpy.unique', 'np.unique', (['non_zero_elems_in_freq'], {}), '(non_z...
import socket import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np from math import sqrt import time import thread address = (socket.gethostbyname(socket.gethostname()),5555) s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.bind(address) print(address[0],'listen at port',...
[ "matplotlib.pyplot.show", "math.sqrt", "matplotlib.pyplot.ylim", "socket.socket", "thread.start_new_thread", "matplotlib.animation.FuncAnimation", "numpy.ma.array", "socket.gethostname", "numpy.arange", "matplotlib.pyplot.subplots" ]
[((220, 268), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (233, 268), False, 'import socket\n'), ((343, 357), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (355, 357), True, 'import matplotlib.pyplot as plt\n'), ((362, 384),...
''' utils.py Series of functions to make life a bit easier @amanmajid ''' import os import numpy as np import pandas as pd import geopandas as gpd from . import spatial from .meta import * from .params import * #--- # Conversions #--- def kwh_to_gwh(x): '''Kilowatt hours to Gigawatt hours ...
[ "os.makedirs", "pandas.merge", "os.path.exists", "pandas.concat", "numpy.concatenate" ]
[((5132, 5188), 'pandas.merge', 'pd.merge', (['mappable', 'time_ref'], {'on': '"""timestep"""', 'how': '"""right"""'}), "(mappable, time_ref, on='timestep', how='right')\n", (5140, 5188), True, 'import pandas as pd\n'), ((5638, 5664), 'numpy.concatenate', 'np.concatenate', (['tt'], {'axis': '(0)'}), '(tt, axis=0)\n', (...
# -*- coding: utf-8 -*- """ Specific Case for 4D data (time, wavelength, two spatial axes) """ from __future__ import absolute_import import glob import datetime import itertools import numpy as np import matplotlib.pyplot as plt import scipy.ndimage as ndimage import scipy.interpolate as interpolate from matplotlib ...
[ "numpy.load", "numpy.abs", "numpy.mean", "numpy.arange", "glob.glob", "sunpy.wcs.get_center", "numpy.max", "numpy.linspace", "matplotlib.pyplot.subplots", "datetime.datetime.now", "matplotlib.pyplot.get_cmap", "scipy.ndimage.interpolation.map_coordinates", "numpy.min", "numpy.savez", "ma...
[((879, 902), 'numpy.zeros', 'np.zeros', (['[self.res, 2]'], {}), '([self.res, 2])\n', (887, 902), True, 'import numpy as np\n'), ((3502, 3534), 'scipy.interpolate.splprep', 'interpolate.splprep', (['[x, y]'], {'k': 'k'}), '([x, y], k=k)\n', (3521, 3534), True, 'import scipy.interpolate as interpolate\n'), ((3612, 3640...
import numpy from distutils.core import setup from Cython.Build import cythonize from distutils.extension import Extension ext_modules = [ Extension("atomset", ["atomset.pyx"], include_dirs = ["."]), Extension("SymmetryContactMapEvaluator", ["SymmetryContactMapEvaluator.pyx"], include_dirs = ["."]), ...
[ "distutils.extension.Extension", "Cython.Build.cythonize", "numpy.get_include" ]
[((149, 206), 'distutils.extension.Extension', 'Extension', (['"""atomset"""', "['atomset.pyx']"], {'include_dirs': "['.']"}), "('atomset', ['atomset.pyx'], include_dirs=['.'])\n", (158, 206), False, 'from distutils.extension import Extension\n'), ((218, 320), 'distutils.extension.Extension', 'Extension', (['"""Symmetr...
#!/usr/bin/env python3 """ Script to detect Tandem Repeats in a specified fasta file containing protein sequences using TRAL. Output will be generated in a specified output directory (which will be made if it does not exist). Output will consist of one .tsv file and one .pkl file for each protein in which a TR is detec...
[ "numpy.load", "tral.configuration.Configuration.instance", "Bio.SeqIO.parse", "argparse.ArgumentParser", "tral.repeat_list.repeat_list.RepeatList", "os.makedirs", "tral.paths.config_file", "os.path.isdir", "os.path.dirname", "tral.repeat_list.repeat_list.two_repeats_overlap", "collections.defaul...
[((1695, 1720), 'logging.getLogger', 'logging.getLogger', (['"""root"""'], {}), "('root')\n", (1712, 1720), False, 'import logging\n'), ((2478, 2514), 'Bio.SeqIO.parse', 'SeqIO.parse', (['sequences_file', '"""fasta"""'], {}), "(sequences_file, 'fasta')\n", (2489, 2514), False, 'from Bio import SeqIO\n'), ((10377, 10413...
import numpy as np print(np.empty(3)) # [ -3.10503618e+231 -3.10503618e+231 -3.10503618e+231] print(np.empty((2, 3))) # [[ -3.10503618e+231 2.68677888e+154 6.92663118e-310] # [ 1.06099790e-313 6.92663119e-310 4.17211958e-309]] print(np.empty(3).dtype) # float64 print(np.empty(3, dtype=np.int)) # [-11529...
[ "numpy.empty", "numpy.empty_like", "numpy.arange" ]
[((26, 37), 'numpy.empty', 'np.empty', (['(3)'], {}), '(3)\n', (34, 37), True, 'import numpy as np\n'), ((104, 120), 'numpy.empty', 'np.empty', (['(2, 3)'], {}), '((2, 3))\n', (112, 120), True, 'import numpy as np\n'), ((284, 309), 'numpy.empty', 'np.empty', (['(3)'], {'dtype': 'np.int'}), '(3, dtype=np.int)\n', (292, ...
import numpy as np from funcy import print_durations def read_bingo(file): draws = np.loadtxt(file, max_rows=1, delimiter=",", dtype=int) boards = np.loadtxt(file, skiprows=1, dtype=int) return draws, boards.reshape((-1, 5, 5)) def eval_bingo(draws, boards): matches = np.zeros_like(boards, dtype=bo...
[ "numpy.zeros_like", "numpy.zeros", "numpy.loadtxt" ]
[((89, 143), 'numpy.loadtxt', 'np.loadtxt', (['file'], {'max_rows': '(1)', 'delimiter': '""","""', 'dtype': 'int'}), "(file, max_rows=1, delimiter=',', dtype=int)\n", (99, 143), True, 'import numpy as np\n'), ((157, 196), 'numpy.loadtxt', 'np.loadtxt', (['file'], {'skiprows': '(1)', 'dtype': 'int'}), '(file, skiprows=1...
import numpy as np from .entities.baseentity import BaseEntity from .entities.player import PlayerEntity from .entities.bullet import BulletEntity class Engine: def __init__(self): self.size = np.array([540, 720], dtype=float) self.player = PlayerEntity(v=1) self.entities = [self.player] ...
[ "numpy.array" ]
[((208, 241), 'numpy.array', 'np.array', (['[540, 720]'], {'dtype': 'float'}), '([540, 720], dtype=float)\n', (216, 241), True, 'import numpy as np\n')]
import sys sys.path.append('../../george/build/lib.linux-x86_64-3.6') import george from george.modeling import Model from george import kernels import numpy as np import matplotlib.pyplot as pl """ Simulated dataset from http://george.readthedocs.io/en/latest/tutorials/model """ class Model(Model): parameter...
[ "matplotlib.pyplot.title", "numpy.random.seed", "numpy.exp", "sys.path.append", "numpy.random.randn", "numpy.isfinite", "george.kernels.ExpSquaredKernel", "matplotlib.pyplot.errorbar", "george.modeling.Model", "matplotlib.pyplot.ylim", "matplotlib.pyplot.ylabel", "statsmodels.datasets.co2.load...
[((12, 70), 'sys.path.append', 'sys.path.append', (['"""../../george/build/lib.linux-x86_64-3.6"""'], {}), "('../../george/build/lib.linux-x86_64-3.6')\n", (27, 70), False, 'import sys\n'), ((557, 577), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (571, 577), True, 'import numpy as np\n'), ((105...
import numpy as np import pandas as pd import geopandas import json from shapely.geometry import MultiPoint from tqdm import tqdm def read_geojson_with_power(path_to_geojson): """Reads a GeoJSON with a list in one of the features GeoPandas does not import lists from GeoJSON. We need a power list for eac...
[ "pandas.DataFrame", "tqdm.tqdm", "json.load", "shapely.geometry.MultiPoint", "geopandas.GeoDataFrame", "numpy.array", "numpy.arange" ]
[((1060, 1074), 'numpy.array', 'np.array', (['rest'], {}), '(rest)\n', (1068, 1074), True, 'import numpy as np\n'), ((1084, 1187), 'pandas.DataFrame', 'pd.DataFrame', (['rest'], {'columns': "['max_ASP_FZG', 'max_ASP_PW', 'max_ASP_LI', 'max_ASP_LW', 'max_ASP_LZ']"}), "(rest, columns=['max_ASP_FZG', 'max_ASP_PW', 'max_AS...
import tensorflow as tf import numpy as np import random from matplotlib import image as Image from matplotlib import pyplot as plt import glob from skimage import io,transform import os import scipy.io as scio class DataLoader(object): def __init__(self, batch_size,input_size=np.array([224,224]...
[ "skimage.io.imread", "numpy.dtype", "random.seed", "numpy.tile", "numpy.array", "skimage.transform.resize", "os.listdir", "numpy.random.shuffle" ]
[((302, 322), 'numpy.array', 'np.array', (['[224, 224]'], {}), '([224, 224])\n', (310, 322), True, 'import numpy as np\n'), ((420, 441), 'random.seed', 'random.seed', (['(20190222)'], {}), '(20190222)\n', (431, 441), False, 'import random\n'), ((623, 655), 'numpy.array', 'np.array', (['[127.11, 77.02, 50.64]'], {}), '(...
import sys, os, csv import pandas as pd import numpy as np from tqdm import tqdm from datetime import datetime, timedelta sys.path.append(os.getcwd()) from ml_earthquake.preprocess import _midnight, _distance class _PredictionArea: def __init__(self, name, center_lat, center_lng, radius_meters, threshold_mag) -> ...
[ "csv.writer", "os.getcwd", "pandas.read_csv", "ml_earthquake.preprocess._distance", "datetime.timedelta", "ml_earthquake.preprocess._midnight", "datetime.datetime.now", "numpy.concatenate" ]
[((139, 150), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (148, 150), False, 'import sys, os, csv\n'), ((577, 629), 'pandas.read_csv', 'pd.read_csv', (['"""data/swarms.csv"""'], {'parse_dates': "['date']"}), "('data/swarms.csv', parse_dates=['date'])\n", (588, 629), True, 'import pandas as pd\n'), ((770, 783), 'csv.wri...
import numpy as np from cython_bbox import bbox_overlaps as bbox_ious import os data_root = '/home/hust/yly/Dataset/MOT16/train/' seqs = os.listdir(data_root) seqs = sorted(seqs) for seq in seqs: path_in = os.path.join(data_root,seq,'gt/gt.txt') input_ = np.loadtxt(path_in, delimiter=',') input_ = input_[np...
[ "numpy.sum", "numpy.lexsort", "cython_bbox.bbox_overlaps", "numpy.max", "numpy.loadtxt", "os.path.join", "os.listdir" ]
[((137, 158), 'os.listdir', 'os.listdir', (['data_root'], {}), '(data_root)\n', (147, 158), False, 'import os\n'), ((210, 251), 'os.path.join', 'os.path.join', (['data_root', 'seq', '"""gt/gt.txt"""'], {}), "(data_root, seq, 'gt/gt.txt')\n", (222, 251), False, 'import os\n'), ((263, 297), 'numpy.loadtxt', 'np.loadtxt',...
import os import sys sys.path.append('/export/u1/homes/weichao/Workspace/disentangling-vae/') from disvae.utils.modelIO import save_model, load_model, load_metadata from disvae.models.losses import LOSSES, RECON_DIST from disvae.models.vae import MODELS from utils.datasets import get_dataloaders, get_img_size, DATASET...
[ "sys.path.append", "os.mkdir", "utils.mnist_classifier.Net", "torch.no_grad", "numpy.argmax", "torchvision.transforms.ToPILImage", "numpy.zeros", "torch.empty", "datetime.datetime.now", "disvae.utils.modelIO.load_model", "utils.datasets.get_dataloaders", "os.path.join", "torch.tensor" ]
[((21, 93), 'sys.path.append', 'sys.path.append', (['"""/export/u1/homes/weichao/Workspace/disentangling-vae/"""'], {}), "('/export/u1/homes/weichao/Workspace/disentangling-vae/')\n", (36, 93), False, 'import sys\n'), ((855, 882), 'os.path.join', 'os.path.join', (['ROOT_DIR', 'vae'], {}), '(ROOT_DIR, vae)\n', (867, 882...
#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, <NAME> (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-2017, <NAME> (www...
[ "aeneas.globalfunctions.file_can_be_read", "numpy.outer", "numpy.sum", "numpy.copy", "numpy.zeros", "numpy.searchsorted", "aeneas.globalfunctions.can_run_c_extension", "numpy.argmin", "numpy.append", "aeneas.audiofilemfcc.AudioFileMFCC", "numpy.array", "aeneas.globalfunctions.run_c_extension_w...
[((8194, 8232), 'numpy.array', 'numpy.array', (['[t[0] for t in wave_path]'], {}), '([t[0] for t in wave_path])\n', (8205, 8232), False, 'import numpy\n'), ((8256, 8294), 'numpy.array', 'numpy.array', (['[t[1] for t in wave_path]'], {}), '([t[1] for t in wave_path])\n', (8267, 8294), False, 'import numpy\n'), ((12485, ...
""" """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np class Norm(object): """ * singletance pattern * discrete player position onto sparse map (shape=[100,50]) """ __instance = None COLS...
[ "numpy.stack", "numpy.load", "numpy.minimum", "numpy.maximum", "numpy.amin", "numpy.zeros", "numpy.ones", "numpy.amax" ]
[((5368, 5404), 'numpy.ones', 'np.ones', ([], {'shape': '[32, 100, 64, 32, 11]'}), '(shape=[32, 100, 64, 32, 11])\n', (5375, 5404), True, 'import numpy as np\n'), ((1652, 1690), 'numpy.zeros', 'np.zeros', ([], {'shape': '[shape_[0], shape_[1]]'}), '(shape=[shape_[0], shape_[1]])\n', (1660, 1690), True, 'import numpy as...
import numpy as np import hvwfg as hv from numba import njit from desdeo_tools.scalarization import SimpleASF @njit() def epsilon_indicator(reference_front: np.ndarray, front: np.ndarray) -> float: """Computes the additive epsilon-indicator between reference front and current approximating front. Args: ...
[ "desdeo_tools.scalarization.SimpleASF", "numba.njit", "numpy.arange" ]
[((114, 120), 'numba.njit', 'njit', ([], {}), '()\n', (118, 120), False, 'from numba import njit\n'), ((934, 940), 'numba.njit', 'njit', ([], {}), '()\n', (938, 940), False, 'from numba import njit\n'), ((1722, 1740), 'numpy.arange', 'np.arange', (['ref_len'], {}), '(ref_len)\n', (1731, 1740), True, 'import numpy as np...
import numpy as np class PCA: """ PCA: mathematical technique used for dimensionality reduction Attributes: array (list): A matrix of elements """ def __init__(self, array): self.arr = array def calculate(self): self.arr = np.array(self.arr) # Calculate mean ...
[ "numpy.cov", "numpy.mean", "numpy.array", "numpy.linalg.eig" ]
[((275, 293), 'numpy.array', 'np.array', (['self.arr'], {}), '(self.arr)\n', (283, 293), True, 'import numpy as np\n'), ((338, 365), 'numpy.mean', 'np.mean', (['self.arr.T'], {'axis': '(1)'}), '(self.arr.T, axis=1)\n', (345, 365), True, 'import numpy as np\n'), ((544, 563), 'numpy.cov', 'np.cov', (['arr_scale.T'], {}),...
import argparse import datetime import os import sys import numpy as np import pandas as pd from flee.datamanager import read_period # This Script filters the discharge dataset based on simulation period and # the Micro model locations! parser = argparse.ArgumentParser() parser.add_argument( "--input_dir", requ...
[ "os.path.abspath", "pandas.Timestamp", "argparse.ArgumentParser", "datetime.datetime.strptime", "pandas.to_datetime", "datetime.timedelta", "numpy.asscalar", "os.path.join" ]
[((249, 274), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (272, 274), False, 'import argparse\n'), ((551, 589), 'os.path.join', 'os.path.join', (['work_dir', 'args.input_dir'], {}), '(work_dir, args.input_dir)\n', (563, 589), False, 'import os\n'), ((602, 641), 'os.path.join', 'os.path.join'...
#! /usr/bin/env python """ This script provides wrapper functions for processing Sentinel-1 GRD products. """ # import stdlib modules import os from os.path import join as opj import numpy as np import json import glob import shutil import itertools # geo libs import gdal import fiona import imageio import rasterio i...
[ "os.remove", "numpy.nan_to_num", "gdal.BuildVRTOptions", "os.path.isfile", "rasterio.mask.mask", "os.path.join", "matplotlib.pyplot.imshow", "numpy.transpose", "itertools.product", "rasterio.features.shapes", "numpy.dstack", "numpy.uint8", "numpy.ma.masked_where", "os.path.basename", "im...
[((708, 743), 'gdal.Open', 'gdal.Open', (['rasterfn', 'gdal.GA_Update'], {}), '(rasterfn, gdal.GA_Update)\n', (717, 743), False, 'import gdal\n'), ((4332, 4355), 'numpy.nan_to_num', 'np.nan_to_num', (['db_array'], {}), '(db_array)\n', (4345, 4355), True, 'import numpy as np\n'), ((7755, 7808), 'itertools.product', 'ite...
from time import time import numpy as np from violin_ocp import Violin, ViolinString, ViolinNMPC, ViolinOcp, Bow, BowTrajectory, BowPosition from bioptim import Solver, OdeSolver def main(): model_name = "WuViolin" violin = Violin(model_name, ViolinString.G) bow = Bow(model_name) # --- OPTIONS --- #...
[ "violin_ocp.Violin", "violin_ocp.BowTrajectory", "violin_ocp.Bow", "time.time", "violin_ocp.ViolinOcp", "violin_ocp.ViolinNMPC", "numpy.tile", "bioptim.Solver.IPOPT", "numpy.concatenate", "bioptim.OdeSolver.RK4" ]
[((235, 269), 'violin_ocp.Violin', 'Violin', (['model_name', 'ViolinString.G'], {}), '(model_name, ViolinString.G)\n', (241, 269), False, 'from violin_ocp import Violin, ViolinString, ViolinNMPC, ViolinOcp, Bow, BowTrajectory, BowPosition\n'), ((280, 295), 'violin_ocp.Bow', 'Bow', (['model_name'], {}), '(model_name)\n'...
import numpy as np import torch from utils.misc import round_down class Sampler(torch.utils.data.Sampler): def __init__(self, data_source, nPerSpeaker, max_seg_per_spk, batch_size, distributed, seed, **kwargs): self.data_source = data_source self.data_label = data_source.data_label ...
[ "numpy.arange", "torch.Generator" ]
[((563, 580), 'torch.Generator', 'torch.Generator', ([], {}), '()\n', (578, 580), False, 'import torch\n'), ((1475, 1492), 'numpy.arange', 'np.arange', (['numSeg'], {}), '(numSeg)\n', (1484, 1492), True, 'import numpy as np\n')]
import numpy as np from math import cos, sin np.set_printoptions(suppress=True, precision=6) def Quaternion2Euler(quat): e0 = quat[0] e1 = quat[1] e2 = quat[2] e3 = quat[3] phi = np.arctan2(2 * (e0 * e1 + e2 * e3), (e0 ** 2 + e3 ** 2 - e1 ** 2 - e2 ** 2)) theta = np.arcsin(2 * (e0 * e2 - e1 ...
[ "numpy.set_printoptions", "numpy.arctan2", "numpy.copy", "numpy.zeros", "numpy.arcsin", "math.sin", "numpy.sin", "numpy.array", "math.cos", "numpy.cos" ]
[((46, 93), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)', 'precision': '(6)'}), '(suppress=True, precision=6)\n', (65, 93), True, 'import numpy as np\n'), ((203, 277), 'numpy.arctan2', 'np.arctan2', (['(2 * (e0 * e1 + e2 * e3))', '(e0 ** 2 + e3 ** 2 - e1 ** 2 - e2 ** 2)'], {}), '(2 * (e0 ...
"""Kinematic model for the robot that deals with the motors and servos.""" import numpy as np from src.config import TIMESTEP, V_CALIB, G_CALIB, SIMULATION from src import picar from src import utils as u class Bicycle(object): def __init__(self): self.pose = None self.v = 0 self.gamma = 0...
[ "src.picar.run_action", "numpy.rad2deg", "src.picar.run_speed", "numpy.fabs", "numpy.sin", "numpy.cos" ]
[((875, 899), 'src.picar.run_speed', 'picar.run_speed', (['picar_v'], {}), '(picar_v)\n', (890, 899), False, 'from src import picar\n'), ((1120, 1159), 'src.picar.run_action', 'picar.run_action', (['f"""fwturn:{turnangle}"""'], {}), "(f'fwturn:{turnangle}')\n", (1136, 1159), False, 'from src import picar\n'), ((1321, 1...
#!/usr/bin/env python # # Implementation of Value-Guided Model Identification (VGMI) in Python. # The approach is from "Fast Model Identification via Physics Engines # for Data-Efficient Policy Search", <NAME>, <NAME>, # <NAME>, <NAME>, IJCAI 2018. # https://arxiv.org/abs/1710.08893 # import random import math import...
[ "GPy.models.GPRegression", "random.choice", "numpy.array", "numpy.linalg.norm", "GPy.kern.RBF", "numpy.linspace", "numpy.squeeze", "math.log" ]
[((546, 582), 'numpy.linspace', 'np.linspace', ([], {'start': '(0)', 'stop': '(1)', 'num': '(21)'}), '(start=0, stop=1, num=21)\n', (557, 582), True, 'import numpy as np\n'), ((1446, 1461), 'GPy.kern.RBF', 'GPy.kern.RBF', (['(7)'], {}), '(7)\n', (1458, 1461), False, 'import GPy\n'), ((1474, 1511), 'GPy.models.GPRegress...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Make plots illustrating MSIDset.interpolate() % skatest (or skadev) $ export ENG_ARCHIVE=/proj/sot/ska/data/eng_archive $ ipython --classic >>> run -i make_interpolate >>> plot_em() """ import numpy as np from Ska.Matplotlib import plot_cxctime from...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "Ska.engarchive.fetch_eng.MSIDset", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "numpy.flatnonzero", "matplotlib.pyplot.figure", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "Ska.Matplotlib....
[((402, 488), 'Ska.engarchive.fetch_eng.MSIDset', 'fetch.MSIDset', (["['aosares1', 'pitch_fss']", '"""2010:001:00:00:00"""', '"""2010:001:00:00:20"""'], {}), "(['aosares1', 'pitch_fss'], '2010:001:00:00:00',\n '2010:001:00:00:20')\n", (415, 488), True, 'from Ska.engarchive import fetch_eng as fetch\n'), ((1023, 1043...
''' This script configures and executes experiments for evaluating recurrent autoencoding approaches useful for learning informative representations of sequentially observed patient health. After configuring the specific settings and hyperparameters for the selected autoencoder, the experiment can be specified to: (1)...
[ "sys.path.append", "os.path.abspath", "numpy.set_printoptions", "numpy.random.seed", "argparse.ArgumentParser", "os.makedirs", "yaml.safe_dump", "torch.manual_seed", "os.path.realpath", "os.path.exists", "numpy.random.RandomState", "torch.utils.tensorboard.SummaryWriter", "torch.device", "...
[((1650, 1675), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (1665, 1675), False, 'import sys\n'), ((1676, 1738), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)', 'linewidth': '(200)', 'precision': '(2)'}), '(suppress=True, linewidth=200, precision=2)\n', (1695, ...
import tensorflow as tf from tensorflow.models.rnn import rnn_cell, seq2seq import numpy as np class CharRNN: def __init__(self, args, infer=False): self.args = args if infer: args.batch_size = 1 args.seq_length = 1 if args.model == 'rnn': cell_fn = r...
[ "tensorflow.reduce_sum", "numpy.sum", "numpy.argmax", "tensorflow.reshape", "tensorflow.matmul", "tensorflow.Variable", "tensorflow.get_variable", "tensorflow.nn.softmax", "tensorflow.variable_scope", "tensorflow.concat", "tensorflow.placeholder", "numpy.cumsum", "tensorflow.models.rnn.seq2s...
[((642, 689), 'tensorflow.models.rnn.rnn_cell.MultiRNNCell', 'rnn_cell.MultiRNNCell', (['([cell] * args.num_layers)'], {}), '([cell] * args.num_layers)\n', (663, 689), False, 'from tensorflow.models.rnn import rnn_cell, seq2seq\n'), ((717, 777), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32', '[args.batch_siz...
import numpy as np import logging import torch import torch.nn as nn import torch.nn.functional as F from torch import nn from torch.autograd import Variable import torch from crowd_nav.policy.cadrl import mlp, mlp2, conv_mlp, conv_mlp2 from crowd_nav.policy.multi_human_rl import MultiHumanRL class AFAModule(nn.Modu...
[ "torch.mean", "crowd_nav.policy.cadrl.conv_mlp2", "torch.eye", "torch.nn.Conv1d", "torch.cat", "torch.mul", "torch.nn.functional.softmax", "torch.exp", "numpy.random.random", "torch.cuda.is_available", "numpy.array", "torch.Tensor", "torch.sum", "crowd_nav.policy.cadrl.mlp" ]
[((1841, 1901), 'torch.nn.Conv1d', 'nn.Conv1d', (['(hidden_dim + input_dim)', 'hidden_dim', '(1)'], {'bias': '(False)'}), '(hidden_dim + input_dim, hidden_dim, 1, bias=False)\n', (1850, 1901), False, 'from torch import nn\n'), ((1921, 1981), 'torch.nn.Conv1d', 'nn.Conv1d', (['(hidden_dim + input_dim)', 'hidden_dim', '(...
import numpy def check_valid_permutation(permutation): """Check that a given container contains a valid permutation. Parameters ---------- permutation : array-like, 1-dimensional An array, list, etc. Returns ------- permutation : ndarray, 1-dimensional An ndarray of integ...
[ "numpy.asarray" ]
[((496, 522), 'numpy.asarray', 'numpy.asarray', (['permutation'], {}), '(permutation)\n', (509, 522), False, 'import numpy\n')]
#!/usr/bin/env python from __future__ import print_function from keras.engine import Layer from keras import backend as K class Interleave(Layer): """Special-purpose layer for interleaving sequences. Intended to merge a sequence of word vectors with a sequence of vectors representing dependencies a (wo...
[ "keras.backend.concatenate", "keras.layers.LSTM", "numpy.asanyarray", "keras.models.Model", "keras.backend.ndim", "numpy.arange", "keras.layers.Embedding", "keras.layers.Input" ]
[((2077, 2094), 'keras.layers.Input', 'Input', ([], {'shape': '(3,)'}), '(shape=(3,))\n', (2082, 2094), False, 'from keras.layers import Input, Embedding, LSTM, Masking\n'), ((2106, 2123), 'keras.layers.Input', 'Input', ([], {'shape': '(2,)'}), '(shape=(2,))\n', (2111, 2123), False, 'from keras.layers import Input, Emb...
#!/usr/bin/env python3 # Copyright 2018 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ "os.mkdir", "cv2.GaussianBlur", "argparse.ArgumentParser", "cv2.bitwise_and", "numpy.argmax", "cv2.VideoWriter_fourcc", "numpy.ones", "numpy.clip", "bbox_writer.read_bboxes", "numpy.linalg.norm", "cv2.imshow", "os.path.join", "cv2.cvtColor", "os.path.dirname", "cv2.setMouseCallback", "...
[((2610, 2741), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description_text', 'epilog': 'epilog_text', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=description_text, epilog=epilog_text,\n formatter_class=argparse.RawDescriptionHelpFormatter)\n', (2633, 2...
import numpy as np from layer import SegmentationDilation from paz import processors as pr from paz.abstract import SequentialProcessor, Processor, Box2D from processors_SE3 import CalculatePseudoInverse, RotationMatrixfromAxisAngles from processors_SE3 import CanonicaltoRelativeFrame, KeypointstoPalmFrame from proces...
[ "processors_keypoints.CropImageFromMask", "paz.processors.DrawBoxes2D", "processors_SE3.CalculatePseudoInverse", "processors_standard.MergeDictionaries", "processors_SE3.RotationMatrixfromAxisAngles", "paz.processors.LoadImage", "paz.processors.NormalizeImage", "processors_SE3.TransformVisibilityMask"...
[((2143, 2210), 'paz.processors.UnpackDictionary', 'pr.UnpackDictionary', (["['image', 'segmentation_label', 'annotations']"], {}), "(['image', 'segmentation_label', 'annotations'])\n", (2162, 2210), True, 'from paz import processors as pr\n'), ((2522, 2565), 'paz.processors.UnpackDictionary', 'pr.UnpackDictionary', ([...
from __future__ import print_function import argparse import os import random import time import torch.optim as optim import torch.utils.data from pointnet.dataset import ShapeNetDataset, ModelNetDataset, HDF5_ModelNetDataset from pointnet.model import PointNetCls, feature_transform_regularizer import torch.nn.function...
[ "pointnet.dataset.ShapeNetDataset", "os.path.abspath", "torch.optim.lr_scheduler.StepLR", "os.makedirs", "random.randint", "argparse.ArgumentParser", "pointnet.model.PointNetCls", "time.strftime", "misc.common_functions.write_log", "random.seed", "torch.nn.functional.nll_loss", "pointnet.datas...
[((472, 497), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (495, 497), False, 'import argparse\n'), ((1454, 1490), 'os.makedirs', 'os.makedirs', (['opt.outf'], {'exist_ok': '(True)'}), '(opt.outf, exist_ok=True)\n', (1465, 1490), False, 'import os\n'), ((1516, 1550), 'time.strftime', 'time.st...
import numpy as np from ..external import constants def write_optional(destination, optional, continuation, *args, **kwargs): if optional is None: destination.write(constants.bool.pack(False)) else: destination.write(constants.bool.pack(True)) continuation(destination, optional, *arg...
[ "numpy.nditer", "numpy.array" ]
[((626, 666), 'numpy.array', 'np.array', (['array'], {'dtype': 'dtype', 'copy': '(False)'}), '(array, dtype=dtype, copy=False)\n', (634, 666), True, 'import numpy as np\n'), ((848, 903), 'numpy.nditer', 'np.nditer', (['array', "('refs_ok', 'zerosize_ok')"], {'order': '"""F"""'}), "(array, ('refs_ok', 'zerosize_ok'), or...
""" TODO: Add doc string. """ import os import numpy as np import pandas as pd from numpy import average CLUSTERED_FILENAME_POSFIX = "_clustered" CLUSTER_NAME_COLUMN_LABEL = "cluster_label" SUM_PRE_CITATIONS_COLUMN_LABEL = "SumPreRawCitations" SUM_POST_CITATIONS_COLUMN_LABEL = "SumPostRawCitations" class Base(obj...
[ "numpy.average", "numpy.sum", "os.path.basename", "pandas.read_csv", "os.walk", "numpy.max", "os.path.splitext", "os.path.join" ]
[((853, 879), 'os.path.basename', 'os.path.basename', (['filename'], {}), '(filename)\n', (869, 879), False, 'import os\n'), ((1965, 1978), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (1972, 1978), False, 'import os\n'), ((2876, 2917), 'pandas.read_csv', 'pd.read_csv', (['filename'], {'header': '(0)', 'sep': '"""...
def get_top_candidate(data): top_el = None top_val = 0 for el in data['votes']: votes = int(el['votes']) if votes > top_val: top_val = votes top_el = el output = {} if top_el is None: print(f"{data['county_name']} {data['uat_name']}") raise Val...
[ "osmnx.great_circle_vec", "unidecode.unidecode", "numpy.std", "numpy.array", "requests.request" ]
[((816, 841), 'unidecode.unidecode', 'unidecode.unidecode', (['name'], {}), '(name)\n', (835, 841), False, 'import unidecode\n'), ((2186, 2235), 'requests.request', 'requests.request', (['"""GET"""', 'url'], {'headers': '{}', 'data': '{}'}), "('GET', url, headers={}, data={})\n", (2202, 2235), False, 'import requests\n...
import numpy as np from typing import List, Tuple MEAN, STD = [0.485, 0.456, 0.406], [0.229, 0.224, 0.225] def normalize(image: np.ndarray) -> np.ndarray: """Normalized an image (or a set of images), as per https://pytorch.org/docs/1.0.0/torchvision/models.html Specifically, images are normalized to ra...
[ "numpy.random.rand", "numpy.moveaxis" ]
[((1588, 1618), 'numpy.random.rand', 'np.random.rand', (['dataset_length'], {}), '(dataset_length)\n', (1602, 1618), True, 'import numpy as np\n'), ((723, 755), 'numpy.moveaxis', 'np.moveaxis', (['image', 'source', 'dest'], {}), '(image, source, dest)\n', (734, 755), True, 'import numpy as np\n'), ((1104, 1136), 'numpy...
#!/usr/local/bin/python3 """Script to generate a fixture of a box falling on a saw.""" import argparse import json import pathlib import sys import numpy from fixture_utils import * def generate_fixture(args): """Generate a saw and block.""" fixture = generate_custom_fixture(args) rigid_bodies = fixtur...
[ "numpy.full", "pathlib.Path", "numpy.vstack" ]
[((1286, 1344), 'numpy.vstack', 'numpy.vstack', (['[wheel_inner_vertices, wheel_outer_vertices]'], {}), '([wheel_inner_vertices, wheel_outer_vertices])\n', (1298, 1344), False, 'import numpy\n'), ((1438, 1491), 'numpy.vstack', 'numpy.vstack', (['[wheel_edges, wheel_edges + num_points]'], {}), '([wheel_edges, wheel_edge...
import pyqtgraph as pg from PySide import QtGui, QtCore import numpy as np class QCircRectF(QtCore.QRectF): def __init__(self, center=(0, 0), radius=1, rect=None): self._scale = 1. if rect is not None: self.center = rect.center() super(QCircRectF, self).__init__(rect) ...
[ "numpy.zeros_like", "numpy.multiply", "numpy.arctan2", "skimage.draw.polygon", "PySide.QtGui.QPainterPath", "PySide.QtCore.QPointF", "PySide.QtGui.QMenu", "PySide.QtCore.QRectF", "PySide.QtCore.Signal", "PySide.QtGui.QColor", "numpy.vstack", "PySide.QtGui.QAction", "PySide.QtGui.QPen" ]
[((1598, 1619), 'PySide.QtCore.Signal', 'QtCore.Signal', (['object'], {}), '(object)\n', (1611, 1619), False, 'from PySide import QtGui, QtCore\n'), ((1850, 1869), 'numpy.zeros_like', 'np.zeros_like', (['data'], {}), '(data)\n', (1863, 1869), True, 'import numpy as np\n'), ((5006, 5031), 'skimage.draw.polygon', 'polygo...
import pickle import numpy as np from ssm.utils.remotedata import load_data_factory import ssm import os root_dir = os.path.dirname(os.path.dirname(ssm.__file__)) defaultcal = load_data_factory( "https://owncloud.cta-observatory.org/index.php/s/HuUSjikMcrKqV6t/download", os.path.join(root_dir, "caldata", "defa...
[ "os.path.dirname", "os.path.join", "numpy.ones", "numpy.sqrt" ]
[((133, 162), 'os.path.dirname', 'os.path.dirname', (['ssm.__file__'], {}), '(ssm.__file__)\n', (148, 162), False, 'import os\n'), ((281, 336), 'os.path.join', 'os.path.join', (['root_dir', '"""caldata"""', '"""defaultslowcal.pkl"""'], {}), "(root_dir, 'caldata', 'defaultslowcal.pkl')\n", (293, 336), False, 'import os\...
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
[ "megengine.test.assertTensorClose", "megengine.core.Graph", "pytest.raises", "megengine.functional.softmax", "numpy.random.random", "numpy.random.randint", "helpers.MLP" ]
[((853, 858), 'helpers.MLP', 'MLP', ([], {}), '()\n', (856, 858), False, 'from helpers import MLP\n'), ((952, 968), 'megengine.functional.softmax', 'F.softmax', (['pred0'], {}), '(pred0)\n', (961, 968), True, 'import megengine.functional as F\n'), ((1395, 1430), 'megengine.test.assertTensorClose', 'assertTensorClose', ...
import os from copy import copy import numpy as np import tensorflow as tf import tensorflow.contrib as tc from mpi4py import MPI from common import logger from common.misc_util import boolean_flag from common.mpi_adam import MpiAdam from common.mpi_running_mean_std import RunningMeanStd import common.tf_util as tf_u...
[ "common.logger.info", "tensorflow.clip_by_value", "tensorflow.contrib.layers.l2_regularizer", "numpy.ones", "numpy.clip", "tensorflow.assign", "tensorflow.global_variables", "numpy.mean", "tensorflow.get_default_graph", "os.path.join", "numpy.prod", "common.mpi_adam.MpiAdam", "mpi4py.MPI.COM...
[((650, 678), 'tensorflow.concat', 'tf.concat', (['[y1, y2]'], {'axis': '(-1)'}), '([y1, y2], axis=-1)\n', (659, 678), True, 'import tensorflow as tf\n'), ((1080, 1124), 'tensorflow.reduce_mean', 'tf.reduce_mean', (['x'], {'axis': 'axis', 'keep_dims': '(True)'}), '(x, axis=axis, keep_dims=True)\n', (1094, 1124), True, ...
import numpy as np import shapefile from geopandas import GeoDataFrame from plotnine import ggplot, aes, geom_map, labs, theme, facet_wrap _theme = theme(subplots_adjust={'right': 0.85}) def _point_file(test_file): with shapefile.Writer(test_file, shapefile.POINT) as shp: shp.field('name', 'C') ...
[ "plotnine.theme", "plotnine.labs", "plotnine.facet_wrap", "geopandas.GeoDataFrame.from_file", "shapefile.Writer", "numpy.tile", "numpy.linspace", "plotnine.aes", "plotnine.geom_map", "plotnine.ggplot" ]
[((150, 188), 'plotnine.theme', 'theme', ([], {'subplots_adjust': "{'right': 0.85}"}), "(subplots_adjust={'right': 0.85})\n", (155, 188), False, 'from plotnine import ggplot, aes, geom_map, labs, theme, facet_wrap\n'), ((1946, 1980), 'geopandas.GeoDataFrame.from_file', 'GeoDataFrame.from_file', (['point_file'], {}), '(...
import sys from glob import glob import numpy as np import networkx as nx import pandas as pd import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.colors import ListedColormap from matplotlib.collections import LineCollection from matplotlib import lines, colors from scipy.stats.kde import gaussi...
[ "numpy.abs", "numpy.sum", "numpy.ones", "numpy.argsort", "numpy.arange", "networkx.draw_networkx_nodes", "tracks.tracks_to_pooled", "matplotlib.pyplot.gca", "matplotlib.colors.ListedColormap", "sys.path.append", "matplotlib.colors.Normalize", "matplotlib.pyplot.matshow", "networkx.from_numpy...
[((440, 494), 'sys.path.append', 'sys.path.append', (['"""../multiviewtracks/MultiViewTracks/"""'], {}), "('../multiviewtracks/MultiViewTracks/')\n", (455, 494), False, 'import sys\n'), ((1499, 1533), 'numpy.concatenate', 'np.concatenate', (['speed_distribution'], {}), '(speed_distribution)\n', (1513, 1533), True, 'imp...
# -*- coding: utf-8 -*- """ Binary Sparse Coding (BSC) feeding a Multi Layer Perceptron (MLP) From a given limited number of data points x from a sparse data set X, BSC is trained to generate more data points for a MLP to train, test and validate. BSC and MLP has to given by a parameter file. The parameters has ...
[ "os.mkdir", "os.remove", "numpy.load", "numpy.abs", "pulp.functions.lod", "numpy.empty", "pulp.utils.preprocessing.ZCA", "cPickle.load", "time.strftime", "pulp.functions.RecNegMSAE", "numpy.random.randint", "numpy.mean", "pulp.em.EM", "pulp.utils.parallel.pprint", "matplotlib.pyplot.imre...
[((810, 826), 'os.stat', 'os.stat', (['"""pylib"""'], {}), "('pylib')\n", (817, 826), False, 'import os\n'), ((827, 851), 'sys.path.append', 'sys.path.append', (['"""pylib"""'], {}), "('pylib')\n", (842, 851), False, 'import sys\n'), ((852, 878), 'sys.path.append', 'sys.path.append', (['"""*/utils"""'], {}), "('*/utils...
# --------------------------------------------- # Gaussian elemination # # Author: <NAME> # precision : float64 # precision : float128 # date: 13 May 2018 # hirooarata/gauss_python is licensed under the MIT License. # References: Numerical recipes in C, # : Scientific calculation handbook(Hayato Togawa...
[ "numpy.zeros", "numpy.linalg.solve", "numpy.abs", "numpy.random.randn" ]
[((1131, 1143), 'numpy.abs', 'abs', (['a[k, k]'], {}), '(a[k, k])\n', (1134, 1143), False, 'from numpy import sqrt, real, imag, zeros, array, abs, sum, float64, float128\n'), ((3452, 3473), 'numpy.random.randn', 'np.random.randn', (['n', 'n'], {}), '(n, n)\n', (3467, 3473), True, 'import numpy as np\n'), ((5092, 5104),...
#!/usr/bin/env python3 import os import h5py import numpy as np import matplotlib.pyplot as plt def write_imgs(data_type): """Convert data in HDF5 file to image files. data_type (str): Either "train" or "test". """ dirname = '{}-set'.format(data_type) if not os.path.exists(dirname): os.mk...
[ "os.mkdir", "os.path.exists", "matplotlib.pyplot.imsave", "numpy.array_equal", "matplotlib.pyplot.imread", "os.listdir" ]
[((282, 305), 'os.path.exists', 'os.path.exists', (['dirname'], {}), '(dirname)\n', (296, 305), False, 'import os\n'), ((315, 332), 'os.mkdir', 'os.mkdir', (['dirname'], {}), '(dirname)\n', (323, 332), False, 'import os\n'), ((768, 793), 'matplotlib.pyplot.imsave', 'plt.imsave', (['filename', 'x_i'], {}), '(filename, x...
# # Copyright © 2020 <NAME> <<EMAIL>> # # Distributed under terms of the GPLv3 license. """ """ from os.path import dirname, join import matplotlib.pyplot as plt import numpy as np import tikzplotlib x = np.linspace(-3, 3, 30) box_t = np.abs(x) <= 1 #(np.abs(x) < 1) * (1 - np.abs(x)) sin_t = np.abs(x) <= 1 convolved...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "numpy.abs", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "os.path.dirname", "matplotlib.pyplot.stem", "matplotlib.pyplot.rcParams.update", "numpy.linspace", "matplotlib.pyplot.grid" ]
[((207, 229), 'numpy.linspace', 'np.linspace', (['(-3)', '(3)', '(30)'], {}), '(-3, 3, 30)\n', (218, 229), True, 'import numpy as np\n'), ((497, 538), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'sin_t'], {'linewidth': '(10.0)', 'c': '"""r"""'}), "(x, sin_t, linewidth=10.0, c='r')\n", (505, 538), True, 'import matplot...
import logging import numpy as np from thyme.utils.atomic_symbols import species_to_idgroups def sort_by_force(trj, pred_label, chosen_species: str = None): """ chosen_specie: str, only sort the force error among the atoms with the chosen_species symbol """ forces = trj.force...
[ "numpy.argsort", "thyme.utils.atomic_symbols.species_to_idgroups", "numpy.abs" ]
[((1026, 1044), 'numpy.argsort', 'np.argsort', (['maxdfs'], {}), '(maxdfs)\n', (1036, 1044), True, 'import numpy as np\n'), ((500, 518), 'numpy.argsort', 'np.argsort', (['maxdfs'], {}), '(maxdfs)\n', (510, 518), True, 'import numpy as np\n'), ((584, 616), 'thyme.utils.atomic_symbols.species_to_idgroups', 'species_to_id...
""" The ref module contains the reference matrices and code for calculating the Liouvillian. Operator basis:: { Eq, Ix, Iy, Iz, Sx, Sy, Sz, 2IxSz, 2IySz, 2IzSx, 2IzSy, 2IxSx, 2IxSy, 2IySx, 2IySy, 2IzSz } """ import dataclasses as dc import itertools as it import re ...
[ "numpy.iscomplexobj", "numpy.eye", "numpy.abs", "numpy.asarray", "numpy.zeros", "scipy.stats.norm.pdf", "chemex.nmr.constants.Distribution", "dataclasses.field", "numpy.sign", "numpy.array", "chemex.nmr.constants.XI_RATIO.get", "numpy.linspace", "itertools.product", "numpy.float64", "dat...
[((454, 479), 're.compile', 're.compile', (['"""\\\\[(.+?)\\\\]"""'], {}), "('\\\\[(.+?)\\\\]')\n", (464, 479), False, 'import re\n'), ((8207, 8241), 'dataclasses.dataclass', 'dc.dataclass', ([], {'frozen': '(True)', 'eq': '(True)'}), '(frozen=True, eq=True)\n', (8219, 8241), True, 'import dataclasses as dc\n'), ((8290...
#!/usr/bin/env python # coding: utf-8 # # These functions are the utilities for model testing # ### Modual requirements # numpy # os # pyuvdata # tensorflow # In[1]: import numpy as np import os from pyuvdata import UVData import tensorflow as tf # In[2]: #get_ipython().run_line_magic('matplotlib', 'notebook')...
[ "os.listdir", "numpy.abs", "pyuvdata.UVData", "tensorflow.keras.models.load_model", "numpy.flip", "numpy.shape", "numpy.log10", "os.path.join", "numpy.delete", "numpy.concatenate" ]
[((1454, 1462), 'pyuvdata.UVData', 'UVData', ([], {}), '()\n', (1460, 1462), False, 'from pyuvdata import UVData\n'), ((5075, 5086), 'numpy.abs', 'np.abs', (['arr'], {}), '(arr)\n', (5081, 5086), True, 'import numpy as np\n'), ((5097, 5110), 'numpy.log10', 'np.log10', (['arr'], {}), '(arr)\n', (5105, 5110), True, 'impo...
"""Cross-modal retrieval evaluation wrapper. PCME Copyright (c) 2021-present NAVER Corp. MIT license """ from functools import partial import numpy as np import torch import torch.nn as nn from tqdm import tqdm from utils.tensor_utils import to_numpy def batch(iterable, batch_size=1): """a batch generator ...
[ "functools.partial", "torch.where", "numpy.median", "numpy.zeros", "numpy.mean", "numpy.array", "numpy.arange", "numpy.where", "torch.no_grad", "torch.sum", "utils.tensor_utils.to_numpy", "torch.from_numpy" ]
[((3517, 3532), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3530, 3532), False, 'import torch\n'), ((8340, 8355), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (8353, 8355), False, 'import torch\n'), ((10490, 10505), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (10503, 10505), False, 'import torch...
from sklearn import metrics import met import numpy as np # -*- coding: utf-8 -*- """ Created on Mon Dec 31 23:16:03 2018 @author: Raneem """ def purity_measure(y_true, y_pred): """ The MIT License (MIT) Copyright (c) 2017 <NAME> Purity score To compute purity, each cluster is assigned t...
[ "numpy.power", "sklearn.metrics.accuracy_score", "sklearn.metrics.calinski_harabaz_score", "numpy.zeros", "numpy.argmin", "met.dunn_fast", "sklearn.metrics.silhouette_score", "numpy.histogram", "numpy.where", "numpy.array", "numpy.min", "sklearn.metrics.davies_bouldin_score", "numpy.unique" ...
[((956, 978), 'numpy.zeros', 'np.zeros', (['y_true.shape'], {}), '(y_true.shape)\n', (964, 978), True, 'import numpy as np\n'), ((992, 1009), 'numpy.unique', 'np.unique', (['y_true'], {}), '(y_true)\n', (1001, 1009), True, 'import numpy as np\n'), ((1277, 1294), 'numpy.unique', 'np.unique', (['y_pred'], {}), '(y_pred)\...
#import cfg import pandas as pd import numpy as np import scipy.sparse as sp import re import pickle from bs4 import BeautifulSoup #from nltk.stem.porter import * from nltk.tokenize import TreebankWordTokenizer from nltk.stem import wordnet from sklearn.decomposition import TruncatedSVD from sklearn.preprocessing im...
[ "nltk.tokenize.TreebankWordTokenizer", "numpy.sum", "sklearn.decomposition.TruncatedSVD", "sklearn.manifold.TSNE", "sklearn.preprocessing.StandardScaler", "sklearn.feature_extraction.text.TfidfVectorizer", "pandas.read_csv", "numpy.savetxt", "numpy.zeros", "numpy.array", "gensim.models.KeyedVect...
[((863, 954), 'gensim.models.KeyedVectors.load_word2vec_format', 'gensim.models.KeyedVectors.load_word2vec_format', (['path_w2v_pretrained_model'], {'binary': '(True)'}), '(path_w2v_pretrained_model,\n binary=True)\n', (910, 954), False, 'import gensim\n'), ((1281, 1304), 'nltk.tokenize.TreebankWordTokenizer', 'Tree...
import sys import os import inspect import torch import torch.nn.functional as F from torchvision import transforms import numpy as np import random from PIL import Image import glob import time import random from torchvision.utils import save_image, make_grid import argparse currentdir = os.path.dirname(os.path.abs...
[ "numpy.load", "argparse.ArgumentParser", "im2scene.eval.calculate_frechet_distance", "torch.cat", "im2scene.config.load_config", "torch.device", "torch.no_grad", "im2scene.config.get_renderer", "os.path.join", "torch.utils.data.DataLoader", "os.path.dirname", "im2scene.eval.calculate_activatio...
[((379, 406), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (394, 406), False, 'import os\n'), ((407, 436), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (422, 436), False, 'import sys\n'), ((630, 728), 'argparse.ArgumentParser', 'argparse.Argument...
"""Contains the implementation of quintic bezier splines""" from math import acos from numpy import dot, array, clip from numpy.linalg import norm from scipy.integrate import quad from scipy.optimize import brentq class Spline(object): """Quintic bezier spline implementation Attribute...
[ "numpy.dot", "numpy.array", "scipy.optimize.brentq", "numpy.clip" ]
[((7711, 7742), 'numpy.dot', 'dot', (['tangent', '[[0, 1], [-1, 0]]'], {}), '(tangent, [[0, 1], [-1, 0]])\n', (7714, 7742), False, 'from numpy import dot, array, clip\n'), ((10863, 10878), 'numpy.array', 'array', (['position'], {}), '(position)\n', (10868, 10878), False, 'from numpy import dot, array, clip\n'), ((10903...
import cv2 import numpy as np from tensorflow.keras.models import load_model from lane_navigation import LaneKeepAssistSystem from image_preprocessing import * import logging class DeepLearningLKAS(object): """ A Lane Keep Assist System powered by Deep Learning. Inspired by Nvidia End-to-End ML architecture f...
[ "cv2.GaussianBlur", "tensorflow.keras.models.load_model", "cv2.cvtColor", "numpy.asarray", "logging.info", "cv2.resize" ]
[((546, 571), 'tensorflow.keras.models.load_model', 'load_model', (['ml_model_path'], {}), '(ml_model_path)\n', (556, 571), False, 'from tensorflow.keras.models import load_model\n'), ((580, 645), 'logging.info', 'logging.info', (['"""Configuring Deep Learning Lane Keep Assist System"""'], {}), "('Configuring Deep Lear...
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import subprocess as sp import os import errno import argparse from common.camera import * from matplotlib.animation import FuncAnimation, writers from mpl_toolkits.mplot3d import Axes3D from common.skeleton import Skeleton def...
[ "numpy.load", "argparse.ArgumentParser", "matplotlib.pyplot.ioff", "matplotlib.pyplot.close", "common.skeleton.Skeleton", "numpy.min", "matplotlib.use", "numpy.array", "numpy.arange" ]
[((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((3853, 3910), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate Animation"""'}), "(description='Generate Animation')\n", (3876, 3910), False, 'import argparse...
import unittest import numpy as np import itertools from sparse import DBSRMatrix from scipy.sparse import bsr_matrix class TestSingleBlock(unittest.TestCase): def test_construction(self): nblocks = 10 np.random.seed(nblocks) data = np.random.random((nblocks, 2, 3)) indices = n...
[ "unittest.main", "numpy.random.seed", "sparse.DBSRMatrix", "scipy.sparse.bsr_matrix", "numpy.flatnonzero", "numpy.random.randint", "numpy.random.random", "numpy.arange", "numpy.delete" ]
[((6157, 6172), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6170, 6172), False, 'import unittest\n'), ((228, 251), 'numpy.random.seed', 'np.random.seed', (['nblocks'], {}), '(nblocks)\n', (242, 251), True, 'import numpy as np\n'), ((267, 300), 'numpy.random.random', 'np.random.random', (['(nblocks, 2, 3)'], {}...
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import argparse from logging import getLogger import pickle import os import pathlib import random import numpy as np im...
[ "os.mkdir", "numpy.random.seed", "torch.cuda.device_count", "pathlib.Path", "os.path.isfile", "pickle.load", "torch.no_grad", "os.path.join", "argparse.ArgumentTypeError", "torch.distributed.get_rank", "matplotlib.pyplot.close", "examples.configs.utils.populate_config", "random.seed", "tor...
[((705, 726), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (719, 726), False, 'import matplotlib\n'), ((814, 825), 'logging.getLogger', 'getLogger', ([], {}), '()\n', (823, 825), False, 'from logging import getLogger\n'), ((492, 529), 'os.path.join', 'os.path.join', (['sys.path[0]', '"""../../....
# %% # Imports import os import matplotlib.pyplot as plt from tqdm import tqdm import numpy as np import cv2 from fcutils.file_io.io import load_yaml from fcutils.file_io.utils import get_file_name from fcutils.video.utils import get_cap_from_file, get_cap_selected_frame, get_video_params, open_cvwriter from behaviou...
[ "fcutils.file_io.utils.get_file_name", "cv2.circle", "os.path.join", "behaviour.utilities.signals.get_times_signal_high_and_low", "fcutils.video.utils.get_video_params", "fcutils.file_io.io.load_yaml", "behaviour.tdms.utils.get_analog_inputs_clean_dataframe", "numpy.arange", "behaviour.utilities.sig...
[((759, 780), 'fcutils.file_io.io.load_yaml', 'load_yaml', (['notes_path'], {}), '(notes_path)\n', (768, 780), False, 'from fcutils.file_io.io import load_yaml\n'), ((1440, 1484), 'os.path.join', 'os.path.join', (['videos_fld', "(s + 'Overview.mp4')"], {}), "(videos_fld, s + 'Overview.mp4')\n", (1452, 1484), False, 'im...
######################################## # Some notes on the installation and stuff ... ######################################## #!conda install -y -c bioconda bedtools #!conda install -y -c bioconda ucsc-bedgraphtobigwig -> that was bad ... just a binary from UCSC - was a much better solution ########################...
[ "numpy.argsort", "matplotlib.pyplot.figure", "numpy.random.randint", "numpy.mean", "numpy.arange", "numpy.nanmean", "pandas.DataFrame", "sklearn.cluster.KMeans", "numpy.isfinite", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.subplots", "pandas.concat", "numpy.hstack", "numpy.sort", "...
[((1196, 1204), 'copy.copy', 'copy', (['ks'], {}), '(ks)\n', (1200, 1204), False, 'from copy import copy\n'), ((2851, 2859), 'copy.copy', 'copy', (['ks'], {}), '(ks)\n', (2855, 2859), False, 'from copy import copy\n'), ((5610, 5646), 'numpy.nanmean', 'np.nanmean', (['X'], {'axis': '(0)', 'keepdims': '(True)'}), '(X, ax...
import os import time import logging from transformers import AutoTokenizer from transformers import ( HfArgumentParser, TrainingArguments, ) from asyncval.callbacks import get_reporting_integration_callbacks, CallbackHandler from torch.utils.data import DataLoader from asyncval.arguments import AsyncvalArgumen...
[ "torch.cat", "asyncval.data.EncodeDataset", "gc.collect", "torch.no_grad", "os.path.join", "asyncval.evaluation.Evaluator", "torch.cuda.amp.autocast", "os.path.exists", "contextlib.nullcontext", "tqdm.tqdm", "os.stat", "asyncval.callbacks.CallbackHandler", "time.sleep", "transformers.AutoT...
[((647, 674), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (664, 674), False, 'import logging\n'), ((1683, 1719), 'tqdm.tqdm', 'tqdm', (['encode_loader'], {'desc': '"""Encoding"""'}), "(encode_loader, desc='Encoding')\n", (1687, 1719), False, 'from tqdm import tqdm\n'), ((2196, 2214), '...
#!/usr/bin/env python3 from argparse import ArgumentParser import os import pickle import random import sys import numpy as np import pandas as pd from sklearn.model_selection import ( train_test_split, StratifiedKFold, cross_validate, ) import tqdm from janus.evaluation.synthetic_evaluation import run_si...
[ "pickle.dump", "pdb.post_mortem", "numpy.random.seed", "argparse.ArgumentParser", "sklearn.model_selection.train_test_split", "janus.utils.set_seed", "janus.repair.repair_tools.get_repair_tools", "numpy.random.random", "janus.evaluation.synthetic_evaluation.run_single_tree", "random.seed", "nump...
[((3176, 3202), 'pandas.concat', 'pd.concat', (['results'], {'axis': '(0)'}), '(results, axis=0)\n', (3185, 3202), True, 'import pandas as pd\n'), ((3256, 3342), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Evaluate repairs on a set of script-based pipelines"""'}), "(description=\n 'Evaluate...
import numpy as np from Algorithms.Preprocessing import Preprocessing class PatchPreprocessing(Preprocessing): def __init__(self, data, labels, n_train_samples, n_validation_samples, use_ground_truth, patch_radius): super().__init__(data, labels, n_train_samples, n_validation_samples, use_ground_truth) ...
[ "numpy.array", "numpy.random.shuffle" ]
[((4587, 4601), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (4595, 4601), True, 'import numpy as np\n'), ((4546, 4562), 'numpy.array', 'np.array', (['labels'], {}), '(labels)\n', (4554, 4562), True, 'import numpy as np\n'), ((4680, 4706), 'numpy.random.shuffle', 'np.random.shuffle', (['indices'], {}), '(indi...
import numpy as np import csv w = csv.writer(open("dicionario_teste.csv", "w")) import pickle from time import sleep file = open('dicionario_teste.pkl', 'wb') lista = [] dicionario = {} precisao = 0.00001 valor = 201 n_elementos = round(valor / precisao) print(n_elementos) # n_elementos = int(0b11111111111111111111...
[ "pickle.dump", "numpy.linspace", "time.sleep" ]
[((419, 473), 'numpy.linspace', 'np.linspace', ([], {'start': '(-100)', 'stop': '(100)', 'num': '(n_elementos + 1)'}), '(start=-100, stop=100, num=n_elementos + 1)\n', (430, 473), True, 'import numpy as np\n'), ((1048, 1077), 'pickle.dump', 'pickle.dump', (['dicionario', 'file'], {}), '(dicionario, file)\n', (1059, 107...
"""Utility functions for collapsing the id arrays stored in a the-wizz HDF5 file into a clustering redshift estimate given an input sample. """ import pickle import h5py from multiprocessing import Pool import numpy as np from scipy.interpolate import InterpolatedUnivariateSpline as iu_spline from the_wizz import c...
[ "pickle.dump", "numpy.sum", "numpy.empty", "numpy.ones", "the_wizz.core_utils.file_checker_loader", "numpy.mean", "numpy.arange", "numpy.random.randint", "numpy.nanmean", "numpy.zeros_like", "scipy.interpolate.InterpolatedUnivariateSpline", "numpy.savetxt", "numpy.logical_not", "numpy.isfi...
[((2654, 2671), 'numpy.log', 'np.log', (['(1 + z_min)'], {}), '(1 + z_min)\n', (2660, 2671), True, 'import numpy as np\n'), ((2686, 2703), 'numpy.log', 'np.log', (['(1 + z_max)'], {}), '(1 + z_max)\n', (2692, 2703), True, 'import numpy as np\n'), ((3950, 4000), 'the_wizz.core_utils.WMAP5.comoving_distance', 'core_utils...
from keras import layers,models from keras.datasets import mnist from keras.utils import to_categorical import numpy as np (train_images, train_labels),(test_images, test_labels) = mnist.load_data() #print("Train Image Shape: ",train_images.shape) #print(len(train_images)) #print("Total Train Labels: ",len(tra...
[ "numpy.argmax", "keras.datasets.mnist.load_data", "keras.layers.Dense", "keras.models.Sequential", "keras.utils.to_categorical" ]
[((185, 202), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (200, 202), False, 'from keras.datasets import mnist\n'), ((365, 405), 'keras.models.Sequential', 'models.Sequential', ([], {'name': '"""New MnistModel"""'}), "(name='New MnistModel')\n", (382, 405), False, 'from keras import layers, m...
import torch import numpy as np import logging from .dqn import DQNPolicy from rltime.models.torch.utils import linear, repeat_interleave class IQNPolicy(DQNPolicy): """An IQN Policy (https://arxiv.org/abs/1806.06923) """ def __init__(self, *args, embedding_dim=64, num_sampling_quantiles=32, ...
[ "torch.rand", "rltime.models.torch.utils.linear", "logging.getLogger", "rltime.models.torch.utils.repeat_interleave", "torch.cos", "torch.arange", "torch.nn.functional.relu", "numpy.prod" ]
[((2802, 2844), 'rltime.models.torch.utils.linear', 'linear', (['embedding_dim', 'quantile_layer_size'], {}), '(embedding_dim, quantile_layer_size)\n', (2808, 2844), False, 'from rltime.models.torch.utils import linear, repeat_interleave\n'), ((4126, 4182), 'rltime.models.torch.utils.repeat_interleave', 'repeat_interle...
from __future__ import absolute_import, division, print_function import numpy as np import os import time import torch import math from torch.utils.data import (DataLoader, SequentialSampler, TensorDataset) from tqdm import tqdm import logging from accelerate import Accelerator from tran...
[ "transformers.glue_compute_metrics", "numpy.argmax", "transformers.utils.logging.set_verbosity_info", "transformers.utils.logging.set_verbosity_error", "torch.utils.data.TensorDataset", "torch.no_grad", "os.path.join", "torch.utils.data.DataLoader", "torch.load", "os.path.exists", "torch.utils.d...
[((992, 1005), 'accelerate.Accelerator', 'Accelerator', ([], {}), '()\n', (1003, 1005), False, 'from accelerate import Accelerator\n'), ((6801, 6864), 'torch.tensor', 'torch.tensor', (['[f.input_ids for f in features]'], {'dtype': 'torch.long'}), '([f.input_ids for f in features], dtype=torch.long)\n', (6813, 6864), Fa...
import future, sys, os, datetime, argparse # print(os.path.dirname(sys.executable)) import torch import numpy as np import matplotlib from tqdm import tqdm import matplotlib.pyplot as plt from matplotlib.lines import Line2D matplotlib.rcParams["figure.figsize"] = [10, 10] import torch from torch.nn import Module, Par...
[ "numpy.set_printoptions", "argparse.ArgumentParser", "os.getcwd", "torch.set_printoptions", "os.chdir" ]
[((455, 506), 'torch.set_printoptions', 'torch.set_printoptions', ([], {'precision': '(4)', 'sci_mode': '(False)'}), '(precision=4, sci_mode=False)\n', (477, 506), False, 'import torch\n'), ((507, 554), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(4)', 'suppress': '(True)'}), '(precision=4, sup...
""" ========= Mixed SPN ========= This demonstrates learning a Mixed Sum-Product Network (MSPN) where the data is composed of variables drawn from multiple types of distributions. """ import numpy as np np.random.seed(123) from spn.algorithms.LearningWrappers import learn_mspn from spn.structure.Base import Context...
[ "numpy.random.seed", "spn.algorithms.LearningWrappers.learn_mspn", "numpy.random.randint", "numpy.random.normal", "spn.structure.Base.Context" ]
[((206, 225), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (220, 225), True, 'import numpy as np\n'), ((1030, 1122), 'spn.structure.Base.Context', 'Context', ([], {'meta_types': '[MetaType.DISCRETE, MetaType.DISCRETE, MetaType.REAL, MetaType.REAL]'}), '(meta_types=[MetaType.DISCRETE, MetaType.DISC...
import numpy as np w1 = np.load('weight_IMGN_A1.npy') w2 = np.load('weight_IMGN_A2.npy') w3 = np.load('weight_IMGN_A3.npy') w4 = np.load('weight_IMGN_A4.npy') w5 = np.load('weight_IMGN_A5.npy') w6 = np.load('weight_IMGN_A6.npy') w7 = np.load('weight_IMGN_A7.npy') w8 = np.load('weight_IMGN_A8.npy') w9 = np.load('weigh...
[ "numpy.load", "numpy.save", "numpy.std", "numpy.shape", "numpy.mean", "numpy.random.normal" ]
[((26, 55), 'numpy.load', 'np.load', (['"""weight_IMGN_A1.npy"""'], {}), "('weight_IMGN_A1.npy')\n", (33, 55), True, 'import numpy as np\n'), ((61, 90), 'numpy.load', 'np.load', (['"""weight_IMGN_A2.npy"""'], {}), "('weight_IMGN_A2.npy')\n", (68, 90), True, 'import numpy as np\n'), ((96, 125), 'numpy.load', 'np.load', ...
from sympy import Symbol, diff, Expr, simplify, init_printing from sympy.physics.vector import ReferenceFrame, curl from matplotlib import pyplot as plt import numpy as np from typing import List init_printing() class System: def __init__(self): """ This class can do 6 things: calculate acceleration in each...
[ "matplotlib.pyplot.title", "sympy.Symbol", "numpy.meshgrid", "matplotlib.pyplot.show", "sympy.physics.vector.curl", "sympy.diff", "matplotlib.pyplot.quiver", "sympy.simplify", "sympy.physics.vector.ReferenceFrame", "sympy.init_printing", "numpy.linspace", "sympy.Expr", "matplotlib.pyplot.tic...
[((198, 213), 'sympy.init_printing', 'init_printing', ([], {}), '()\n', (211, 213), False, 'from sympy import Symbol, diff, Expr, simplify, init_printing\n'), ((505, 516), 'sympy.Symbol', 'Symbol', (['"""t"""'], {}), "('t')\n", (511, 516), False, 'from sympy import Symbol, diff, Expr, simplify, init_printing\n'), ((528...
# -*- coding: utf-8 -*- # pylint : disable=anomalous-backslash-in-string # pylint : ignore=docstrings ############################################################# # Copyright (c) 2020-2021 <NAME> # # # # This software is open-source and is distrib...
[ "numpy.zeros", "mdtraj.load", "numpy.array", "parmed.load_file", "scipy.spatial.ConvexHull" ]
[((4538, 4571), 'parmed.load_file', 'parmed.load_file', (['*args'], {}), '(*args, **kwargs)\n', (4554, 4571), False, 'import parmed\n'), ((4584, 4630), 'numpy.array', 'np.array', (['[atom.charge for atom in parm.atoms]'], {}), '([atom.charge for atom in parm.atoms])\n', (4592, 4630), True, 'import numpy as np\n'), ((81...
# Copyright 2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
[ "numpy.random.choice", "random.sample", "attr.ib", "crafty.data.ObjectKey", "itertools.product", "itertools.groupby" ]
[((1489, 1510), 'attr.ib', 'attr.ib', ([], {'default': '(True)'}), '(default=True)\n', (1496, 1510), False, 'import attr\n'), ((20015, 20024), 'attr.ib', 'attr.ib', ([], {}), '()\n', (20022, 20024), False, 'import attr\n'), ((20041, 20050), 'attr.ib', 'attr.ib', ([], {}), '()\n', (20048, 20050), False, 'import attr\n')...
# -*- coding: utf-8 -*- # Created on Sat Jun 05 2021 # Last modified on Mon Jun 07 2021 # Copyright (c) CaMOS Development Team. All Rights Reserved. # Distributed under a MIT License. See LICENSE for more info. import numpy as np import h5py from camos.tasks.opening import Opening from camos.viewport.signalviewer2 im...
[ "h5py.File", "numpy.array", "camos.model.inputdata.InputData" ]
[((612, 641), 'h5py.File', 'h5py.File', (['self.filename', '"""r"""'], {}), "(self.filename, 'r')\n", (621, 641), False, 'import h5py\n'), ((1385, 1411), 'camos.model.inputdata.InputData', 'InputData', (['data'], {'name': 'name'}), '(data, name=name)\n', (1394, 1411), False, 'from camos.model.inputdata import InputData...
# MIT License # # Copyright (c) 2017 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publi...
[ "numpy.full", "os.path.exists", "progressbar.ETA", "numpy.isnan", "progressbar.Percentage", "shutil.move", "progressbar.SimpleProgress", "logging.getLogger", "numpy.nanmean" ]
[((1414, 1441), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1431, 1441), False, 'import logging\n'), ((9010, 9043), 'numpy.full', 'np.full', (['self.num_samples', 'np.nan'], {}), '(self.num_samples, np.nan)\n', (9017, 9043), True, 'import numpy as np\n'), ((9527, 9555), 'numpy.nanmean...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== import numpy as np from ..learner import * from .. import parameter, input_variable...
[ "pytest.mark.parametrize", "numpy.asarray", "numpy.exp" ]
[((477, 540), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""params, expectation"""', 'SCHEDULE_PARAMS'], {}), "('params, expectation', SCHEDULE_PARAMS)\n", (500, 540), False, 'import pytest\n'), ((1073, 1136), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""params, expectation"""', 'SCHEDULE_P...
from astropy.tests.helper import assert_quantity_allclose from numpy.linalg import norm from poliastro import bodies, coordinates from poliastro.examples import molniya from poliastro.twobody.orbit import Orbit def test_inertial_body_centered_to_pqw(): molniya_r_peri, molniya_v_peri = coordinates.inertial_body_c...
[ "poliastro.coordinates.inertial_body_centered_to_pqw", "astropy.tests.helper.assert_quantity_allclose", "numpy.linalg.norm", "poliastro.twobody.orbit.Orbit.from_vectors" ]
[((293, 370), 'poliastro.coordinates.inertial_body_centered_to_pqw', 'coordinates.inertial_body_centered_to_pqw', (['molniya.r', 'molniya.v', 'bodies.Earth'], {}), '(molniya.r, molniya.v, bodies.Earth)\n', (334, 370), False, 'from poliastro import bodies, coordinates\n'), ((405, 484), 'poliastro.twobody.orbit.Orbit.fro...
# -*- coding: utf-8 -*- import numpy as np import torch import torch.nn as nn class Discriminator(nn.Module): def __init__(self, data_shape): super(Discriminator, self).__init__() self.data_shape = data_shape self.model = nn.Sequential( nn.Linear(int(np.prod(self.data_shape))...
[ "torch.load", "torch.save", "torch.nn.Linear", "torch.nn.LeakyReLU", "numpy.prod" ]
[((736, 763), 'torch.save', 'torch.save', (['save_dict', 'path'], {}), '(save_dict, path)\n', (746, 763), False, 'import torch\n'), ((838, 854), 'torch.load', 'torch.load', (['path'], {}), '(path)\n', (848, 854), False, 'import torch\n'), ((340, 371), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (['(0.2)'], {'inplace': '(True...
from __future__ import absolute_import from __future__ import print_function from six.moves import range __author__ = 'marafi' def GetIbarraPeakOrientedModel(id,b,h,dp,fy,fpc,rho,rhop,rho_v,N,s,LsOH,L,Ig,a_sl=1,Imperial=True,t_slab=None, rho_slab=None, eff_wdith=None,_Notes=None): import OpenSeesAPI Stiffness...
[ "OpenSeesAPI.Model.Element.Material.UniaxialMaterial.Clough", "math.sqrt", "math.ceil", "OpenSeesAPI.Model.Element.Material.UniaxialMaterial.ReinforcingSteel.GABuck", "OpenSeesAPI.Model.Element.Material.UniaxialMaterial.Hysteretic", "numpy.ones", "OpenSeesAPI.Database.Collector.AddMaterial", "OpenSees...
[((3286, 3594), 'OpenSeesAPI.Model.Element.Material.UniaxialMaterial.ModIMKPeakOriented', 'OpenSeesAPI.Model.Element.Material.UniaxialMaterial.ModIMKPeakOriented', (['id', 'elstk', 'AlphaY_pos', 'AlphaY_neg', 'My', 'MyNeg', 'Lambda', 'Lambda', 'Lambda', 'Lambda', 'c', 'c', 'c', 'c', 'theta_p_pos', 'theta_p_neg', 'theta...
#!/usr/bin/env python # coding: utf-8 # In[2]: import json import os #import pywt import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np plt.close("all") # In[12]: ##readppg data, change the path according to your own directories with open('../intermediate_data/all_features_30sec_bfill_fullda...
[ "numpy.size", "json.load", "matplotlib.pyplot.show", "matplotlib.pyplot.close", "numpy.log2", "numpy.hanning", "matplotlib.pyplot.subplots" ]
[((161, 177), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (170, 177), True, 'import matplotlib.pyplot as plt\n'), ((359, 374), 'json.load', 'json.load', (['JSON'], {}), '(JSON)\n', (368, 374), False, 'import json\n'), ((1125, 1163), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrow...
from py_wake.wind_turbines import WindTurbine import numpy as np from pathlib import Path from py_wake.utils.tensorflow_surrogate_utils import TensorflowSurrogate import inspect from py_wake.wind_turbines.power_ct_functions import PowerCtSurrogate from py_wake.wind_turbines.wind_turbine_functions import FunctionSurroga...
[ "numpy.arctan2", "numpy.abs", "py_wake.wind_turbines.power_ct_functions.PowerCtSurrogate._power_ct", "matplotlib.pyplot.figure", "pathlib.Path", "numpy.arange", "matplotlib.pyplot.gca", "py_wake.turbulence_models.stf.STF2017TurbulenceModel", "numpy.full", "numpy.zeros_like", "inspect.signature",...
[((1636, 1704), 'py_wake.wind_turbines.power_ct_functions.PowerCtSurrogate._power_ct', 'PowerCtSurrogate._power_ct', (['self', 'ws[m]'], {'run_only': 'run_only'}), '(self, ws[m], run_only=run_only, **kwargs)\n', (1662, 1704), False, 'from py_wake.wind_turbines.power_ct_functions import PowerCtSurrogate\n'), ((2220, 230...
import seaborn as sns import matplotlib.pyplot as plt import numpy as np import re from math import ceil import pandas from scipy.stats import shapiro, boxcox, yeojohnson, yeojohnson_normmax from sklearn.utils.multiclass import unique_labels from sklearn.experimental import enable_iterative_imputer from sklearn.impute ...
[ "matplotlib.pyplot.title", "scipy.stats.yeojohnson", "sklearn.impute.SimpleImputer", "matplotlib.pyplot.show", "seaborn.heatmap", "scipy.stats.boxcox", "scipy.stats.shapiro", "seaborn.barplot", "numpy.ones", "sklearn.preprocessing.LabelEncoder", "scipy.stats.probplot", "seaborn.distplot", "s...
[((525, 554), 'seaborn.set_palette', 'sns.set_palette', (['"""colorblind"""'], {}), "('colorblind')\n", (540, 554), True, 'import seaborn as sns\n'), ((7206, 7237), 'scipy.stats.shapiro', 'shapiro', (['data[numeric_features]'], {}), '(data[numeric_features])\n', (7213, 7237), False, 'from scipy.stats import shapiro, bo...
from __future__ import division from __future__ import print_function from builtins import range from past.utils import old_div from scipy.special import digamma #from math import exp import numpy as np minIter = 100 maxIter = 1000 minAlpha = 1e-8 alphaCheckCutoff = 10**-2 #https://github.com/COMBINE-lab/salmon/...
[ "numpy.sum", "numpy.copy", "past.utils.old_div", "numpy.isinf", "numpy.isnan", "scipy.special.digamma", "numpy.array", "numpy.array_equal" ]
[((2638, 2653), 'numpy.sum', 'np.sum', (['alphaIn'], {}), '(alphaIn)\n', (2644, 2653), True, 'import numpy as np\n'), ((2668, 2685), 'scipy.special.digamma', 'digamma', (['alphaSum'], {}), '(alphaSum)\n', (2675, 2685), False, 'from scipy.special import digamma\n'), ((2753, 2773), 'numpy.copy', 'np.copy', (['priorAlphas...
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License # Copyright (c) 2017 Tauranis # 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 ...
[ "torch.utils.data.DataLoader", "utils.get_image_list", "cv2.imread", "Logging.log.info", "numpy.rollaxis", "torch.from_numpy" ]
[((3123, 3263), 'utils.get_image_list', 'utils.get_image_list', (['"""/media/rodrigo/c6e79420-ed98-4730-96f6-ff18c884341d/Rodrigo/Unicamp/IA368Z/trab-final/dataset/300x300_cr90"""'], {}), "(\n '/media/rodrigo/c6e79420-ed98-4730-96f6-ff18c884341d/Rodrigo/Unicamp/IA368Z/trab-final/dataset/300x300_cr90'\n )\n", (314...
import click, json, re import numpy as np from supermercado import super_utils as sutils def findedges(inputtiles, parsenames): tiles = sutils.tile_parser(inputtiles, parsenames) xmin, xmax, ymin, ymax = sutils.get_range(tiles) zoom = sutils.get_zoom(tiles) # zoom = inputtiles[0, -1] # make ...
[ "supermercado.super_utils.burnXYZs", "numpy.roll", "supermercado.super_utils.get_idx", "numpy.zeros", "supermercado.super_utils.tile_parser", "supermercado.super_utils.get_range", "numpy.where", "supermercado.super_utils.get_zoom" ]
[((145, 187), 'supermercado.super_utils.tile_parser', 'sutils.tile_parser', (['inputtiles', 'parsenames'], {}), '(inputtiles, parsenames)\n', (163, 187), True, 'from supermercado import super_utils as sutils\n'), ((218, 241), 'supermercado.super_utils.get_range', 'sutils.get_range', (['tiles'], {}), '(tiles)\n', (234, ...
#Uses master dataset import pandas import numpy as np from sklearn import svm from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score from sklearn.metrics import confusion_matrix from sklearn.metrics import classification_report from sklearn import preprocessing import pickle imp...
[ "sys.path.append", "numpy.ravel", "os.getcwd", "pandas.read_csv", "sklearn.metrics.accuracy_score", "sklearn.svm.SVC" ]
[((343, 354), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (352, 354), False, 'import os\n'), ((389, 410), 'sys.path.append', 'sys.path.append', (['path'], {}), '(path)\n', (404, 410), False, 'import sys\n'), ((580, 617), 'pandas.read_csv', 'pandas.read_csv', (['"""datasets/train.csv"""'], {}), "('datasets/train.csv')\n...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Python scripts for performing matrix optics. This method uses paraxial approximations (sin(a) ~= a), which is valid for angles < ~6 deg (.1 radians). The rays and matricies are structued as numpy arrays (fast calculations) embedded within a list structure for flexi...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.zeros", "numpy.cumsum", "matplotlib.pyplot.figure", "numpy.min", "numpy.max", "numpy.linspace", "numpy.dot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((3392, 3427), 'numpy.zeros', 'np.zeros', ([], {'shape': '(2, 2)', 'dtype': 'float'}), '(shape=(2, 2), dtype=float)\n', (3400, 3427), True, 'import numpy as np\n'), ((4405, 4417), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (4415, 4417), True, 'import matplotlib.pyplot as plt\n'), ((4494, 4514), 'matpl...
import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from matplotlib import cm from scipy.spatial import Delaunay from scipy.linalg import eigh from truss2d import Truss2D, update_K_M DOF = 2 plot_mesh = False plot_result = True lumped = False # number of nodes in each direct...
[ "matplotlib.pyplot.title", "numpy.meshgrid", "matplotlib.pyplot.show", "truss2d.update_K_M", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "numpy.zeros", "matplotlib.pyplot.triplot", "numpy.diagonal", "numpy.isclose", "matplotlib.use", "truss2d.Truss2D", "scipy.linalg.eigh", "numpy.li...
[((37, 60), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (51, 60), False, 'import matplotlib\n'), ((444, 465), 'numpy.linspace', 'np.linspace', (['(0)', 'a', 'nx'], {}), '(0, a, nx)\n', (455, 465), True, 'import numpy as np\n'), ((473, 494), 'numpy.linspace', 'np.linspace', (['(0)', 'b', 'n...
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. import numpy as np import dace from dace.transformation.interstate import StateFusion @dace.program def nested_scope(A: dace.float64[3, 3], B: dace.float64[3, 3]): mytransient = dace.define_local([3, 3], dace.float64) mytransient[:] =...
[ "dace.define_local", "numpy.allclose", "numpy.zeros_like", "numpy.zeros" ]
[((260, 299), 'dace.define_local', 'dace.define_local', (['[3, 3]', 'dace.float64'], {}), '([3, 3], dace.float64)\n', (277, 299), False, 'import dace\n'), ((447, 486), 'dace.define_local', 'dace.define_local', (['[3, 3]', 'dace.float64'], {}), '([3, 3], dace.float64)\n', (464, 486), False, 'import dace\n'), ((708, 726)...
import numpy as np import torch as t import torch.nn as nn import torch.nn.functional as F from ..attention import MultiHeadAttention from ..utils import PositionWise class Decoder(nn.Module): def __init__(self, embeddings, n_layers, n_heads, h_s, p_s, vocab_s, dropout=0.1): """ :param embeddings...
[ "torch.ones", "numpy.random.choice", "torch.cat", "torch.nn.SELU", "torch.nn.Linear", "torch.tensor" ]
[((1575, 1620), 'torch.tensor', 't.tensor', (['[seed]'], {'dtype': 't.long', 'device': 'device'}), '([seed], dtype=t.long, device=device)\n', (1583, 1620), True, 'import torch as t\n'), ((893, 913), 'torch.nn.Linear', 'nn.Linear', (['h_s', '(1000)'], {}), '(h_s, 1000)\n', (902, 913), True, 'import torch.nn as nn\n'), (...
import os import pdb import random import numpy as np import scipy as sp import matplotlib.pyplot as plt import madmom import tensorflow as tf from sklearn.metrics import f1_score from mir_eval.onset import f_measure from sklearn.model_selection import KFold from sklearn.model_selection import StratifiedKFold from ...
[ "os.mkdir", "numpy.load", "numpy.sum", "numpy.abs", "tensorflow.keras.optimizers.SGD", "numpy.clip", "numpy.mean", "os.nice", "tensorflow.keras.callbacks.EarlyStopping", "tensorflow.size", "madmom.features.onsets.OnsetPeakPickingProcessor", "tensorflow.keras.callbacks.ReduceLROnPlateau", "nu...
[((408, 418), 'os.nice', 'os.nice', (['(0)'], {}), '(0)\n', (415, 418), False, 'import os\n'), ((447, 498), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (491, 498), True, 'import tensorflow as tf\n'), ((2043, 2093), 'numpy.arra...
from collections import abc import numpy as np import pytest from pandas import ( CategoricalDtype, DataFrame, MultiIndex, Series, Timestamp, date_range, ) import pandas._testing as tm class TestDataFrameToRecords: def test_to_records_dt64(self): df = DataFrame( [["on...
[ "pandas.DataFrame", "pandas.MultiIndex.from_tuples", "pandas._testing.assert_almost_equal", "pandas.date_range", "numpy.random.randn", "collections.abc.Mapping.register", "email.parser.Parser", "numpy.zeros", "numpy.dtype", "numpy.rec.array", "pandas.CategoricalDtype", "pandas._testing.assert_...
[((13505, 13564), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""tz"""', "['UTC', 'GMT', 'US/Eastern']"], {}), "('tz', ['UTC', 'GMT', 'US/Eastern'])\n", (13528, 13564), False, 'import pytest\n'), ((1164, 1180), 'numpy.zeros', 'np.zeros', (['(8, 4)'], {}), '((8, 4))\n', (1172, 1180), True, 'import numpy as ...
""" Collection of tests for unified linear algebra functions """ # global import pytest import numpy as np from hypothesis import given, strategies as st # local import ivy import ivy_tests.test_ivy.helpers as helpers import ivy.functional.backends.numpy as ivy_np # vector_to_skew_symmetric_matrix @pytest.mark.para...
[ "numpy.random.uniform", "ivy.vector_to_skew_symmetric_matrix", "numpy.random.seed", "hypothesis.strategies.sampled_from", "hypothesis.strategies.booleans", "ivy.is_ivy_array", "ivy.to_numpy", "pytest.mark.parametrize", "hypothesis.strategies.integers" ]
[((304, 454), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""x"""', '[[[[1.0, 2.0, 3.0]], [[4.0, 5.0, 6.0]], [[1.0, 2.0, 3.0]], [[4.0, 5.0, 6.0]\n ], [[1.0, 2.0, 3.0]]], [[1.0, 2.0, 3.0]]]'], {}), "('x', [[[[1.0, 2.0, 3.0]], [[4.0, 5.0, 6.0]], [[1.0,\n 2.0, 3.0]], [[4.0, 5.0, 6.0]], [[1.0, 2.0, 3.0]]...
""" Utilities for cloud masking Credits: Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>(Sinergise) Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise) Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME> (Sinergise) This source code is licensed under the MIT license found in the LICENSE file in the r...
[ "numpy.stack", "cv2.GaussianBlur", "numpy.moveaxis", "cv2.resize" ]
[((1135, 1161), 'numpy.moveaxis', 'np.moveaxis', (['data', 'axis', '(0)'], {}), '(data, axis, 0)\n', (1146, 1161), True, 'import numpy as np\n'), ((1222, 1242), 'numpy.stack', 'np.stack', (['res_mapped'], {}), '(res_mapped)\n', (1230, 1242), True, 'import numpy as np\n'), ((1348, 1373), 'numpy.moveaxis', 'np.moveaxis',...
# 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 # # Unless required by applicable law or agree...
[ "numpy.random.seed", "csv.writer", "functools.partialmethod", "random.seed", "torch.initial_seed", "torch.no_grad" ]
[((1995, 2015), 'torch.initial_seed', 'torch.initial_seed', ([], {}), '()\n', (2013, 2015), False, 'import torch\n'), ((2021, 2056), 'random.seed', 'random.seed', (['(torch_seed + worker_id)'], {}), '(torch_seed + worker_id)\n', (2032, 2056), False, 'import random\n'), ((2130, 2168), 'numpy.random.seed', 'np.random.see...