code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import abc,os,pickle,sys
import scipy.stats
import numpy as np
from datetime import datetime
import tensorflow as tf
from BatchIterator import PaddedDataIterator
from generation import *
from Plotter import get_intensity,get_integral,get_integral_... | [
"Utils.file2sequence",
"tensorflow.shape",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"numpy.linalg.norm",
"tensorflow.reduce_mean",
"tensorflow.set_random_seed",
"tensorflow.GPUOptions",
"tensorflow.log",
"BatchIterator.PaddedDataIterator",
"os.path.exists",
"Utils.sequence2file",
... | [((19, 40), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (33, 40), False, 'import matplotlib\n'), ((1230, 1254), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['SEED'], {}), '(SEED)\n', (1248, 1254), True, 'import tensorflow as tf\n'), ((1255, 1275), 'numpy.random.seed', 'np.random.seed'... |
import math
import cv2
import numpy as np
import tensorflow as tf
from scipy import ndimage
import os
from MNIST_data import input_data
class Recognizer:
def __init__(self):
pass
@staticmethod
def shift(img, sx, sy):
rows, cols = img.shape
M = np.float32([[1, 0, sx], [0, 1, sy]])... | [
"math.floor",
"numpy.lib.pad",
"scipy.ndimage.measurements.center_of_mass",
"tensorflow.cast",
"tensorflow.log",
"os.remove",
"MNIST_data.input_data.read_data_sets",
"cv2.threshold",
"numpy.delete",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.matmul",
"numpy.round",
"tensor... | [((284, 320), 'numpy.float32', 'np.float32', (['[[1, 0, sx], [0, 1, sy]]'], {}), '([[1, 0, sx], [0, 1, sy]])\n', (294, 320), True, 'import numpy as np\n'), ((339, 375), 'cv2.warpAffine', 'cv2.warpAffine', (['img', 'M', '(cols, rows)'], {}), '(img, M, (cols, rows))\n', (353, 375), False, 'import cv2\n'), ((462, 502), 's... |
# -*- coding: utf-8 -*-
# Copyright 2017 <NAME>
# Copyright 2018 <NAME>
#
# 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
#
# Un... | [
"ccpi.viewer.CILViewer2D.ViewerEventManager",
"vtk.vtkDecimatePro",
"vtk.vtkImageMapToWindowLevelColors",
"vtk.vtkTextMapper",
"vtk.vtkTextProperty",
"vtk.vtkPNGWriter",
"ccpi.viewer.utils.colormaps.CILColorMaps.get_color_transfer_function",
"vtk.vtkImageActor",
"vtk.vtkInteractorStyleTrackballCamer... | [((1180, 1232), 'vtk.vtkInteractorStyleTrackballCamera.__init__', 'vtk.vtkInteractorStyleTrackballCamera.__init__', (['self'], {}), '(self)\n', (1226, 1232), False, 'import vtk\n'), ((9408, 9429), 'vtk.vtkTextProperty', 'vtk.vtkTextProperty', ([], {}), '()\n', (9427, 9429), False, 'import vtk\n'), ((9809, 9828), 'vtk.v... |
from setuptools import setup, Extension
import numpy as np
from Cython.Build import cythonize
from Cython.Distutils import build_ext
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
# Obtain the numpy include directory. This logic works across numpy versions.
try:
numpy_include = np.get_includ... | [
"setuptools.Extension",
"Cython.Build.cythonize",
"numpy.get_numpy_include",
"numpy.get_include"
] | [((307, 323), 'numpy.get_include', 'np.get_include', ([], {}), '()\n', (321, 323), True, 'import numpy as np\n'), ((498, 559), 'setuptools.Extension', 'Extension', (['"""nms_cpu"""'], {'sources': "['src/nms_cpu.cpp']"}), "('nms_cpu', sources=['src/nms_cpu.cpp'], **ext_args)\n", (507, 559), False, 'from setuptools impor... |
import numpy as np
def rotX(theta):
return np.array([[1, 0, 0]
, [0, np.cos(theta), -np.sin(theta)]
, [0, np.sin(theta), np.cos(theta)]])
def rotY(theta):
return np.array([[np.cos(theta), 0, np.sin(theta)]
, [0, 1, 0]
, [-np.sin(theta... | [
"numpy.cross",
"numpy.diag",
"numpy.array",
"numpy.dot",
"numpy.outer",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin"
] | [((630, 646), 'numpy.cross', 'np.cross', (['v1', 'v2'], {}), '(v1, v2)\n', (638, 646), True, 'import numpy as np\n'), ((928, 941), 'numpy.sin', 'np.sin', (['angle'], {}), '(angle)\n', (934, 941), True, 'import numpy as np\n'), ((953, 966), 'numpy.cos', 'np.cos', (['angle'], {}), '(angle)\n', (959, 966), True, 'import n... |
#<NAME>
from sklearn import preprocessing
import matplotlib.pyplot as plt
import numpy as np
from sklearn.cluster import KMeans
# Data set
# Datos de 13/02/2020 a 10/11/2020
# De acuerdo con: https://tablerocovid.mspas.gob.gt/
# Regiones de acuerdo con: https://aprende.guatemala.com/historia/geografia/regiones-de-gua... | [
"sklearn.cluster.KMeans",
"sklearn.preprocessing.LabelEncoder",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((1468, 1496), 'sklearn.preprocessing.LabelEncoder', 'preprocessing.LabelEncoder', ([], {}), '()\n', (1494, 1496), False, 'from sklearn import preprocessing\n'), ((1591, 2612), 'numpy.array', 'np.array', (['[[region_guatemala2[0], no_fallecidos[0]], [region_guatemala2[1],\n no_fallecidos[1]], [region_guatemala2[2],... |
from imutils import contours
from collections import deque
import numpy as np
import argparse
import imutils
import cv2
from Tkinter import Frame, Tk, BOTH, Text, Menu, END
import tkFileDialog
import os.path
import os
import sys
from time import gmtime, strftime
def PT(F):
Time = strftime("%Y-%... | [
"os.listdir",
"collections.deque",
"cv2.countNonZero",
"argparse.ArgumentParser",
"cv2.inRange",
"Tkinter.Tk",
"cv2.destroyWindow",
"cv2.bitwise_and",
"os.path.split",
"os.path.isfile",
"numpy.array",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"time.gmt... | [((9238, 9253), 'os.listdir', 'os.listdir', (['"""."""'], {}), "('.')\n", (9248, 9253), False, 'import os\n'), ((9371, 9394), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (9392, 9394), False, 'import cv2\n'), ((420, 445), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (44... |
import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd
import numpy as np
def dntrack(df: pd.DataFrame,
rho: (list,str) = None,
ntr: (list,str) = None,
lims: list = None,
lime: bool = False,
dtick: bool =False,
fill: bool =T... | [
"matplotlib.pyplot.gca",
"numpy.linspace",
"numpy.arange"
] | [((2137, 2146), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (2144, 2146), True, 'import matplotlib.pyplot as plt\n'), ((3020, 3066), 'numpy.linspace', 'np.linspace', (['lims[0]', 'lims[1]', 'grid_numbers[0]'], {}), '(lims[0], lims[1], grid_numbers[0])\n', (3031, 3066), True, 'import numpy as np\n'), ((3086, 3... |
import numpy
import pylab
import random
n = 100000
x = numpy.zeros(n)
y = numpy.zeros(n)
for i in range(1, n):
ran = random.randint(1, 4)
if ran == 1: # rechts
x[i] = x[i - 1] + 1
y[i] = y[i - 1]
elif ran == 2:
x[i] = x[i - 1] - 1
y[i] = y[i - 1]
elif ran == 3:
x[i] = x[i - 1]
y[i] = y[i - 1] + 1
el... | [
"pylab.title",
"pylab.plot",
"numpy.zeros",
"random.randint",
"pylab.show"
] | [((56, 70), 'numpy.zeros', 'numpy.zeros', (['n'], {}), '(n)\n', (67, 70), False, 'import numpy\n'), ((75, 89), 'numpy.zeros', 'numpy.zeros', (['n'], {}), '(n)\n', (86, 89), False, 'import numpy\n'), ((364, 395), 'pylab.title', 'pylab.title', (['"""2D Random Walker"""'], {}), "('2D Random Walker')\n", (375, 395), False,... |
import numpy as np
import dynet as dy
from xnmt.modelparts.transforms import Linear
from xnmt.persistence import serializable_init, Serializable, Ref
from xnmt.events import register_xnmt_handler, handle_xnmt_event
from xnmt.param_initializers import LeCunUniformInitializer
from xnmt.param_collections import ParamMana... | [
"dynet.parameter",
"xnmt.param_initializers.LeCunUniformInitializer",
"dynet.pickneglogsoftmax_batch",
"dynet.reshape",
"dynet.softmax",
"dynet.layer_norm",
"dynet.dropout",
"dynet.pickrange",
"dynet.inputTensor",
"dynet.transpose",
"numpy.argwhere",
"numpy.concatenate",
"xnmt.param_collecti... | [((507, 562), 'dynet.reshape', 'dy.reshape', (['input', '(model_dim,)'], {'batch_size': 'total_words'}), '(input, (model_dim,), batch_size=total_words)\n', (517, 562), True, 'import dynet as dy\n'), ((757, 819), 'dynet.reshape', 'dy.reshape', (['input', '(model_dim, seq_len)'], {'batch_size': 'batch_size'}), '(input, (... |
import numpy as np
from numpy import ndarray
from numba import njit, prange
__cache = True
@njit(nogil=True, parallel=True, cache=__cache)
def element_transformation_matrices(Q: ndarray, nNE: int=2):
nE = Q.shape[0]
nEVAB = nNE * 6
res = np.zeros((nE, nEVAB, nEVAB), dtype=Q.dtype)
for iE in prange(nE)... | [
"numba.prange",
"numpy.zeros",
"numba.njit",
"numpy.zeros_like"
] | [((94, 140), 'numba.njit', 'njit', ([], {'nogil': '(True)', 'parallel': '(True)', 'cache': '__cache'}), '(nogil=True, parallel=True, cache=__cache)\n', (98, 140), False, 'from numba import njit, prange\n'), ((430, 476), 'numba.njit', 'njit', ([], {'nogil': '(True)', 'parallel': '(True)', 'cache': '__cache'}), '(nogil=T... |
from __future__ import annotations
import numpy as np
import scipy.signal
from functools import partial
from typing import Callable
try:
import simpleaudio as sa
except ModuleNotFoundError:
raise ModuleNotFoundError("Please install simpleaudio to use this module.\n"
"pip install ... | [
"numpy.abs",
"numpy.asarray",
"numpy.any",
"numpy.squeeze",
"functools.partial",
"numpy.sin",
"numpy.arange"
] | [((711, 747), 'numpy.sin', 'np.sin', (['(x * 2 * np.pi * freq + phase)'], {}), '(x * 2 * np.pi * freq + phase)\n', (717, 747), True, 'import numpy as np\n'), ((1158, 1170), 'numpy.arange', 'np.arange', (['n'], {}), '(n)\n', (1167, 1170), True, 'import numpy as np\n'), ((3540, 3616), 'functools.partial', 'partial', (['s... |
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
from functools import reduce
import unittest
import numpy
from pyscf import lib
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import ao2mo
from pyscf import fci
from pyscf.tools import molden
from pyscf.grad import rhf as rhf_grad
f... | [
"pyscf.gto.Mole",
"pyscf.lib.fp",
"pyscf.lib.light_speed",
"pyscf.gto.M",
"pyscf.ao2mo.kernel",
"functools.reduce",
"pyscf.grad.rhf.grad_nuc",
"numpy.diag_indices",
"pyscf.mcscf.CASSCF",
"numpy.dot",
"numpy.zeros",
"numpy.einsum",
"pyscf.grad.casscf.Gradients",
"pyscf.lib.einsum",
"unitt... | [((2513, 2523), 'pyscf.gto.Mole', 'gto.Mole', ([], {}), '()\n', (2521, 2523), False, 'from pyscf import gto\n'), ((850, 873), 'numpy.zeros', 'numpy.zeros', (['(nmo, nmo)'], {}), '((nmo, nmo))\n', (861, 873), False, 'import numpy\n'), ((963, 996), 'numpy.zeros', 'numpy.zeros', (['(nmo, nmo, nmo, nmo)'], {}), '((nmo, nmo... |
# SM.NLMS.py
#
# Implements the Set-membership Normalized LMS algorithm for COMPLEX valued data.
# (Algorithm 6.1 - book: Adaptive Filtering: Algorithms and Practical
# Implementation, Diniz)
#
# Authors:
# . <NAME> - <EMAIL> & <EMAIL>
... | [
"numpy.append",
"numpy.array",
"numpy.zeros",
"time.time"
] | [((3001, 3007), 'time.time', 'time', ([], {}), '()\n', (3005, 3007), False, 'from time import time\n'), ((3063, 3122), 'numpy.zeros', 'np.zeros', (['(Filter.filter_order + 1)'], {'dtype': 'input_signal.dtype'}), '(Filter.filter_order + 1, dtype=input_signal.dtype)\n', (3071, 3122), True, 'import numpy as np\n'), ((3140... |
import typing
from typing import List
import numpy as np
class Solution:
def minimumDifference(
self,
nums: List[int],
k: int,
) -> int:
a = np.array(nums)
a.sort()
k -= 1
return (a[k:] - a[:a.size - k]).min()
| [
"numpy.array"
] | [((168, 182), 'numpy.array', 'np.array', (['nums'], {}), '(nums)\n', (176, 182), True, 'import numpy as np\n')] |
import math, random, sys, os
import numpy as np
import pandas as pd
import networkx as nx
import func_timeout
import tqdm
from rdkit import RDLogger
from rdkit.Chem import Descriptors
from rdkit.Chem import rdmolops
import rdkit.Chem.QED
import torch
from botorch.models import SingleTaskGP
from botorch.fit import fit_... | [
"numpy.nanpercentile",
"rdkit.Chem.Descriptors.MolLogP",
"torch.max",
"rdkit.Chem.rdmolops.GetAdjacencyMatrix",
"torch.exp",
"torch.min",
"numpy.array",
"numpy.nanmean",
"torch.cuda.is_available",
"botorch.acquisition.qNoisyExpectedImprovement",
"numpy.percentile",
"botorch.models.SingleTaskGP... | [((695, 712), 'rdkit.RDLogger.logger', 'RDLogger.logger', ([], {}), '()\n', (710, 712), False, 'from rdkit import RDLogger\n'), ((753, 778), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (768, 778), False, 'import math, random, sys, os\n'), ((790, 811), 'os.path.dirname', 'os.path.dirname', ... |
from PIL import Image, ImageDraw
from PIL.ImageChops import multiply
import numpy as np
try:
import matplotlib.pyplot as plt
except:
print("### matplotlib.pyplot could not be imported.")
def imshow(image):
plt.imshow(image)
plt.show()
def pilshow(pil_image):
imshow(np.asarray(pil_image))
def ... | [
"matplotlib.pyplot.imshow",
"PIL.Image.open",
"numpy.asarray",
"PIL.ImageDraw.Draw",
"PIL.ImageChops.multiply",
"numpy.full",
"matplotlib.pyplot.show"
] | [((221, 238), 'matplotlib.pyplot.imshow', 'plt.imshow', (['image'], {}), '(image)\n', (231, 238), True, 'import matplotlib.pyplot as plt\n'), ((243, 253), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (251, 253), True, 'import matplotlib.pyplot as plt\n'), ((595, 619), 'PIL.ImageDraw.Draw', 'ImageDraw.Draw', ... |
import numpy as np
import pandas as pd
from mia.estimators import ShadowModelBundle, prepare_attack_data
from sklearn.ensemble import RandomForestClassifier
from sklearn.utils import resample
# depent on tensorflow 1.14
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.layers import Conv1D, A... | [
"numpy.mean",
"tensorflow.keras.utils.to_categorical",
"mia.estimators.prepare_attack_data",
"pandas.read_csv",
"tensorflow.keras.layers.AveragePooling1D",
"tensorflow.keras.losses.BinaryCrossentropy",
"tensorflow.keras.layers.Dropout",
"mia.estimators.ShadowModelBundle",
"sklearn.ensemble.RandomFor... | [((639, 660), 'numpy.random.seed', 'np.random.seed', (['(19122)'], {}), '(19122)\n', (653, 660), True, 'import numpy as np\n'), ((3887, 3919), 'numpy.random.permutation', 'np.random.permutation', (['total_row'], {}), '(total_row)\n', (3908, 3919), True, 'import numpy as np\n'), ((4400, 4412), 'tensorflow.keras.models.S... |
from __future__ import print_function
# pyDIA
#
# This software implements the difference-imaging algorithm of Bramich et al. (2010)
# with mixed-resolution delta basis functions. It uses an NVIDIA GPU to do the heavy
# processing.
#
# Subroutines deconvolve3_rows, deconvolve3_columns, resolve_coeffs_2d and
# inte... | [
"c_interface_functions.compute_model_cuda",
"numpy.sqrt",
"io_functions.write_image",
"photometry_functions.compute_psf_image",
"numpy.argsort",
"io_functions.get_date",
"sys.exit",
"data_structures.EmptyBase",
"numpy.genfromtxt",
"itertools.repeat",
"data_structures.Observation",
"os.path.exi... | [((1834, 1845), 'time.time', 'time.time', ([], {}), '()\n', (1843, 1845), False, 'import time\n'), ((3303, 3335), 'numpy.ones', 'np.ones', (['smask.shape'], {'dtype': 'bool'}), '(smask.shape, dtype=bool)\n', (3310, 3335), True, 'import numpy as np\n'), ((3345, 3359), 'data_structures.EmptyBase', 'DS.EmptyBase', ([], {}... |
#!/usr/bin/env python
"""
Operations on surface mesh vertices.
Authors:
- <NAME>, 2012 (<EMAIL>)
- <NAME>, 2012-2016 (<EMAIL>) http://binarybottle.com
Copyright 2016, Mindboggle team (http://mindboggle.info), Apache v2.0 License
"""
def find_neighbors_from_file(input_vtk):
"""
Generate the list... | [
"itertools.chain",
"mindboggle.guts.mesh.find_neighbors_from_file",
"mindboggle.guts.mesh.find_neighbors",
"mindboggle.guts.mesh.decimate.SetTargetReduction",
"mindboggle.mio.vtks.rewrite_scalars",
"numpy.sqrt",
"vtk.vtkCellArray",
"vtk.vtkDecimatePro",
"vtk.vtkPoints",
"numpy.array",
"mindboggl... | [((1878, 1906), 'mindboggle.mio.vtks.read_faces_points', 'read_faces_points', (['input_vtk'], {}), '(input_vtk)\n', (1895, 1906), False, 'from mindboggle.mio.vtks import read_faces_points\n'), ((1929, 1959), 'mindboggle.guts.mesh.find_neighbors', 'find_neighbors', (['faces', 'npoints'], {}), '(faces, npoints)\n', (1943... |
#!/usr/bin/env python
# Filename: test_scripts
"""
introduction:
authors: <NAME>
email:<EMAIL>
add time: 11 April, 2021
"""
import os, sys
import cv2
import numpy as np
code_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
sys.path.insert(0, code_dir)
import datasets.raster_io as raster_io
def ... | [
"cv2.rectangle",
"numpy.mean",
"sys.path.insert",
"os.path.join",
"datasets.raster_io.read_raster_all_bands_np",
"numpy.ascontiguousarray",
"cv2.imshow",
"cv2.waitKey",
"cv2.cvtColor",
"os.path.abspath",
"cv2.imread",
"os.path.expanduser"
] | [((246, 274), 'sys.path.insert', 'sys.path.insert', (['(0)', 'code_dir'], {}), '(0, code_dir)\n', (261, 274), False, 'import os, sys\n'), ((435, 520), 'os.path.expanduser', 'os.path.expanduser', (['"""~/Data/Arctic/canada_arctic/autoMapping/multiArea_yolov4_1"""'], {}), "('~/Data/Arctic/canada_arctic/autoMapping/multiA... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2019 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | [
"numpy.flip",
"numpy.ones",
"iris.coords.AuxCoord",
"numpy.array",
"improver.utilities.cube_manipulation.sort_coord_in_cube",
"unittest.main",
"improver.utilities.warnings_handler.ManageWarnings"
] | [((7954, 7981), 'improver.utilities.warnings_handler.ManageWarnings', 'ManageWarnings', ([], {'record': '(True)'}), '(record=True)\n', (7968, 7981), False, 'from improver.utilities.warnings_handler import ManageWarnings\n'), ((8700, 8715), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8713, 8715), False, 'import... |
'''
Tasks which control a plant under pure machine control. Used typically for initializing BMI decoder parameters.
'''
import numpy as np
import time
import os
import pdb
import multiprocessing as mp
import pickle
import tables
import re
import tempfile, traceback, datetime
import riglib.bmi
from riglib.stereo_opengl... | [
"numpy.ceil",
"riglib.bmi.bmi.MachineOnlyFilter",
"riglib.bmi.bmi.Decoder",
"riglib.bmi.extractor.DummyExtractor",
"riglib.bmi.state_space_models.StateSpaceEndptVel2D",
"riglib.experiment.traits.OptionsList"
] | [((965, 1038), 'riglib.experiment.traits.OptionsList', 'traits.OptionsList', (['*bmi_ssm_options'], {'bmi3d_input_options': 'bmi_ssm_options'}), '(*bmi_ssm_options, bmi3d_input_options=bmi_ssm_options)\n', (983, 1038), False, 'from riglib.experiment import traits, experiment\n'), ((1087, 1109), 'riglib.bmi.state_space_... |
import os
import sys
import random
import numpy as np
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from h01_data.parse import get_data as get_raw_data
from h02_learn.model import opt_params
from h02_learn.train import convert_to_loader, _run_language, write_csv, get_data
from utils import argparser
from utils i... | [
"h02_learn.train.get_data",
"random.shuffle",
"h02_learn.train.convert_to_loader",
"h02_learn.train.write_csv",
"os.path.join",
"utils.utils.get_languages",
"h02_learn.model.opt_params.get_opt_params",
"numpy.zeros",
"h02_learn.train._run_language",
"utils.argparser.parse_args",
"h01_data.parse.... | [((74, 105), 'os.path.join', 'os.path.join', (['sys.path[0]', '""".."""'], {}), "(sys.path[0], '..')\n", (86, 105), False, 'import os\n'), ((625, 656), 'h02_learn.train.get_data', 'get_data', (['lang', 'rare_mode', 'args'], {}), '(lang, rare_mode, args)\n', (633, 656), False, 'from h02_learn.train import convert_to_loa... |
import numpy as np
import pytest
from ansys import dpf
from ansys.dpf import core
from ansys.dpf.core import FieldDefinition
from ansys.dpf.core import operators as ops
from ansys.dpf.core.common import locations, shell_layers
@pytest.fixture()
def stress_field(allkindofcomplexity):
model = dpf.core.Model(allkind... | [
"ansys.dpf.core.Model",
"ansys.dpf.core.Field",
"ansys.dpf.core.DataSources",
"numpy.array",
"pytest.fixture",
"ansys.dpf.core.fields_factory.create_3d_vector_field",
"ansys.dpf.core.Operator",
"numpy.arange",
"ansys.dpf.core.Dimensionality.scalar_dim",
"ansys.dpf.core.operators.logic.identical_fi... | [((230, 246), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (244, 246), False, 'import pytest\n'), ((298, 333), 'ansys.dpf.core.Model', 'dpf.core.Model', (['allkindofcomplexity'], {}), '(allkindofcomplexity)\n', (312, 333), False, 'from ansys import dpf\n'), ((457, 473), 'ansys.dpf.core.Field', 'dpf.core.Field'... |
import sys
import importlib
import argparse
import numpy as np
import random
import cmath
import math
from dft import dft, inv_dft
from fft import fft, inv_fft
from rsa import *
#arguments for dft, fft, inverse dft and inverse fft
parameters1 = []
parameters2 = []
i=4
while i<2048:
param1 = list(... | [
"numpy.array_equiv",
"numpy.fft.fft",
"numpy.array",
"numpy.random.randint",
"dft.dft",
"fft.fft"
] | [((320, 363), 'numpy.random.randint', 'np.random.randint', ([], {'low': '(0)', 'high': '(1000)', 'size': 'i'}), '(low=0, high=1000, size=i)\n', (337, 363), True, 'import numpy as np\n'), ((422, 465), 'numpy.random.randint', 'np.random.randint', ([], {'low': '(0)', 'high': '(1000)', 'size': 'i'}), '(low=0, high=1000, si... |
"""Tests for io.py.
"""
import os
import pytest
import tempfile
import unittest.mock as mock
import numpy as np
import pandas as pd
import cytoxnet.dataprep.io
import cytoxnet.data
def test_load_data():
"""Test the load_data function.
Should be able to find files, and package data. Also dropping nans
... | [
"tempfile.TemporaryDirectory",
"pandas.read_csv",
"os.path.join",
"os.path.realpath",
"pytest.raises",
"numpy.array_equal",
"pandas.DataFrame",
"unittest.mock.patch"
] | [((1641, 1678), 'unittest.mock.patch', 'mock.patch', (['"""cytoxnet.dataprep.io.pd"""'], {}), "('cytoxnet.dataprep.io.pd')\n", (1651, 1678), True, 'import unittest.mock as mock\n'), ((1680, 1717), 'unittest.mock.patch', 'mock.patch', (['"""cytoxnet.dataprep.io.os"""'], {}), "('cytoxnet.dataprep.io.os')\n", (1690, 1717)... |
import datetime as dtm
from profile_plot import profile_plot
import matplotlib.pyplot as plt
from matplotlib.font_manager import fontManager, FontProperties
from matplotlib import ticker, cm
import sys
import pandas as pd
import numpy as np
import os
import re
from dateutil import parser
import errno
from shutil import... | [
"re.compile",
"numpy.argsort",
"numpy.array",
"datetime.timedelta",
"os.strerror",
"numpy.arange",
"datetime.datetime",
"os.path.exists",
"textwrap.dedent",
"os.listdir",
"numpy.searchsorted",
"subprocess.Popen",
"matplotlib.pyplot.style.use",
"numpy.round",
"dateutil.parser.parse",
"n... | [((454, 508), 'matplotlib.pyplot.style.use', 'plt.style.use', (["['seaborn-paper', 'seaborn-colorblind']"], {}), "(['seaborn-paper', 'seaborn-colorblind'])\n", (467, 508), True, 'import matplotlib.pyplot as plt\n'), ((3198, 3213), 'numpy.array', 'np.array', (['times'], {}), '(times)\n', (3206, 3213), True, 'import nump... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2022- <NAME>
#
# Distributed under the terms of the MIT License
# (see wavespin/__init__.py for details)
# -----------------------------------------------------------------------------
from ...fronten... | [
"math.sqrt",
"math.log2",
"numpy.isnan",
"copy.deepcopy",
"warnings.warn",
"numpy.cumsum"
] | [((1377, 1391), 'math.sqrt', 'math.sqrt', (['(0.5)'], {}), '(0.5)\n', (1386, 1391), False, 'import math\n'), ((31725, 31736), 'copy.deepcopy', 'deepcopy', (['I'], {}), '(I)\n', (31733, 31736), False, 'from copy import deepcopy\n'), ((36594, 36645), 'numpy.cumsum', 'np.cumsum', (["[(not p['is_cqt']) for p in self.psi1_f... |
# -*- coding: utf-8 -*-
import unittest
from .. import distributions
from scipy.integrate import quad
import numpy as np
import scipy.stats
class test_distributions(unittest.TestCase):
def _check_pdfintegral(self, integral, integrale, theory):
integrale = max(integrale, 1e-5)
limits = integral ... | [
"unittest.TestSuite",
"scipy.integrate.quad",
"numpy.array",
"numpy.linspace",
"sys.exit",
"unittest.TextTestRunner",
"matplotlib.pyplot.show"
] | [((2506, 2526), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (2524, 2526), False, 'import unittest\n'), ((2687, 2712), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {}), '()\n', (2710, 2712), False, 'import unittest\n'), ((458, 474), 'scipy.integrate.quad', 'quad', (['func', 'a', 'b'], {})... |
#Exercício: Ler uma imagem, converter em escala de cinza,
# utilizando a seguinte fórmula:
# Gr = R*0,25 + G*0,65 + B*0,1
#ler o seu histograma e verificar qual o nível de cor
# possui maior intensidade na imagem. Imprima o histograma.
# A partir da imagem do histograma, identifique um limiar
# para fazer a limiarizaçã... | [
"cv2.calcHist",
"cv2.threshold",
"matplotlib.pyplot.plot",
"numpy.argmax",
"cv2.imshow",
"numpy.zeros",
"cv2.waitKey",
"matplotlib.pyplot.xlim",
"cv2.imread",
"matplotlib.pyplot.show"
] | [((464, 480), 'cv2.imread', 'cv2.imread', (['path'], {}), '(path)\n', (474, 480), False, 'import cv2\n'), ((502, 534), 'cv2.imshow', 'cv2.imshow', (['"""IMG Original """', 'img'], {}), "('IMG Original ', img)\n", (512, 534), False, 'import cv2\n'), ((559, 585), 'numpy.zeros', 'np.zeros', (['(h, w)', 'np.uint8'], {}), '... |
import numpy as np
from dask import array as da
from typing import Tuple, List, Iterable
import pyqtgraph as pg
import skbeam.core.correlation as corr
from xicam.SAXS.patches.pyFAI import AzimuthalIntegrator
from xicam.core.intents import PlotIntent
from xicam.core import msg
from xicam.plugins.operationplugin import... | [
"xicam.plugins.operationplugin.output_names",
"xicam.plugins.operationplugin.visible",
"numpy.mean",
"xicam.plugins.operationplugin.intent",
"numpy.flipud",
"xicam.core.msg.notifyMessage",
"numpy.min",
"xicam.plugins.operationplugin.display_name",
"xicam.plugins.operationplugin.input_names",
"xica... | [((514, 548), 'xicam.plugins.operationplugin.display_name', 'display_name', (['"""1-time Correlation"""'], {}), "('1-time Correlation')\n", (526, 548), False, 'from xicam.plugins.operationplugin import operation, describe_input, describe_output, visible, input_names, output_names, display_name, categories, intent\n'), ... |
# Author: <NAME> <<EMAIL>>
# My imports
from . import constants
# Regular imports
from datetime import datetime
from copy import deepcopy
from scipy import signal
import numpy as np
import warnings
import librosa
import random
import torch
# TODO - torch Tensor compatibility
# TODO - try to ensure these won't brea... | [
"scipy.signal.convolve",
"librosa.midi_to_hz",
"torch.from_numpy",
"numpy.argsort",
"numpy.array",
"librosa.util.pad_center",
"copy.deepcopy",
"librosa.hz_to_midi",
"numpy.arange",
"numpy.mean",
"numpy.savez",
"numpy.reshape",
"numpy.where",
"numpy.sort",
"numpy.diff",
"numpy.max",
"... | [((1234, 1250), 'numpy.empty', 'np.empty', (['[0, 3]'], {}), '([0, 3])\n', (1242, 1250), True, 'import numpy as np\n'), ((2053, 2094), 'librosa.midi_to_hz', 'librosa.midi_to_hz', (['batched_notes[..., 2]'], {}), '(batched_notes[..., 2])\n', (2071, 2094), False, 'import librosa\n'), ((2583, 2624), 'librosa.hz_to_midi', ... |
import numpy as np
def integrand_sin(x):
return x**2 * np.sin(x)
def simpson(f, a, b, nstrips):
x, dx = np.linspace(a, b, num=2*nstrips+1, endpoint=True, retstep=True)
return dx / 3 * (f(x[0]) + f(x[-1]) + 4 * np.sum(f(x[1:-1:2])) + 2 * np.sum(f(x[2:-1:2])))
nstrips_all = 10 * 2**np.arange(8)
dx = 1 / ns... | [
"numpy.sin",
"numpy.linspace",
"numpy.cos",
"numpy.arange"
] | [((114, 181), 'numpy.linspace', 'np.linspace', (['a', 'b'], {'num': '(2 * nstrips + 1)', 'endpoint': '(True)', 'retstep': '(True)'}), '(a, b, num=2 * nstrips + 1, endpoint=True, retstep=True)\n', (125, 181), True, 'import numpy as np\n'), ((60, 69), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (66, 69), True, 'import n... |
"""
Tests for domain helpers.
"""
# pylint: disable=missing-docstring
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import numpy.testing as nt
import scipy.optimize as spop
import copy
import reggie.core.domains as domains
### BASE ... | [
"numpy.testing.assert_allclose",
"reggie.core.domains.Log",
"numpy.array",
"copy.deepcopy",
"copy.copy",
"scipy.optimize.approx_fprime",
"reggie.core.domains.Identity"
] | [((660, 685), 'copy.copy', 'copy.copy', (['self.transform'], {}), '(self.transform)\n', (669, 685), False, 'import copy\n'), ((699, 728), 'copy.deepcopy', 'copy.deepcopy', (['self.transform'], {}), '(self.transform)\n', (712, 728), False, 'import copy\n'), ((811, 832), 'numpy.array', 'np.array', (['self.bounds'], {}), ... |
"""
Authors: <NAME>, <NAME>, <NAME>
"""
import numpy as np
import scipy.stats as spst
import scipy.linalg as la
class LQFilter:
def __init__(self, d, h, y_m, r=None, h_eps=None, β=None):
"""
Parameters
----------
d : list or numpy.array (1-D or a 2-D column vector)
... | [
"scipy.linalg.lu",
"numpy.eye",
"numpy.linalg.solve",
"numpy.prod",
"numpy.asarray",
"numpy.roots",
"numpy.diag",
"scipy.linalg.cholesky",
"numpy.zeros",
"numpy.vstack",
"numpy.poly1d",
"scipy.linalg.inv",
"numpy.arange"
] | [((983, 996), 'numpy.asarray', 'np.asarray', (['d'], {}), '(d)\n', (993, 996), True, 'import numpy as np\n'), ((1054, 1069), 'numpy.asarray', 'np.asarray', (['y_m'], {}), '(y_m)\n', (1064, 1069), True, 'import numpy as np\n'), ((1417, 1441), 'numpy.zeros', 'np.zeros', (['(2 * self.m + 1)'], {}), '(2 * self.m + 1)\n', (... |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from ..layers.LayerSandPileReservoir import LayerSandPileReservoir
from ..layers.LayerLinearRegression import LayerLinearRegression
from .LayeredModel import LayeredModel
class SandPileModel(LayeredModel):
def __init__(self, input_size, ou... | [
"numpy.shape",
"matplotlib.pyplot.plot",
"seaborn.heatmap"
] | [((2025, 2051), 'seaborn.heatmap', 'sns.heatmap', (['signals_shape'], {}), '(signals_shape)\n', (2036, 2051), True, 'import seaborn as sns\n'), ((2061, 2071), 'matplotlib.pyplot.plot', 'plt.plot', ([], {}), '()\n', (2069, 2071), True, 'import matplotlib.pyplot as plt\n'), ((1947, 1964), 'numpy.shape', 'np.shape', (['si... |
from __future__ import absolute_import, division, print_function
import numpy as np
from simdna.util import DEFAULT_LETTER_TO_INDEX
from simdna import util
import math
class PWM(object):
def __init__(self, name, letterToIndex=DEFAULT_LETTER_TO_INDEX):
self.name = name
self.letterToIndex = letterT... | [
"numpy.array",
"numpy.log",
"simdna.util.sampleFromProbsArr",
"numpy.argmax"
] | [((941, 961), 'numpy.array', 'np.array', (['self._rows'], {}), '(self._rows)\n', (949, 961), True, 'import numpy as np\n'), ((1182, 1200), 'numpy.log', 'np.log', (['self._rows'], {}), '(self._rows)\n', (1188, 1200), True, 'import numpy as np\n'), ((1969, 1997), 'simdna.util.sampleFromProbsArr', 'util.sampleFromProbsArr... |
from unittest.case import TestCase
import unittest
import pandas as pd
import numpy as np
from datetime import datetime
from qlib import init
from qlib.config import C
from qlib.log import TimeInspector
from qlib.utils.time import cal_sam_minute as cal_sam_minute_new, get_min_cal
def cal_sam_minute(x, sam_minutes):
... | [
"datetime.datetime",
"qlib.utils.time.get_min_cal",
"numpy.random.choice",
"pandas.Timedelta",
"qlib.utils.time.cal_sam_minute",
"qlib.log.TimeInspector.logt",
"qlib.init",
"unittest.main"
] | [((3232, 3247), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3245, 3247), False, 'import unittest\n'), ((2048, 2054), 'qlib.init', 'init', ([], {}), '()\n', (2052, 2054), False, 'from qlib import init\n'), ((2172, 2185), 'qlib.utils.time.get_min_cal', 'get_min_cal', ([], {}), '()\n', (2183, 2185), False, 'from ... |
import numpy as np
import cv2,os
cam=cv2.VideoCapture(0)
face_cascade=cv2.CascadeClassifier("haarcascade_frontalface_alt.xml")
face_data=[]
path="./data/"
if not os.path.exists(path):
os.mkdir(path)
file_name=input("Enter the name")
cnt=0
while True:
ret,frame=cam.read()
if ret==False:
break
faces=face_cascade.de... | [
"cv2.rectangle",
"os.path.exists",
"numpy.asarray",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"os.mkdir",
"cv2.CascadeClassifier",
"cv2.resize",
"cv2.waitKey",
"numpy.save"
] | [((37, 56), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (53, 56), False, 'import cv2, os\n'), ((70, 126), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""haarcascade_frontalface_alt.xml"""'], {}), "('haarcascade_frontalface_alt.xml')\n", (91, 126), False, 'import cv2, os\n'), ((798, 819), 'n... |
#! /usr/bin/env python
"""
Module for generating an RBF approximation
of temporal dynamics in POD basis space
"""
import numpy as np
import scipy
from scipy.spatial.distance import cdist
from numpy.lib.scimath import sqrt as csqrt
from scipy import interpolate
import pod as pod
import greedy as gdy
import rom as rom... | [
"numpy.prod",
"numpy.linalg.solve",
"numpy.sqrt",
"numpy.amin",
"numpy.power",
"numpy.searchsorted",
"scipy.spatial.distance.cdist",
"numpy.linalg.cond",
"numpy.exp",
"numpy.zeros",
"numpy.empty",
"numpy.nonzero",
"numpy.linalg.norm",
"numpy.amax",
"numpy.arange"
] | [((2977, 3006), 'numpy.zeros', 'np.zeros', (['(nw_total, Nt)', '"""d"""'], {}), "((nw_total, Nt), 'd')\n", (2985, 3006), True, 'import numpy as np\n'), ((4260, 4289), 'numpy.zeros', 'np.zeros', (['(nw_total, Nt)', '"""d"""'], {}), "((nw_total, Nt), 'd')\n", (4268, 4289), True, 'import numpy as np\n'), ((10679, 10712), ... |
# harmonypy - A data alignment algorithm.
# Copyright (C) 2018 <NAME>
# 2019 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... | [
"logging.getLogger",
"logging.StreamHandler",
"numpy.log",
"numpy.array_split",
"numpy.array",
"numpy.isfinite",
"numpy.linalg.norm",
"numpy.arange",
"numpy.multiply",
"scipy.cluster.vq.kmeans",
"numpy.repeat",
"numpy.max",
"numpy.exp",
"numpy.dot",
"numpy.random.seed",
"numpy.round",
... | [((864, 894), 'logging.getLogger', 'logging.getLogger', (['"""harmonypy"""'], {}), "('harmonypy')\n", (881, 894), False, 'import logging\n'), ((931, 954), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (952, 954), False, 'import logging\n'), ((994, 1067), 'logging.Formatter', 'logging.Formatter', (... |
from numbers import Real, Integral
import numpy as np
import openmc.checkvalue as cv
from .angle_energy import AngleEnergy
from .endf import get_cont_record
class NBodyPhaseSpace(AngleEnergy):
"""N-body phase space distribution
Parameters
----------
total_mass : float
Total mass of product p... | [
"openmc.checkvalue.check_greater_than",
"numpy.string_",
"openmc.checkvalue.check_type"
] | [((1479, 1516), 'openmc.checkvalue.check_type', 'cv.check_type', (['name', 'total_mass', 'Real'], {}), '(name, total_mass, Real)\n', (1492, 1516), True, 'import openmc.checkvalue as cv\n'), ((1525, 1569), 'openmc.checkvalue.check_greater_than', 'cv.check_greater_than', (['name', 'total_mass', '(0.0)'], {}), '(name, tot... |
from PIL import Image
import numpy as np
import math
def symmetric_pad_img(origin_img, pad_pixel=100):
origin_img_array = np.array(origin_img)
padded_img_array = np.pad(origin_img_array,
pad_width=((pad_pixel, pad_pixel), (pad_pixel, pad_pixel), (0, 0)),
... | [
"PIL.Image.fromarray",
"PIL.Image.open",
"math.ceil",
"PIL.Image.new",
"numpy.array",
"numpy.pad"
] | [((134, 154), 'numpy.array', 'np.array', (['origin_img'], {}), '(origin_img)\n', (142, 154), True, 'import numpy as np\n'), ((179, 293), 'numpy.pad', 'np.pad', (['origin_img_array'], {'pad_width': '((pad_pixel, pad_pixel), (pad_pixel, pad_pixel), (0, 0))', 'mode': '"""symmetric"""'}), "(origin_img_array, pad_width=((pa... |
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from sympy import *
def session2():
a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
c = a + b
print("矩阵加法", c)
d = a - b
print("矩阵减法", d)
e = a * b
print("矩阵乘法", e)
f = np.dot(a, b)
... | [
"sklearn.preprocessing.PolynomialFeatures",
"pandas.read_csv",
"numpy.arange",
"sklearn.model_selection.train_test_split",
"numpy.size",
"matplotlib.pyplot.plot",
"sklearn.datasets.load_boston",
"tushare.get_hist_data",
"sklearn.preprocessing.StandardScaler",
"numpy.array",
"numpy.dot",
"numpy... | [((146, 165), 'numpy.array', 'np.array', (['[1, 2, 3]'], {}), '([1, 2, 3])\n', (154, 165), True, 'import numpy as np\n'), ((174, 193), 'numpy.array', 'np.array', (['[4, 5, 6]'], {}), '([4, 5, 6])\n', (182, 193), True, 'import numpy as np\n'), ((307, 319), 'numpy.dot', 'np.dot', (['a', 'b'], {}), '(a, b)\n', (313, 319),... |
import pandapower as pp
import pytest
from numpy import array
@pytest.fixture()
def base_net():
net = pp.create_empty_network()
pp.create_bus(net, vn_kv=10)
pp.create_bus(net, vn_kv=10)
pp.create_ext_grid(net, 0)
pp.create_load(net, 1, p_kw=200, controllable=False)
pp.create_line_from_parameter... | [
"pandapower.create_sgen",
"pandapower.create_ext_grid",
"pandapower.create_empty_network",
"pandapower.create_line_from_parameters",
"pandapower.create_load",
"pandapower.runopp",
"pandapower.create_gen",
"pytest.main",
"numpy.array",
"pytest.fixture",
"pandapower.runpp",
"pandapower.create_bu... | [((64, 80), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (78, 80), False, 'import pytest\n'), ((107, 132), 'pandapower.create_empty_network', 'pp.create_empty_network', ([], {}), '()\n', (130, 132), True, 'import pandapower as pp\n'), ((137, 165), 'pandapower.create_bus', 'pp.create_bus', (['net'], {'vn_kv': '... |
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
from functools import lru_cache
import cupy as cp
from cupyx.scipy.sparse import csr_matrix as csr_gpu
import itertools
import time
import os
import pickle
import scipy
import random
import correlation_module
import sys
sys.path.insert(0, "../../.... | [
"sys.path.insert",
"pickle.dump",
"numpy.random.rand",
"cupy.random.rand",
"networkx.adjacency_matrix",
"networkx.selfloop_edges",
"networkx.DiGraph",
"networkx.generators.degree_seq.configuration_model",
"numpy.random.pareto",
"numpy.count_nonzero",
"numpy.array",
"scipy.sparse.coo_matrix",
... | [((293, 327), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../../lib"""'], {}), "(0, '../../../lib')\n", (308, 327), False, 'import sys\n'), ((385, 416), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../lib"""'], {}), "(0, '../../lib')\n", (400, 416), False, 'import sys\n'), ((1311, 1336), 'numpy.array... |
"""
Simulation of binary floating point representation at arbitrary fixed or
infinite precision (including greater than 64 bit).
:name: Simfloat
:author: <NAME>
:version: 0.2
:date: August 2008
Updated to version 0.2 for full Python 3 compatibility in 2020.
"""
import numpy as np
import math
import decimal
from dec... | [
"decimal.getcontext",
"numpy.alltrue",
"numpy.sometrue",
"numpy.array",
"numpy.zeros",
"numpy.isfinite",
"numpy.sign",
"decimal.Decimal"
] | [((1497, 1517), 'decimal.getcontext', 'decimal.getcontext', ([], {}), '()\n', (1515, 1517), False, 'import decimal\n'), ((42488, 42555), 'numpy.alltrue', 'np.alltrue', (["[(n in ('0', '1', '.', 'e', '+', '-')) for n in s_rest]"], {}), "([(n in ('0', '1', '.', 'e', '+', '-')) for n in s_rest])\n", (42498, 42555), True, ... |
#!/usr/bin/env python
import time
import rospy
import math
import copy
import numpy
from std_msgs.msg import Float64
from sensor_msgs.msg import JointState
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Point
from tf.transformations import euler_from_quaternion
class CubeRLUtils(object):
def __i... | [
"tf.transformations.euler_from_quaternion",
"rospy.logerr",
"rospy.Subscriber",
"std_msgs.msg.Float64",
"rospy.is_shutdown",
"rospy.init_node",
"rospy.wait_for_message",
"time.sleep",
"numpy.array",
"geometry_msgs.msg.Point",
"rospy.Rate",
"numpy.linalg.norm",
"rospy.Publisher",
"rospy.log... | [((5196, 5283), 'rospy.init_node', 'rospy.init_node', (['"""cube_rl_systems_test_node"""'], {'anonymous': '(True)', 'log_level': 'rospy.INFO'}), "('cube_rl_systems_test_node', anonymous=True, log_level=\n rospy.INFO)\n", (5211, 5283), False, 'import rospy\n'), ((5325, 5362), 'rospy.loginfo', 'rospy.loginfo', (['"""M... |
import sklearn
from sklearn import metrics
import numpy as np
import pandas as pd
import re
class MetricsCls:
"""
Requirement: metric functions under the class should always have the y_true, and y_pred args.
Examples:
>>> obj=MetricsCls(config={'MAPE__version':'sklearn'})
>... | [
"numpy.abs",
"numpy.average",
"numpy.diff",
"sklearn.metrics.mean_squared_error",
"numpy.array",
"sklearn.metrics.mean_absolute_percentage_error",
"pandas.DataFrame",
"sklearn.metrics.mean_absolute_error",
"numpy.round"
] | [((2860, 2970), 'sklearn.metrics.mean_absolute_error', 'sklearn.metrics.mean_absolute_error', (['y_true', 'y_pred'], {'sample_weight': 'sample_weight', 'multioutput': 'multioutput'}), '(y_true, y_pred, sample_weight=\n sample_weight, multioutput=multioutput)\n', (2895, 2970), False, 'import sklearn\n'), ((3111, 3237... |
import InstrumentDriver
import numpy as np
class Driver(InstrumentDriver.InstrumentWorker):
""" This class implements a simple signal generator driver"""
def performOpen(self, options={}):
"""Perform the operation of opening the instrument connection"""
pass
def performClose(self, b... | [
"numpy.sin",
"numpy.linspace"
] | [((1218, 1241), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(1000)'], {}), '(0, 1, 1000)\n', (1229, 1241), True, 'import numpy as np\n'), ((1267, 1322), 'numpy.sin', 'np.sin', (['(freq * time * 2 * np.pi + phase * np.pi / 180.0)'], {}), '(freq * time * 2 * np.pi + phase * np.pi / 180.0)\n', (1273, 1322), True, 'i... |
from typing import Union
import numpy as np
def moore_n(
n: int, position: tuple, grid: np.ndarray, invariant: Union[int, np.ndarray] = 0
):
"""Gets the N Moore neighborhood at given postion."""
row, col = position
nrows, ncols = grid.shape
# Target offsets from position.
ofup, ofdo = row +... | [
"numpy.array",
"collections.namedtuple",
"numpy.repeat"
] | [((5197, 5315), 'collections.namedtuple', 'namedtuple', (['"""Neighbors"""', "['up_left', 'up', 'up_right', 'left', 'self', 'right', 'down_left', 'down',\n 'down_right']"], {}), "('Neighbors', ['up_left', 'up', 'up_right', 'left', 'self',\n 'right', 'down_left', 'down', 'down_right'])\n", (5207, 5315), False, 'fr... |
from nose.plugins.attrib import attr
import os
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import trackpy
from trackpy import plots
from trackpy.utils import suppress_plotting, fit_powerlaw
from trackpy.tests.common import StrictTestCase
import nose
# Quiet warnings about Axes not be... | [
"pandas.Series",
"trackpy.plots.plot_traj",
"nose.plugins.attrib.attr",
"pandas.DataFrame",
"os.path.join",
"trackpy.utils.fit_powerlaw",
"nose.runmodule",
"nose.SkipTest",
"numpy.random.randint",
"trackpy.utils.suppress_plotting",
"trackpy.plots.annotate3d",
"trackpy.plots.annotate",
"os.pa... | [((369, 486), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'message': '"""This figure includes Axes that are not compatible with tight_layout"""'}), "('ignore', message=\n 'This figure includes Axes that are not compatible with tight_layout')\n", (392, 486), False, 'import warnings\n'), ... |
import torch
import os
import time
import numpy as np
from tqdm import tqdm
from collections import OrderedDict
from torch import optim
from torch import nn
from torchvision.utils import save_image
class Base:
def _get_stats(self, dict_, mode):
stats = OrderedDict({})
for key in dict_.keys():
... | [
"numpy.mean",
"collections.OrderedDict",
"os.path.exists",
"os.makedirs",
"time.time"
] | [((267, 282), 'collections.OrderedDict', 'OrderedDict', (['{}'], {}), '({})\n', (278, 282), False, 'from collections import OrderedDict\n'), ((341, 360), 'numpy.mean', 'np.mean', (['dict_[key]'], {}), '(dict_[key])\n', (348, 360), True, 'import numpy as np\n'), ((1298, 1309), 'time.time', 'time.time', ([], {}), '()\n',... |
# Copyright 2021 DeepMind Technologies Limited.
#
# 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 agre... | [
"neural_lns.data_utils.get_features",
"collections.deque",
"neural_lns.mip_utils.is_var_binary",
"neural_lns.local_branching_expert.get_lns_lp_solution",
"os.path.join",
"ml_collections.ConfigDict",
"absl.logging.warning",
"numpy.zeros",
"numpy.concatenate",
"neural_lns.local_branching_expert.impr... | [((1221, 1311), 'ml_collections.ConfigDict', 'ml_collections.ConfigDict', (["{'seed': 42, 'time_limit_seconds': 1800, 'relative_gap': 0}"], {}), "({'seed': 42, 'time_limit_seconds': 1800,\n 'relative_gap': 0})\n", (1246, 1311), False, 'import ml_collections\n'), ((1554, 1590), 'os.path.join', 'os.path.join', (['data... |
import os
import pandas as pd
import numpy as np
import pickle
import argparse
## torch packages
import torch
from transformers import BertTokenizer,AutoTokenizer
import re
## for visualisation
import matplotlib.pyplot as plt
import collections
## custom packages
from extract_lexicon import get_arousal_vec,get_valenc... | [
"pickle.dump",
"argparse.ArgumentParser",
"pandas.read_csv",
"os.path.join",
"extract_lexicon.get_valence_vec",
"pandas.DataFrame.from_dict",
"extract_lexicon.get_arousal_vec",
"extract_lexicon.get_dom_vec",
"numpy.zeros",
"utils.tweet_preprocess",
"transformers.AutoTokenizer.from_pretrained"
] | [((538, 558), 'numpy.zeros', 'np.zeros', (['class_size'], {}), '(class_size)\n', (546, 558), True, 'import numpy as np\n'), ((4752, 4797), 'transformers.AutoTokenizer.from_pretrained', 'AutoTokenizer.from_pretrained', (['tokenizer_type'], {}), '(tokenizer_type)\n', (4781, 4797), False, 'from transformers import BertTok... |
# 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.common.initializer.Uniform",
"mindspore.common.initializer.HeUniform",
"mindspore.nn.SequentialCell",
"numpy.ones",
"mindspore.nn.AvgPool2d",
"mindspore.nn.MaxPool2d",
"mindspore.ops.operations.Transpose",
"mindspore.nn.BatchNorm2d",
"math.sqrt",
"mindspore.common.initializer.HeNormal",... | [((1096, 1154), 'mindspore.nn.Conv2d', 'nn.Conv2d', (['inplanes', 'planes'], {'kernel_size': '(1)', 'has_bias': '(False)'}), '(inplanes, planes, kernel_size=1, has_bias=False)\n', (1105, 1154), True, 'import mindspore.nn as nn\n'), ((1174, 1196), 'mindspore.nn.BatchNorm2d', 'nn.BatchNorm2d', (['planes'], {}), '(planes)... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 15 16:06:04 2019
@author: <NAME>
"""
# https://realpython.com/python-web-scraping-practical-introduction/
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
import string
import time
import math
import datetime
abstracts = []
from nltk.corpus import sto... | [
"webscraper_functions.simple_get",
"nltk.corpus.stopwords.words",
"pandas.read_csv",
"datetime.datetime.strptime",
"webscraper_functions.get_abstract",
"time.sleep",
"bs4.BeautifulSoup",
"webscraper_functions.string_parse2",
"string.capwords",
"webscraper_functions.string_parse1",
"pandas.DataFr... | [((2772, 2787), 'numpy.arange', 'np.arange', (['(0)', '(1)'], {}), '(0, 1)\n', (2781, 2787), True, 'import numpy as np\n'), ((9705, 9914), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': "{'Topics_split': topics_split, 'Topics': topics, 'Authors': authors,\n 'Titles': titles, 'Journals': journals, 'Years': years, ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 16 12:05:08 2018
@author: Alexandre
"""
###############################################################################
import numpy as np
###############################################################################
from pyro.dynamic import pendulum
from pyro.control ... | [
"numpy.array",
"pyro.control.linear.PIDController",
"numpy.zeros",
"pyro.dynamic.pendulum.SinglePendulum.h"
] | [((967, 999), 'pyro.control.linear.PIDController', 'linear.PIDController', (['kp', 'ki', 'kd'], {}), '(kp, ki, kd)\n', (987, 999), False, 'from pyro.control import linear\n'), ((1024, 1040), 'numpy.array', 'np.array', (['[3.14]'], {}), '([3.14])\n', (1032, 1040), True, 'import numpy as np\n'), ((725, 765), 'pyro.dynami... |
#
# This code is for detecting proper region of the plate
# with the combined approach
#
# imports
import cv2
import imutils
import numpy as np
from imutils import paths
# import RDetectPlates as detplt
from imutils import perspective
import matplotlib.pyplot as plt
import sklearn as sk
from sklearn.decomposition impor... | [
"cv2.rectangle",
"imutils.perspective.four_point_transform",
"numpy.array",
"imutils.paths.list_images",
"matplotlib.pyplot.imshow",
"cv2.threshold",
"cv2.erode",
"numpy.max",
"matplotlib.pyplot.close",
"cv2.minAreaRect",
"numpy.min",
"Regressor_01.Regression_plt",
"cv2.boxPoints",
"cv2.mo... | [((722, 743), 'cv2.imread', 'cv2.imread', (['imgs[rnd]'], {}), '(imgs[rnd])\n', (732, 743), False, 'import cv2\n'), ((749, 765), 'matplotlib.pyplot.imshow', 'plt.imshow', (['gimg'], {}), '(gimg)\n', (759, 765), True, 'import matplotlib.pyplot as plt\n'), ((770, 781), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '(... |
#!/usr/bin/env python3
import numpy as np
from gym import spaces
from gym.utils import seeding
from learn2learn.gym.envs.meta_env import MetaEnv
class Particles2DEnv(MetaEnv):
"""
[[Source]](https://github.com/learnables/learn2learn/blob/master/learn2learn/gym/envs/particles/particles_2d.py)
**Descript... | [
"numpy.clip",
"numpy.abs",
"numpy.sqrt",
"gym.spaces.Box",
"numpy.zeros",
"gym.utils.seeding.np_random"
] | [((756, 822), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(-np.inf)', 'high': 'np.inf', 'shape': '(2,)', 'dtype': 'np.float32'}), '(low=-np.inf, high=np.inf, shape=(2,), dtype=np.float32)\n', (766, 822), False, 'from gym import spaces\n'), ((895, 955), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(-0.1)', 'high': '(... |
import json
import numpy as np
import os
import pickle
import sklearn.metrics
import time
from chapydette import cp_estimation
def load_features(cruise, features_dir, projection_dim, subsample_num=1, subsample_of=1):
"""
Load features for a cruise.
:param cruise: Cruise to load features for.
:param ... | [
"numpy.median",
"numpy.sqrt",
"os.path.join",
"numpy.percentile",
"time.time",
"numpy.round"
] | [((1742, 1758), 'numpy.median', 'np.median', (['dists'], {}), '(dists)\n', (1751, 1758), True, 'import numpy as np\n'), ((1890, 1915), 'numpy.sqrt', 'np.sqrt', (['(1 / (2 * gammas))'], {}), '(1 / (2 * gammas))\n', (1897, 1915), True, 'import numpy as np\n'), ((10935, 10946), 'time.time', 'time.time', ([], {}), '()\n', ... |
import numpy as np
import skimage.segmentation
import skimage.io
import keras.backend as K
import tensorflow as tf
debug = False
def channel_precision(channel, name):
def precision_func(y_true, y_pred):
y_pred_tmp = K.cast(tf.equal( K.argmax(y_pred, axis=-1), channel), "float32")
true_positives = ... | [
"keras.backend.clip",
"numpy.argmax",
"numpy.max",
"keras.backend.argmax",
"numpy.sum",
"numpy.empty",
"keras.backend.epsilon",
"numpy.full",
"numpy.zeros_like"
] | [((1574, 1588), 'numpy.max', 'np.max', (['labels'], {}), '(labels)\n', (1580, 1588), True, 'import numpy as np\n'), ((1637, 1675), 'numpy.zeros_like', 'np.zeros_like', (['labels'], {'dtype': 'np.uint16'}), '(labels, dtype=np.uint16)\n', (1650, 1675), True, 'import numpy as np\n'), ((2484, 2554), 'numpy.argmax', 'np.arg... |
"""
Add samples
This script takes a wav file that must have n peaks and create n different files for each peak.
"""
import numpy as np
from scipy.io.wavfile import read,write
import peakutils, os
# average
# 3169 / 2 = 1584.5
side = 10000
# The stander for the peaks
stander = 0
"""
Write the .wav file
"""
def exp... | [
"numpy.array",
"scipy.io.wavfile.read",
"scipy.io.wavfile.write",
"os.getcwd"
] | [((353, 380), 'scipy.io.wavfile.write', 'write', (['filename', 'rate', 'data'], {}), '(filename, rate, data)\n', (358, 380), False, 'from scipy.io.wavfile import read, write\n'), ((1462, 1476), 'scipy.io.wavfile.read', 'read', (['filenmae'], {}), '(filenmae)\n', (1466, 1476), False, 'from scipy.io.wavfile import read, ... |
import warnings
import csv
import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
from models.cnn_models import CNN1
from sklearn.model_selection import train_test_split
from tensorflow.keras.utils import to_categorical, plot_model
# gpus = tf.config.experimental.li... | [
"matplotlib.pyplot.imshow",
"tensorflow.keras.utils.to_categorical",
"matplotlib.pyplot.savefig",
"tensorflow.config.experimental.set_memory_growth",
"sklearn.model_selection.train_test_split",
"csv.writer",
"models.cnn_models.CNN1",
"numpy.argmax",
"tensorflow.keras.utils.plot_model",
"numpy.arra... | [((412, 463), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (456, 463), True, 'import tensorflow as tf\n'), ((485, 536), 'tensorflow.config.experimental.set_memory_growth', 'tf.config.experimental.set_memory_growth', (['gpu', '(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script doing the actual virtual screening of a library of compounds over a previously built Bayesian model.
"""
import argparse
import logging
import numpy as np
import csv
import json
import math
from rdkit import Chem
import common
__author__ = "<NA... | [
"numpy.mean",
"argparse.ArgumentParser",
"math.floor",
"common.to_float",
"common.fragments_extraction",
"math.log",
"common.delete_files",
"numpy.array",
"common.init_logging",
"common.descriptors_extraction",
"json.load",
"common.open_file",
"math.isnan"
] | [((1746, 1791), 'math.log', 'math.log', (["(probs['active'] / probs['inactive'])"], {}), "(probs['active'] / probs['inactive'])\n", (1754, 1791), False, 'import math\n'), ((4903, 4921), 'numpy.array', 'np.array', (['features'], {}), '(features)\n', (4911, 4921), True, 'import numpy as np\n'), ((6717, 6738), 'common.ini... |
""" impyute.imputation.ts.locf """
import numpy as np
from impyute.util import find_null
from impyute.util import checks
from impyute.util import preprocess
@preprocess
@checks
def locf(data, axis=0):
""" Last Observation Carried Forward
For each set of missing indices, use the value of one row before(same
... | [
"numpy.shape",
"numpy.transpose",
"impyute.util.find_null",
"numpy.isnan"
] | [((1025, 1040), 'impyute.util.find_null', 'find_null', (['data'], {}), '(data)\n', (1034, 1040), False, 'from impyute.util import find_null\n'), ((958, 976), 'numpy.transpose', 'np.transpose', (['data'], {}), '(data)\n', (970, 976), True, 'import numpy as np\n'), ((1398, 1426), 'numpy.isnan', 'np.isnan', (['data[x_i + ... |
#Filename: initialize.py
#Institute: IIT Roorkee
import torch.nn as nn
import numpy as np
def weights_init_kaimingUniform(module):
for m in module.modules():
if isinstance(m, nn.Conv2d):
nn.init.kaiming_uniform_(m.weight, mode = 'fan_in', nonlinearity = 'relu')
if m.bias is not No... | [
"numpy.sqrt",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"torch.nn.init.kaiming_uniform_",
"torch.nn.init.uniform_",
"torch.nn.init.normal_"
] | [((214, 284), 'torch.nn.init.kaiming_uniform_', 'nn.init.kaiming_uniform_', (['m.weight'], {'mode': '"""fan_in"""', 'nonlinearity': '"""relu"""'}), "(m.weight, mode='fan_in', nonlinearity='relu')\n", (238, 284), True, 'import torch.nn as nn\n'), ((851, 920), 'torch.nn.init.kaiming_normal_', 'nn.init.kaiming_normal_', (... |
import os
import tempfile
import numpy as np
from microscopium.screens.cellomics import SPIRAL_CLOCKWISE_RIGHT_25
from microscopium import preprocess as pre
from microscopium import io as mio
import pytest
import warnings
@pytest.fixture
def image_files():
# for clarity we define images as integer arrays in [0, 1... | [
"numpy.clip",
"numpy.testing.assert_equal",
"numpy.array",
"microscopium.io.temporary_file",
"numpy.random.RandomState",
"os.remove",
"microscopium.preprocess.correct_multiimage_illumination",
"numpy.testing.assert_array_almost_equal",
"microscopium.preprocess.montage_with_missing",
"microscopium.... | [((3552, 3610), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fns, expected"""', 'missing_test_fns'], {}), "('fns, expected', missing_test_fns)\n", (3575, 3610), False, 'import pytest\n'), ((4590, 4676), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""missing, order, rows, cols, expected"""', ... |
#! /usr/bin/env python
import _pickle as cPickle, gzip
import numpy as np
from tqdm import tqdm
import torch
import torch.autograd as autograd
import torch.nn.functional as F
import torch.nn as nn
import sys
sys.path.append("..")
import utils
from utils import *
from train_utils import batchify_data, run_epoch, train_... | [
"torch.manual_seed",
"torch.nn.ReLU",
"torch.nn.LeakyReLU",
"train_utils.batchify_data",
"train_utils.train_model",
"numpy.random.seed",
"torch.nn.Linear",
"sys.path.append",
"numpy.random.shuffle"
] | [((209, 230), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (224, 230), False, 'import sys\n'), ((816, 846), 'numpy.random.shuffle', 'np.random.shuffle', (['permutation'], {}), '(permutation)\n', (833, 846), True, 'import numpy as np\n'), ((997, 1040), 'train_utils.batchify_data', 'batchify_data... |
from __future__ import print_function
import os
import sys
import pickle
import json
import datetime
from collections import namedtuple
import numpy as np
import sqlite3
from sqlalchemy import create_engine
from sqlalchemy_utils import drop_database
from sqlalchemy.orm import sessionmaker
from sqlalchemy.exc import Int... | [
"sqlalchemy.orm.sessionmaker",
"sqlalchemy_utils.drop_database",
"analysis.delayedfeedback.database.EventType",
"datetime.datetime.fromtimestamp",
"sqlalchemy.create_engine",
"os.path.join",
"numpy.diff",
"analysis.delayedfeedback.database.Subject",
"analysis.delayedfeedback.database.Base.metadata.c... | [((2862, 2883), 'sqlalchemy.create_engine', 'create_engine', (['db_url'], {}), '(db_url)\n', (2875, 2883), False, 'from sqlalchemy import create_engine\n'), ((2668, 2689), 'sqlalchemy.create_engine', 'create_engine', (['db_url'], {}), '(db_url)\n', (2681, 2689), False, 'from sqlalchemy import create_engine\n'), ((2698,... |
import yake
import gensim
import numpy as np
import itertools
import nltk
from nltk.corpus import stopwords
def extract_keywords(text):
"""
Extract keywords from a text using yake model.
"""
# extract keywords
kw_extractor = yake.KeywordExtractor()
keywords = kw_extractor.extract_keywords(text... | [
"yake.KeywordExtractor",
"gensim.models.KeyedVectors.load_word2vec_format",
"numpy.argsort",
"numpy.zeros",
"numpy.linalg.norm"
] | [((247, 270), 'yake.KeywordExtractor', 'yake.KeywordExtractor', ([], {}), '()\n', (268, 270), False, 'import yake\n'), ((914, 927), 'numpy.zeros', 'np.zeros', (['(300)'], {}), '(300)\n', (922, 927), True, 'import numpy as np\n'), ((1128, 1242), 'gensim.models.KeyedVectors.load_word2vec_format', 'gensim.models.KeyedVect... |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
from utils import util
from scipy.special import logit
import sklearn.linear_model as lm
from sklearn.linear_model import LogisticRegressionCV, LogisticRegression
from sklearn.metrics.pairwise import linear_kernel, polynomial_kernel, rbf_kernel
f... | [
"sklearn.preprocessing.PolynomialFeatures",
"sklearn.metrics.pairwise.rbf_kernel",
"scipy.stats.multivariate_normal",
"matplotlib.pyplot.pcolormesh",
"numpy.random.RandomState",
"numpy.linspace",
"matplotlib.pyplot.scatter",
"numpy.eye",
"matplotlib.pyplot.savefig",
"numpy.ones",
"sklearn.metric... | [((3144, 3154), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3152, 3154), True, 'import matplotlib.pyplot as plt\n'), ((477, 501), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)'], {}), '(0)\n', (498, 501), True, 'import numpy as np\n'), ((1089, 1110), 'sklearn.preprocessing.PolynomialFeatures'... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# @Time : 2017/6/21 12:26
# @Author : HouJP
# @Email : <EMAIL>
import ConfigParser
import random
import numpy as np
from scipy import sparse
from bin.featwheel.utils import LogUtil
from ..featwheel.feature import Feature
from ..postprocessor import PostProcessor
cl... | [
"numpy.array",
"random.random",
"bin.featwheel.utils.LogUtil.log",
"ConfigParser.ConfigParser"
] | [((434, 461), 'ConfigParser.ConfigParser', 'ConfigParser.ConfigParser', ([], {}), '()\n', (459, 461), False, 'import ConfigParser\n'), ((2935, 3002), 'bin.featwheel.utils.LogUtil.log', 'LogUtil.log', (['"""INFO"""', "('save train features (%s) done' % feature_name)"], {}), "('INFO', 'save train features (%s) done' % fe... |
"""
This RNN is used for predicting stock trends of the Google stock.
@Editor: <NAME>
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.l... | [
"numpy.reshape",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"keras.models.Sequential",
"numpy.array",
"keras.layers.LSTM",
"keras.layers.Dropout",
"pandas.concat",
"keras.layers.Dense",
"matplotlib.pyplot.title",
"sklearn.preprocessin... | [((497, 540), 'pandas.read_csv', 'pd.read_csv', (['"""Google_Stock_Price_Train.csv"""'], {}), "('Google_Stock_Price_Train.csv')\n", (508, 540), True, 'import pandas as pd\n'), ((784, 829), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {'feature_range': '(0, 1)', 'copy': '(True)'}), '(feature_range=(0, 1), ... |
import numpy as np
# Matrix for converting axial coordinates to pixel coordinates
axial_to_pixel_mat = np.array([[np.sqrt(3), np.sqrt(3) / 2], [0, 3 / 2.]])
# Matrix for converting pixel coordinates to axial coordinates
pixel_to_axial_mat = np.linalg.inv(axial_to_pixel_mat)
# These are the vectors for moving from ... | [
"numpy.abs",
"numpy.sqrt",
"numpy.arange",
"numpy.squeeze",
"numpy.array",
"numpy.zeros",
"numpy.linalg.inv",
"numpy.vstack",
"numpy.round"
] | [((244, 277), 'numpy.linalg.inv', 'np.linalg.inv', (['axial_to_pixel_mat'], {}), '(axial_to_pixel_mat)\n', (257, 277), True, 'import numpy as np\n'), ((358, 378), 'numpy.array', 'np.array', (['(1, 0, -1)'], {}), '((1, 0, -1))\n', (366, 378), True, 'import numpy as np\n'), ((384, 404), 'numpy.array', 'np.array', (['(0, ... |
import numpy as np
import scipy
from scipy.stats import binom
# numpy.seterr(all='raise')
#
# Decision tree: Regression
#
class Tree():
def __init__(self, X, y, maxDepth, alpha0 = None, baseline_features = None, peek_ahead_max_depth=0, split_val_quantiles = [], peek_ahead_quantiles = [], nSamples = ... | [
"numpy.mean",
"numpy.unique",
"numpy.append",
"numpy.nanmean",
"numpy.quantile",
"numpy.sum",
"numpy.isnan",
"numpy.array",
"scipy.stats.binom.cdf",
"numpy.min",
"numpy.argmin",
"numpy.isinf",
"numpy.var",
"numpy.random.permutation"
] | [((9593, 9611), 'numpy.nanmean', 'np.nanmean', (['self.y'], {}), '(self.y)\n', (9603, 9611), True, 'import numpy as np\n'), ((12297, 12325), 'numpy.isnan', 'np.isnan', (['best_split_feature'], {}), '(best_split_feature)\n', (12305, 12325), True, 'import numpy as np\n'), ((17461, 17483), 'numpy.isinf', 'np.isinf', (['be... |
"""Test becquerel's Spectrum."""
import pytest
import datetime
import numpy as np
from uncertainties import ufloat, UFloat, unumpy
import becquerel as bq
TEST_DATA_LENGTH = 256
TEST_COUNTS = 4
TEST_GAIN = 8.23
TEST_EDGES_KEV = np.arange(TEST_DATA_LENGTH + 1) * TEST_GAIN
def make_data(lam=TEST_COUNTS, size=TEST_DAT... | [
"numpy.sqrt",
"numpy.array",
"becquerel.Spectrum.from_listmode",
"pytest.fixture",
"uncertainties.ufloat",
"numpy.arange",
"datetime.datetime",
"numpy.random.poisson",
"numpy.where",
"becquerel.Calibration.from_linear",
"numpy.logspace",
"uncertainties.unumpy.uarray",
"numpy.random.normal",
... | [((5201, 5276), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""spec_type"""', "['uncal', 'cal', 'uncal_long', 'cal']"], {}), "('spec_type', ['uncal', 'cal', 'uncal_long', 'cal'])\n", (5224, 5276), False, 'import pytest\n'), ((5819, 5859), 'numpy.random.normal', 'np.random.normal', (['MEAN', 'STDDEV', 'NSAM... |
from __future__ import division, print_function, absolute_import
"""
Author: PinAxe
Project: Convolutional Auto Encoder Example.
A 7 layers auto-encoder with TensorFlow Convolutional layers
trains on noised MNIST set. Supposed to do some serious denoising.
Also it saves and automaticaly restores the model and does vis... | [
"numpy.clip",
"tensorflow.image.resize_images",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.reduce_mean",
"matplotlib.pyplot.imshow",
"tensorflow.pow",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.layers.conv2d",
"tensorflow.nn.sigmoid",
"numpy.emp... | [((2607, 2660), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""/tmp/data/"""'], {'one_hot': '(True)'}), "('/tmp/data/', one_hot=True)\n", (2632, 2660), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((2661, 2685), 'tensorflow.reset_default_gr... |
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import load_boston
from sklearn.ensemble import StackingRegressor
from sklearn.linear_model import LinearRegression, TheilSenRegressor
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from sklearn... | [
"sklearn.utils.check_random_state",
"numpy.median",
"numpy.ones",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"numpy.average",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"sklearn.datasets.load_boston",
"sklearn.linear_model.TheilSenRegressor",
"sklearn.metr... | [((485, 517), 'sklearn.utils.check_random_state', 'check_random_state', (['random_state'], {}), '(random_state)\n', (503, 517), False, 'from sklearn.utils import check_random_state\n'), ((4933, 4978), 'matplotlib.pyplot.plot', 'plt.plot', (['p', 'ensemble_ols', '"""b"""'], {'label': '"""enols"""'}), "(p, ensemble_ols, ... |
import openl3
from pathlib import Path
import numpy as np
import librosa
import tensorflow_hub as hub
class AudioL3:
def __init__(self, input_repr: str = 'mel256', content_type: str = 'music', embedding_size: int = 512) -> None:
self.model = openl3.models.load_audio_embedding_model(input_repr=input_repr... | [
"numpy.mean",
"openl3.models.load_audio_embedding_model",
"tensorflow_hub.load",
"openl3.get_audio_embedding",
"librosa.load"
] | [((258, 383), 'openl3.models.load_audio_embedding_model', 'openl3.models.load_audio_embedding_model', ([], {'input_repr': 'input_repr', 'content_type': 'content_type', 'embedding_size': 'embedding_size'}), '(input_repr=input_repr,\n content_type=content_type, embedding_size=embedding_size)\n', (298, 383), False, 'im... |
"""
Author: <NAME>
Source:
Content: File includes calculation of values on cubic Bézier curve.
"""
import numpy as np
# calculates one point on a cubic Bézier curve
# input: - uVal (float): parameter of value u
# - b (list) = [b0, b1, ..., bn] control and Bézier points as list
# output: - poin... | [
"numpy.linspace"
] | [((743, 763), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'N'], {}), '(0, 1, N)\n', (754, 763), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
"""
Plotting planet population Joint PDF
Written By: <NAME>
2/1/2019
"""
try:
import cPickle as pickle
except:
import pickle
import os
if not 'DISPLAY' in os.environ.keys(): #Check environment for keys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt ... | [
"matplotlib.ticker.LogLocator",
"matplotlib.pyplot.ylabel",
"numpy.nanmin",
"os.path.exists",
"re.split",
"numpy.where",
"matplotlib.pyplot.xlabel",
"EXOSIMS.util.vprint.vprint",
"numpy.asarray",
"numpy.max",
"matplotlib.pyplot.close",
"numpy.linspace",
"numpy.nanmax",
"numpy.min",
"os.e... | [((262, 283), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (276, 283), False, 'import matplotlib\n'), ((189, 206), 'os.environ.keys', 'os.environ.keys', ([], {}), '()\n', (204, 206), False, 'import os\n'), ((1022, 1034), 'EXOSIMS.util.vprint.vprint', 'vprint', (['args'], {}), '(args)\n', (1028,... |
# python3.7
"""Implements image cropping."""
import numpy as np
try:
import nvidia.dali.fn as fn
except ImportError:
fn = None
try:
import cupy
except ImportError:
cupy = None
from utils.formatting_utils import format_image_size
from .base_transformation import BaseTransformation
__all__ = ['Cente... | [
"cupy.ascontiguousarray",
"nvidia.dali.fn.random.uniform",
"numpy.ascontiguousarray",
"cupy.random.uniform",
"numpy.random.uniform",
"utils.formatting_utils.format_image_size",
"nvidia.dali.fn.crop"
] | [((681, 709), 'utils.formatting_utils.format_image_size', 'format_image_size', (['crop_size'], {}), '(crop_size)\n', (698, 709), False, 'from utils.formatting_utils import format_image_size\n'), ((1657, 1788), 'nvidia.dali.fn.crop', 'fn.crop', (['data'], {'crop_pos_x': '(0.5)', 'crop_pos_y': '(0.5)', 'crop_w': 'self.cr... |
import numpy as np
import nept
def bayesian_prob(counts, tuning_curves, binsize, min_neurons, min_spikes=1):
"""Computes the bayesian probability of location based on spike counts.
Parameters
----------
counts : nept.AnalogSignal
Where each inner array is the number of spikes (int) in each bi... | [
"numpy.nanargmax",
"nept.Position",
"numpy.where",
"numpy.nansum",
"numpy.log",
"numpy.asarray",
"nept.Epoch",
"numpy.any",
"numpy.sum",
"numpy.empty",
"numpy.isnan",
"numpy.finfo",
"numpy.shape",
"numpy.isinf",
"numpy.seterr",
"numpy.arange"
] | [((1569, 1593), 'numpy.seterr', 'np.seterr', ([], {'over': '"""ignore"""'}), "(over='ignore')\n", (1578, 1593), True, 'import numpy as np\n'), ((2408, 2435), 'numpy.seterr', 'np.seterr', ([], {}), '(**error_settings)\n', (2417, 2435), True, 'import numpy as np\n'), ((2798, 2839), 'numpy.sum', 'np.sum', (['(counts.data ... |
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import math
import torch.nn.functional as F
import pdb
def Entropy(input_):
bs = input_.size(0)
epsilon = 1e-5
entropy = -input_ * torch.log(input_ + epsilon)
entropy = torch.sum(entropy, dim=1)
return entropy... | [
"torch.ones_like",
"torch.log",
"torch.log_softmax",
"torch.mean",
"torch.exp",
"torch.softmax",
"numpy.array",
"torch.nn.BCELoss",
"torch.sum",
"torch.nn.LogSoftmax",
"torch.nn.functional.softmax"
] | [((276, 301), 'torch.sum', 'torch.sum', (['entropy'], {'dim': '(1)'}), '(entropy, dim=1)\n', (285, 301), False, 'import torch\n'), ((234, 261), 'torch.log', 'torch.log', (['(input_ + epsilon)'], {}), '(input_ + epsilon)\n', (243, 261), False, 'import torch\n'), ((1187, 1211), 'torch.ones_like', 'torch.ones_like', (['en... |
import re
import warnings
from astropy.coordinates import SkyCoord
import astropy.units as u
import numpy as np
from astropy.wcs import WCS, FITSFixedWarning
from astropy.io import fits
def _arange_inclusive(x0, x1, binx):
"""
Return np.arange(x0, x1, binx) except that range is inclusive of x1.
"""
... | [
"numpy.searchsorted",
"warnings.catch_warnings",
"numpy.min",
"astropy.coordinates.SkyCoord",
"numpy.max",
"numpy.argsort",
"numpy.array",
"warnings.simplefilter",
"astropy.io.fits.open",
"numpy.histogram2d",
"astropy.wcs.WCS",
"numpy.arange",
"re.search"
] | [((477, 516), 'numpy.arange', 'np.arange', (['x0', 'x1', 'binx'], {'dtype': 'np.float'}), '(x0, x1, binx, dtype=np.float)\n', (486, 516), True, 'import numpy as np\n'), ((6542, 6580), 'numpy.searchsorted', 'np.searchsorted', (["events['x']", '[x0, x1]'], {}), "(events['x'], [x0, x1])\n", (6557, 6580), True, 'import num... |
import os
import matplotlib.pyplot as plt
import numpy as np
from skimage.feature import plot_matches
def show_correspondences(imgA, imgB, X1, Y1, X2, Y2, matches, good_matches, number_to_display, filename=None):
"""
Visualizes corresponding points between two images, either as
arrows or dots
mode='dots': Co... | [
"matplotlib.pyplot.gcf",
"numpy.logical_not",
"skimage.feature.plot_matches",
"numpy.array",
"os.path.isdir",
"os.mkdir",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((592, 622), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': '(1)', 'ncols': '(1)'}), '(nrows=1, ncols=1)\n', (604, 622), True, 'import matplotlib.pyplot as plt\n'), ((902, 997), 'skimage.feature.plot_matches', 'plot_matches', (['ax', 'imgA', 'imgB', 'kp1', 'kp2', 'matches[good_matches]'], {'matches_color... |
"""
The purpose of this code is to first create the raw directory folder and include the following files
starting protein receptor
starting ligand
target ligand
glide pose viewer file
Then the top glide poses are added
Then the decoys are created
It can be run on sherlock using
$ $SCHRODINGER/run python3 decoy.py al... | [
"schrodinger.structure.StructureWriter",
"numpy.arccos",
"schrodinger.structutils.transform.get_centroid",
"schrodinger.structutils.interactions.steric_clash.clash_volume",
"numpy.sin",
"os.path.exists",
"os.listdir",
"argparse.ArgumentParser",
"schrodinger.structutils.transform.rotate_structure",
... | [((9233, 9264), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(np.pi * 2)'], {}), '(0, np.pi * 2)\n', (9250, 9264), True, 'import numpy as np\n'), ((9277, 9301), 'numpy.random.uniform', 'np.random.uniform', (['(-1)', '(1)'], {}), '(-1, 1)\n', (9294, 9301), True, 'import numpy as np\n'), ((9314, 9333), 'numpy.a... |
# -*- coding:utf-8 -*-
"""
This file generates description of model and
intermediate images of extracted features
"""
import keras
import sys
import json
import numpy as np
from PIL import Image
import os
base_path = os.path.dirname(os.path.abspath(__file__))
x_norm_file = sys.argv[1]
x_test_file = sys.argv[2]
y_tes... | [
"numpy.prod",
"PIL.Image.fromarray",
"keras.models.load_model",
"json.dumps",
"os.path.join",
"numpy.array",
"keras.models.Model",
"os.path.abspath",
"numpy.shape",
"numpy.load"
] | [((557, 592), 'keras.models.load_model', 'keras.models.load_model', (['model_file'], {}), '(model_file)\n', (580, 592), False, 'import keras\n'), ((235, 260), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (250, 260), False, 'import os\n'), ((352, 372), 'numpy.load', 'np.load', (['x_norm_file... |
#===============================================================================
# Copyright 2022 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.a... | [
"numpy.dtype",
"numpy.ones_like",
"numpy.reshape",
"numpy.unique",
"numpy.any",
"numpy.errstate",
"numpy.zeros",
"numpy.empty",
"numpy.vstack",
"numpy.all",
"numpy.isinf",
"numpy.arange"
] | [((12504, 12531), 'numpy.all', 'np.all', (['sample_mask'], {'axis': '(1)'}), '(sample_mask, axis=1)\n', (12510, 12531), True, 'import numpy as np\n'), ((12603, 12667), 'numpy.reshape', 'np.reshape', (['neigh_ind[sample_mask]', '(n_queries, n_neighbors - 1)'], {}), '(neigh_ind[sample_mask], (n_queries, n_neighbors - 1))... |
import numpy as np
import pandas as pd
from classy import Class
import pickle
import sys,os
import astropy
from astropy.cosmology import Planck15
from astropy import units as u
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
rc('text', usetex=Tr... | [
"numpy.log10",
"scipy.signal.argrelextrema",
"numpy.where",
"scipy.integrate.simps",
"scipy.interpolate.interp1d",
"numpy.max",
"matplotlib.rc",
"numpy.min",
"pandas.DataFrame",
"scipy.special.jv",
"numpy.logspace"
] | [((236, 303), 'matplotlib.rc', 'rc', (['"""font"""'], {}), "('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']})\n", (238, 303), False, 'from matplotlib import rc\n'), ((300, 323), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (302, 323), False, 'from matplotlib ... |
import traceback
import h5py
import matplotlib.pyplot as plt
import numpy as np
import os
import seaborn as sn
import sys
import tensorflow as tf
from support.data_model import CLASSES, TAG_CLASS_MAP, Track, UNCLASSIFIED_TAGS
from support.track_utils import convert_frames, convert_hdf5_frames
START_TIME = '2021-03... | [
"support.track_utils.convert_hdf5_frames",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"support.data_model.Track",
"numpy.argmax",
"seaborn.heatmap",
"h5py.File",
"matplotlib.pyplot.close",
"numpy.diag",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.matmul",
"numpy.row_stack"... | [((570, 596), 'numpy.zeros', 'np.zeros', (['dims', 'np.float32'], {}), '(dims, np.float32)\n', (578, 596), True, 'import numpy as np\n'), ((1190, 1238), 'numpy.row_stack', 'np.row_stack', (['(normalized_matrix, precision_row)'], {}), '((normalized_matrix, precision_row))\n', (1202, 1238), True, 'import numpy as np\n'),... |
# --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file
path
data = pd.read_csv(path)
data = data.rename(columns={'Total':'Total_Medals'})
data.head()
#Code starts here
# --------------
#Code starts here
data['Better_Event'] = n... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"numpy.where",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.xlabel",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((150, 167), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (161, 167), True, 'import pandas as pd\n'), ((319, 392), 'numpy.where', 'np.where', (["(data['Total_Summer'] > data['Total_Winter'])", '"""Summer"""', '"""Winter"""'], {}), "(data['Total_Summer'] > data['Total_Winter'], 'Summer', 'Winter')\n", ... |
import matplotlib
matplotlib.use('Agg')
import os, sys
import yaml
from argparse import ArgumentParser
from tqdm import tqdm
import imageio
import numpy as np
from skimage.transform import resize
from skimage import img_as_ubyte
import torch
from sync_batchnorm import DataParallelWithCallback
# from modules.generato... | [
"sync_batchnorm.DataParallelWithCallback",
"argparse.ArgumentParser",
"imageio.imwrite",
"matplotlib.use",
"gzip.open",
"torch.load",
"animate.normalize_kp",
"torch.device",
"modules.keypoint_detector.KPDetector",
"time.sleep",
"yaml.load",
"numpy.array",
"copy.deepcopy",
"torch.no_grad",
... | [((19, 40), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (33, 40), False, 'import matplotlib\n'), ((827, 933), 'modules.keypoint_detector.KPDetector', 'KPDetector', ([], {}), "(**config['model_params']['kp_detector_params'], **config[\n 'model_params']['common_params'])\n", (837, 933), False... |
#!/usr/bin/env python
"""
Plot a depth plane extracted from the SCEC Community Velocity Model.
"""
import math
import numpy as np
import matplotlib.pyplot as plt
import cst.data
import cst.cvms
import cst.cvmh
# parameters
prop = 'rho'
prop = 'Vs'
label = 'S-wave velocity (m/s)'
depth = 500.0
vmin, vmax = 300, 3200
de... | [
"matplotlib.pyplot.gca",
"math.cos",
"matplotlib.pyplot.figure",
"numpy.empty_like",
"numpy.meshgrid",
"numpy.arange"
] | [((429, 475), 'numpy.arange', 'np.arange', (['lon[0]', '(lon[1] + 0.5 * delta)', 'delta'], {}), '(lon[0], lon[1] + 0.5 * delta, delta)\n', (438, 475), True, 'import numpy as np\n'), ((480, 526), 'numpy.arange', 'np.arange', (['lat[0]', '(lat[1] + 0.5 * delta)', 'delta'], {}), '(lat[0], lat[1] + 0.5 * delta, delta)\n', ... |
# -*- coding: utf-8 -*-
"""
v9s model
* Input: v5_im
Author: Kohei <<EMAIL>>
"""
from logging import getLogger, Formatter, StreamHandler, INFO, FileHandler
from pathlib import Path
import subprocess
import argparse
import math
import glob
import sys
import json
import re
import warnings
import scipy
import tqdm
impo... | [
"logging.getLogger",
"numpy.clip",
"logging.StreamHandler",
"keras.backend.sum",
"pandas.read_csv",
"tables.Atom.from_dtype",
"math.floor",
"keras.callbacks.History",
"numpy.array",
"tables.Filters",
"pathlib.Path",
"click.group",
"subprocess.Popen",
"keras.backend.clip",
"json.dumps",
... | [((4066, 4110), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""', 'UserWarning'], {}), "('ignore', UserWarning)\n", (4087, 4110), False, 'import warnings\n'), ((4121, 4136), 'logging.StreamHandler', 'StreamHandler', ([], {}), '()\n', (4134, 4136), False, 'from logging import getLogger, Formatter, Stre... |
from random import randint
import numpy as np
try:
import tensorflow as tf
except ImportError:
tf = None
# ToDo: we are using a lot of tf.keras.backend modules below, can we use tf core instead?
class MaskingDense(tf.keras.layers.Layer):
""" Just copied code from keras Dense layer and added masking and ... | [
"tensorflow.keras.constraints.get",
"tensorflow.keras.backend.dropout",
"tensorflow.keras.activations.get",
"tensorflow.keras.backend.in_train_phase",
"tensorflow.keras.backend.bias_add",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.initializers.get",
"tensorflow.keras.regularizers.... | [((1831, 1867), 'tensorflow.keras.activations.get', 'tf.keras.activations.get', (['activation'], {}), '(activation)\n', (1855, 1867), True, 'import tensorflow as tf\n'), ((1898, 1938), 'tensorflow.keras.activations.get', 'tf.keras.activations.get', (['out_activation'], {}), '(out_activation)\n', (1922, 1938), True, 'im... |
#!/usr/bin/env python3
from argparse import ArgumentParser
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import to_hex
def main(args):
cmap = plt.get_cmap(args.cmap)
for x in np.linspace(0, 1, num=args.n_colors):
print(to_hex(cmap(x), keep_alpha=False))
if __name__ == '... | [
"numpy.linspace",
"argparse.ArgumentParser",
"matplotlib.pyplot.get_cmap"
] | [((178, 201), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['args.cmap'], {}), '(args.cmap)\n', (190, 201), True, 'import matplotlib.pyplot as plt\n'), ((215, 251), 'numpy.linspace', 'np.linspace', (['(0)', '(1)'], {'num': 'args.n_colors'}), '(0, 1, num=args.n_colors)\n', (226, 251), True, 'import numpy as np\n'), ((... |
import pandas as pd
from matplotlib import pyplot
from sklearn.externals import joblib
import numpy as np
import datetime
import pickle
import argparse
def string_to_timestamp(string):
date_time_obj = datetime.datetime.strptime(string, '%Y-%m-%d %H:%M:%S')
timestamp = date_time_obj.timestamp()
return times... | [
"numpy.mean",
"argparse.ArgumentParser",
"pandas.read_csv",
"datetime.datetime.strptime",
"numpy.array",
"pandas.to_datetime"
] | [((206, 261), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['string', '"""%Y-%m-%d %H:%M:%S"""'], {}), "(string, '%Y-%m-%d %H:%M:%S')\n", (232, 261), False, 'import datetime\n'), ((1988, 2046), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Start and End Times"""'}), "(de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.