code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from aiida import orm from aiida.common import AttributeDict from aiida.plugins import WorkflowFactory from aiida.engine import submit ConvergencePhononFrequencies = WorkflowFactory( 'sssp_workflow.convergence.phonon_frequencies') def run_test(pw_...
[ "aiida.orm.load_node", "aiida.orm.List", "numpy.array", "aiida.engine.submit", "aiida.plugins.WorkflowFactory", "aiida.orm.load_code" ]
[((233, 296), 'aiida.plugins.WorkflowFactory', 'WorkflowFactory', (['"""sssp_workflow.convergence.phonon_frequencies"""'], {}), "('sssp_workflow.convergence.phonon_frequencies')\n", (248, 296), False, 'from aiida.plugins import WorkflowFactory\n'), ((361, 404), 'numpy.array', 'np.array', (['[30, 35, 40, 45, 50, 55, 60,...
""" Parts of the code are adapted from https://github.com/akanazawa/hmr """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import torch def compute_similarity_transform(S1, S2): """ Computes a similarity transform (sR, t) that ta...
[ "numpy.mean", "numpy.eye", "torch.mean", "numpy.sum", "torch.sum", "numpy.linalg.svd", "numpy.zeros_like", "torch.zeros" ]
[((888, 903), 'numpy.sum', 'np.sum', (['(X1 ** 2)'], {}), '(X1 ** 2)\n', (894, 903), True, 'import numpy as np\n'), ((1080, 1096), 'numpy.linalg.svd', 'np.linalg.svd', (['K'], {}), '(K)\n', (1093, 1096), True, 'import numpy as np\n'), ((1185, 1203), 'numpy.eye', 'np.eye', (['U.shape[0]'], {}), '(U.shape[0])\n', (1191, ...
import cv2 as cv import numpy as np img = cv.imread(r'C:\Users\PIYUS\Desktop\Image Processing\learning\Resources\Photos\park.jpg') cv.imshow("Img", img) blank = np.zeros(img.shape[:2], dtype='uint8') b , g , r = cv.split(img) # even after splitting how to get the actual color in place? blue = cv.merge([b, blank, bla...
[ "cv2.merge", "cv2.imshow", "numpy.zeros", "cv2.waitKey", "cv2.split", "cv2.imread" ]
[((43, 148), 'cv2.imread', 'cv.imread', (['"""C:\\\\Users\\\\PIYUS\\\\Desktop\\\\Image Processing\\\\learning\\\\Resources\\\\Photos\\\\park.jpg"""'], {}), "(\n 'C:\\\\Users\\\\PIYUS\\\\Desktop\\\\Image Processing\\\\learning\\\\Resources\\\\Photos\\\\park.jpg'\n )\n", (52, 148), True, 'import cv2 as cv\n'), ((13...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ) # # 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 # # ...
[ "random.uniform", "numpy.reshape", "numpy.random.choice", "numpy.random.random", "os.path.join", "numpy.array", "numpy.nan_to_num" ]
[((3950, 3966), 'numpy.nan_to_num', 'np.nan_to_num', (['x'], {}), '(x)\n', (3963, 3966), True, 'import numpy as np\n'), ((3979, 3995), 'numpy.nan_to_num', 'np.nan_to_num', (['y'], {}), '(y)\n', (3992, 3995), True, 'import numpy as np\n'), ((5746, 5807), 'numpy.random.choice', 'np.random.choice', (['data.shape[0]', 'sel...
import pandas as pd import geopandas as gpd import numpy as np from shapely.geometry import Point from bokeh.io import curdoc, show, output_notebook from bokeh.layouts import row, column from bokeh.models import (CDSView, ColorBar, ColumnDataSource, CustomJS, CustomJSFilter, ...
[ "bokeh.layouts.row", "bokeh.plotting.figure", "shapely.geometry.Point", "bokeh.io.curdoc", "numpy.random.randint", "bokeh.models.BooleanFilter", "bokeh.models.Toggle", "bokeh.models.RangeSlider", "bokeh.tile_providers.get_provider", "bokeh.models.HoverTool" ]
[((1367, 1417), 'numpy.random.randint', 'np.random.randint', (['X_RANGE[0]', 'X_RANGE[1]', 'npoints'], {}), '(X_RANGE[0], X_RANGE[1], npoints)\n', (1384, 1417), True, 'import numpy as np\n'), ((1426, 1476), 'numpy.random.randint', 'np.random.randint', (['Y_RANGE[0]', 'Y_RANGE[1]', 'npoints'], {}), '(Y_RANGE[0], Y_RANGE...
import RPi.GPIO as GPIO from sensorlib.hx711 import HX711 from config.config import Config from numpy import median import time class Scale: def __init__(self): self.config = Config() # config init self.config_data = self.config.get_config_data() self.hx = HX711(5, 6) # initialize scale ...
[ "RPi.GPIO.cleanup", "numpy.median", "config.config.Config", "sensorlib.hx711.HX711", "time.sleep" ]
[((189, 197), 'config.config.Config', 'Config', ([], {}), '()\n', (195, 197), False, 'from config.config import Config\n'), ((288, 299), 'sensorlib.hx711.HX711', 'HX711', (['(5)', '(6)'], {}), '(5, 6)\n', (293, 299), False, 'from sensorlib.hx711 import HX711\n'), ((2552, 2566), 'RPi.GPIO.cleanup', 'GPIO.cleanup', ([], ...
#!/usr/bin/env python """ Measure the 3D PSF a movie given the locations of the beads of interest in the movie and the z-offset of each frame of the movie. It is assumed that the drift over the time course of the movie is neglible. Depending on your setup you may need to change: 1. The z range (z_range). 2. The pi...
[ "numpy.abs", "storm_analysis.spliner.measure_psf_utils.sumPSF", "argparse.ArgumentParser", "storm_analysis.spliner.measure_psf_utils.averagePSF", "storm_analysis.spliner.measure_psf_utils.meanEdge", "os.path.splitext", "numpy.max", "storm_analysis.spliner.measure_psf_utils.makeZIndexArray", "storm_a...
[((1944, 1969), 'numpy.loadtxt', 'numpy.loadtxt', (['zfile_name'], {}), '(zfile_name)\n', (1957, 1969), False, 'import numpy\n'), ((2078, 2137), 'storm_analysis.spliner.measure_psf_utils.makeZIndexArray', 'measurePSFUtils.makeZIndexArray', (['z_offsets', 'z_range', 'z_step'], {}), '(z_offsets, z_range, z_step)\n', (210...
""" Description: Experiments that characterize the functional synaptic connectivity between two neurons often rely on being able to evoke a spike in the presynaptic cell and detect an evoked synaptic response in the postsynaptic cell. These synaptic responses can be difficult to distinguish from the c...
[ "numpy.clip", "numpy.log10", "numpy.log", "numpy.random.exponential", "pyqtgraph.multiprocess.Parallelize", "numpy.array", "pyqtgraph.GraphicsWindow", "numpy.arange", "os.path.exists", "numpy.mean", "pyqtgraph.plot", "numpy.isscalar", "pathlib.Path", "numpy.where", "pyqtgraph.console.Con...
[((2922, 2938), 'numpy.array', 'np.array', (['events'], {}), '(events)\n', (2930, 2938), True, 'import numpy as np\n'), ((26535, 26546), 'pyqtgraph.mkQApp', 'pg.mkQApp', ([], {}), '()\n', (26544, 26546), True, 'import pyqtgraph as pg\n'), ((26557, 26583), 'pyqtgraph.console.ConsoleWidget', 'pg.console.ConsoleWidget', (...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np from numpy.testing import assert_allclose from astropy.tests.helper import assert_quantity_allclose, pytest from astropy.units import Quantity from astrop...
[ "astropy.coordinates.Angle", "numpy.testing.assert_allclose", "numpy.zeros_like", "astropy.units.Quantity", "astropy.tests.helper.assert_quantity_allclose" ]
[((1501, 1521), 'astropy.units.Quantity', 'Quantity', (['(2.0)', '"""TeV"""'], {}), "(2.0, 'TeV')\n", (1509, 1521), False, 'from astropy.units import Quantity\n'), ((1896, 1940), 'numpy.testing.assert_allclose', 'assert_allclose', (['plot_data', 'model_data.value'], {}), '(plot_data, model_data.value)\n', (1911, 1940),...
import numpy as np import pandas as pd from .base_test_class import DartsBaseTestClass from ..utils import timeseries_generation as tg from ..metrics import r2_score from ..models import StandardRegressionModel def train_test_split(features, target, split_ts): """ Splits all provided TimeSeries instances int...
[ "pandas.Timestamp", "numpy.random.seed" ]
[((1676, 1693), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (1690, 1693), True, 'import numpy as np\n'), ((1250, 1274), 'pandas.Timestamp', 'pd.Timestamp', (['"""20010101"""'], {}), "('20010101')\n", (1262, 1274), True, 'import pandas as pd\n'), ((3647, 3671), 'pandas.Timestamp', 'pd.Timestamp', (['"...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Python version: 3.6 import copy import torch import numpy as np import math import random from scipy import stats from functools import reduce import time import sklearn.metrics.pairwise as smp eps = np.finfo(float).eps def arfl_update_main_model(main_model, w_locals...
[ "numpy.sqrt", "numpy.log", "torch.sqrt", "torch.exp", "torch.min", "torch.flatten", "copy.deepcopy", "torch.isinf", "sklearn.metrics.pairwise.cosine_similarity", "torch.eye", "numpy.max", "torch.zeros_like", "numpy.isinf", "numpy.eye", "random.uniform", "functools.reduce", "torch.Ten...
[((251, 266), 'numpy.finfo', 'np.finfo', (['float'], {}), '(float)\n', (259, 266), True, 'import numpy as np\n'), ((3218, 3229), 'time.time', 'time.time', ([], {}), '()\n', (3227, 3229), False, 'import time\n'), ((3242, 3261), 'copy.deepcopy', 'copy.deepcopy', (['w[0]'], {}), '(w[0])\n', (3255, 3261), False, 'import co...
# pylint: disable=missing-docstring import unittest import numpy as np # pylint bug on next line from tensorflow.python.client import device_lib # pylint: disable=no-name-in-module from cleverhans.devtools.checks import CleverHansTest HAS_GPU = "GPU" in {x.device_type for x in device_lib.list_local_devices()} clas...
[ "tensorflow.Graph", "tensorflow.python.client.device_lib.list_local_devices", "cleverhans_tutorials.mnist_tutorial_tf.mnist_tutorial", "numpy.random.seed", "unittest.main" ]
[((2325, 2340), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2338, 2340), False, 'import unittest\n'), ((783, 793), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (791, 793), True, 'import tensorflow as tf\n'), ((1444, 1454), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (1452, 1454), True, 'import tenso...
import numpy as np import tensorflow as tf from deepchem.models import TensorGraph from deepchem.models.tensorgraph.layers import Feature, Conv1D, Dense, Flatten, Reshape, Squeeze, Transpose, \ CombineMeanStd, Repeat, GRU, L2Loss, Concat, SoftMax, Constant, Variable, Add, Multiply, InteratomicL2Distances, \ Sof...
[ "deepchem.models.TensorGraph", "deepchem.models.tensorgraph.layers.Add", "deepchem.models.tensorgraph.layers.Squeeze", "deepchem.models.tensorgraph.layers.WeightedError", "deepchem.models.tensorgraph.graph_layers.WeaveGather", "deepchem.models.tensorgraph.layers.GRU", "deepchem.models.tensorgraph.layers...
[((724, 737), 'deepchem.models.TensorGraph', 'TensorGraph', ([], {}), '()\n', (735, 737), False, 'from deepchem.models import TensorGraph\n'), ((750, 786), 'deepchem.models.tensorgraph.layers.Feature', 'Feature', ([], {'shape': '(tg.batch_size, 1, 1)'}), '(shape=(tg.batch_size, 1, 1))\n', (757, 786), False, 'from deepc...
import numpy as np import deepdish as dd import srfnef as nef from scipy import sparse def max_shift_val(sgn1, sgn2, shift_max): shift_, val = 0, 0 for k in range(-shift_max, shift_max + 1): if k > 0: sum_ = np.sum(sgn1[k:] * sgn2[:-k]) if sum_ > val: val = sum_...
[ "numpy.random.normal", "numpy.ones", "numpy.hstack", "numpy.argsort", "numpy.sum", "numpy.array", "numpy.zeros", "deepdish.io.load" ]
[((238, 266), 'numpy.sum', 'np.sum', (['(sgn1[k:] * sgn2[:-k])'], {}), '(sgn1[k:] * sgn2[:-k])\n', (244, 266), True, 'import numpy as np\n'), ((1331, 1427), 'deepdish.io.load', 'dd.io.load', (['filename', "['/time', '/rsector_id', '/module_id', '/submodule_id', '/crystal_id']"], {}), "(filename, ['/time', '/rsector_id'...
from adaptive_conv import adaConv2d, get_inference_time import torch import torch.nn as nn from torch import Tensor import numpy as np from Tadaptive_conv2 import adaTrConv2d def weights_init_uniform_rule(m): classname = m.__class__.__name__ # for every Conv2d layer in a model.. if classname.find('Conv2...
[ "torch.manual_seed", "Tadaptive_conv2.adaTrConv2d", "torch.nn.ReLU", "numpy.sqrt", "torch.nn.Conv2d", "adaptive_conv.adaConv2d", "torch.cuda.is_available", "adaptive_conv.get_inference_time", "torch.rand" ]
[((2250, 2270), 'torch.manual_seed', 'torch.manual_seed', (['(0)'], {}), '(0)\n', (2267, 2270), False, 'import torch\n'), ((881, 998), 'adaptive_conv.adaConv2d', 'adaConv2d', (['in_channels', 'out_channels'], {'kernel_size': 'kernel_size', 'dilation': 'dilation', 'padding': 'padding', 'stride': 'stride'}), '(in_channel...
"""Hierarchically build a multiconformer ligand.""" import argparse import os.path import sys import logging import time from itertools import izip from string import ascii_uppercase logger = logging.getLogger(__name__) import numpy as np from .builders import HierarchicalBuilder from .structure import Ligand, Struc...
[ "logging.getLogger", "logging.basicConfig", "logging.StreamHandler", "numpy.unique", "argparse.ArgumentParser", "time.strftime", "numpy.logical_not", "itertools.izip", "time.time" ]
[((193, 220), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (210, 220), False, 'import logging\n'), ((473, 517), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (496, 517), False, 'import argparse\n'), ((3572, 3583), 'tim...
import igraph import csv import numpy as np import timeit # Function to load the graph from file def load_graph(path_to_graph_file): g = igraph.Graph.Read_GraphML(path_to_graph_file) return g def construct_igraph(graph): # 'vertices' contains the range of the vertices' indices in the graph x = int(np....
[ "timeit.default_timer", "csv.writer", "numpy.linalg.norm", "numpy.diag", "numpy.max", "numpy.array", "numpy.zeros", "igraph.Graph.Read_GraphML", "numpy.einsum", "numpy.sum", "numpy.savetxt", "numpy.min", "numpy.loadtxt", "igraph.Graph" ]
[((142, 187), 'igraph.Graph.Read_GraphML', 'igraph.Graph.Read_GraphML', (['path_to_graph_file'], {}), '(path_to_graph_file)\n', (167, 187), False, 'import igraph\n'), ((523, 597), 'igraph.Graph', 'igraph.Graph', ([], {'vertex_attrs': "{'label': vertices}", 'edges': 'edges', 'directed': '(True)'}), "(vertex_attrs={'labe...
# -------------- # Importing header files import numpy as np import warnings warnings.filterwarnings('ignore') #New record new_record=[[50, 9, 4, 1, 0, 0, 40, 0]] #Reading file data = np.genfromtxt(path, delimiter=",", skip_header=1) print(data) print(type(data)) #Code starts here census = np.con...
[ "numpy.asarray", "numpy.genfromtxt", "warnings.filterwarnings", "numpy.concatenate" ]
[((82, 115), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (105, 115), False, 'import warnings\n'), ((203, 252), 'numpy.genfromtxt', 'np.genfromtxt', (['path'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(path, delimiter=',', skip_header=1)\n", (216, 252), True, 'i...
# Copyright (C) 2019 <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 # Unless required by applicable law or agreed to in writing, soft...
[ "numpy.radians", "numpy.linalg.norm", "pymedphys._imports.numpy.array", "pymedphys._imports.numpy.shape", "pymedphys._imports.numpy.expand_dims" ]
[((1142, 1431), 'pymedphys._imports.numpy.array', 'np.array', (['[[c + u_x * u_x * (1 - c), u_x * u_y * (1 - c) - u_z * s, u_x * u_z * (1 -\n c) + u_y * s], [u_y * u_x * (1 - c) + u_z * s, c + u_y * u_y * (1 - c),\n u_y * u_z * (1 - c) - u_x * s], [u_z * u_x * (1 - c) - u_y * s, u_z *\n u_y * (1 - c) + u_x * s...
import sys # from pylab import * import seaborn as sns import math import matplotlib.pyplot as plt import matplotlib.animation as animation import tensorflow as tf import gym import numpy as np import tensorflow.contrib.layers as layers from gym import wrappers class Agent(object): def __init__(self, input_size=4...
[ "tensorflow.reduce_sum", "tensorflow.gradients", "numpy.array", "tensorflow.log", "gym.make", "numpy.mean", "tensorflow.Session", "tensorflow.placeholder", "tensorflow.contrib.layers.fully_connected", "numpy.asarray", "tensorflow.ConfigProto", "tensorflow.train.AdamOptimizer", "tensorflow.tr...
[((3951, 3973), 'numpy.zeros_like', 'np.zeros_like', (['rewards'], {}), '(rewards)\n', (3964, 3973), True, 'import numpy as np\n'), ((7597, 7609), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (7607, 7609), True, 'import matplotlib.pyplot as plt\n'), ((8838, 8854), 'tensorflow.ConfigProto', 'tf.ConfigProt...
# -*- coding: utf-8 -*- """ Created on Sun Aug 05 22:06:13 2012 @author: jev """ import numpy as np from pandas import * from matplotlib.pyplot import * #df1 = DataFrame.from_csv('test1.csv').astype(np.dtype('f4')) #df2 = DataFrame.from_csv('test2.csv').astype(np.dtype('f4')) #df = DataFrame([df1,df2]...
[ "numpy.dtype" ]
[((366, 380), 'numpy.dtype', 'np.dtype', (['"""f4"""'], {}), "('f4')\n", (374, 380), True, 'import numpy as np\n')]
import cv2 import numpy as np from threading import Thread from PIL import Image from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * from objloader import * class Renderer(): def __init__(self): self.object = None self.texture_background = None self.image = None ...
[ "PIL.Image.fromarray", "cv2.flip", "numpy.array", "cv2.Rodrigues", "threading.Thread", "numpy.transpose" ]
[((2083, 2277), 'numpy.array', 'np.array', (['[[rmtx[0][0], rmtx[0][1], rmtx[0][2], tvecs[0][0]], [rmtx[1][0], rmtx[1][1],\n rmtx[1][2], tvecs[1][0]], [rmtx[2][0], rmtx[2][1], rmtx[2][2], tvecs[2]\n [0]], [0.0, 0.0, 0.0, 1.0]]'], {}), '([[rmtx[0][0], rmtx[0][1], rmtx[0][2], tvecs[0][0]], [rmtx[1][0],\n rmtx[1]...
""" this repository implements canny line author: github.com/ludlows 2018-04-10 """ import cv2 import numpy as np class CannyPF(object): """ pass """ def __init__(self, gauss_size, vm_grad, img): """ initialize parameters and applying gaussian smooth filter to original image -...
[ "numpy.abs", "cv2.imwrite", "numpy.sqrt", "numpy.ones", "numpy.where", "numpy.random.random", "cv2.Canny", "numpy.log", "numpy.argsort", "numpy.sum", "numpy.zeros", "numpy.array", "numpy.arctan2", "cv2.cvtColor", "cv2.GaussianBlur", "cv2.Sobel", "numpy.arctan" ]
[((4463, 4562), 'cv2.Sobel', 'cv2.Sobel', (['image', 'cv2.CV_16S', '(1)', '(0)'], {'ksize': '(3)', 'scale': '(1)', 'delta': '(0)', 'borderType': 'cv2.BORDER_REPLICATE'}), '(image, cv2.CV_16S, 1, 0, ksize=3, scale=1, delta=0, borderType=\n cv2.BORDER_REPLICATE)\n', (4472, 4562), False, 'import cv2\n'), ((4563, 4662),...
""" Solver D3Q6^4 for a Poiseuille flow d_t(p) + d_x(ux) + d_y(uy) + d_z(uz)= 0 d_t(ux) + d_x(ux^2) + d_y(ux*uy) + d_z(ux*uz) + d_x(p) = mu (d_xx+d_yy+d_zz)(ux) d_t(uy) + d_x(ux*uy) + d_y(uy^2) + d_z(uy*uz) + d_y(p) = mu (d_xx+d_yy+d_zz)(uy) d_t(uz) + d_x(ux*uz) + d_y(uy*uz) + d_z(uz^2) + d_z(p) = mu (d_xx+d_y...
[ "six.moves.range", "numpy.sqrt", "pylbm.Simulation", "pylbm.H5File", "sympy.symbols" ]
[((1130, 1156), 'sympy.symbols', 'sp.symbols', (['"""X,Y,Z,lambda"""'], {}), "('X,Y,Z,lambda')\n", (1140, 1156), True, 'import sympy as sp\n'), ((1173, 1197), 'sympy.symbols', 'sp.symbols', (['"""p,ux,uy,uz"""'], {}), "('p,ux,uy,uz')\n", (1183, 1197), True, 'import sympy as sp\n'), ((1285, 1353), 'pylbm.H5File', 'pylbm...
from koko_gym import KokoReacherEnv from glfw import get_framebuffer_size import random import numpy as np #Make reacher env instance reacher = KokoReacherEnv() reacher.reset_model() #Set the viewer width, height = get_framebuffer_size(reacher.viewer.window) reacher.viewer_setup(camera_type='global_cam', camera_selec...
[ "numpy.sin", "glfw.get_framebuffer_size", "koko_gym.KokoReacherEnv" ]
[((145, 161), 'koko_gym.KokoReacherEnv', 'KokoReacherEnv', ([], {}), '()\n', (159, 161), False, 'from koko_gym import KokoReacherEnv\n'), ((217, 260), 'glfw.get_framebuffer_size', 'get_framebuffer_size', (['reacher.viewer.window'], {}), '(reacher.viewer.window)\n', (237, 260), False, 'from glfw import get_framebuffer_s...
import gym import torch import tensorboardX from agents import TD3 import argparse import os import utils import numpy as np def main(args): env = gym.make(args['env_name']) device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') action_dim = env.action_space.shape[0] max_action = en...
[ "os.path.exists", "agents.TD3", "utils.init_state", "argparse.ArgumentParser", "utils.carRace_action_to_output", "utils.carRace_output_to_action", "numpy.append", "torch.cuda.is_available", "utils.preprocess", "os.mkdir", "gym.make" ]
[((153, 179), 'gym.make', 'gym.make', (["args['env_name']"], {}), "(args['env_name'])\n", (161, 179), False, 'import gym\n'), ((402, 454), 'agents.TD3', 'TD3', (['args', 'action_dim', 'max_action', 'state_dim', 'device'], {}), '(args, action_dim, max_action, state_dim, device)\n', (405, 454), False, 'from agents import...
import numpy as np #initalize parameters #layer_dims = katmanların nöron sayılarını tutan liste (özellikler dahil) def initilaize_parameters(layer_dims): np.random.seed(1) parameters = {} L = len(layer_dims) for l in range(1,L): #np.sqrt(layer_dims[l-1]) sayesinde W parametresini daha küçük sa...
[ "numpy.sqrt", "numpy.log", "numpy.squeeze", "numpy.exp", "numpy.array", "numpy.dot", "numpy.zeros", "numpy.sum", "numpy.random.seed", "numpy.maximum", "numpy.random.randn", "numpy.divide" ]
[((159, 176), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (173, 176), True, 'import numpy as np\n'), ((1002, 1018), 'numpy.maximum', 'np.maximum', (['(0)', 'Z'], {}), '(0, Z)\n', (1012, 1018), True, 'import numpy as np\n'), ((2110, 2126), 'numpy.squeeze', 'np.squeeze', (['cost'], {}), '(cost)\n', (21...
# Sample player class (for tests) import numpy as np class BasePlayer: def __init__(self, train_mode): """ :param train_mode: bool """ raise NotImplementedError def start(self, state, valid_actions): """ :param state: np.array :param valid_actions: np.a...
[ "numpy.random.choice", "IPython.display.display", "numpy.random.random", "IPython.display.clear_output" ]
[((1124, 1155), 'numpy.random.choice', 'np.random.choice', (['valid_actions'], {}), '(valid_actions)\n', (1140, 1155), True, 'import numpy as np\n'), ((1222, 1253), 'numpy.random.choice', 'np.random.choice', (['valid_actions'], {}), '(valid_actions)\n', (1238, 1253), True, 'import numpy as np\n'), ((2089, 2103), 'IPyth...
import argparse import array import math import wave import time import matplotlib.pyplot as plt import numpy import pywt from scipy import signal class beats_per_minute: def __init__(self, filename): self.filename = filename self.initiate_bpm_calculations() def initiate_bpm_calculations(se...
[ "pywt.dwt", "numpy.mean", "wave.open", "numpy.median", "math.floor", "numpy.where", "numpy.zeros", "numpy.correlate", "scipy.signal.lfilter" ]
[((646, 679), 'math.floor', 'math.floor', (['(nsamps / window_samps)'], {}), '(nsamps / window_samps)\n', (656, 679), False, 'import math\n'), ((695, 722), 'numpy.zeros', 'numpy.zeros', (['max_window_ndx'], {}), '(max_window_ndx)\n', (706, 722), False, 'import numpy\n'), ((2526, 2554), 'numpy.where', 'numpy.where', (['...
# coding:utf-8 import os import gc import numpy as np import pandas as pd from keras.models import Sequential from keras.callbacks import EarlyStopping from keras.layers import Conv2D, MaxPool2D, Flatten, Dense np.random.seed(7) pd.set_option("max_rows", None) pd.set_option("max_columns", None) class LeNet(object): ...
[ "keras.layers.Conv2D", "keras.layers.Flatten", "os.path.join", "pandas.set_option", "numpy.random.seed", "gc.collect", "keras.callbacks.EarlyStopping", "keras.layers.Dense", "keras.layers.MaxPool2D" ]
[((212, 229), 'numpy.random.seed', 'np.random.seed', (['(7)'], {}), '(7)\n', (226, 229), True, 'import numpy as np\n'), ((230, 261), 'pandas.set_option', 'pd.set_option', (['"""max_rows"""', 'None'], {}), "('max_rows', None)\n", (243, 261), True, 'import pandas as pd\n'), ((262, 296), 'pandas.set_option', 'pd.set_optio...
import numpy as np import pandas as pd from models.utility import get_precn from sklearn.metrics import roc_auc_score from sklearn.neighbors import NearestNeighbors from sklearn.neighbors import LocalOutlierFactor from sklearn.svm import OneClassSVM from sklearn.ensemble import IsolationForest from PyNomaly import loop...
[ "numpy.mean", "numpy.median", "PyNomaly.loop.LocalOutlierProbability", "sklearn.ensemble.IsolationForest", "models.hbos.Hbos", "sklearn.metrics.roc_auc_score", "sklearn.neighbors.LocalOutlierFactor", "sklearn.neighbors.NearestNeighbors", "pandas.DataFrame", "sklearn.svm.OneClassSVM", "models.uti...
[((619, 637), 'sklearn.neighbors.NearestNeighbors', 'NearestNeighbors', ([], {}), '()\n', (635, 637), False, 'from sklearn.neighbors import NearestNeighbors\n'), ((1992, 2007), 'pandas.DataFrame', 'pd.DataFrame', (['X'], {}), '(X)\n', (2004, 2007), True, 'import pandas as pd\n'), ((772, 795), 'numpy.mean', 'np.mean', (...
import numpy as np from gym import utils from math import pi,sin,cos import numpy as np from rllab.misc import autoargs from rllab.core.serializable import Serializable from rllab.envs.base import Step from rllab.envs.mujoco.mujoco_env import MujocoEnv from rllab.misc import logger from rllab.misc.overrides import ov...
[ "rllab.core.serializable.Serializable.__init__", "numpy.mean", "numpy.clip", "numpy.std", "CPG_core.math.transformation.euler_from_quaternion", "CPG_core.controllers.CPG_controller_quadruped_sin.CPG_network", "numpy.min", "numpy.max", "math.cos", "numpy.array", "CPG_core.PID_controller.PID_contr...
[((706, 1635), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, \n 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0,\n 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0], [0.0, 1.0, 0.0,\n 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0...
import os import sys import pytest import numpy as np from numpy.testing import assert_allclose from empymod import filters def test_digitalfilter(): # 1.a DigitalFilter # Assure a DigitalFilter has attribute 'name'. out1 = filters.DigitalFilter('test') out2 = filters.Di...
[ "empymod.filters.DigitalFilter", "numpy.average", "numpy.testing.assert_allclose", "os.path.join", "empymod.filters.wer_201_2018", "pytest.mark.skipif" ]
[((671, 768), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(sys.version_info < (3, 6))'], {'reason': '"""tmpdir seems to fail for Python<3.6."""'}), "(sys.version_info < (3, 6), reason=\n 'tmpdir seems to fail for Python<3.6.')\n", (689, 768), False, 'import pytest\n'), ((269, 298), 'empymod.filters.DigitalFilter'...
# -*- coding: utf-8 -*- """ Created on Sun Aug 21 10:18:52 2016 @author: PM5 Module of functions specific to ROMS. """ import netCDF4 as nc import numpy as np def get_basic_info(fn, only_G=False, only_S=False, only_T=False): """ Gets grid, vertical coordinate, and time info from a ROMS NetCDF history file ...
[ "datetime.datetime", "numpy.atleast_2d", "numpy.tile", "netCDF4.MFDataset", "netCDF4.Dataset", "numpy.tanh", "numpy.sinh", "numpy.exp", "shutil.copyfile", "numpy.linspace", "re.finditer", "numpy.cosh", "numpy.shape" ]
[((535, 554), 'netCDF4.Dataset', 'nc.Dataset', (['fn', '"""r"""'], {}), "(fn, 'r')\n", (545, 554), True, 'import netCDF4 as nc\n'), ((3794, 3810), 'numpy.atleast_2d', 'np.atleast_2d', (['h'], {}), '(h)\n', (3807, 3810), True, 'import numpy as np\n'), ((3822, 3841), 'numpy.atleast_2d', 'np.atleast_2d', (['zeta'], {}), '...
import pandas as pd import scipy as sp import numpy as np import warnings class PartitionExplainer(): def __init__(self, model, masker, clustering): """ Uses the Partition SHAP method to explain the output of any function. Partition SHAP computes Shapley values recursively through a hierarchy...
[ "numpy.abs", "numpy.ones", "numpy.invert", "numpy.zeros", "warnings.warn" ]
[((4964, 5055), 'numpy.zeros', 'np.zeros', (['(2 * cluster_matrix.shape[0] + 1, cluster_matrix.shape[0] + 1)'], {'dtype': 'np.bool'}), '((2 * cluster_matrix.shape[0] + 1, cluster_matrix.shape[0] + 1),\n dtype=np.bool)\n', (4972, 5055), True, 'import numpy as np\n'), ((2498, 2589), 'warnings.warn', 'warnings.warn', (...
import numpy as np import pandas as pd import quaternion import scipy.interpolate from tensorflow.keras.utils import Sequence from scipy.spatial.transform import Rotation def interpolate_3dvector_linear(input, input_timestamp, output_timestamp): assert input.shape[0] == input_timestamp.shape[0] func = scipy....
[ "numpy.arccos", "pandas.read_csv", "numpy.absolute", "numpy.zeros", "numpy.arctan2", "numpy.linalg.norm" ]
[((1433, 1464), 'numpy.linalg.norm', 'np.linalg.norm', (['point_cartesian'], {}), '(point_cartesian)\n', (1447, 1464), True, 'import numpy as np\n'), ((518, 548), 'pandas.read_csv', 'pd.read_csv', (['imu_data_filename'], {}), '(imu_data_filename)\n', (529, 548), True, 'import pandas as pd\n'), ((974, 991), 'numpy.absol...
# This file is part of PSL-Python. # Copyright (c) 2021, <NAME> <<EMAIL>> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright noti...
[ "numpy.eye", "unified_camera.unified_camera", "os.path.join", "numpy.array", "numpy.dot", "numpy.empty", "cv2.imread" ]
[((1624, 1654), 'os.path.join', 'os.path.join', (['self.ds_path', 'fn'], {}), '(self.ds_path, fn)\n', (1636, 1654), False, 'import os\n'), ((2668, 2698), 'os.path.join', 'os.path.join', (['self.ds_path', 'fn'], {}), '(self.ds_path, fn)\n', (2680, 2698), False, 'import os\n'), ((3306, 3317), 'numpy.array', 'np.array', (...
"""temps vs high and low""" import numpy as np from pandas.io.sql import read_sql from pyiem.network import Table as NetworkTable from pyiem.plot.use_agg import plt from pyiem.util import get_autoplot_context, get_dbconn def get_description(): """ Return a dict describing how to call this plotter """ desc = ...
[ "pyiem.network.Table", "pandas.io.sql.read_sql", "pyiem.util.get_dbconn", "numpy.arange", "pyiem.plot.use_agg.plt.subplots" ]
[((871, 889), 'pyiem.util.get_dbconn', 'get_dbconn', (['"""coop"""'], {}), "('coop')\n", (881, 889), False, 'from pyiem.util import get_autoplot_context, get_dbconn\n'), ((1036, 1078), 'pyiem.network.Table', 'NetworkTable', (["('%sCLIMATE' % (station[:2],))"], {}), "('%sCLIMATE' % (station[:2],))\n", (1048, 1078), True...
import unittest from datasetio.datasetwriter import DatasetWriter import h5py import os import numpy as np import string import random class TestDatasetWriter(unittest.TestCase): def setUp(self): self.feat_length = 10 self.seq_length = 20 self.buffer_size = 5 self.num_rows = 100 ...
[ "random.choice", "numpy.random.rand", "datasetio.datasetwriter.DatasetWriter", "h5py.File", "numpy.random.randint", "numpy.zeros", "numpy.array_equal", "h5py.string_dtype", "unittest.main", "os.remove" ]
[((3731, 3746), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3744, 3746), False, 'import unittest\n'), ((523, 618), 'datasetio.datasetwriter.DatasetWriter', 'DatasetWriter', (['"""test"""', 'self.num_rows', 'self.dtypes', 'self.dataset_file_path', 'self.buffer_size'], {}), "('test', self.num_rows, self.dtypes, ...
#!/bin/python2 from __future__ import print_function from gensim.parsing.preprocessing import strip_non_alphanum, preprocess_string from gensim.corpora.dictionary import Dictionary from keras.models import load_model import numpy as np import os import subprocess try: input = raw_input except NameError: pass t...
[ "os.listdir", "keras.models.load_model", "gensim.corpora.dictionary.Dictionary.load", "gensim.parsing.preprocessing.preprocess_string", "subprocess.Popen", "numpy.array" ]
[((905, 957), 'gensim.corpora.dictionary.Dictionary.load', 'Dictionary.load', (['"""SentimentAnalysis/vocab_sentiment"""'], {}), "('SentimentAnalysis/vocab_sentiment')\n", (920, 957), False, 'from gensim.corpora.dictionary import Dictionary\n'), ((336, 379), 'keras.models.load_model', 'load_model', (['"""SentimentAnaly...
#!/usr/bin/env python """ @author <NAME> """ import roboticstoolbox as rp import numpy as np from roboticstoolbox.backends.Connector import Connector from roboticstoolbox.backends.PyPlot.RobotPlot2 import RobotPlot2 from roboticstoolbox.backends.PyPlot.EllipsePlot import EllipsePlot _mpl = False try: import matp...
[ "numpy.round", "matplotlib.pyplot.ioff", "matplotlib.pyplot.style.use", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "roboticstoolbox.backends.PyPlot.RobotPlot2.RobotPlot2", "matplotlib.pyplot.ion", "matplotlib.pyplot.rc", "matplotlib.pyplot.show" ]
[((498, 521), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (511, 521), True, 'import matplotlib.pyplot as plt\n'), ((761, 807), 'matplotlib.pyplot.rc', 'plt.rc', (['"""grid"""'], {'linestyle': '"""-"""', 'color': '"""#dbdbdb"""'}), "('grid', linestyle='-', color='#dbdbdb')\n",...
from tensorflow.python.ops import math_ops from tensorflow.python.framework import ops from tensorflow import keras from tensorflow.keras import backend as K import numpy as np import pickle as pkl def top3_acc(labels, logits): return keras.metrics.sparse_top_k_categorical_accuracy(y_true=labels, y_pred=logits, k...
[ "tensorflow.keras.metrics.sparse_top_k_categorical_accuracy", "tensorflow.keras.backend.get_value", "tensorflow.keras.backend.set_value", "numpy.where" ]
[((241, 328), 'tensorflow.keras.metrics.sparse_top_k_categorical_accuracy', 'keras.metrics.sparse_top_k_categorical_accuracy', ([], {'y_true': 'labels', 'y_pred': 'logits', 'k': '(3)'}), '(y_true=labels, y_pred=\n logits, k=3)\n', (288, 328), False, 'from tensorflow import keras\n'), ((367, 454), 'tensorflow.keras.m...
# vim: expandtab:ts=4:sw=4 import numpy as np import cv2 def crop_to_shape(images, patch_shape): """Crop images to desired shape, respecting the target aspect ratio. Parameters ---------- images : List[ndarray] A list of images in BGR format (dtype np.uint8) patch_shape : (int, int) ...
[ "numpy.unique", "numpy.logical_and", "numpy.where", "numpy.logical_not", "numpy.asarray", "numpy.logical_or", "cv2.resize", "numpy.zeros_like", "numpy.random.RandomState" ]
[((2386, 2403), 'numpy.unique', 'np.unique', (['data_y'], {}), '(data_y)\n', (2395, 2403), True, 'import numpy as np\n'), ((2537, 2569), 'numpy.random.RandomState', 'np.random.RandomState', ([], {'seed': 'seed'}), '(seed=seed)\n', (2558, 2569), True, 'import numpy as np\n'), ((2843, 2874), 'numpy.logical_not', 'np.logi...
""" Support for STATS data files. STATS binary file structure =========================== A stats binary output files begins with a stats_hdt_t structure:: typedef struct { (unsigned short header_size /* bytes, may or may not be there */ unsigned short spcid; /* station id - 10, 40, 60, 21 */...
[ "time.ctime", "DatesTimes.VSR_to_timetuple", "Data_Reduction.get_binary_record", "DatesTimes.timestamp_to_str_with_ms", "time.strftime", "DatesTimes.VSR_tuple_to_timestamp", "numpy.array", "glob.glob" ]
[((10419, 10498), 'Data_Reduction.get_binary_record', 'DRDSN.get_binary_record', (['fd', 'header_size', 'DRDSN.STATS_binary_record_size', 'index'], {}), '(fd, header_size, DRDSN.STATS_binary_record_size, index)\n', (10442, 10498), True, 'import Data_Reduction as DRDSN\n'), ((12245, 12284), 'DatesTimes.VSR_tuple_to_time...
import sys sys.path.insert(0, '/share/data/vision-greg2/xdu/pixel2style2pixel') import torch import clip # from datasets import images_dataset # from datasets.images_dataset import ImagesDataset, LSUNImagesDataset # from training.coach import Coach # from argparse import ArgumentParser # from configs.paths_config impor...
[ "sys.path.insert", "numpy.linalg.norm", "torch.nn.AvgPool2d", "torch.nn.functional.softmax", "numpy.empty", "clip.tokenize", "torch.randn", "torch.argmax", "torch.topk", "scipy.spatial.distance_matrix", "streamlit.write", "torch.randn_like", "torch.nn.Upsample", "utils.common.tensor2im", ...
[((11, 79), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/share/data/vision-greg2/xdu/pixel2style2pixel"""'], {}), "(0, '/share/data/vision-greg2/xdu/pixel2style2pixel')\n", (26, 79), False, 'import sys\n'), ((11490, 11523), 'torch.topk', 'torch.topk', (['NN_mat', 'num_nn'], {'dim': '(1)'}), '(NN_mat, num_nn, dim...
"""describes spectrally dependent data spectral_data implements the abstract base class SpectralData which defines a material parameter which has a spectral dependence (e.g. refractive index, permittivity). Each of the subclasses must implement the evaluate method which returns the material parameter for a given Spect...
[ "numpy.abs", "numpy.sqrt", "numpy.ones", "numpy.power", "numpy.log", "numpy.max", "numpy.geomspace", "numpy.array", "scipy.interpolate.interp1d", "scipy.interpolate.splrep", "numpy.arctan2", "scipy.interpolate.splev", "numpy.min", "dispersion.io._numeric_to_string_table", "dispersion.spe...
[((2137, 2198), 'dispersion.spectrum.Spectrum', 'Spectrum', (['valid_range'], {'spectrum_type': 'spectrum_type', 'unit': 'unit'}), '(valid_range, spectrum_type=spectrum_type, unit=unit)\n', (2145, 2198), False, 'from dispersion.spectrum import Spectrum\n'), ((2424, 2455), 'numpy.min', 'np.min', (['self.valid_range.valu...
import numpy as np from src.PARAMATERS import img_dir, project_dir, s2 from src.utils.utils import create_f from src.visualization import visualise_function f_param_dir = project_dir / 'data' / 'synthetic' / 'mog_datasets' / 'mog_f' if __name__ == '__main__': # Load saved function parameters x_is = np.load(f...
[ "src.visualization.visualise_function", "numpy.load", "src.utils.utils.create_f" ]
[((311, 344), 'numpy.load', 'np.load', (["(f_param_dir / 'x_is.npy')"], {}), "(f_param_dir / 'x_is.npy')\n", (318, 344), True, 'import numpy as np\n'), ((360, 397), 'numpy.load', 'np.load', (["(f_param_dir / 'alpha_is.npy')"], {}), "(f_param_dir / 'alpha_is.npy')\n", (367, 397), True, 'import numpy as np\n'), ((438, 46...
import cv2 import numpy as np import matplotlib.pyplot as plt def create_thresholded_binary_image(img, thresh_min = 20, thresh_max = 100, s_thresh_min = 170, s_thresh_max = 255): # Convert to HLS color space and separate the S channel hls = cv2.cvtColor(img, cv2.COLOR_RGB2HLS) s_channel = hls[:, :, 2] ...
[ "numpy.absolute", "numpy.max", "cv2.cvtColor", "numpy.zeros_like", "matplotlib.pyplot.subplots", "cv2.Sobel", "matplotlib.pyplot.show" ]
[((250, 286), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_RGB2HLS'], {}), '(img, cv2.COLOR_RGB2HLS)\n', (262, 286), False, 'import cv2\n'), ((349, 386), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_RGB2GRAY'], {}), '(img, cv2.COLOR_RGB2GRAY)\n', (361, 386), False, 'import cv2\n'), ((414, 447), 'cv2.Sobel...
import numpy as np from scipy.sparse import coo_matrix from scipy.sparse.linalg import norm def prepare_input(y, X, end_time): y0, y1 = y[np.isnan(y[:, 1])], y[~np.isnan(y[:, 1])] x0, x1 = X[np.isnan(y[:, 1])], X[~np.isnan(y[:, 1])] diagonal0, diagonal1 = coo_matrix((y0.shape[0], y0.shape[0])), coo_matr...
[ "numpy.ones", "numpy.zeros", "numpy.isnan", "scipy.sparse.linalg.norm", "scipy.sparse.coo_matrix" ]
[((745, 758), 'numpy.zeros', 'np.zeros', (['mod'], {}), '(mod)\n', (753, 758), True, 'import numpy as np\n'), ((272, 310), 'scipy.sparse.coo_matrix', 'coo_matrix', (['(y0.shape[0], y0.shape[0])'], {}), '((y0.shape[0], y0.shape[0]))\n', (282, 310), False, 'from scipy.sparse import coo_matrix\n'), ((312, 350), 'scipy.spa...
import numpy def generateRandomImageWithParametersLike(baseImage): embedImage = numpy.random.random(baseImage.shape) * 255 embedImage = embedImage.astype('uint8') return embedImage
[ "numpy.random.random" ]
[((86, 122), 'numpy.random.random', 'numpy.random.random', (['baseImage.shape'], {}), '(baseImage.shape)\n', (105, 122), False, 'import numpy\n')]
import numpy as np import pytest import unittest from sdia_python.lab2.box_window import BoxWindow, UnitBoxWindow def test_raise_type_error_when_something_is_called(): with pytest.raises(TypeError): # call_something_that_raises_TypeError() raise TypeError() #checks the str function for the box_...
[ "numpy.array", "sdia_python.lab2.box_window.BoxWindow", "sdia_python.lab2.box_window.UnitBoxWindow", "pytest.raises" ]
[((1643, 1660), 'sdia_python.lab2.box_window.BoxWindow', 'BoxWindow', (['bounds'], {}), '(bounds)\n', (1652, 1660), False, 'from sdia_python.lab2.box_window import BoxWindow, UnitBoxWindow\n'), ((2193, 2210), 'sdia_python.lab2.box_window.BoxWindow', 'BoxWindow', (['bounds'], {}), '(bounds)\n', (2202, 2210), False, 'fro...
import numpy as np def binary_classification_metrics(prediction, ground_truth): precision = 0 recall = 0 accuracy = 0 f1 = 0 f_n = 0 t_n = 0 f_p = 0 t_p = 0 for i in range(len(ground_truth)): if prediction[i] == ground_truth[i]: if prediction[i] == 1: ...
[ "numpy.sum" ]
[((850, 884), 'numpy.sum', 'np.sum', (['(prediction == ground_truth)'], {}), '(prediction == ground_truth)\n', (856, 884), True, 'import numpy as np\n')]
# -*- coding: UTF-8 -*- import os import cv2 import numpy as np import time import labels import tensorflow as tf #model_path = "./model/quantize_frozen_graph.tflite" model_path = "./mobilenet_v2_1.4_224.tflite" def load_model(inputData): # Load TFLite model and allocate tensors. interpreter = tf.lite.Interp...
[ "tensorflow.lite.Interpreter", "numpy.multiply", "numpy.max", "numpy.array", "cv2.cvtColor", "cv2.resize", "time.time", "cv2.imread" ]
[((306, 348), 'tensorflow.lite.Interpreter', 'tf.lite.Interpreter', ([], {'model_path': 'model_path'}), '(model_path=model_path)\n', (325, 348), True, 'import tensorflow as tf\n'), ((637, 648), 'time.time', 'time.time', ([], {}), '()\n', (646, 648), False, 'import time\n'), ((695, 706), 'time.time', 'time.time', ([], {...
#DeepForest bird detection from extracted Zooniverse predictions from pytorch_lightning.loggers import CometLogger from deepforest.callbacks import images_callback from deepforest import visualize from deepforest import main import traceback import geopandas as gp from shapely.geometry import Point, box import pandas a...
[ "numpy.unique", "geopandas.read_file", "pandas.read_csv", "pathlib.Path", "rasterio.open", "os.path.join", "shapely.geometry.Point", "numpy.random.seed", "os.path.basename", "pandas.concat" ]
[((966, 989), 'geopandas.read_file', 'gp.read_file', (['shapefile'], {}), '(shapefile)\n', (978, 989), True, 'import geopandas as gp\n'), ((2021, 2047), 'os.path.basename', 'os.path.basename', (['rgb_path'], {}), '(rgb_path)\n', (2037, 2047), False, 'import os\n'), ((3447, 3469), 'pandas.concat', 'pd.concat', (['annota...
import os from os import listdir, makedirs from os.path import join import pickle import cv2 import matplotlib.pyplot as plt import numpy as np # from moviepy.video.io.ImageSequenceClip import ImageSequenceClip import src.data.constants as c import src.data.utils.utils as utils BLOCK_SIZE = 5 C = 14 DIR = c.RAW_DA...
[ "matplotlib.pyplot.imshow", "cv2.imwrite", "os.listdir", "matplotlib.pyplot.savefig", "cv2.normalize", "matplotlib.pyplot.title", "cv2.threshold", "os.path.join", "cv2.medianBlur", "src.data.utils.utils.setcwd", "matplotlib.pyplot.figure", "cv2.destroyAllWindows", "matplotlib.pyplot.axis", ...
[((391, 418), 'os.path.join', 'join', (['c.DATA_DIR', 'c.IMG_DIR'], {}), '(c.DATA_DIR, c.IMG_DIR)\n', (395, 418), False, 'from os.path import join\n'), ((2415, 2438), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (2436, 2438), False, 'import cv2\n'), ((4377, 4400), 'cv2.destroyAllWindows', 'cv2.de...
import numpy as np import matplotlib.pyplot as plt # input u = 40 # initial velocity in m/s g = 9.81 # gravitational acceleration m/s^2 theta1 = 45 # angle of projectile theta2 = 60 # angle of projectile ux1 = u*np.cos(theta1*np.pi/180) # velocity in x direction uy1 = u*np.sin(theta1*np.pi/180) # velocity in y direc...
[ "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "numpy.linspace", "matplotlib.pyplot.figure", "numpy.cos", "numpy.sin", "matplotlib.pyplot.title", "matplotlib.pyplot.margins", "matplotlib.pyplot.show" ]
[((493, 523), 'numpy.linspace', 'np.linspace', (['(0)', 't_total_1', '(100)'], {}), '(0, t_total_1, 100)\n', (504, 523), True, 'import numpy as np\n'), ((527, 557), 'numpy.linspace', 'np.linspace', (['(0)', 't_total_2', '(100)'], {}), '(0, t_total_2, 100)\n', (538, 557), True, 'import numpy as np\n'), ((638, 665), 'mat...
from click.testing import CliRunner import rasterio as rio import numpy as np from rio_rgbify.scripts.cli import rgbify import click from tempfile import mkdtemp from shutil import rmtree import os from raster_tester.compare import affaux, upsample_array class TestingDir: def __init__(self): self.tmpdir ...
[ "os.path.getsize", "raster_tester.compare.affaux", "rasterio.open", "os.path.join", "numpy.any", "click.testing.CliRunner", "numpy.sum", "tempfile.mkdtemp", "shutil.rmtree", "raster_tester.compare.upsample_array" ]
[((643, 659), 'raster_tester.compare.affaux', 'affaux', (['upsample'], {}), '(upsample)\n', (649, 659), False, 'from raster_tester.compare import affaux, upsample_array\n'), ((669, 711), 'raster_tester.compare.upsample_array', 'upsample_array', (['r1', 'upsample', 'frAff', 'toAff'], {}), '(r1, upsample, frAff, toAff)\n...
import numpy as np def get_phaselc(t, p, data, v_num): return 1.+p.amp1[v_num]*np.cos(2.*np.pi*(t-p.theta1[v_num])/p.per[v_num]) + p.amp2[v_num]*np.cos(4.*np.pi*(t-p.theta2[v_num])/p.per[v_num])
[ "numpy.cos" ]
[((147, 205), 'numpy.cos', 'np.cos', (['(4.0 * np.pi * (t - p.theta2[v_num]) / p.per[v_num])'], {}), '(4.0 * np.pi * (t - p.theta2[v_num]) / p.per[v_num])\n', (153, 205), True, 'import numpy as np\n'), ((81, 139), 'numpy.cos', 'np.cos', (['(2.0 * np.pi * (t - p.theta1[v_num]) / p.per[v_num])'], {}), '(2.0 * np.pi * (t ...
import keras # import keras_retinanet from keras_retinanet import models from keras_retinanet.utils.image import read_image_bgr, preprocess_image, resize_image from keras_retinanet.utils.visualization import draw_box, draw_caption from keras_retinanet.utils.colors import label_color # import miscellaneous modules imp...
[ "os.path.exists", "tensorflow.Session", "tqdm.tqdm", "os.path.join", "keras_retinanet.models.load_model", "keras_retinanet.utils.image.resize_image", "keras_retinanet.utils.colors.label_color", "os.mkdir", "numpy.expand_dims", "keras_retinanet.utils.visualization.draw_caption", "keras_retinanet....
[((1141, 1196), 'keras_retinanet.models.load_model', 'models.load_model', (['model_path'], {'backbone_name': '"""resnet50"""'}), "(model_path, backbone_name='resnet50')\n", (1158, 1196), False, 'from keras_retinanet import models\n'), ((554, 570), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (568, 570)...
import sys import csv import datetime import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.colors as mcolors from matplotlib.ticker import MultipleLocator, FormatStrFormatter, AutoMinorLocator import numpy as np import os import argparse import json kbps = [1410237, 3720740, 696126...
[ "datetime.datetime.utcfromtimestamp", "numpy.array", "sys.exit", "os.walk", "os.path.exists", "argparse.ArgumentParser", "os.path.split", "os.mkdir", "csv.reader", "matplotlib.pyplot.savefig", "matplotlib.use", "matplotlib.colors.TABLEAU_COLORS.keys", "matplotlib.ticker.FormatStrFormatter", ...
[((56, 77), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (70, 77), False, 'import matplotlib\n'), ((1051, 1070), 'numpy.array', 'np.array', (['cwnd_info'], {}), '(cwnd_info)\n', (1059, 1070), True, 'import numpy as np\n'), ((1190, 1212), 'numpy.array', 'np.array', (['quality_info'], {}), '(qual...
import pandas as pd import numpy as np import seaborn as sns from matplotlib import gridspec import matplotlib.pyplot as plt from sklearn.manifold import TSNE from drosoph_vae.data_loading import get_3d_columns_names from drosoph_vae.settings import config, skeleton from drosoph_vae.settings.config import SetupConfig ...
[ "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel", "seaborn.scatterplot", "numpy.arange", "seaborn.color_palette", "seaborn.distplot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "sklearn.manifold.TSNE", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.scatter", "pandas.DataFram...
[((2406, 2459), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(3)', '(2 * 2)'], {'sharex': '(True)', 'figsize': '(25, 10)'}), '(3, 2 * 2, sharex=True, figsize=(25, 10))\n', (2418, 2459), True, 'import matplotlib.pyplot as plt\n'), ((4338, 4356), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n',...
## # @license # Copyright 2018 AI Lab - Telkom University. 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
[ "numpy.mean", "numpy.std", "numpy.max", "numpy.sum", "skimage.color.rgb2hsv", "numpy.min" ]
[((844, 862), 'skimage.color.rgb2hsv', 'color.rgb2hsv', (['img'], {}), '(img)\n', (857, 862), False, 'from skimage import color\n'), ((1082, 1105), 'numpy.mean', 'np.mean', (['image[:, :, 0]'], {}), '(image[:, :, 0])\n', (1089, 1105), True, 'import numpy as np\n'), ((1115, 1137), 'numpy.std', 'np.std', (['image[:, :, 0...
import os, sys, time from typing import Any, List, Mapping, Optional, Sequence import numpy as np from mlir.ir import * from mlir.dialects import arith, builtin, linalg, tensor, scf, func from mlir.dialects.linalg.opdsl.lang import * from ..core.compilation import attach_inplaceable_attributes, attach_passthrough f...
[ "numpy.allclose", "mlir.dialects.linalg.FillOp", "numpy.random.rand", "os.getenv", "mlir.dialects.arith.ConstantOp", "mlir.dialects.func.ReturnOp", "numpy.dot", "mlir.dialects.linalg.matmul", "numpy.dtype", "mlir.dialects.builtin.FuncOp" ]
[((4399, 4441), 'mlir.dialects.builtin.FuncOp', 'builtin.FuncOp', (['name', '(types, [types[-1]])'], {}), '(name, (types, [types[-1]]))\n', (4413, 4441), False, 'from mlir.dialects import arith, builtin, linalg, tensor, scf, func\n'), ((9236, 9278), 'mlir.dialects.builtin.FuncOp', 'builtin.FuncOp', (['name', '(types, [...
import PIL.Image import numpy as np import torch import torchvision.transforms.functional as tvf from pytorch_nn_tools.devices import to_device imagenet_stats = dict(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) class UnNormalize_(object): def __init__(self, mean, std): sel...
[ "pytorch_nn_tools.devices.to_device", "torchvision.transforms.functional.to_pil_image", "numpy.array", "torchvision.transforms.functional.resize", "matplotlib.pyplot.subplots" ]
[((655, 697), 'torchvision.transforms.functional.to_pil_image', 'tvf.to_pil_image', (['unnormalized'], {'mode': '"""RGB"""'}), "(unnormalized, mode='RGB')\n", (671, 697), True, 'import torchvision.transforms.functional as tvf\n'), ((803, 816), 'numpy.array', 'np.array', (['img'], {}), '(img)\n', (811, 816), True, 'impo...
#!/usr/bin/env python # coding: utf-8 # # Отчет по лабораторным работам 2.2/2.3 # # ## Изучение спектров атомов водорода и молекулярного йода # <NAME>, Б01-818 # In[1]: import numpy as np import pandas as pd import matplotlib.pyplot as plt import scipy.optimize as opt from scipy import odr neon_deg = [2928., 2862...
[ "matplotlib.pyplot.grid", "numpy.sqrt", "matplotlib.pyplot.ylabel", "numpy.divide", "scipy.odr.ODR", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.round", "scipy.odr.Model", "scipy.odr.RealData", "matplotlib.pyplot.figure", "numpy.linspace", "matp...
[((1011, 1033), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {}), "('font', **font)\n", (1017, 1033), True, 'import matplotlib.pyplot as plt\n'), ((1204, 1221), 'scipy.odr.Model', 'odr.Model', (['f_spec'], {}), '(f_spec)\n', (1213, 1221), False, 'from scipy import odr\n'), ((1229, 1257), 'scipy.odr.RealData', 'od...
from typing import Any, ClassVar, Dict, Optional, Tuple, cast import kornia.augmentation as aug import numpy as np import torch import torch.nn as nn from kornia.color.hsv import hsv_to_rgb, rgb_to_hsv from .base import Augmentation class RandomShift(Augmentation): """Random shift augmentation. References:...
[ "kornia.color.hsv.rgb_to_hsv", "kornia.color.hsv.hsv_to_rgb", "kornia.augmentation.RandomRotation", "kornia.augmentation.RandomCrop", "kornia.augmentation.RandomHorizontalFlip", "numpy.random.randint", "torch.nn.ReplicationPad2d", "kornia.augmentation.RandomVerticalFlip", "kornia.augmentation.Random...
[((1876, 1908), 'kornia.augmentation.RandomErasing', 'aug.RandomErasing', ([], {'p': 'probability'}), '(p=probability)\n', (1893, 1908), True, 'import kornia.augmentation as aug\n'), ((2715, 2754), 'kornia.augmentation.RandomHorizontalFlip', 'aug.RandomHorizontalFlip', ([], {'p': 'probability'}), '(p=probability)\n', (...
from matplotlib import pyplot as plt import numpy as np lm_dict = { "brow":{ "rightUpper": [70,63,105,66,107], "rightLower": [46,53,52,65,55], "leftUpper": [336,296,334,293,300], "leftLower": [285,295,282,283,276] }, "nose":{ "dorsum":[6,197,195,5,4], "tipLower":[218,237,44,1,274,457,438]...
[ "numpy.array", "numpy.eye", "numpy.zeros" ]
[((2824, 2847), 'numpy.array', 'np.array', (['self.vertices'], {}), '(self.vertices)\n', (2832, 2847), True, 'import numpy as np\n'), ((2869, 2889), 'numpy.array', 'np.array', (['self.faces'], {}), '(self.faces)\n', (2877, 2889), True, 'import numpy as np\n'), ((2926, 2949), 'numpy.array', 'np.array', (['self.vertices'...
import os import logging import yaml import numpy as np from matplotlib import pyplot as plt # import pandas as pd # import scipy import LCTM.metrics from kinemparse import decode from mathtools import utils # , metrics # from blocks.core import blockassembly logger = logging.getLogger(__name__) def eval_metri...
[ "logging.getLogger", "numpy.log", "numpy.arange", "os.path.exists", "mathtools.utils.parse_config", "matplotlib.pyplot.close", "mathtools.utils.computeSegments", "mathtools.utils.getUniqueIds", "numpy.concatenate", "matplotlib.pyplot.subplots", "mathtools.utils.parse_args", "os.path.expanduser...
[((276, 303), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (293, 303), False, 'import logging\n'), ((844, 865), 'numpy.zeros_like', 'np.zeros_like', (['scores'], {}), '(scores)\n', (857, 865), True, 'import numpy as np\n'), ((881, 907), 'numpy.arange', 'np.arange', (['scores.shape[0]'],...
""" Copyright 2018, <NAME>, Stevens Institute of Technology 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 ...
[ "numpy.mean", "hashlib.md5", "math.cos", "collections.defaultdict", "math.sin", "re.search" ]
[((980, 997), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (991, 997), False, 'from collections import Counter, defaultdict\n'), ((5149, 5162), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (5160, 5162), False, 'import hashlib\n'), ((3726, 3741), 'math.cos', 'math.cos', (['tetha'], {}), '(tet...
from dynamic_graph import plug from dynamic_graph.sot.core.feature_generic import FeatureGeneric from dynamic_graph.sot.core.gain_adaptive import GainAdaptive from dynamic_graph.sot.core.matrix_util import matrixToTuple, rpy2tr from dynamic_graph.sot.core.meta_task_6d import toFlags from numpy import array, eye, matrix...
[ "dynamic_graph.plug", "numpy.eye", "dynamic_graph.sot.core.gain_adaptive.GainAdaptive", "dynamic_graph.sot.core.matrix_util.rpy2tr", "dynamic_graph.sot.core.feature_generic.FeatureGeneric", "dynamic_graph.sot.core.meta_task_6d.toFlags", "dynamic_graph.sot.core.matrix_util.matrixToTuple", "numpy.matrix...
[((1623, 1629), 'numpy.eye', 'eye', (['(4)'], {}), '(4)\n', (1626, 1629), False, 'from numpy import array, eye, matrix, ndarray\n'), ((2331, 2347), 'dynamic_graph.sot.core.matrix_util.matrixToTuple', 'matrixToTuple', (['M'], {}), '(M)\n', (2344, 2347), False, 'from dynamic_graph.sot.core.matrix_util import matrixToTupl...
"""Explainable Boosting Machines (EBM), implementation of GA2M""" import datatable as dt import numpy as np import logging from h2oaicore.models import CustomModel from sklearn.preprocessing import LabelEncoder from h2oaicore.systemutils import physical_cores_count class GA2MModel(CustomModel): _regression = True...
[ "sklearn.preprocessing.LabelEncoder", "numpy.random.choice", "interpret.glassbox.ExplainableBoostingClassifier", "numpy.isnan", "datatable.Frame", "datatable.isna", "interpret.glassbox.ExplainableBoostingRegressor" ]
[((5399, 5410), 'datatable.Frame', 'dt.Frame', (['X'], {}), '(X)\n', (5407, 5410), True, 'import datatable as dt\n'), ((2940, 2973), 'numpy.random.choice', 'np.random.choice', (['estimators_list'], {}), '(estimators_list)\n', (2956, 2973), True, 'import numpy as np\n'), ((3020, 3058), 'numpy.random.choice', 'np.random....
import pytest import numpy as np from fibonacci import fib, fib_numpy @pytest.mark.parametrize("f_fib", (fib, fib_numpy)) def test_random_fib(f_fib): n = np.random.randint(1, 1000) a = f_fib(n) n2 = np.random.randint(3, n) assert a[n2] == a[n2-1] + a[n2-2] def test_fail(): raise ValueError("It'...
[ "pytest.mark.parametrize", "numpy.random.randint" ]
[((75, 125), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""f_fib"""', '(fib, fib_numpy)'], {}), "('f_fib', (fib, fib_numpy))\n", (98, 125), False, 'import pytest\n'), ((162, 188), 'numpy.random.randint', 'np.random.randint', (['(1)', '(1000)'], {}), '(1, 1000)\n', (179, 188), True, 'import numpy as np\n')...
# -*- coding: utf-8 -*- """ Author: @gabvaztor StartDate: 04/03/2017 With this class you can import a lot of labeled data like Kaggle problems. - This class not preprocessed de data reducing noise. To select the csv reader we have followed the following benchmark: http://softwarerecs.stackexchange.com/questions/7463...
[ "src.utils.UtilsFunctions.save_numpy_arrays_generic", "pandas.read_csv", "sklearn.model_selection.train_test_split", "numpy.where", "numpy.asarray", "src.utils.UtilsFunctions.save_submission_to_csv", "os.path.join", "os.path.splitext", "collections.Counter", "os.path.dirname", "numpy.zeros", "...
[((6251, 6275), 'numpy.asarray', 'np.asarray', (['self.x_train'], {}), '(self.x_train)\n', (6261, 6275), True, 'import numpy as np\n'), ((6299, 6323), 'numpy.asarray', 'np.asarray', (['self.y_train'], {}), '(self.y_train)\n', (6309, 6323), True, 'import numpy as np\n'), ((6346, 6369), 'numpy.asarray', 'np.asarray', (['...
""" query a set of images and then scroll through them to inspect image quality """ import os import datetime import numpy as np from chmap.settings.app import App import chmap.database.db_classes as db_class import chmap.database.db_funs as db_funs import chmap.utilities.datatypes.datatypes as psi_d_types import matp...
[ "datetime.datetime", "chmap.database.db_funs.query_hist", "chmap.utilities.datatypes.datatypes.binary_to_hist", "chmap.utilities.datatypes.datatypes.read_los_image", "chmap.database.db_funs.init_db_conn_old", "matplotlib.pyplot.waitforbuttonpress", "matplotlib.pyplot.grid", "os.path.join", "matplotl...
[((470, 508), 'datetime.datetime', 'datetime.datetime', (['(2007)', '(1)', '(1)', '(0)', '(0)', '(0)'], {}), '(2007, 1, 1, 0, 0, 0)\n', (487, 508), False, 'import datetime\n'), ((526, 564), 'datetime.datetime', 'datetime.datetime', (['(2007)', '(3)', '(5)', '(0)', '(0)', '(0)'], {}), '(2007, 3, 5, 0, 0, 0)\n', (543, 56...
import os import re import numpy as np import trimesh def save_mesh(mesh, save_path): if isinstance(mesh.visual, trimesh.visual.texture.TextureVisuals): save_path = os.path.join(os.path.dirname(save_path), os.path.basename(os.path.splitext(save_path)[0]), ...
[ "trimesh.exchange.export.export_mesh", "numpy.unique", "os.makedirs", "trimesh.load_mesh", "numpy.hstack", "numpy.ones", "os.path.join", "os.path.splitext", "os.path.dirname", "numpy.sum", "numpy.array", "numpy.zeros", "numpy.vstack", "trimesh.Trimesh", "os.path.basename", "numpy.linsp...
[((429, 481), 'trimesh.exchange.export.export_mesh', 'trimesh.exchange.export.export_mesh', (['mesh', 'save_path'], {}), '(mesh, save_path)\n', (464, 481), False, 'import trimesh\n'), ((533, 556), 'trimesh.load_mesh', 'trimesh.load_mesh', (['path'], {}), '(path)\n', (550, 556), False, 'import trimesh\n'), ((382, 408), ...
import urwid import urwid.html_fragment from pprint import pformat import numpy import sys import os.path import csv import yaml import math import copy import datetime import json from panwid import DataTable, DataTableColumn from hypermax.hyperparameter import Hyperparameter def makeMountedFrame(widget, header): ...
[ "csv.DictWriter", "math.sqrt", "urwid.SimpleFocusListWalker", "copy.deepcopy", "numpy.arange", "urwid.Columns", "json.dumps", "urwid.Pile", "urwid.ExitMainLoop", "panwid.DataTableColumn", "hypermax.hyperparameter.Hyperparameter", "yaml.dump", "urwid.raw_display.Screen", "urwid.Filler", "...
[((16635, 16661), 'urwid.raw_display.Screen', 'urwid.raw_display.Screen', ([], {}), '()\n', (16659, 16661), False, 'import urwid\n'), ((28178, 28221), 'urwid.Pile', 'urwid.Pile', (['[(2, bottomButtons), graphArea]'], {}), '([(2, bottomButtons), graphArea])\n', (28188, 28221), False, 'import urwid\n'), ((28557, 28646), ...
#!/usr/bin/python3 import tkinter as tk from tkinter import ttk from prettytable import PrettyTable from prettytable import ALL import numpy as np import scipy.linalg as lg from time import sleep # Dummy value, real values used cannot be greater than this one MAXIMAL_COST = 10000000000 # Must be LESS than MAXIMAL_CO...
[ "prettytable.PrettyTable", "tkinter.IntVar", "tkinter.Entry", "tkinter.Button", "scipy.linalg.solve", "tkinter.StringVar", "numpy.array", "tkinter.Tk", "tkinter.Scrollbar", "tkinter.Label", "tkinter.Listbox" ]
[((17936, 17943), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (17941, 17943), True, 'import tkinter as tk\n'), ((17980, 18021), 'tkinter.Label', 'tk.Label', (['root'], {'text': '"""Dos\\\\Odb"""', 'height': '(1)'}), "(root, text='Dos\\\\Odb', height=1)\n", (17988, 18021), True, 'import tkinter as tk\n'), ((495, 533), 'tki...
import numpy as np from PIL import Image from matplotlib import pyplot as plt from tempfile import TemporaryFile import pandas as pd np.random.seed(123) NUM_OF_RAW_IMAGES = 151 NUM_OF_CLASSES = 247 NUM_OF_SPECIAL_CLASSES = 19 NUM_OF_UYIR_MEI_CLASSES = 234 IMG_H_W = 65 DELIMITER = ',' RESULTANT_STORAGE_PATH = '../Im...
[ "numpy.savez", "numpy.array", "numpy.zeros", "numpy.empty", "numpy.random.seed" ]
[((136, 155), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (150, 155), True, 'import numpy as np\n'), ((828, 903), 'numpy.zeros', 'np.zeros', (['(NUM_OF_RAW_IMAGES * NUM_OF_CLASSES, IMG_H_W, IMG_H_W)'], {'dtype': 'int'}), '((NUM_OF_RAW_IMAGES * NUM_OF_CLASSES, IMG_H_W, IMG_H_W), dtype=int)\n', (83...
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2016 CNRS # 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 ...
[ "pyannote.audio.segmentation.BICSegmentation", "pyannote.metrics.segmentation.SegmentationPurity", "pyannote.audio.signal.Peak", "numpy.linspace", "numpy.random.seed", "pyannote.database.Etape", "pyannote.audio.features.yaafe.YaafeMFCC", "pyannote.metrics.segmentation.SegmentationCoverage" ]
[((1741, 1761), 'numpy.random.seed', 'np.random.seed', (['(1337)'], {}), '(1337)\n', (1755, 1761), True, 'import numpy as np\n'), ((1879, 1947), 'pyannote.audio.features.yaafe.YaafeMFCC', 'YaafeMFCC', ([], {'e': '(False)', 'De': '(False)', 'DDe': '(False)', 'coefs': '(11)', 'D': '(False)', 'DD': '(False)'}), '(e=False,...
import os import pandas as pd import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from typing import Union, Optional, List, Dict from tqdm import tqdm from .basic_predictor import BasicPredictor from .utils import inverse_preprocess_data from common_utils_dev import to_parquet, to_abs_...
[ "pandas.Series", "fire.Fire", "pandas.Timedelta", "torch.Tensor", "os.path.join", "common_utils_dev.to_abs_path", "numpy.concatenate", "pandas.DataFrame" ]
[((360, 428), 'common_utils_dev.to_abs_path', 'to_abs_path', (['__file__', '"""../../../storage/dataset/dataset/v001/train"""'], {}), "(__file__, '../../../storage/dataset/dataset/v001/train')\n", (371, 428), False, 'from common_utils_dev import to_parquet, to_abs_path\n'), ((445, 503), 'common_utils_dev.to_abs_path', ...
# 对文件和数据库数据合并载入内存 from pandas import Timedelta, DataFrame, read_csv, to_datetime from numpy import float32, polyfit, string_ from config import Config, str2array, PARAMS_TABLE_NAME, get_table_name, MINI_EPS, PARAMS_LIST from sql_mapper import SQLMapper from multiprocessing import Process def view_data(data,...
[ "config.Config.PARAMS_TEMPLATE.copy", "config.Config.device2path.keys", "config.Config.device2path.items", "sql_mapper.SQLMapper.class_init_by_config", "config.str2array", "sql_mapper.SQLMapper.select_params", "numpy.polyfit", "pandas.read_csv", "multiprocessing.Process", "pandas.Timedelta", "sq...
[((574, 597), 'config.Config.init_from_file', 'Config.init_from_file', ([], {}), '()\n', (595, 597), False, 'from config import Config, str2array, PARAMS_TABLE_NAME, get_table_name, MINI_EPS, PARAMS_LIST\n'), ((607, 658), 'sql_mapper.SQLMapper.class_init_by_config', 'SQLMapper.class_init_by_config', (['Config.mysql_con...
# -*-coding:utf-8-*- from __future__ import print_function import numpy as np import os from .rbm import RBM # 多个RBM组合类 class RbmForest: def __init__(self, num_visible, num_hidden, num_output=10, learning_rate=0.1, path=None): """ Because we only recognize 10 numbers, so the RBM_each consists of...
[ "numpy.array_split", "os.path.join", "os.mkdir", "numpy.square" ]
[((962, 999), 'os.path.join', 'os.path.join', (['self.path', "('rbm-%d' % i)"], {}), "(self.path, 'rbm-%d' % i)\n", (974, 999), False, 'import os\n'), ((1014, 1028), 'os.mkdir', 'os.mkdir', (['path'], {}), '(path)\n', (1022, 1028), False, 'import os\n'), ((2049, 2115), 'numpy.array_split', 'np.array_split', (['train_da...
import itertools import math import numpy as np import rasterio from scipy import interpolate def load_datasets(): """ Loads the two target datasets from disk into memory. """ hourly_max_temp_data = rasterio.open("../data/hourly_max_temp_2019.nc").read() land_cover_data = rasterio.open("../data/l...
[ "numpy.where", "rasterio.open", "numpy.linspace", "numpy.empty", "numpy.apply_over_axes", "scipy.interpolate.interp2d" ]
[((753, 777), 'numpy.empty', 'np.empty', (['(365, 41, 107)'], {}), '((365, 41, 107))\n', (761, 777), True, 'import numpy as np\n'), ((1178, 1201), 'numpy.empty', 'np.empty', (['(52, 41, 107)'], {}), '((52, 41, 107))\n', (1186, 1201), True, 'import numpy as np\n'), ((2066, 2112), 'numpy.linspace', 'np.linspace', (['lat_...
import numpy as np from . basic import solve_L, solve_U def factorize_LU(A): # LU decomposition, LU compressed in one matrix m, n = A.shape assert m == n X = np.copy(A) for i in range(n-1): X[i+1:n, i] = X[i+1:n, i] / X[i, i] X[i+1:n, i+1:n] -= X[i+1:n, i][:,np.newaxis] @ X[i, i+1:...
[ "numpy.copy", "numpy.eye", "numpy.zeros_like", "numpy.abs" ]
[((176, 186), 'numpy.copy', 'np.copy', (['A'], {}), '(A)\n', (183, 186), True, 'import numpy as np\n'), ((418, 435), 'numpy.zeros_like', 'np.zeros_like', (['LU'], {}), '(LU)\n', (431, 435), True, 'import numpy as np\n'), ((444, 461), 'numpy.zeros_like', 'np.zeros_like', (['LU'], {}), '(LU)\n', (457, 461), True, 'import...
import numpy as np class LogisticRegressionModel(object): def __init__(self, weights, b, x_mean=None, x_scale=None, sta=None, phase=None): self.weights = weights self.b = b if x_mean is None: x_mean = np.zeros(weights.shape) self.x_mean = x_mean if x_scale is ...
[ "numpy.dot", "numpy.zeros", "numpy.exp", "numpy.ones" ]
[((244, 267), 'numpy.zeros', 'np.zeros', (['weights.shape'], {}), '(weights.shape)\n', (252, 267), True, 'import numpy as np\n'), ((348, 370), 'numpy.ones', 'np.ones', (['weights.shape'], {}), '(weights.shape)\n', (355, 370), True, 'import numpy as np\n'), ((554, 584), 'numpy.dot', 'np.dot', (['centered', 'self.weights...
import numpy as np import pytest import xarray as xr from sgkit import variables from sgkit.variables import ArrayLikeSpec, SgkitVariables def test_variables__variables_registered(): assert len(SgkitVariables.registered_variables) > 0 assert all( isinstance(x, ArrayLikeSpec) for x in SgkitVar...
[ "sgkit.variables.ArrayLikeSpec", "sgkit.variables.SgkitVariables.register_variable", "sgkit.variables.SgkitVariables.registered_variables.values", "numpy.asarray", "pytest.raises", "pytest.fixture", "sgkit.variables.SgkitVariables.registered_variables.pop", "sgkit.variables.validate" ]
[((366, 382), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (380, 382), False, 'import pytest\n'), ((747, 785), 'sgkit.variables.ArrayLikeSpec', 'ArrayLikeSpec', (['"""foo"""'], {'kind': '"""i"""', 'ndim': '(1)'}), "('foo', kind='i', ndim=1)\n", (760, 785), False, 'from sgkit.variables import ArrayLikeSpec, Sgk...
# -*- coding: utf-8 -*- """Elastic Ensemble classifier from file.""" __author__ = "<NAME>" import numpy as np import os from sklearn.metrics import accuracy_score from sktime.utils.data_io import write_results_to_uea_format class ElasticEnsemblePostProcess: """Elastic Ensemble post processor. Parameters ...
[ "os.path.exists", "numpy.add", "sktime.utils.data_io.write_results_to_uea_format", "numpy.argmax", "numpy.array", "numpy.empty", "sklearn.metrics.accuracy_score" ]
[((10706, 10763), 'sklearn.metrics.accuracy_score', 'accuracy_score', (['self.actual_train_class_vals', 'train_preds'], {}), '(self.actual_train_class_vals, train_preds)\n', (10720, 10763), False, 'from sklearn.metrics import accuracy_score\n'), ((11021, 11365), 'sktime.utils.data_io.write_results_to_uea_format', 'writ...
# import numpy as np import fun_provider as provider # load common librarys import numpy as np import networkx as nx from scipy.spatial.distance import pdist,squareform from sklearn.cluster import KMeans import time import h5py # load GPGL functions from fun_GPGL import graph_cut,fun_GPGL_layout_push #%% global set...
[ "sklearn.cluster.KMeans", "numpy.unique", "fun_provider.jitter_point_cloud", "fun_GPGL.fun_GPGL_layout_push", "scipy.spatial.distance.pdist", "networkx.spring_layout", "h5py.File", "time.time_ns", "numpy.array", "numpy.zeros", "fun_provider.rotate_point_cloud", "fun_GPGL.graph_cut", "network...
[((500, 511), 'time.time', 'time.time', ([], {}), '()\n', (509, 511), False, 'import time\n'), ((532, 583), 'sklearn.cluster.KMeans', 'KMeans', ([], {'n_clusters': 'NUM_CUTS', 'n_init': '(1)', 'max_iter': '(100)'}), '(n_clusters=NUM_CUTS, n_init=1, max_iter=100)\n', (538, 583), False, 'from sklearn.cluster import KMean...
import numpy as np import numbers class PatchCutter(object): def __init__(self, patch_size=None, dim=2): if isinstance(patch_size, numbers.Number): patch_size = [patch_size] * dim else: if patch_size is not None: assert len(patch_size) == dim ...
[ "numpy.array", "numpy.zeros", "numpy.random.uniform", "numpy.all", "numpy.random.randn", "numpy.round" ]
[((1698, 1717), 'numpy.random.randn', 'np.random.randn', (['(60)'], {}), '(60)\n', (1713, 1717), True, 'import numpy as np\n'), ((1726, 1754), 'numpy.random.randn', 'np.random.randn', (['(4)', '(144)', '(180)'], {}), '(4, 144, 180)\n', (1741, 1754), True, 'import numpy as np\n'), ((458, 471), 'numpy.zeros', 'np.zeros',...
#!/usr/bin/env python3 """ Author: <NAME> This script carries out feature selection using the mean decrease accuracy approach. Usage: python mda.py -model [rf, xgboost] -data [path/to/balanced/datasets] -o [output file name and path] """ import pandas as pd import argparse from glob import glob import numpy as np ...
[ "os.path.exists", "numpy.mean", "argparse.ArgumentParser", "pandas.read_csv", "sklearn.ensemble.RandomForestClassifier", "sklearn.model_selection.ShuffleSplit", "collections.defaultdict", "glob.glob", "sklearn.preprocessing.MinMaxScaler", "sklearn.metrics.accuracy_score", "xgboost.XGBClassifier"...
[((647, 672), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (670, 672), False, 'import argparse\n'), ((1331, 1348), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1342, 1348), False, 'from collections import defaultdict\n'), ((1362, 1376), 'sklearn.preprocessing.MinMaxS...
# coding=utf-8 # Copyright 2021 The Trax 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
[ "numpy.ones", "tensorflow_datasets.load", "bert.tokenization.bert_tokenization.FullTokenizer", "gin.configurable", "numpy.zeros", "functools.partial", "tensorflow_datasets.as_numpy" ]
[((1959, 1977), 'gin.configurable', 'gin.configurable', ([], {}), '()\n', (1975, 1977), False, 'import gin\n'), ((3105, 3123), 'gin.configurable', 'gin.configurable', ([], {}), '()\n', (3121, 3123), False, 'import gin\n'), ((4667, 4685), 'gin.configurable', 'gin.configurable', ([], {}), '()\n', (4683, 4685), False, 'im...
import pyclesperanto_prototype as cle import numpy as np def test_touch_matrix_to_mesh(): gpu_touch_matrix = cle.push(np.asarray([ [0, 0, 0], [0, 0, 0], [0, 1, 0] ])) gpu_point_list = cle.push(np.asarray([ [1, 4], ...
[ "pyclesperanto_prototype.touch_matrix_to_mesh", "numpy.asarray", "pyclesperanto_prototype.set", "pyclesperanto_prototype.pull", "numpy.array_equal", "pyclesperanto_prototype.create" ]
[((362, 380), 'pyclesperanto_prototype.create', 'cle.create', (['[5, 5]'], {}), '([5, 5])\n', (372, 380), True, 'import pyclesperanto_prototype as cle\n'), ((385, 407), 'pyclesperanto_prototype.set', 'cle.set', (['gpu_output', '(0)'], {}), '(gpu_output, 0)\n', (392, 407), True, 'import pyclesperanto_prototype as cle\n'...
""" Parser for various Hi-C data. """ import numpy as np from collections import defaultdict class HiCData(object): """HiCData Simple class for storing and filtering contact data from single-cell HiC experiments. """ def __init__(self, data): """HiCData This is a list of tuples s...
[ "numpy.array", "collections.defaultdict" ]
[((985, 1004), 'numpy.array', 'np.array', (['self.data'], {}), '(self.data)\n', (993, 1004), True, 'import numpy as np\n'), ((3029, 3046), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (3040, 3046), False, 'from collections import defaultdict\n'), ((1566, 1585), 'numpy.array', 'np.array', (['sel...
import numpy as np import geopandas import shapely class SparseGrid: def __init__(self, x_lim, y_lim, n_cols=10, n_rows=10, tag_prefix = ''): ''' General class to define a spatial frame composed of regular polygons, based on a grid of size n_cols x n_rows :param x_lim: Minimum an...
[ "shapely.geometry.multipolygon.asMultiPolygon", "numpy.diff", "numpy.linspace", "shapely.geometry.Polygon", "geopandas.GeoDataFrame" ]
[((1294, 1343), 'numpy.linspace', 'np.linspace', (['x_lim[0]', '(x_lim[1] - self.dx)', 'n_cols'], {}), '(x_lim[0], x_lim[1] - self.dx, n_cols)\n', (1305, 1343), True, 'import numpy as np\n'), ((1366, 1415), 'numpy.linspace', 'np.linspace', (['y_lim[0]', '(y_lim[1] - self.dy)', 'n_rows'], {}), '(y_lim[0], y_lim[1] - sel...
# -*- coding: utf-8 -*- """ Interface into SQL for the IBEIS Controller TODO; need to use some sort of sticky bit so sql files are created with reasonable permissions. """ import functools import logging import collections import os import parse import re import uuid from collections.abc import Mapping, MutableMapping...
[ "logging.getLogger", "sqlalchemy.sql.bindparam", "utool.unindent", "utool.flag_unique_items", "utool.isiterable", "deprecated.deprecated", "pandas.Index", "sqlalchemy.MetaData", "sqlalchemy.schema.Table", "utool.take_column", "utool.take", "numpy.argsort", "sqlalchemy.select", "utool.setdi...
[((820, 840), 'utool.inject2', 'ut.inject2', (['__name__'], {}), '(__name__)\n', (830, 840), True, 'import utool as ut\n'), ((850, 875), 'logging.getLogger', 'logging.getLogger', (['"""wbia"""'], {}), "('wbia')\n", (867, 875), False, 'import logging\n'), ((890, 954), 'utool.get_argflag', 'ut.get_argflag', (["('--readon...
""" Utilities to manipulate numpy arrays """ import sys from distutils.version import LooseVersion import numpy as np from nibabel.volumeutils import endian_codes, native_code, swapped_code NUMPY_LESS_1_8 = LooseVersion(np.version.short_version) < '1.8' def as_native_array(arr): """ Return `arr` as native by...
[ "numpy.maximum.reduce", "numpy.linalg.pinv", "numpy.asarray", "numpy.linalg.svd", "numpy.empty", "numpy.linalg.eigh", "distutils.version.LooseVersion", "numpy.transpose", "numpy.arange" ]
[((212, 250), 'distutils.version.LooseVersion', 'LooseVersion', (['np.version.short_version'], {}), '(np.version.short_version)\n', (224, 250), False, 'from distutils.version import LooseVersion\n'), ((1514, 1527), 'numpy.asarray', 'np.asarray', (['a'], {}), '(a)\n', (1524, 1527), True, 'import numpy as np\n'), ((3318,...
import scipy.optimize import numpy def unmiximage(weighted_spectra, endmembers_array, in_null, out_unmix_null): output_terms = len(endmembers_array[0]) + 1 image_shape = (output_terms,) + weighted_spectra.shape[1:] fractions = numpy.empty(image_shape) it = numpy.nditer(fractions[0], flags=['multi_inde...
[ "numpy.nditer", "numpy.empty" ]
[((241, 265), 'numpy.empty', 'numpy.empty', (['image_shape'], {}), '(image_shape)\n', (252, 265), False, 'import numpy\n'), ((275, 324), 'numpy.nditer', 'numpy.nditer', (['fractions[0]'], {'flags': "['multi_index']"}), "(fractions[0], flags=['multi_index'])\n", (287, 324), False, 'import numpy\n')]
from __future__ import absolute_import import os import sys import numpy as np import nibabel as nib from spinalcordtoolbox.utils import __sct_dir__ sys.path.append(os.path.join(__sct_dir__, 'scripts')) from spinalcordtoolbox.image import Image from spinalcordtoolbox.deepseg_lesion import core as deepseg_lesion im...
[ "nibabel.nifti1.Nifti1Image", "numpy.eye", "numpy.random.rand", "numpy.logical_and", "os.path.join", "spinalcordtoolbox.deepseg_lesion.core.apply_intensity_normalization_model", "numpy.any", "numpy.max", "os.path.isfile", "numpy.zeros", "numpy.random.uniform", "numpy.min", "numpy.nan_to_num"...
[((168, 204), 'os.path.join', 'os.path.join', (['__sct_dir__', '"""scripts"""'], {}), "(__sct_dir__, 'scripts')\n", (180, 204), False, 'import os\n'), ((783, 805), 'numpy.zeros', 'np.zeros', (['(48, 48, 96)'], {}), '((48, 48, 96))\n', (791, 805), True, 'import numpy as np\n'), ((1113, 1122), 'numpy.eye', 'np.eye', (['(...
# Copyright 2020-2022 OpenDR European Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
[ "os.path.exists", "imageio.imread", "zipfile.ZipFile", "urllib.request.urlretrieve", "os.path.join", "torch.from_numpy", "torch.tensor", "numpy.expand_dims", "torchvision.transforms.Normalize", "torchvision.transforms.Resize", "numpy.concatenate", "torchvision.transforms.ToTensor", "torchvis...
[((4939, 4974), 'os.path.join', 'os.path.join', (['path', '"""hand_gestures"""'], {}), "(path, 'hand_gestures')\n", (4951, 4974), False, 'import os\n'), ((1834, 1864), 'numpy.expand_dims', 'np.expand_dims', (['depth'], {'axis': '(-1)'}), '(depth, axis=-1)\n', (1848, 1864), True, 'import numpy as np\n'), ((2729, 2754), ...
# Copyright (C) 2020 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
[ "cv2.imshow", "numpy.argsort", "numpy.array", "numpy.count_nonzero", "numpy.arange", "argparse.ArgumentParser", "numpy.where", "mmdet.datasets.builder.build_dataset", "numpy.max", "numpy.empty", "numpy.concatenate", "numpy.maximum", "mmcv.load", "cv2.waitKey", "collections.namedtuple", ...
[((2740, 2765), 'bisect.bisect', 'bisect', (['fppis', 'fppi_level'], {}), '(fppis, fppi_level)\n', (2746, 2765), False, 'from bisect import bisect\n'), ((3200, 3263), 'collections.namedtuple', 'namedtuple', (['"""Detection"""', "['image', 'bbox', 'score', 'gt_match']"], {}), "('Detection', ['image', 'bbox', 'score', 'g...