code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import numpy as np
''' DATA
NAME WEIGHT GROWTH GENDER
Alice 133 65 F
Bob 160 72 M
Charlie 152 70 M
Diana 120 60 F
NAME WEIGHT(Minus 135) GROWTH(Minus 66) GENDER(1 - F, 0 - M)
Alice ... | [
"numpy.random.normal",
"numpy.array",
"numpy.exp",
"numpy.apply_along_axis"
] | [((4442, 4491), 'numpy.array', 'np.array', (['[[-2, -1], [25, 6], [17, 4], [-15, -6]]'], {}), '([[-2, -1], [25, 6], [17, 4], [-15, -6]])\n', (4450, 4491), True, 'import numpy as np\n'), ((4552, 4574), 'numpy.array', 'np.array', (['[1, 0, 0, 1]'], {}), '([1, 0, 0, 1])\n', (4560, 4574), True, 'import numpy as np\n'), ((5... |
import math
import numpy as np
import matplotlib.pyplot as plt
from .coords import CartesianCoords, CylindricalCoords
def in_poly(x, y, n, r=1, rotation=0, translate=(0, 0), plot=False):
"""
Determines whether or not the point (x,y) lies within a regular
n-sided polygon whose circumscribing circle has r... | [
"numpy.isclose",
"numpy.arccos",
"math.sqrt",
"matplotlib.pyplot.figure",
"numpy.empty",
"numpy.cos",
"numpy.concatenate",
"numpy.sin",
"numpy.seterr"
] | [((660, 676), 'numpy.empty', 'np.empty', (['(n, 2)'], {}), '((n, 2))\n', (668, 676), True, 'import numpy as np\n'), ((1322, 1344), 'numpy.seterr', 'np.seterr', ([], {'all': '"""raise"""'}), "(all='raise')\n", (1331, 1344), True, 'import numpy as np\n'), ((2926, 2938), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}),... |
import tensorflow as tf
import numpy as np
def reset_graph(seed=42):
tf.reset_default_graph()
tf.set_random_seed(seed)
np.random.seed(seed)
def neuron_layer(X, n_neurons, name, activation=None):
with tf.name_scope(name):
n_inputs = int(X.get_shape()[1])
stddev = 2/ np.sqrt(n_inputs)
... | [
"tensorflow.cast",
"tensorflow.reset_default_graph",
"numpy.sqrt",
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.Variable",
"tensorflow.placeholder",
"tensorflow.train.Saver",
"tensorflow.nn.in_top_k",
"tensorflow.global_variables_initializer",
"tensorflow.nn.sparse_softmax_cross_entrop... | [((74, 98), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (96, 98), True, 'import tensorflow as tf\n'), ((103, 127), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['seed'], {}), '(seed)\n', (121, 127), True, 'import tensorflow as tf\n'), ((132, 152), 'numpy.random.seed', 'np.rando... |
from tensorflow.keras.layers import Conv2D,Input, Dense, MaxPooling2D, Flatten, Reshape, PReLU, ReLU, Concatenate, BatchNormalization, Dropout, Add
from tensorflow.keras.models import Model
from tensorflow.keras import optimizers
from tensorflow.keras.callbacks import EarlyStopping
import tensorflow as tf
from tensorfl... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.Dense",
"copy.copy",
"numpy.save",
"tensorflow.keras.layers.Input",
"numpy.mean",
"os.listdir",
"tensorflow.keras.layers.Reshape",
"matplotlib.... | [((843, 867), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': 'input_shape'}), '(shape=input_shape)\n', (848, 867), False, 'from tensorflow.keras.layers import Conv2D, Input, Dense, MaxPooling2D, Flatten, Reshape, PReLU, ReLU, Concatenate, BatchNormalization, Dropout, Add\n'), ((10589, 10623), 'numpy.random.ra... |
"""
get_scattered_chunks.py
Definition of the `get_scattered_chunks()` function, used to generate
a subsample of rows for manual review of the dataset.
"""
import numpy as np
import pandas as pd
def get_scattered_chunks(
data: pd.DataFrame, n_chunks: int = 5, chunk_size: int = 3
) -> pd.DataFrame:
"""
R... | [
"numpy.linspace"
] | [((728, 773), 'numpy.linspace', 'np.linspace', (['(0)', 'endpoint', 'n_chunks'], {'dtype': 'int'}), '(0, endpoint, n_chunks, dtype=int)\n', (739, 773), True, 'import numpy as np\n')] |
from pdb import post_mortem
from urllib import response
from rest_framework import renderers
from api.models import User,Tag1,Tag2,Sensor,SensorType,Data,File,Analysis
from django.http import Http404
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status... | [
"api.models.User.objects.all",
"api.models.File.objects.all",
"api.models.Data.objects.all",
"api.models.Data.objects.get",
"api.models.Tag2.objects.all",
"numpy.mean",
"django.shortcuts.get_object_or_404",
"api.models.Sensor.objects.all",
"api.models.Tag1.objects.all",
"api.models.User.objects.ge... | [((949, 967), 'api.models.User.objects.all', 'User.objects.all', ([], {}), '()\n', (965, 967), False, 'from api.models import User, Tag1, Tag2, Sensor, SensorType, Data, File, Analysis\n'), ((1066, 1084), 'api.models.Tag1.objects.all', 'Tag1.objects.all', ([], {}), '()\n', (1082, 1084), False, 'from api.models import U... |
# -*- coding: utf-8 -*-
"""
UNIVERSIDAD DE CONCEPCION
Departamento de Ingenieria Informatica y
Ciencias de la Computacion
Memoria de Titulo Ingenieria Civil Informatica
DETECCION DE BORDES EN IMAGENES DGGE USANDO UN
SISTEMA HIBRIDO ACO CON LOGICA DIFUSA
Autor: <NAME>
Patrocinante: <NAME>
"""
import num... | [
"numpy.copy",
"numpy.random.rand",
"numpy.power",
"numpy.where",
"numpy.ndindex",
"numpy.max",
"numpy.random.randint",
"numpy.cumsum",
"numpy.min",
"MathTools.MathTools",
"numpy.random.shuffle"
] | [((800, 829), 'numpy.copy', 'N.copy', (['self._pheromoneMatrix'], {}), '(self._pheromoneMatrix)\n', (806, 829), True, 'import numpy as N\n'), ((1501, 1516), 'MathTools.MathTools', 'mat.MathTools', ([], {}), '()\n', (1514, 1516), True, 'import MathTools as mat\n'), ((1770, 1795), 'numpy.random.shuffle', 'N.random.shuffl... |
from logging import getLogger
from pathlib import Path
import random
import numpy as np
import h5py as h5
from scipy.optimize import minimize
import yaml
import isle
# This script is a fork of Jan-<NAME> make-train-data.py in foldilearn.
# foldilearn introduced Machine Learning parametrization of Lefschetz thimbles
# ... | [
"logging.getLogger",
"isle.initialize",
"isle.meta.sourceOfFunction",
"pathlib.Path",
"yaml.dump",
"isle.rungeKutta4Flow",
"isle.cli.makeDefaultParser",
"scipy.optimize.minimize",
"foldilearn.resources.loadCriticalPoint",
"numpy.array",
"numpy.empty",
"isle.cli.trackProgress",
"isle.util.par... | [((751, 787), 'pathlib.Path', 'Path', (['"""/data/Sign_Problem/Gaussian/"""'], {}), "('/data/Sign_Problem/Gaussian/')\n", (755, 787), False, 'from pathlib import Path\n'), ((1094, 1189), 'isle.util.parameters', 'isle.util.parameters', ([], {'beta': '(6)', 'U': '(3)', 'mu': '(0)', 'sigmaKappa': '(-1)', 'hopping': 'isle.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `missingdata` package."""
from os import makedirs
from os.path import join as pjoin
import numpy as np
import pandas as pd
from missingdata.base import blackholes
# from quilt.data.ResidentMario import missingno_data
# collisions = missingno_data.nyc_colli... | [
"os.makedirs",
"missingdata.base.blackholes",
"os.path.join",
"numpy.random.randint",
"numpy.random.seed",
"pandas.read_excel"
] | [((455, 482), 'os.path.join', 'pjoin', (['in_dir', '"""processing"""'], {}), "(in_dir, 'processing')\n", (460, 482), True, 'from os.path import join as pjoin\n'), ((498, 532), 'os.path.join', 'pjoin', (['proc_dir', '"""missingdata_vis"""'], {}), "(proc_dir, 'missingdata_vis')\n", (503, 532), True, 'from os.path import ... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from numpy import pi
from numpy import array
from numpy import linspace
from numpy.random import random
from numpy.random import randint
from numpy import zeros
from numpy import arange
from numpy import column_stack
from numpy import cos
from numpy import sin
from modules.h... | [
"modules.helpers.get_img_as_rgb_array",
"modules.sandSpline.SandSpline",
"fn.Fn",
"numpy.column_stack",
"numpy.array",
"numpy.linspace",
"numpy.zeros",
"sand.Sand",
"traceback.print_exc",
"numpy.arange"
] | [((463, 492), 'modules.helpers.get_img_as_rgb_array', 'get_img_as_rgb_array', (['IMGNAME'], {}), '(IMGNAME)\n', (483, 492), False, 'from modules.helpers import get_img_as_rgb_array\n'), ((1291, 1315), 'numpy.linspace', 'linspace', (['(0)', '(1.0)', 'GRID_X'], {}), '(0, 1.0, GRID_X)\n', (1299, 1315), False, 'from numpy ... |
import numpy as np
from collections import defaultdict
import torch
from kmeans_pytorch import kmeans
from DA2Lite.compression.clustering.methods.base import ClusteringBase
from DA2Lite.core.layer_utils import _exclude_layer, get_layer_type
class NewClustering(ClusteringBase):
def get_cluster_idx(self, i_node,... | [
"numpy.ones",
"kmeans_pytorch.kmeans",
"torch.svd",
"torch.diag",
"torch.dist"
] | [((626, 644), 'torch.svd', 'torch.svd', (['weights'], {}), '(weights)\n', (635, 644), False, 'import torch\n'), ((889, 949), 'kmeans_pytorch.kmeans', 'kmeans', ([], {'X': 'i_sv', 'num_clusters': 'n_to_cluster', 'distance': '"""cosine"""'}), "(X=i_sv, num_clusters=n_to_cluster, distance='cosine')\n", (895, 949), False, ... |
"""Germinal Center Optimization.
"""
import copy
import numpy as np
import opytimizer.math.distribution as d
import opytimizer.math.random as r
import opytimizer.utils.constant as c
import opytimizer.utils.exception as e
import opytimizer.utils.logging as l
from opytimizer.core import Optimizer
logger = l.get_logge... | [
"opytimizer.utils.exception.TypeError",
"numpy.ones",
"opytimizer.math.random.generate_uniform_random_number",
"opytimizer.utils.logging.get_logger",
"opytimizer.utils.exception.ValueError",
"numpy.min",
"numpy.max",
"numpy.sum",
"copy.deepcopy"
] | [((309, 331), 'opytimizer.utils.logging.get_logger', 'l.get_logger', (['__name__'], {}), '(__name__)\n', (321, 331), True, 'import opytimizer.utils.logging as l\n'), ((2716, 2772), 'opytimizer.math.random.generate_uniform_random_number', 'r.generate_uniform_random_number', (['(70)', '(70)', 'space.n_agents'], {}), '(70... |
try:
import matplotlib
matplotlib.use('WXAgg')
import numpy
from matplotlib.pyplot import cm
import types
numpy.seterr(invalid='ignore')
except ImportError:
pass
"""@package pipeline_display
This package allows easy plotting of pipeline data (images, spectra, tables)
with a few class method... | [
"numpy.abs",
"matplotlib.use",
"numpy.isfinite",
"numpy.nanmax",
"matplotlib.colors.Normalize",
"numpy.ma.masked_array",
"types.MethodType",
"numpy.seterr"
] | [((31, 54), 'matplotlib.use', 'matplotlib.use', (['"""WXAgg"""'], {}), "('WXAgg')\n", (45, 54), False, 'import matplotlib\n'), ((130, 160), 'numpy.seterr', 'numpy.seterr', ([], {'invalid': '"""ignore"""'}), "(invalid='ignore')\n", (142, 160), False, 'import numpy\n'), ((9870, 9937), 'matplotlib.colors.Normalize', 'matp... |
# Author: <NAME> '20
# Date: 13 November 2018
# Project: COS 526 A2 — Point Cloud Registration
#
# File: icp.py
# About: Implements the Iterative Closest Points algorithm
# Takes 2 *.pts files as the argument and tries to align the points of
# the first file with those in the second. Expects ... | [
"numpy.identity",
"numpy.median",
"numpy.linalg.solve",
"random.shuffle",
"numpy.cross",
"numpy.subtract",
"os.path.isfile",
"numpy.zeros",
"numpy.matrix",
"lib.kdtree.KdTree"
] | [((1991, 1999), 'lib.kdtree.KdTree', 'KdTree', ([], {}), '()\n', (1997, 1999), False, 'from lib.kdtree import KdTree\n'), ((790, 811), 'os.path.isfile', 'os.path.isfile', (['file1'], {}), '(file1)\n', (804, 811), False, 'import os\n'), ((888, 909), 'os.path.isfile', 'os.path.isfile', (['file2'], {}), '(file2)\n', (902,... |
from numpy import linalg as la
from scipy import linalg as sla
from sklearn.cluster import KMeans
import igraph as ig
import numpy as np
import math
import plotly.plotly as py
import plotly.graph_objs as go
py.sign_in('panbabybaby', 'JS2Punm2xSGm2MgZEFA3')
def normalized_clutering_ng(S, k):
print(S)
rows, col... | [
"math.floor",
"math.sqrt",
"plotly.graph_objs.Line",
"plotly.graph_objs.Font",
"igraph.Graph",
"plotly.plotly.iplot",
"plotly.graph_objs.YAxis",
"plotly.graph_objs.Margin",
"plotly.graph_objs.Figure",
"scipy.linalg.sqrtm",
"numpy.linalg.eig",
"numpy.transpose",
"sklearn.cluster.KMeans",
"p... | [((208, 257), 'plotly.plotly.sign_in', 'py.sign_in', (['"""panbabybaby"""', '"""JS2Punm2xSGm2MgZEFA3"""'], {}), "('panbabybaby', 'JS2Punm2xSGm2MgZEFA3')\n", (218, 257), True, 'import plotly.plotly as py\n'), ((488, 501), 'numpy.linalg.eig', 'la.eig', (['L_sym'], {}), '(L_sym)\n', (494, 501), True, 'from numpy import li... |
#!/usr/bin/env python
import numpy as np
import os.path
import sys
from scipy.spatial.distance import cdist
# Input/output
if len(sys.argv) == 3: path_output = os.path.splitext(sys.argv[1])[0] + ".in"
elif len(sys.argv) == 4: path_output = sys.argv[3]
else:
print("\033[1;31mUsage is %s trajectory topology [outpu... | [
"numpy.mean",
"numpy.roll",
"numpy.cross",
"scipy.spatial.distance.cdist",
"numpy.asarray",
"numpy.dot",
"sys.exit",
"numpy.linalg.svd"
] | [((1847, 1864), 'numpy.asarray', 'np.asarray', (['bases'], {}), '(bases)\n', (1857, 1864), True, 'import numpy as np\n'), ((1874, 1891), 'numpy.asarray', 'np.asarray', (['backs'], {}), '(backs)\n', (1884, 1891), True, 'import numpy as np\n'), ((3052, 3074), 'numpy.mean', 'np.mean', (['backs'], {'axis': '(0)'}), '(backs... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | [
"numpy.eye",
"mvpa2.mappers.staticprojection.StaticProjectionMapper",
"numpy.arange"
] | [((666, 686), 'numpy.eye', 'np.eye', (['ds.nfeatures'], {}), '(ds.nfeatures)\n', (672, 686), True, 'import numpy as np\n'), ((697, 758), 'mvpa2.mappers.staticprojection.StaticProjectionMapper', 'StaticProjectionMapper', ([], {'proj': 'proj[:, :3]', 'recon': 'proj[:, :3].T'}), '(proj=proj[:, :3], recon=proj[:, :3].T)\n'... |
import PCA as pc
import numpy as np
from sklearn.decomposition import PCA
if __name__ == "__main__":
data = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
pca = pc.PCA(n_components=1)
pca.fit(data,rowvar=False)
res = pca.transform(data,rowvar=False)
ratio = pca.variance... | [
"sklearn.decomposition.PCA",
"numpy.array",
"PCA.PCA"
] | [((118, 182), 'numpy.array', 'np.array', (['[[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]'], {}), '([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])\n', (126, 182), True, 'import numpy as np\n'), ((196, 218), 'PCA.PCA', 'pc.PCA', ([], {'n_components': '(1)'}), '(n_components=1)\n', (202, 218), True, 'im... |
#%% (1) Define grid
from rtm import define_grid, produce_dem
"""
To obtain the below file from OpenTopography, run the command
$ curl https://cloud.sdsc.edu/v1/AUTH_opentopography/hosted_data/OTDS.072019.4326.1/raster/DEM_WGS84.tif -o DEM_WGS84.tif
or simply paste the above URL in a web browser. Alternatively, spec... | [
"rtm.produce_dem",
"rtm.plot_time_slice",
"rtm.define_grid",
"obspy.UTCDateTime",
"numpy.argmax",
"rtm.grid_search",
"rtm.process_waveforms",
"rtm.get_peak_coordinates",
"rtm.calculate_time_buffer",
"rtm.plot_record_section",
"waveform_collection.gather_waveforms",
"rtm.plot_st"
] | [((696, 808), 'rtm.define_grid', 'define_grid', ([], {'lon_0': 'LON_0', 'lat_0': 'LAT_0', 'x_radius': 'X_RADIUS', 'y_radius': 'Y_RADIUS', 'spacing': 'SPACING', 'projected': '(True)'}), '(lon_0=LON_0, lat_0=LAT_0, x_radius=X_RADIUS, y_radius=Y_RADIUS,\n spacing=SPACING, projected=True)\n', (707, 808), False, 'from rt... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import numpy as np
import time
import cv2
from tqdm import tqdm
from model_wrappers.ldf_wrapper import LDF_Wrapper
import logging
def get_mae(img1, img2):
# get mae from two gray scale images
ims = []
for pred in [img1, img2]:
... | [
"logging.info",
"numpy.mean",
"os.path.exists",
"numpy.where",
"numpy.max",
"cv2.distanceTransform",
"numpy.round",
"cv2.blur",
"numpy.abs",
"time.time",
"torch.log",
"os.makedirs",
"torch.sigmoid",
"torch.stack",
"tqdm.tqdm",
"os.path.join",
"torch.no_grad",
"torch.zeros",
"nump... | [((829, 843), 'numpy.round', 'np.round', (['pred'], {}), '(pred)\n', (837, 843), True, 'import numpy as np\n'), ((913, 941), 'cv2.blur', 'cv2.blur', (['mask'], {'ksize': '(5, 5)'}), '(mask, ksize=(5, 5))\n', (921, 941), False, 'import cv2\n'), ((952, 1017), 'cv2.distanceTransform', 'cv2.distanceTransform', (['body'], {... |
import bpy
from PIL import ImageDraw
import os
import torch
import cv2
import math
import numpy as np
from math import radians
from PIL import Image, ImageFilter
from dataset.data_utils import process_viewpoint_label, TransLightning, resize_pad, random_crop
import torchvision.transforms as transforms
from model.resnet ... | [
"numpy.sqrt",
"numpy.arccos",
"bpy.data.objects.new",
"torch.sin",
"math.cos",
"torch.cos",
"numpy.sin",
"model.vp_estimator.BaselineEstimator",
"bpy.ops.transform.rotate",
"model.resnet.resnet50",
"torch.matmul",
"torchvision.transforms.ToTensor",
"math.radians",
"numpy.cos",
"torchvisi... | [((6394, 6469), 'torchvision.transforms.Normalize', 'transforms.Normalize', ([], {'mean': '[0.485, 0.456, 0.406]', 'std': '[0.229, 0.224, 0.225]'}), '(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])\n', (6414, 6469), True, 'import torchvision.transforms as transforms\n'), ((6636, 6656), 'dataset.data_utils.resiz... |
"""OctreeIntersection class.
"""
from typing import List, Tuple
import numpy as np
from .octree_level import OctreeLevel
from .octree_util import ChunkData
# TODO_OCTREE: These types might be a horrible idea but trying it for now.
Float2 = np.ndarray # [x, y] dtype=float64 (default type)
class OctreeIntersection:... | [
"numpy.clip"
] | [((806, 840), 'numpy.clip', 'np.clip', (['(self.rows / base[0])', '(0)', '(1)'], {}), '(self.rows / base[0], 0, 1)\n', (813, 840), True, 'import numpy as np\n'), ((872, 906), 'numpy.clip', 'np.clip', (['(self.cols / base[1])', '(0)', '(1)'], {}), '(self.cols / base[1], 0, 1)\n', (879, 906), True, 'import numpy as np\n'... |
import numpy as np
import os
import sys
from post_summary import post_summary
# joint names
oname = 'UZ_Tau_EW'
names = ['UZ_Tau_Ea', 'UZ_Tau_Eb', 'UZ_Tau_Wa', 'UZ_Tau_Wb']
# get the # of posterior samples
npost = len(np.load('outputs/'+names[0]+'.age-mass.posterior.npz')['logM'])
npostL = len(np.load('outputs/'+nam... | [
"numpy.savez",
"numpy.average",
"post_summary.post_summary",
"numpy.sum",
"numpy.load"
] | [((961, 990), 'post_summary.post_summary', 'post_summary', (['mage'], {'prec': '(0.01)'}), '(mage, prec=0.01)\n', (973, 990), False, 'from post_summary import post_summary\n'), ((1007, 1036), 'post_summary.post_summary', 'post_summary', (['mtot'], {'prec': '(0.01)'}), '(mtot, prec=0.01)\n', (1019, 1036), False, 'from p... |
import cv2 as cv
import numpy as np
img = cv.imread('Resources/Photos/lady.jpg')
#cv.imshow('Lady', img)
#Translation, move image
def translate(img, x, y):
transMat = np.float32([[1,0,x], [0,1,y]])
dimensions = (img.shape[1], img.shape[0])
return cv.warpAffine(img, transMat, dimensions)
#-x --> left
#-y -... | [
"cv2.warpAffine",
"cv2.flip",
"cv2.imshow",
"cv2.getRotationMatrix2D",
"cv2.resize",
"cv2.waitKey",
"numpy.float32",
"cv2.imread"
] | [((42, 80), 'cv2.imread', 'cv.imread', (['"""Resources/Photos/lady.jpg"""'], {}), "('Resources/Photos/lady.jpg')\n", (51, 80), True, 'import cv2 as cv\n'), ((1253, 1312), 'cv2.resize', 'cv.resize', (['img', '(1500, 1500)'], {'interpolation': 'cv.INTER_LINEAR'}), '(img, (1500, 1500), interpolation=cv.INTER_LINEAR)\n', (... |
import json
import re
from typing import OrderedDict
import torch
import numpy as np
import matplotlib.pyplot as plt
import io
import cv2
import pickle
import wandb
import cvgutils.Dir as Dir
import cvgutils.Image as cvgim
import cvgutils.Utils as cvgutil
from tensorboardX import SummaryWriter
# from torch.utils.tensor... | [
"numpy.clip",
"wandb.log",
"io.BytesIO",
"wandb.init",
"typing.OrderedDict",
"cv2.imdecode",
"matplotlib.rc",
"os.path.exists",
"os.listdir",
"cvgutils.Image.plotly_fig2array",
"tensorboardX.SummaryWriter",
"cvgutils.Image.imwrite",
"matplotlib.pyplot.close",
"numpy.stack",
"matplotlib.p... | [((12367, 12379), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (12377, 12379), False, 'import io\n'), ((12526, 12550), 'cv2.imdecode', 'cv2.imdecode', (['img_arr', '(1)'], {}), '(img_arr, 1)\n', (12538, 12550), False, 'import cv2\n'), ((12561, 12597), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2RGB'], {}),... |
import pandas as pd
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import LSTM
import tensorflow as tf
import boto3
from io import StringIO
ACCESS_KEY = "aws-access-key"
S... | [
"boto3.client",
"pandas.read_csv",
"tensorflow.keras.layers.LSTM",
"boto3.resource",
"tensorflow.keras.layers.Dense",
"numpy.array",
"tensorflow.keras.models.Sequential",
"pandas.DataFrame",
"io.StringIO",
"sklearn.preprocessing.MinMaxScaler",
"pandas.to_datetime"
] | [((476, 587), 'boto3.client', 'boto3.client', (['"""s3"""'], {'region_name': 'REGION_NAME', 'aws_access_key_id': 'ACCESS_KEY', 'aws_secret_access_key': 'SECRET_KEY'}), "('s3', region_name=REGION_NAME, aws_access_key_id=ACCESS_KEY,\n aws_secret_access_key=SECRET_KEY)\n", (488, 587), False, 'import boto3\n'), ((933, 9... |
"""Utility toolbox submodules."""
import numpy as np
from scipy.spatial.transform import Rotation as R
def rot(axis, deg):
"""Compute 3D rotation matrix given euler rotation."""
return R.from_euler(axis, np.deg2rad(deg)).as_matrix()
| [
"numpy.deg2rad"
] | [((216, 231), 'numpy.deg2rad', 'np.deg2rad', (['deg'], {}), '(deg)\n', (226, 231), True, 'import numpy as np\n')] |
import numpy as np
import os,sys
import matplotlib.pyplot as plt
import pathlib
import pandas as pd
# import plotly.express as px
# ipath__ = pathlib.Path(__file__) #.parent.resolve()
# ipath__= os.path.normpath(ipath__).split(os.path.sep)
# datapath__ = os.path.join(*ipath__[:-3],"datasets/")
datapath__ = os.path.... | [
"matplotlib.pyplot.imshow",
"numpy.fromfile",
"os.listdir",
"matplotlib.pyplot.savefig",
"pathlib.Path",
"matplotlib.pyplot.colorbar",
"os.path.join",
"os.path.dirname",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((341, 366), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (356, 366), False, 'import os, sys\n'), ((2381, 2456), 'numpy.fromfile', 'np.fromfile', (['self.filer'], {'count': '(self.nx * self.ny * self.nv)', 'dtype': '"""float64"""'}), "(self.filer, count=self.nx * self.ny * self.nv, dtype='... |
import numpy.linalg
import numpy.random
import scipy.stats
import scipy.io
import argparse
import numpy
import math
import sys
import os
import os.path
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
sys.path.append("./module")
import mainmkvcmp
import basicutils
parser = argparse.ArgumentParser()
... | [
"argparse.ArgumentParser",
"numpy.max",
"os.path.isfile",
"numpy.zeros",
"sys.path.append",
"mainmkvcmp.main_mkc_comp_cont"
] | [((219, 246), 'sys.path.append', 'sys.path.append', (['"""./module"""'], {}), "('./module')\n", (234, 246), False, 'import sys\n'), ((293, 318), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (316, 318), False, 'import argparse\n'), ((2517, 2552), 'numpy.zeros', 'numpy.zeros', (['tprev'], {'dty... |
import argparse
import sys
print()
print(" ".join(sys.argv))
print()
parser = argparse.ArgumentParser('Options for model configuration and training')
parser.add_argument('--num_epochs', type=int, default=100, help="Number of iterations to run training for")
parser.add_argument('--starting_epoch', type=int, default=0,... | [
"os.path.exists",
"tensorflow.keras.mixed_precision.experimental.Policy",
"argparse.ArgumentParser",
"numpy.squeeze",
"sequences.DataLoader",
"os.mkdir",
"tensorflow.keras.mixed_precision.experimental.set_policy",
"tensorflow.keras.mixed_precision.experimental.LossScaleOptimizer"
] | [((79, 150), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Options for model configuration and training"""'], {}), "('Options for model configuration and training')\n", (102, 150), False, 'import argparse\n'), ((4513, 4573), 'sequences.DataLoader', 'DataLoader', ([], {'batch_size': 'args.batch_size', 'dat... |
import cv2
import numpy as np
import os
file = raw_input("path of the folder where the pics will be saved: ")
counter=0
while 1:
# create a blank image
blank_image = np.zeros((550,1280,3), np.uint8)
cv2.putText(blank_image,str(600-counter)+" seconds left",(200,300),cv2.FONT_HERSHEY_PLAIN,5.0,(255,255,255),5)
cv... | [
"cv2.imwrite",
"numpy.zeros",
"cv2.putText"
] | [((172, 206), 'numpy.zeros', 'np.zeros', (['(550, 1280, 3)', 'np.uint8'], {}), '((550, 1280, 3), np.uint8)\n', (180, 206), True, 'import numpy as np\n'), ((318, 439), 'cv2.putText', 'cv2.putText', (['blank_image', '"""female free swim countdown:"""', '(200, 200)', 'cv2.FONT_HERSHEY_PLAIN', '(3.0)', '(255, 255, 255)', '... |
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sklearn.linear_model
import scipy.spatial
import scipy.stats
import statsmodels.formula.api as smf
from utils.paths import path_expt, path_figures, path_metadata
from utils.tasks import (clutter, difficulty, scale, si... | [
"numpy.mean",
"pandas.read_csv",
"numpy.random.choice",
"matplotlib.pyplot.colorbar",
"numpy.flatnonzero",
"numpy.min",
"numpy.max",
"numpy.array",
"statsmodels.formula.api.ols",
"matplotlib.ticker.FormatStrFormatter",
"numpy.random.seed",
"utils.tasks.compute_task_properties",
"numpy.std",
... | [((492, 529), 'matplotlib.ticker.FormatStrFormatter', 'mpl.ticker.FormatStrFormatter', (['"""%.1f"""'], {}), "('%.1f')\n", (521, 529), True, 'import matplotlib as mpl\n'), ((995, 1052), 'pandas.read_csv', 'pd.read_csv', (["(path_metadata / 'imagenet_image_clutter.csv')"], {}), "(path_metadata / 'imagenet_image_clutter.... |
# Copyright 2020 Adap GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
"flower.proto.transport_pb2.Weights",
"unittest.mock.MagicMock",
"flower.grpc_server.grpc_proxy_client.GRPCProxyClient",
"numpy.ones"
] | [((1218, 1229), 'unittest.mock.MagicMock', 'MagicMock', ([], {}), '()\n', (1227, 1229), False, 'from unittest.mock import MagicMock\n'), ((1512, 1561), 'flower.grpc_server.grpc_proxy_client.GRPCProxyClient', 'GRPCProxyClient', ([], {'cid': '"""1"""', 'bridge': 'self.bridge_mock'}), "(cid='1', bridge=self.bridge_mock)\n... |
import os
import cv2
import numpy as np
in_path = './imgs1'
files= os.listdir(in_path)
print(files)
def sepia(src_image):
gray = cv2.cvtColor(src_image, cv2.COLOR_BGR2GRAY)
normalized_gray = np.array(gray, np.float32)/255
#solid color
sepia = np.ones(src_image.shape)
sepia[:,:,0] *= 153 #B
... | [
"cv2.imwrite",
"os.listdir",
"numpy.ones",
"numpy.array",
"cv2.cvtColor",
"cv2.imread"
] | [((70, 89), 'os.listdir', 'os.listdir', (['in_path'], {}), '(in_path)\n', (80, 89), False, 'import os\n'), ((140, 183), 'cv2.cvtColor', 'cv2.cvtColor', (['src_image', 'cv2.COLOR_BGR2GRAY'], {}), '(src_image, cv2.COLOR_BGR2GRAY)\n', (152, 183), False, 'import cv2\n'), ((266, 290), 'numpy.ones', 'np.ones', (['src_image.s... |
# 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... | [
"numpy.array",
"mindspore.mindrecord.FileWriter",
"argparse.ArgumentParser"
] | [((7779, 7854), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""read dataset and save it to minddata"""'}), "(description='read dataset and save it to minddata')\n", (7802, 7854), False, 'import argparse\n'), ((2788, 2834), 'mindspore.mindrecord.FileWriter', 'FileWriter', ([], {'file_name... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"tvm.tir.Schedule",
"tvm.topi.nn.pool2d",
"os.path.join",
"numpy.iinfo",
"copy.copy",
"tvm.te.create_prim_func",
"pytest.mark.usefixtures",
"os.mkdir",
"pytest.mark.skipif",
"numpy.dtype"
] | [((4184, 4226), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""benchmark_group"""'], {}), "('benchmark_group')\n", (4207, 4226), False, 'import pytest\n'), ((2972, 2989), 'copy.copy', 'copy.copy', (['arr_in'], {}), '(arr_in)\n', (2981, 2989), False, 'import copy\n'), ((3993, 4008), 'numpy.dtype', 'np.dtype... |
import pandas
import numpy as np
#load dataset
data = pandas.read_csv("fer2013.csv", delimiter=",")
data = data.values
#Number of training data per class in the original dataset
# 0 - 3995
# 1 - 436
# 2 - 4097
# 3 - 7215
# 4 - 4830
# 5 - 3171
# 6 - 4965
X_label = []
Y_label = []
X_unlabel = []
Y_unlabel = []
#Segre... | [
"numpy.savetxt",
"pandas.read_csv"
] | [((55, 100), 'pandas.read_csv', 'pandas.read_csv', (['"""fer2013.csv"""'], {'delimiter': '""","""'}), "('fer2013.csv', delimiter=',')\n", (70, 100), False, 'import pandas\n'), ((1896, 1958), 'numpy.savetxt', 'np.savetxt', (['"""X_label_20.csv"""', 'X_label'], {'delimiter': '""" """', 'fmt': '"""%s"""'}), "('X_label_20.... |
# -*- coding: utf-8 -*-
# File generated according to Generator/ClassesRef/Simulation/LossModelSteinmetz.csv
# WARNING! All changes made in this file will be lost!
"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/LossModelSteinmetz
"""
from os import linesep
from sy... | [
"sys.getsizeof",
"numpy.isnan"
] | [((7779, 7799), 'sys.getsizeof', 'getsizeof', (['self.k_hy'], {}), '(self.k_hy)\n', (7788, 7799), False, 'from sys import getsizeof\n'), ((7813, 7833), 'sys.getsizeof', 'getsizeof', (['self.k_ed'], {}), '(self.k_ed)\n', (7822, 7833), False, 'from sys import getsizeof\n'), ((7847, 7870), 'sys.getsizeof', 'getsizeof', ([... |
import numpy as np
from sklearn.model_selection import KFold
from sklearn.metrics import f1_score
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
import fasttext
def run_kfold_test(clf, x, y, k=10):
'''
Runs k-Fold test for model benchmarking.
o Inputs:
... | [
"sklearn.metrics.f1_score",
"fasttext.supervised",
"numpy.array",
"numpy.sum",
"sklearn.model_selection.KFold",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.confusion_matrix"
] | [((521, 529), 'sklearn.model_selection.KFold', 'KFold', (['k'], {}), '(k)\n', (526, 529), False, 'from sklearn.model_selection import KFold\n'), ((1493, 1510), 'numpy.array', 'np.array', (['results'], {}), '(results)\n', (1501, 1510), True, 'import numpy as np\n'), ((900, 923), 'sklearn.metrics.f1_score', 'f1_score', (... |
import torchvision.transforms.functional as TF
from torchvision import transforms
import numpy as np
import cv2
import math
import random
from PIL import Image
from scipy import ndimage
class HideAndSeek(object):
'''
Class that performs Random Erasing in Random Erasing Data Augmentation by Zhong et al.
--... | [
"torchvision.transforms.CenterCrop",
"torchvision.transforms.functional.to_tensor",
"PIL.Image.fromarray",
"numpy.random.normal",
"numpy.sqrt",
"numpy.random.rand",
"numpy.random.random",
"numpy.delete",
"torchvision.transforms.functional.hflip",
"torchvision.transforms.functional.crop",
"numpy.... | [((2896, 2928), 'numpy.delete', 'np.delete', (['flat_order', 'to_remove'], {}), '(flat_order, to_remove)\n', (2905, 2928), True, 'import numpy as np\n'), ((2961, 3022), 'numpy.array', 'np.array', (['[[x // cols, x % cols] for x in flat_order[:count]]'], {}), '([[x // cols, x % cols] for x in flat_order[:count]])\n', (2... |
#----------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#------------------------------------------------------------------... | [
"PIL.Image.open",
"paddle.v2.parameters.Parameters.from_tar",
"argparse.ArgumentParser",
"gzip.open",
"paddle.trainer_config_helpers.config_parser_utils.reset_parser",
"numpy.squeeze",
"paddle.v2.infer",
"numpy.transpose"
] | [((705, 730), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (728, 730), False, 'import argparse\n'), ((2006, 2032), 'PIL.Image.open', 'pil_image.open', (['image_path'], {}), '(image_path)\n', (2020, 2032), True, 'from PIL import Image as pil_image\n'), ((2153, 2167), 'paddle.trainer_config_hel... |
# import os
import argparse
# import random
from os.path import isfile, join
# import json
from tqdm import tqdm
import cv2
import numpy as np
# import pickle
from facenet_pytorch import MTCNN
# from operator import itemgetter
import glob
import matplotlib.pyplot as plt
import torch
torch.multiprocessing.set_start_meth... | [
"argparse.ArgumentParser",
"concurrent.futures.ThreadPoolExecutor",
"tqdm.tqdm",
"os.path.join",
"numpy.argmax",
"facenet_pytorch.MTCNN",
"torch.cuda.is_available",
"cv2.cvtColor",
"torch.multiprocessing.set_start_method",
"glob.glob"
] | [((284, 331), 'torch.multiprocessing.set_start_method', 'torch.multiprocessing.set_start_method', (['"""spawn"""'], {}), "('spawn')\n", (322, 331), False, 'import torch\n'), ((987, 1007), 'facenet_pytorch.MTCNN', 'MTCNN', ([], {'device': 'device'}), '(device=device)\n', (992, 1007), False, 'from facenet_pytorch import ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import scipy.linalg
import scipy.special
from . import thops
def nan_throw(tensor, name="tensor"):
stop = False
if ((tensor!=tensor).any()):
print(name + " has nans")
stop = True
if (to... | [
"numpy.log",
"torch.nn.functional.conv1d",
"torch.slogdet",
"torch.exp",
"torch.sqrt",
"torch.isinf",
"numpy.arange",
"torch.nn.GRU",
"numpy.random.chisquare",
"torch.nn.LSTM",
"torch.matmul",
"numpy.tile",
"numpy.eye",
"numpy.abs",
"numpy.ones",
"torch.Tensor",
"numpy.sign",
"torc... | [((7270, 7312), 'numpy.zeros', 'np.zeros', (['self.num_channels'], {'dtype': 'np.long'}), '(self.num_channels, dtype=np.long)\n', (7278, 7312), True, 'import numpy as np\n'), ((7545, 7576), 'numpy.random.shuffle', 'np.random.shuffle', (['self.indices'], {}), '(self.indices)\n', (7562, 7576), True, 'import numpy as np\n... |
# Code for the type model experiments
import time
import random
import numpy.random as np_random
from itertools import combinations
from UtilityFunctions import print_dict_to_file, train_duals, JaccardMatching
from InstanceGeneration import type_model
from BipartiteGraph import BipartiteGraph
from MinWeightPerfec... | [
"numpy.random.geometric",
"MinWeightPerfectMatching.check_certificates",
"random.seed",
"itertools.combinations",
"UtilityFunctions.print_dict_to_file",
"UtilityFunctions.train_duals",
"MinWeightPerfectMatching.MinWeightPerfectMatching",
"InstanceGeneration.type_model",
"numpy.random.seed",
"time.... | [((494, 505), 'time.time', 'time.time', ([], {}), '()\n', (503, 505), False, 'import time\n'), ((552, 586), 'UtilityFunctions.train_duals', 'train_duals', (['samples', 'instance_gen'], {}), '(samples, instance_gen)\n', (563, 586), False, 'from UtilityFunctions import print_dict_to_file, train_duals, JaccardMatching\n')... |
import numpy as np
def fUi_VortexSegment11_smooth(xa = None,ya = None,za = None,xb = None,yb = None,zb = None,visc_model = None,t = None,bComputeGrad = None):
# !!!!! No intensity!!!
norm_a = np.sqrt(xa * xa + ya * ya + za * za)
norm_b = np.sqrt(xb * xb + yb * yb + zb * zb)
denominator = norm_a * ... | [
"numpy.abs",
"numpy.sqrt",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.isnan",
"numpy.transpose",
"numpy.arange"
] | [((206, 242), 'numpy.sqrt', 'np.sqrt', (['(xa * xa + ya * ya + za * za)'], {}), '(xa * xa + ya * ya + za * za)\n', (213, 242), True, 'import numpy as np\n'), ((256, 292), 'numpy.sqrt', 'np.sqrt', (['(xb * xb + yb * yb + zb * zb)'], {}), '(xb * xb + yb * yb + zb * zb)\n', (263, 292), True, 'import numpy as np\n'), ((393... |
#GNV_data_reader.py
#loads data from GNV output; converts timestamps into epoch time to align with SSTDR measurements
#data source, with info: https://mesonet.agron.iastate.edu/request/download.phtml?network=FL_ASOS
"""
GNV columns:
station: station; GNV airport
valid: timestamp at which data is valid
... | [
"numpy.genfromtxt",
"datetime.datetime.fromisoformat",
"numpy.isnan"
] | [((1070, 1123), 'numpy.genfromtxt', 'np.genfromtxt', (['gnv_path'], {'delimiter': '""","""', 'skip_header': '(1)'}), "(gnv_path, delimiter=',', skip_header=1)\n", (1083, 1123), True, 'import numpy as np\n'), ((1166, 1219), 'numpy.genfromtxt', 'np.genfromtxt', (['env_path'], {'delimiter': '""","""', 'skip_header': '(1)'... |
# %%
# %matplotlib widget
import base64
import io
import pathlib
import ipyvuetify as v
import ipywidgets as widgets
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from controls import SpectralBandsControlPanel
parameters = {
'model': 6,
'range': 1,
'haze': 1,
'spectral_... | [
"ipyvuetify.Icon",
"ipyvuetify.CardTitle",
"numpy.ravel_multi_index",
"numpy.column_stack",
"ipyvuetify.Spacer",
"ipywidgets.HBox",
"pathlib.Path",
"ipywidgets.Output",
"numpy.max",
"numpy.min",
"ipyvuetify.Btn",
"io.StringIO",
"ipyvuetify.CardText",
"ipywidgets.HTML",
"matplotlib.pyplot... | [((493, 509), 'ipywidgets.Output', 'widgets.Output', ([], {}), '()\n', (507, 509), True, 'import ipywidgets as widgets\n'), ((4405, 4415), 'matplotlib.pyplot.ioff', 'plt.ioff', ([], {}), '()\n', (4413, 4415), True, 'import matplotlib.pyplot as plt\n'), ((4487, 4820), 'ipyvuetify.Select', 'v.Select', ([], {'label': '"""... |
# this file contains functions for generating missing values in a dataset
import numpy as np
from numpy.lib.function_base import select
import pandas as pd
from utils.data import *
from sklearn.preprocessing import StandardScaler
def gen_complete_random(data, random_ratio=0.2, selected_cols=[], print_time=False, prin... | [
"numpy.random.standard_normal",
"numpy.where",
"sklearn.preprocessing.StandardScaler",
"numpy.exp",
"numpy.random.uniform",
"pandas.concat",
"numpy.random.binomial"
] | [((5126, 5142), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (5140, 5142), False, 'from sklearn.preprocessing import StandardScaler\n'), ((9233, 9249), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (9247, 9249), False, 'from sklearn.preprocessing import Stand... |
import os
import cv2
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image, ImageChops
from config_parser.config import CONFIG, IMAGE_PARAMS
try:
import deformation
HAS_DEFORMATION_LIB = True
except ModuleNotFoundError:
HAS_DEFORMATION_LIB = False
W = IMAGE_PARAMS["W"]
H = IMAGE_PARA... | [
"numpy.random.rand",
"numpy.arange",
"matplotlib.pyplot.imshow",
"numpy.multiply",
"numpy.reshape",
"numpy.where",
"cv2.medianBlur",
"os.path.normpath",
"numpy.stack",
"numpy.concatenate",
"cv2.blur",
"PIL.ImageChops.offset",
"cv2.getRotationMatrix2D",
"cv2.resize",
"cv2.GaussianBlur",
... | [((1888, 1914), 'os.path.normpath', 'os.path.normpath', (['img_path'], {}), '(img_path)\n', (1904, 1914), False, 'import os\n'), ((2221, 2279), 'cv2.resize', 'cv2.resize', (['img_arr', 'shape'], {'interpolation': 'cv2.INTER_LINEAR'}), '(img_arr, shape, interpolation=cv2.INTER_LINEAR)\n', (2231, 2279), False, 'import cv... |
# -*- coding: utf-8 -*-
# @Date : 2020/5/27
# @Author: Luokun
# @Email : <EMAIL>
import numpy as np
class AdaBoost:
"""
Adaptive Boosting(自适应提升算法)
"""
def __init__(self, n_estimators: int, lr=0.01, eps=1e-5):
"""
:param n_estimators: 弱分类器个数
:param eps: 误差阈值
"""
... | [
"numpy.where",
"numpy.log",
"numpy.exp",
"numpy.sum",
"numpy.empty",
"numpy.argmin"
] | [((434, 458), 'numpy.empty', 'np.empty', (['[n_estimators]'], {}), '([n_estimators])\n', (442, 458), True, 'import numpy as np\n'), ((1718, 1738), 'numpy.sum', 'np.sum', (['pred'], {'axis': '(0)'}), '(pred, axis=0)\n', (1724, 1738), True, 'import numpy as np\n'), ((1754, 1779), 'numpy.where', 'np.where', (['(pred > 0)'... |
#!/usr/bin/python3 python
# encoding: utf-8
'''
@author: 孙昊
@contact: <EMAIL>
@file: box.py
@time: 2021/2/23 上午10:26
@desc:
'''
import numpy as np
def Locations2Boxes(locations, priors, center_variance, size_variance):
"""Convert regressional location results of SSD into boxes in the form of (center_x, center_y, ... | [
"numpy.exp"
] | [((1292, 1334), 'numpy.exp', 'np.exp', (['(locations[..., 2:] * size_variance)'], {}), '(locations[..., 2:] * size_variance)\n', (1298, 1334), True, 'import numpy as np\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `pyswarms` package."""
# Import from __future__
from __future__ import with_statement
from __future__ import absolute_import
from __future__ import print_function
# Import modules
import unittest
import numpy as np
# Import from package
from pyswarms.utils.... | [
"pyswarms.utils.functions.single_obj.goldstein_func",
"numpy.ones",
"pyswarms.utils.functions.single_obj.rosenbrock_func",
"pyswarms.utils.functions.single_obj.bukin6_func",
"pyswarms.utils.functions.single_obj.schaffer2_func",
"pyswarms.utils.functions.single_obj.booth_func",
"pyswarms.utils.functions.... | [((9243, 9258), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9256, 9258), False, 'import unittest\n'), ((573, 589), 'numpy.zeros', 'np.zeros', (['[3, 2]'], {}), '([3, 2])\n', (581, 589), True, 'import numpy as np\n'), ((611, 626), 'numpy.ones', 'np.ones', (['[3, 2]'], {}), '([3, 2])\n', (618, 626), True, 'impor... |
#!/usr/bin/env python3
# Author: <NAME>
# Contact: <EMAIL>
"""Define data preprocessing operations for **PETGEM**."""
# ---------------------------------------------------------------
# Load python modules
# ---------------------------------------------------------------
import numpy as np
import h5py
import meshio
... | [
"h5py.File",
"numpy.array",
"numpy.zeros",
"meshio.read",
"scipy.spatial.Delaunay",
"numpy.full",
"numpy.int",
"numpy.arange"
] | [((2534, 2612), 'numpy.int', 'np.int', (['(self.basis_order * (self.basis_order + 2) * (self.basis_order + 3) / 2)'], {}), '(self.basis_order * (self.basis_order + 2) * (self.basis_order + 3) / 2)\n', (2540, 2612), True, 'import numpy as np\n'), ((3140, 3162), 'meshio.read', 'meshio.read', (['mesh_file'], {}), '(mesh_f... |
import numpy as np
def cosine_similarity(a, b):
a = np.squeeze(a)
b = np.squeeze(b)
assert a.shape[0] == b.shape[0]
return np.sum(a * b) / (np.linalg.norm(a) * np.linalg.norm(b))
| [
"numpy.sum",
"numpy.linalg.norm",
"numpy.squeeze"
] | [((58, 71), 'numpy.squeeze', 'np.squeeze', (['a'], {}), '(a)\n', (68, 71), True, 'import numpy as np\n'), ((80, 93), 'numpy.squeeze', 'np.squeeze', (['b'], {}), '(b)\n', (90, 93), True, 'import numpy as np\n'), ((141, 154), 'numpy.sum', 'np.sum', (['(a * b)'], {}), '(a * b)\n', (147, 154), True, 'import numpy as np\n')... |
"""
MIT License
Copyright (c) 2020 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publi... | [
"tensorflow.split",
"tensorflow.concat",
"numpy.stack",
"tensorflow.keras.backend.exp",
"tensorflow.convert_to_tensor",
"tensorflow.keras.activations.sigmoid",
"numpy.arange"
] | [((1391, 1438), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['anchors'], {'dtype': 'tf.float32'}), '(anchors, dtype=tf.float32)\n', (1411, 1438), True, 'import tensorflow as tf\n'), ((2252, 2297), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['_size'], {'dtype': 'tf.float32'}), '(_size, dtype=t... |
"""Working example of Soft Q-Learning."""
import numpy as np
import torch.optim
from rllib.agent import SoftQLearningAgent
from rllib.environment import GymEnvironment
from rllib.util.training.agent_training import evaluate_agent, train_agent
ENVIRONMENT = ["NChain-v0", "CartPole-v0"][1]
NUM_EPISODES = 50
MAX_STEPS... | [
"rllib.util.training.agent_training.train_agent",
"rllib.environment.GymEnvironment",
"rllib.agent.SoftQLearningAgent.default",
"numpy.random.seed",
"rllib.util.training.agent_training.evaluate_agent"
] | [((392, 412), 'numpy.random.seed', 'np.random.seed', (['SEED'], {}), '(SEED)\n', (406, 412), True, 'import numpy as np\n'), ((428, 461), 'rllib.environment.GymEnvironment', 'GymEnvironment', (['ENVIRONMENT', 'SEED'], {}), '(ENVIRONMENT, SEED)\n', (442, 461), False, 'from rllib.environment import GymEnvironment\n'), ((4... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__version__ = "0.1.0"
__author__ = "<NAME>"
from flask import flash
from flask import Flask
from flask import render_template
from flask import request
from keras.models import load_model
import os
import nump... | [
"flask.render_template",
"keras.models.load_model",
"numpy.reshape",
"flask.Flask",
"numpy.array"
] | [((335, 350), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (340, 350), False, 'from flask import Flask\n'), ((451, 504), 'flask.render_template', 'render_template', (['"""index.html"""'], {'class_finding': 'filename'}), "('index.html', class_finding=filename)\n", (466, 504), False, 'from flask import ren... |
import sys
import numpy as np
from gym import utils
from gym.envs.toy_text import discrete
from six import StringIO
LEFT = 0
DOWN = 1
RIGHT = 2
UP = 3
MAPS = {
"4x4": [ # Simple balanced paths
"S ",
" WW ",
" W ",
" G"
],
"5x5": [ # Unbalanced wi... | [
"numpy.random.choice",
"numpy.asarray",
"numpy.array",
"six.StringIO",
"gym.utils.colorize"
] | [((4504, 4560), 'numpy.random.choice', 'np.random.choice', (["[' ', 'W']", '(size, size)'], {'p': '[p, 1 - p]'}), "([' ', 'W'], (size, size), p=[p, 1 - p])\n", (4520, 4560), True, 'import numpy as np\n'), ((5903, 5930), 'numpy.asarray', 'np.asarray', (['desc'], {'dtype': '"""c"""'}), "(desc, dtype='c')\n", (5913, 5930)... |
from .output import pretty_draw
from .misc import constant, dataframe_value_mapping
import networkx as nx
import pandas as pd
import numpy as np
from copy import copy, deepcopy
from .formats import bif_parser
import os.path
from itertools import repeat, combinations
from .factor import TableFactor, DictValueMapping
d... | [
"numpy.prod",
"numpy.transpose",
"networkx.topological_sort",
"networkx.dfs_preorder_nodes",
"networkx.DiGraph",
"numpy.random.randint",
"numpy.zeros",
"networkx.compose",
"networkx.number_of_nodes",
"itertools.repeat"
] | [((3267, 3290), 'networkx.compose', 'nx.compose', (['self', 'other'], {}), '(self, other)\n', (3277, 3290), True, 'import networkx as nx\n'), ((4533, 4558), 'networkx.topological_sort', 'nx.topological_sort', (['self'], {}), '(self)\n', (4552, 4558), True, 'import networkx as nx\n'), ((9316, 9340), 'networkx.number_of_... |
import logging
from abc import ABCMeta, abstractmethod
import hgvsp
import numpy as np
import pandas as pd
from numpy.testing import assert_array_equal
from tqdm import tqdm
from joblib import Parallel, delayed
from . import constants, utilities, exceptions, LOGGER
logger = logging.getLogger(LOGGER)
class Vali... | [
"logging.getLogger",
"hgvsp.single_variant_re.fullmatch",
"hgvsp.multi_variant_re.fullmatch",
"joblib.Parallel",
"numpy.issubdtype",
"joblib.delayed",
"tqdm.tqdm.pandas",
"numpy.testing.assert_array_equal"
] | [((282, 307), 'logging.getLogger', 'logging.getLogger', (['LOGGER'], {}), '(LOGGER)\n', (299, 307), False, 'import logging\n'), ((6861, 6900), 'tqdm.tqdm.pandas', 'tqdm.pandas', ([], {'desc': '"""Validating variants"""'}), "(desc='Validating variants')\n", (6872, 6900), False, 'from tqdm import tqdm\n'), ((1104, 1146),... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 18 01:20:47 2021
@author: user
"""
import numpy as np
import matplotlib.pyplot as pt
S = np.array([[4410000*4410000*4410000,4410000*4410000, 4410000, 1],
[4830000*4830000*4830000,4830000*4830000,4830000,1],
[5250000*5250000*5250000,5250000*525000... | [
"numpy.copy",
"matplotlib.pyplot.plot",
"numpy.argmax",
"numpy.array",
"numpy.concatenate",
"numpy.shape",
"numpy.transpose"
] | [((139, 410), 'numpy.array', 'np.array', (['[[4410000 * 4410000 * 4410000, 4410000 * 4410000, 4410000, 1], [4830000 * \n 4830000 * 4830000, 4830000 * 4830000, 4830000, 1], [5250000 * 5250000 *\n 5250000, 5250000 * 5250000, 5250000, 1], [5670000 * 5670000 * 5670000, \n 5670000 * 5670000, 5670000, 1]]'], {}), '(... |
# !/usr/bin/env python
import tensorflow as tf
import numpy as np
from mnist import model
from flask import Flask, render_template, request, jsonify
app = Flask(__name__, template_folder='build', static_folder='build')
x = tf.placeholder("float", [None, 784])
sess = tf.Session()
with tf.variable_scope("convolutional... | [
"flask.render_template",
"tensorflow.variable_scope",
"flask.Flask",
"tensorflow.placeholder",
"tensorflow.train.Saver",
"tensorflow.Session",
"numpy.array",
"mnist.model.convolutional",
"flask.jsonify"
] | [((157, 220), 'flask.Flask', 'Flask', (['__name__'], {'template_folder': '"""build"""', 'static_folder': '"""build"""'}), "(__name__, template_folder='build', static_folder='build')\n", (162, 220), False, 'from flask import Flask, render_template, request, jsonify\n'), ((225, 261), 'tensorflow.placeholder', 'tf.placeho... |
import numpy as np
from tree.DecisionTreeClassifier import DecisionTreeClassifier
from scipy import stats # 用于求众数
class RandomForestClassifier:
def __init__(self, n_estimators: int = 5, min_samples_split: int = 5,
min_samples_leaf: int = 5, min_impurity_decrease: float = 0.0):
'''
... | [
"numpy.copy",
"numpy.sqrt",
"numpy.random.choice",
"scipy.stats.mode",
"tree.DecisionTreeClassifier.DecisionTreeClassifier",
"datasets.dataset.load_breast_cancer",
"numpy.sum",
"model_selection.train_test_split.train_test_split"
] | [((2334, 2354), 'datasets.dataset.load_breast_cancer', 'load_breast_cancer', ([], {}), '()\n', (2352, 2354), False, 'from datasets.dataset import load_breast_cancer\n'), ((2509, 2546), 'model_selection.train_test_split.train_test_split', 'train_test_split', (['X', 'Y'], {'test_size': '(0.2)'}), '(X, Y, test_size=0.2)\n... |
import torch
import random
import numpy as np
import os
import pandas as pd
import config
import cv2
import matplotlib.pyplot as plt
from dataset import ImageFolder
from torch.utils.data import DataLoader
from sklearn.model_selection import train_test_split
import albumentations as A
from albumentations.py... | [
"cv2.rectangle",
"pandas.read_csv",
"torch.sum",
"cv2.approxPolyDP",
"cv2.arcLength",
"cv2.contourArea",
"numpy.random.seed",
"sklearn.model_selection.train_test_split",
"albumentations.Normalize",
"torch.save",
"matplotlib.pyplot.show",
"dataset.ImageFolder",
"torch.manual_seed",
"albumen... | [((716, 739), 'random.seed', 'random.seed', (['SEED_VALUE'], {}), '(SEED_VALUE)\n', (727, 739), False, 'import random\n'), ((797, 823), 'numpy.random.seed', 'np.random.seed', (['SEED_VALUE'], {}), '(SEED_VALUE)\n', (811, 823), True, 'import numpy as np\n'), ((829, 858), 'torch.manual_seed', 'torch.manual_seed', (['SEED... |
# Y+
# X- car X+
# Y-
# icp takes points as [[x, x, x, x], [y, y, y, y]]
import numpy as np
VIS_RADIUS = 0
width = 0
num_samples = 0
def p2c(r, t):
"""polar r (float), theta (float) to cartesian x (float), y (float)"""
if np.isfinite(r) and np.isfinite(t):
return r * np.sin(t), r * np.cos(t) ... | [
"numpy.radians",
"numpy.sqrt",
"numpy.logical_and",
"numpy.absolute",
"numpy.take",
"numpy.array",
"numpy.argwhere",
"numpy.isfinite",
"numpy.arctan2",
"numpy.cos",
"numpy.sin",
"numpy.vectorize",
"numpy.arange"
] | [((619, 662), 'numpy.vectorize', 'np.vectorize', (['p2c', '[np.float32, np.float32]'], {}), '(p2c, [np.float32, np.float32])\n', (631, 662), True, 'import numpy as np\n'), ((670, 713), 'numpy.vectorize', 'np.vectorize', (['c2p', '[np.float32, np.float32]'], {}), '(c2p, [np.float32, np.float32])\n', (682, 713), True, 'i... |
import os
import sys
import gc
from collections import defaultdict
from numpy.lib.function_base import _DIMENSION_NAME
from src.api import target_class_lib as tc
project_directory = '/srv/target'
if os.path.join(project_directory, 'checkout') not in sys.path:
sys.path.append(os.path.join(project_directory, 'che... | [
"keras.layers.Dense",
"os.path.exists",
"src.api.target_class_lib.drop_multiperson_samples",
"sklearn.decomposition.PCA",
"src.api.target_class_lib.remove_bad_samples",
"sklearn.manifold.TSNE",
"keras.models.Model",
"numpy.random.seed",
"pandas.DataFrame",
"src.api.target_class_lib.get_fpkm",
"s... | [((342, 433), 'os.path.join', 'os.path.join', (['project_directory', '"""data"""', '"""all_gene_expression_files_in_target"""', '"""links"""'], {}), "(project_directory, 'data',\n 'all_gene_expression_files_in_target', 'links')\n", (354, 433), False, 'import os\n'), ((448, 517), 'os.path.join', 'os.path.join', (['pr... |
import pytest
import numpy as np
import scipy.stats
import focal_stats
def test_focal_stats_values():
a = np.random.rand(5, 5)
# Values when not reducing
assert np.allclose(focal_stats.focal_mean(a)[2, 2], a.mean())
assert np.allclose(focal_stats.focal_sum(a)[2, 2], a.sum())
assert np.allclose(fo... | [
"focal_stats.focal_std",
"numpy.random.rand",
"numpy.ones",
"numpy.arange",
"focal_stats.focal_majority",
"focal_stats.focal_mean",
"focal_stats.focal_min",
"focal_stats.focal_sum",
"pytest.mark.parametrize",
"pytest.raises",
"focal_stats.focal_max",
"focal_stats.rolling_window",
"numpy.rand... | [((2648, 2875), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fs,np_fs"""', '[(focal_stats.focal_mean, np.nanmean), (focal_stats.focal_sum, np.nansum),\n (focal_stats.focal_min, np.nanmin), (focal_stats.focal_max, np.nanmax),\n (focal_stats.focal_std, np.nanstd)]'], {}), "('fs,np_fs', [(focal_stats.... |
#
# $Id$
#
# Copyright (C)
# 2014 - $Date$
# <NAME> <<EMAIL>>
# 2010-2012
# <NAME>, <NAME>
#
# This file implements tests for indexing functionalities of the
# boost::numpy::ndarray class.
#
# This file is distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt or cop... | [
"indexing_test_module.index_array",
"indexing_test_module.single",
"indexing_test_module.index_array_2d",
"numpy.array",
"indexing_test_module.slice",
"unittest.main",
"indexing_test_module.index_array_slice",
"numpy.arange"
] | [((2055, 2070), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2068, 2070), False, 'import unittest\n'), ((511, 527), 'numpy.arange', 'np.arange', (['(0)', '(10)'], {}), '(0, 10)\n', (520, 527), True, 'import numpy as np\n'), ((761, 777), 'numpy.arange', 'np.arange', (['(0)', '(10)'], {}), '(0, 10)\n', (770, 777)... |
import argparse
import itertools
import os
import pickle
import sys
import datetime
import string
import math
import random
import json
import shutil
import numpy as np
import tensorflow as tf
from paragraph_batch_utils import batch_data_generator, pad_paragraphs_to_seq_length
def randomword(length):
"""
... | [
"tensorflow.get_variable",
"numpy.mean",
"os.path.exists",
"tensorflow.squared_difference",
"tensorflow.placeholder",
"tensorflow.Session",
"numpy.asarray",
"tensorflow.nn.dynamic_rnn",
"tensorflow.nn.rnn_cell.LSTMCell",
"tensorflow.matmul",
"tensorflow.train.exponential_decay",
"tensorflow.tr... | [((1132, 1194), 'paragraph_batch_utils.pad_paragraphs_to_seq_length', 'pad_paragraphs_to_seq_length', (['X'], {'max_seq_length': 'max_seq_length'}), '(X, max_seq_length=max_seq_length)\n', (1160, 1194), False, 'from paragraph_batch_utils import batch_data_generator, pad_paragraphs_to_seq_length\n'), ((1357, 1394), 'num... |
#!/usr/bin/env python
# encoding: utf-8
"""
@Author: yangwenhao
@Contact: <EMAIL>
@Software: PyCharm
@File: 4.3_WorkingWithKernels.py
@Time: 2019/1/4 上午11:29
@Overview: The prior SVMs worked with linear separable data. If we would like to separate non-linear data, we can change how we project the linear separator onto... | [
"tensorflow.transpose",
"matplotlib.pyplot.ylabel",
"tensorflow.reduce_sum",
"tensorflow.multiply",
"numpy.array",
"matplotlib.pyplot.GridSpec",
"sklearn.datasets.make_circles",
"tensorflow.reduce_mean",
"numpy.arange",
"matplotlib.pyplot.contourf",
"tensorflow.random_normal",
"tensorflow.plac... | [((589, 601), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (599, 601), True, 'import tensorflow as tf\n'), ((731, 790), 'sklearn.datasets.make_circles', 'datasets.make_circles', ([], {'n_samples': '(500)', 'factor': '(0.5)', 'noise': '(0.1)'}), '(n_samples=500, factor=0.5, noise=0.1)\n', (752, 790), False, 'fr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 27 23:35:00 2019
Exercise 20
@author: <NAME>
"""
#from visual.graph import gdisplay
#from visual.graph import gcurve
#import visual.graph as g
import numpy as np
import scipy as sc
t=np.arange(0,10.001,.01)
y1=zeros((2),float)
y=zeros((2),flo... | [
"numpy.arange"
] | [((260, 286), 'numpy.arange', 'np.arange', (['(0)', '(10.001)', '(0.01)'], {}), '(0, 10.001, 0.01)\n', (269, 286), True, 'import numpy as np\n'), ((395, 421), 'numpy.arange', 'np.arange', (['(0)', '(10.001)', '(0.01)'], {}), '(0, 10.001, 0.01)\n', (404, 421), True, 'import numpy as np\n'), ((425, 451), 'numpy.arange', ... |
import scanpy as sc
import numpy as np
import sys
in_file = sys.argv[1]
out_file = sys.argv[2]
dataset = sc.read(in_file)
dataset.X = np.nan_to_num(dataset.X, copy=True, nan=0.0, posinf=0.0, neginf=0.0)
dataset.obsm["X_tsne"] = dataset.obs[['l1-tsne_0', 'l1-tsne_1']].to_numpy()
dataset.obsm["X_umap"] = dataset.obs[... | [
"numpy.nan_to_num",
"scanpy.read"
] | [((108, 124), 'scanpy.read', 'sc.read', (['in_file'], {}), '(in_file)\n', (115, 124), True, 'import scanpy as sc\n'), ((137, 205), 'numpy.nan_to_num', 'np.nan_to_num', (['dataset.X'], {'copy': '(True)', 'nan': '(0.0)', 'posinf': '(0.0)', 'neginf': '(0.0)'}), '(dataset.X, copy=True, nan=0.0, posinf=0.0, neginf=0.0)\n', ... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
"pysc2.lib.actions.FunctionCall",
"lib.option.mineral_worker",
"lib.utils.get_unit_mask_screen",
"lib.replay_buffer.Cnn_Buffer",
"lib.utils.get_power_mask_screen",
"lib.utils.get_best_army",
"lib.utils.get_input",
"numpy.concatenate",
"lib.utils.find_gas",
"lib.option.check_params",
"lib.utils.g... | [((2015, 2023), 'lib.replay_buffer.Buffer', 'Buffer', ([], {}), '()\n', (2021, 2023), False, 'from lib.replay_buffer import Buffer, Cnn_Buffer\n'), ((2051, 2059), 'lib.replay_buffer.Buffer', 'Buffer', ([], {}), '()\n', (2057, 2059), False, 'from lib.replay_buffer import Buffer, Cnn_Buffer\n'), ((2087, 2095), 'lib.repla... |
"""Module for building new datasets or reading it from files. Upper layer of data (sequence) management."""
# pylint: disable=too-many-arguments, too-many-locals
import gzip
import math
import os
import pickle
import random
import sys
from collections import defaultdict
import numpy as np
from Bio import SeqIO
from Bi... | [
"pickle.dump",
"math.ceil",
"gzip.open",
"Bio.Seq.Seq",
"pickle.load",
"os.path.join",
"numpy.asarray",
"numpy.max",
"os.path.isfile",
"sklearn.cross_validation.LabelShuffleSplit",
"numpy.array",
"VirClass.VirClass.load_ncbi.load_seqs_from_ncbi",
"collections.defaultdict",
"Bio.SeqIO.parse... | [((5957, 5974), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (5968, 5974), False, 'from collections import defaultdict\n'), ((10319, 10408), 'sklearn.cross_validation.LabelShuffleSplit', 'cross_validation.LabelShuffleSplit', (['oids'], {'n_iter': '(1)', 'test_size': 'test', 'random_state': 'see... |
"""
Venn diagram 2 & 3 Example
==========================
Here shows how to draw venn diagram
"""
import numpy as np
import pandas as pd
import milkviz as mv
# %%
# Data input for venn diagram
# -------------------------------------
# There are three types of data input
#
# 1. Specific a list of sets
#
# 2. Speci... | [
"numpy.random.randint",
"milkviz.venn"
] | [((870, 911), 'milkviz.venn', 'mv.venn', (['list_sets'], {'names': "['A', 'B', 'C']"}), "(list_sets, names=['A', 'B', 'C'])\n", (877, 911), True, 'import milkviz as mv\n'), ((912, 930), 'milkviz.venn', 'mv.venn', (['list_list'], {}), '(list_list)\n', (919, 930), True, 'import milkviz as mv\n'), ((931, 949), 'milkviz.ve... |
try:
import pyfmmlib2d
except:
pass
import pykifmm2d
import numpy as np
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
plt.ion()
"""
Demonstration of the FMM for the Laplace Kernel
If N <= 50000, will do a direct sum and compare to this
Otherwise, will try to call FMMLIB2D through pyfmmlib2d
T... | [
"numpy.abs",
"numpy.repeat",
"numpy.random.rand",
"pyfmmlib2d.RFMM",
"numpy.zeros",
"pykifmm2d.on_the_fly_fmm",
"numpy.row_stack",
"matplotlib.pyplot.ion",
"pykifmm2d.fmm.planned_fmm",
"pykifmm2d.fmm.fmm_planner",
"time.time"
] | [((143, 152), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (150, 152), True, 'import matplotlib.pyplot as plt\n'), ((1190, 1233), 'numpy.repeat', 'np.repeat', (['center_clusters_x', 'N_per_cluster'], {}), '(center_clusters_x, N_per_cluster)\n', (1199, 1233), True, 'import numpy as np\n'), ((1251, 1294), 'numpy... |
import streamlit as st
from io import StringIO
import os
import pickle
import re
from sklearn.linear_model import LogisticRegression
from sklearn.feature_extraction.text import TfidfVectorizer
import pandas as pd
import numpy as np
from preproc import remove_urls
from preproc import lemmatize_words
from preproc import ... | [
"nltk.download",
"pandas.read_csv",
"streamlit.button",
"time.sleep",
"preproc.remove_urls",
"streamlit.text_area",
"preproc.correct_spellings",
"streamlit.header",
"streamlit.title",
"preproc.remove_punctuation",
"streamlit.warning",
"preproc.lemmatize_words",
"streamlit.sidebar.checkbox",
... | [((4191, 4236), 'streamlit.title', 'st.title', (['"""COVID-19 Tweet Sentiment Analysis"""'], {}), "('COVID-19 Tweet Sentiment Analysis')\n", (4199, 4236), True, 'import streamlit as st\n'), ((4489, 4515), 'keras.models.load_model', 'load_model', (['"""models/NN.h5"""'], {}), "('models/NN.h5')\n", (4499, 4515), False, '... |
from sqlite3 import DateFromTicks
import matplotlib
import matplotlib.dates
from matplotlib.dates import date2num
import numpy
def polyfit(dates,levels,p):
dateFloat = []
d0 = 0
for date in dates:
dateFloat.append(date2num(date))
polyCoeff = numpy.polyfit(dateFloat,levels,p)
poly = numpy.pol... | [
"numpy.poly1d",
"matplotlib.dates.date2num",
"numpy.polyfit"
] | [((266, 301), 'numpy.polyfit', 'numpy.polyfit', (['dateFloat', 'levels', 'p'], {}), '(dateFloat, levels, p)\n', (279, 301), False, 'import numpy\n'), ((311, 334), 'numpy.poly1d', 'numpy.poly1d', (['polyCoeff'], {}), '(polyCoeff)\n', (323, 334), False, 'import numpy\n'), ((234, 248), 'matplotlib.dates.date2num', 'date2n... |
import os
import requests
import json
import dateutil.parser
import time
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from util import load_ground_truth, get_sysnset_map, is_predict_correct
IMG_DIR = '/opt/client/data/val_img'
GROUND_TRUTH_FILE = './data/ILSVRC2012_validation_groun... | [
"numpy.mean",
"os.listdir",
"requests.Session",
"requests.adapters.HTTPAdapter",
"csv.writer",
"os.path.splitext",
"time.sleep",
"requests.delete",
"numpy.linspace",
"util.is_predict_correct",
"util.load_ground_truth",
"time.time",
"util.get_sysnset_map"
] | [((945, 963), 'requests.Session', 'requests.Session', ([], {}), '()\n', (961, 963), False, 'import requests\n'), ((979, 1026), 'requests.adapters.HTTPAdapter', 'requests.adapters.HTTPAdapter', ([], {'pool_maxsize': '(100)'}), '(pool_maxsize=100)\n', (1008, 1026), False, 'import requests\n'), ((1224, 1235), 'time.time',... |
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.backends.backend_pdf import PdfPages
"""
Notes for future:
You set up the basic elements of a curve, but not everything
is truly automated. Need to:
1. Automate ... | [
"matplotlib.pyplot.text",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.y... | [((13023, 13057), 'numpy.arange', 'np.arange', (['(0)', '(10000)', '(1 * supplyInc)'], {}), '(0, 10000, 1 * supplyInc)\n', (13032, 13057), True, 'import numpy as np\n'), ((13066, 13101), 'numpy.arange', 'np.arange', (['(10000)', '(0)', '(-1 * demandInc)'], {}), '(10000, 0, -1 * demandInc)\n', (13075, 13101), True, 'imp... |
'''
Created on Nov 25, 2011
@author: cryan
Code for numerical optimal control.
'''
import numpy as np
from numpy import sin,cos
from copy import deepcopy
from scipy.constants import pi
from scipy.linalg import expm
from scipy.linalg import eigh
from scipy.optimize import fmin_l_bfgs_b
import matplotlib.pyplot a... | [
"numpy.copy",
"numpy.eye",
"numpy.ones_like",
"numpy.ceil",
"numpy.ones",
"numpy.sqrt",
"Evolution.expm_eigen",
"numpy.log",
"numpy.exp",
"numpy.sum",
"numpy.zeros",
"numpy.dot",
"numpy.linspace",
"numpy.cos",
"copy.deepcopy",
"numpy.sin",
"numpy.zeros_like"
] | [((2031, 2157), 'numpy.zeros', 'np.zeros', (['(systemParams.numControlHams, optimParams.numTimeSteps, systemParams.dim,\n systemParams.dim)'], {'dtype': 'np.complex128'}), '((systemParams.numControlHams, optimParams.numTimeSteps,\n systemParams.dim, systemParams.dim), dtype=np.complex128)\n', (2039, 2157), True, ... |
from torchvision.datasets import VisionDataset
import warnings
import torch
from PIL import Image
import os
import os.path
import numpy as np
from torchvision import transforms
def pil_loader(path):
# open path as file to avoid ResourceWarning (https://github.com/python-pillow/Pillow/issues/835)
with open(pat... | [
"numpy.dtype",
"PIL.Image.open",
"numpy.delete",
"torchvision.transforms.RandomCrop",
"numpy.empty",
"numpy.concatenate",
"torchvision.transforms.Normalize",
"torchvision.transforms.Resize",
"torchvision.transforms.ToTensor"
] | [((349, 362), 'PIL.Image.open', 'Image.open', (['f'], {}), '(f)\n', (359, 362), False, 'from PIL import Image\n'), ((2337, 2377), 'numpy.delete', 'np.delete', (['self.samples', 'reduced'], {'axis': '(0)'}), '(self.samples, reduced, axis=0)\n', (2346, 2377), True, 'import numpy as np\n'), ((1061, 1093), 'numpy.empty', '... |
import pytest
from mapreader import classifier
from mapreader import loadAnnotations
from mapreader import patchTorchDataset
import numpy as np
import torch
from torch import nn
import torchvision
from torchvision import transforms
from torchvision import models
PATH2IMAGES = "./examples/non-geospatial/classificati... | [
"mapreader.loadAnnotations",
"torch.nn.CrossEntropyLoss",
"mapreader.loader",
"torchvision.transforms.Resize",
"torch.Tensor",
"torchvision.transforms.RandomHorizontalFlip",
"numpy.array",
"torchvision.transforms.RandomVerticalFlip",
"torchvision.transforms.Normalize",
"mapreader.patchTorchDataset... | [((573, 592), 'mapreader.loader', 'loader', (['PATH2IMAGES'], {}), '(PATH2IMAGES)\n', (579, 592), False, 'from mapreader import loader\n'), ((1380, 1397), 'mapreader.loadAnnotations', 'loadAnnotations', ([], {}), '()\n', (1395, 1397), False, 'from mapreader import loadAnnotations\n'), ((4310, 4387), 'mapreader.patchTor... |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # Supress TF debugging info. (Uncomment in case of debugging)
import tensorflow as tf
import cv2
import numpy as np
import core.utils as utils
from core.yolov4 import filter_boxes
from tensorflow.python.saved_model import tag_constants
from tensorflow.compat.v1 impo... | [
"tensorflow.lite.Interpreter",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.shape",
"core.utils.detect_coordinates",
"numpy.asarray",
"tensorflow.constant",
"cv2.cvtColor",
"cv2.resize",
"cv2.imread"
] | [((1007, 1062), 'tensorflow.lite.Interpreter', 'tf.lite.Interpreter', ([], {'model_path': 'FLAGS.detection_weights'}), '(model_path=FLAGS.detection_weights)\n', (1026, 1062), True, 'import tensorflow as tf\n'), ((2472, 2532), 'tensorflow.lite.Interpreter', 'tf.lite.Interpreter', ([], {'model_path': 'FLAGS.classificatio... |
import numpy as np
my_list = [10,20,30,40,50,60]
arr = np.array(my_list)
print("Array:",arr)
print('Dimension:',arr.ndim)
res = arr.reshape(2,3)
print(res)
print("Dimension",res.ndim)
new_list = [10,20,30,40,50,60,70,80]
newarr=np.array(new_list)
holder = newarr.reshape(2,2,2)
print(holder)
| [
"numpy.array"
] | [((57, 74), 'numpy.array', 'np.array', (['my_list'], {}), '(my_list)\n', (65, 74), True, 'import numpy as np\n'), ((234, 252), 'numpy.array', 'np.array', (['new_list'], {}), '(new_list)\n', (242, 252), True, 'import numpy as np\n')] |
#!/mnt/data1/Matt/anaconda_install/anaconda2/envs/matt_EMAN2/bin/python
################################################################################
# imports
import argparse; import sys
parser = argparse.ArgumentParser('Generate noisy and noiseless 2D projections of randomly oriented and translated MRC files.')
pa... | [
"numpy.mean",
"json.loads",
"os.listdir",
"numpy.ones",
"argparse.ArgumentParser",
"numpy.random.RandomState",
"mrcfile.new",
"json.dumps",
"numpy.std",
"numpy.sum",
"numpy.zeros",
"multiprocessing.Pool",
"sys.exit",
"skimage.morphology.disk",
"glob.glob"
] | [((200, 327), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Generate noisy and noiseless 2D projections of randomly oriented and translated MRC files."""'], {}), "(\n 'Generate noisy and noiseless 2D projections of randomly oriented and translated MRC files.'\n )\n", (223, 327), False, 'import argpa... |
"""
~~~ RUNS SIMULATIONS OF THE DIMENSIONLESS PROCESSED INITIAL DATA ~~~
This code reads in the dimensionless initial data and runs simulations of NLS, Dysthe, dNLS, and vDysthe.
1. Get the dimensionless chi values, define a new time vector, and save it
2. Get the dimensionless xi and B values
3. Run simulations and... | [
"vDysthe.sixth",
"NLS.sixth",
"Dysthe.kvec",
"numpy.linspace",
"Dysthe.sixth",
"numpy.sin",
"dNLS.sixth",
"numpy.loadtxt"
] | [((822, 867), 'numpy.linspace', 'np.linspace', (['times[0]', 'times[-1]', 'Num_O_Times'], {}), '(times[0], times[-1], Num_O_Times)\n', (833, 867), True, 'import numpy as np\n'), ((1624, 1643), 'Dysthe.kvec', 'dy.kvec', (['gridnum', 'L'], {}), '(gridnum, L)\n', (1631, 1643), True, 'import Dysthe as dy\n'), ((1179, 1193)... |
'''
Sample selection function.
'''
import pickle
from collections import defaultdict
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import KFold
from sklearn.decomposition import PCA
import networkx as nx
import SPD
import proposed_method.data_utils as data_utils
d... | [
"numpy.argsort",
"numpy.array",
"numpy.stack",
"collections.defaultdict",
"sklearn.model_selection.KFold",
"sklearn.linear_model.LinearRegression"
] | [((545, 561), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (556, 561), False, 'from collections import defaultdict\n'), ((1360, 1378), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {}), '()\n', (1376, 1378), False, 'from sklearn.linear_model import LinearRegression\n'), ((1693... |
import numpy as np
import sys
from six import StringIO, b
from gym import utils
from gym.envs.toy_text import discrete
LEFT = 0
DOWN = 1
RIGHT = 2
UP = 3
MAPS = {
"4x4": [
"SFFF",
"FFFF",
"FFFF",
"FFFG"
],
"8x8": [
"SFFFFFFF",
"FFFFFFFF",
"FFFFFFFF"... | [
"numpy.array",
"numpy.asarray",
"six.StringIO",
"gym.utils.colorize"
] | [((1170, 1197), 'numpy.asarray', 'np.asarray', (['desc'], {'dtype': '"""c"""'}), "(desc, dtype='c')\n", (1180, 1197), True, 'import numpy as np\n'), ((3937, 3990), 'gym.utils.colorize', 'utils.colorize', (['desc[row][col]', '"""red"""'], {'highlight': '(True)'}), "(desc[row][col], 'red', highlight=True)\n", (3951, 3990... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import io
import random
#from dtw import * #pip install dtw-python
from fastdtw import fastdtw # pip install fastdtw
from itertools import islice
import statistics
import math
import ipywidgets as widgets
from IPython.display import display,Javas... | [
"itertools.islice",
"matplotlib.pyplot.grid",
"collections.deque",
"numpy.ones",
"os.listdir",
"matplotlib.pyplot.ylabel",
"pandas.read_csv",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"os.path.join",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.figure",
"matplotlib.pyp... | [((426, 464), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 14}"], {}), "({'font.size': 14})\n", (445, 464), True, 'import matplotlib.pyplot as plt\n'), ((562, 626), 'matplotlib.pyplot.grid', 'plt.grid', ([], {'axis': '"""y"""', 'color': '"""#cccccc"""', 'linestyle': '"""--"""', 'linewidt... |
# _*_ coding: utf-8 _*_
__author__ = '<NAME>'
__date__ = '1/22/2018 3:25 PM'
from sklearn.cross_validation import train_test_split
import pandas as pd
import numpy as np
from sklearn.externals import joblib
print("hello program started!")
data = pd.read_csv("data/master_frame2.csv")
feature_list = [i for i in data]
... | [
"pandas.read_csv",
"sklearn.externals.joblib.load",
"numpy.array",
"sklearn.cross_validation.train_test_split",
"pandas.to_datetime"
] | [((249, 286), 'pandas.read_csv', 'pd.read_csv', (['"""data/master_frame2.csv"""'], {}), "('data/master_frame2.csv')\n", (260, 286), True, 'import pandas as pd\n'), ((538, 573), 'numpy.array', 'np.array', (['data[feature_list].values'], {}), '(data[feature_list].values)\n', (546, 573), True, 'import numpy as np\n'), ((6... |
"""Datasource module, containing the :class:`DataSource`
and :class:`ProfileDataSource` classes.
"""
import os
import numpy as np
import netCDF4
from cloudnetpy import RadarArray, CloudnetArray, utils
class DataSource:
"""Base class for all Cloudnet measurements and model data.
Args:
filename (str): ... | [
"numpy.array",
"cloudnetpy.utils.seconds2hours",
"netCDF4.Dataset",
"os.path.basename"
] | [((952, 978), 'os.path.basename', 'os.path.basename', (['filename'], {}), '(filename)\n', (968, 978), False, 'import os\n'), ((1002, 1027), 'netCDF4.Dataset', 'netCDF4.Dataset', (['filename'], {}), '(filename)\n', (1017, 1027), False, 'import netCDF4\n'), ((5183, 5225), 'numpy.array', 'np.array', (['(range_instrument +... |
import matplotlib.pyplot as plt
import numpy as np
import os
from shutil import copyfile
import pdb
data_dir = '/home/abel/DATA/ILSVRC/'
checkpoint_dir = '/home/abel/DATA/faster_rcnn/resnet101_coco/checkpoints/'
name = 'EntAllVideos-NeighCycle'
run = 1
data_info = {'data_dir': data_dir,
'annotations_dir'... | [
"os.path.exists",
"os.path.join",
"os.makedirs",
"numpy.max"
] | [((1849, 1917), 'os.path.join', 'os.path.join', (["data_info['data_dir']", '"""AL"""', "(data_info['set'] + '.txt')"], {}), "(data_info['data_dir'], 'AL', data_info['set'] + '.txt')\n", (1861, 1917), False, 'import os\n'), ((1083, 1103), 'numpy.max', 'np.max', (['frames_video'], {}), '(frames_video)\n', (1089, 1103), T... |
import os
import time
import psutil
import pprint
import torch
import torch.nn.functional as F
import numpy as np
from models.classification_heads import ClassificationHead
from models.R2D2_embedding import R2D2Embedding
from models.protonet_embedding import ProtoNetEmbedding
from models.ResNet12_embeddin... | [
"torch.optim.lr_scheduler.LambdaLR",
"numpy.array",
"torch.nn.functional.softmax",
"os.path.exists",
"numpy.asarray",
"os.path.split",
"os.mkdir",
"os.getpid",
"torch.argmax",
"torch.optim.SGD",
"models.R2D2_embedding.R2D2Embedding",
"models.ResNet12_embedding.resnet12",
"models.protonet_emb... | [((7544, 7573), 'torch.cuda.memory_allocated', 'torch.cuda.memory_allocated', ([], {}), '()\n', (7571, 7573), False, 'import torch\n'), ((9763, 9850), 'torch.optim.lr_scheduler.LambdaLR', 'torch.optim.lr_scheduler.LambdaLR', (['optimizer'], {'lr_lambda': 'lambda_epoch', 'last_epoch': '(-1)'}), '(optimizer, lr_lambda=la... |
import pandas as pd
from sklearn.metrics.pairwise import cosine_similarity
import networkx as nx
from sklearn.cluster import KMeans
import matplotlib.colors as colors
from itertools import cycle
import time
import matplotlib.pyplot as plt
import subprocess
from utils import tsne
import pdb
import numpy as np
from sklea... | [
"pandas.read_pickle",
"sklearn.cluster.KMeans",
"utils.tsne",
"numpy.unique",
"scipy.io.loadmat",
"numpy.asarray",
"networkx.Graph",
"numpy.array",
"matplotlib.pyplot.figure",
"tensorflow.config.experimental.list_physical_devices",
"subprocess.call",
"matplotlib.pyplot.scatter",
"networkx.wr... | [((981, 1012), 'scipy.io.loadmat', 'sio.loadmat', (['"""wine_network.mat"""'], {}), "('wine_network.mat')\n", (992, 1012), True, 'import scipy.io as sio\n'), ((1022, 1051), 'scipy.io.loadmat', 'sio.loadmat', (['"""wine_label.mat"""'], {}), "('wine_label.mat')\n", (1033, 1051), True, 'import scipy.io as sio\n'), ((1124,... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import time
import numpy as np
import tensorflow as tf
import utils.utils as utils
class Evaluator:
def __init__(self,
cmd_args, config, optimizer, learning_rate, loss, sav... | [
"tensorflow.initialize_all_variables",
"tensorflow.Session",
"os.path.dirname",
"numpy.ndarray",
"utils.utils.error_rate",
"sys.stdout.flush",
"time.time"
] | [((917, 972), 'numpy.ndarray', 'np.ndarray', ([], {'shape': '(size, num_classes)', 'dtype': 'np.float32'}), '(shape=(size, num_classes), dtype=np.float32)\n', (927, 972), True, 'import numpy as np\n'), ((2430, 2441), 'time.time', 'time.time', ([], {}), '()\n', (2439, 2441), False, 'import time\n'), ((2375, 2407), 'os.p... |
import numpy
import sys
from Algorithms.Logistic.Executor.logistic_executor import LogisticExecutor
from Algorithms.Logistic.Solver.logistic_solver import LogisticSolver
from Utils.DCA import sparse_optimization_dca, feasibility_detection_dca, dca_solver
from constants import GS_DCA, GS_SDR, PERFECT_AGGREGATION, DCA_ON... | [
"numpy.multiply",
"numpy.sqrt",
"numpy.add",
"Utils.DCA.sparse_optimization_dca",
"Utils.DCA.feasibility_detection_dca",
"numpy.floor",
"numpy.subtract",
"Algorithms.Logistic.Executor.logistic_executor.LogisticExecutor",
"numpy.zeros",
"numpy.dot",
"numpy.random.randn",
"sys.path.append"
] | [((357, 382), 'sys.path.append', 'sys.path.append', (['home_dir'], {}), '(home_dir)\n', (372, 382), False, 'import sys\n'), ((1896, 1920), 'numpy.zeros', 'numpy.zeros', (['(self.d, 1)'], {}), '((self.d, 1))\n', (1907, 1920), False, 'import numpy\n'), ((2778, 2792), 'numpy.sqrt', 'numpy.sqrt', (['(10)'], {}), '(10)\n', ... |
# -*- coding: utf-8 -*-
#
# ensemble.py
#
# This module is part of dstools.
#
"""
Tools for combining base estimators to build a learning algorithm with
improved robustness over a single estimator.
"""
__author__ = '<NAME>'
__email__ = '<EMAIL>'
import numpy as np
from scipy import sparse
from dstools.base import ... | [
"sklearn.datasets.load_iris",
"sklearn.model_selection.GridSearchCV",
"sklearn.utils.validation.check_array",
"sklearn.linear_model.Lasso",
"numpy.hstack",
"sklearn.utils.validation.check_X_y",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.linear_model... | [((3877, 3897), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (3895, 3897), False, 'from sklearn import datasets\n'), ((5081, 5116), 'sklearn.neighbors.KNeighborsClassifier', 'KNeighborsClassifier', ([], {'n_neighbors': '(1)'}), '(n_neighbors=1)\n', (5101, 5116), False, 'from sklearn.neighbors i... |
"""Many Neurons."""
from __future__ import print_function, absolute_import
import numpy as np
import matplotlib.pyplot as plt
import nengo
from nengo.utils.ensemble import sorted_neurons
from nengo.utils.matplotlib import rasterplot
# build model
model = nengo.Network(label="Many neurons.")
with model:
A = nen... | [
"nengo.Network",
"nengo.Probe",
"matplotlib.pyplot.show",
"nengo.Ensemble",
"numpy.sin",
"matplotlib.pyplot.figure",
"nengo.Connection",
"nengo.Simulator",
"matplotlib.pyplot.legend",
"nengo.utils.ensemble.sorted_neurons"
] | [((259, 295), 'nengo.Network', 'nengo.Network', ([], {'label': '"""Many neurons."""'}), "(label='Many neurons.')\n", (272, 295), False, 'import nengo\n'), ((651, 663), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (661, 663), True, 'import matplotlib.pyplot as plt\n'), ((788, 800), 'matplotlib.pyplot.lege... |
import os, time, json
import numpy as np
from scellseg import models, io, metrics
from scellseg.contrast_learning.dataset import DatasetPairEval
from scellseg.dataset import DatasetShot, DatasetQuery
from torch.utils.data import DataLoader
from scellseg.utils import set_manual_seed, make_folder, process_different_mode... | [
"scellseg.utils.process_different_model",
"numpy.array",
"numpy.arange",
"scellseg.metrics.average_precision",
"scellseg.models.sCellSeg",
"scellseg.io.get_image_files",
"pandas.concat",
"pandas.DataFrame",
"scellseg.io.imread",
"scellseg.metrics.refine_masks",
"time.time",
"warnings.filterwar... | [((430, 463), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (453, 463), False, 'import warnings\n'), ((724, 760), 'os.path.join', 'os.path.join', (['project_path', '"""output"""'], {}), "(project_path, 'output')\n", (736, 760), False, 'import os, time, json\n'), ((761, 78... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.