code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import cv2
import numpy as np
img = cv2.imread("test1.jpg")
emptyImage = np.zeros(img.shape, np.uint8)
emptyImage2 = img.copy()
emptyImage3=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
cv2.imshow("EmptyImage3", emptyImage3)
cv2.waitKey (0)
cv2.destroyAllWindows()
| [
"cv2.cvtColor",
"cv2.waitKey",
"cv2.destroyAllWindows",
"numpy.zeros",
"cv2.imread",
"cv2.imshow"
] | [((43, 66), 'cv2.imread', 'cv2.imread', (['"""test1.jpg"""'], {}), "('test1.jpg')\n", (53, 66), False, 'import cv2\n'), ((82, 111), 'numpy.zeros', 'np.zeros', (['img.shape', 'np.uint8'], {}), '(img.shape, np.uint8)\n', (90, 111), True, 'import numpy as np\n'), ((159, 196), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.... |
#!/usr/bin/env python
#
# atlaspanel.py - The AtlasPanel class.
#
# Author: <NAME> <<EMAIL>>
#
"""This module provides the :class:`AtlasPanel`, a *FSLeyes control* panel
which allows the user to browse the FSL atlas images. See the
:mod:`~fsleyes` package documentation for more details on control panels,
and the :mod:`... | [
"fsleyes.controls.controlpanel.ControlPanel.destroy",
"fsleyes.controls.controlpanel.ControlPanel.__init__",
"wx.BoxSizer",
"numpy.concatenate",
"numpy.abs",
"fsl.utils.idle.idle",
"fsl.data.atlases.getAtlasDescription",
"fsleyes_props.suppress",
"fsl.data.atlases.loadAtlas",
"fsl.data.image.Image... | [((1125, 1152), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1142, 1152), False, 'import logging\n'), ((5725, 5810), 'fsleyes.controls.controlpanel.ControlPanel.__init__', 'ctrlpanel.ControlPanel.__init__', (['self', 'parent', 'overlayList', 'displayCtx', 'viewPanel'], {}), '(self, par... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"jax.numpy.array",
"numpy.load",
"numpy.dtype",
"jax.test_util._default_tolerance.copy",
"jax.test_util.device_under_test"
] | [((1191, 1220), 'jax.test_util._default_tolerance.copy', 'jtu._default_tolerance.copy', ([], {}), '()\n', (1218, 1220), True, 'import jax.test_util as jtu\n'), ((3660, 3770), 'jax.numpy.array', 'jnp.array', (['[[C[0, 0], C[0, 3], C[0, 4]], [C[0, 3], C[0, 1], C[0, 5]], [C[0, 4], C[0, 5\n ], C[0, 2]]]', 'dtype'], {}),... |
# Version 1.0.0 Released: 14/11/21
# <NAME>
# <EMAIL>
# License Apache 2.0
# ==================================================================================================================================================================================
#LaharZ v0.3 - working
#Laharz v0.4 - temporary version - not t... | [
"tkinter.StringVar",
"PIL.Image.new",
"numpy.amin",
"numpy.empty",
"scipy.ndimage.binary_fill_holes",
"tkinter.ttk.Progressbar",
"gmsh.model.add",
"numpy.shape",
"os.path.isfile",
"tkinter.BooleanVar",
"numpy.arange",
"tkinter.Frame",
"gmsh.finalize",
"tkinter.Label",
"tkinter.Checkbutto... | [((100048, 100055), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (100053, 100055), True, 'import tkinter as tk\n'), ((86104, 86119), 'simplekml.Kml', 'simplekml.Kml', ([], {}), '()\n', (86117, 86119), False, 'import simplekml\n'), ((86131, 86157), 'pyproj.Geod', 'pyproj.Geod', ([], {'ellps': '"""WGS84"""'}), "(ellps='WGS84... |
import numpy as np
from scipy import constants
from .conversion import vol_uc2mol
def zharkov_panh(v, temp, v0, a0, m, n, z, t_ref=300.,
three_r=3. * constants.R):
"""
calculate pressure from anharmonicity for Zharkov equation
the equation is from Dorogokupets 2015
:param v: unit-cel... | [
"numpy.power"
] | [((794, 808), 'numpy.power', 'np.power', (['x', 'm'], {}), '(x, m)\n', (802, 808), True, 'import numpy as np\n'), ((874, 890), 'numpy.power', 'np.power', (['t', '(2.0)'], {}), '(t, 2.0)\n', (882, 890), True, 'import numpy as np\n')] |
# python color_tracking.py --video balls.mp4
# python color_tracking.py
# import the necessary packages
from collections import deque
import numpy as np
import argparse
import imutils
import cv2
import urllib # for reading image from URL
# construct the argument parse and parse the arguments
ap = argpars... | [
"cv2.GaussianBlur",
"cv2.minEnclosingCircle",
"argparse.ArgumentParser",
"cv2.cvtColor",
"cv2.morphologyEx",
"cv2.waitKey",
"cv2.moments",
"cv2.imshow",
"numpy.ones",
"cv2.VideoCapture",
"imutils.resize",
"cv2.destroyAllWindows",
"cv2.inRange"
] | [((313, 338), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (336, 338), False, 'import argparse\n'), ((4089, 4112), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (4110, 4112), False, 'import cv2\n'), ((1328, 1347), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(1)'], {}), '(... |
import argparse
import os
import string
import sys
import time
import cv2
import numpy as np
import torch
from torch.autograd import Variable
from torchvision import transforms
import utils
import crnn_captcha
parser = argparse.ArgumentParser()
parser.add_argument('--model_path', type=str, default='./crnn_capcha.pth'... | [
"crnn_captcha.CRNN",
"argparse.ArgumentParser",
"torch.autograd.Variable",
"torch.load",
"utils.strLabelConverter",
"time.time",
"cv2.imread",
"torch.cuda.is_available",
"numpy.reshape",
"torchvision.transforms.Normalize",
"os.path.join",
"os.listdir",
"cv2.resize",
"torch.from_numpy"
] | [((221, 246), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (244, 246), False, 'import argparse\n'), ((599, 663), 'torchvision.transforms.Normalize', 'transforms.Normalize', (['[0.906, 0.91, 0.907]', '[0.147, 0.13, 0.142]'], {}), '([0.906, 0.91, 0.907], [0.147, 0.13, 0.142])\n', (619, 663), Fa... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | [
"numpy.random.seed",
"etcmodel.layers.RelativeAttention",
"tensorflow.initializers.constant",
"numpy.random.randint",
"numpy.random.normal",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.test.main",
"tensorflow.random.uniform",
"tensorflow.concat",
"etcmodel.layers.FusedGlobalLo... | [((1137, 1222), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["('using_gather', False)", "('using_one_hot', True)"], {}), "(('using_gather', False), ('using_one_hot', True)\n )\n", (1167, 1222), False, 'from absl.testing import parameterized\n'), ((2629, 2714), 'absl.testing.para... |
"""Manage grid logic"""
import math
from random import random
import numpy as np
from PIL import Image, ImageDraw, ImageFilter
# defaults
HNPOLY = 64 # image height will contain HNPOLY polygons
COEF = 0.560451 # [0, 1) move verteces coef dist as ratio to next vert
NCOLORS = 128 # reduce pallete to... | [
"PIL.Image.new",
"numpy.zeros",
"math.sin",
"PIL.Image.open",
"random.random",
"math.cos",
"PIL.ImageDraw.Draw"
] | [((766, 862), 'numpy.zeros', 'np.zeros', (['(self.h, self.w)'], {'dtype': "[('rgb', int, 3), ('noise', float), ('sharpness', float)]"}), "((self.h, self.w), dtype=[('rgb', int, 3), ('noise', float), (\n 'sharpness', float)])\n", (774, 862), True, 'import numpy as np\n'), ((906, 976), 'numpy.zeros', 'np.zeros', (['(s... |
from .particle_filter_base import ParticleFilter
from core.resampling.resampler import Resampler
import copy
import numpy as np
from scipy.stats import multivariate_normal
from scipy import linalg
class KalmanParticleFilter(ParticleFilter):
"""
Notes:
* State is (x, y, heading), where x and y are in ... | [
"numpy.random.uniform",
"copy.deepcopy",
"numpy.arctan2",
"numpy.eye",
"numpy.transpose",
"numpy.cumsum",
"numpy.sin",
"numpy.random.multivariate_normal",
"numpy.array",
"scipy.stats.multivariate_normal.pdf",
"numpy.cos",
"numpy.dot",
"numpy.diag",
"scipy.linalg.pinv",
"numpy.sqrt"
] | [((1674, 1737), 'numpy.diag', 'np.diag', (['[process_noise[0], process_noise[0], process_noise[1]]'], {}), '([process_noise[0], process_noise[0], process_noise[1]])\n', (1681, 1737), True, 'import numpy as np\n'), ((1755, 1808), 'numpy.diag', 'np.diag', (['[measurement_noise[0], measurement_noise[1]]'], {}), '([measure... |
"""
Compare puncta distribution in a channel with synapse distribution.
"""
import os
import copy
import socket
import numpy as np
import pandas as pd
from skimage import measure
from at_synapse_detection import SynapseDetection as syn
from at_synapse_detection import dataAccess as da
from at_synapse_detection import... | [
"at_synapse_detection.antibodyAnalysis.calculuate_target_ratio",
"numpy.load",
"at_synapse_detection.antibodyAnalysis.write_dfs_to_excel",
"skimage.measure.label",
"at_synapse_detection.SynapseDetection.convolveVolume",
"at_synapse_detection.SynapseAnalysis.mask_synaptic_volumes",
"os.path.join",
"ski... | [((1029, 1055), 'at_synapse_detection.antibodyAnalysis.AntibodyAnalysis', 'aa.AntibodyAnalysis', (['query'], {}), '(query)\n', (1048, 1055), True, 'from at_synapse_detection import antibodyAnalysis as aa\n'), ((1606, 1683), 'at_synapse_detection.antibodyAnalysis.compute_raw_measures', 'aa.compute_raw_measures', (['pres... |
import numpy as np
from keras.models import Sequential
from keras.layers import LSTM
from keras.layers import Dense
from keras.layers import RepeatVector
from keras.layers import TimeDistributed
from keras.utils import plot_model
def Autoencoder(series_length):
"""
Return a keras model of autoencoder
:par... | [
"keras.layers.LSTM",
"keras.utils.plot_model",
"keras.layers.Dense",
"numpy.array",
"keras.models.Sequential",
"keras.layers.RepeatVector"
] | [((371, 383), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (381, 383), False, 'from keras.models import Sequential\n'), ((748, 803), 'numpy.array', 'np.array', (['[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]'], {}), '([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9])\n', (756, 803), True, 'import numpy as n... |
import operator
import re
import os
import json
import logging
from collections import Counter
from tqdm import tqdm
import colorlog
from sklearn.feature_extraction.text import TfidfTransformer
import numpy as np
#####################
# Hyperparameters
#####################
CONTEXT_LENGTH = 100
CAPTIO... | [
"colorlog.basicConfig",
"json.load",
"re.split",
"os.makedirs",
"os.path.exists",
"colorlog.info",
"numpy.argsort",
"numpy.sort",
"collections.Counter",
"operator.itemgetter",
"os.path.join",
"sklearn.feature_extraction.text.TfidfTransformer",
"re.sub",
"re.compile"
] | [((387, 432), 'os.path.join', 'os.path.join', (['""".."""', '""".."""', '"""data"""', '"""Instagram"""'], {}), "('..', '..', 'data', 'Instagram')\n", (399, 432), False, 'import os\n'), ((478, 542), 'os.path.join', 'os.path.join', (['DATA_ROOT_PATH', '"""json"""', '"""insta-caption-train.json"""'], {}), "(DATA_ROOT_PATH... |
# -*- coding: utf-8 -*-
# imagecodecs/setup.py
"""Imagecodecs package setuptools script."""
import sys
import re
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
buildnumber = '' # 'post0'
with open('imagecodecs/_imagecodecs.pyx') as fh:
co... | [
"setuptools.Extension",
"setuptools.setup",
"setuptools.command.build_ext.build_ext.finalize_options",
"numpy.get_include",
"re.search"
] | [((6352, 6371), 'setuptools.setup', 'setup', ([], {}), '(**setup_args)\n', (6357, 6371), False, 'from setuptools import setup, Extension\n'), ((3348, 3551), 'setuptools.Extension', 'Extension', (['"""imagecodecs._imagecodecs_lite"""', "['imagecodecs/imagecodecs.c', 'imagecodecs/_imagecodecs_lite' + ext]"], {'include_di... |
import os
import re
import sys
import numpy as np
from scipy.io import loadmat
import pandas as pd
DEFAULT_MAT_FILE = './data/nut_data_reps.mat'
DEFAULT_OUT_DIR = './output'
CSV_FILENAME = 'nes-lter-nutrient.csv'
if len(sys.argv) < 3:
in_mat_file = DEFAULT_MAT_FILE
out_dir = DEFAULT_OUT_DIR
else:
assert... | [
"pandas.DataFrame",
"scipy.io.loadmat",
"os.path.exists",
"numpy.isnan",
"pandas.Series"
] | [((448, 475), 'os.path.exists', 'os.path.exists', (['in_mat_file'], {}), '(in_mat_file)\n', (462, 475), False, 'import os\n'), ((534, 557), 'os.path.exists', 'os.path.exists', (['out_dir'], {}), '(out_dir)\n', (548, 557), False, 'import os\n'), ((639, 676), 'scipy.io.loadmat', 'loadmat', (['in_mat_file'], {'squeeze_me'... |
import datetime
import h5py
import numpy as np
import torch
from torch.utils import data
import torch.nn.functional as F
import soundfile as sf
from transformData import mu_law_encode,quan_mu_law_encode
sampleSize = 16384 * 60
sample_rate = 16384 * 60
class Dataset(data.Dataset):
def __init__(self, listx, rootx... | [
"numpy.random.uniform",
"numpy.random.seed",
"transformData.mu_law_encode",
"numpy.random.randint",
"datetime.datetime.now",
"numpy.concatenate"
] | [((722, 738), 'numpy.random.seed', 'np.random.seed', ([], {}), '()\n', (736, 738), True, 'import numpy as np\n'), ((997, 1013), 'transformData.mu_law_encode', 'mu_law_encode', (['x'], {}), '(x)\n', (1010, 1013), False, 'from transformData import mu_law_encode, quan_mu_law_encode\n'), ((1026, 1042), 'transformData.mu_la... |
import numpy as np
import os
import sys
import tensorflow as tf
from imutils.video import VideoStream
import cv2
import imutils
import time
from imutils.video import FPS
from sklearn.metrics import pairwise
import copy
import pathlib
from collections import defaultdict
colors = np.random.uniform(0, 255, size=(100, 3))... | [
"numpy.random.uniform",
"cv2.putText",
"cv2.rectangle"
] | [((280, 320), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(255)'], {'size': '(100, 3)'}), '(0, 255, size=(100, 3))\n', (297, 320), True, 'import numpy as np\n'), ((864, 937), 'cv2.rectangle', 'cv2.rectangle', (['image_np', '(xmin, ymin)', '(xmin + w, ymin + h)', '(0, 0, 0)', '(3)'], {}), '(image_np, (xmin, y... |
import os
import argparse
import numpy as np
import torch
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
from bpe import Config
from bpe.agent import agents_bpe
from bpe.dataset.datasets_bpe import SARADataset
from bpe.functional.utils import cycle, mov... | [
"tqdm.tqdm",
"numpy.random.seed",
"bpe.dataset.datasets_bpe.SARADataset",
"argparse.ArgumentParser",
"bpe.agent.agents_bpe.Agent3x_bpe",
"bpe.Config",
"bpe.functional.utils.cycle",
"bpe.Config.__dict__.items",
"bpe.model.networks_bpe.AutoEncoder_bpe",
"torch.nn.DataParallel",
"bpe.functional.uti... | [((1162, 1187), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1185, 1187), False, 'import argparse\n'), ((2575, 2587), 'bpe.Config', 'Config', (['args'], {}), '(args)\n', (2581, 2587), False, 'from bpe import Config\n'), ((2624, 2660), 'bpe.model.networks_bpe.AutoEncoder_bpe', 'networks_bpe.A... |
import numpy as np
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.utils.extmath import cartesian
# import matplotlib.pyplot as plt
class MPHP:
'''Multidimensional Periodic Hawkes Process
Captures rates with periodic component depending on the day of week
'''
def __init__(self... | [
"numpy.abs",
"numpy.sum",
"numpy.floor",
"numpy.random.exponential",
"numpy.ones",
"numpy.arange",
"numpy.tile",
"numpy.exp",
"numpy.multiply",
"numpy.linalg.eig",
"numpy.append",
"numpy.max",
"numpy.divide",
"numpy.vectorize",
"numpy.ceil",
"numpy.triu_indices",
"numpy.all",
"nump... | [((354, 364), 'numpy.ones', 'np.ones', (['(7)'], {}), '(7)\n', (361, 364), True, 'import numpy as np\n'), ((875, 900), 'numpy.linalg.eig', 'np.linalg.eig', (['self.alpha'], {}), '(self.alpha)\n', (888, 900), True, 'import numpy as np\n'), ((1641, 1660), 'numpy.max', 'np.max', (['self.mu_day'], {}), '(self.mu_day)\n', (... |
import numpy as np
import matplotlib.pyplot as plt
n_files = 100
path = './experiments/test9/PES'
name = '/test9_PES_f_'
n_iterations = 100
log_regret = np.zeros((n_iterations,n_files))
time = np.zeros((n_iterations,n_files))
real_opt = 0.#test7:4.389940124468381 #test5:-0.5369910241891562#test-0.42973174#test_linear... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.std",
"numpy.savetxt",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.mean"
] | [((154, 187), 'numpy.zeros', 'np.zeros', (['(n_iterations, n_files)'], {}), '((n_iterations, n_files))\n', (162, 187), True, 'import numpy as np\n'), ((195, 228), 'numpy.zeros', 'np.zeros', (['(n_iterations, n_files)'], {}), '((n_iterations, n_files))\n', (203, 228), True, 'import numpy as np\n'), ((720, 747), 'numpy.z... |
import pygame
from random import randint
import numpy as np
# Programa por Magnus e Rudigus
pygame.init()
screen = pygame.display.set_mode((620, 620))
myfont = pygame.font.SysFont("monospace", 30, 1)
done = False
is_blue = 0
quantBlocos = [10, 10]
blocos = []
minas = np.zeros((quantBlocos[0], quantBlocos[1]))
minas[... | [
"pygame.mouse.get_pressed",
"pygame.font.SysFont",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.draw.rect",
"pygame.Rect",
"numpy.zeros",
"pygame.init",
"pygame.display.flip",
"pygame.mouse.get_pos",
"numpy.random.shuffle"
] | [((94, 107), 'pygame.init', 'pygame.init', ([], {}), '()\n', (105, 107), False, 'import pygame\n'), ((117, 152), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(620, 620)'], {}), '((620, 620))\n', (140, 152), False, 'import pygame\n'), ((162, 201), 'pygame.font.SysFont', 'pygame.font.SysFont', (['"""monospace... |
#!/usr/bin/env python
"""Script to run RM2 ALM case."""
import argparse
import os
import subprocess
from subprocess import call, check_output
import numpy as np
import pandas as pd
import glob
import foampy
from foampy.dictionaries import replace_value
import shutil
from pyrm2tf import processing as pr
def get_mesh_... | [
"pandas.DataFrame",
"os.mkdir",
"os.remove",
"argparse.ArgumentParser",
"os.path.isdir",
"pandas.read_csv",
"foampy.clean",
"subprocess.check_output",
"pyrm2tf.processing.calc_perf",
"foampy.dictionaries.read_single_line_value",
"os.path.isfile",
"numpy.arange",
"subprocess.call",
"numpy.l... | [((709, 784), 'foampy.dictionaries.read_single_line_value', 'foampy.dictionaries.read_single_line_value', (['"""controlDict"""'], {'keyword': '"""deltaT"""'}), "('controlDict', keyword='deltaT')\n", (751, 784), False, 'import foampy\n'), ((1206, 1226), 'pyrm2tf.processing.calc_perf', 'pr.calc_perf', ([], {'t1': '(3.0)'... |
import numpy as np
import argparse
from matplotlib import pyplot as plt
rewards = []
EPOSIDES = 250
lineStyle = ['-b','--r','.g']
def plot(f, arr, strLabel):
strLine = f.readline()
start = strLine.find('INFO')
if start != -1:
start += len('INFO:')
tittle = strLine[start:-1]
else :
... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"numpy.asarray",
"matplotlib.pyplot.legend",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"argparse.FileType"
] | [((601, 636), 'numpy.asarray', 'np.asarray', (['rewards'], {'dtype': 'np.float'}), '(rewards, dtype=np.float)\n', (611, 636), True, 'import numpy as np\n'), ((675, 698), 'numpy.arange', 'np.arange', (['(0)', 'rewardLen'], {}), '(0, rewardLen)\n', (684, 698), True, 'import numpy as np\n'), ((703, 720), 'matplotlib.pyplo... |
# -*- coding: utf-8 -*-
"""
Module that loads data distributed at http://jmcauley.ucsd.edu/data/amazon/
The dataset was presented on the following papers:
<NAME>, <NAME>. 2016. Ups and downs: Modeling the visual evolution of fashion
trends with one-class collaborative filtering. WWW.
<NAME>, <NAME>, <NAME>, <NAME>. ... | [
"nltk.tokenize.word_tokenize",
"numpy.asarray",
"numpy.array",
"multidomain_sentiment.dataset.common.create_dataset",
"nltk.download",
"multidomain_sentiment.word_embedding.load_word_embedding",
"six.iteritems",
"logging.getLogger"
] | [((534, 567), 'nltk.download', 'nltk.download', ([], {'info_or_id': '"""punkt"""'}), "(info_or_id='punkt')\n", (547, 567), False, 'import nltk\n'), ((814, 841), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (831, 841), False, 'import logging\n'), ((1410, 1438), 'numpy.asarray', 'np.asarr... |
import os
import numpy as np
import sys
import SimpleITK as sitk
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from data_io_utils import DataIO
class MaskBoundingUtils:
def __init__(self):
print('init MaskBoundingUtils class')
@staticmethod
def extract_mask_file_bounding(infile, i... | [
"os.path.abspath",
"os.makedirs",
"SimpleITK.ReadImage",
"os.path.dirname",
"data_io_utils.DataIO.load_dicom_series",
"data_io_utils.DataIO.load_nii_image",
"SimpleITK.GetArrayFromImage",
"data_io_utils.DataIO.save_medical_info_and_data",
"numpy.where",
"numpy.array",
"SimpleITK.WriteImage",
"... | [((7520, 7546), 'SimpleITK.ReadImage', 'sitk.ReadImage', (['image_file'], {}), '(image_file)\n', (7534, 7546), True, 'import SimpleITK as sitk\n'), ((7561, 7586), 'SimpleITK.ReadImage', 'sitk.ReadImage', (['mask_file'], {}), '(mask_file)\n', (7575, 7586), True, 'import SimpleITK as sitk\n'), ((7734, 7769), 'os.makedirs... |
import numpy as np
class Network:
def __init__(self):
self.L1 = Layer(layer_width=2, input_width=1, bias=[0, -1])
def forward(self, x):
x = self.L1.forward(x)
return np.sum(x)
def update_weights(self, adj):
self.L1.update_weights(adj)
class Layer:
def __init__(self,... | [
"numpy.zeros",
"numpy.random.uniform",
"numpy.sum",
"numpy.array"
] | [((201, 210), 'numpy.sum', 'np.sum', (['x'], {}), '(x)\n', (207, 210), True, 'import numpy as np\n'), ((1019, 1055), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(1)', 'input_shape'], {}), '(0, 1, input_shape)\n', (1036, 1055), True, 'import numpy as np\n'), ((407, 428), 'numpy.zeros', 'np.zeros', (['layer_wi... |
# download data from here: https://press.liacs.nl/mirflickr/mirdownload.html
# import hashlib
# with open("mirflickr25k.zip","rb") as f:
# md5_obj = hashlib.md5()
# md5_obj.update(f.read())
# hash_code = md5_obj.hexdigest()
# print(str(hash_code).upper() == "A23D0A8564EE84CDA5622A6C2F947785")
import o... | [
"numpy.random.permutation",
"numpy.zeros",
"os.listdir",
"os.path.join"
] | [((359, 395), 'numpy.zeros', 'np.zeros', (['(25000, 38)'], {'dtype': 'np.int8'}), '((25000, 38), dtype=np.int8)\n', (367, 395), True, 'import numpy as np\n'), ((480, 506), 'os.listdir', 'os.listdir', (['label_dir_name'], {}), '(label_dir_name)\n', (490, 506), False, 'import os\n'), ((796, 842), 'numpy.random.permutatio... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 20 01:03:24 2021
@author: Mahfuz_Shazol
"""
import numpy as np
X=np.array([
[4,2],
[-5,-3]
])
result =np.linalg.det(X)
print(result)
N=np.array([
[-4,1],
[-8,2]
])
result =np.linalg.det(N)
print(result) | [
"numpy.linalg.det",
"numpy.array"
] | [((115, 143), 'numpy.array', 'np.array', (['[[4, 2], [-5, -3]]'], {}), '([[4, 2], [-5, -3]])\n', (123, 143), True, 'import numpy as np\n'), ((165, 181), 'numpy.linalg.det', 'np.linalg.det', (['X'], {}), '(X)\n', (178, 181), True, 'import numpy as np\n'), ((201, 229), 'numpy.array', 'np.array', (['[[-4, 1], [-8, 2]]'], ... |
"""
https://circuitdigest.com/microcontroller-projects/license-plate-recognition-using-raspberry-pi-and-opencv
"""
import logging
import typing as t
import imutils
import numpy as np
import pytesseract
from cv2 import cv2
from car_plate_recognizer.handlers.base import BaseHandler, Plate, save_img
logger = logging.g... | [
"cv2.cv2.Canny",
"cv2.cv2.arcLength",
"cv2.cv2.drawContours",
"cv2.cv2.bitwise_and",
"cv2.cv2.bilateralFilter",
"numpy.zeros",
"cv2.cv2.findContours",
"cv2.cv2.resize",
"pytesseract.image_to_string",
"cv2.cv2.approxPolyDP",
"numpy.min",
"numpy.where",
"numpy.max",
"imutils.grab_contours",
... | [((311, 338), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (328, 338), False, 'import logging\n'), ((1650, 1689), 'cv2.cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '(image, cv2.COLOR_BGR2GRAY)\n', (1662, 1689), False, 'from cv2 import cv2\n'), ((1726, 1763), 'cv... |
"""
<NAME>
<NAME>
March 2021
Final project for Climate Dynamics
presented to Kyle Armour and <NAME>
Ocean 2-layer model
"""
## Import packages ##
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
import sys
pht = os.path.abspath('/Users/jadesauve/Documents/Python/scripts/2_layer_carb... | [
"pandas.DataFrame",
"matplotlib.pyplot.title",
"os.path.abspath",
"sys.path.append",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((249, 325), 'os.path.abspath', 'os.path.abspath', (['"""/Users/jadesauve/Documents/Python/scripts/2_layer_carbon/"""'], {}), "('/Users/jadesauve/Documents/Python/scripts/2_layer_carbon/')\n", (264, 325), False, 'import os\n'), ((1174, 1194), 'numpy.arange', 'np.arange', (['num_years'], {}), '(num_years)\n', (1183, 11... |
"""Contains the logic for handling read model corruption invocation"""
from multiprocessing import Process, Queue
import time
import pysam
import numpy as np
from mitty.simulation.sequencing.writefastq import writer, load_qname_sidecar, parse_qname
import logging
logger = logging.getLogger(__name__)
SEED_MAX = (1 ... | [
"pysam.FastxFile",
"mitty.simulation.sequencing.writefastq.load_qname_sidecar",
"numpy.random.RandomState",
"time.time",
"mitty.simulation.sequencing.writefastq.parse_qname",
"multiprocessing.Queue",
"multiprocessing.Process",
"logging.getLogger"
] | [((276, 303), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (293, 303), False, 'import logging\n'), ((811, 841), 'mitty.simulation.sequencing.writefastq.load_qname_sidecar', 'load_qname_sidecar', (['sidecar_in'], {}), '(sidecar_in)\n', (829, 841), False, 'from mitty.simulation.sequencing... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Functions to deal sample split test."""
import copy
import numpy as np
from scipy.spatial import cKDTree
from scipy.optimize import curve_fit
from astropy.table import Column, vstack
from . import wlensing
from . import visual
__all__ = ["get_mask_strait_line", "st... | [
"copy.deepcopy",
"numpy.ceil",
"numpy.asarray",
"numpy.unique",
"numpy.isfinite",
"numpy.nanmin",
"scipy.optimize.curve_fit",
"astropy.table.vstack",
"numpy.arange",
"numpy.linspace",
"scipy.spatial.cKDTree",
"astropy.table.Column",
"numpy.diag",
"numpy.digitize",
"numpy.nanmax"
] | [((713, 761), 'scipy.optimize.curve_fit', 'curve_fit', (['strait_line', 'x_arr[mask]', 'y_arr[mask]'], {}), '(strait_line, x_arr[mask], y_arr[mask])\n', (722, 761), False, 'from scipy.optimize import curve_fit\n'), ((2775, 2809), 'numpy.digitize', 'np.digitize', (['X', 'X_bins'], {'right': '(True)'}), '(X, X_bins, righ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 18:30:44 2019
@author: <NAME>
Edited on Apr 18th 2019
@author: <NAME>
"""
from keras.datasets import mnist
from keras.models import Sequential, Model
from keras.layers import Input, Dense, LeakyReLU, Dropout
from keras.optimizers import Adam
imp... | [
"numpy.random.seed",
"numpy.empty",
"numpy.ones",
"keras.models.Model",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.random.normal",
"keras.layers.Input",
"matplotlib.pyplot.imshow",
"keras.layers.LeakyReLU",
"matplotlib.pyplot.show",
"keras.layers.Dropout",
"matplotlib.pyplot.... | [((404, 421), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (419, 421), False, 'from keras.datasets import mnist\n'), ((581, 608), 'keras.optimizers.Adam', 'Adam', ([], {'lr': '(0.0002)', 'beta_1': '(0.5)'}), '(lr=0.0002, beta_1=0.5)\n', (585, 608), False, 'from keras.optimizers import Adam\n')... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import math
import argparse
import itertools
import concurrent.futures
import pyproj
import numpy as np
import scipy.ndimage
from PIL import Image
from osgeo import gdal
gdal.UseExceptions()
def num2deg(xtile, ytile, zoom):
n = 2 ** zoom
lat = math.d... | [
"numpy.amin",
"argparse.ArgumentParser",
"numpy.clip",
"math.radians",
"os.path.dirname",
"math.cos",
"numpy.rollaxis",
"math.sinh",
"math.ceil",
"osgeo.gdal.UseExceptions",
"numpy.linalg.inv",
"osgeo.gdal.Open",
"math.tan",
"numpy.zeros",
"math.floor",
"numpy.amax",
"os.cpu_count",
... | [((230, 250), 'osgeo.gdal.UseExceptions', 'gdal.UseExceptions', ([], {}), '()\n', (248, 250), False, 'from osgeo import gdal\n'), ((477, 494), 'math.radians', 'math.radians', (['lat'], {}), '(lat)\n', (489, 494), False, 'import math\n'), ((774, 819), 'pyproj.Transformer.from_crs', 'pyproj.Transformer.from_crs', (['"""E... |
"""
Use the EMNIST datasets to test for SGD convergence vs randomization
"""
# ===============================================================================
#
# Imports
#
# ===============================================================================
from __future__ import print_function
import os
import argparse... | [
"pickle.dump",
"numpy.random.seed",
"argparse.ArgumentParser",
"numpy.arange",
"numpy.unique",
"keras.optimizers.adam",
"keras.layers.Flatten",
"os.path.exists",
"keras.layers.MaxPooling2D",
"numpy.random.shuffle",
"keras.utils.to_categorical",
"numpy.ceil",
"keras.layers.Dropout",
"keras.... | [((2788, 2800), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (2798, 2800), False, 'from keras.models import Sequential\n'), ((3871, 3883), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (3881, 3883), False, 'from keras.models import Sequential\n'), ((5282, 5303), 'numpy.lexsort', 'np.lexsort',... |
import copy
import time
import numpy as np
import open3d
import torch
import torch.nn.functional as F
# from lapsolver import solve_dense
from matplotlib import cm
from open3d import *
from open3d import *
from torch.autograd import Function
from train_open_spline_utils.src.VisUtils import tessalate_points
from train... | [
"numpy.random.seed",
"numpy.sum",
"matplotlib.cm.get_cmap",
"numpy.argmax",
"torch.sqrt",
"ipdb.set_trace",
"torch.eye",
"torch.cat",
"numpy.argmin",
"numpy.argsort",
"open3d.visualization.draw_geometries",
"numpy.mean",
"train_open_spline_utils.src.utils.visualize_point_cloud",
"numpy.ara... | [((829, 840), 'train_open_spline_utils.src.curve_utils.DrawSurfs', 'DrawSurfs', ([], {}), '()\n', (838, 840), False, 'from train_open_spline_utils.src.curve_utils import DrawSurfs\n'), ((879, 899), 'torch.manual_seed', 'torch.manual_seed', (['(2)'], {}), '(2)\n', (896, 899), False, 'import torch\n'), ((900, 917), 'nump... |
# <NAME>
# Mayo, 2020
# <EMAIL>
# Variables aleatorias
# La variable aleatoria es una función, se caracteriza por ser determinista
#
#Datos a partir de la base llamada datos.cvs
#### **************** Algoritmo **************** ####
#**********************************************... | [
"numpy.random.uniform",
"scipy.stats.norm",
"csv.reader",
"scipy.stats.rayleigh.fit",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.legend",
"scipy.stats.rayleigh",
"matplotlib.pyplot.cla",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"numpy.sqrt"
] | [((1972, 2007), 'csv.reader', 'csv.reader', (['csv_file'], {'delimiter': '""","""'}), "(csv_file, delimiter=',')\n", (1982, 2007), False, 'import csv\n'), ((2664, 2688), 'scipy.stats.rayleigh.fit', 'stats.rayleigh.fit', (['data'], {}), '(data)\n', (2682, 2688), True, 'import scipy.stats as stats\n'), ((2726, 2751), 'sc... |
import matplotlib.pyplot as plt
import numpy as np
# import numpy.linalg as la
from kernels import eval_sp_dp_QBX, sommerfeld
plt.gca().set_aspect("equal")
k = 10
alpha = k # CFIE parameter
beta = 0
interval = 10
xs = 0
ys = 5
sp, dp, _, _, _, _, _, _ = eval_sp_dp_QBX(4, k)
som_sp, _ = sommerfeld(k, beta, interval... | [
"numpy.meshgrid",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca",
"kernels.eval_sp_dp_QBX",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.figure",
"kernels.sommerfeld",
"numpy.linspace",
"numpy.real"
] | [((259, 279), 'kernels.eval_sp_dp_QBX', 'eval_sp_dp_QBX', (['(4)', 'k'], {}), '(4, k)\n', (273, 279), False, 'from kernels import eval_sp_dp_QBX, sommerfeld\n'), ((292, 329), 'kernels.sommerfeld', 'sommerfeld', (['k', 'beta', 'interval', '"""full"""'], {}), "(k, beta, interval, 'full')\n", (302, 329), False, 'from kern... |
"""Authors: <NAME> and <NAME>."""
from nwb_conversion_tools.basedatainterface import BaseDataInterface
from pynwb import NWBFile
import os
import warnings
from lxml import etree as et
import numpy as np
from ..utils.neuroscope import read_lfp, write_lfp, write_spike_waveforms
class GrosmarkLFPInterface(BaseDataInter... | [
"lxml.etree.parse",
"warnings.warn",
"os.path.split",
"numpy.concatenate"
] | [((881, 908), 'os.path.split', 'os.path.split', (['session_path'], {}), '(session_path)\n', (894, 908), False, 'import os\n'), ((1354, 1384), 'numpy.concatenate', 'np.concatenate', (['shank_channels'], {}), '(shank_channels)\n', (1368, 1384), True, 'import numpy as np\n'), ((1640, 1667), 'os.path.split', 'os.path.split... |
from decimal import Decimal
import math
import numpy as np
import pyproj
WGS84_LATLON_EPSG = 4326
# There's significant overhead in pyproj when building a Transformer object.
# Without a cache a Transformer can be built many times per request, even for
# the same CRS.
_TRANSFORMER_CACHE = {}
def reproject_latlons... | [
"math.isnan",
"pyproj.transformer.Transformer.from_crs",
"decimal.Decimal",
"numpy.floor"
] | [((1140, 1213), 'pyproj.transformer.Transformer.from_crs', 'pyproj.transformer.Transformer.from_crs', (['from_crs', 'to_crs'], {'always_xy': '(True)'}), '(from_crs, to_crs, always_xy=True)\n', (1179, 1213), False, 'import pyproj\n'), ((1476, 1494), 'numpy.floor', 'np.floor', (['(x / base)'], {}), '(x / base)\n', (1484,... |
# Import necessary modules
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import Ridge
from sklearn.model_selection import cross_val_score
# TODO
# import ridge_x and ridge_y from /datasets
def display_plot(cv_scores, cv_scores_std):
fig = plt.figure()
ax = fig.add_subplot(1, 1,... | [
"matplotlib.pyplot.show",
"numpy.std",
"numpy.logspace",
"sklearn.model_selection.cross_val_score",
"matplotlib.pyplot.figure",
"numpy.max",
"numpy.mean",
"sklearn.linear_model.Ridge",
"numpy.sqrt"
] | [((799, 820), 'sklearn.linear_model.Ridge', 'Ridge', ([], {'normalize': '(True)'}), '(normalize=True)\n', (804, 820), False, 'from sklearn.linear_model import Ridge\n'), ((876, 898), 'numpy.logspace', 'np.logspace', (['(-4)', '(0)', '(50)'], {}), '(-4, 0, 50)\n', (887, 898), True, 'import numpy as np\n'), ((277, 289), ... |
"""
@File : game
@author : yulosun
@Date : 10/11/19
@license:
"""
import actr
import time
import math
import numpy as np
import numbers
import matplotlib.pyplot as plt
import SYL_spt2
import datetime
actr.load_act_r_model(r"C:\Users\syl\Desktop\ACTR_ATO\sp_new.lisp")
response = False
t = 0... | [
"matplotlib.pyplot.title",
"actr.run",
"actr.process_events",
"actr.copy_chunk",
"actr.add_text_to_exp_window",
"actr.monitor_command",
"actr.chunk_slot_value",
"numpy.arange",
"actr.remove_items_from_exp_window",
"actr.add_command",
"actr.buffer_read",
"actr.load_act_r_model",
"matplotlib.p... | [((224, 295), 'actr.load_act_r_model', 'actr.load_act_r_model', (['"""C:\\\\Users\\\\syl\\\\Desktop\\\\ACTR_ATO\\\\sp_new.lisp"""'], {}), "('C:\\\\Users\\\\syl\\\\Desktop\\\\ACTR_ATO\\\\sp_new.lisp')\n", (245, 295), False, 'import actr\n'), ((1076, 1104), 'actr.buffer_read', 'actr.buffer_read', (['"""imaginal"""'], {})... |
import numpy as np
def radius_of_curvature(pixels_x, pixels_y, mx, my):
if pixels_y is None or pixels_x is None:
return 0
y_eval = np.max(pixels_y) * my
fit = np.polyfit(pixels_y * my, pixels_x * mx, 2)
curvature = ((1 + (2 * fit[0] * y_eval + fit[1]) ** 2) ** 1.5) / np.absolute(2 * fit[0])
... | [
"numpy.absolute",
"numpy.min",
"numpy.max",
"numpy.polyfit"
] | [((181, 224), 'numpy.polyfit', 'np.polyfit', (['(pixels_y * my)', '(pixels_x * mx)', '(2)'], {}), '(pixels_y * my, pixels_x * mx, 2)\n', (191, 224), True, 'import numpy as np\n'), ((1325, 1345), 'numpy.min', 'np.min', (['lane_width_m'], {}), '(lane_width_m)\n', (1331, 1345), True, 'import numpy as np\n'), ((1367, 1387)... |
__all__ = ['SegmentationEM']
import attr
import numpy as np
from .. import annotations
from ..annotations import Annotation, manage_docstring
from ..base import BaseImageSegmentationAggregator
@attr.s
@manage_docstring
class SegmentationEM(BaseImageSegmentationAggregator):
"""
The EM algorithm for the image... | [
"numpy.stack",
"numpy.zeros_like",
"numpy.log",
"attr.ib",
"numpy.errstate",
"numpy.exp",
"numpy.round"
] | [((586, 605), 'attr.ib', 'attr.ib', ([], {'default': '(10)'}), '(default=10)\n', (593, 605), False, 'import attr\n'), ((2776, 2806), 'numpy.stack', 'np.stack', (['segmentations.values'], {}), '(segmentations.values)\n', (2784, 2806), True, 'import numpy as np\n'), ((1245, 1273), 'numpy.errstate', 'np.errstate', ([], {'... |
from unittest import TestCase
import numpy as np
from matplotlib import pyplot as plt
from src.bandit_algorithms.thompson_sampling_learner import ThompsonSamplingLearner
from src.tests.bandit_algorithms.environments.bandit_test_environment import BanditTestEnvironment
from src.tests.bandit_algorithms.greedy_learner i... | [
"src.tests.bandit_algorithms.greedy_learner.GreedyLearner",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"src.tests.bandit_algorithms.environments.bandit_test_environment.BanditTestEnvironment",
"numpy.cumsum",
"numpy.max",
"numpy.mean",
"numpy.array",
"matplotlib.pyplot.figure",
"src.ban... | [((538, 570), 'numpy.array', 'np.array', (['[0.15, 0.1, 0.1, 0.35]'], {}), '([0.15, 0.1, 0.1, 0.35])\n', (546, 570), True, 'import numpy as np\n'), ((609, 618), 'numpy.max', 'np.max', (['p'], {}), '(p)\n', (615, 618), True, 'import numpy as np\n'), ((2082, 2130), 'numpy.mean', 'np.mean', (['(opt - ts_rewards_per_experi... |
'''****************************************************************************
* GANs.py: GAN Models
******************************************************************************
* v0.1 - 01.03.2019
*
* Copyright (c) 2019 <NAME> (<EMAIL>)
*
* Permission is hereby granted, free of charge, to any person obtainin... | [
"tensorflow.keras.layers.multiply",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dense",
"numpy.ones",
"misc.misc.print_newline",
"tensorflow.keras.layers.LeakyReLU",
"numpy.random.randint",
"numpy.random.normal",
"tensorflow.keras.Sequential",
"os.path.join",
"tensorflow.keras.la... | [((2504, 2516), 'tensorflow.keras.Sequential', 'Sequential', ([], {}), '()\n', (2514, 2516), False, 'from tensorflow.keras import Input, Model, Sequential\n'), ((4905, 4936), 'tensorflow.keras.Input', 'Input', ([], {'shape': '(self.latent_dim,)'}), '(shape=(self.latent_dim,))\n', (4910, 4936), False, 'from tensorflow.k... |
import os
import numpy as np
import torch
from sklearn.datasets import load_svmlight_file
from tensorflow import gfile
from torch.utils.data import DataLoader, Dataset
from torchvision import transforms
from torchvision.transforms import Compose
from allrank.utils.ltr_logging import get_logger
logger = get_logger()
... | [
"numpy.pad",
"torch.utils.data.DataLoader",
"numpy.argmax",
"allrank.utils.ltr_logging.get_logger",
"torch.cuda.device_count",
"numpy.split",
"numpy.arange",
"sklearn.datasets.load_svmlight_file",
"numpy.random.choice",
"tensorflow.gfile.Open",
"numpy.unique",
"torch.from_numpy"
] | [((307, 319), 'allrank.utils.ltr_logging.get_logger', 'get_logger', ([], {}), '()\n', (317, 319), False, 'from allrank.utils.ltr_logging import get_logger\n'), ((5819, 5844), 'torch.cuda.device_count', 'torch.cuda.device_count', ([], {}), '()\n', (5842, 5844), False, 'import torch\n'), ((5982, 6074), 'torch.utils.data.... |
import tensorflow as tf
from tensorflow.keras.models import Model, Sequential, load_model
from tensorflow.keras.layers import Dense, Input, Dropout, Flatten
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.optimizers import SGD
from tensorflow.keras.callbacks import CSVLogger
i... | [
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.models.load_model",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"numpy.argmax",
"tensorflow.keras.preprocessing.image.img_to_array",
"tensorflow.keras.optimizers.SGD",
"os.path.exists",
"tensorflow.k... | [((814, 917), 'tensorflow.keras.applications.vgg16.VGG16', 'tf.keras.applications.vgg16.VGG16', ([], {'weights': '"""imagenet"""', 'include_top': '(False)', 'input_shape': '(224, 224, 3)'}), "(weights='imagenet', include_top=False,\n input_shape=(224, 224, 3))\n", (847, 917), True, 'import tensorflow as tf\n'), ((94... |
import numpy as np
import matplotlib.pyplot as plt
from random import *
#com epoca
def f(x, p1,p2):
return -(p1*x)/p2
xx = np.arange(-1, 1, 0.1)
yy = np.arange(-1, 1, 0.1)
#x1 = [0.3, -0.6, -0.1, 0.1]
#x2 = [0.7,0.3,-0.8,-0.45]
#classe = [1,0,0,1]
x1 = [0.2, 0.4,-0.2,-0.4]
x2 = [0.2,0.4,-0.2,-0.4]
classe = [1,1,0... | [
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
] | [((125, 146), 'numpy.arange', 'np.arange', (['(-1)', '(1)', '(0.1)'], {}), '(-1, 1, 0.1)\n', (134, 146), True, 'import numpy as np\n'), ((153, 174), 'numpy.arange', 'np.arange', (['(-1)', '(1)', '(0.1)'], {}), '(-1, 1, 0.1)\n', (162, 174), True, 'import numpy as np\n'), ((1260, 1270), 'matplotlib.pyplot.show', 'plt.sho... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 10 20:13:50 2020
@author: mm
#descricao: este programa calcula a fórmula de Báskara
"""
import numpy as np
#equação ax2+bx+c=0
a=1
b=5
c=4
delta = (b**2 - 4*a*c)
raiz_delta = np.sqrt(delta)
x_linha = (b.__neg__() + raiz_delta)/(2*a)
x_duaslinha... | [
"numpy.sqrt"
] | [((249, 263), 'numpy.sqrt', 'np.sqrt', (['delta'], {}), '(delta)\n', (256, 263), True, 'import numpy as np\n')] |
import numpy
from psyneulink.core.components.functions.statefulfunctions.integratorfunctions import SimpleIntegrator
from psyneulink.core.components.functions.distributionfunctions import DriftDiffusionAnalytical
from psyneulink.core.components.functions.transferfunctions import Linear, Logistic
from psyneulink.core.c... | [
"psyneulink.core.scheduling.condition.EveryNCalls",
"psyneulink.core.scheduling.condition.Never",
"psyneulink.core.scheduling.condition.AfterNCalls",
"psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism",
"psyneulink.core.components.process.Process",
"psyneulink.core.compo... | [((2227, 2259), 'psyneulink.core.components.mechanisms.processing.transfermechanism.TransferMechanism', 'TransferMechanism', ([], {'name': '"""Reward"""'}), "(name='Reward')\n", (2244, 2259), False, 'from psyneulink.core.components.mechanisms.processing.transfermechanism import TransferMechanism\n'), ((2311, 2428), 'ps... |
import numpy as np
import random
import math
import collections
from enum import Enum
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import animation
import json
import copy
import wordvectors.physicaldata.tools as tools
class Energy_Modes(Enum):
neighbouring = 1
recta... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.axes",
"random.shuffle",
"matplotlib.pyplot.figure",
"matplotlib.colors.ListedColormap",
"random.randint",
"numpy.copy",
"json.loads",
"matplotlib.pyplot.imshow",
"wordvectors.physicaldata.tools.progress_log",
"numpy.append",
"copy.deepcopy",
"ma... | [((1997, 2026), 'wordvectors.physicaldata.tools.progress_log', 'tools.progress_log', (['num_steps'], {}), '(num_steps)\n', (2015, 2026), True, 'import wordvectors.physicaldata.tools as tools\n'), ((3185, 3197), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3195, 3197), True, 'import matplotlib.pyplot as ... |
import numpy as np
import time
import multiprocessing as mp
from multiprocessing.managers import SyncManager
from queue import PriorityQueue
from .XpcsAna.Xpcs import Xpcs
from .XsvsAna.Xsvs import Xsvs
from .SaxsAna.Saxs import Saxs
from .ProcData.Xdata import Xdata
from .Decorators import Decorators
from .misc.xsave ... | [
"multiprocessing.Lock",
"time.sleep",
"numpy.where",
"numpy.arange",
"multiprocessing.Process",
"numpy.digitize",
"numpy.unique"
] | [((2749, 2775), 'numpy.arange', 'np.arange', (['first', '(last + 1)'], {}), '(first, last + 1)\n', (2758, 2775), True, 'import numpy as np\n'), ((2792, 2820), 'numpy.arange', 'np.arange', (['(0)', 'nf', 'chunk_size'], {}), '(0, nf, chunk_size)\n', (2801, 2820), True, 'import numpy as np\n'), ((2845, 2874), 'numpy.digit... |
"""
Created: 2018-08-08
Modified: 2019-03-07
Author: <NAME> <<EMAIL>>
"""
from numpy import array, zeros, arange
from scipy.optimize import root
from scipy.interpolate import lagrange
import common
from common import r0, th0, ph0, pph0, timesteps, get_val, get_der
from plotting import plot_orbit
steps_per_bounce =... | [
"plotting.plot_orbit",
"numpy.zeros",
"common.timesteps",
"time.time",
"numpy.array",
"numpy.arange",
"scipy.optimize.root"
] | [((333, 373), 'common.timesteps', 'timesteps', (['steps_per_bounce'], {'nbounce': '(100)'}), '(steps_per_bounce, nbounce=100)\n', (342, 373), False, 'from common import r0, th0, ph0, pph0, timesteps, get_val, get_der\n'), ((424, 442), 'numpy.zeros', 'zeros', (['[3, nt + 1]'], {}), '([3, nt + 1])\n', (429, 442), False, ... |
import pygame
from pygame.locals import DOUBLEBUF, OPENGL, RESIZABLE
import math
import numpy as np
from OpenGL.GL import glLineWidth, glBegin, GL_LINES, glColor3f, glVertex3fv, glEnd, glPointSize, GL_POINTS, glVertex3f, \
glScaled, GLfloat, glGetFloatv, GL_MODELVIEW_MATRIX, glRotatef, glTranslatef, glClear, GL_COL... | [
"OpenGL.GL.glVertex3fv",
"pygame.event.get",
"OpenGL.GL.glScaled",
"OpenGL.GL.glClear",
"OpenGL.GL.glGetFloatv",
"OpenGL.GL.glTranslatef",
"OpenGL.GL.glBegin",
"pygame.display.set_mode",
"OpenGL.GL.glVertex3f",
"OpenGL.GL.glLineWidth",
"pygame.quit",
"pygame.mouse.get_pressed",
"math.sqrt",
... | [((563, 579), 'OpenGL.GL.glLineWidth', 'glLineWidth', (['(1.5)'], {}), '(1.5)\n', (574, 579), False, 'from OpenGL.GL import glLineWidth, glBegin, GL_LINES, glColor3f, glVertex3fv, glEnd, glPointSize, GL_POINTS, glVertex3f, glScaled, GLfloat, glGetFloatv, GL_MODELVIEW_MATRIX, glRotatef, glTranslatef, glClear, GL_COLOR_B... |
import numpy as np
def sigmoid(x, derivative=False):
# Sigmoida in odvod
s = 1/(1 + np.exp(-x))
if not derivative:
return s
else:
return s * (1 - s)
def ReLu(x, derivative=False):
if not derivative:
return x if x > 0 else 0,
else:
return 1 if x > 0 else 0,
k... | [
"numpy.exp"
] | [((94, 104), 'numpy.exp', 'np.exp', (['(-x)'], {}), '(-x)\n', (100, 104), True, 'import numpy as np\n')] |
###################
# PyCon 2018 Project Submission
# "Visualizing Global Refugee Crisis using Pythonic ETL"
# <EMAIL>
###################
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.basemap import Basemap
###################
# Generate a bar chart for total popul... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"mpl_toolkits.basemap.Basemap"
... | [((591, 689), 'matplotlib.pyplot.title', 'plt.title', (['"""Total Refugee Population: 1952-2016"""'], {'fontweight': '"""bold"""', 'color': '"""g"""', 'fontsize': '"""12"""'}), "('Total Refugee Population: 1952-2016', fontweight='bold', color=\n 'g', fontsize='12')\n", (600, 689), True, 'from matplotlib import pyplo... |
import time
import numpy as np
import torch
from torch.optim.lr_scheduler import ReduceLROnPlateau
# from torch_geometric.nn import VGAE
from torch_geometric.loader import DataLoader
from torch_geometric.utils import (degree, negative_sampling,
batched_negative_sampling,
... | [
"matplotlib.pyplot.title",
"argparse.ArgumentParser",
"time.ctime",
"matplotlib.pyplot.figure",
"numpy.mean",
"genome_graph.gen_g2g_graph",
"torch.no_grad",
"dcj_comp.dcj_dist",
"torch_geometric.loader.DataLoader",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.utils.tensorboard.SummaryWri... | [((960, 985), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (983, 985), False, 'import argparse\n'), ((3434, 3449), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3447, 3449), False, 'import torch\n'), ((4276, 4291), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4289, 4291), False... |
## Imports and Setup
print("Importing")
# Suppress all the deprecated warnings!
from warnings import simplefilter
simplefilter(action='ignore', category=FutureWarning)
import argparse
import numpy as np
import tensorflow as tf
from time import time
from data_loader import load_data, load_npz, load_random, load_ogb, ... | [
"analysis.plot_accs",
"os.mkdir",
"numpy.random.seed",
"argparse.ArgumentParser",
"tensorflow.logging.set_verbosity",
"data_loader.load_data",
"warnings.simplefilter",
"data_loader.load_random",
"tensorflow.set_random_seed",
"data_loader.load_npz",
"train.train",
"analysis.plot_losses",
"ana... | [((116, 169), 'warnings.simplefilter', 'simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (128, 169), False, 'from warnings import simplefilter\n'), ((627, 669), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR... |
from functools import partial
import numpy as np
import scarlet
from numpy.testing import assert_almost_equal, assert_equal
class TestWavelet(object):
def get_psfs(self, sigmas, boxsize):
psf = scarlet.GaussianPSF(sigmas, boxsize=boxsize)
return psf.get_model()
"""Test the wavelet object"""
... | [
"scarlet.GaussianPSF",
"scarlet.Starlet.from_coefficients",
"numpy.testing.assert_almost_equal",
"scarlet.Starlet.from_image",
"numpy.testing.assert_equal"
] | [((209, 253), 'scarlet.GaussianPSF', 'scarlet.GaussianPSF', (['sigmas'], {'boxsize': 'boxsize'}), '(sigmas, boxsize=boxsize)\n', (228, 253), False, 'import scarlet\n'), ((426, 467), 'scarlet.Starlet.from_image', 'scarlet.Starlet.from_image', (['psf'], {'scales': '(3)'}), '(psf, scales=3)\n', (452, 467), False, 'import ... |
from plume.tree import DecisionTreeClassifier
from plume.knn import KNeighborClassifier
from plume.ensemble import AdaBoostClassifier, BaggingClassifier, \
RandomForestsClassifier
import numpy as np
def test_adaboost():
clf = AdaBoostClassifier(DecisionTreeClassifier)
train_x = np.array([
[1, 1, 0]... | [
"numpy.array",
"plume.ensemble.BaggingClassifier",
"plume.ensemble.AdaBoostClassifier",
"plume.ensemble.RandomForestsClassifier",
"plume.knn.KNeighborClassifier"
] | [((235, 277), 'plume.ensemble.AdaBoostClassifier', 'AdaBoostClassifier', (['DecisionTreeClassifier'], {}), '(DecisionTreeClassifier)\n', (253, 277), False, 'from plume.ensemble import AdaBoostClassifier, BaggingClassifier, RandomForestsClassifier\n'), ((292, 357), 'numpy.array', 'np.array', (['[[1, 1, 0], [0, 1, 0], [1... |
import numpy as np
# array A / B
arrayA, arrayB = (np.array([int(i) for i in input().split()]) for _ in range(2))
# produ interno
# produ externo
print('{}\n{}'.format(np.inner(arrayA, arrayB), np.outer(arrayA, arrayB)))
| [
"numpy.outer",
"numpy.inner"
] | [((169, 193), 'numpy.inner', 'np.inner', (['arrayA', 'arrayB'], {}), '(arrayA, arrayB)\n', (177, 193), True, 'import numpy as np\n'), ((195, 219), 'numpy.outer', 'np.outer', (['arrayA', 'arrayB'], {}), '(arrayA, arrayB)\n', (203, 219), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
"""Specification for Generation of training data sets"""
import os
import pathlib
import shutil
from sets.training_sets import (
TrainingSets,
XML_NS
)
from cv2 import (
cv2
)
import pytest
import numpy as np
import lxml.etree as etree
RES_ROOT = os.path.join('tests', 'resources'... | [
"cv2.cv2.putText",
"sets.training_sets.TrainingSets",
"numpy.random.rand",
"os.path.dirname",
"pytest.fixture",
"os.path.exists",
"pathlib.Path",
"shutil.copyfile",
"sets.training_sets.XML_NS.items",
"os.path.join"
] | [((287, 321), 'os.path.join', 'os.path.join', (['"""tests"""', '"""resources"""'], {}), "('tests', 'resources')\n", (299, 321), False, 'import os\n'), ((1869, 1908), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""fixture_alto_tif"""'}), "(name='fixture_alto_tif')\n", (1883, 1908), False, 'import pytest\n'), ((34... |
# -*- coding: utf-8 -*-
import numpy as np
def bou(z):
#razones adimensionales
a=4.6 #dimensiones zapata
b=14. #dimensiones zapata
q=1000./(a*b) #carga
m=a/z #adimensional
n=b/z #adimensional
#solución de la ecuación de ... | [
"numpy.arcsin"
] | [((441, 538), 'numpy.arcsin', 'np.arcsin', (['(2 * m * n * (m ** 2 + n ** 2 + 1) ** 0.5 / (m ** 2 + n ** 2 + 1 + m ** 2 *\n n ** 2))'], {}), '(2 * m * n * (m ** 2 + n ** 2 + 1) ** 0.5 / (m ** 2 + n ** 2 + 1 +\n m ** 2 * n ** 2))\n', (450, 538), True, 'import numpy as np\n')] |
# Aprendizaje Automático: Proyecto Final
# Clasificación de símbolos Devanagari
# <NAME>
# <NAME>
# png_to_np.py
# Lee los datos en formato .png y los escribe como arrays de numpy (sin marco)
import glob
import numpy as np
import matplotlib.pyplot as plt
# Paths
CHARACTERS='datos/characters.txt'
TRAIN_IMG_DIR='dato... | [
"numpy.savez_compressed",
"numpy.array",
"numpy.reshape",
"glob.glob",
"matplotlib.pyplot.imread"
] | [((1383, 1431), 'numpy.reshape', 'np.reshape', (['train_mat', '(train_mat.shape[0], 784)'], {}), '(train_mat, (train_mat.shape[0], 784))\n', (1393, 1431), True, 'import numpy as np\n'), ((1702, 1748), 'numpy.reshape', 'np.reshape', (['test_mat', '(test_mat.shape[0], 784)'], {}), '(test_mat, (test_mat.shape[0], 784))\n'... |
import unittest
import numpy as np
from eoflow.models.losses import CategoricalCrossEntropy, CategoricalFocalLoss
from eoflow.models.losses import JaccardDistanceLoss, TanimotoDistanceLoss
class TestLosses(unittest.TestCase):
def test_shapes(self):
for loss_fn in [CategoricalFocalLoss(from_logits=True), ... | [
"unittest.main",
"numpy.stack",
"eoflow.models.losses.CategoricalFocalLoss",
"eoflow.models.losses.TanimotoDistanceLoss",
"numpy.zeros",
"numpy.ones",
"eoflow.models.losses.JaccardDistanceLoss",
"numpy.array",
"eoflow.models.losses.CategoricalCrossEntropy",
"numpy.concatenate"
] | [((4703, 4718), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4716, 4718), False, 'import unittest\n'), ((896, 913), 'numpy.ones', 'np.ones', (['(32, 32)'], {}), '((32, 32))\n', (903, 913), True, 'import numpy as np\n'), ((930, 948), 'numpy.zeros', 'np.zeros', (['(32, 32)'], {}), '((32, 32))\n', (938, 948), True... |
import numpy as np
from keras import backend as Theano
from keras.layers import Dense, Input, Convolution2D, Flatten, merge
from keras.layers.normalization import BatchNormalization
from keras.models import Model
from keras.optimizers import Adadelta, RMSprop, Adam, SGD
from keras.regularizers import l1, l2
from keras.... | [
"keras.layers.Convolution2D",
"keras.backend.function",
"keras.layers.Flatten",
"keras.backend.T.sum",
"keras.models.Model",
"numpy.ones",
"keras.backend.T.arange",
"keras.layers.Dense",
"numpy.arange",
"keras.layers.Input",
"keras.optimizers.RMSprop",
"keras.layers.merge"
] | [((627, 648), 'keras.layers.Input', 'Input', (['self.state_dim'], {}), '(self.state_dim)\n', (632, 648), False, 'from keras.layers import Dense, Input, Convolution2D, Flatten, merge\n'), ((1840, 1868), 'keras.models.Model', 'Model', (['self.state_in', 'self.q'], {}), '(self.state_in, self.q)\n', (1845, 1868), False, 'f... |
import os
import numpy as np
from scipy.ndimage import gaussian_filter
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import np_tif
from stack_registration import bucket
def main():
assert os.path.isdir('./../images')
if not os.path.isdir('./../images/figure_3... | [
"mpl_toolkits.axes_grid1.make_axes_locatable",
"os.mkdir",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show",
"numpy.amin",
"os.path.isdir",
"scipy.ndimage.gaussian_filter",
"numpy.zeros",
"matplotlib.pyplot.colorbar",
"numpy.amax",
"stack_registration.bucket",
"matplotlib.pyplot.subplots"... | [((244, 272), 'os.path.isdir', 'os.path.isdir', (['"""./../images"""'], {}), "('./../images')\n", (257, 272), False, 'import os\n'), ((3460, 3511), 'scipy.ndimage.gaussian_filter', 'gaussian_filter', (['STE_stack'], {'sigma': '(0, sigma, sigma)'}), '(STE_stack, sigma=(0, sigma, sigma))\n', (3475, 3511), False, 'from sc... |
import copy
import numpy as np
import time
import matplotlib.pyplot as plt
import memory_profiler
from floris.simulation import Floris
from conftest import SampleInputs
def time_profile(input_dict):
floris = Floris.from_dict(input_dict.floris)
start = time.perf_counter()
floris.steady_state_atmospheric_c... | [
"copy.deepcopy",
"floris.simulation.Floris",
"floris.simulation.Floris.from_dict",
"numpy.sum",
"numpy.zeros",
"time.perf_counter",
"memory_profiler.memory_usage",
"conftest.SampleInputs"
] | [((215, 250), 'floris.simulation.Floris.from_dict', 'Floris.from_dict', (['input_dict.floris'], {}), '(input_dict.floris)\n', (231, 250), False, 'from floris.simulation import Floris\n'), ((263, 282), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (280, 282), False, 'import time\n'), ((341, 360), 'time.per... |
from math import floor, atan2, sqrt, pi
import numpy as np
from numba import cuda, void, float64, float32, complex128, complex64, int32
from ._spherical_harmonics import gen_sph
from ..plists import nlist
class ql:
def __init__(self, frame, ls=np.asarray([4, 6]), cell_guess=15, n_guess=10):
self.frame =... | [
"numba.void",
"numpy.ceil",
"math.sqrt",
"math.atan2",
"numpy.asarray",
"numpy.dtype",
"numba.cuda.get_current_device",
"numba.cuda.to_device",
"numba.cuda.atomic.add",
"numpy.zeros",
"math.floor",
"numba.cuda.local.array",
"numpy.max",
"numba.cuda.grid",
"numba.cuda.synchronize"
] | [((252, 270), 'numpy.asarray', 'np.asarray', (['[4, 6]'], {}), '([4, 6])\n', (262, 270), True, 'import numpy as np\n'), ((825, 845), 'numpy.dtype', 'np.dtype', (['np.float64'], {}), '(np.float64)\n', (833, 845), True, 'import numpy as np\n'), ((1567, 1590), 'numba.cuda.to_device', 'cuda.to_device', (['self.ls'], {}), '... |
import numpy as np
import numba
from src.data import Problem, Case, Matter
from src.operator.solver.common.shape import is_same
@numba.jit('i8(i8[:, :], i8)', nopython=True)
def find_periodicity_row(x_arr, background):
"""
:param x_arr: np.array(int)
:param background: int
:return: int, minimum period... | [
"numpy.abs",
"numpy.zeros",
"numpy.ones",
"src.operator.solver.common.shape.is_same",
"src.data.Matter",
"numba.jit",
"numpy.unique"
] | [((131, 175), 'numba.jit', 'numba.jit', (['"""i8(i8[:, :], i8)"""'], {'nopython': '(True)'}), "('i8(i8[:, :], i8)', nopython=True)\n", (140, 175), False, 'import numba\n'), ((843, 897), 'numba.jit', 'numba.jit', (['"""i8[:, :](i8[:, :], i8, i8)"""'], {'nopython': '(True)'}), "('i8[:, :](i8[:, :], i8, i8)', nopython=Tru... |
# Code is from OpenAI Baseline and Tensor2Tensor
import itertools
import numpy as np
from gym.envs.box2d import CarRacing
import multiprocessing as mp
def printstar(string, num_stars=50):
print("*" * num_stars)
print(string)
print("*" * num_stars)
def make_env():
def _thunk():
env = CarRacin... | [
"pickle.loads",
"numpy.stack",
"gym.envs.box2d.CarRacing",
"cloudpickle.dumps",
"multiprocessing.Pipe"
] | [((312, 431), 'gym.envs.box2d.CarRacing', 'CarRacing', ([], {'grayscale': '(0)', 'show_info_panel': '(0)', 'discretize_actions': '"""hard"""', 'frames_per_state': '(1)', 'num_lanes': '(1)', 'num_tracks': '(1)'}), "(grayscale=0, show_info_panel=0, discretize_actions='hard',\n frames_per_state=1, num_lanes=1, num_trac... |
# Tensorflow and numpy to create the neural network
import tensorflow as tf
import numpy as np
# Matplotlib to plot info to show our results
import matplotlib.pyplot as plt
# OS to load files and save checkpoints
import os
# Load MNIST data from tf examples
image_height = 28
image_width = 28
color_channels = 1
mo... | [
"tensorflow.reset_default_graph",
"tensorflow.local_variables_initializer",
"pickle.load",
"tensorflow.layers.max_pooling2d",
"tensorflow.nn.softmax",
"tensorflow.metrics.accuracy",
"numpy.transpose",
"os.path.exists",
"numpy.append",
"tensorflow.placeholder",
"tensorflow.cast",
"numpy.reshape... | [((348, 395), 'tensorflow.contrib.learn.datasets.load_dataset', 'tf.contrib.learn.datasets.load_dataset', (['"""mnist"""'], {}), "('mnist')\n", (386, 395), True, 'import tensorflow as tf\n'), ((444, 490), 'numpy.asarray', 'np.asarray', (['mnist.train.labels'], {'dtype': 'np.int32'}), '(mnist.train.labels, dtype=np.int3... |
import os
import sys
import copy
import pickle
import numpy as np
import pandas as pd
from inspect import signature
from tensorflow import keras
from skorch.net import NeuralNet
from abc import ABCMeta, abstractmethod
from commonmodels2.utils.utils import *
from commonmodels2.log.logger import Logger
class ModelBase(m... | [
"copy.deepcopy",
"pickle.dump",
"tensorflow.keras.models.load_model",
"os.makedirs",
"os.path.isdir",
"os.path.dirname",
"numpy.any",
"pickle.load",
"inspect.signature",
"numpy.array",
"os.path.join",
"skorch.net.NeuralNet"
] | [((718, 733), 'inspect.signature', 'signature', (['func'], {}), '(func)\n', (727, 733), False, 'from inspect import signature\n'), ((1312, 1339), 'copy.deepcopy', 'copy.deepcopy', (['self._params'], {}), '(self._params)\n', (1325, 1339), False, 'import copy\n'), ((1398, 1419), 'copy.deepcopy', 'copy.deepcopy', (['param... |
# coding: utf8
# !/usr/env/python
# coding: utf8
# !/usr/env/python
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal
from terrainbento import BasicHySa, NotCoreNodeBaselevelHandler, PrecipChanger
@pytest.mark.parametrize("m_sp,n_sp", [(1.0 / 3, 2.0 / 3.0), (0.5, 1.0)])
@pytest.ma... | [
"terrainbento.NotCoreNodeBaselevelHandler",
"numpy.power",
"terrainbento.BasicHySa",
"terrainbento.PrecipChanger",
"pytest.raises",
"pytest.mark.parametrize",
"numpy.testing.assert_array_almost_equal"
] | [((237, 309), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""m_sp,n_sp"""', '[(1.0 / 3, 2.0 / 3.0), (0.5, 1.0)]'], {}), "('m_sp,n_sp', [(1.0 / 3, 2.0 / 3.0), (0.5, 1.0)])\n", (260, 309), False, 'import pytest\n'), ((311, 396), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""depression_finder"""... |
from PIL import Image
import numpy as np
from blend_modes import soft_light, multiply
from core_def import CoreModeKey, BlendKey
class Blend(object):
@staticmethod
def run(image, config, show):
return Blend.__do_blend(image, config[CoreModeKey.MODE], config[BlendKey.OPACITY], show)
@staticmetho... | [
"PIL.Image.fromarray",
"numpy.uint8"
] | [((776, 803), 'numpy.uint8', 'np.uint8', (['blended_img_float'], {}), '(blended_img_float)\n', (784, 803), True, 'import numpy as np\n'), ((912, 940), 'PIL.Image.fromarray', 'Image.fromarray', (['blended_img'], {}), '(blended_img)\n', (927, 940), False, 'from PIL import Image\n')] |
from typing import Dict, List
import numpy as np
from matplotlib import pyplot as plt
from src.bounding_box import BoundingBox
from src.evaluators.pascal_voc_evaluator import calculate_ap_every_point
from doors_detector.evaluators.model_evaluator import ModelEvaluator
class MyEvaluator(ModelEvaluator):
def get... | [
"matplotlib.pyplot.title",
"numpy.divide",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"numpy.count_nonzero",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"src.bounding_box.BoundingBox.iou",
"numpy.array",
"src.evaluators.pa... | [((9198, 9253), 'numpy.divide', 'np.divide', (['accumulate_tp', '(accumulate_tp + accumulate_fp)'], {}), '(accumulate_tp, accumulate_tp + accumulate_fp)\n', (9207, 9253), True, 'import numpy as np\n'), ((9291, 9334), 'src.evaluators.pascal_voc_evaluator.calculate_ap_every_point', 'calculate_ap_every_point', (['recall',... |
import random
import numpy as np
from albumentations import DualTransform
from skimage.transform import PiecewiseAffineTransform, warp
class CustomPiecewiseAffineTransform(DualTransform):
"""
Add sine-wave piecewise affine transform to the image
Args:
phase_shift_limit, amplitude_limit, w_limit:... | [
"numpy.dstack",
"skimage.transform.PiecewiseAffineTransform",
"numpy.meshgrid",
"random.uniform",
"skimage.transform.warp",
"numpy.linspace",
"numpy.vstack"
] | [((770, 796), 'skimage.transform.PiecewiseAffineTransform', 'PiecewiseAffineTransform', ([], {}), '()\n', (794, 796), False, 'from skimage.transform import PiecewiseAffineTransform, warp\n'), ((1816, 1840), 'numpy.linspace', 'np.linspace', (['(0)', 'cols', '(20)'], {}), '(0, cols, 20)\n', (1827, 1840), True, 'import nu... |
import pandas as pd
import pylab
import numpy as np
import tensorflow as tf
import os
import gc
import librosa
import librosa.display
import matplotlib
import matplotlib.pyplot as plt
from keras.preprocessing.image import img_to_array, load_img
from keras.models import Model, Sequential
from keras.optimizer... | [
"matplotlib.pyplot.title",
"pandas.read_csv",
"numpy.around",
"keras.optimizers.SGD",
"keras.layers.Flatten",
"sklearn.preprocessing.LabelEncoder",
"keras.utils.np_utils.to_categorical",
"keras.layers.MaxPooling2D",
"matplotlib.pyplot.show",
"keras.layers.Convolution2D",
"keras.layers.Dropout",
... | [((1962, 1993), 'numpy.around', 'np.around', (['(output_image / 255.0)'], {}), '(output_image / 255.0)\n', (1971, 1993), True, 'import numpy as np\n'), ((2079, 2103), 'pandas.read_csv', 'pd.read_csv', (['"""train.csv"""'], {}), "('train.csv')\n", (2090, 2103), True, 'import pandas as pd\n'), ((2642, 2707), 'sklearn.mod... |
# Copyright 2021 The Kubric 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 agreed to in w... | [
"json.load",
"tensorflow_datasets.public_api.features.ClassLabel",
"tensorflow_datasets.public_api.features.Text",
"tensorflow_datasets.public_api.features.Image",
"tensorflow_datasets.public_api.features.Tensor",
"tensorflow_datasets.public_api.core.Version",
"numpy.array",
"tensorflow_datasets.publi... | [((3601, 3627), 'tensorflow_datasets.public_api.core.Version', 'tfds.core.Version', (['"""1.0.0"""'], {}), "('1.0.0')\n", (3618, 3627), True, 'import tensorflow_datasets.public_api as tfds\n'), ((7727, 7754), 'tensorflow_datasets.public_api.core.as_path', 'tfds.core.as_path', (['filename'], {}), '(filename)\n', (7744, ... |
import cv2
import os.path
import numpy as np
from os.path import dirname,exists
from tensorflow.keras.models import load_model
# make prediction on image saved on disk
def prediction_path(path_img,path_res,model_name="model.h5"):
if not exists("models/"+model_name):
print('Model '+model_name+' not found !!... | [
"tensorflow.keras.models.load_model",
"numpy.argmax",
"cv2.cvtColor",
"os.path.dirname",
"os.path.exists",
"cv2.imread",
"numpy.reshape",
"cv2.resize"
] | [((395, 429), 'tensorflow.keras.models.load_model', 'load_model', (["('models/' + model_name)"], {}), "('models/' + model_name)\n", (405, 429), False, 'from tensorflow.keras.models import load_model\n'), ((999, 1036), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2GRAY'], {}), '(img, cv2.COLOR_BGR2GRAY)\n', (1... |
from collections import namedtuple
from copy import deepcopy
import numpy as np
def powers2(num):
'''List (descending) of powers of two in the number'''
powers = [int(power)
for power, value in enumerate(reversed(format(num, 'b')))
if value != '0']
return powers[::-1]
# asser... | [
"copy.deepcopy",
"collections.namedtuple",
"numpy.copy"
] | [((397, 497), 'collections.namedtuple', 'namedtuple', (['"""Tile"""', "('coords', 'cells', 'master_vertices', 'slave_vertices', 'mappings', 'data')"], {}), "('Tile', ('coords', 'cells', 'master_vertices', 'slave_vertices',\n 'mappings', 'data'))\n", (407, 497), False, 'from collections import namedtuple\n'), ((916, ... |
import numpy as np
import torch
def get_coordinate_tensors(x_max, y_max):
x_map = np.tile(np.arange(x_max), (y_max,1))/x_max*2 - 1.0
y_map = np.tile(np.arange(y_max), (x_max,1)).T/y_max*2 - 1.0
x_map_tensor = torch.from_numpy(x_map.astype(np.float32)).cuda()
y_map_tensor = torch.from_numpy(y_map.asty... | [
"torch.stack",
"numpy.arange",
"torch.cat"
] | [((1278, 1303), 'torch.cat', 'torch.cat', (['centers'], {'dim': '(0)'}), '(centers, dim=0)\n', (1287, 1303), False, 'import torch\n'), ((1503, 1533), 'torch.cat', 'torch.cat', (['centers_list'], {'dim': '(0)'}), '(centers_list, dim=0)\n', (1512, 1533), False, 'import torch\n'), ((96, 112), 'numpy.arange', 'np.arange', ... |
import os
import re
import numpy as np
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException, \
UnexpectedAlertPresentException, StaleElementReferenceException, \
NoSuchWindowException, WebDriverException
from enum import Enum, auto
from threading import Thread, Event
f... | [
"threading.Thread",
"numpy.zeros",
"re.match",
"threading.Event",
"selenium.webdriver.ChromeOptions",
"selenium.webdriver.Chrome",
"enum.auto",
"numpy.all"
] | [((539, 545), 'enum.auto', 'auto', ([], {}), '()\n', (543, 545), False, 'from enum import Enum, auto\n'), ((560, 566), 'enum.auto', 'auto', ([], {}), '()\n', (564, 566), False, 'from enum import Enum, auto\n'), ((581, 587), 'enum.auto', 'auto', ([], {}), '()\n', (585, 587), False, 'from enum import Enum, auto\n'), ((60... |
import pygame
from pygame.locals import *
from numpy import reshape
import sys
import traceback
import random
import math
from .game import Game
def rndint(x):
return int(round(x))
def clamp(x, minimum, maximum):
if x < minimum:
return minimum
if x > maximum:
return maximum
return x
... | [
"random.randint",
"pygame.font.SysFont",
"pygame.event.get",
"pygame.draw.rect",
"math.sin",
"pygame.display.flip",
"numpy.reshape",
"math.cos",
"pygame.time.Clock",
"pygame.key.get_pressed"
] | [((701, 743), 'pygame.font.SysFont', 'pygame.font.SysFont', (['"""Times New Roman"""', '(18)'], {}), "('Times New Roman', 18)\n", (720, 743), False, 'import pygame\n'), ((1344, 1363), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (1361, 1363), False, 'import pygame\n'), ((1808, 1841), 'numpy.reshape', 're... |
import os
import unittest
import warnings
# prevent excessive warning logs
warnings.filterwarnings('ignore')
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import numpy as np
import random
from sklearn.model_selection import train_test_split
from finetune import ComparisonRegressor
class TestComparisonRegression(unittes... | [
"unittest.main",
"numpy.random.seed",
"warnings.filterwarnings",
"sklearn.model_selection.train_test_split",
"random.choice",
"numpy.mean",
"random.seed"
] | [((76, 109), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (99, 109), False, 'import warnings\n'), ((2513, 2528), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2526, 2528), False, 'import unittest\n'), ((652, 667), 'random.seed', 'random.seed', (['(42)'], {}), '(42... |
import torch
import numpy as np
import data
import matplotlib.pyplot as plt
import copy
class PTDeep(torch.nn.Module):
def __init__(self, conf, activation_f, param_lambda=1e-4):
"""Arguments:
:param conf: network architecture - nr_neurons in each layer
"""
self.conf = conf
... | [
"data.graph_surface",
"numpy.random.seed",
"numpy.argmax",
"torch.mm",
"torch.randn",
"data.sample_gmm_2d",
"data.sample_gauss_2d",
"numpy.random.randint",
"numpy.max",
"torch.Tensor",
"torch.optim.lr_scheduler.ExponentialLR",
"torch.nn.ParameterList",
"torch.zeros",
"torch.log",
"matplo... | [((7247, 7314), 'torch.optim.lr_scheduler.ExponentialLR', 'torch.optim.lr_scheduler.ExponentialLR', (['optimizer'], {'gamma': '(1 - 0.0001)'}), '(optimizer, gamma=1 - 0.0001)\n', (7285, 7314), False, 'import torch\n'), ((8145, 8160), 'torch.Tensor', 'torch.Tensor', (['X'], {}), '(X)\n', (8157, 8160), False, 'import tor... |
"""Search for rooms where maximizing correlational coefficient leads to
accurate clustering
"""
import multiprocessing
import csv
import sys
from copy import deepcopy
import numpy as np
from ..data_loader import config_loader
from . import strict_ga
def _choose_random_room(total_room_count: int, target_room_count: in... | [
"numpy.random.choice",
"copy.deepcopy",
"numpy.random.seed",
"csv.writer",
"multiprocessing.Value",
"multiprocessing.Pool",
"sys.stderr.write"
] | [((432, 472), 'multiprocessing.Value', 'multiprocessing.Value', (['"""i"""', '(0)'], {'lock': '(True)'}), "('i', 0, lock=True)\n", (453, 472), False, 'import multiprocessing\n'), ((335, 408), 'numpy.random.choice', 'np.random.choice', (['total_room_count'], {'size': 'target_room_count', 'replace': '(False)'}), '(total_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @File : fib.py
# @Date : 2019-02-15
# @Author : luyang(<EMAIL>)
import numpy as np
from prettytable import PrettyTable
def fib(month, produce, young):
rabbits = np.zeros([month, 2])
# 第一个月的起始状况,1对young,0对mature
rabbits[0, 0] = young
rabbits[0, ... | [
"numpy.zeros",
"prettytable.PrettyTable"
] | [((225, 245), 'numpy.zeros', 'np.zeros', (['[month, 2]'], {}), '([month, 2])\n', (233, 245), True, 'import numpy as np\n'), ((806, 856), 'prettytable.PrettyTable', 'PrettyTable', (["['month', 'young', 'mature', 'total']"], {}), "(['month', 'young', 'mature', 'total'])\n", (817, 856), False, 'from prettytable import Pre... |
""" Rasterize
Module to rasterize a shapely polygon to a Numpy Array
Author: <NAME>
(University of Antwerp, Belgium)
"""
import numpy as np
from rasterio.features import rasterize as rasterioRasterize
from shapely.geometry import Polygon, MultiPolygon, Point
from np2Geotiff import *
def rasterize(mpol, res ... | [
"numpy.flip",
"numpy.ceil",
"shapely.geometry.Polygon",
"numpy.zeros",
"shapely.geometry.MultiPolygon",
"numpy.min",
"numpy.rot90",
"numpy.max",
"numpy.array"
] | [((2038, 2060), 'numpy.zeros', 'np.zeros', (['(rows, cols)'], {}), '((rows, cols))\n', (2046, 2060), True, 'import numpy as np\n'), ((3295, 3315), 'numpy.flip', 'np.flip', (['arr'], {'axis': '(0)'}), '(arr, axis=0)\n', (3302, 3315), True, 'import numpy as np\n'), ((1301, 1321), 'shapely.geometry.MultiPolygon', 'MultiPo... |
import json
import PIL
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
import torch
from torch import nn
from torch import tensor
from torch import optim
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
import torchvision.models as... | [
"torch.nn.Dropout",
"numpy.argmax",
"torch.nn.NLLLoss",
"torchvision.transforms.Normalize",
"torch.no_grad",
"torch.utils.data.DataLoader",
"torchvision.transforms.RandomRotation",
"torch.load",
"torch.exp",
"torch.nn.Linear",
"torchvision.transforms.CenterCrop",
"torchvision.models.vgg16",
... | [((1349, 1408), 'torchvision.datasets.ImageFolder', 'datasets.ImageFolder', (['train_dir'], {'transform': 'train_transforms'}), '(train_dir, transform=train_transforms)\n', (1369, 1408), False, 'from torchvision import datasets, transforms\n'), ((1421, 1478), 'torchvision.datasets.ImageFolder', 'datasets.ImageFolder', ... |
#!/usr/bin/env python3
import os
from datetime import datetime
import re
from dataclasses import dataclass
import pathlib
import numpy as np
import scipy.stats as stats
from analysis.parser.common import parse_contiki
@dataclass(frozen=True)
class LengthStats:
length: int
seconds: float
def us_to_s(us: int... | [
"argparse.ArgumentParser",
"os.path.basename",
"analysis.parser.common.parse_contiki",
"numpy.mean",
"scipy.stats.sem",
"scipy.stats.describe",
"dataclasses.dataclass",
"re.compile"
] | [((223, 245), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (232, 245), False, 'from dataclasses import dataclass\n'), ((474, 521), 're.compile', 're.compile', (['"""sha256\\\\(([0-9]+)\\\\), ([0-9]+) us"""'], {}), "('sha256\\\\(([0-9]+)\\\\), ([0-9]+) us')\n", (484, 521), False, ... |
# -*- coding: utf-8 -*-
#
# This module is part of the GeoTag-X PyBossa plugin.
# It contains implementations for custom filters.
#
# Authors:
# - <NAME> (<EMAIL>)
# - <NAME> (<EMAIL>)
#
# Copyright (c) 2016 UNITAR/UNOSAT
#
# The MIT License (MIT)
# Permission is hereby granted, free of charge, to any person obtaining ... | [
"math.exp",
"flask.Blueprint",
"json.loads",
"math.fabs",
"pybossa.exporter.json_export.JsonExporter",
"json.dumps",
"flask.jsonify",
"flask.current_app.config.keys",
"pybossa.cache.projects.get",
"numpy.unique"
] | [((1366, 1413), 'flask.Blueprint', 'Blueprint', (['"""geotagx-geojson-exporter"""', '__name__'], {}), "('geotagx-geojson-exporter', __name__)\n", (1375, 1413), False, 'from flask import Blueprint, current_app, jsonify\n'), ((2134, 2148), 'pybossa.exporter.json_export.JsonExporter', 'JsonExporter', ([], {}), '()\n', (21... |
from .base_array import *
from .state_variables_array import *
import cantera as ct
import numpy as np
import scipy.interpolate as interp
class PressureArray(StateVariablesArray):
'''Variable array for pressure'''
def __init__(self, parent, var=None):
super().__init__(parent, var)
self.name = ... | [
"scipy.interpolate.interp1d",
"numpy.multiply"
] | [((814, 857), 'scipy.interpolate.interp1d', 'interp.interp1d', (['dis', 'phi_cgs'], {'kind': '"""cubic"""'}), "(dis, phi_cgs, kind='cubic')\n", (829, 857), True, 'import scipy.interpolate as interp\n'), ((1396, 1422), 'numpy.multiply', 'np.multiply', (['R_s', 'coef_a_V'], {}), '(R_s, coef_a_V)\n', (1407, 1422), True, '... |
import numpy as np
import torch
from sklearn.metrics import roc_auc_score, precision_recall_curve, jaccard_score, f1_score
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.initialized = False
self.val = None
self.avg = None
... | [
"numpy.round",
"numpy.multiply",
"sklearn.metrics.roc_auc_score"
] | [((1800, 1829), 'sklearn.metrics.roc_auc_score', 'roc_auc_score', (['target', 'output'], {}), '(target, output)\n', (1813, 1829), False, 'from sklearn.metrics import roc_auc_score, precision_recall_curve, jaccard_score, f1_score\n'), ((474, 498), 'numpy.multiply', 'np.multiply', (['val', 'weight'], {}), '(val, weight)\... |
from pywebio.input import *
from pywebio.output import *
from pywebio import start_server
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import io
def data_gen(num=100):
"""
Generates random samples for plotting
"""
a = np.random.normal(size=num)
return a
def plot_raw(a):... | [
"io.BytesIO",
"pywebio.start_server",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.close",
"PIL.Image.open",
"matplotlib.pyplot.figure",
"numpy.random.normal",
"matplotlib.pyplot.gcf"
] | [((263, 289), 'numpy.random.normal', 'np.random.normal', ([], {'size': 'num'}), '(size=num)\n', (279, 289), True, 'import numpy as np\n'), ((362, 373), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (371, 373), True, 'import matplotlib.pyplot as plt\n'), ((378, 405), 'matplotlib.pyplot.figure', 'plt.figure',... |
#!/usr/bin/env python
import scipy.stats
from sklearn.metrics import mean_squared_error
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import jinja2
from jinja2 import Template
import os
import subprocess
import matplotlib
import json
pgf_with_latex = {"pgf.texsystem": 'pdflatex'}
matplotlib.r... | [
"matplotlib.pyplot.title",
"numpy.load",
"pandas.read_csv",
"github.Github",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.round",
"os.path.abspath",
"matplotlib.rcParams.update",
"numpy.int",
"numpy.linspace",
"sklearn.metrics.mean_squared_error",
"i... | [((308, 350), 'matplotlib.rcParams.update', 'matplotlib.rcParams.update', (['pgf_with_latex'], {}), '(pgf_with_latex)\n', (334, 350), False, 'import matplotlib\n'), ((496, 522), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 4)'}), '(figsize=(6, 4))\n', (506, 522), True, 'import matplotlib.pyplot as pl... |
# Plot Linked Subreddits
# Import Modules
import os
import pandas as pd
import numpy as np
import csv
import matplotlib.pyplot as plt
from matplotlib.ticker import PercentFormatter
linked_sr = pd.read_csv('Outputs/CS_FULL/LinkedSubreddits_CS_FULL.csv')
linked_sr = linked_sr.sort_values(by=['Times_Linked'],ascending=... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"pandas.read_csv",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.yticks",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.subplots"
] | [((195, 254), 'pandas.read_csv', 'pd.read_csv', (['"""Outputs/CS_FULL/LinkedSubreddits_CS_FULL.csv"""'], {}), "('Outputs/CS_FULL/LinkedSubreddits_CS_FULL.csv')\n", (206, 254), True, 'import pandas as pd\n'), ((1414, 1456), 'numpy.arange', 'np.arange', (['(0)', '(max_links + spacing)', 'spacing'], {}), '(0, max_links + ... |
import numpy as np
import pyglet
from glearn.viewers.modes.viewer_mode import ViewerMode
from glearn.networks.layers.conv2d import Conv2dLayer
class CNNViewerMode(ViewerMode):
def __init__(self, config, visualize_grid=[1, 1], **kwargs):
super().__init__(config, **kwargs)
self.visualize_grid = vis... | [
"numpy.zeros",
"numpy.multiply"
] | [((3247, 3282), 'numpy.multiply', 'np.multiply', (['self.input.shape', 'grid'], {}), '(self.input.shape, grid)\n', (3258, 3282), True, 'import numpy as np\n'), ((3372, 3392), 'numpy.zeros', 'np.zeros', (['image_size'], {}), '(image_size)\n', (3380, 3392), True, 'import numpy as np\n'), ((5314, 5346), 'numpy.zeros', 'np... |
"""
This module provides tools for stacking a model on top of other
models without information leakage from a target variable to
predictions made by base models.
@author: <NAME>
"""
from typing import List, Dict, Tuple, Callable, Union, Optional, Any
from abc import ABC, abstractmethod
import numpy as np
from skle... | [
"sklearn.base.clone",
"sklearn.utils.validation.check_X_y",
"numpy.unique",
"numpy.zeros",
"sklearn.model_selection.KFold",
"sklearn.utils.validation.check_is_fitted",
"numpy.hstack",
"numpy.apply_along_axis",
"joblib.Parallel",
"joblib.delayed",
"sklearn.utils.multiclass.check_classification_ta... | [((10472, 10515), 'numpy.hstack', 'np.hstack', (['(meta_features, ordering_column)'], {}), '((meta_features, ordering_column))\n', (10481, 10515), True, 'import numpy as np\n'), ((11569, 11592), 'numpy.vstack', 'np.vstack', (['meta_feature'], {}), '(meta_feature)\n', (11578, 11592), True, 'import numpy as np\n'), ((130... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.