code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
from typing import AnyStr, ByteString, Callable, List, Sequence, TypeVar, Union import numpy as np ReturnType = TypeVar("ReturnType") dtype_dict = { "float": "FLOAT", "double": "DOUBLE", "float32": "FLOAT", "float64": "DOUBLE", "int8": "INT8", "int16": "INT16", "int32": "INT32", "int6...
[ "typing.TypeVar", "numpy.dtype", "numpy.frombuffer", "numpy.fromstring" ]
[((114, 135), 'typing.TypeVar', 'TypeVar', (['"""ReturnType"""'], {}), "('ReturnType')\n", (121, 135), False, 'from typing import AnyStr, ByteString, Callable, List, Sequence, TypeVar, Union\n'), ((1477, 1510), 'numpy.fromstring', 'np.fromstring', (['value'], {'dtype': 'dtype'}), '(value, dtype=dtype)\n', (1490, 1510),...
import numpy as np from path import Path import scipy.misc from collections import Counter import matplotlib.pyplot as plt class KittiRawLoader(object): def __init__(self, dataset_dir, static_frames_file=None, img_height=128, img_width=416, ...
[ "numpy.eye", "numpy.fromfile", "collections.Counter", "numpy.zeros", "numpy.genfromtxt", "path.Path", "numpy.linalg.norm", "numpy.reshape", "numpy.int", "numpy.array", "numpy.where", "numpy.dot", "numpy.round" ]
[((869, 886), 'path.Path', 'Path', (['dataset_dir'], {}), '(dataset_dir)\n', (873, 886), False, 'from path import Path\n'), ((4336, 4395), 'numpy.reshape', 'np.reshape', (["filedata['P_rect_' + scene_data['cid']]", '(3, 4)'], {}), "(filedata['P_rect_' + scene_data['cid']], (3, 4))\n", (4346, 4395), True, 'import numpy ...
import json import logging import numpy as np import pathlib import pickle import random from sklearn.preprocessing import LabelEncoder import torch import torch.utils.data class TranscribedDataset(): le = None sos = '<sos>' eos = '<eos>' pad = '<pad>' unk = '<unk>' @classmethod def init_...
[ "json.load", "torch.stack", "random.sample", "torch.load", "sklearn.preprocessing.LabelEncoder", "pathlib.Path", "pickle.load", "numpy.memmap", "torch.tensor", "torch.from_numpy" ]
[((9024, 9046), 'torch.stack', 'torch.stack', (['images', '(0)'], {}), '(images, 0)\n', (9035, 9046), False, 'import torch\n'), ((370, 384), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (382, 384), False, 'from sklearn.preprocessing import LabelEncoder\n'), ((1977, 1995), 'pathlib.Path', 'pat...
import os import csv import six import pandas as pd import numpy as np from ..core import STReader, SortOrder, find_conversion from ..core import csv_headers, col_population, pop_na, col_timestamps, col_node_ids # TODO: Won't work with a non-population column csv file. Update so that if there is no populations then i...
[ "os.makedirs", "csv.writer", "pandas.read_csv", "numpy.isscalar", "os.path.dirname", "os.path.exists", "csv.Sniffer", "numpy.array" ]
[((536, 557), 'os.path.dirname', 'os.path.dirname', (['path'], {}), '(path)\n', (551, 557), False, 'import os\n'), ((616, 637), 'os.makedirs', 'os.makedirs', (['path_dir'], {}), '(path_dir)\n', (627, 637), False, 'import os\n'), ((1913, 1974), 'pandas.read_csv', 'pd.read_csv', (['path'], {'sep': 'sep', 'header': '(0 if...
"""MIT License Copyright (c) 2022 <NAME> 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, publish, distrib...
[ "cv2.GaussianBlur", "cv2.cvtColor", "numpy.empty", "numpy.ones", "cv2.LUT", "cv2.createCLAHE", "cv2.decomposeProjectionMatrix", "cv2.StereoSGBM_create" ]
[((1590, 1632), 'cv2.decomposeProjectionMatrix', 'cv2.decomposeProjectionMatrix', (['leftProjMat'], {}), '(leftProjMat)\n', (1619, 1632), False, 'import cv2\n'), ((1677, 1720), 'cv2.decomposeProjectionMatrix', 'cv2.decomposeProjectionMatrix', (['rightProjMat'], {}), '(rightProjMat)\n', (1706, 1720), False, 'import cv2\...
# coding: utf-8 import os import shutil import pickle import librosa import argparse import pandas as pd import numpy as np from glob import glob from tqdm import tqdm from PIL import Image from facenet_pytorch import MTCNN, InceptionResnetV1 import torch from transformers import BertTokenizer, BertModel from torch.ut...
[ "os.mkdir", "pickle.dump", "argparse.ArgumentParser", "pandas.read_csv", "numpy.mean", "pickle.load", "numpy.random.normal", "shutil.rmtree", "torch.no_grad", "librosa.feature.mfcc", "os.path.join", "numpy.std", "os.path.exists", "transformers.BertModel.from_pretrained", "librosa.feature...
[((10167, 10192), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (10190, 10192), False, 'import argparse\n'), ((1269, 1299), 'os.path.join', 'os.path.join', (['tmp_dir', '"""Faces"""'], {}), "(tmp_dir, 'Faces')\n", (1281, 1299), False, 'import os\n'), ((1308, 1335), 'os.mkdir', 'os.mkdir', (['f...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jun 18 18:05:40 2018 Dataset Object CHECK MAX DISBALANCE OPN REPLICATION FOR MULTICLASS @author: ereyes """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np class Datase...
[ "numpy.random.shuffle", "numpy.concatenate", "numpy.max", "numpy.where", "numpy.array", "numpy.arange", "numpy.min", "numpy.unique" ]
[((2965, 3000), 'numpy.arange', 'np.arange', (['self.data_array.shape[0]'], {}), '(self.data_array.shape[0])\n', (2974, 3000), True, 'import numpy as np\n'), ((3003, 3025), 'numpy.random.shuffle', 'np.random.shuffle', (['idx'], {}), '(idx)\n', (3020, 3025), True, 'import numpy as np\n'), ((4385, 4411), 'numpy.unique', ...
import networkx as nx import matplotlib.pyplot as plt import pylab import pickle import numpy as np import common def draw_transition_table(transition_table, cluster_centers, meanscreen, tsne ,color, black_edges=None, red_edges=None, title=None): G = nx.DiGraph() edge_colors = [] if red_edges is not None...
[ "numpy.argmax", "matplotlib.pyplot.axes", "numpy.ones", "numpy.isnan", "matplotlib.pyplot.figure", "networkx.draw_networkx_labels", "networkx.draw_networkx_edge_labels", "numpy.round", "matplotlib.pyplot.draw", "common.load_hdf5", "matplotlib.pyplot.show", "numpy.ones_like", "matplotlib.pypl...
[((257, 269), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (267, 269), True, 'import networkx as nx\n'), ((1258, 1353), 'networkx.draw_networkx_edge_labels', 'nx.draw_networkx_edge_labels', (['G', 'pos'], {'edge_labels': 'edge_labels', 'label_pos': '(0.65)', 'font_size': '(9)'}), '(G, pos, edge_labels=edge_label...
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY ...
[ "megengine.core.tensor.dtype.get_scale", "megengine.quantization.quantize.quantize_qat", "megengine.tensor", "numpy.float32", "numpy.ones", "megengine.core.tensor.dtype.get_zero_point", "megengine.core.tensor.dtype.qint8", "test.utils.LinearOpr", "megengine.core.tensor.dtype.quint8", "megengine.mo...
[((1033, 1050), 'megengine.quantization.quantize.quantize_qat', 'quantize_qat', (['net'], {}), '(net)\n', (1045, 1050), False, 'from megengine.quantization.quantize import quantize_qat\n'), ((2023, 2034), 'test.utils.LinearOpr', 'LinearOpr', ([], {}), '()\n', (2032, 2034), False, 'from test.utils import LinearOpr\n'), ...
# System import os import sys from pprint import pprint as pp import argparse import logging import multiprocessing as mp from functools import partial from time import time import shutil # Externals import yaml import numpy as np import pandas as pd import torch import torch.nn as nn from torch_scatter import scatter...
[ "numpy.load", "numpy.empty", "GraphLearning.src.trainers.get_trainer", "shutil.rmtree", "os.path.join", "numpy.unique", "sklearn.cluster.DBSCAN", "pandas.DataFrame", "os.path.exists", "numpy.append", "scipy.sparse.dok_matrix", "Seeding.src.utils.data_utils.load_summaries", "functools.partial...
[((579, 604), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (602, 604), False, 'import torch\n'), ((755, 793), 'numpy.array', 'np.array', (['[g.i for g in graph_dataset]'], {}), '([g.i for g in graph_dataset])\n', (763, 793), True, 'import numpy as np\n'), ((809, 827), 'numpy.array', 'np.array...
# Import required stuff from cvxpy import * import numpy as np import matplotlib.pyplot as plt # In this problem, we need both y.txt and beta.txt, so read them from input files. # Please note that the path has to be changed accordingly before running. with open('/home/akilesh/Desktop/Akilesh_opt/y.txt') as f: y =...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.logspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.tight_layout" ]
[((865, 888), 'numpy.logspace', 'np.logspace', (['(-2)', '(1)', '(100)'], {}), '(-2, 1, 100)\n', (876, 888), True, 'import numpy as np\n'), ((1869, 1885), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(211)'], {}), '(211)\n', (1880, 1885), True, 'import matplotlib.pyplot as plt\n'), ((1886, 1914), 'matplotlib.pyplot.p...
# 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...
[ "pandas.DataFrame", "functools.partial", "numpy.nanpercentile", "pandas.NamedAgg", "flask_babel.gettext", "geopy.point.Point", "geohash.encode", "prophet.Prophet", "superset.utils.core.TIME_COMPARISION.join", "pandas.concat", "logging.getLogger" ]
[((28618, 28785), 'prophet.Prophet', 'Prophet', ([], {'interval_width': 'confidence_interval', 'yearly_seasonality': 'yearly_seasonality', 'weekly_seasonality': 'weekly_seasonality', 'daily_seasonality': 'daily_seasonality'}), '(interval_width=confidence_interval, yearly_seasonality=\n yearly_seasonality, weekly_sea...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Trains a neural network for bird classification. For usage information, call with --help. Author: <NAME> """ from __future__ import print_function import sys import os import io from argparse import ArgumentParser try: import cPickle as pickle except ImportErro...
[ "numpy.load", "config.parse_config_file", "numpy.sum", "argparse.ArgumentParser", "model.cost", "pickle.dump", "lasagne.regularization.regularize_network_params", "lasagne.layers.get_output", "os.path.join", "data.run_datafeed", "model.architecture", "os.path.dirname", "os.path.exists", "n...
[((628, 661), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': 'descr'}), '(description=descr)\n', (642, 661), False, 'from argparse import ArgumentParser\n'), ((3855, 3909), 'data.prepare_datafeed', 'data.prepare_datafeed', (['filelist', 'datadir', '"""train"""', 'cfg'], {}), "(filelist, datadir, 'tra...
import unittest import numpy as np from neurolib.utils.parameterSpace import ParameterSpace class TestParameterSpace(unittest.TestCase): def test_parameterspace_init(self): # init from list par = ParameterSpace(["a", "b"], [[3], [3]]) # init from dict par = ParameterSpace({"a": [1...
[ "numpy.zeros", "neurolib.utils.parameterSpace.ParameterSpace", "numpy.ones" ]
[((218, 256), 'neurolib.utils.parameterSpace.ParameterSpace', 'ParameterSpace', (["['a', 'b']", '[[3], [3]]'], {}), "(['a', 'b'], [[3], [3]])\n", (232, 256), False, 'from neurolib.utils.parameterSpace import ParameterSpace\n'), ((297, 339), 'neurolib.utils.parameterSpace.ParameterSpace', 'ParameterSpace', (["{'a': [1, ...
import json import os import random from unittest.mock import patch import cv2 import numpy as np import pytest import albumentations as A import albumentations.augmentations.functional as F from albumentations.core.serialization import SERIALIZABLE_REGISTRY, shorten_class_name from albumentations.core.transforms_int...
[ "albumentations.Lambda", "numpy.random.seed", "albumentations.Resize", "albumentations.Flip", "albumentations.Rotate", "numpy.random.randint", "albumentations.TemplateTransform", "albumentations.load", "pytest.mark.parametrize", "albumentations.HorizontalFlip", "os.path.join", "albumentations....
[((1467, 1505), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""p"""', '[0.5, 1]'], {}), "('p', [0.5, 1])\n", (1490, 1505), False, 'import pytest\n'), ((1507, 1550), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""seed"""', 'TEST_SEEDS'], {}), "('seed', TEST_SEEDS)\n", (1530, 1550), False, 'impo...
from time import perf_counter as clock import subprocess import random import numpy # Constants STEP = 1000 * 100 # the size of the buffer to fill the table, in rows SCALE = 0.1 # standard deviation of the noise compared with actual # values NI_NTIMES = 1 # The number of queries fo...
[ "numpy.random.seed", "getopt.getopt", "cProfile.Profile", "numpy.histogram", "numpy.random.randint", "numpy.arange", "hotshot.stats.load", "numpy.random.normal", "cProfile.close", "pytables_backend.PyTables_DB", "pstats.Stats", "psyco.bind", "random.seed", "hotshot.Profile", "subprocess....
[((3019, 3038), 'numpy.array', 'numpy.array', (['ltimes'], {}), '(ltimes)\n', (3030, 3038), False, 'import numpy\n'), ((4202, 4244), 'numpy.arange', 'numpy.arange', (['start', 'stop'], {'dtype': '"""float64"""'}), "(start, stop, dtype='float64')\n", (4214, 4244), False, 'import numpy\n'), ((4262, 4302), 'numpy.arange',...
import numpy as np import pandas as pd from tqdm import tqdm def bootstrap(x, iter=int(1E6), return_samples=False): """ Performs a simple bootstrap resampling method on an array of data. Parameters ---------- x : numpy array A one-dimensional numpy array containing values you wish to boo...
[ "numpy.percentile", "numpy.empty", "pandas.concat", "pandas.DataFrame" ]
[((1029, 1043), 'numpy.empty', 'np.empty', (['iter'], {}), '(iter)\n', (1037, 1043), True, 'import numpy as np\n'), ((1739, 1762), 'numpy.percentile', 'np.percentile', (['means', 'v'], {}), '(means, v)\n', (1752, 1762), True, 'import numpy as np\n'), ((1989, 2015), 'pandas.concat', 'pd.concat', (['dfs'], {'sort': '(Fal...
# -*- coding: utf-8 -*- """@package Methods.Machine.LamSlotWind.plot_winding Plot the Lamination's Winding Methods @date Created on Tue Dec 16 16:39:48 2014 @copyright (C) 2014-2015 EOMYS ENGINEERING. @author pierre_b @todo Matrix Zs*Qs for display (cf doc database/articles/electrical machines/ analytical modelling of ...
[ "matplotlib.pyplot.title", "numpy.meshgrid", "matplotlib.pyplot.plot", "pyleecan.Functions.Winding.gen_phase_list.gen_name", "pyleecan.Functions.Winding.comp_wind_sym.comp_wind_sym", "matplotlib.lines.Line2D", "matplotlib.pyplot.legend", "matplotlib.pyplot.axis", "pyleecan.Functions.Winding.gen_phas...
[((1670, 1696), 'pyleecan.Functions.Winding.gen_phase_list.gen_color', 'gen_color', (['self.winding.qs'], {}), '(self.winding.qs)\n', (1679, 1696), False, 'from pyleecan.Functions.Winding.gen_phase_list import gen_color, gen_name\n'), ((1711, 1736), 'pyleecan.Functions.Winding.gen_phase_list.gen_name', 'gen_name', (['s...
#!/usr/bin/env python3 import sys sys.path.append('./lib') import argparse import os import datetime import numpy as np import time import pickle import torch from torch import optim from param_stamp import get_param_stamp, get_param_stamp_from_args import evaluate from lib.encoder import Classifier from lib.vae_mod...
[ "os.mkdir", "numpy.random.seed", "argparse.ArgumentParser", "torch.cuda.device_count", "pickle.load", "lib.train.train_cl", "param_stamp.get_param_stamp_from_args", "os.path.join", "lib.encoder.Classifier", "sys.path.append", "lib.callbacks._VAE_loss_cb", "os.path.exists", "datetime.datetime...
[((35, 59), 'sys.path.append', 'sys.path.append', (['"""./lib"""'], {}), "('./lib')\n", (50, 59), False, 'import sys\n'), ((564, 666), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""./main.py"""'], {'description': '"""Run individual continual learning experiment."""'}), "('./main.py', description=\n 'Ru...
# pylint: disable-msg=W0401,W0511,W0611,W0612,W0614,R0201,E1102 """Tests suite for MaskedArray & subclassing. :author: <NAME> :contact: pierregm_at_uga_dot_edu """ from __future__ import division, absolute_import, print_function __author__ = "<NAME>" import warnings import pickle import operator import itertools fro...
[ "numpy.ma.core.make_mask", "numpy.ma.core.fix_invalid", "numpy.arctan2", "numpy.sum", "numpy.ravel", "numpy.ma.core.make_mask_descr", "numpy.ma.core.empty_like", "numpy.ma.core.greater_equal", "numpy.ma.testutils.assert_equal_records", "numpy.ones", "numpy.argsort", "numpy.arange", "numpy.ex...
[((166569, 166613), 'numpy.ma.array', 'np.ma.array', (['[0, 1, 2, 3]'], {'mask': '[0, 0, 1, 0]'}), '([0, 1, 2, 3], mask=[0, 0, 1, 0])\n', (166580, 166613), True, 'import numpy as np\n'), ((166700, 166738), 'numpy.ma.masked_equal', 'np.ma.masked_equal', (['[1, 2, 3]'], {'value': '(2)'}), '([1, 2, 3], value=2)\n', (16671...
import unittest from align.jaccard import * from align.roc import * import numpy as np from PIL import Image class JaccardIndexTest(unittest.TestCase): def setUp(self): self.y_true = np.ones((10, 3, 100, 100)) self.y_pred = np.zeros((10, 3, 100, 100)) self.y_pred[1] = np.ones((3,100,100)) ...
[ "unittest.main", "numpy.zeros", "numpy.ones", "PIL.Image.open" ]
[((1114, 1129), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1127, 1129), False, 'import unittest\n'), ((197, 223), 'numpy.ones', 'np.ones', (['(10, 3, 100, 100)'], {}), '((10, 3, 100, 100))\n', (204, 223), True, 'import numpy as np\n'), ((246, 273), 'numpy.zeros', 'np.zeros', (['(10, 3, 100, 100)'], {}), '((10...
import theano import theano.tensor as T import numpy as np from itertools import chain, izip from learntools.libs.logger import log_me from learntools.libs.auc import auc from learntools.model.mlp import ConvolutionalMLP from learntools.model.theano_utils import make_shared from learntools.model import Model, gen_bat...
[ "itertools.chain.from_iterable", "theano.tensor.log", "learntools.model.mlp.ConvolutionalMLP", "learntools.libs.logger.log_me", "theano.function", "learntools.model.gen_batches_by_size", "theano.tensor.ivector", "numpy.random.RandomState", "theano.tensor.grad", "itertools.izip", "theano.tensor.a...
[((407, 439), 'learntools.libs.logger.log_me', 'log_me', (['"""...building ConvEmotiv"""'], {}), "('...building ConvEmotiv')\n", (413, 439), False, 'from learntools.libs.logger import log_me\n'), ((1281, 1323), 'learntools.model.gen_batches_by_size', 'gen_batches_by_size', (['train_idx', 'batch_size'], {}), '(train_idx...
from __future__ import print_function, division """ @ About : @ Author : <NAME> @ ref. : https://labrosa.ee.columbia.edu/matlab/rastamat/ """ import warnings import librosa import scipy.fftpack as fft import numpy as np import spectrum from scipy import signal def specgram(x, nfft=256, fs=8000, window=np.array([]), o...
[ "numpy.roots", "numpy.abs", "numpy.sum", "numpy.angle", "numpy.floor", "numpy.ones", "numpy.argsort", "librosa.istft", "numpy.arange", "numpy.tile", "numpy.diag", "numpy.round", "spectrum.LEVINSON", "numpy.multiply", "numpy.random.randn", "scipy.signal.lfilter", "numpy.fft.fft", "n...
[((305, 317), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (313, 317), True, 'import numpy as np\n'), ((1490, 1507), 'numpy.concatenate', 'np.concatenate', (['S'], {}), '(S)\n', (1504, 1507), True, 'import numpy as np\n'), ((1516, 1535), 'numpy.fft.fft', 'np.fft.fft', (['S', 'nfft'], {}), '(S, nfft)\n', (1526, 15...
import numpy as np initial_state = globals().copy() non_element_functions = ['element_metadata', 'initial_state', 'non_element_functions', 'typeChecker', 'circuit_elements'] # populated at the end of the file - # this m...
[ "numpy.sinh", "numpy.array", "numpy.tanh", "numpy.sqrt" ]
[((1933, 1944), 'numpy.array', 'np.array', (['f'], {}), '(f)\n', (1941, 1944), True, 'import numpy as np\n'), ((2143, 2154), 'numpy.array', 'np.array', (['f'], {}), '(f)\n', (2151, 2154), True, 'import numpy as np\n'), ((2412, 2423), 'numpy.array', 'np.array', (['f'], {}), '(f)\n', (2420, 2423), True, 'import numpy as ...
import random import time from copy import deepcopy import gym import networkx as nx import numpy as np from gym.spaces import Box, Dict, Discrete, MultiDiscrete, Tuple class MyTestEnv(gym.Env): """This is a "going right" task. The task is to go right ``size`` steps. """ def __init__( self, ...
[ "copy.deepcopy", "gym.spaces.Discrete", "numpy.zeros", "numpy.random.RandomState", "gym.spaces.MultiDiscrete", "time.sleep", "random.random", "networkx.Graph", "numpy.array", "gym.spaces.Box", "numpy.arange", "numpy.random.rand" ]
[((2491, 2518), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (2512, 2518), True, 'import numpy as np\n'), ((4941, 4951), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (4949, 4951), True, 'import networkx as nx\n'), ((5241, 5261), 'copy.deepcopy', 'deepcopy', (['self.graph'], {}), '...
# Based on https://colab.research.google.com/github/reiinakano/neural-painters/blob/master/notebooks/generate_stroke_examples.ipynb from lib import surface, tiledsurface, brush import torch import numpy as np from PIL import Image def point_on_curve_1(t, cx, cy, sx, sy, x1, y1, x2, y2): ratio = t / 100.0 x3...
[ "torch.from_numpy", "lib.tiledsurface.Surface", "lib.brush.Brush", "lib.surface.scanline_strips_iter", "numpy.expand_dims", "numpy.random.default_rng", "PIL.Image.fromarray", "numpy.sqrt" ]
[((607, 629), 'numpy.sqrt', 'np.sqrt', (['(x * x + y * y)'], {}), '(x * x + y * y)\n', (614, 629), True, 'import numpy as np\n'), ((1396, 1421), 'numpy.random.default_rng', 'np.random.default_rng', (['(42)'], {}), '(42)\n', (1417, 1421), True, 'import numpy as np\n'), ((1495, 1517), 'lib.tiledsurface.Surface', 'tiledsu...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from numba import f8 from numba import i8 from numba import jit from numba import prange from numpy import argmin from numpy import array from numpy import empty from numpy import min from numpy.random import ...
[ "numpy.random.choice", "numpy.empty", "numpy.argmin", "time.time", "numpy.min", "numba.jit", "numpy.array", "numba.prange", "numpy.random.rand" ]
[((568, 613), 'numba.jit', 'jit', ([], {'nogil': '(True)', 'nopython': '(True)', 'parallel': '(True)'}), '(nogil=True, nopython=True, parallel=True)\n', (571, 613), False, 'from numba import jit\n'), ((766, 832), 'numba.jit', 'jit', (['(f8[:, :], i8, i8)'], {'nogil': '(True)', 'nopython': '(True)', 'parallel': '(False)...
import pandas as pd import matplotlib.pyplot as plt import numpy as np import re import spacy import pickle import time from collections import defaultdict import pmi_tfidf_classifier as ptic path = "../data/" np.random.seed(250) #spacy.prefer_gpu() #nlp = spacy.load("en_core_sci_sm", disable=['ner', 'parser']) data_...
[ "pmi_tfidf_classifier.get_word_stat", "numpy.random.seed", "numpy.sum", "numpy.logical_and", "pandas.read_csv", "pmi_tfidf_classifier.create_pmi_dict", "pmi_tfidf_classifier.classify_pmi_based", "numpy.random.permutation", "pmi_tfidf_classifier.tokenization" ]
[((211, 230), 'numpy.random.seed', 'np.random.seed', (['(250)'], {}), '(250)\n', (225, 230), True, 'import numpy as np\n'), ((326, 361), 'pandas.read_csv', 'pd.read_csv', (["(path + 'DILI_data.csv')"], {}), "(path + 'DILI_data.csv')\n", (337, 361), True, 'import pandas as pd\n'), ((372, 409), 'numpy.random.permutation'...
import numpy as np def msaeye(msa, unique, turbo): tic1 = timeit.default_timer() length = msa.shape[1] number = msa.shape[0] # number = 5 array = np.eye(int(number)) seqs = [] for i in range(number): seqs.append(msa[i,:]) iseq = np.zeros((number, length), dtype=int) for i ...
[ "scipy.cluster.hierarchy.fcluster", "numpy.sum", "numpy.empty", "scipy.cluster.hierarchy.linkage", "numpy.argmin", "matplotlib.pyplot.figure", "matplotlib.pyplot.gca", "numpy.unique", "matplotlib.colors.Normalize", "numpy.max", "collections.Counter", "numpy.intersect1d", "numpy.repeat", "s...
[((271, 308), 'numpy.zeros', 'np.zeros', (['(number, length)'], {'dtype': 'int'}), '((number, length), dtype=int)\n', (279, 308), True, 'import numpy as np\n'), ((10729, 10757), 'numpy.concatenate', 'np.concatenate', (['atom_indices'], {}), '(atom_indices)\n', (10743, 10757), True, 'import numpy as np\n'), ((10772, 107...
import numpy as np import cv2 as cv from split import SliceImage import utils class DocumentScanner: def __init__(self, path): self.path = path self.contrast = 0 self.row = 4 self.column = 4 def setImage(self): self.image = cv.imread(self.path, 1) def copy...
[ "cv2.GaussianBlur", "cv2.medianBlur", "cv2.getPerspectiveTransform", "cv2.arcLength", "cv2.approxPolyDP", "numpy.argmax", "cv2.adaptiveThreshold", "numpy.argmin", "numpy.linalg.norm", "cv2.warpPerspective", "cv2.dilate", "cv2.cvtColor", "cv2.imwrite", "split.SliceImage", "cv2.drawContour...
[((278, 301), 'cv2.imread', 'cv.imread', (['self.path', '(1)'], {}), '(self.path, 1)\n', (287, 301), True, 'import cv2 as cv\n'), ((749, 791), 'cv2.cvtColor', 'cv.cvtColor', (['self.clone', 'cv.COLOR_BGR2GRAY'], {}), '(self.clone, cv.COLOR_BGR2GRAY)\n', (760, 791), True, 'import cv2 as cv\n'), ((881, 930), 'split.Slice...
import tensorflow as tf import numpy as np (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data() x_train, x_test = np.array(x_train/255.0,dtype="<f4"), np.array(x_test/255.0,dtype="<f4") idx=np.argsort(y_train.flatten()) vdx=np.array([6000*i+j for i in range(10) for j in range(5400,6000)])...
[ "numpy.random.permutation", "tensorflow.convert_to_tensor", "numpy.array", "tensorflow.keras.datasets.mnist.load_data" ]
[((86, 121), 'tensorflow.keras.datasets.mnist.load_data', 'tf.keras.datasets.mnist.load_data', ([], {}), '()\n', (119, 121), True, 'import tensorflow as tf\n'), ((508, 536), 'numpy.random.permutation', 'np.random.permutation', (['(54000)'], {}), '(54000)\n', (529, 536), True, 'import numpy as np\n'), ((636, 663), 'nump...
import numpy as np import mido from mido import Message, MidiFile, MidiTrack import argparse from functools import partial def main(): #Get options from input parser = argparse.ArgumentParser(description='Superpermutation to midi converter') parser.add_argument('inputfile', help='The f...
[ "functools.partial", "numpy.zeros_like", "argparse.ArgumentParser", "mido.MidiFile", "mido.Message", "mido.MidiTrack", "mido.open_output", "numpy.unique" ]
[((178, 251), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Superpermutation to midi converter"""'}), "(description='Superpermutation to midi converter')\n", (201, 251), False, 'import argparse\n'), ((1550, 1581), 'numpy.zeros_like', 'np.zeros_like', (['superpermutation'], {}), '(superp...
""" This module implements the intermediates computation for plot(df) function. """ # pylint: disable=too-many-lines from collections import defaultdict from typing import Any, DefaultDict, Dict, List, Optional, Tuple, Union, cast import dask import dask.array as da import dask.dataframe as dd import numpy as np impo...
[ "pandas.DataFrame", "dask.array.stats.skew", "dask.delayed", "nltk.stem.PorterStemmer", "nltk.stem.WordNetLemmatizer", "dask.array.histogram", "typing.cast", "dask.array.stats.kurtosis", "pandas.pivot_table", "collections.defaultdict", "pandas.to_timedelta", "pandas.Grouper", "numpy.linspace...
[((7664, 7680), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (7675, 7680), False, 'from collections import defaultdict\n'), ((8921, 8947), 'dask.compute', 'dask.compute', (['datas', 'stats'], {}), '(datas, stats)\n', (8933, 8947), False, 'import dask\n'), ((25009, 25047), 'pandas.Grouper', 'pd.Gr...
################################################################################ # Numba-DPPY # # Copyright 2020-2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain ...
[ "dpctl.SyclDevice", "numba_dppy.tests._helper.assert_auto_offloading", "numpy.empty", "dpctl.device_context", "numpy.testing.assert_allclose", "pytest.fixture", "pytest.skip", "numpy.random.random", "numba_dppy.tests._helper.is_gen12", "pytest.mark.parametrize" ]
[((1088, 1130), 'pytest.fixture', 'pytest.fixture', ([], {'params': 'list_of_filter_strs'}), '(params=list_of_filter_strs)\n', (1102, 1130), False, 'import pytest\n'), ((1440, 1479), 'pytest.fixture', 'pytest.fixture', ([], {'params': 'list_of_trig_ops'}), '(params=list_of_trig_ops)\n', (1454, 1479), False, 'import pyt...
import tkinter from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk from matplotlib.figure import Figure import requests from scipy.signal import medfilt from copy import deepcopy from json import loads import numpy as np with open('endomondo.config', 'r') as conf: username = conf...
[ "matplotlib.backends.backend_tkagg.NavigationToolbar2Tk", "tkinter.Checkbutton", "tkinter.StringVar", "copy.deepcopy", "requests.session", "json.loads", "numpy.average", "tkinter.mainloop", "tkinter.Button", "tkinter.Entry", "scipy.signal.medfilt", "matplotlib.figure.Figure", "tkinter.Scale"...
[((7376, 7388), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (7386, 7388), False, 'import tkinter\n'), ((7432, 7463), 'matplotlib.figure.Figure', 'Figure', ([], {'figsize': '(5, 4)', 'dpi': '(100)'}), '(figsize=(5, 4), dpi=100)\n', (7438, 7463), False, 'from matplotlib.figure import Figure\n'), ((7534, 7569), 'matplot...
#!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic integration with Numeric Python. # Author: <NAME>, <EMAIL> # ############################################################################### # Copyrigh...
[ "sys.path.append", "numpy.zeros_like", "osgeo.gdal_array.OpenArray", "_gdal.GDALRegister_NUMPY", "gdaltest.post_reason", "osgeo.gdal.Unlink", "numpy.empty", "numpy.zeros", "numpy.empty_like", "osgeo.gdalnumeric.OpenArray", "gdaltest.run_tests", "gdaltest.setup_run", "gdaltest.summarize", "...
[((1577, 1604), 'sys.path.append', 'sys.path.append', (['"""../pymod"""'], {}), "('../pymod')\n", (1592, 1604), False, 'import sys\n'), ((2138, 2167), 'osgeo.gdal.GetDriverByName', 'gdal.GetDriverByName', (['"""NUMPY"""'], {}), "('NUMPY')\n", (2158, 2167), False, 'from osgeo import gdal\n'), ((2588, 2629), 'osgeo.gdaln...
from sklearn.model_selection import KFold from sklearn.metrics import classification_report, accuracy_score, matthews_corrcoef from sklearn import svm from feature import Feature from sklearn.linear_model import LogisticRegression from sklearn.ensemble import ExtraTreesClassifier import numpy as np ...
[ "sklearn.metrics.accuracy_score", "sklearn.model_selection.KFold", "sklearn.metrics.classification_report", "sklearn.ensemble.ExtraTreesClassifier", "sklearn.linear_model.LogisticRegression", "sklearn.metrics.matthews_corrcoef", "numpy.array", "sklearn.svm.SVC", "feature.Feature", "numpy.concatena...
[((6598, 6634), 'sklearn.ensemble.ExtraTreesClassifier', 'ExtraTreesClassifier', ([], {'random_state': '(0)'}), '(random_state=0)\n', (6618, 6634), False, 'from sklearn.ensemble import ExtraTreesClassifier\n'), ((6649, 6685), 'sklearn.ensemble.ExtraTreesClassifier', 'ExtraTreesClassifier', ([], {'random_state': '(0)'})...
""" Tensorflow implementation of DeepFM [1] Reference: [1] DeepFM: A Factorization-Machine based Neural Network for CTR Prediction, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. """ import numpy as np import tensorflow as tf import os import example.config as config from sklearn.base import BaseEstimator, TransformerM...
[ "tensorflow.cond", "tensorflow.reduce_sum", "tensorflow.contrib.layers.l2_regularizer", "tensorflow.reshape", "numpy.random.set_state", "tensorflow.train.AdamOptimizer", "tensorflow.ConfigProto", "tensorflow.multiply", "tensorflow.matmul", "tensorflow.losses.log_loss", "numpy.random.normal", "...
[((2513, 2523), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (2521, 2523), True, 'import tensorflow as tf\n'), ((8938, 8977), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'device_count': "{'gpu': 0}"}), "(device_count={'gpu': 0})\n", (8952, 8977), True, 'import tensorflow as tf\n'), ((9040, 9065), 'tensorflow...
''' DIO using a serial port + microcontroller instead of the NIDAQ card ''' import serial from collections import defaultdict import struct from numpy import binary_repr from .dio.parse import MSG_TYPE_ROWBYTE, MSG_TYPE_REGISTER import time import threading import pyfirmata def construct_word(aux, msg_type, data, n_bi...
[ "serial.Serial", "collections.defaultdict", "numpy.binary_repr", "struct.pack" ]
[((1347, 1405), 'serial.Serial', 'serial.Serial', (['"""/dev/arduino_neurosync"""'], {'baudrate': 'baudrate'}), "('/dev/arduino_neurosync', baudrate=baudrate)\n", (1360, 1405), False, 'import serial\n'), ((1457, 1473), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (1468, 1473), False, 'from collec...
import copy import os import pickle import numpy as np from numpy.linalg import inv from numpy.matlib import repmat import pylot.utils class DepthFrame(object): """Class that stores depth frames. Args: frame: A numpy array storing the depth frame. camera_setup (:py:class:`~pylot.drivers.sen...
[ "copy.deepcopy", "numpy.ones_like", "numpy.dtype", "numpy.transpose", "pygame.display.flip", "pygame.surfarray.blit_array", "numpy.linalg.inv", "numpy.reshape", "numpy.dot", "numpy.matlib.repmat", "cv2.resize" ]
[((2098, 2148), 'numpy.reshape', 'np.reshape', (['_frame', '(frame.height, frame.width, 4)'], {}), '(_frame, (frame.height, frame.width, 4))\n', (2108, 2148), True, 'import numpy as np\n'), ((2370, 2416), 'numpy.dot', 'np.dot', (['frame[:, :, :3]', '[65536.0, 256.0, 1.0]'], {}), '(frame[:, :, :3], [65536.0, 256.0, 1.0]...
""" Coordinate Transformation Functions This module contains the functions for converting one `sunpy.coordinates.frames` object to another. .. warning:: The functions in this submodule should never be called directly, transforming between coordinate frames should be done using the ``.transform_to`` methods on ...
[ "astropy.coordinates.ConvertError", "astropy.coordinates.matrix_utilities.matrix_product", "sunpy.sun.constants.get", "astropy.coordinates.HeliocentricMeanEcliptic", "astropy.units.allclose", "astropy.coordinates.representation.CartesianRepresentation", "astropy.coordinates.HCRS", "astropy.coordinates...
[((15927, 16049), 'astropy.coordinates.baseframe.frame_transform_graph.transform', 'frame_transform_graph.transform', (['FunctionTransformWithFiniteDifference', 'HeliographicStonyhurst', 'HeliographicCarrington'], {}), '(FunctionTransformWithFiniteDifference,\n HeliographicStonyhurst, HeliographicCarrington)\n', (15...
from keras.callbacks import Callback import keras.backend as K import numpy as np class SGDRScheduler(Callback): '''Cosine annealing learning rate scheduler with periodic restarts. # Usage ```python schedule = SGDRScheduler(min_lr=1e-5, max_lr=1e-2, ...
[ "keras.backend.set_value", "keras.backend.get_value", "numpy.ceil", "numpy.cos" ]
[((2345, 2394), 'keras.backend.set_value', 'K.set_value', (['self.model.optimizer.lr', 'self.max_lr'], {}), '(self.model.optimizer.lr, self.max_lr)\n', (2356, 2394), True, 'import keras.backend as K\n'), ((2592, 2628), 'keras.backend.get_value', 'K.get_value', (['self.model.optimizer.lr'], {}), '(self.model.optimizer.l...
import cv2 import numpy as np from PIL import Image import os path = "./photo/myobject" filelist = os.listdir(path) total_num = len(filelist) n = 6 for i in range(1,total_num): n = 6 - len(str(i)) filepath = "./photo/myobject/"+str(0)*n + str(i)+".jpg" imgsize = Image.open(filepath)#開啟圖片 print('開啟檔案:...
[ "cv2.grabCut", "numpy.zeros", "PIL.Image.open", "cv2.imread", "numpy.where", "os.listdir" ]
[((101, 117), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (111, 117), False, 'import os\n'), ((278, 298), 'PIL.Image.open', 'Image.open', (['filepath'], {}), '(filepath)\n', (288, 298), False, 'from PIL import Image\n'), ((471, 491), 'cv2.imread', 'cv2.imread', (['filepath'], {}), '(filepath)\n', (481, 491)...
""" Math Utilities """ import collections import numpy as np from nnlib.utils.functional import not_none __all__ = ['FNVHash', 'ceil_div', 'normalize', 'pow', 'prod', 'sum', 'random_subset', 'softmax'] class FNVHash: hval = 0x811c9dc5 fnv_32_prime = 0x01000193 uint32_max = 2 ** 32 @staticmethod ...
[ "numpy.arange", "numpy.asarray", "numpy.sum", "numpy.log" ]
[((657, 687), 'numpy.asarray', 'np.asarray', (['xs'], {'dtype': 'np.float'}), '(xs, dtype=np.float)\n', (667, 687), True, 'import numpy as np\n'), ((705, 716), 'numpy.sum', 'np.sum', (['arr'], {}), '(arr)\n', (711, 716), True, 'import numpy as np\n'), ((4282, 4293), 'numpy.sum', 'np.sum', (['arr'], {}), '(arr)\n', (428...
"""Beat-synchronous chroma feature calculation with LabROSA. <NAME> <EMAIL> 2016-04-08 """ from __future__ import print_function import cPickle as pickle import getopt import os import sys import time import numpy as np import scipy import sklearn.mixture import librosa def read_iso_label_file(filename): ""...
[ "numpy.maximum", "getopt.getopt", "numpy.argmax", "time.ctime", "cPickle.load", "librosa.feature.sync", "os.path.join", "os.path.dirname", "os.path.exists", "numpy.maximum.outer", "librosa.feature.chroma_cqt", "numpy.hstack", "librosa.load", "sys.exit", "os.makedirs", "cPickle.dump", ...
[((864, 912), 'numpy.maximum.outer', 'np.maximum.outer', (['ranges_a[:, 0]', 'ranges_b[:, 0]'], {}), '(ranges_a[:, 0], ranges_b[:, 0])\n', (880, 912), True, 'import numpy as np\n'), ((935, 983), 'numpy.minimum.outer', 'np.minimum.outer', (['ranges_a[:, 1]', 'ranges_b[:, 1]'], {}), '(ranges_a[:, 1], ranges_b[:, 1])\n', ...
import logging import numpy as np from amset.constants import defaults from amset.deformation.common import desymmetrize_deformation_potentials from amset.deformation.io import load_deformation_potentials from amset.electronic_structure.kpoints import get_mesh_from_kpoint_numbers from amset.electronic_structure.symme...
[ "amset.deformation.common.desymmetrize_deformation_potentials", "amset.electronic_structure.kpoints.get_mesh_from_kpoint_numbers", "numpy.product", "amset.electronic_structure.symmetry.expand_kpoints", "logging.getLogger", "amset.deformation.io.load_deformation_potentials" ]
[((495, 522), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (512, 522), False, 'import logging\n'), ((703, 740), 'amset.deformation.io.load_deformation_potentials', 'load_deformation_potentials', (['filename'], {}), '(filename)\n', (730, 740), False, 'from amset.deformation.io import loa...
""" Utilities for working with videos, pulling out patches, etc. """ import numpy from pylearn2.compat import OrderedDict from pylearn2.utils.rng import make_np_rng __author__ = "<NAME>" __copyright__ = "Copyright 2011, <NAME> / Universite de Montreal" __license__ = "BSD" __maintainer__ = "<NAME>" __email__ = "<EMAIL...
[ "pylearn2.utils.rng.make_np_rng", "pylearn2.compat.OrderedDict", "pyffmpeg.FFMpegReader", "numpy.cumsum", "numpy.random.random_integers" ]
[((930, 953), 'pyffmpeg.FFMpegReader', 'pyffmpeg.FFMpegReader', ([], {}), '()\n', (951, 953), False, 'import pyffmpeg\n'), ((3701, 3725), 'pylearn2.compat.OrderedDict', 'OrderedDict', (['file_tuples'], {}), '(file_tuples)\n', (3712, 3725), False, 'from pylearn2.compat import OrderedDict\n'), ((3801, 3849), 'pylearn2.ut...
import numpy as np import pickle, os, ntpath, cv2 tot_list = [] img_list = [] label_list = [] pickle_dict = {} load_path = '' def _load_data(path): count = 0 for root, dirs, files in os.walk(path): for file in files: imgpath = os.path.join(root, file) tot_list.append(imgpath) ...
[ "pickle.dump", "numpy.random.shuffle", "ntpath.basename", "cv2.cvtColor", "numpy.asarray", "os.walk", "cv2.imread", "os.path.join", "cv2.resize" ]
[((193, 206), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (200, 206), False, 'import pickle, os, ntpath, cv2\n'), ((324, 351), 'numpy.random.shuffle', 'np.random.shuffle', (['tot_list'], {}), '(tot_list)\n', (341, 351), True, 'import numpy as np\n'), ((747, 767), 'numpy.asarray', 'np.asarray', (['img_list'], {}),...
import numpy as np from . import _colormixer from . import _histograms import threading from ...util import img_as_ubyte # utilities to make life easier for plugin writers. import multiprocessing CPU_COUNT = multiprocessing.cpu_count() class GuiLockError(Exception): def __init__(self, msg): self.msg = m...
[ "numpy.empty", "multiprocessing.cpu_count" ]
[((210, 237), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (235, 237), False, 'import multiprocessing\n'), ((3854, 3898), 'numpy.empty', 'np.empty', (['(height, width, 3)'], {'dtype': 'np.uint8'}), '((height, width, 3), dtype=np.uint8)\n', (3862, 3898), True, 'import numpy as np\n')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ feign blocks module zs. elter, a. cserkaszky 2019 """ import os import math import re import numpy as np import matplotlib.pyplot as plt from feign.geometry import * def isFloat(s): try: float(s) return True except ValueError: return...
[ "numpy.sum", "numpy.ravel", "numpy.empty", "numpy.mean", "numpy.sin", "matplotlib.pyplot.gca", "numpy.interp", "numpy.std", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "matplotlib.pyplot.Circle", "numpy.cos", "matplotlib.pyplot.Polygon", "re.compile"...
[((1225, 1250), 'numpy.interp', 'np.interp', (['energy', 'en', 'mu'], {}), '(energy, en, mu)\n', (1234, 1250), True, 'import numpy as np\n'), ((1853, 1880), 're.compile', 're.compile', (['HEX_COLOR_REGEX'], {}), '(HEX_COLOR_REGEX)\n', (1863, 1880), False, 'import re\n'), ((14130, 14147), 'numpy.array', 'np.array', (['f...
import numpy as np import numpy_financial as npf import numpy.linalg as linalg from datetime import date from workalendar.america import Brazil cal = Brazil() class Titulos: def __init__(self, taxa, start, end, c=0): """ :param fv: Face Value :param c: coupon :param start: settleme...
[ "workalendar.america.Brazil", "numpy.sum", "numpy_financial.irr", "numpy.zeros", "datetime.date", "numpy.transpose", "numpy.insert", "numpy.append", "numpy.max", "numpy.array", "numpy.column_stack", "numpy.linalg.solve", "numpy.vstack" ]
[((150, 158), 'workalendar.america.Brazil', 'Brazil', ([], {}), '()\n', (156, 158), False, 'from workalendar.america import Brazil\n'), ((1621, 1645), 'datetime.date', 'date', (['start.year', '(12)', '(31)'], {}), '(start.year, 12, 31)\n', (1625, 1645), False, 'from datetime import date\n'), ((1672, 1698), 'datetime.da...
# Plot (and write to table?) autocorrelation and ESS for samplers with different # stepsizes on some standard functions (no noise?). See also MCMCVisualizer # plots and pymc3 plots. # Plot the following: # vs NUTS with different initial stepsizes # vs HMC with different initial stepsizes # vs SGHMC with different ini...
[ "pymc3.sample", "pysgmcmc.samplers.energy_functions.Gmm1", "numpy.isnan", "numpy.random.rand", "os.path.dirname", "keras.backend.random_normal_variable", "itertools.product", "pymc3.step_methods.HamiltonianMC", "pymc3.sampling.init_nuts", "pysgmcmc.samplers.energy_functions.MoGL2HMC", "keras.bac...
[((3859, 4112), 'collections.OrderedDict', 'OrderedDict', (["(('SGHMC', SGHMCSampler), ('SGHMCHD', SGHMCHDSampler), ('SGLD', SGLDSampler\n ), ('NUTS', pm.step_methods.NUTS), ('HMC', pm.step_methods.\n HamiltonianMC), ('Metropolis', pm.step_methods.Metropolis), ('Slice',\n pm.step_methods.Slice))"], {}), "((('S...
import mysql.connector mydb = mysql.connector.connect( host="localhost", user="root", password="", database="PUCCR" ) mycursor = mydb.cursor() #mycursor.execute("SELECT * FROM users") #myresult = mycursor.fetchall() #for x in myresult: # print(x) import sys, os, dlib, glob, numpy import cv2 from skimage i...
[ "os.path.basename", "dlib.face_recognition_model_v1", "numpy.array", "dlib.get_frontal_face_detector", "dlib.shape_predictor", "os.path.join", "skimage.io.imread" ]
[((354, 386), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (384, 386), False, 'import sys, os, dlib, glob, numpy\n'), ((602, 638), 'dlib.shape_predictor', 'dlib.shape_predictor', (['predictor_path'], {}), '(predictor_path)\n', (622, 638), False, 'import sys, os, dlib, glob, nump...
# -------------------------------------------------------- # Flow-Guided Feature Aggregation # Copyright (c) 2017 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- """ given a imagenet vid imdb, compute mAP """ import nu...
[ "xml.etree.ElementTree.parse", "numpy.sum", "numpy.maximum", "numpy.zeros", "cPickle.load", "numpy.argsort", "numpy.cumsum", "numpy.min", "numpy.where", "numpy.array", "os.path.isfile", "cPickle.dump", "numpy.max", "numpy.finfo", "numpy.concatenate" ]
[((619, 637), 'xml.etree.ElementTree.parse', 'ET.parse', (['filename'], {}), '(filename)\n', (627, 637), True, 'import xml.etree.ElementTree as ET\n'), ((1799, 1834), 'numpy.concatenate', 'np.concatenate', (['([0.0], rec, [1.0])'], {}), '(([0.0], rec, [1.0]))\n', (1813, 1834), True, 'import numpy as np\n'), ((1844, 188...
# lshash/lshash.py # Copyright 2012 <NAME> (a.k.a <NAME>) and contributors (see CONTRIBUTORS.txt) # # This module is part of lshash and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # wiki:https://yongyuan.name/blog/ann-search.html import os import json import numpy as np fr...
[ "storage.storage", "numpy.load", "json.loads", "numpy.random.randn", "numpy.asarray", "os.path.isfile", "numpy.mean", "numpy.array", "numpy.savez_compressed", "numpy.dot", "bitarray.bitarray" ]
[((4758, 4805), 'numpy.random.randn', 'np.random.randn', (['self.hash_size', 'self.input_dim'], {}), '(self.hash_size, self.input_dim)\n', (4773, 4805), True, 'import numpy as np\n'), ((12575, 12593), 'numpy.dot', 'np.dot', (['diff', 'diff'], {}), '(diff, diff)\n', (12581, 12593), True, 'import numpy as np\n'), ((12780...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import unittest from network import TargetNetwork, Network class TargetNetworkTest(unittest.TestCase): def test_init(self): np.random.seed(seed=0) ...
[ "unittest.main", "network.TargetNetwork", "numpy.random.seed" ]
[((829, 844), 'unittest.main', 'unittest.main', ([], {}), '()\n', (842, 844), False, 'import unittest\n'), ((292, 314), 'numpy.random.seed', 'np.random.seed', ([], {'seed': '(0)'}), '(seed=0)\n', (306, 314), True, 'import numpy as np\n'), ((340, 355), 'network.TargetNetwork', 'TargetNetwork', ([], {}), '()\n', (353, 35...
from mpvr.datamodule.manager import Manager as dm from mpvr.utils.process import * from scipy.signal import savgol_filter import numpy as np import pandas as pd dm = dm.from_config(dm.section_list()[1]) max_val = 0 for scenario in dm.get_scenarios(): dm.set_scenario(scenario) df = dm.get_processed_data('mpe')...
[ "numpy.abs", "mpvr.datamodule.manager.Manager.fig_finalize", "mpvr.datamodule.manager.Manager.get_incidence_data", "numpy.arange", "mpvr.datamodule.manager.Manager.get_scenarios", "mpvr.datamodule.manager.Manager.set_scenario", "mpvr.datamodule.manager.Manager.section_list", "mpvr.datamodule.manager.M...
[((233, 251), 'mpvr.datamodule.manager.Manager.get_scenarios', 'dm.get_scenarios', ([], {}), '()\n', (249, 251), True, 'from mpvr.datamodule.manager import Manager as dm\n'), ((463, 481), 'mpvr.datamodule.manager.Manager.get_scenarios', 'dm.get_scenarios', ([], {}), '()\n', (479, 481), True, 'from mpvr.datamodule.manag...
import paddle import paddle.nn as nn import paddle.nn.functional as F import cv2 import numpy as np from PIL import Image import math class Erosion2d(nn.Layer): """ Erosion2d """ def __init__(self, m=1): super(Erosion2d, self).__init__() self.m = m self.pad = [m, m, m, m] d...
[ "paddle.to_tensor", "paddle.nn.functional.affine_grid", "paddle.nn.functional.grid_sample", "paddle.sin", "paddle.stack", "paddle.nn.functional.unfold", "numpy.expand_dims", "paddle.cos", "PIL.Image.open", "paddle.nn.functional.pad", "paddle.min", "paddle.full", "numpy.array", "paddle.max"...
[((1255, 1285), 'paddle.split', 'paddle.split', (['param', '(8)'], {'axis': '(1)'}), '(param, 8, axis=1)\n', (1267, 1285), False, 'import paddle\n'), ((1374, 1401), 'paddle.sin', 'paddle.sin', (['(math.pi * theta)'], {}), '(math.pi * theta)\n', (1384, 1401), False, 'import paddle\n'), ((1418, 1445), 'paddle.cos', 'padd...
import numpy as np import matplotlib.pyplot as plt from newton_raphson import * from random import uniform import numpy.polynomial.legendre as L ###question 0 def E(X): ##Return the value of E(x1,...,xn) E=0 N=len(X) for i in range(N): E+=np.log(abs(X[i]+1))+np.log(abs(X[i]-1)) for j ...
[ "matplotlib.pyplot.title", "numpy.poly1d", "numpy.matrix", "matplotlib.pyplot.show", "numpy.linalg.lstsq", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.axis", "numpy.shape", "matplotlib.pyplot.figure", "numpy.polynomial.legendre.leg2poly", "numpy.li...
[((3963, 3980), 'numpy.zeros', 'np.zeros', (['(10, 1)'], {}), '((10, 1))\n', (3971, 3980), True, 'import numpy as np\n'), ((617, 628), 'numpy.shape', 'np.shape', (['X'], {}), '(X)\n', (625, 628), True, 'import numpy as np\n'), ((659, 675), 'numpy.zeros', 'np.zeros', (['[n, 1]'], {}), '([n, 1])\n', (667, 675), True, 'im...
# coding: utf-8 import os import sys sys.path.append(os.pardir) # 为了导入父目录的文件而进行的设定 import numpy as np import matplotlib.pyplot as plt from dataset.mnist import load_mnist from common.multi_layer_net import MultiLayerNet from common.optimizer import SGD (x_train, t_train), (x_test, t_test) = load_mnist(normalize=True...
[ "sys.path.append", "numpy.random.choice", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "common.optimizer.SGD", "matplotlib.pyplot.legend", "dataset.mnist.load_mnist", "numpy.arange", "common.multi_layer_net.MultiLayerNet", "matplotlib.pyplot.ylabel", "matplotli...
[((38, 64), 'sys.path.append', 'sys.path.append', (['os.pardir'], {}), '(os.pardir)\n', (53, 64), False, 'import sys\n'), ((295, 321), 'dataset.mnist.load_mnist', 'load_mnist', ([], {'normalize': '(True)'}), '(normalize=True)\n', (305, 321), False, 'from dataset.mnist import load_mnist\n'), ((567, 707), 'common.multi_l...
''' FILENAME: pix2pix_data.py AUTHORS: <NAME> START DATE: Friday February 25th 2022 CONTACT: <EMAIL> INFO: preparing data for training with pix2pix model ''' import sys from matplotlib.pyplot import bar_label sys.path.append('/data1/shaohua/code/GANToy') import glob import os im...
[ "sys.path.append", "options.train_options.args_option", "torch.utils.data.DataLoader", "PIL.Image.open", "torchvision.transforms.ToTensor", "numpy.random.random", "numpy.array", "torchvision.transforms.Normalize", "os.path.join", "torchvision.transforms.Resize" ]
[((249, 294), 'sys.path.append', 'sys.path.append', (['"""/data1/shaohua/code/GANToy"""'], {}), "('/data1/shaohua/code/GANToy')\n", (264, 294), False, 'import sys\n'), ((1533, 1546), 'options.train_options.args_option', 'args_option', ([], {}), '()\n', (1544, 1546), False, 'from options.train_options import args_option...
from collections import Counter from io import BytesIO import base64 from PIL import Image, ImageDraw import numpy as np from kmeans import KMeans def rgb2hex(rgb): return '#{:02x}{:02x}{:02x}'.format(*[int(x) for x in rgb]) def receive_image(buf): return Image.open(BytesIO(buf)) def image_to_array(img,...
[ "io.BytesIO", "PIL.Image.new", "numpy.uint8", "numpy.product", "numpy.array", "kmeans.KMeans", "collections.Counter" ]
[((838, 847), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (845, 847), False, 'from io import BytesIO\n'), ((1597, 1606), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (1604, 1606), False, 'from io import BytesIO\n'), ((1778, 1787), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (1785, 1787), False, 'from io import BytesIO\n'),...
import numpy as np from scipy import interpolate def clean_ibi(events, samping_rate, n=2): ibi = _ibi(events, samping_rate) for _ in range(n): # detect outlier and repalce with nan outliers = signal_outliers(ibi, samping_rate) time = np.cumsum(ibi) # interpolate nan f =...
[ "numpy.abs", "numpy.median", "numpy.zeros", "numpy.cumsum", "numpy.diff", "numpy.arange", "scipy.interpolate.interp1d" ]
[((827, 841), 'numpy.median', 'np.median', (['arr'], {}), '(arr)\n', (836, 841), True, 'import numpy as np\n'), ((1315, 1349), 'numpy.zeros', 'np.zeros', (['arr.shape[0]'], {'dtype': 'bool'}), '(arr.shape[0], dtype=bool)\n', (1323, 1349), True, 'import numpy as np\n'), ((268, 282), 'numpy.cumsum', 'np.cumsum', (['ibi']...
import numpy as np import matplotlib.pyplot as plt def f(x): decay = 10.0 period = decay return (3.0+0.5*np.sin(2.*np.pi*x/period))*x*np.exp(-x/decay) # read data from file xdata, ydata, yerror = np.loadtxt('DecayOcsData.txt', skiprows=5, unpack=True) # create theoretical fitting curve x = np.linspace(0,...
[ "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.sin", "numpy.loadtxt", "numpy.linspace", "numpy.exp", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.errorbar" ]
[((210, 265), 'numpy.loadtxt', 'np.loadtxt', (['"""DecayOcsData.txt"""'], {'skiprows': '(5)', 'unpack': '(True)'}), "('DecayOcsData.txt', skiprows=5, unpack=True)\n", (220, 265), True, 'import numpy as np\n'), ((306, 329), 'numpy.linspace', 'np.linspace', (['(0)', '(45)', '(128)'], {}), '(0, 45, 128)\n', (317, 329), Tr...
#!/usr/bin/env python # As v1, but using scipy.sparse.diags instead of spdiags """ Functions for solving a 1D diffusion equations of simplest types (constant coefficient, no source term): u_t = a*u_xx on (0,L) with boundary conditions u=0 on x=0,L, for t in (0,T]. Initial condition: u(x,0)=I(x). The following ...
[ "numpy.zeros", "time.perf_counter", "time.sleep", "numpy.linspace", "numpy.linalg.solve", "sys.exit", "numpy.sqrt" ]
[((1720, 1739), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1737, 1739), False, 'import time\n'), ((1812, 1843), 'numpy.linspace', 'np.linspace', (['(0)', '(Nt * dt)', '(Nt + 1)'], {}), '(0, Nt * dt, Nt + 1)\n', (1823, 1843), True, 'import numpy as np\n'), ((1873, 1892), 'numpy.sqrt', 'np.sqrt', (['(a ...
import copy from typing import List import numpy as np from numpy.core import ndarray from .hg import Histogram # import matplotlib.pyplot as plt to_print = False class NewForest: """This creates a forest of trees, given the following list of parameters: 1) n_trees: the number of trees 2) max_depth: the ...
[ "copy.deepcopy", "numpy.zeros", "numpy.shape", "numpy.percentile", "numpy.argsort", "numpy.sort", "numpy.arange", "numpy.array", "numpy.random.choice" ]
[((1059, 1085), 'numpy.zeros', 'np.zeros', (['self.max_buckets'], {}), '(self.max_buckets)\n', (1067, 1085), True, 'import numpy as np\n'), ((1195, 1216), 'numpy.shape', 'np.shape', (['self.points'], {}), '(self.points)\n', (1203, 1216), True, 'import numpy as np\n'), ((1351, 1374), 'numpy.zeros', 'np.zeros', (['(self....
# -*- coding: utf-8 -*- """The check functions.""" # Authors: <NAME> <<EMAIL>> # # License: BSD (3-clause) import operator from distutils.version import LooseVersion import os.path as op import numpy as np from ._logging import warn def _ensure_int(x, name='unknown', must_be='an int'): """Ensure a variable is...
[ "operator.index", "mne.utils.logger.info", "distutils.version.LooseVersion", "numpy.allclose", "numpy.isfinite", "numpy.random.RandomState", "os.path.isfile", "numpy.array", "numpy.unique" ]
[((5048, 5064), 'os.path.isfile', 'op.isfile', (['fname'], {}), '(fname)\n', (5057, 5064), True, 'import os.path as op\n'), ((8651, 8690), 'numpy.array', 'np.array', (["[ch['loc'][:3] for ch in chs]"], {}), "([ch['loc'][:3] for ch in chs])\n", (8659, 8690), True, 'import numpy as np\n'), ((3713, 3740), 'numpy.random.Ra...
# -------------- #Importing header files import pandas as pd import warnings warnings.filterwarnings("ignore") from sklearn.model_selection import train_test_split # Code starts here data = pd.read_csv(path) X = data.drop(['customer.id','paid.back.loan'],axis =1 ) y = data['paid.back.loan'] X_train,X_test,y_train...
[ "sklearn.model_selection.GridSearchCV", "matplotlib.pyplot.show", "warnings.filterwarnings", "pandas.read_csv", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.axis", "sklearn.preprocessing.LabelEncoder", "sklearn.tree.DecisionTreeClassifier", "sklearn.tree.export_graphviz", "pydotp...
[((80, 113), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (103, 113), False, 'import warnings\n'), ((196, 213), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (207, 213), True, 'import pandas as pd\n'), ((330, 383), 'sklearn.model_selection.train_test_spli...
# Some tests for the Cylindrical coordinates handler import numpy as np from yt.testing import \ fake_amr_ds, \ assert_equal, \ assert_almost_equal # Our canonical tests are that we can access all of our fields and we can # compute our volume correctly. def test_cylindrical_coordinates(): # We're go...
[ "yt.testing.fake_amr_ds", "yt.testing.assert_equal", "numpy.argmin", "numpy.argmax" ]
[((432, 467), 'yt.testing.fake_amr_ds', 'fake_amr_ds', ([], {'geometry': '"""cylindrical"""'}), "(geometry='cylindrical')\n", (443, 467), False, 'from yt.testing import fake_amr_ds, assert_equal, assert_almost_equal\n'), ((1069, 1131), 'yt.testing.assert_equal', 'assert_equal', (["dd['index', 'path_element_r']", "dd['i...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2018 the HERA Project # Licensed under the MIT License import os import argparse import pyuvdata from hera_cal.version import version_info import pyuvdata.utils as uvutils import numpy as np parser = argparse.ArgumentParser(description='Extract HERA hex anten...
[ "pyuvdata.UVData", "argparse.ArgumentParser", "pyuvdata.utils.ENU_from_ECEF", "numpy.max", "numpy.array", "os.path.splitext", "numpy.loadtxt" ]
[((261, 375), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Extract HERA hex antennas from data file, and save with new extension."""'}), "(description=\n 'Extract HERA hex antennas from data file, and save with new extension.')\n", (284, 375), False, 'import argparse\n'), ((1653, 16...
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import print_function # Python 2/3 compatibility __doc__ = """ Demo ward clustering on a graph: various ways of forming clusters and dendrogram Requires matplotlib """...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "numpy.sum", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.random.randn", "numpy.ceil", "nipy.algorithms.clustering.hierarchical_clustering.ward", "numpy.zeros", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "nipy.alg...
[((772, 783), 'numpy.random.randn', 'randn', (['n', '(2)'], {}), '(n, 2)\n', (777, 783), False, 'from numpy.random import randn, rand\n'), ((812, 821), 'nipy.algorithms.graph.knn', 'knn', (['X', '(5)'], {}), '(X, 5)\n', (815, 821), False, 'from nipy.algorithms.graph import knn\n'), ((829, 848), 'nipy.algorithms.cluster...
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import IndexLocator, FormatStrFormatter ''' <NAME>, Dec 2015 Plotting routine for initial 'test' runs of ELC. It will make a plot that has both light curve data w/fit and RV data w/fit. There are also residua...
[ "matplotlib.pyplot.axhline", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.median", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.subplot2grid", "matplotlib.pyplot.axis", "matplotlib.pyplot.figtext", "numpy.max", "numpy.min", "numpy.array", "numpy.loadtxt", "numpy.interp",...
[((1544, 1619), 'numpy.loadtxt', 'np.loadtxt', (['f1'], {'comments': '"""#"""', 'dtype': 'np.float64', 'usecols': '(0, 1)', 'unpack': '(True)'}), "(f1, comments='#', dtype=np.float64, usecols=(0, 1), unpack=True)\n", (1554, 1619), True, 'import numpy as np\n'), ((1731, 1806), 'numpy.loadtxt', 'np.loadtxt', (['f3'], {'c...
# -*- coding: utf-8 -*- __all__ = [ 'predict', 'redistribute', 'simulate', 'walk_probability' ] ########### # IMPORTS # ########### # Libraries import numpy as _np # Internal from .custom_types import ( oint as _oint, olist_int as _olist_int, tarray as _tarray, tlist_int as _tlist...
[ "numpy.sum", "numpy.log", "numpy.ravel", "numpy.zeros", "numpy.split", "numpy.max", "numpy.exp" ]
[((935, 979), 'numpy.zeros', '_np.zeros', (['(steps + 1, mc.size)'], {'dtype': 'float'}), '((steps + 1, mc.size), dtype=float)\n', (944, 979), True, 'import numpy as _np\n'), ((1990, 2000), 'numpy.exp', '_np.exp', (['p'], {}), '(p)\n', (1997, 2000), True, 'import numpy as _np\n'), ((1119, 1139), 'numpy.sum', '_np.sum',...
# This example demonstrates prototype of the update model that Ryan, Alex, and Chip discussed. ################################################################################################################################ # Everything here would be part of a DH library ##############################################...
[ "numpy.zeros", "deephaven.TableTools.timeTable", "numpy.sum", "deephaven.QueryScope.addParam" ]
[((4181, 4222), 'deephaven.QueryScope.addParam', 'QueryScope.addParam', (['"""gatherer"""', 'gatherer'], {}), "('gatherer', gatherer)\n", (4200, 4222), False, 'from deephaven import QueryScope\n'), ((4227, 4268), 'deephaven.QueryScope.addParam', 'QueryScope.addParam', (['"""computer"""', 'computer'], {}), "('computer',...
'''Prediction and plotting routine In preparation for prediction and plotting, this script will: 1) Load the obs_dimensions 2) Specify the input_dimensions and latent_dimensions 3) Instantiate the DataHandler class 4) Instantiate the neural network 5) Load the trained neural network weights 6) ...
[ "sys.path.append", "matplotlib.pyplot.title", "numpy.log", "matplotlib.pyplot.ioff", "matplotlib.pyplot.plot", "pandas.read_csv", "matplotlib.pyplot.close", "neural_networks.nn_vaeiaf.VAEIAF", "numpy.expand_dims", "matplotlib.pyplot.figure", "utils_data.data_handler.DataHandler", "numpy.linspa...
[((968, 1001), 'sys.path.append', 'sys.path.append', (['"""../../../../.."""'], {}), "('../../../../..')\n", (983, 1001), False, 'import sys\n'), ((1074, 1084), 'matplotlib.pyplot.ioff', 'plt.ioff', ([], {}), '()\n', (1082, 1084), True, 'import matplotlib.pyplot as plt\n'), ((2374, 2463), 'utils_data.data_handler.DataH...
import logging logging.basicConfig(format="[%(asctime)s] %(filename)s [line:%(lineno)d] %(message)s", datefmt="%m-%d %H:%M:%S") import os import sys import urllib import pprint import tarfile import tensorflow as tf import json import datetime import dateutil.tz import numpy as np import scipy.misc pp = pprint.Prett...
[ "numpy.random.uniform", "os.makedirs", "logging.basicConfig", "tensorflow.trainable_variables", "os.stat", "os.path.exists", "numpy.prod", "pprint.PrettyPrinter", "numpy.arange", "sys.stdout.flush", "urllib.urlretrieve", "tarfile.open", "os.path.join", "logging.getLogger" ]
[((15, 137), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""[%(asctime)s] %(filename)s [line:%(lineno)d] %(message)s"""', 'datefmt': '"""%m-%d %H:%M:%S"""'}), "(format=\n '[%(asctime)s] %(filename)s [line:%(lineno)d] %(message)s', datefmt=\n '%m-%d %H:%M:%S')\n", (34, 137), False, 'import loggi...
#!/usr/bin/env python3 import os import sys import re import argparse from pathlib import Path from collections import Counter from enum import Enum import itertools import json from operator import itemgetter import math import datetime import logging import multiprocessing import time import signal from typing import...
[ "argparse.ArgumentParser", "cv2.approxPolyDP", "cv2.arcLength", "cv2.imdecode", "numpy.ones", "logging.getLogger", "pageinfo.guess_lines", "json.dumps", "pathlib.Path", "numpy.mean", "cv2.rectangle", "cv2.compareHist", "cv2.HOGDescriptor", "cv2.minMaxLoc", "cv2.imshow", "cv2.inRange", ...
[((605, 632), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (622, 632), False, 'import logging\n'), ((1733, 1760), 'cv2.img_hash.PHash_create', 'cv2.img_hash.PHash_create', ([], {}), '()\n', (1758, 1760), False, 'import cv2\n'), ((1215, 1234), 'pathlib.Path', 'Path', (['"""item/equip/"""...
# Copyright 2017 The TensorFlow Authors. 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 applica...
[ "functools.partial", "numpy.size", "tensorflow.python.eager.context.get_default_context", "tensorflow.python.pywrap_tensorflow.TFE_Py_Execute", "numpy.isinf", "numpy.isnan", "numpy.issubdtype" ]
[((5244, 5273), 'tensorflow.python.eager.context.get_default_context', 'context.get_default_context', ([], {}), '()\n', (5271, 5273), False, 'from tensorflow.python.eager import context\n'), ((10708, 10737), 'tensorflow.python.eager.context.get_default_context', 'context.get_default_context', ([], {}), '()\n', (10735, ...
import numpy as np from .distribution import NoDistribution __all__ = ["Simulator"] class Simulator(NoDistribution): def __init__(self, function, *args, **kwargs): """ This class stores a function defined by the user in python language. function : function Simulation ...
[ "numpy.prod" ]
[((556, 579), 'numpy.prod', 'np.prod', (['observed.shape'], {}), '(observed.shape)\n', (563, 579), True, 'import numpy as np\n')]
import copy import os import random import re import time from os.path import join from threading import Thread import cv2 import gym import numpy as np from filelock import FileLock, Timeout from gym.utils import seeding from vizdoom.vizdoom import ScreenResolution, DoomGame, Mode, AutomapMode from algorithms.utils....
[ "vizdoom.vizdoom.DoomGame", "utils.utils.log.warning", "utils.utils.log.info", "cv2.imshow", "os.path.join", "gym.utils.seeding.np_random", "numpy.zeros_like", "os.path.dirname", "numpy.transpose", "os.path.exists", "utils.utils.log.debug", "gym.utils.seeding.hash_seed", "os.path.normpath", ...
[((1128, 1145), 'utils.utils.project_tmp_dir', 'project_tmp_dir', ([], {}), '()\n', (1143, 1145), False, 'from utils.utils import log, project_tmp_dir\n'), ((1162, 1190), 'os.path.join', 'join', (['tmp_dir', 'lock_filename'], {}), '(tmp_dir, lock_filename)\n', (1166, 1190), False, 'from os.path import join\n'), ((3471,...
import unittest import tensorflow.contrib.keras as keras import numpy as np from vixstructure.models import term_structure_to_spread_price, term_structure_to_spread_price_v2 from vixstructure.models import term_structure_to_single_spread_price from vixstructure.models import mask_output from vixstructure.data import ...
[ "unittest.main", "numpy.square", "vixstructure.models.term_structure_to_single_spread_price", "tensorflow.contrib.keras.layers.Lambda", "numpy.all", "tensorflow.contrib.keras.layers.Input", "tensorflow.contrib.keras.models.Model", "vixstructure.models.term_structure_to_spread_price_v2", "vixstructur...
[((3622, 3637), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3635, 3637), False, 'import unittest\n'), ((421, 497), 'vixstructure.data.LongPricesDataset', 'LongPricesDataset', (['"""../../data/8_m_settle.csv"""', '"""../../data/expirations.csv"""'], {}), "('../../data/8_m_settle.csv', '../../data/expirations.cs...
from sklearn.utils.sparsefuncs import mean_variance_axis from scipy.sparse import issparse from scipy.special import loggamma import numpy as np def log_binom(n, k): """ log (n choose k) Parameters ---------- n, k: int Output ------ log_binom: float """ return loggamma(n + 1)...
[ "scipy.special.loggamma", "scipy.sparse.issparse", "numpy.array", "sklearn.utils.sparsefuncs.mean_variance_axis", "numpy.sqrt" ]
[((1997, 2008), 'scipy.sparse.issparse', 'issparse', (['X'], {}), '(X)\n', (2005, 2008), False, 'from scipy.sparse import issparse\n'), ((341, 360), 'scipy.special.loggamma', 'loggamma', (['(n - k + 1)'], {}), '(n - k + 1)\n', (349, 360), False, 'from scipy.special import loggamma\n'), ((2086, 2171), 'sklearn.utils.spa...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # A tf.keras implementation of ghostnet # # import os, sys import warnings import math from keras_applications.imagenet_utils import _obtain_input_shape from keras_applications.imagenet_utils import preprocess_input as _preprocess_input from tensorflow.keras.utils impor...
[ "keras_preprocessing.image.load_img", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Multiply", "common.backbones.layers.YoloConv2D", "tensorflow.keras.backend.set_learning_phase", "common.backbones.layers.YoloDepthwiseConv2D", "tensorflow.keras.layers.Fla...
[((14029, 14076), 'tensorflow.keras.models.Model', 'Model', (['inputs', 'x'], {'name': "('ghostnet_%0.2f' % width)"}), "(inputs, x, name='ghostnet_%0.2f' % width)\n", (14034, 14076), False, 'from tensorflow.keras.models import Model\n'), ((14692, 14740), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '(None, ...
""" Copyright (c) 2019 NAVER Corp. 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, publish, distribute, su...
[ "torch.from_numpy", "torch.nn.ReLU", "torch.nn.ReflectionPad2d", "torch.nn.Conv2d", "numpy.transpose", "numpy.ones", "numpy.sqrt" ]
[((1237, 1252), 'numpy.ones', 'np.ones', (['(1, 2)'], {}), '((1, 2))\n', (1244, 1252), True, 'import numpy as np\n'), ((1287, 1302), 'numpy.ones', 'np.ones', (['(1, 2)'], {}), '((1, 2))\n', (1294, 1302), True, 'import numpy as np\n'), ((1367, 1391), 'numpy.transpose', 'np.transpose', (['harr_wav_L'], {}), '(harr_wav_L)...
import numpy class ReverseProjection: """ I suppose that the photo is xy plane having z=0. coordinates of a point of laser plane having laser_position=0 are (p_1, p_2, p_3). normal vector of laser plane is (n_1, n_2, n_3). focus is in (width/2, heigth/2, -f). """ def __init__(self, ...
[ "numpy.cross", "numpy.linalg.inv", "numpy.array", "numpy.linalg.norm", "numpy.dot" ]
[((602, 674), 'numpy.array', 'numpy.array', (['[photo_size_px[0] / 2, photo_size_px[1] / 2, focal_point_z]'], {}), '([photo_size_px[0] / 2, photo_size_px[1] / 2, focal_point_z])\n', (613, 674), False, 'import numpy\n'), ((923, 966), 'numpy.cross', 'numpy.cross', (['self.up_unit', 'self.normal_unit'], {}), '(self.up_uni...
#!/usr/bin/env python ''' Feature homography ================== Example of using features2d framework for interactive video homography matching. ORB features and FLANN matcher are used. The actual tracking is implemented by PlaneTracker class in plane_tracker.py ''' # Python 2/3 compatibility from __future__ import ...
[ "cv2.contourArea", "numpy.uint8", "numpy.float32", "cv2.AKAZE_create", "cv2.FlannBasedMatcher", "numpy.array", "collections.namedtuple", "numpy.int32", "cv2.findHomography" ]
[((2274, 2339), 'collections.namedtuple', 'namedtuple', (['"""PlaneTarget"""', '"""image, rect, keypoints, descrs, data"""'], {}), "('PlaneTarget', 'image, rect, keypoints, descrs, data')\n", (2284, 2339), False, 'from collections import namedtuple\n'), ((2588, 2642), 'collections.namedtuple', 'namedtuple', (['"""Track...
import re from string import ascii_letters import numpy as np import pandas as pd import pytest import anndata as ad ADATA_ATTRS = ("obs", "var", "varm", "obsm", "layers", "obsp", "varp", "uns") @pytest.fixture def adata(): return ad.AnnData( np.zeros((20, 10)), obs=pd.DataFrame( di...
[ "numpy.zeros", "pytest.fixture", "numpy.arange", "re.search" ]
[((843, 877), 'pytest.fixture', 'pytest.fixture', ([], {'params': 'ADATA_ATTRS'}), '(params=ADATA_ATTRS)\n', (857, 877), False, 'import pytest\n'), ((260, 278), 'numpy.zeros', 'np.zeros', (['(20, 10)'], {}), '((20, 10))\n', (268, 278), True, 'import numpy as np\n'), ((1323, 1395), 're.search', 're.search', (['f"""^\\\\...
# Copyright 2019 Graphcore Ltd. """Networks for VAE implementation in VCD paper""" import numpy as np import tensorflow as tf def encoder(X_input, Z_dim, dtype, n_hidden=200): """As in paper""" with tf.variable_scope('encoder', reuse=tf.AUTO_REUSE, use_resource=True): # Calculate sqrt(n_hidden) - for...
[ "tensorflow.exp", "tensorflow.random_normal_initializer", "tensorflow.variable_scope", "numpy.prod" ]
[((209, 277), 'tensorflow.variable_scope', 'tf.variable_scope', (['"""encoder"""'], {'reuse': 'tf.AUTO_REUSE', 'use_resource': '(True)'}), "('encoder', reuse=tf.AUTO_REUSE, use_resource=True)\n", (226, 277), True, 'import tensorflow as tf\n'), ((3424, 3492), 'tensorflow.variable_scope', 'tf.variable_scope', (['"""decod...
from functools import reduce from itertools import product from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union import numpy as np class _Domain: __slots__ = ['_dimensions_discrete', '_avg_distance', '_dimensions_continuous', '_dimensio...
[ "numpy.sum", "numpy.abs", "numpy.random.default_rng", "numpy.cumsum", "numpy.any", "numpy.linspace", "numpy.random.choice" ]
[((7364, 7396), 'numpy.random.default_rng', 'np.random.default_rng', ([], {'seed': 'seed'}), '(seed=seed)\n', (7385, 7396), True, 'import numpy as np\n'), ((9225, 9257), 'numpy.random.default_rng', 'np.random.default_rng', ([], {'seed': 'seed'}), '(seed=seed)\n', (9246, 9257), True, 'import numpy as np\n'), ((11582, 11...
#!/usr/bin/env python import numpy as np import chainer from chainer import cuda, serializers, Variable # , optimizers, training import cv2 import os.path #import chainer.functions as F #import chainer.links as L #import six #import os #from chainer.training import extensions #from train import Image2ImageDataset f...
[ "lnet.LNET", "chainer.cuda.set_max_workspace_size", "cv2.resize", "chainer.Variable", "chainer.cuda.get_device", "chainer.serializers.load_npz", "cv2.cvtColor", "cv2.imwrite", "numpy.asarray", "numpy.zeros", "chainer.cuda.to_cpu", "cv2.imread", "unet.UNET", "cv2.__version__.split", "chai...
[((1298, 1309), 'unet.UNET', 'unet.UNET', ([], {}), '()\n', (1307, 1309), False, 'import unet\n'), ((1333, 1344), 'unet.UNET', 'unet.UNET', ([], {}), '()\n', (1342, 1344), False, 'import unet\n'), ((1649, 1713), 'chainer.serializers.load_npz', 'serializers.load_npz', (['"""./models/unet_128_standard"""', 'self.cnn_128'...
from flee import flee, SimulationSettings from datamanager import handle_refugee_data from datamanager import DataTable #DataTable.subtract_dates() from flee import InputGeography import numpy as np import outputanalysis.analysis as a import sys import visualization.vis from datetime import datetime from datetime impor...
[ "outputanalysis.analysis.abs_error", "flee.flee.Ecosystem", "flee.InputGeography.InputGeography", "numpy.sum", "datamanager.handle_refugee_data.RefugeeTable", "datamanager.DataTable.subtract_dates", "datetime.datetime", "datetime.timedelta", "outputanalysis.analysis.rel_error", "flee.flee.Simulati...
[((614, 658), 'datamanager.DataTable.subtract_dates', 'DataTable.subtract_dates', (['date', '"""2013-12-01"""'], {}), "(date, '2013-12-01')\n", (638, 658), False, 'from datamanager import DataTable\n'), ((1104, 1120), 'flee.flee.Ecosystem', 'flee.Ecosystem', ([], {}), '()\n', (1118, 1120), False, 'from flee import flee...
import matplotlib.pyplot as plt import numpy as np import pandas as pd import matplotlib.patches as mpatches #importing dataset and converting to datasframe data = pd.read_csv('heart.csv', header=None) df = pd.DataFrame(data) #data frame y = df.iloc[:, 13] y = y-1 def chol_age(): x = df.iloc[:, 0:5] x = x.drop(x....
[ "matplotlib.pyplot.title", "pandas.DataFrame", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.patches.Rectangle", "pandas.read_csv", "matplotlib.pyplot.scatter", "matplotlib.pyplot.bar", "matplotlib.pyplot.legend", "matplotlib.pyplot.pie", "matplotlib.pyplot.ylabel", "matplotl...
[((165, 202), 'pandas.read_csv', 'pd.read_csv', (['"""heart.csv"""'], {'header': 'None'}), "('heart.csv', header=None)\n", (176, 202), True, 'import pandas as pd\n'), ((209, 227), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (221, 227), True, 'import pandas as pd\n'), ((2018, 2028), 'matplotlib.pyplo...
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions a...
[ "sys.path.append", "unittest.main", "numpy.dtype", "test_util.get_zero_model_name", "numpy.random.random", "numpy.array_equal" ]
[((1545, 1573), 'sys.path.append', 'sys.path.append', (['"""../common"""'], {}), "('../common')\n", (1560, 1573), False, 'import sys\n'), ((6563, 6578), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6576, 6578), False, 'import unittest\n'), ((3541, 3603), 'test_util.get_zero_model_name', 'tu.get_zero_model_name'...
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
[ "numpy.isreal", "qiskit.quantum_info.Pauli", "qiskit.quantum_info.SparsePauliOp.from_operator", "qiskit.QuantumCircuit" ]
[((10316, 10347), 'qiskit.QuantumCircuit', 'QuantumCircuit', (['self.num_qubits'], {}), '(self.num_qubits)\n', (10330, 10347), False, 'from qiskit import QuantumCircuit\n'), ((11091, 11136), 'qiskit.quantum_info.SparsePauliOp.from_operator', 'SparsePauliOp.from_operator', (['mat_op.primitive'], {}), '(mat_op.primitive)...
#!/usr/bin/env python # -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology. # SPDX-FileCopyrightText: © 2021 <NAME> <<EMAIL>> # NOTICE: authors should document their contributions in concisely in NOTICE # with details inline in source files...
[ "numpy.sum", "numpy.angle", "numpy.random.RandomState", "numpy.exp", "wavestate.bunch.Bunch", "numpy.testing.assert_allclose", "numpy.all" ]
[((1086, 1195), 'wavestate.bunch.Bunch', 'Bunch', ([], {'generator': 'generator', 'instances': 'instances', 'description': 'description', 'annotation': 'annotation'}), '(generator=generator, instances=instances, description=description,\n annotation=annotation, **kwargs)\n', (1091, 1195), False, 'from wavestate.bunc...
import numpy as np import matplotlib matplotlib.use('pdf') import matplotlib.pyplot as plt import traceback Fs = 30.72e6 x1 = [] x2=[] x5=[] x_comp_0 = [] y_comp_0 = [] x_comp_1 = [] y_comp_1 = [] x_comp_2 = [] y_comp_2 = [] try: f1 = open("/root/.files/free5GRAN/execution_raw_files/studied_frame.txt", "r") ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.specgram", "traceback.print_exc", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "matplotlib.pyplot.scatter", "matplotlib.pyplot.figure", "matplotlib.use", "numpy.arange", "matplotlib.pyplot.savefig" ]
[((37, 58), 'matplotlib.use', 'matplotlib.use', (['"""pdf"""'], {}), "('pdf')\n", (51, 58), False, 'import matplotlib\n'), ((509, 521), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (519, 521), True, 'import matplotlib.pyplot as plt\n'), ((526, 560), 'matplotlib.pyplot.specgram', 'plt.specgram', (['x1'], ...
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ from functions_scenario import derivatives, sat_conc import numpy as np import matplotlib.pyplot as plt import pandas as pd from pandas import DataFrame # Start hour h2 is for test only - in live version will be current time h2 = 1095 h1 ...
[ "numpy.quantile", "numpy.sum", "matplotlib.pyplot.plot", "pandas.read_csv", "matplotlib.pyplot.scatter", "functions_scenario.derivatives", "matplotlib.pyplot.yticks", "numpy.zeros", "numpy.genfromtxt", "matplotlib.pyplot.figure", "numpy.mean", "numpy.linspace", "matplotlib.pyplot.subplots_ad...
[((544, 587), 'numpy.genfromtxt', 'np.genfromtxt', (['"""ACH_out.csv"""'], {'delimiter': '""","""'}), "('ACH_out.csv', delimiter=',')\n", (557, 587), True, 'import numpy as np\n'), ((597, 640), 'numpy.genfromtxt', 'np.genfromtxt', (['"""IAS_out.csv"""'], {'delimiter': '""","""'}), "('IAS_out.csv', delimiter=',')\n", (6...
"""Print summary statistics of DRIAMS spectra. The purpose of this script is to print some summary statistics about DRIAMS data sets, stratified by site. This is just a debug script with no usage in real-world analysis scenarios. """ import argparse import dotenv import os import numpy as np from maldi_learn.driams...
[ "tqdm.tqdm", "numpy.sum", "argparse.ArgumentParser", "maldi_learn.driams.DRIAMSDatasetExplorer", "maldi_learn.driams.load_driams_dataset", "dotenv.load_dotenv", "numpy.min", "numpy.max", "os.getenv" ]
[((425, 445), 'dotenv.load_dotenv', 'dotenv.load_dotenv', ([], {}), '()\n', (443, 445), False, 'import dotenv\n'), ((460, 484), 'os.getenv', 'os.getenv', (['"""DRIAMS_ROOT"""'], {}), "('DRIAMS_ROOT')\n", (469, 484), False, 'import os\n'), ((528, 553), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\...
from functools import partial import numpy as np from keras.preprocessing.image import img_to_array from keras.preprocessing.image import load_img from toolbox.image import bicubic_rescale from toolbox.image import modcrop from toolbox.paths import data_dir def load_set(name, lr_sub_size=11, lr_sub_stride=5, scale=...
[ "numpy.stack", "functools.partial", "toolbox.image.bicubic_rescale", "keras.preprocessing.image.img_to_array", "keras.preprocessing.image.load_img", "toolbox.image.modcrop" ]
[((421, 489), 'functools.partial', 'partial', (['generate_sub_images'], {'size': 'lr_sub_size', 'stride': 'lr_sub_stride'}), '(generate_sub_images, size=lr_sub_size, stride=lr_sub_stride)\n', (428, 489), False, 'from functools import partial\n'), ((532, 600), 'functools.partial', 'partial', (['generate_sub_images'], {'...
from datetime import datetime import numpy as NP import scipy.optimize import sympy as SYM import pylab as PL def chapman(z, Nm, Hm, H_O, exp=NP.exp): """ Return Chapman function electron density at height *z*, maximum electron density at the F-peak *Nm*, height at the maximum *Hm*, and the scale hei...
[ "sympy.symbols", "pylab.show", "numpy.sum", "pylab.axis", "numpy.asarray", "sympy.diff", "pylab.ylabel", "sympy.lambdify", "datetime.datetime", "pylab.figure", "numpy.linspace", "pylab.xlabel", "numpy.dot", "pyglow.pyglow.Point", "pylab.ticklabel_format", "pylab.legend", "pylab.plot"...
[((1769, 1795), 'sympy.symbols', 'SYM.symbols', (['"""z Nm Hm H_O"""'], {}), "('z Nm Hm H_O')\n", (1780, 1795), True, 'import sympy as SYM\n'), ((1848, 1869), 'sympy.diff', 'SYM.diff', (['chapman', 'Nm'], {}), '(chapman, Nm)\n', (1856, 1869), True, 'import sympy as SYM\n'), ((1880, 1901), 'sympy.diff', 'SYM.diff', (['c...