code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python3 import numpy as np def rosenbrock(Xs: np.array, a=1, b=100) -> np.array: if (Xs.ndim > 1): x0 = Xs[0, :] x1 = Xs[1, :] else: x0 = Xs[0] x1 = Xs[1] return (a - x0) ** 2 + b * (x1 - x0 ** 2) ** 2 def rastrigin(Xs: np.array, A=10) -> np.array: N ...
[ "numpy.arange", "numpy.cos" ]
[((508, 523), 'numpy.arange', 'np.arange', (['(1)', '(6)'], {}), '(1, 6)\n', (517, 523), True, 'import numpy as np\n'), ((571, 594), 'numpy.cos', 'np.cos', (['((i + 1) * x + i)'], {}), '((i + 1) * x + i)\n', (577, 594), True, 'import numpy as np\n'), ((631, 654), 'numpy.cos', 'np.cos', (['((i + 1) * y + 1)'], {}), '((i...
''' Module containing the single-player game class called mayhem Written by <NAME> ''' import pygame as pg import numpy as np from importlib import reload import user_settings as cng from states import state_config as state_cng from states import state from classes import spaceship from classes impor...
[ "instances.game_instances.ship.update", "instances.game_instances.venus.draw", "instances.game_instances.ship.draw", "pygame.display.update", "instances.game_instances.sun.draw", "numpy.linalg.norm", "importlib.reload", "instances.game_instances.venus.update", "numpy.array", "instances.game_instan...
[((825, 853), 'numpy.linalg.norm', 'np.linalg.norm', (['self.w_shape'], {}), '(self.w_shape)\n', (839, 853), True, 'import numpy as np\n'), ((934, 976), 'numpy.round', 'np.round', (['(1000 / state_cng.game_target_fps)'], {}), '(1000 / state_cng.game_target_fps)\n', (942, 976), True, 'import numpy as np\n'), ((2148, 220...
#!/usr/bin/env python """Process duckietown simulation data to a VOC-style segmentation dataset following the same format as labelme2voc.py. Adapted the labelme repo. See https://github.com/wkentaro/labelme/blob/main/examples/semantic_segmentation/labelme2voc.py. This script assumes the raw sim data follows the follow...
[ "labelme.utils.lblsave", "numpy.save", "argparse.ArgumentParser", "os.makedirs", "os.path.basename", "cv2.cvtColor", "numpy.zeros", "os.path.exists", "imgviz.io.imsave", "PIL.Image.open", "cv2.inRange", "numpy.array", "os.path.join", "sys.exit" ]
[((2510, 2528), 'numpy.array', 'np.array', (['mask_img'], {}), '(mask_img)\n', (2518, 2528), True, 'import numpy as np\n'), ((2543, 2560), 'numpy.array', 'np.array', (['raw_img'], {}), '(raw_img)\n', (2551, 2560), True, 'import numpy as np\n'), ((2575, 2615), 'cv2.cvtColor', 'cv2.cvtColor', (['raw_img', 'cv2.COLOR_RGB2...
# Copyright 2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "functools.partial", "src.transforms.RandomResize", "src.transforms.RandomSizeCrop", "numpy.zeros", "numpy.ones", "numpy.clip", "mindspore.dataset.GeneratorDataset", "src.transforms.Normalize", "pathlib.Path", "pycocotools.coco.COCO", "numpy.array", "mindspore.dataset.DistributedSampler", "o...
[((2629, 2647), 'numpy.array', 'np.array', (['image_id'], {}), '(image_id)\n', (2637, 2647), True, 'import numpy as np\n'), ((2963, 2992), 'numpy.clip', 'np.clip', (['boxes[:, 0::2]', '(0)', 'w'], {}), '(boxes[:, 0::2], 0, w)\n', (2970, 2992), True, 'import numpy as np\n'), ((3014, 3043), 'numpy.clip', 'np.clip', (['bo...
from matplotlib import pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D import tifffile as tiff import cv2 img1 = tiff.imread('spectrum_fingerprint_real.tiff') img2 = tiff.imread('spectrum_fingerprint_fake.tiff') delta = img1 - img2 figure = plt.figure() ax = Axes3D(figure) X = np....
[ "numpy.meshgrid", "matplotlib.pyplot.show", "mpl_toolkits.mplot3d.Axes3D", "matplotlib.pyplot.figure", "numpy.arange", "numpy.cos", "tifffile.imread", "numpy.sqrt" ]
[((145, 190), 'tifffile.imread', 'tiff.imread', (['"""spectrum_fingerprint_real.tiff"""'], {}), "('spectrum_fingerprint_real.tiff')\n", (156, 190), True, 'import tifffile as tiff\n'), ((199, 244), 'tifffile.imread', 'tiff.imread', (['"""spectrum_fingerprint_fake.tiff"""'], {}), "('spectrum_fingerprint_fake.tiff')\n", (...
# -*- coding: utf-8 -*- """ Created on Mon Nov 23 14:59:04 2020 @authors: <NAME> <NAME> <NAME> <NAME> %================================LoRaSimSODAQ.py===============================% A LoRa mesh simulation program, commissioned by SODAQ. This program is made in order t...
[ "matplotlib.pyplot.show", "random.randint", "math.ceil", "matplotlib.pyplot.axes", "random.choice", "matplotlib.widgets.Button", "matplotlib.pyplot.draw", "matplotlib.pyplot.Line2D", "matplotlib.pyplot.Circle", "math.log", "matplotlib.pyplot.subplots", "sys.exit", "numpy.sqrt" ]
[((44054, 44068), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (44066, 44068), True, 'import matplotlib.pyplot as plt\n'), ((44080, 44113), 'matplotlib.pyplot.axes', 'plt.axes', (['[0.58, 0.9, 0.1, 0.075]'], {}), '([0.58, 0.9, 0.1, 0.075])\n', (44088, 44113), True, 'import matplotlib.pyplot as plt\n'...
import numpy as np import pandas as pd import utils.io_handler as io_handler import os, collections, scipy, itertools, multiprocessing, shutil import scipy, pickle, json import sklearn, sklearn.ensemble import csv from datetime import datetime from pprint import pprint from tensorflow.python.platform import flags from...
[ "pandas.DataFrame", "data_postp.matching.train_and_dump_classifier", "data_postp.similarity_computations.df_col_to_matrix", "numpy.split", "sklearn.linear_model.LogisticRegression", "numpy.mean", "pandas.read_pickle" ]
[((1235, 1267), 'pandas.read_pickle', 'pd.read_pickle', (['PICKLE_FILE_TEST'], {}), '(PICKLE_FILE_TEST)\n', (1249, 1267), True, 'import pandas as pd\n'), ((1426, 1505), 'numpy.split', 'np.split', (['transformed_vectors_as_matrix', 'transformed_vectors_as_matrix.shape[0]'], {}), '(transformed_vectors_as_matrix, transfor...
""" Authors: <NAME> & <NAME> A number of visualization tools are included here to aid the user in evaluating the: convergence of lnprob the posterior PDFs the evolution of the PDFs for each parameter of the model the covariance matrix for the posterior PDFs the best-fit model a number of rand...
[ "matplotlib.pyplot.title", "matplotlib.backends.backend_pdf.PdfPages", "yaml.load", "matplotlib.rc", "numpy.abs", "modifypdf.cleanColumns", "matplotlib.pyplot.clf", "numpy.ravel", "modifypdf.prune", "cPickle.load", "matplotlib.pyplot.figure", "os.path.isfile", "numpy.arange", "plotutils.au...
[((639, 660), 'yaml.load', 'yaml.load', (['configfile'], {}), '(configfile)\n', (648, 660), False, 'import yaml\n'), ((1571, 1580), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (1578, 1580), True, 'import matplotlib.pyplot as plt\n'), ((1585, 1615), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(...
#!/usr/bin/env python3 """ S3FD Face detection plugin https://arxiv.org/abs/1708.05237 Adapted from S3FD Port in FAN: https://github.com/1adrianb/face-alignment """ from scipy.special import logsumexp import numpy as np import keras import keras.backend as K from lib.model.session import KSession from ._base import ...
[ "keras.backend.constant", "numpy.maximum", "numpy.minimum", "numpy.average", "numpy.dtype", "keras.backend.sum", "numpy.zeros", "keras.backend.pow", "keras.backend.ndim", "numpy.where", "numpy.array", "numpy.exp", "scipy.special.logsumexp", "keras.backend.int_shape", "numpy.ascontiguousa...
[((4942, 4956), 'keras.backend.int_shape', 'K.int_shape', (['x'], {}), '(x)\n', (4953, 4956), True, 'import keras.backend as K\n'), ((6082, 6118), 'keras.backend.sum', 'K.sum', (['x', 'self._axes', 'self._keepdims'], {}), '(x, self._axes, self._keepdims)\n', (6087, 6118), True, 'import keras.backend as K\n'), ((6202, 6...
#!/usr/bin/env python # plots stimulus paramaters import numpy as np import matplotlib.pyplot as plt from matplotlib.collections import LineCollection from matplotlib.colors import ListedColormap, BoundaryNorm ## Options #################################################################### oFreq = [1, 2...
[ "matplotlib.collections.LineCollection", "matplotlib.pyplot.show", "matplotlib.pyplot.box", "matplotlib.pyplot.figure", "numpy.sin", "numpy.arange", "numpy.tile", "numpy.linspace", "numpy.array", "numpy.concatenate", "numpy.repeat" ]
[((797, 827), 'numpy.arange', 'np.arange', (['(oTime * oResolution)'], {}), '(oTime * oResolution)\n', (806, 827), True, 'import numpy as np\n'), ((837, 890), 'numpy.sin', 'np.sin', (['(2 * np.pi * time / (oRotPeriod * oResolution))'], {}), '(2 * np.pi * time / (oRotPeriod * oResolution))\n', (843, 890), True, 'import ...
#!/usr/bin/env python # -*- coding: utf8 -*- from urllib.request import urlopen import pandas as pd import numpy as np import time from astropy.io import votable import warnings from astropy import coordinates as coord from astropy import units as u # For fun, but still useful from clint.textui import puts, colored war...
[ "warnings.simplefilter", "astropy.io.votable.parse", "pandas.read_csv", "clint.textui.colored.clean", "urllib.request.urlopen", "time.strftime", "clint.textui.colored.green", "numpy.where", "warnings.catch_warnings", "io.open", "astropy.coordinates.SkyCoord" ]
[((317, 348), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {}), "('ignore')\n", (338, 348), False, 'import warnings\n'), ((468, 484), 'io.open', 'open', (['fname', '"""w"""'], {}), "(fname, 'w')\n", (472, 484), False, 'from io import open\n'), ((1346, 1369), 'pandas.read_csv', 'pd.read_csv', (['...
import matplotlib matplotlib.use('Agg') import os import json from optparse import OptionParser from collections import defaultdict, Counter import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm from common import create_poly def main(): usage = "%prog path/to/conf...
[ "optparse.OptionParser", "statsmodels.api.OLS", "pandas.read_csv", "numpy.isnan", "collections.defaultdict", "numpy.mean", "os.path.join", "pandas.DataFrame", "statsmodels.api.Logit", "numpy.std", "os.path.exists", "statsmodels.api.NegativeBinomial", "collections.Counter", "matplotlib.pypl...
[((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((343, 368), 'optparse.OptionParser', 'OptionParser', ([], {'usage': 'usage'}), '(usage=usage)\n', (355, 368), False, 'from optparse import OptionParser\n'), ((1313, 1359), 'pandas.read_csv', 'pd.r...
""" Load in all of the stays*.csv.gz files, group by a users path for a day, and save all of these paths into individual files for each sequence of stays. These files than then be incrementally read in during training. This version of the script will bin each trajectory into hour long time bins where the location is...
[ "pickle.dump", "tqdm.tqdm", "pandas.read_csv", "pandas.to_datetime", "numpy.arange", "glob.glob" ]
[((526, 565), 'glob.glob', 'glob.glob', (["(data_directory + '/*.csv.gz')"], {}), "(data_directory + '/*.csv.gz')\n", (535, 565), False, 'import pandas as pd, numpy as np, os, glob, pickle\n'), ((647, 669), 'pandas.read_csv', 'pd.read_csv', (['stays_csv'], {}), '(stays_csv)\n', (658, 669), True, 'import pandas as pd, n...
import os import torch import numpy as np import cv2 from datasets.DOTA_devkit.ResultMerge_multi_process import py_cpu_nms_poly_fast, py_cpu_nms_poly def normalize_img(image): image = (image / 255.0 - (0.485, 0.456, 0.406)) / (0.229, 0.224, 0.225) return image.astype(np.float32) def preprocess(i...
[ "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "shapely.geometry.Polygon", "matplotlib.pyplot.imshow", "numpy.asarray", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "numpy.mean", "numpy.array", "datasets.DOTA_devkit.ResultMerge_multi_process.py_cpu_nms_poly_fast", "matplotlib.py...
[((358, 375), 'numpy.asarray', 'np.asarray', (['image'], {}), '(image)\n', (368, 375), True, 'import numpy as np\n'), ((389, 426), 'cv2.resize', 'cv2.resize', (['image', '(input_w, input_h)'], {}), '(image, (input_w, input_h))\n', (399, 426), False, 'import cv2\n'), ((560, 587), 'torch.from_numpy', 'torch.from_numpy', ...
# Copyright 2022 The KerasCV Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[ "numpy.uint8", "tensorflow.random.Generator.from_non_deterministic_state", "tensorflow.stack", "tensorflow.cast", "numpy.arange", "tensorflow.function", "keras_cv.layers.preprocessing.posterization.Posterization" ]
[((753, 803), 'tensorflow.random.Generator.from_non_deterministic_state', 'tf.random.Generator.from_non_deterministic_state', ([], {}), '()\n', (801, 803), True, 'import tensorflow as tf\n'), ((1544, 1590), 'keras_cv.layers.preprocessing.posterization.Posterization', 'Posterization', ([], {'bits': 'bits', 'value_range'...
""" Dissimilarity measures for clustering """ # Author: '<NAME>' <<EMAIL>> # License: MIT import numpy as np def matching_dissim(a, b): """Simple matching dissimilarity function""" return np.sum(a != b, axis=1) def euclidean_dissim(a, b): """Euclidean distance dissimilarity function""" if np.isnan...
[ "numpy.sum", "numpy.isnan" ]
[((200, 222), 'numpy.sum', 'np.sum', (['(a != b)'], {'axis': '(1)'}), '(a != b, axis=1)\n', (206, 222), True, 'import numpy as np\n'), ((437, 465), 'numpy.sum', 'np.sum', (['((a - b) ** 2)'], {'axis': '(1)'}), '((a - b) ** 2, axis=1)\n', (443, 465), True, 'import numpy as np\n'), ((312, 323), 'numpy.isnan', 'np.isnan',...
import unittest import numpy as np import multipy ################################################################################ ################################################################################ #### #### Class: Transform #### ########################################################################...
[ "numpy.allclose", "numpy.ones", "numpy.shape", "numpy.array", "numpy.loadtxt", "numpy.random.rand", "multipy.Transform" ]
[((538, 560), 'numpy.random.rand', 'np.random.rand', (['(2)', '(100)'], {}), '(2, 100)\n', (552, 560), True, 'import numpy as np\n'), ((573, 593), 'numpy.array', 'np.array', (['[[1], [1]]'], {}), '([[1], [1]])\n', (581, 593), True, 'import numpy as np\n'), ((933, 955), 'numpy.random.rand', 'np.random.rand', (['(5)', '(...
''' This module provides all the methods needed to succesfully deploy a model. We provide methods for URL based, file based and folder based deployment. Allowing you to choose one to mix and match with your own project's needs. The main method shows a use case of the deploy.py module, and also has argument parsing whic...
[ "h5py.File", "data.get_categories", "os.path.basename", "data.resize", "os.walk", "cv2.imread", "numpy.array", "collections.namedtuple", "urllib.urlretrieve", "os.path.join" ]
[((598, 651), 'collections.namedtuple', 'namedtuple', (['"""Prediction"""', '"""rank category probability"""'], {}), "('Prediction', 'rank category probability')\n", (608, 651), False, 'from collections import namedtuple\n'), ((1318, 1344), 'os.walk', 'os.walk', (['test_image_folder'], {}), '(test_image_folder)\n', (13...
#!/usr/bin/env python import argparse import numpy as np from openbabel import pybel import pandas as pd def get_bond_info(m): bond_dict = dict() mol = m.OBMol for i in range(mol.NumBonds()): bb = mol.GetBondById(i) if bb is None: continue begin = bb.GetBeginAtomIdx() ...
[ "pandas.read_csv", "numpy.linalg.norm", "numpy.array", "openbabel.pybel.readfile" ]
[((728, 762), 'openbabel.pybel.readfile', 'pybel.readfile', (['"""pdb"""', 'ligand_file'], {}), "('pdb', ligand_file)\n", (742, 762), False, 'from openbabel import pybel\n'), ((2627, 2660), 'numpy.array', 'np.array', (['[39.864, 22.37, 13.612]'], {}), '([39.864, 22.37, 13.612])\n', (2635, 2660), True, 'import numpy as ...
""" The ComposedErrorgen class and supporting functionality. """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U.S....
[ "pygsti.modelmembers.modelmember._decompose_gpindices", "pygsti.modelmembers.operations.linearop.LinearOperator.__init__", "numpy.empty", "numpy.zeros", "pygsti.evotypes.Evotype.cast", "pygsti.baseobjs.statespace.StateSpace.cast", "scipy.sparse.csr_matrix", "numpy.take", "numpy.arange", "pygsti.to...
[((2908, 2930), 'pygsti.evotypes.Evotype.cast', '_Evotype.cast', (['evotype'], {}), '(evotype)\n', (2921, 2930), True, 'from pygsti.evotypes import Evotype as _Evotype\n'), ((4038, 4082), 'pygsti.modelmembers.operations.linearop.LinearOperator.__init__', '_LinearOperator.__init__', (['self', 'rep', 'evotype'], {}), '(s...
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # 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 us...
[ "PIL.Image.new", "xt.environment.MiniGrid.TC_utils.utils_traffic_control.get_world_plot_wall", "numpy.ones", "numpy.zeros_like", "numpy.copy", "os.path.exists", "numpy.random.choice", "PIL.ImageDraw.Draw", "xt.environment.MiniGrid.TC_utils.utils_traffic_control.init_complex", "xt.environment.MiniG...
[((2600, 2651), 'PIL.ImageFont.truetype', 'ImageFont.truetype', (['"""./envs/TC_utils/cmb10.ttf"""', '(25)'], {}), "('./envs/TC_utils/cmb10.ttf', 25)\n", (2618, 2651), False, 'from PIL import Image, ImageDraw, ImageFont\n'), ((3617, 3679), 'xt.environment.MiniGrid.TC_utils.utils_traffic_control.get_various_list', 'get_...
"""Backend supported: tensorflow.compat.v1""" import deepxde as dde import xde as xde import numpy as np import matplotlib import matplotlib.pyplot as plt import random from deepxde.backend import tf ## useful reference: https://en.wikipedia.org/wiki/Laplace_operator#Coordinate_expressions ## Laplacian-beltrami operat...
[ "deepxde.backend.tf.sin", "xde.saveplot", "xde.data.PDE", "xde.Model", "xde.maps.FNN", "xde.geometry.geometry_1d.Interval", "numpy.hstack", "numpy.isclose", "xde.DirichletBC", "numpy.sin", "deepxde.backend.tf.cos", "xde.metrics.l2_relative_error", "xde.grad.hessian" ]
[((1081, 1113), 'xde.grad.hessian', 'xde.grad.hessian', (['y', 'x'], {'i': '(0)', 'j': '(0)'}), '(y, x, i=0, j=0)\n', (1097, 1113), True, 'import xde as xde\n'), ((1148, 1161), 'deepxde.backend.tf.sin', 'tf.sin', (['theta'], {}), '(theta)\n', (1154, 1161), False, 'from deepxde.backend import tf\n'), ((1215, 1234), 'num...
""" Penalty matrix generators """ import scipy as sp import numpy as np def derivative(n, coef, derivative=2, periodic=False): """ Builds a penalty matrix for P-Splines with continuous features. Penalizes the squared differences between basis coefficients. Parameters ---------- n : int ...
[ "scipy.sparse.issparse", "numpy.zeros", "scipy.sparse.csc_matrix", "scipy.sparse.identity", "scipy.sparse.block_diag", "scipy.sparse.eye" ]
[((765, 790), 'scipy.sparse.csc_matrix', 'sp.sparse.csc_matrix', (['(0.0)'], {}), '(0.0)\n', (785, 790), True, 'import scipy as sp\n'), ((2683, 2708), 'scipy.sparse.csc_matrix', 'sp.sparse.csc_matrix', (['(0.0)'], {}), '(0.0)\n', (2703, 2708), True, 'import scipy as sp\n'), ((4799, 4824), 'scipy.sparse.csc_matrix', 'sp...
import numpy as np import os import sys import ntpath import time from . import util, html from tensorboardX import SummaryWriter from datetime import datetime def save_images(webpage, visuals, image_path, aspect_ratio=1.0, width=256): """Save images to the disk. Parameters: webpage (the HTML class) -...
[ "tensorboardX.SummaryWriter", "ntpath.basename", "numpy.transpose", "time.strftime", "datetime.datetime.now", "os.path.splitext", "os.path.join" ]
[((906, 936), 'ntpath.basename', 'ntpath.basename', (['image_path[0]'], {}), '(image_path[0])\n', (921, 936), False, 'import ntpath\n'), ((948, 976), 'os.path.splitext', 'os.path.splitext', (['short_path'], {}), '(short_path)\n', (964, 976), False, 'import os\n'), ((1194, 1229), 'os.path.join', 'os.path.join', (['image...
import numpy as np import matplotlib as mpl import create_data mpl.use("Agg") import matplotlib.pyplot as plt class InputData(object): """An object of InputData must have images and labels. Attributes: images: A list of lists of image pixels. labels: A list of one-hot label lists. """ ...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplotlib.pyplot.colorbar", "matplotlib.use", "numpy.arange", "create_data.generate_data", "numpy.random.shuffle" ]
[((64, 78), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (71, 78), True, 'import matplotlib as mpl\n'), ((3203, 3262), 'matplotlib.pyplot.imshow', 'plt.imshow', (['matrix'], {'interpolation': '"""nearest"""', 'origin': '"""upper"""'}), "(matrix, interpolation='nearest', origin='upper')\n", (3213, 3262...
from __future__ import division import pandas as pd import numpy as np import scipy.io.wavfile as wav # Reads wav file import os import sys from glob import glob from datagrabber import * from sklearn import preprocessing import pickle IEMOCAP_LOCATION = "../../../local" SCALER_LOCATION = "frame_scaler.sav" verbose...
[ "sys.stdout.write", "sys.stdout.flush", "numpy.zeros", "sklearn.preprocessing.StandardScaler" ]
[((358, 383), 'numpy.zeros', 'np.zeros', (['(100000, 16000)'], {}), '((100000, 16000))\n', (366, 383), True, 'import numpy as np\n'), ((1331, 1361), 'sklearn.preprocessing.StandardScaler', 'preprocessing.StandardScaler', ([], {}), '()\n', (1359, 1361), False, 'from sklearn import preprocessing\n'), ((852, 899), 'sys.st...
import gym from model import DQNPong, DQNAgent from utils.wrappers import wrap_deepmind from configs import DensePongAgentConfig as dense_config import numpy as np from argparse import ArgumentParser OBJECTIVE_SCORE = 18.0 def main(): agent = DQNPong(input_size=dense_config.input_size, output_size=dense_config.o...
[ "model.DQNPong", "argparse.ArgumentParser", "gym.make", "utils.wrappers.wrap_deepmind", "numpy.asarray", "numpy.mean", "numpy.reshape" ]
[((250, 398), 'model.DQNPong', 'DQNPong', ([], {'input_size': 'dense_config.input_size', 'output_size': 'dense_config.output_size', 'model_path': 'dense_config.model_path', 'scope': 'dense_config.scope'}), '(input_size=dense_config.input_size, output_size=dense_config.\n output_size, model_path=dense_config.model_pa...
import struct import binascii import numpy as np from .specs import header_spec, dtype_spec header_struct = struct.Struct(''.join(header_spec.values())) def read(path, header_only=False, mmap=False): """ read an em file and return header info as a dict and data as a np.ndarray """ with open(path, ...
[ "numpy.fromfile", "numpy.memmap", "binascii.b2a_base64" ]
[((656, 678), 'binascii.b2a_base64', 'binascii.b2a_base64', (['v'], {}), '(v)\n', (675, 678), False, 'import binascii\n'), ((1089, 1164), 'numpy.memmap', 'np.memmap', (['f'], {'dtype': 'dtype', 'shape': 'shape', 'offset': 'header_struct.size', 'mode': '"""r"""'}), "(f, dtype=dtype, shape=shape, offset=header_struct.siz...
import sys sys.path.insert(0, '..') from CSSPy.dataset_tools import * from CSSPy.visualization_tools import * import numpy as np import pandas as pd from matplotlib import pyplot as plt from matplotlib import rcParams rcParams.update({'figure.autolayout': True}) # This is a test for basic functions of this package: ## ...
[ "pandas.read_csv", "matplotlib.rcParams.update", "numpy.transpose", "sys.path.insert", "numpy.shape", "numpy.linalg.svd" ]
[((11, 35), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (26, 35), False, 'import sys\n'), ((218, 262), 'matplotlib.rcParams.update', 'rcParams.update', (["{'figure.autolayout': True}"], {}), "({'figure.autolayout': True})\n", (233, 262), False, 'from matplotlib import rcParams\n'), (...
from __future__ import print_function from numpy import array, arange, zeros, unique, searchsorted, full, nan, isnan from numpy.linalg import norm # type: ignore from pyNastran.utils.numpy_utils import integer_types from pyNastran.bdf.field_writer_8 import print_card_8 from pyNastran.bdf.field_writer_16 import print_...
[ "numpy.full", "pyNastran.bdf.field_writer_8.set_blank_if_default", "pyNastran.bdf.bdf_interface.assign_type.integer", "pyNastran.bdf.field_writer_8.print_card_8", "numpy.unique", "numpy.zeros", "numpy.searchsorted", "numpy.isnan", "pyNastran.bdf.bdf_interface.assign_type.integer_or_blank", "numpy....
[((1854, 1883), 'pyNastran.dev.bdf_vectorized.cards.elements.element.Element.__init__', 'Element.__init__', (['self', 'model'], {}), '(self, model)\n', (1870, 1883), False, 'from pyNastran.dev.bdf_vectorized.cards.elements.element import Element\n'), ((2702, 2732), 'pyNastran.bdf.bdf_interface.assign_type.integer', 'in...
# coding: utf-8 import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' import logging, sys, io, time, cv2, threading, socketserver import numpy as np, tensorflow as tf from time import sleep from threading import Condition from http import server from yolov3.utils import * PAGE="""\ <html> <head> <title>Raspberry Pi ...
[ "threading.Thread", "io.BytesIO", "cv2.putText", "cv2.VideoWriter_fourcc", "cv2.rotate", "numpy.copy", "threading.Condition", "numpy.zeros", "tensorflow.concat", "tensorflow.constant", "time.time", "cv2.VideoCapture", "time.sleep", "tensorflow.shape", "cv2.imencode", "http.server.serve...
[((528, 540), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (538, 540), False, 'import logging, sys, io, time, cv2, threading, socketserver\n'), ((566, 577), 'threading.Condition', 'Condition', ([], {}), '()\n', (575, 577), False, 'from threading import Condition\n'), ((3002, 3022), 'cv2.VideoCapture', 'cv2.VideoCaptur...
import itertools import math import os import cv2 import time import argparse import matplotlib.pyplot as plt # import imutils import torch import warnings import numpy as np import yaml import glob from chatbot import telegram from detector import build_detector from deep_sort import build_tracker from utils.draw impo...
[ "argparse.ArgumentParser", "cv2.VideoWriter_fourcc", "utils.draw.draw_boxes", "matplotlib.pyplot.figure", "os.path.isfile", "yaml.safe_load", "cv2.VideoWriter", "cv2.rectangle", "cv2.imshow", "os.path.join", "matplotlib.pyplot.xlabel", "cv2.line", "cv2.cvtColor", "cv2.imwrite", "matplotl...
[((2223, 2290), 'cv2.circle', 'cv2.circle', (['img', '(pair[0][0], pair[0][1])', 'BIG_CIRCLE', 'COLOR_RED', '(2)'], {}), '(img, (pair[0][0], pair[0][1]), BIG_CIRCLE, COLOR_RED, 2)\n', (2233, 2290), False, 'import cv2\n'), ((2295, 2365), 'cv2.circle', 'cv2.circle', (['img', '(pair[0][0], pair[0][1])', 'SMALL_CIRCLE', 'C...
import numpy as np import torch import torch.nn as nn import torch.optim as optim import qwz_utils import qwz_manifold import qwz_tda import os class qwz_deformation_dirichlet(nn.Module): j = complex(0,1) def __init__(self, mesh_size, param_list=None, precomputed=False, state_list=None): """ u...
[ "torch.nn.init.uniform_", "qwz_manifold.qwz_manifold", "numpy.argsort", "torch.cos", "torch.no_grad", "numpy.power", "qwz_utils.distance", "numpy.take_along_axis", "torch.exp", "torch.Tensor", "torch.zeros", "torch.matmul", "qwz_tda.qwz_tda", "torch.zeros_like", "numpy.median", "numpy....
[((690, 736), 'numpy.array', 'np.array', (['[state.real for state in state_list]'], {}), '([state.real for state in state_list])\n', (698, 736), True, 'import numpy as np\n'), ((756, 802), 'numpy.array', 'np.array', (['[state.imag for state in state_list]'], {}), '([state.imag for state in state_list])\n', (764, 802), ...
# Copyright 2021 Alibaba Group Holding Limited. 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 ...
[ "tensorflow.einsum", "epl.config.Config", "tensorflow.trainable_variables", "tensorflow.reshape", "epl.replicate", "tensorflow.ConfigProto", "numpy.random.randint", "tensorflow.keras.activations.get", "tensorflow.clip_by_global_norm", "tensorflow.gradients", "tensorflow.clip_by_norm", "epl.Con...
[((22870, 22881), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (22879, 22881), False, 'from tensorflow.python.platform import test\n'), ((1185, 1205), 'distutils.version.LooseVersion', 'Version', (['__version__'], {}), '(__version__)\n', (1192, 1205), True, 'from distutils.version import Loose...
from torch_connectomics.model.loss import * from torch_connectomics.utils.vis import visualize, visualize_aff from torch_connectomics.utils.net import * import numpy as np import h5py def train_val(args, train_loader,test_loader, model, model_io_size, pad_size, device, criterion, optimizer, scheduler, logger...
[ "h5py.File", "numpy.sum", "torch_connectomics.utils.vis.visualize", "numpy.zeros", "numpy.expand_dims", "numpy.min", "torch_connectomics.utils.vis.visualize_aff" ]
[((3437, 3466), 'numpy.zeros', 'np.zeros', (['x'], {'dtype': 'np.float32'}), '(x, dtype=np.float32)\n', (3445, 3466), True, 'import numpy as np\n'), ((5759, 5780), 'numpy.sum', 'np.sum', (['(gt & seg_eval)'], {}), '(gt & seg_eval)\n', (5765, 5780), True, 'import numpy as np\n'), ((5794, 5816), 'numpy.sum', 'np.sum', ([...
import sys from tools import cg_lib from tools import tensor as cplx_lib import itertools import numpy as np import scipy.linalg from opt_einsum import contract from joblib import Memory location = './cachedir' memory = Memory(location, verbose=0) USE_CACHE = False if USE_CACHE: clebsch_gordan_cached = memory.cach...
[ "numpy.load", "tools.tensor.cplx_contractor", "numpy.zeros", "torch.randn", "numpy.einsum", "numpy.any", "tools.tensor.np_to_cplx", "torch.zeros", "joblib.Memory", "tools.tensor.cplx_to_np" ]
[((221, 248), 'joblib.Memory', 'Memory', (['location'], {'verbose': '(0)'}), '(location, verbose=0)\n', (227, 248), False, 'from joblib import Memory\n'), ((767, 843), 'numpy.zeros', 'np.zeros', (['(gens.shape[0], gens.shape[0], gens.shape[0])'], {'dtype': 'np.complex128'}), '((gens.shape[0], gens.shape[0], gens.shape[...
import os import pytest import pandas as pd import numpy as np from nltk.tokenize import sent_tokenize from keras.preprocessing.sequence import pad_sequences from keras.preprocessing.text import Tokenizer @pytest.fixture def testpath(): return os.path.dirname(os.path.abspath(__file__)) @pytest.fixture def df_r...
[ "numpy.pad", "os.path.abspath", "pandas.read_csv", "keras.preprocessing.sequence.pad_sequences", "nltk.tokenize.sent_tokenize", "keras.preprocessing.text.Tokenizer" ]
[((403, 427), 'pandas.read_csv', 'pd.read_csv', (['path_to_csv'], {}), '(path_to_csv)\n', (414, 427), True, 'import pandas as pd\n'), ((527, 553), 'keras.preprocessing.text.Tokenizer', 'Tokenizer', ([], {'num_words': '(20000)'}), '(num_words=20000)\n', (536, 553), False, 'from keras.preprocessing.text import Tokenizer\...
import numpy as np import matplotlib.pyplot as plt import pickle parameters = {'axes.labelsize':'x-large', 'xtick.labelsize':'x-large', 'ytick.labelsize':'x-large'} plt.rcParams.update(parameters) with open('outputs/pk_gda_K100.pkl', 'rb') as infile: out_GDA_K100 = pickle.load(infile) with open('ou...
[ "matplotlib.pyplot.xlim", "matplotlib.pyplot.yscale", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.scatter", "matplotlib.pyplot.yticks", "numpy.ones", "numpy.hstack", "numpy.sort", "matplotlib.pyplot.figure", "matplotlib.pyplot.rcParams.update", "pickle.load", "nump...
[((180, 211), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (['parameters'], {}), '(parameters)\n', (199, 211), True, 'import matplotlib.pyplot as plt\n'), ((1377, 1389), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1387, 1389), True, 'import matplotlib.pyplot as plt\n'), ((1543, 1567), 'm...
import numpy as np import pandas as pd class AllDatasets(object): """Pre-process, organize, normalize all training data sets""" def __init__(self, input_data=None): """Initialize input data""" self.input_data = input_data def toy_data_set(self, n_row): x_inputs_1 = np.random...
[ "numpy.random.rand", "numpy.array", "numpy.random.randn" ]
[((311, 332), 'numpy.random.rand', 'np.random.rand', (['n_row'], {}), '(n_row)\n', (325, 332), True, 'import numpy as np\n'), ((354, 375), 'numpy.random.rand', 'np.random.rand', (['n_row'], {}), '(n_row)\n', (368, 375), True, 'import numpy as np\n'), ((397, 418), 'numpy.random.rand', 'np.random.rand', (['n_row'], {}), ...
import warnings warnings.filterwarnings('ignore') import os import sys import glob import lxml.etree as ET from pprint import pprint import time import argparse import numpy as np import pandas as pd from matplotlib import pyplot as plt import cv2 from PIL import Image import tensorflow as tf from keras.models impo...
[ "keras.models.load_model", "argparse.ArgumentParser", "syntactical_analysis.lexer.Lexer", "numpy.resize", "pandas.read_csv", "keras.backend.set_image_data_format", "matplotlib.pyplot.figure", "glob.glob", "tensorflow.get_default_graph", "cv2.imshow", "tensorflow.greater", "sys.path.append", ...
[((16, 49), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (39, 49), False, 'import warnings\n'), ((590, 631), 'keras.backend.set_image_data_format', 'K.set_image_data_format', (['"""channels_first"""'], {}), "('channels_first')\n", (613, 631), True, 'from keras import bac...
import logging import numpy as np import pandas as pd from functools import singledispatch @singledispatch def log2_normalize(mat, offset=1.): ''' Compute log normalization of matrix Simple `log2(x + offset)`, offset usually set to 1. because log(0) is undefined. ''' logging.warn('Unrecognized type: ' + type(...
[ "numpy.log2", "numpy.log10" ]
[((468, 489), 'numpy.log2', 'np.log2', (['(mat + offset)'], {}), '(mat + offset)\n', (475, 489), True, 'import numpy as np\n'), ((578, 599), 'numpy.log2', 'np.log2', (['(mat + offset)'], {}), '(mat + offset)\n', (585, 599), True, 'import numpy as np\n'), ((982, 1004), 'numpy.log10', 'np.log10', (['(mat + offset)'], {})...
# coding: utf-8 ################################################################### # Copyright (c) 2016-2020 European Synchrotron Radiation Facility # # # # Author: <NAME> # # ...
[ "numpy.trapz", "copy.deepcopy", "numpy.zeros_like", "numpy.abs", "crispy.utils.broaden.broaden", "numpy.finfo", "numpy.loadtxt", "numpy.linspace", "logging.getLogger" ]
[((830, 857), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (847, 857), False, 'import logging\n'), ((1203, 1229), 'copy.deepcopy', 'copy.deepcopy', (['item.suffix'], {}), '(item.suffix)\n', (1216, 1229), False, 'import copy\n'), ((3882, 3925), 'crispy.utils.broaden.broaden', 'broaden', ...
""" Author: <NAME> """ import cantera as ct import matplotlib.pyplot as plt import numpy as np from scipy.optimize import fsolve def _volumeConservation(pressure,volumes,gases,volumeChambre,fullOutput=False): compressedVolumes = np.zeros(len(volumes)) # equilibrateSet = [0,0,0] equilibrateSet...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "scipy.optimize.fsolve", "numpy.array", "cantera.Solution", "numpy.nanmax" ]
[((6644, 6675), 'numpy.array', 'np.array', (['[volumeChambre, 0, 0]'], {}), '([volumeChambre, 0, 0])\n', (6652, 6675), True, 'import numpy as np\n'), ((7327, 7374), 'numpy.array', 'np.array', (['[volumes[0] * gases[0].density, 0, 0]'], {}), '([volumes[0] * gases[0].density, 0, 0])\n', (7335, 7374), True, 'import numpy ...
# -*- coding: utf-8 -*- """ This program reads the npy datafile generated from single.py and makes plots. """ import numpy as np import matplotlib.pyplot as plt DIR = "./" data=np.load(DIR + "single_data.npy", allow_pickle=True) #%% tspan_n = data[0] # s xspan = data[1] M = data[3] U = data[2] tspan...
[ "numpy.load", "numpy.meshgrid", "numpy.abs", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.xticks", "numpy.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.subplots", "matp...
[((186, 237), 'numpy.load', 'np.load', (["(DIR + 'single_data.npy')"], {'allow_pickle': '(True)'}), "(DIR + 'single_data.npy', allow_pickle=True)\n", (193, 237), True, 'import numpy as np\n'), ((498, 541), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8.5, 6)', 'linewidth': '(1.5)'}), '(figsize=(8.5, 6),...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import pandas as pd import matplotlib.pyplot as plt from pyPreprocessing.baseline_correction import generate_baseline from pyPreprocessing.smoothing import smoothing from pyRegression.nonlinear_regression import calc_function from little_helpers.num_de...
[ "numpy.zeros_like", "matplotlib.pyplot.plot", "pyPreprocessing.baseline_correction.generate_baseline", "matplotlib.pyplot.legend", "pyPreprocessing.smoothing.smoothing", "numpy.random.default_rng", "matplotlib.pyplot.figure", "numpy.array", "pandas.Series", "numpy.linspace", "numpy.squeeze", "...
[((3280, 3359), 'pyPreprocessing.smoothing.smoothing', 'smoothing', (['spectrum[1][np.newaxis]', '"""sav_gol"""'], {'savgol_points': '(10)', 'savgol_order': '(9)'}), "(spectrum[1][np.newaxis], 'sav_gol', savgol_points=10, savgol_order=9)\n", (3289, 3359), False, 'from pyPreprocessing.smoothing import smoothing\n'), ((3...
# Effective Computing Coding Assignment import numpy as np import sys, os import pickle # sys.path.append(os.path.abspath('../shared')) import my_module as mymod from importlib import reload reload(mymod) # make sure the output directory exists this_dir = os.path.abspath('.').split('/')[-1] # this_parent = os.path.a...
[ "os.path.abspath", "numpy.argmax", "numpy.clip", "importlib.reload", "my_module.make_dir", "numpy.array", "numpy.arange", "numpy.sqrt" ]
[((193, 206), 'importlib.reload', 'reload', (['mymod'], {}), '(mymod)\n', (199, 206), False, 'from importlib import reload\n'), ((431, 454), 'my_module.make_dir', 'mymod.make_dir', (['out_dir'], {}), '(out_dir)\n', (445, 454), True, 'import my_module as mymod\n'), ((505, 553), 'numpy.array', 'np.array', (['[1, 4, 9, 16...
#!/usr/bin/env python #_*_coding:utf-8_*_ '''determine whether the version of user's python comply with the requirements of this procedure''' import sys if sys.version_info[0] != 3 or sys.version_info[1] != 7: print("\nYou are using python" + str(sys.version_info[0]) + '.' + str(sys.version_info[1]) + " , while pHisP...
[ "os.remove", "optparse.OptionParser", "os.getcwd", "re.finditer", "sklearn.preprocessing.MinMaxScaler", "time.time", "time.localtime", "numpy.loadtxt", "os.path.splitext", "sklearn.svm.SVC", "os.path.split", "sys.exit" ]
[((3947, 3970), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (3968, 3970), False, 'import optparse\n'), ((4941, 4952), 'time.time', 'time.time', ([], {}), '()\n', (4950, 4952), False, 'import time\n'), ((5555, 5584), 'os.path.split', 'os.path.split', (['outPutFileName'], {}), '(outPutFileName)\n'...
import matplotlib.pyplot as plt import h5py import numpy as np import sys h5fname = sys.argv[1] if not h5fname: h5fname = 'temp.h5' dataset = h5py.File(h5fname, "r") x = np.array(dataset["x"][:]) x_pad = np.array(dataset["x_pad"][:]) fig, axarr = plt.subplots(1, 2) axarr[0].set_title('x') axarr[0].imshow(x[0, :,...
[ "h5py.File", "matplotlib.pyplot.savefig", "numpy.array", "matplotlib.pyplot.subplots" ]
[((148, 171), 'h5py.File', 'h5py.File', (['h5fname', '"""r"""'], {}), "(h5fname, 'r')\n", (157, 171), False, 'import h5py\n'), ((176, 201), 'numpy.array', 'np.array', (["dataset['x'][:]"], {}), "(dataset['x'][:])\n", (184, 201), True, 'import numpy as np\n'), ((210, 239), 'numpy.array', 'np.array', (["dataset['x_pad'][...
""" This module implements classes and methods to manage the variables in fitting. """ import warnings import numpy as np import sympy as sy from .config import get_config, regist_config from .tensorflow_wrapper import tf def combineVM(vm1, vm2, name="", same_list=None): """ This function combines two VarsM...
[ "sympy.symbols", "sympy.solve", "numpy.random.chisquare", "sympy.diff", "sympy.sympify", "numpy.ones", "numpy.array" ]
[((29386, 29401), 'numpy.array', 'np.array', (['xvals'], {}), '(xvals)\n', (29394, 29401), True, 'import numpy as np\n'), ((29646, 29661), 'numpy.array', 'np.array', (['dydxs'], {}), '(dydxs)\n', (29654, 29661), True, 'import numpy as np\n'), ((33207, 33228), 'sympy.symbols', 'sy.symbols', (['"""x a b y"""'], {}), "('x...
import argparse import json import numpy as np # per film role film.cvt cty gender ENTITY_TYPES = ["t0", "t1", "t2", "cvt", "t3", "t4"] REL_TYPES = ["r0", # acted_in "r1", # film_name "r2", # char_name "r3", # lives_in "r4" # gender ...
[ "numpy.sum", "argparse.ArgumentParser", "numpy.ones", "numpy.random.default_rng", "numpy.where" ]
[((13085, 13110), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (13108, 13110), False, 'import argparse\n'), ((13731, 13763), 'numpy.random.default_rng', 'np.random.default_rng', (['args.seed'], {}), '(args.seed)\n', (13752, 13763), True, 'import numpy as np\n'), ((2025, 2059), 'numpy.ones', '...
# -*- coding: utf-8 -*- """ /*************************************************************************** LecoS A QGIS plugin Contains analytical functions for landscape analysis ------------------- begin : 2012-09-06 copyrigh...
[ "scipy.ndimage.generate_binary_structure", "scipy.count_nonzero", "numpy.sum", "numpy.ones", "numpy.argsort", "numpy.mean", "numpy.unique", "numpy.nanmean", "numpy.zeros_like", "numpy.minimum.reduceat", "math.pow", "numpy.copy", "numpy.std", "numpy.append", "numpy.max", "math.log", "...
[((1985, 2012), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2002, 2012), False, 'import logging\n'), ((28305, 28338), 'pandas.Series', 'pd.Series', (['zlst[1]'], {'index': 'zlst[0]'}), '(zlst[1], index=zlst[0])\n', (28314, 28338), True, 'import pandas as pd\n'), ((1556, 1567), 'sys.ex...
import numpy as np from src.single_tree.global_params import GlobalParams from src.multiple_trees.iterate_trees import generate_bin_tree, get_subtrees from src.multiple_trees.matrix_diff import MatrixDiff, print_matrix, corrcoef # Build matrices and corr coef only systematic_tree = "morph" max_level = 10 matrDiff =...
[ "src.multiple_trees.matrix_diff.print_matrix", "src.multiple_trees.matrix_diff.MatrixDiff", "src.multiple_trees.iterate_trees.generate_bin_tree", "numpy.linspace", "src.single_tree.global_params.GlobalParams", "src.multiple_trees.matrix_diff.corrcoef", "src.multiple_trees.iterate_trees.get_subtrees" ]
[((321, 456), 'src.multiple_trees.matrix_diff.MatrixDiff', 'MatrixDiff', (['"""../../input/xtg/*.xtg"""', 'f"""../../input/systematic_tree_{systematic_tree}.xtg"""', "['Angiosperms']"], {'max_level': 'max_level'}), "('../../input/xtg/*.xtg',\n f'../../input/systematic_tree_{systematic_tree}.xtg', ['Angiosperms'],\n ...
import numpy as np from bicks.mathtool import find_real_roots_for_small_and_big_q, \ find_n_roots_for_small_and_big_q, find_real_roots, dichotomy def find_eigen_kpar(phcs, k0a, qa, nmode, mode="E"): """The eigenstates of the 1D photonic crystal. Paramters --------- phcs: PhotonicCrystalSlab ...
[ "bicks.mathtool.find_real_roots_for_small_and_big_q", "bicks.mathtool.dichotomy", "bicks.mathtool.find_n_roots_for_small_and_big_q", "bicks.mathtool.find_real_roots", "numpy.sin", "numpy.cos", "numpy.real", "numpy.sqrt" ]
[((1660, 1697), 'bicks.mathtool.find_real_roots', 'find_real_roots', (['f', '(nmax * k0a + 0.12)'], {}), '(f, nmax * k0a + 0.12)\n', (1675, 1697), False, 'from bicks.mathtool import find_real_roots_for_small_and_big_q, find_n_roots_for_small_and_big_q, find_real_roots, dichotomy\n'), ((1348, 1363), 'numpy.real', 'np.re...
""" Author: <NAME> Implements NN based on R-learner and U-learner (as discussed in Nie & Wager (2017)) """ import numpy as onp import pandas as pd from sklearn.model_selection import StratifiedKFold from jax import jit, grad, random import jax.numpy as jnp from jax.experimental import optimizers from catenets.models...
[ "catenets.models.base.OutputHead", "numpy.random.seed", "jax.numpy.sum", "catenets.models.model_utils.check_X_is_np", "numpy.zeros", "numpy.ones", "jax.random.PRNGKey", "numpy.arange", "catenets.models.base.train_output_net_only", "sklearn.model_selection.StratifiedKFold", "jax.grad", "jax.exp...
[((15050, 15461), 'catenets.models.base.train_output_net_only', 'train_output_net_only', (['X_fit', 'y_fit'], {'n_layers_out': 'n_layers_out', 'n_units_out': 'n_units_out', 'n_layers_r': 'n_layers_r', 'n_units_r': 'n_units_r', 'penalty_l2': 'penalty_l2', 'step_size': 'step_size', 'n_iter': 'n_iter', 'batch_size': 'batc...
from math import cos, pi, ceil, floor import numpy as np from sympy import symbols from sympy.utilities.lambdify import lambdify class interpolator(object): """docstring for interpolator""" def __init__(self, x=[0, 1, 2, 3, 4, -1, -2, -3, -4]): self.X = x ''' Given the knows points of a func...
[ "sympy.symbols", "numpy.divide", "numpy.vectorize", "math.ceil", "math.floor", "math.cos", "numpy.prod" ]
[((506, 518), 'sympy.symbols', 'symbols', (['"""x"""'], {}), "('x')\n", (513, 518), False, 'from sympy import symbols\n'), ((2814, 2829), 'numpy.divide', 'np.divide', (['N', 'D'], {}), '(N, D)\n', (2823, 2829), True, 'import numpy as np\n'), ((3157, 3169), 'sympy.symbols', 'symbols', (['"""x"""'], {}), "('x')\n", (3164...
import numpy as np from PIL import Image from ..utils import misc def impute(x, c): ''' x: [d] c: [2d] ''' d = x.shape[0] xo = c[:d] bitmask = c[d:] sorted_mask = np.sort(1 - bitmask, axis=0)[::-1] sorted_mask = sorted_mask != 0 valid_mask = bitmask != 0 xu = x.copy() x...
[ "numpy.sum", "numpy.arange", "matplotlib.pyplot.imsave", "numpy.exp", "numpy.multiply", "numpy.random.randn", "numpy.random.choice", "numpy.stack", "numpy.minimum", "PIL.Image.fromarray", "numpy.sort", "numpy.random.permutation", "numpy.squeeze", "numpy.concatenate", "matplotlib.pyplot.s...
[((558, 570), 'numpy.array', 'np.array', (['xs'], {}), '(xs)\n', (566, 570), True, 'import numpy as np\n'), ((889, 919), 'numpy.multiply', 'np.multiply', (['data', '(1 - bitmask)'], {}), '(data, 1 - bitmask)\n', (900, 919), True, 'import numpy as np\n'), ((930, 956), 'numpy.multiply', 'np.multiply', (['data', 'bitmask'...
# Plotting import matplotlib.pyplot as plt import seaborn as sns # Dat import numpy as np import pandas as pd class NBVisualizer: def __init__(self): pass """############################################### ##################### NBMat ###################### #############################################...
[ "matplotlib.pyplot.axvline", "numpy.isin", "seaborn.heatmap", "numpy.apply_along_axis", "numpy.where", "numpy.arange", "matplotlib.pyplot.gca", "numpy.core.defchararray.replace", "pandas.concat", "numpy.unique" ]
[((534, 543), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (541, 543), True, 'import matplotlib.pyplot as plt\n'), ((3730, 3739), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (3737, 3739), True, 'import matplotlib.pyplot as plt\n'), ((4872, 4967), 'seaborn.heatmap', 'sns.heatmap', (['heat_df[heat_cols...
from PIL import Image import numpy as np import glob def convert_image_size(input_path="../images/*.jpg", output_path="../resized_images/"): images = glob.glob(input_path) # obtain a list of all images for image in images: im = Image.open(image) # resize but keep aspect ratio data_padde...
[ "PIL.Image.fromarray", "numpy.asarray", "PIL.Image.open", "glob.glob" ]
[((155, 176), 'glob.glob', 'glob.glob', (['input_path'], {}), '(input_path)\n', (164, 176), False, 'import glob\n'), ((245, 262), 'PIL.Image.open', 'Image.open', (['image'], {}), '(image)\n', (255, 262), False, 'from PIL import Image\n'), ((438, 466), 'PIL.Image.fromarray', 'Image.fromarray', (['data_padded'], {}), '(d...
import os import argparse from collections import Counter import numpy as np import pandas as pd import stanza parser = argparse.ArgumentParser() parser.add_argument("--experiment_dir", help="Path to the directory of an experiment", default="/home/matej/Documents/paraphrase-nli/experiments/ASSIN/P...
[ "argparse.ArgumentParser", "pandas.read_csv", "numpy.median", "numpy.logical_not", "stanza.Pipeline", "os.path.join", "stanza.download" ]
[((122, 147), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (145, 147), False, 'import argparse\n'), ((622, 678), 'os.path.join', 'os.path.join', (['args.experiment_dir', '"""all_paraphrases.csv"""'], {}), "(args.experiment_dir, 'all_paraphrases.csv')\n", (634, 678), False, 'import os\n'), ((7...
''' Helper class and functions for loading KITTI objects Author: <NAME> Date: September 2017 ''' import os import sys import numpy as np import cv2 from PIL import Image BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(BASE_DIR) sys.path.append(os.path.join(ROOT_DIR, 'kitti')) from k...
[ "mayavi.mlab.figure", "kitti_util.draw_projected_box3d", "numpy.round", "os.path.join", "cv2.line", "os.path.abspath", "numpy.copy", "cv2.cvtColor", "os.path.dirname", "viz_util.draw_lidar", "numpy.max", "viz_util.draw_gt_boxes3d", "mayavi.mlab.show", "numpy.min", "mayavi.mlab.plot3d", ...
[((238, 263), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR'], {}), '(BASE_DIR)\n', (253, 263), False, 'import os\n'), ((200, 225), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (215, 225), False, 'import os\n'), ((280, 311), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""kitti"""'], ...
import unittest import numpy as np import postABC import matplotlib.pyplot as plt import matplotlib.mlab as mlab import os from scipy import integrate class TestMultModa(unittest.TestCase): def test_simple_multimodal_model(self): # OK generate some samples from the Model # Y = x + N(0,1) my...
[ "numpy.zeros_like", "numpy.abs", "matplotlib.pyplot.plot", "numpy.random.randn", "os.path.dirname", "numpy.zeros", "postABC.ABCPostProcessor", "numpy.max", "matplotlib.pyplot.figure", "numpy.array", "numpy.linspace", "numpy.random.rand", "numpy.testing.assert_allclose" ]
[((331, 366), 'numpy.zeros', 'np.zeros', (['(1000, 2)'], {'dtype': '"""double"""'}), "((1000, 2), dtype='double')\n", (339, 366), True, 'import numpy as np\n'), ((396, 421), 'numpy.zeros_like', 'np.zeros_like', (['my_samples'], {}), '(my_samples)\n', (409, 421), True, 'import numpy as np\n'), ((448, 474), 'numpy.linspa...
import numpy as np def get_circle_center(p1, p2, r): """Return the center (x,y) of a circle given two points p1 and p2 and radius r""" x1, y1 = p1 x2, y2 = p2 c = x1**2 + y1**2 - x2**2 - y2**2 x3 = x1 - x2 y3 = y1 - y2 cy = 0.5 * c / y3 - y1 c2 = (x1**2 + cy**2 - r**2) a = (x...
[ "numpy.linspace", "numpy.sqrt" ]
[((715, 737), 'numpy.linspace', 'np.linspace', (['x1', 'x2', 'N'], {}), '(x1, x2, N)\n', (726, 737), True, 'import numpy as np\n'), ((396, 424), 'numpy.sqrt', 'np.sqrt', (['(b ** 2 - 4 * a * c2)'], {}), '(b ** 2 - 4 * a * c2)\n', (403, 424), True, 'import numpy as np\n'), ((853, 880), 'numpy.sqrt', 'np.sqrt', (['(b ** ...
import glob import re import gensim import gensim.corpora as corpora import matplotlib.colors as mcolors import numpy as np import pandas as pd import spacy from bokeh.plotting import figure, output_file, show from gensim.utils import simple_preprocess from nltk.corpus import stopwords from sklearn.manifold import TSN...
[ "pandas.DataFrame", "gensim.models.ldamodel.LdaModel", "sklearn.manifold.TSNE", "gensim.models.phrases.Phraser", "pandas.read_csv", "numpy.argmax", "gensim.models.Phrases", "gensim.corpora.Dictionary", "matplotlib.colors.TABLEAU_COLORS.items", "bokeh.plotting.output_file", "spacy.load", "numpy...
[((465, 491), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""english"""'], {}), "('english')\n", (480, 491), False, 'from nltk.corpus import stopwords\n'), ((2027, 2054), 'glob.glob', 'glob.glob', (['"""csv_data/*.csv"""'], {}), "('csv_data/*.csv')\n", (2036, 2054), False, 'import glob\n'), ((1627, 1682), 'spa...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import traceback import fluprodia from fluprodia import FluidPropertyDiagram import numpy as np from tespy.components import ( Compressor, CycleCloser, HeatExchangerSimple, Valve) from tespy.connections import Connection from tespy.networks i...
[ "tespy.components.CycleCloser", "tespy.components.Compressor", "fluprodia.FluidPropertyDiagram", "tespy.connections.Connection", "os.environ.get", "numpy.arange", "tespy.components.HeatExchangerSimple", "numpy.linspace", "tespy.components.Valve", "numpy.array", "tespy.networks.Network" ]
[((1366, 1393), 'fluprodia.FluidPropertyDiagram', 'FluidPropertyDiagram', (['"""NH3"""'], {}), "('NH3')\n", (1386, 1393), False, 'from fluprodia import FluidPropertyDiagram\n'), ((1454, 1477), 'numpy.arange', 'np.arange', (['(-50)', '(201)', '(25)'], {}), '(-50, 201, 25)\n', (1463, 1477), True, 'import numpy as np\n'),...
import os import sysconfig from setuptools import Extension, find_packages, setup from typing import List, Optional, Tuple from Cython.Build import cythonize from Cython.Compiler import Options import numpy as np Options.fast_fail = True PYTHON_REQUIRES = ">=3.6" TRACE_CYTHON = bool(int(os.getenv("TRACE_CYTHON", 0))...
[ "Cython.Build.cythonize", "sysconfig.get_config_var", "numpy.get_include", "os.getenv", "setuptools.find_packages" ]
[((1277, 1339), 'Cython.Build.cythonize', 'cythonize', (['extensions'], {'compiler_directives': 'compiler_directives'}), '(extensions, compiler_directives=compiler_directives)\n', (1286, 1339), False, 'from Cython.Build import cythonize\n'), ((291, 319), 'os.getenv', 'os.getenv', (['"""TRACE_CYTHON"""', '(0)'], {}), "(...
"""For Lauecollect logfile. Select a subset of a dataset, based on filename and the repeat numbers of collection variables. Author: <NAME> Date created: 2018-12-12 Date last modified: 2018-12-12 """ __version__ = "1.1" def image_numbers(logfile,name="",repeat_count=[]): """Select a subset of a dataset based on cr...
[ "table.table", "numpy.all" ]
[((1895, 1926), 'table.table', 'table', (['filename'], {'separator': '"""\t"""'}), "(filename, separator='\\t')\n", (1900, 1926), False, 'from table import table\n'), ((1589, 1600), 'numpy.all', 'all', (['(a == b)'], {}), '(a == b)\n', (1592, 1600), False, 'from numpy import all\n')]
# (c) 2017 <NAME> import numpy as np import matplotlib.pyplot as plt def Dt_plane(h, r): x = r/h return 1. - 9./16.*x + 1./8.*x**3 - 45./256.*x**4 - 1/16.*x**5 def Dn_plane(l, r, N=20): alpha = np.arccosh(l/r) sinh = np.sinh s = 0. for n in range(1, N): n = float(n) K = n*(n+1)...
[ "matplotlib.pyplot.xscale", "numpy.logspace", "matplotlib.pyplot.legend", "numpy.arccosh", "matplotlib.pyplot.xticks", "matplotlib.pyplot.grid" ]
[((933, 959), 'numpy.logspace', 'np.logspace', (['(1e-10)', '(2)', '(100)'], {}), '(1e-10, 2, 100)\n', (944, 959), True, 'import numpy as np\n'), ((1185, 1202), 'matplotlib.pyplot.xscale', 'plt.xscale', (['"""log"""'], {}), "('log')\n", (1195, 1202), True, 'import matplotlib.pyplot as plt\n'), ((1245, 1269), 'matplotli...
from typing import Callable import numpy as np import scipy from base.base_distance_anomaly_detector import BaseDistanceAnomalyDetector class MahalanobisDistanceAnomalyDetector(BaseDistanceAnomalyDetector): """ Anomaly detection based on the Mahalanobis distance. Parameters ---------- scorer : Call...
[ "scipy.linalg.inv", "numpy.dot", "numpy.cov" ]
[((1910, 1943), 'numpy.cov', 'np.cov', (['normal_data'], {'rowvar': '(False)'}), '(normal_data, rowvar=False)\n', (1916, 1943), True, 'import numpy as np\n'), ((2027, 2087), 'scipy.linalg.inv', 'scipy.linalg.inv', (['self.covariance_matrix_'], {'check_finite': '(True)'}), '(self.covariance_matrix_, check_finite=True)\n...
#!/usr/bin/env python3 # # This file creates a grids file for the VIF case # # ======================================================================== # # Imports # # ======================================================================== import numpy as np # =======================================================...
[ "numpy.meshgrid" ]
[((1468, 1487), 'numpy.meshgrid', 'np.meshgrid', (['xs', 'ys'], {}), '(xs, ys)\n', (1479, 1487), True, 'import numpy as np\n'), ((1501, 1520), 'numpy.meshgrid', 'np.meshgrid', (['xe', 'ye'], {}), '(xe, ye)\n', (1512, 1520), True, 'import numpy as np\n')]
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "mindspore.context.set_context", "mindspore.ops.operations.Mul", "mindspore.context.reset_auto_parallel_context", "mindspore.common.api._cell_graph_executor.compile", "mindspore.Tensor", "numpy.ones", "mindspore.nn.TrainOneStepCell", "mindspore.context.set_auto_parallel_context", "mindspore.ops.oper...
[((1601, 1618), 'numpy.ones', 'np.ones', (['[16, 48]'], {}), '([16, 48])\n', (1608, 1618), True, 'import numpy as np\n'), ((1651, 1668), 'numpy.ones', 'np.ones', (['[48, 16]'], {}), '([48, 16])\n', (1658, 1668), True, 'import numpy as np\n'), ((1716, 1760), 'mindspore.context.set_context', 'context.set_context', ([], {...
import numpy as np from cv2 import cv2 # from scipy.linalg import solve from scipy import optimize source, target = 'media/source.jpg', 'media/target.jpg' def projective(x): return np.array([ 192-(x[2]*1)/(1*1), 195-(x[5]*1)/(1*1), 170-(x[1]*524+x[2]*1)/(x[7]*524 + 1*1), 315-(x[...
[ "cv2.cv2.destroyAllWindows", "cv2.cv2.waitKey", "numpy.zeros", "numpy.shape", "numpy.append", "cv2.cv2.imwrite", "numpy.array", "cv2.cv2.imread", "cv2.cv2.imshow" ]
[((190, 648), 'numpy.array', 'np.array', (['[192 - x[2] * 1 / (1 * 1), 195 - x[5] * 1 / (1 * 1), 170 - (x[1] * 524 + x[\n 2] * 1) / (x[7] * 524 + 1 * 1), 315 - (x[4] * 524 + x[5] * 1) / (x[7] *\n 524 + 1 * 1), 536 - (x[0] * 699 + x[2] * 1) / (x[6] * 699 + 1 * 1), 264 -\n (x[3] * 699 + x[5] * 1) / (x[6] * 699 +...
import numpy as np import random from dmarket.agents import MarketAgent class StochasticDescendingAgent(MarketAgent): """ Stocasticaly decreases or increases offer """ def __init__(self, role, reservation_price, name=None): super().__init__(role, reservation_price, name) def get_offer(...
[ "random.randint", "numpy.zeros", "numpy.argmax", "random.uniform" ]
[((1792, 1809), 'numpy.zeros', 'np.zeros', (['(21, 3)'], {}), '((21, 3))\n', (1800, 1809), True, 'import numpy as np\n'), ((1422, 1446), 'random.uniform', 'random.uniform', (['(100)', '(180)'], {}), '(100, 180)\n', (1436, 1446), False, 'import random\n'), ((2839, 2875), 'numpy.argmax', 'np.argmax', (['self.q_table[tabl...
#!/usr/bin/env python """ @author <NAME> """ # import numpy as np from roboticstoolbox.backends.PyPlot.RobotPlot import RobotPlot import numpy as np from spatialmath import SE2 class RobotPlot2(RobotPlot): def __init__( self, robot, env, readonly, display=True, eeframe=True, name=True, opt...
[ "spatialmath.SE2", "numpy.array" ]
[((1579, 1630), 'numpy.array', 'np.array', (['[linkframe.t for linkframe in linkframes]'], {}), '([linkframe.t for linkframe in linkframes])\n', (1587, 1630), True, 'import numpy as np\n'), ((2025, 2036), 'spatialmath.SE2', 'SE2', (['len', '(0)'], {}), '(len, 0)\n', (2028, 2036), False, 'from spatialmath import SE2\n')...
#!/usr/bin/env python # coding: utf-8 """This script is intended to convert raw He3 detector files (generated by He3 readout system) to simple text csv files with ASCii data. Simple usage: python k15reader.py input_file_name > output_file_name Author: <NAME>, march 2021. """ import re import os import numpy as np ...
[ "os.path.abspath", "os.path.join", "numpy.zeros", "datetime.datetime", "os.path.isfile", "re.findall", "datetime.timedelta", "re.search", "os.path.getctime", "numpy.ndarray", "os.listdir" ]
[((1223, 1252), 're.findall', 're.findall', (['pattern', 'raw_line'], {}), '(pattern, raw_line)\n', (1233, 1252), False, 'import re\n'), ((1381, 1415), 're.findall', 're.findall', (['date_pattern', 'raw_line'], {}), '(date_pattern, raw_line)\n', (1391, 1415), False, 'import re\n'), ((1806, 1840), 're.findall', 're.find...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ "neural_compressor.experimental.common.Postprocess", "argparse.ArgumentParser", "logging.basicConfig", "neural_compressor.experimental.Quantization", "math.ceil", "neural_compressor.experimental.Benchmark", "numpy.transpose", "numpy.zeros", "os.path.exists", "PIL.Image.open", "pycocotools.coco.C...
[((961, 988), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (978, 988), False, 'import logging\n'), ((989, 1132), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(name)s - %(message)s"""', 'datefmt': '"""%m/%d/%Y %H:%M:%S"""', 'level': '...
import numpy as np from scipy import spatial import math def function_for_TSP(num_points, seed=None): if seed: np.random.seed(seed=seed) points_coordinate = np.random.rand(num_points, 2) # generate coordinate of points randomly distance_matrix = spatial.distance.cdist(points_coordinate, points_c...
[ "scipy.spatial.distance.cdist", "numpy.random.seed", "numpy.sum", "numpy.abs", "numpy.floor", "numpy.square", "math.sin", "numpy.sin", "numpy.exp", "numpy.cos", "numpy.random.rand", "numpy.prod", "numpy.sqrt" ]
[((176, 205), 'numpy.random.rand', 'np.random.rand', (['num_points', '(2)'], {}), '(num_points, 2)\n', (190, 205), True, 'import numpy as np\n'), ((270, 355), 'scipy.spatial.distance.cdist', 'spatial.distance.cdist', (['points_coordinate', 'points_coordinate'], {'metric': '"""euclidean"""'}), "(points_coordinate, point...
from datetime import datetime import numpy as np import math import pickle import pandas as pd import os import sys import re def read_patients_table(path): p = pd.read_csv(os.path.join(path, 'PATIENTS.csv.gz'), compression='gzip') p = p[['SUBJECT_ID', 'GENDER', 'DOB', 'DOD',]] p['DOB'] = pd.to_datetime(p[...
[ "numpy.timedelta64", "pandas.to_datetime", "pandas.Timedelta", "os.path.join", "re.sub" ]
[((303, 327), 'pandas.to_datetime', 'pd.to_datetime', (["p['DOB']"], {}), "(p['DOB'])\n", (317, 327), True, 'import pandas as pd\n'), ((343, 367), 'pandas.to_datetime', 'pd.to_datetime', (["p['DOD']"], {}), "(p['DOD'])\n", (357, 367), True, 'import pandas as pd\n'), ((1551, 1628), 'pandas.to_datetime', 'pd.to_datetime'...
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Ais Demod Grc # Generated: Tue Oct 9 17:56:41 2012 ################################################## from gnuradio import digital from gnuradio import eng_notation from gnuradio import gr from gnuradio.eng_...
[ "gnuradio.gr.map_bb", "optparse.OptionParser", "wx.Icon", "numpy.random.randint", "grc_gnuradio.wxgui.top_block_gui.__init__", "gnuradio.gr.quadrature_demod_cf", "gnuradio.gr.throttle", "gnuradio.digital.gmskmod_bc" ]
[((3500, 3563), 'optparse.OptionParser', 'OptionParser', ([], {'option_class': 'eng_option', 'usage': '"""%prog: [options]"""'}), "(option_class=eng_option, usage='%prog: [options]')\n", (3512, 3563), False, 'from optparse import OptionParser\n'), ((586, 647), 'grc_gnuradio.wxgui.top_block_gui.__init__', 'grc_wxgui.top...
from __main__ import vtk, qt, ctk, slicer import string import numpy import math import operator import collections import time class FirstOrderStatistics: def __init__(self, parameterValues, bins, grayLevels, allKeys): """ :param parameterValues: 3D array with the coordinates of the voxels where t...
[ "numpy.sum", "numpy.median", "numpy.std", "numpy.seterr", "numpy.power", "numpy.log2", "time.time", "numpy.min", "numpy.max", "numpy.mean", "numpy.where", "collections.OrderedDict", "numpy.float64" ]
[((566, 591), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (589, 591), False, 'import collections\n'), ((634, 659), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (657, 659), False, 'import collections\n'), ((2677, 2707), 'numpy.sum', 'numpy.sum', (['(parameterArray *...
import os import sys from astropy.coordinates import SkyCoord from astropy.io import fits from astropy.wcs import WCS import numpy as np import pandas as pd import pytest import unittest sys.path.append('..') from cutout import CutoutProducer class TestRaise(unittest.TestCase): def test_import_raise(self): ...
[ "sys.path.append", "numpy.random.uniform", "os.path.exists", "cutout.CutoutProducer", "pytest.main", "numpy.shape", "astropy.io.fits.open", "numpy.testing.assert_allclose" ]
[((189, 210), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (204, 210), False, 'import sys\n'), ((10516, 10529), 'pytest.main', 'pytest.main', ([], {}), '()\n', (10527, 10529), False, 'import pytest\n'), ((1699, 1870), 'cutout.CutoutProducer', 'CutoutProducer', ([], {'tilename': '"""testtile"""'...
# import community import numpy as np import networkx as nx import matplotlib as mpl from matplotlib.pyplot import imshow from matplotlib import pyplot as plt import matplotlib.image as mpimg import pygraphviz from networkx.drawing.nx_agraph import write_dot, graphviz_layout import random import pydoc from ds import Mc...
[ "sys.path.append", "matplotlib.rc", "datasets.synthetic.generator.TreeGenerator", "numpy.linspace" ]
[((381, 402), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (396, 402), False, 'import sys\n'), ((514, 536), 'matplotlib.rc', 'mpl.rc', (['"""font"""'], {}), "('font', **font)\n", (520, 536), True, 'import matplotlib as mpl\n'), ((553, 592), 'numpy.linspace', 'np.linspace', (['(5)', '(30)'], {'n...
"""Functions to visualize human poses""" import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation, ImageMagickWriter from matplotlib.patches import FancyArrowPatch from mpl_toolkits.mplot3d import proj3d import cv2 # 0-right, 1-left, 2-center from databases.joint_s...
[ "matplotlib.pyplot.clf", "numpy.ones", "numpy.clip", "numpy.around", "numpy.mean", "cv2.rectangle", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "cv2.line", "matplotlib.pyplot.imshow", "numpy.max", "matplotlib.pyplot.cla", "matplotlib.patches.FancyArrowPatch.__init__", "cv2.c...
[((1320, 1364), 'numpy.array', 'np.array', (['joint_set.SIDEDNESS'], {'dtype': '"""int32"""'}), "(joint_set.SIDEDNESS, dtype='int32')\n", (1328, 1364), True, 'import numpy as np\n'), ((5589, 5633), 'numpy.array', 'np.array', (['joint_set.SIDEDNESS'], {'dtype': '"""int32"""'}), "(joint_set.SIDEDNESS, dtype='int32')\n", ...
# -*- coding: utf-8 -*- """ Created on Sun Jun 07 17:47:39 2015 @author: Brian """ import numpy as np # ============================================================== def calculate_normalized_randomization_factors(size): rfs = np.random.random(size) return rfs / np.sum(rfs) # =============================...
[ "numpy.empty", "numpy.random.random", "numpy.sum" ]
[((235, 257), 'numpy.random.random', 'np.random.random', (['size'], {}), '(size)\n', (251, 257), True, 'import numpy as np\n'), ((553, 588), 'numpy.empty', 'np.empty', (['(16, 2)'], {'dtype': 'np.float64'}), '((16, 2), dtype=np.float64)\n', (561, 588), True, 'import numpy as np\n'), ((275, 286), 'numpy.sum', 'np.sum', ...
from scipy.special import gammaln, psi import numpy as np import math import pandas as pd class LDABase: """ Base Class to fit LDA using Collapsed Gibbs Sampling derived from <NAME> Steyvers (2004): Finding scientific topics """ def __init__(self, corpus, K, alpha="asymmetric", beta=0.01): ...
[ "pandas.DataFrame", "numpy.sum", "numpy.flip", "numpy.zeros", "numpy.array", "numpy.exp", "scipy.special.gammaln", "numpy.sqrt" ]
[((631, 657), 'numpy.zeros', 'np.zeros', (['(self.K, self.W)'], {}), '((self.K, self.W))\n', (639, 657), True, 'import numpy as np\n'), ((689, 715), 'numpy.zeros', 'np.zeros', (['(self.D, self.K)'], {}), '((self.D, self.K))\n', (697, 715), True, 'import numpy as np\n'), ((819, 830), 'numpy.zeros', 'np.zeros', (['K'], {...
""" Copyright (C) 2018 University of Massachusetts Amherst. This file is part of "coref_tools" http://github.com/nmonath/coref_tools 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....
[ "torch.save", "numpy.asarray", "numpy.random.permutation" ]
[((1458, 1482), 'numpy.asarray', 'np.asarray', (['self.dataset'], {}), '(self.dataset)\n', (1468, 1482), True, 'import numpy as np\n'), ((1505, 1528), 'numpy.asarray', 'np.asarray', (['self.labels'], {}), '(self.labels)\n', (1515, 1528), True, 'import numpy as np\n'), ((1553, 1578), 'numpy.asarray', 'np.asarray', (['se...
""" Main clustering logic """ import abc import collections from typing import Generic, List import numpy as np from sklearn.cluster import AgglomerativeClustering, dbscan from .types import T, DistanceFunc class _Cluster(abc.ABC, Generic[T]): """ Implements a clustering framework that takes a list of eleme...
[ "collections.defaultdict", "sklearn.cluster.AgglomerativeClustering", "numpy.var" ]
[((2725, 2754), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (2748, 2754), False, 'import collections\n'), ((3036, 3053), 'numpy.var', 'np.var', (['variances'], {}), '(variances)\n', (3042, 3053), True, 'import numpy as np\n'), ((2562, 2647), 'sklearn.cluster.AgglomerativeClustering...
import numpy as np import pandas as pd import pathlib import os ############################################################################### current_week = "30" output_week = "/Users/christianhilscher/desktop/dynsim/output/week" + str(current_week) + "/" pathlib.Path(output_week).mkdir(parents=True, exist_ok=True)...
[ "pandas.DataFrame", "pandas.merge", "pathlib.Path", "numpy.arange", "pandas.read_pickle", "pandas.concat" ]
[((540, 584), 'pandas.read_pickle', 'pd.read_pickle', (["(output_path + 'doc_full.pkl')"], {}), "(output_path + 'doc_full.pkl')\n", (554, 584), True, 'import pandas as pd\n'), ((596, 641), 'pandas.read_pickle', 'pd.read_pickle', (["(output_path + 'doc_full2.pkl')"], {}), "(output_path + 'doc_full2.pkl')\n", (610, 641),...
# ****************************************************************************** # Copyright 2020-2021 Intel Corporation # # 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.apa...
[ "plotly.graph_objects.Scatter", "copy.deepcopy", "io.BytesIO", "plotly.graph_objects.Figure", "matplotlib.pyplot.close", "numpy.shape", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplots" ]
[((1754, 1765), 'numpy.shape', 'np.shape', (['z'], {}), '(z)\n', (1762, 1765), True, 'import numpy as np\n'), ((1783, 1804), 'copy.deepcopy', 'copy.deepcopy', (['layout'], {}), '(layout)\n', (1796, 1804), False, 'import copy\n'), ((2669, 2680), 'plotly.graph_objects.Figure', 'go.Figure', ([], {}), '()\n', (2678, 2680),...
# -*- coding: utf-8 -*- """ ReportCapableInterfaces for masks tools """ from __future__ import absolute_import, division, print_function, unicode_literals import os from niworkflows.nipype.interfaces import fsl, ants from niworkflows.nipype.interfaces.base import ( File, BaseInterfaceInputSpec, traits, isdefined...
[ "numpy.pad", "nibabel.Nifti1Image", "os.path.abspath", "nibabel.load", "niworkflows.nipype.interfaces.base.isdefined", "scipy.ndimage.morphology.binary_dilation", "niworkflows.nipype.interfaces.base.traits.Bool", "nilearn.masking.compute_epi_mask", "niworkflows.NIWORKFLOWS_LOG.info", "numpy.isnan"...
[((3205, 3248), 'niworkflows.nipype.interfaces.base.File', 'File', ([], {'exists': '(True)', 'desc': '"""3D or 4D EPI file"""'}), "(exists=True, desc='3D or 4D EPI file')\n", (3209, 3248), False, 'from niworkflows.nipype.interfaces.base import File, BaseInterfaceInputSpec, traits, isdefined\n'), ((3264, 3320), 'niworkf...
import math import numpy as np import cv2 import matplotlib.pyplot as plt from PIL import Image import torch from torchvision import transforms from torch.autograd import Variable #==================================================================================================== # Inference and debugging helper f...
[ "numpy.arctan2", "cv2.waitKey", "torch.autograd.Variable", "matplotlib.pyplot.imshow", "torchvision.transforms.ToPILImage", "PIL.Image.open", "cv2.imread", "matplotlib.pyplot.figure", "cv2.warpAffine", "numpy.array", "torch.cuda.is_available", "numpy.append", "torch.device", "cv2.imshow", ...
[((579, 600), 'torchvision.transforms.ToTensor', 'transforms.ToTensor', ([], {}), '()\n', (598, 600), False, 'from torchvision import transforms\n'), ((481, 506), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (504, 506), False, 'import torch\n'), ((540, 566), 'torch.autograd.Variable', 'Variab...
#%% [markdown] # # Look at the paired embeddings #%% [markdown] # ## Preliminaries #%% from json import load from pkg.utils import set_warnings import datetime import time import matplotlib.pyplot as plt import numpy as np import seaborn as sns from graspologic.align import OrthogonalProcrustes, SeedlessProcrustes ...
[ "seaborn.ecdfplot", "numpy.linalg.norm", "giskard.plot.simple_scatterplot", "graspologic.utils.pass_to_ranks", "matplotlib.pyplot.gca", "pkg.data.load_maggot_graph", "pkg.io.savefig", "graspologic.align.SeedlessProcrustes", "datetime.timedelta", "graspologic.plot.pairplot", "sklearn.neighbors.Ne...
[((829, 840), 'time.time', 'time.time', ([], {}), '()\n', (838, 840), False, 'import time\n'), ((980, 1005), 'seaborn.color_palette', 'sns.color_palette', (['"""Set1"""'], {}), "('Set1')\n", (997, 1005), True, 'import seaborn as sns\n'), ((1111, 1133), 'pkg.data.load_network_palette', 'load_network_palette', ([], {}), ...
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = Axes3D(fig) x1 = np.linspace(-3 * np.pi, 3 * np.pi, 500) y1 = np.sin(x1) ax.plot(x1, y1, zs=0, c="red") x2 = np.random.normal(0, 1, 100) y2 = np.random.normal(0, 1, 100) z2 = np.random.normal(0, 1, 100...
[ "matplotlib.pyplot.show", "mpl_toolkits.mplot3d.Axes3D", "matplotlib.pyplot.figure", "numpy.sin", "numpy.linspace", "numpy.random.normal" ]
[((99, 111), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (109, 111), True, 'import matplotlib.pyplot as plt\n'), ((117, 128), 'mpl_toolkits.mplot3d.Axes3D', 'Axes3D', (['fig'], {}), '(fig)\n', (123, 128), False, 'from mpl_toolkits.mplot3d import Axes3D\n'), ((135, 174), 'numpy.linspace', 'np.linspace', ...
import os from tqdm import tqdm import argparse import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from modeling.backbone.mobilenet import MobileNetV2 from modeling.assp import ASPP from modeling.domian import DomainClassifer from modeling.decoder...
[ "numpy.load", "argparse.ArgumentParser", "numpy.argmax", "modeling.discriminator.FCDiscriminator", "dataloders.make_data_loader", "torch.cat", "modeling.deeplab.DeepLab", "os.path.isfile", "torch.no_grad", "utils.saver.Saver", "utils.loss.SegmentationLosses", "torch.load", "tqdm.tqdm", "to...
[((10669, 10737), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Deeplab_Wild Training"""'}), "(description='PyTorch Deeplab_Wild Training')\n", (10692, 10737), False, 'import argparse\n'), ((17615, 17643), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.see...
#!/usr/bin/env python """The script ``add_staffline_symbols.py`` takes as input a CVC-MUSCIMA (page, writer) index and a corresponding CropObjectList file and adds to the CropObjectList staffline and staff objects.""" from __future__ import print_function, unicode_literals from __future__ import division from builtins ...
[ "argparse.ArgumentParser", "numpy.ones", "os.path.isfile", "builtins.range", "mung.io.parse_cropobject_list", "matplotlib.pyplot.imshow", "time.clock", "mung.io.export_cropobject_list", "skimage.io.imread", "matplotlib.pyplot.show", "os.path.basename", "skimage.morphology.watershed", "mung.u...
[((2625, 2743), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'add_help': '(True)', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=__doc__, add_help=True, formatter_class\n =argparse.RawDescriptionHelpFormatter)\n', (2648, 2743), False, 'import argp...
import matplotlib.pyplot as plt import json import numpy import sys import objective import heat import plot_info with open('objective_parameters.json') as f: objective_parameters = json.load(f) objective_function = objective.Objective(**objective_parameters) initial_data = objective_function.initial_data dt = ...
[ "json.load", "objective.Objective", "matplotlib.pyplot.plot", "plot_info.showAndSave", "matplotlib.pyplot.legend", "heat.solve_heat_equation", "numpy.arange" ]
[((221, 264), 'objective.Objective', 'objective.Objective', ([], {}), '(**objective_parameters)\n', (240, 264), False, 'import objective\n'), ((398, 454), 'heat.solve_heat_equation', 'heat.solve_heat_equation', (['initial_data', 'dt', 'dx', 'end_time'], {}), '(initial_data, dt, dx, end_time)\n', (422, 454), False, 'imp...
import numpy as np import matplotlib.pyplot as plt import argparse parser = argparse.ArgumentParser(description='Plot training progress') parser.add_argument('-m','--model', metavar='folder', type=str, dest='path', default='', help='Foldername to model where the loss files are s...
[ "matplotlib.pyplot.show", "argparse.ArgumentParser", "matplotlib.pyplot.plot", "numpy.cumsum", "numpy.max", "numpy.loadtxt", "matplotlib.pyplot.gca", "matplotlib.pyplot.savefig" ]
[((77, 138), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Plot training progress"""'}), "(description='Plot training progress')\n", (100, 138), False, 'import argparse\n'), ((946, 971), 'numpy.cumsum', 'np.cumsum', (['a'], {'dtype': 'float'}), '(a, dtype=float)\n', (955, 971), True, 'i...
from unittest import TestCase from common.preprocess import ActionProcesser, ObsProcesser from pysc2.env.environment import TimeStep, StepType from pysc2.lib import actions from pysc2.lib.actions import FunctionCall import numpy as np from pysc2.lib.features import Features, SCREEN_FEATURES, FeatureType, MINIMAP_FEATUR...
[ "common.preprocess.ActionProcesser", "pysc2.env.environment.TimeStep", "numpy.zeros", "pysc2.lib.actions.FunctionCall", "common.preprocess.ObsProcesser", "numpy.arange" ]
[((401, 438), 'common.preprocess.ActionProcesser', 'ActionProcesser', ([], {'dim': '(40)', 'rect_delta': '(5)'}), '(dim=40, rect_delta=5)\n', (416, 438), False, 'from common.preprocess import ActionProcesser, ObsProcesser\n'), ((1015, 1053), 'common.preprocess.ActionProcesser', 'ActionProcesser', ([], {'dim': 'dim', 'r...
# Makes a flag for galaxies that are 3 sigma off of the F160/F125 axis ratio relation import numpy as np import pandas as pd from astropy.io import ascii import matplotlib.pyplot as plt import matplotlib as mpl import initialize_mosdef_dirs as imd import matplotlib.patheffects as path_effects def flag_axis_ratios():...
[ "numpy.std", "astropy.io.ascii.read", "matplotlib.pyplot.subplots", "numpy.logical_or" ]
[((563, 640), 'numpy.logical_or', 'np.logical_or', (["(ar_df['F160_axis_ratio'] < -99)", "(ar_df['F125_axis_ratio'] < -99)"], {}), "(ar_df['F160_axis_ratio'] < -99, ar_df['F125_axis_ratio'] < -99)\n", (576, 640), True, 'import numpy as np\n'), ((990, 1005), 'numpy.std', 'np.std', (['ar_diff'], {}), '(ar_diff)\n', (996,...
import multiprocessing as mp import numpy as np from scipy import integrate import itertools import pickle import datetime def f(x,y): return np.sum((x-y) * np.log(x/y),axis=1) def g(x,y): return np.log(np.sum(x/y,axis=1) * np.sum(y/x,axis=1)) - 2 * np.log(x.shape[1]) def single_process(x): ...
[ "numpy.random.dirichlet", "pickle.dump", "numpy.random.seed", "numpy.log", "datetime.datetime.today", "numpy.sum", "numpy.zeros", "numpy.random.randint", "numpy.mean", "numpy.array", "multiprocessing.Pool", "itertools.repeat" ]
[((394, 414), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (408, 414), True, 'import numpy as np\n'), ((442, 456), 'numpy.zeros', 'np.zeros', (['pack'], {}), '(pack)\n', (450, 456), True, 'import numpy as np\n'), ((468, 482), 'numpy.zeros', 'np.zeros', (['pack'], {}), '(pack)\n', (476, 482), True,...
import numpy as np from numpy.testing import assert_array_equal from landlab import CLOSED_BOUNDARY as CB, FIXED_VALUE_BOUNDARY as FV, RasterModelGrid def test_get_status(): """Test getting the node status array.""" grid = RasterModelGrid((4, 5)) assert_array_equal( grid.status_at_node, [...
[ "numpy.full", "numpy.testing.assert_array_equal", "landlab.RasterModelGrid" ]
[((234, 257), 'landlab.RasterModelGrid', 'RasterModelGrid', (['(4, 5)'], {}), '((4, 5))\n', (249, 257), False, 'from landlab import CLOSED_BOUNDARY as CB, FIXED_VALUE_BOUNDARY as FV, RasterModelGrid\n'), ((262, 381), 'numpy.testing.assert_array_equal', 'assert_array_equal', (['grid.status_at_node', '[FV, FV, FV, FV, FV...