code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
Source code for osm_clipper
Copyright (C) 2020 <NAME>. All versions released under the MIT license.
"""
import os
import numpy
import pandas
import pygeos
import geopandas
import urllib.request
import zipfile
from tqdm import tqdm
from multiprocessing import Pool,cpu_count
from shapely.geometry i... | [
"pygeos.geometry.get_geometry",
"os.makedirs",
"pygeos.simplify",
"os.path.exists",
"tqdm.tqdm.pandas",
"pygeos.area",
"pygeos.to_wkb",
"multiprocessing.cpu_count",
"pygeos.geometry.get_type_id",
"geopandas.GeoDataFrame",
"pygeos.from_shapely",
"numpy.array",
"pygeos.geometry.get_num_geometr... | [((548, 585), 'os.path.join', 'os.path.join', (['data_path', '"""planet_osm"""'], {}), "(data_path, 'planet_osm')\n", (560, 585), False, 'import os\n'), ((1429, 1467), 'os.path.join', 'os.path.join', (['data_path', '"""country_osm"""'], {}), "(data_path, 'country_osm')\n", (1441, 1467), False, 'import os\n'), ((2375, 2... |
import os
import argparse
import json
import onnx
import psutil
import numpy
"""
This profiler tool could run a transformer model and print out the kernel time spent on each Node of the model.
Example of profiling of longformer model:
python profiler.py --model longformer-base-4096_fp32.onnx --batch_size 1 --sequen... | [
"json.load",
"argparse.ArgumentParser",
"psutil.cpu_count",
"numpy.zeros",
"numpy.ones",
"benchmark_helper.setup_logger",
"bert_test_data.generate_test_data",
"bert_test_data.get_bert_inputs",
"onnx.load",
"benchmark_helper.create_onnxruntime_session"
] | [((470, 495), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (493, 495), False, 'import argparse\n'), ((4019, 4092), 'bert_test_data.get_bert_inputs', 'get_bert_inputs', (['model', 'input_ids_name', 'segment_ids_name', 'input_mask_name'], {}), '(model, input_ids_name, segment_ids_name, input_ma... |
#!/usr/bin/python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"numpy.sum",
"numpy.ceil",
"tensorflow.summary.FileWriterCache.get",
"tensorflow.logging.info",
"tensorflow.train.SessionRunArgs",
"tensorflow.contrib.training.StopAfterNEvalsHook",
"tensorflow.Summary",
"tensorflow.train.get_or_create_global_step",
"tensorflow.contrib.training.SummaryAtEndHook",
... | [((9343, 9390), 'tensorflow.concat', 'tf.concat', (['model.target_cross_entropy_losses', '(0)'], {}), '(model.target_cross_entropy_losses, 0)\n', (9352, 9390), True, 'import tensorflow as tf\n'), ((9410, 9463), 'tensorflow.concat', 'tf.concat', (['model.target_cross_entropy_loss_weights', '(0)'], {}), '(model.target_cr... |
import numpy as np
from abc import ABC, abstractmethod
from aos.state import State
class Metric(ABC):
"""
A class to represent a metric of the optical state.
Eventually will have non-trivial image quality metrics ...
"""
@abstractmethod
def evaluate(self, x):
"""
Evaluates the ... | [
"numpy.sum"
] | [((920, 934), 'numpy.sum', 'np.sum', (['(x ** 2)'], {}), '(x ** 2)\n', (926, 934), True, 'import numpy as np\n')] |
from lxml import html as lh
import requests
import pandas as pd
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
from io import StringIO
from scipy import optimize
from scipy.optimize import curve_fit
# define your function:
def gauss_func(x, height, mu, sigma): return height * np.exp... | [
"pandas.DataFrame",
"io.StringIO",
"pandas.Timestamp",
"requests.Session",
"lxml.html.fromstring",
"pandas.to_timedelta",
"pandas.to_datetime",
"numpy.exp",
"requests.get",
"matplotlib.pyplot.savefig"
] | [((2141, 2155), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (2153, 2155), True, 'import pandas as pd\n'), ((3281, 3308), 'pandas.to_datetime', 'pd.to_datetime', (['"""3-16-2020"""'], {}), "('3-16-2020')\n", (3295, 3308), True, 'import pandas as pd\n'), ((3324, 3351), 'pandas.to_datetime', 'pd.to_datetime', ([... |
import numpy as np
from copy import deepcopy
from model.root.root_algo import RootAlgo
class BaseGA(RootAlgo):
"""
Link:
https://blog.sicara.com/getting-started-genetic-algorithms-python-tutorial-81ffa1dd72f9
https://www.tutorialspoint.com/genetic_algorithms/genetic_algorithms_quick_guide.htm
... | [
"numpy.random.uniform",
"copy.deepcopy",
"numpy.multiply",
"numpy.power",
"model.root.root_algo.RootAlgo.__init__"
] | [((506, 546), 'model.root.root_algo.RootAlgo.__init__', 'RootAlgo.__init__', (['self', 'root_algo_paras'], {}), '(self, root_algo_paras)\n', (523, 546), False, 'from model.root.root_algo import RootAlgo\n'), ((808, 850), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(0)', 'high': 'sum_fitness'}), '(low=0, ... |
from __future__ import absolute_import
import os
import numpy as np
import tensorflow as tf
from experiments.scripts.pickle_wrapper import save_pkl, load_pkl
from .ops import simple_linear, select_action_tf, clipped_error
from .alpha_vector import AlphaVector
from .base_tf_solver import BaseTFSolver
class LinearAlpha... | [
"tensorflow.reshape",
"tensorflow.Variable",
"numpy.random.randint",
"os.path.join",
"os.path.exists",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.summary.histogram",
"tensorflow.summary.FileWriter",
"numpy.reshape",
"tensorflow.name_scope",
"tensorflow.train.Saver",
"... | [((5324, 5390), 'numpy.reshape', 'np.reshape', (['gamma', '[self.model.num_actions, self.model.num_states]'], {}), '(gamma, [self.model.num_actions, self.model.num_states])\n', (5334, 5390), True, 'import numpy as np\n'), ((10170, 10208), 'tensorflow.train.Saver', 'tf.train.Saver', (['self.w'], {'max_to_keep': '(30)'})... |
import kwplot
import numpy as np
import kwimage
kwplot.autompl()
f = 8
blank_key = np.zeros((64 * f, 54 * f, 3))
blank_key[:, :, :] = np.array(kwimage.Color('darkgray').as255())[None, None, :]
blank_key[0:f * 2, :] = (3, 3, 3)
blank_key[-f * 2:, :] = (3, 3, 3)
blank_key[:, 0:f * 2] = (3, 3, 3)
blank_key[:, -f * 2:] = ... | [
"kwplot.imshow",
"kwplot.autompl",
"numpy.zeros",
"kwimage.Color",
"kwimage.stack_images"
] | [((48, 64), 'kwplot.autompl', 'kwplot.autompl', ([], {}), '()\n', (62, 64), False, 'import kwplot\n'), ((84, 113), 'numpy.zeros', 'np.zeros', (['(64 * f, 54 * f, 3)'], {}), '((64 * f, 54 * f, 3))\n', (92, 113), True, 'import numpy as np\n'), ((445, 463), 'kwplot.imshow', 'kwplot.imshow', (['key'], {}), '(key)\n', (458,... |
from __future__ import division, print_function
from glob import glob
from sklearn import svm, cross_validation
import numpy as np
import plot_utils as pu
import json
import sys
import fitsio
import pickle
import os
class Artifact(object):
def __init__(self, identifier, expname, ccd, problem, x, y):
s... | [
"pickle.dump",
"json.load",
"plot_utils.diagnostic_vs_m",
"numpy.dtype",
"numpy.searchsorted",
"numpy.genfromtxt",
"numpy.hstack",
"numpy.argsort",
"numpy.sort",
"fitsio.read",
"os.path.isfile",
"numpy.arange",
"numpy.array",
"numpy.min",
"glob.glob",
"numpy.ndarray",
"numpy.unique"
... | [((531, 556), 'glob.glob', 'glob', (["(artifact_base + '*')"], {}), "(artifact_base + '*')\n", (535, 556), False, 'from glob import glob\n'), ((1103, 1122), 'numpy.array', 'np.array', (['artifacts'], {}), '(artifacts)\n', (1111, 1122), True, 'import numpy as np\n'), ((1270, 1292), 'numpy.ndarray', 'np.ndarray', (['(cnx... |
from math import log
import operator
import numpy as np
"""
从文件读入数据,返回一个二维数组
参数:filename 文件路径
"""
def data_input(filename):
r_train = open(filename,'r')
data = r_train.readlines()
data_x = []
for line in data:
line = line.strip('\n').split(' ')
data_x.append(line)
ret... | [
"math.log",
"numpy.mean",
"operator.itemgetter"
] | [((2629, 2644), 'numpy.mean', 'np.mean', (['info_a'], {}), '(info_a)\n', (2636, 2644), True, 'import numpy as np\n'), ((917, 929), 'math.log', 'log', (['prob', '(2)'], {}), '(prob, 2)\n', (920, 929), False, 'from math import log\n'), ((3192, 3214), 'operator.itemgetter', 'operator.itemgetter', (['(1)'], {}), '(1)\n', (... |
# %%
# Imports
from BoundaryConditions.Simulation.SimulationData import getSimData
from GenericModel.Design import _addAgents, _loadBuildingData
from SystemComponentsFast import simulate, Building, Cell
import pandas as pd
import numpy as np
from PostProcesing import plots
import logging
# %%
# Configure logging
FORMA... | [
"BoundaryConditions.Simulation.SimulationData.getSimData",
"pandas.read_hdf",
"logging.basicConfig",
"GenericModel.Design._addAgents",
"PostProcesing.plots.cellEnergyBalance",
"GenericModel.Design._loadBuildingData",
"PostProcesing.plots.buildingTemperature",
"PostProcesing.plots.chargeState",
"nump... | [((415, 449), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': 'FORMAT'}), '(format=FORMAT)\n', (434, 449), False, 'import logging\n'), ((690, 720), 'BoundaryConditions.Simulation.SimulationData.getSimData', 'getSimData', (['start', 'end', 'region'], {}), '(start, end, region)\n', (700, 720), False, 'from ... |
import json
import numpy as np
from tqdm import tqdm
from pathlib import Path, PosixPath
from multiprocessing import Pool
from librosa.feature.spectral import _spectrogram
from librosa.feature import tempogram, fourier_tempogram, melspectrogram, tonnetz
from librosa.feature import mfcc, chroma_stft, chroma_cqt, chroma_... | [
"numpy.load",
"numpy.fft.rfft",
"numpy.abs",
"numpy.floor",
"pathlib.Path",
"numpy.mean",
"numpy.arange",
"tools.feature_extractor.extract_spec_features",
"tools.feature_extractor.SignalLoader",
"numpy.append",
"numpy.finfo",
"numpy.linspace",
"numpy.log10",
"numpy.save",
"numpy.hamming"... | [((1262, 1308), 'numpy.append', 'np.append', (['y[0]', '(y[1:] - pre_emphasis * y[:-1])'], {}), '(y[0], y[1:] - pre_emphasis * y[:-1])\n', (1271, 1308), True, 'import numpy as np\n'), ((1478, 1515), 'numpy.zeros', 'np.zeros', (['(pad_signal_len - signal_len)'], {}), '(pad_signal_len - signal_len)\n', (1486, 1515), True... |
"""
Tests for structural time series models
Author: <NAME>
License: Simplified-BSD
"""
import warnings
import numpy as np
from numpy.testing import assert_equal, assert_allclose, assert_raises
import pandas as pd
import pytest
from statsmodels.datasets import macrodata
from statsmodels.tools.sm_exceptions import Sp... | [
"numpy.random.seed",
"numpy.sum",
"numpy.ones",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.arange",
"numpy.random.normal",
"statsmodels.datasets.macrodata.load_pandas",
"numpy.diag",
"pandas.DataFrame",
"pytest.warns",
"pytest.raises",
"warnings.catch_warnings",
"numpy.testing.assert_... | [((580, 642), 'pandas.date_range', 'pd.date_range', ([], {'start': '"""1959-01-01"""', 'end': '"""2009-07-01"""', 'freq': '"""QS"""'}), "(start='1959-01-01', end='2009-07-01', freq='QS')\n", (593, 642), True, 'import pandas as pd\n'), ((539, 562), 'statsmodels.datasets.macrodata.load_pandas', 'macrodata.load_pandas', (... |
import torch
import numpy as np
from torch.autograd import Variable
import torch.optim as optim
import argparse
import random
import os
import models
import torchvision.utils as vutils
import utils
import nyuDataLoader as dataLoader_nyu
import dataLoader as dataLoader_ours
import torch.nn as nn
from torch.utils.data im... | [
"argparse.ArgumentParser",
"numpy.ones",
"utils.turnErrorIntoNumpy",
"numpy.mean",
"dataLoader.BatchLoader",
"os.path.join",
"torch.multiprocessing.set_sharing_strategy",
"torch.utils.data.DataLoader",
"nyuDataLoader.ConcatDataset",
"random.seed",
"wrapperBRDF.wrapperBRDF",
"models.encoder0",
... | [((474, 499), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (497, 499), False, 'import argparse\n'), ((2503, 2560), 'torch.multiprocessing.set_sharing_strategy', 'torch.multiprocessing.set_sharing_strategy', (['"""file_system"""'], {}), "('file_system')\n", (2545, 2560), False, 'import torch\n... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pickle
import numpy as np
from astropy.time import Time
class TestPickle:
"""Basic pickle test of time"""
def test_pickle(self):
times = ['1999-01-01 00:00:00.123456789', '2010-01-01 00:00:00']
t1 = Time(times, scale='u... | [
"pickle.loads",
"astropy.time.Time",
"numpy.all",
"pickle.dumps"
] | [((300, 324), 'astropy.time.Time', 'Time', (['times'], {'scale': '"""utc"""'}), "(times, scale='utc')\n", (304, 324), False, 'from astropy.time import Time\n'), ((506, 546), 'astropy.time.Time', 'Time', (['"""2012-06-30 12:00:00"""'], {'scale': '"""utc"""'}), "('2012-06-30 12:00:00', scale='utc')\n", (510, 546), False,... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
import unittest
import numpy as np
from cclib.bridge import cclib2pyscf
from cclib.parser.utils import find_package
cl... | [
"unittest.main",
"cclib.bridge.cclib2pyscf.makepyscf",
"numpy.array",
"cclib.parser.utils.find_package"
] | [((1127, 1142), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1140, 1142), False, 'import unittest\n'), ((684, 708), 'numpy.array', 'np.array', (['[1, 8, 1]', '"""i"""'], {}), "([1, 8, 1], 'i')\n", (692, 708), True, 'import numpy as np\n'), ((730, 779), 'numpy.array', 'np.array', (['[[-1, 1, 0], [0, 0, 0], [1, 1... |
"""DimensionHelper module
Contains a bunch of helper classes mostly used in the array.ScaledArray type.
The goal of the ScaledArray type is to be able to access a data array using
floating point indexes instead of integer indexes.
The idea behind this is that the data array represent a section of space.
For example ... | [
"numpy.array",
"nephelae.types.Bounds",
"numpy.linspace"
] | [((3885, 3922), 'nephelae.types.Bounds', 'Bounds', (['maxSlice.start', 'maxSlice.stop'], {}), '(maxSlice.start, maxSlice.stop)\n', (3891, 3922), False, 'from nephelae.types import Bounds\n'), ((5525, 5571), 'numpy.linspace', 'np.linspace', (['(0)', '(self.dimSize - 1)', 'self.dimSize'], {}), '(0, self.dimSize - 1, self... |
import numpy as np
import scipy.sparse as sp
def calc_A_norm_hat(edge_index, weights=None):
if weights is None:
weights = np.ones(edge_index.shape[1])
sparse_adj = sp.coo_matrix((weights, (edge_index[0], edge_index[1])))
nnodes = sparse_adj.shape[0]
A = sparse_adj + sp.eye(nnodes)
D_vec = n... | [
"scipy.sparse.diags",
"numpy.sum",
"numpy.ones",
"scipy.sparse.coo_matrix",
"scipy.sparse.eye",
"numpy.sqrt"
] | [((181, 237), 'scipy.sparse.coo_matrix', 'sp.coo_matrix', (['(weights, (edge_index[0], edge_index[1]))'], {}), '((weights, (edge_index[0], edge_index[1])))\n', (194, 237), True, 'import scipy.sparse as sp\n'), ((405, 433), 'scipy.sparse.diags', 'sp.diags', (['D_vec_invsqrt_corr'], {}), '(D_vec_invsqrt_corr)\n', (413, 4... |
import cv2
import numpy as np
import imutils
from ar_overlay_2d import AR2D
# read in images to be used for query and overlay
query_image = cv2.imread('images/crossword_query.png')
ar_image = cv2.imread('images/smash_box_art.png')
# init ar 2d overlay
ar2d = AR2D(query_image, ar_image, min_match_count=200)
# open we... | [
"cv2.waitKey",
"cv2.imshow",
"cv2.VideoCapture",
"cv2.imread",
"ar_overlay_2d.AR2D",
"imutils.resize",
"cv2.destroyAllWindows",
"numpy.vstack"
] | [((141, 181), 'cv2.imread', 'cv2.imread', (['"""images/crossword_query.png"""'], {}), "('images/crossword_query.png')\n", (151, 181), False, 'import cv2\n'), ((193, 231), 'cv2.imread', 'cv2.imread', (['"""images/smash_box_art.png"""'], {}), "('images/smash_box_art.png')\n", (203, 231), False, 'import cv2\n'), ((261, 30... |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
mpl.rcParams['font.sans-serif'] = ['SimHei'] # 指定默认字体
mpl.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题
np.random.seed(19260817)
def d2():
# x轴采样点
x = ... | [
"matplotlib.pyplot.title",
"numpy.random.seed",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.arange",
"numpy.sin",
"numpy.random.normal",
"numpy.conjugate",
"numpy.fft.ifftshift",
"numpy.meshgrid",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"nump... | [((263, 287), 'numpy.random.seed', 'np.random.seed', (['(19260817)'], {}), '(19260817)\n', (277, 287), True, 'import numpy as np\n'), ((320, 342), 'numpy.linspace', 'np.linspace', (['(0)', '(5)', '(100)'], {}), '(0, 5, 100)\n', (331, 342), True, 'import numpy as np\n'), ((489, 507), 'matplotlib.pyplot.figure', 'plt.fig... |
import numpy as np
import warnings
warnings.filterwarnings("ignore")
from pathlib import Path
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from scipy.io import wavfile
import pyworld as pw
from scipy import signal
from util.utility import separate_speaker, get_separated_values
from LSTMLM.LSTMLM_g... | [
"numpy.load",
"pyworld.synthesize",
"NPBDAA_LM.Bigram_generator.Bigram_generator",
"argparse.ArgumentParser",
"warnings.filterwarnings",
"scipy.signal.medfilt",
"LSTMLM.LSTMLM_generater.LSTMLM_generator",
"pyworld.decode_spectral_envelope",
"Basic_generator.F0_generator.F0_generator",
"Basic_gener... | [((35, 68), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (58, 68), False, 'import warnings\n'), ((888, 981), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'fromfile_prefix_chars': '"""@"""', 'formatter_class': 'ArgumentDefaultsHelpFormatter'}), "(fromfile_prefix_cha... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
import pickle
import os
from .. import Quat, normalize
def indices(t):
import itertools
for k in itertools.product(*[range(i) for i in t]):
yield k
def normalize_angles(x, xmin, xmax):
while np.any(... | [
"numpy.sum",
"numpy.allclose",
"os.path.dirname",
"numpy.zeros",
"numpy.any",
"pytest.raises",
"numpy.where",
"numpy.array",
"pickle.load",
"numpy.random.random",
"numpy.sign",
"numpy.dot",
"pytest.mark.parametrize",
"numpy.isclose",
"numpy.arange",
"numpy.all"
] | [((517, 636), 'numpy.array', 'np.array', (['[[[10, 20, 30], [10, 20, -30], [10, -60, 30]], [[10, 20, 0], [10, 50, 30],\n [10, -50, -30]]]'], {'dtype': 'float'}), '([[[10, 20, 30], [10, 20, -30], [10, -60, 30]], [[10, 20, 0], [10, \n 50, 30], [10, -50, -30]]], dtype=float)\n', (525, 636), True, 'import numpy as np... |
import numpy as np
import os
import scipy
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from PIL import Image
from scipy.misc import imresize
def gauss2D(shape=(3, 3),sigma=0.5):
m, n = [(ss-1.)/2. for ss in shape]
y, x = np.ogrid[-m:m+1,-n:n+1]
h = np.exp(-(x*x + y*y) ... | [
"matplotlib.image.imread",
"numpy.zeros_like",
"matplotlib.pyplot.show",
"numpy.multiply",
"matplotlib.pyplot.imshow",
"numpy.ones",
"numpy.finfo",
"matplotlib.pyplot.figure",
"numpy.exp",
"scipy.misc.imresize",
"numpy.lib.pad",
"numpy.concatenate"
] | [((300, 348), 'numpy.exp', 'np.exp', (['(-(x * x + y * y) / (2.0 * sigma * sigma))'], {}), '(-(x * x + y * y) / (2.0 * sigma * sigma))\n', (306, 348), True, 'import numpy as np\n'), ((676, 696), 'numpy.zeros_like', 'np.zeros_like', (['image'], {}), '(image)\n', (689, 696), True, 'import numpy as np\n'), ((2207, 2234), ... |
# -*- coding: utf-8 -*-
"""ORCHSET Dataset Loader
Orchset is intended to be used as a dataset for the development and
evaluation of melody extraction algorithms. This collection contains
64 audio excerpts focused on symphonic music with their corresponding
annotation of the melody.
For more details, please visit: htt... | [
"csv.reader",
"mirdata.download_utils.downloader",
"mirdata.jams_utils.jams_converter",
"os.path.exists",
"mirdata.download_utils.RemoteFileMetadata",
"mirdata.utils.LargeData",
"librosa.load",
"numpy.array",
"shutil.move",
"shutil.rmtree",
"os.path.join"
] | [((3333, 3386), 'mirdata.utils.LargeData', 'utils.LargeData', (['"""orchset_index.json"""', '_load_metadata'], {}), "('orchset_index.json', _load_metadata)\n", (3348, 3386), False, 'from mirdata import utils\n'), ((969, 1192), 'mirdata.download_utils.RemoteFileMetadata', 'download_utils.RemoteFileMetadata', ([], {'file... |
# Dieses Skript versucht die TDOA im Zeitbereich mit CSOM zu bestimmen
# Variation der Mikrofonabstände sowie Sampling Frequenz 96kHz
# Imports
import sys
import math
import numpy as np
sys.path.append("..\\..\\simulation")
sys.path.append("..\\..\\libraries")
from GeometryLibrary import calculateMicrophoneArray_2
fr... | [
"numpy.arange",
"GeometryLibrary.getPoint",
"sys.path.append",
"numpy.zeros_like",
"SignalProcessingLibrary.butterWorthFilter",
"numpy.max",
"GeometryLibrary.distance",
"numpy.average",
"numpy.median",
"numpy.asarray",
"math.sin",
"GeometryLibrary.angle_radians",
"SimulationLibrary.simulate"... | [((188, 225), 'sys.path.append', 'sys.path.append', (['"""..\\\\..\\\\simulation"""'], {}), "('..\\\\..\\\\simulation')\n", (203, 225), False, 'import sys\n'), ((226, 262), 'sys.path.append', 'sys.path.append', (['"""..\\\\..\\\\libraries"""'], {}), "('..\\\\..\\\\libraries')\n", (241, 262), False, 'import sys\n'), ((9... |
# %%
from multiprocessing.sharedctypes import Value
import os
from torch.utils.data import DataLoader
from dataloaders.csv_data_loader import CSVDataLoader
from dotenv import load_dotenv
import numpy as np
from torchvision import transforms
load_dotenv()
DATA_FOLDER_PATH = os.getenv("DATA_FOLDER_PATH")
def get_norm... | [
"torch.utils.data.DataLoader",
"numpy.std",
"torchvision.transforms.ToPILImage",
"torchvision.transforms.ToTensor",
"dotenv.load_dotenv",
"numpy.mean",
"numpy.array",
"dataloaders.csv_data_loader.CSVDataLoader",
"os.path.join",
"os.getenv",
"torchvision.transforms.Resize"
] | [((243, 256), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (254, 256), False, 'from dotenv import load_dotenv\n'), ((277, 306), 'os.getenv', 'os.getenv', (['"""DATA_FOLDER_PATH"""'], {}), "('DATA_FOLDER_PATH')\n", (286, 306), False, 'import os\n'), ((1066, 1219), 'dataloaders.csv_data_loader.CSVDataLoader', '... |
# ===========================================================================
# heightmap.py ------------------------------------------------------------
# ===========================================================================
# import ------------------------------------------------------------------
# -----... | [
"numpy.log",
"numpy.ceil",
"tempfile.mkstemp",
"numpy.indices",
"numpy.min",
"numpy.max",
"numpy.where"
] | [((1066, 1121), 'numpy.indices', 'np.indices', (['(img.shape[0], img.shape[1])'], {'dtype': '"""float"""'}), "((img.shape[0], img.shape[1]), dtype='float')\n", (1076, 1121), True, 'import numpy as np\n'), ((3786, 3833), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {'prefix': '"""shdw-"""', 'suffix': '""".ply"""'}), "(p... |
from pip import main
import pygame
import cv2
from matplotlib import pyplot as plt
import numpy as np
def get_bkgr():
image = cv2.imread("frame1.jpg")
mask = cv2.imread("mask.jpg")
grayImage = cv2.cvtColor(mask, cv2.COLOR_BGR2GRAY)
(thresh, blackAndWhiteImage) = cv2.threshold(grayImage, 127, 255, cv2.... | [
"cv2.bitwise_and",
"pygame.event.get",
"pygame.display.update",
"matplotlib.pyplot.figure",
"cv2.cvtColor",
"cv2.imwrite",
"pygame.display.set_mode",
"matplotlib.pyplot.imshow",
"pygame.quit",
"cv2.circle",
"matplotlib.pyplot.show",
"pygame.time.Clock",
"cv2.add",
"pygame.display.init",
... | [((132, 156), 'cv2.imread', 'cv2.imread', (['"""frame1.jpg"""'], {}), "('frame1.jpg')\n", (142, 156), False, 'import cv2\n'), ((168, 190), 'cv2.imread', 'cv2.imread', (['"""mask.jpg"""'], {}), "('mask.jpg')\n", (178, 190), False, 'import cv2\n'), ((207, 245), 'cv2.cvtColor', 'cv2.cvtColor', (['mask', 'cv2.COLOR_BGR2GRA... |
import pandas as pd
import numpy as np
from sklearn.datasets import dump_svmlight_file
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from skmultilearn.model_selection import iterative_train_test_split
import json
import sklearn
import pickle
DATASET_PATH = "dataset/dataset_sampl... | [
"sklearn.datasets.dump_svmlight_file",
"json.dump",
"numpy.load",
"numpy.save",
"skmultilearn.model_selection.iterative_train_test_split",
"sklearn.feature_extraction.text.CountVectorizer",
"pandas.read_csv",
"sklearn.feature_extraction.text.TfidfVectorizer",
"numpy.nonzero",
"numpy.all"
] | [((1046, 1099), 'pandas.read_csv', 'pd.read_csv', (['DATASET_PATH'], {'usecols': 'description_fields'}), '(DATASET_PATH, usecols=description_fields)\n', (1057, 1099), True, 'import pandas as pd\n'), ((1270, 1382), 'pandas.read_csv', 'pd.read_csv', (['DATASET_PATH'], {'usecols': "[i for i in cols if i not in ['cve_id', ... |
"""Contains a class representing a Vindinium map."""
import numpy as np
__all__ = ['Map']
class Map(object):
"""Represents static elements in the game.
Elements comprise walls, paths, taverns, mines and spawn points.
Attributes:
size (int): the board size (in a single axis).
"""
def __... | [
"numpy.array"
] | [((1186, 1207), 'numpy.array', 'np.array', (['self._board'], {}), '(self._board)\n', (1194, 1207), True, 'import numpy as np\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : xds
# @wechat : 551883614
# @file: show_the_path.py
# @time: 2019-03-06 11:48:11
# @Software: PyCharm
import numpy as np
import math
# 输入旋转后的终点,中间得到一个转换矩阵,输出一个新的矩阵
def rotation_matrix(end_point):
"""
Return the rotation matrix associated with count... | [
"math.atan2",
"numpy.asarray",
"math.sin",
"numpy.array",
"math.cos",
"numpy.dot"
] | [((408, 429), 'numpy.asarray', 'np.asarray', (['end_point'], {}), '(end_point)\n', (418, 429), True, 'import numpy as np\n'), ((512, 550), 'math.atan2', 'math.atan2', (['end_point[0]', 'end_point[2]'], {}), '(end_point[0], end_point[2])\n', (522, 550), False, 'import math\n'), ((565, 603), 'math.atan2', 'math.atan2', (... |
import numpy as np
import cv2, time, multiprocessing
import matplotlib.pyplot as plt
def transform(x, y, orgX, orgY):
c = complex(x - orgX, y - orgY)
return c ** 1.2
const = np.array([256, 256, 256], np.int16)
def toMatrix(newDict):
global const
arrs = newDict.keys()
xRange = max(arrs, key=lambd... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.zeros",
"time.clock",
"cv2.imread",
"numpy.array",
"multiprocessing.Pool"
] | [((186, 221), 'numpy.array', 'np.array', (['[256, 256, 256]', 'np.int16'], {}), '([256, 256, 256], np.int16)\n', (194, 221), True, 'import numpy as np\n'), ((582, 621), 'numpy.zeros', 'np.zeros', (['(yRange, xRange, 3)', 'np.int16'], {}), '((yRange, xRange, 3), np.int16)\n', (590, 621), True, 'import numpy as np\n'), (... |
import unittest
from numpy import array
from lda import VariationalBayes
from scipy.special import psi as digam
from math import exp
class TestVB(unittest.TestCase):
def setUp(self):
self.init_beta = array([[.26, .185, .185, .185, .185],
[.185, .185, .26, .185, .185],
... | [
"unittest.main",
"numpy.array",
"lda.VariationalBayes"
] | [((1896, 1911), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1909, 1911), False, 'import unittest\n'), ((216, 336), 'numpy.array', 'array', (['[[0.26, 0.185, 0.185, 0.185, 0.185], [0.185, 0.185, 0.26, 0.185, 0.185], [\n 0.185, 0.185, 0.185, 0.26, 0.185]]'], {}), '([[0.26, 0.185, 0.185, 0.185, 0.185], [0.185,... |
import math
import cv2
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras.datasets import mnist
def load_img(path):
img = cv2.imread(path, cv2.IMREAD_GRAYSCALE)
return img
def preprocess_img(img, size, invert_colors=False):
if invert_colors:
img = cv2... | [
"numpy.sum",
"matplotlib.pyplot.clf",
"numpy.argmax",
"tensorflow.reset_default_graph",
"tensorflow.layers.max_pooling2d",
"tensorflow.saved_model.simple_save",
"tensorflow.placeholder_with_default",
"tensorflow.placeholder",
"cv2.resize",
"cv2.bitwise_not",
"matplotlib.pyplot.get_cmap",
"tens... | [((173, 211), 'cv2.imread', 'cv2.imread', (['path', 'cv2.IMREAD_GRAYSCALE'], {}), '(path, cv2.IMREAD_GRAYSCALE)\n', (183, 211), False, 'import cv2\n'), ((348, 406), 'cv2.resize', 'cv2.resize', (['img'], {'dsize': 'size', 'interpolation': 'cv2.INTER_CUBIC'}), '(img, dsize=size, interpolation=cv2.INTER_CUBIC)\n', (358, 4... |
""" Data helper functions """
import os
import random
import numpy as np
import PIL
from tensorflow.keras.preprocessing.image import load_img, img_to_array
from tensorflow.keras.utils import to_categorical
def load_data(directory, classes, rescale=True, preprocess=None, verbose=False):
""" Helper function to load... | [
"tensorflow.keras.utils.to_categorical",
"numpy.empty",
"tensorflow.keras.preprocessing.image.img_to_array",
"os.path.exists",
"os.path.join",
"os.listdir"
] | [((495, 516), 'os.listdir', 'os.listdir', (['directory'], {}), '(directory)\n', (505, 516), False, 'import os\n'), ((921, 973), 'numpy.empty', 'np.empty', (['(num_images, 256, 256, 3)'], {'dtype': '"""float32"""'}), "((num_images, 256, 256, 3), dtype='float32')\n", (929, 973), True, 'import numpy as np\n'), ((2488, 250... |
"""
GPMF
A Generalized Poroelastic Model using FEniCS
Code for a fully-coupled poroelastic formulation: This solves the three
PDEs (conservation of mass, darcy's law, conservation of momentum) using
a Mixed Finite Element approach (i.e. a monolithic solve). The linear
model uses a constant fluid density and porosity... | [
"time.gmtime",
"numpy.abs",
"numpy.round"
] | [((1211, 1219), 'time.gmtime', 'gmtime', ([], {}), '()\n', (1217, 1219), False, 'from time import gmtime, strftime\n'), ((12883, 12912), 'numpy.round', 'np.round', (['(t / tend * 100.0)', '(6)'], {}), '(t / tend * 100.0, 6)\n', (12891, 12912), True, 'import numpy as np\n'), ((16374, 16382), 'time.gmtime', 'gmtime', ([]... |
"""
General purpose math functions, mostly geometric in nature.
"""
import math
import numpy as np
from numpy.linalg import norm
from scipy.linalg import svd
from aspire.utils.random import Random
def cart2pol(x, y):
"""
Convert Cartesian to Polar Coordinates. All input arguments must be the same shape.
... | [
"numpy.zeros_like",
"numpy.arctan2",
"numpy.eye",
"aspire.utils.random.Random",
"numpy.zeros",
"math.floor",
"numpy.ones",
"numpy.hypot",
"scipy.linalg.svd",
"numpy.random.random",
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.round"
] | [((1090, 1104), 'numpy.hypot', 'np.hypot', (['x', 'y'], {}), '(x, y)\n', (1098, 1104), True, 'import numpy as np\n'), ((1113, 1129), 'numpy.hypot', 'np.hypot', (['hxy', 'z'], {}), '(hxy, z)\n', (1121, 1129), True, 'import numpy as np\n'), ((1139, 1157), 'numpy.arctan2', 'np.arctan2', (['z', 'hxy'], {}), '(z, hxy)\n', (... |
# -*- coding: utf-8 -*-
#Mixture of gaussians
#In this examples, the 1d case will be shown
# -*- coding: utf-8 -*-
# =============================================================================
# Here we will be testing with mixtures of student-t, 1d
# ===============================================================... | [
"os.mkdir",
"numpy.random.seed",
"torch.cat",
"matplotlib.pyplot.figure",
"numpy.exp",
"src.utils.TicToc",
"torch.ones",
"src.variational_boosting_bmc.VariationalBoosting",
"numpy.random.choice",
"torch.zeros",
"matplotlib.pyplot.subplots",
"torch.log",
"matplotlib.pyplot.show",
"torch.man... | [((346, 377), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../src"""'], {}), "(0, '../../src')\n", (361, 377), False, 'import sys\n'), ((766, 785), 'numpy.random.seed', 'np.random.seed', (['(100)'], {}), '(100)\n', (780, 785), True, 'import numpy as np\n'), ((786, 808), 'torch.manual_seed', 'torch.manual_seed'... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import copy
# models and dataset import
from sklearn import tree, svm
from sklearn.neural_network import MLPClassifier
from sklearn.multiclass import OneVsRestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble impor... | [
"pyfolding.FTU",
"sklearn.model_selection.train_test_split",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.neural_network.MLPClassifier",
"sklearn.svm.SVC",
"matplotlib.pyplot.close",
"sklearn.cluster.KMeans",
"growingspheres.utils.gs_utils.distances",
"numpy.append",
"sklearn.neighbors.NearestN... | [((3667, 3963), 'growingspheres.counterfactuals.CounterfactualExplanation', 'cf.CounterfactualExplanation', (['raw_data', 'clf.predict'], {'method': '"""GF"""', 'target_class': 'opponent_class', 'continuous_features': 'continuous_features', 'categorical_features': 'categorical_features', 'categorical_values': 'categori... |
import numpy as np
import cv2
# convert a hexadecimal color to a BGR color array
def hex2bgr(h):
b = h & 0xFF
g = (h >> 8) & 0xFF
r = (h >> 16) & 0xFF
return np.array([b, g, r])
# predefined colors in BGR
MAROON = hex2bgr(0x800000)
RED = hex2bgr(0xFF0000)
ORANGE = hex2bgr(0xFFA500)
YELLOW = hex... | [
"cv2.cvtColor",
"numpy.array"
] | [((175, 194), 'numpy.array', 'np.array', (['[b, g, r]'], {}), '([b, g, r])\n', (183, 194), True, 'import numpy as np\n'), ((928, 939), 'numpy.array', 'np.array', (['c'], {}), '(c)\n', (936, 939), True, 'import numpy as np\n'), ((1152, 1175), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'code'], {}), '(img, code)\n', (1164,... |
import itertools
from tempfile import NamedTemporaryFile
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from bokeh.plotting import figure, output_file
def get_validation_plot(true_value, prediction):
output_file(NamedTemporaryFile().name)
x_min = min(min(true_value), min(prediction))
... | [
"matplotlib.pyplot.title",
"tempfile.NamedTemporaryFile",
"numpy.trace",
"bokeh.plotting.figure",
"numpy.sum",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.imshow",
"matplotlib.rcParams.update",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.figure",
"matplotl... | [((432, 495), 'bokeh.plotting.figure', 'figure', ([], {'width': '(800)', 'height': '(800)', 'x_range': 'x_range', 'y_range': 'y_range'}), '(width=800, height=800, x_range=x_range, y_range=y_range)\n', (438, 495), False, 'from bokeh.plotting import figure, output_file\n'), ((2741, 2767), 'matplotlib.pyplot.figure', 'plt... |
#!/usr/bin/env python
import sys
import numpy as np
from netCDF4 import Dataset
with Dataset(sys.argv[1]) as nc1, Dataset(sys.argv[2]) as nc2:
if nc1.variables.keys()!=nc2.variables.keys():
print("Variables are different")
sys.exit(1)
for varname in nc1.variables.keys():
diff = nc2[varname][:]-nc1[va... | [
"netCDF4.Dataset",
"numpy.abs",
"sys.exit"
] | [((87, 107), 'netCDF4.Dataset', 'Dataset', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (94, 107), False, 'from netCDF4 import Dataset\n'), ((116, 136), 'netCDF4.Dataset', 'Dataset', (['sys.argv[2]'], {}), '(sys.argv[2])\n', (123, 136), False, 'from netCDF4 import Dataset\n'), ((235, 246), 'sys.exit', 'sys.exit', (['(1)']... |
"""
Functions to prepare the data for pciSeq. The label image and spots are parsed and if a spot
lies within the cell boundaries then the corresponding cell id is recorded.
Cell centroids and cell areas are also calculated.
"""
import os
import shutil
import numpy as np
import pandas as pd
import skimage.measure as sk... | [
"pandas.DataFrame",
"numpy.asarray",
"os.path.realpath",
"logging.getLogger",
"scipy.sparse.coo_matrix",
"scipy.sparse.csr_matrix",
"numpy.arange",
"numpy.array",
"numpy.random.shuffle"
] | [((586, 605), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (603, 605), False, 'import logging\n'), ((549, 575), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (565, 575), False, 'import os\n'), ((2835, 2848), 'numpy.asarray', 'np.asarray', (['m'], {}), '(m)\n', (2845, 2848), ... |
import numpy
import PIL.Image
import torch.utils.data
import torchvision
import conf.config
import dataset.bak_dataset_utils
class VOCDataset(torch.utils.data.Dataset):
def __init__(self, config: dict, root: str, image_set: str, train: bool = True) -> None:
super().__init__()
self.config = conf... | [
"numpy.asarray",
"torchvision.datasets.VOCDetection"
] | [((354, 419), 'torchvision.datasets.VOCDetection', 'torchvision.datasets.VOCDetection', ([], {'root': 'root', 'image_set': 'image_set'}), '(root=root, image_set=image_set)\n', (387, 419), False, 'import torchvision\n'), ((1438, 1463), 'numpy.asarray', 'numpy.asarray', (['raw_target'], {}), '(raw_target)\n', (1451, 1463... |
# to build the phylogeny:
# - andi *.fasta > ecoli.distances
# - python bin/fix_andi_names.py accession_list < ../results/ecoli.distances > ../results/ecoli.distances.fixed # turns andi prefixes into genome names
# - python bin/draw_phylogeny.py ../results/ecoli_matrix_2.map [full.path.to]/ecoli.distances.fixed ../res... | [
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.vstack"
] | [((3595, 3607), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3605, 3607), True, 'import matplotlib.pyplot as plt\n'), ((3688, 3705), 'numpy.vstack', 'np.vstack', (['(a, a)'], {}), '((a, a))\n', (3697, 3705), True, 'import numpy as np\n'), ((3645, 3667), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '... |
"""Module containing the decoders."""
import numpy as np
import torch
import torch.nn as nn
import pdb
class DecoderBurgess(nn.Module):
def __init__(self, img_size,
latent_dim=10):
r"""Decoder of the model proposed in [1].
Parameters
----------
img_size : tuple o... | [
"torch.nn.ConvTranspose2d",
"torch.randn_like",
"torch.exp",
"numpy.product",
"torch.nn.Linear"
] | [((1408, 1441), 'torch.nn.Linear', 'nn.Linear', (['latent_dim', 'hidden_dim'], {}), '(latent_dim, hidden_dim)\n', (1417, 1441), True, 'import torch.nn as nn\n'), ((1462, 1495), 'torch.nn.Linear', 'nn.Linear', (['hidden_dim', 'hidden_dim'], {}), '(hidden_dim, hidden_dim)\n', (1471, 1495), True, 'import torch.nn as nn\n'... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import numpy as np
import sklearn.neighbors as sn
import matplotlib.pyplot as mp
train_x, train_y = [], []
with open('../../data/knn.txt', 'r') as f:
for line in f.readlines():
data = [float(substr) for substr
in line.split(',')... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"numpy.ones_like",
"matplotlib.pyplot.scatter",
"sklearn.neighbors.KNeighborsClassifier",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.pcolormesh",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.ylabel",
... | [((399, 416), 'numpy.array', 'np.array', (['train_x'], {}), '(train_x)\n', (407, 416), True, 'import numpy as np\n'), ((427, 455), 'numpy.array', 'np.array', (['train_y'], {'dtype': 'int'}), '(train_y, dtype=int)\n', (435, 455), True, 'import numpy as np\n'), ((464, 523), 'sklearn.neighbors.KNeighborsClassifier', 'sn.K... |
"""
Original code based on Kaggle competition
Modified to take 3-channel input
"""
from __future__ import division
import numpy as np
from keras.models import Model
from keras.layers import Input, merge, Convolution2D, MaxPooling2D, UpSampling2D, Cropping2D, AveragePooling2D
from keras import backend as K... | [
"os.mkdir",
"keras.layers.Cropping2D",
"keras.models.Model",
"tensorflow.ConfigProto",
"keras.layers.Input",
"os.path.join",
"pandas.DataFrame",
"random.randint",
"threading.Lock",
"random.seed",
"datetime.datetime.now",
"keras.layers.normalization.BatchNormalization",
"keras.layers.Convolut... | [((758, 774), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (772, 774), True, 'import tensorflow as tf\n'), ((969, 983), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (980, 983), False, 'import random\n'), ((846, 871), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=conf... |
import matplotlib
matplotlib.use("agg")
import matplotlib.pyplot as plt
import sys
sys.path.insert(0, ".")
import os, argparse
import numpy as np
from lib.fid import fid_score
"""
parser = argparse.ArgumentParser()
parser.add_argument("--type", default=0, type=int, help="The path to pytorch inceptionv3 weight. You can... | [
"numpy.load",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"sys.path.insert",
"matplotlib.use",
"lib.fid.fid_score.calculate_frechet_distance",
"matplotlib.pyplot.savefig"
] | [((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (32, 39), False, 'import matplotlib\n'), ((83, 106), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""."""'], {}), "(0, '.')\n", (98, 106), False, 'import sys\n'), ((1156, 1173), 'matplotlib.pyplot.legend', 'plt.legend', (['types'], {})... |
import numpy as np
# NumPy introduces a simple file format for ndarray objects. This .npy file stores data, shape, dtype and other information required to reconstruct the ndarray in a disk file such that the array is correctly retrieved even if the file is on another machine with different architecture.
a = np.arra... | [
"numpy.load",
"numpy.save",
"numpy.savetxt",
"numpy.array",
"numpy.loadtxt"
] | [((313, 338), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5]'], {}), '([1, 2, 3, 4, 5])\n', (321, 338), True, 'import numpy as np\n'), ((337, 358), 'numpy.save', 'np.save', (['"""outfile"""', 'a'], {}), "('outfile', a)\n", (344, 358), True, 'import numpy as np\n'), ((365, 387), 'numpy.load', 'np.load', (['"""outfile.npy... |
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import fitsio
import treecorr
import ngmix
import os
import errno
from esutil import htm
# import lfunc
# Can use for debugging
import pudb
def mag_flux_tick_function(flux):
return ["%.1f" % mag for mag in 30 - 2.5*np.log1... | [
"matplotlib.pyplot.title",
"treecorr.GGCorrelation",
"os.remove",
"pdb.post_mortem",
"ngmix.shape.g1g2_to_e1e2",
"numpy.abs",
"treecorr.Catalog",
"fitsio.read",
"numpy.histogram",
"numpy.arange",
"numpy.exp",
"sys.exc_info",
"os.path.join",
"traceback.print_exc",
"matplotlib.pyplot.close... | [((610, 700), 'esutil.htm.Matcher', 'htm.Matcher', ([], {'depth': '(14)', 'ra': 'truth_catalog[ratag_truth]', 'dec': 'truth_catalog[dectag_truth]'}), '(depth=14, ra=truth_catalog[ratag_truth], dec=truth_catalog[\n dectag_truth])\n', (621, 700), False, 'from esutil import htm\n'), ((1012, 1073), 'esutil.htm.Matcher',... |
# reference implementation of HIGGS training
import argparse
import os
# import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
from torch.utils.data import DataLoader, random_split
from tqdm import tqdm
# for reproducibility inits
import random... | [
"tqdm.tqdm",
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss",
"torch.manual_seed",
"torch.cuda.manual_seed",
"numpy.zeros",
"torch.cuda.manual_seed_all",
"random.seed",
"torch.cuda.is_available",
"torch.initial_seed",
"torch.nn.Linear",
"os... | [((464, 491), 'numpy.random.seed', 'np.random.seed', (['worker_seed'], {}), '(worker_seed)\n', (478, 491), True, 'import numpy as np\n'), ((496, 520), 'random.seed', 'random.seed', (['worker_seed'], {}), '(worker_seed)\n', (507, 520), False, 'import random\n'), ((2952, 3047), 'argparse.ArgumentParser', 'argparse.Argume... |
###############################################################################
#
# Source object color: https://www.pyimagesearch.com/2016/02/15/determining-object-color-with-opencv/
#
# June 28, 2018
#
###############################################################################
# import the necessary packages... | [
"scipy.spatial.distance.euclidean",
"cv2.erode",
"cv2.cvtColor",
"numpy.zeros",
"collections.OrderedDict",
"cv2.drawContours",
"cv2.mean"
] | [((1053, 1082), 'collections.OrderedDict', 'OrderedDict', (['color_dictionary'], {}), '(color_dictionary)\n', (1064, 1082), False, 'from collections import OrderedDict\n'), ((1654, 1695), 'cv2.cvtColor', 'cv2.cvtColor', (['self.lab', 'cv2.COLOR_RGB2LAB'], {}), '(self.lab, cv2.COLOR_RGB2LAB)\n', (1666, 1695), False, 'im... |
# coding=utf-8
# Copyright Huawei Noah's Ark Lab.
# 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/l... | [
"tensorflow.maximum",
"numpy.iinfo",
"tensorflow.string_split",
"tensorflow.contrib.data.group_by_window",
"tensorflow.size",
"tensorflow.less",
"tensorflow.pad",
"tensorflow.TensorShape",
"tensorflow.less_equal",
"tensorflow.concat",
"tensorflow.reverse",
"tensorflow.constant",
"noahnmt.dat... | [((2621, 2651), 'noahnmt.data.input_pipeline.InputPipeline.default_params', 'InputPipeline.default_params', ([], {}), '()\n', (2649, 2651), False, 'from noahnmt.data.input_pipeline import InputPipeline\n'), ((15015, 15062), 'tensorflow.data.Dataset.zip', 'tf.data.Dataset.zip', (['(src_dataset, tgt_dataset)'], {}), '((s... |
"""
eval auc curve
pred score in npy
ground true in mat
"""
import os
import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics import roc_auc_score,roc_curve,auc
from net.utils.parser import load_config,parse_args
import net.utils.logging_tool as logging
from sklearn import metrics
from net.utils.load_g... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.bar",
"os.path.join",
"os.path.exists",
"net.utils.parser.load_config",
"matplotlib.pyplot.cla",
"net.utils.logging_tool.get_logger",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"net.utils.logging_tool.setup_logging",
"matplotlib.pyplot.y... | [((387, 415), 'net.utils.logging_tool.get_logger', 'logging.get_logger', (['__name__'], {}), '(__name__)\n', (405, 415), True, 'import net.utils.logging_tool as logging\n'), ((554, 581), 'numpy.expand_dims', 'np.expand_dims', (['fpr'], {'axis': '(1)'}), '(fpr, axis=1)\n', (568, 581), True, 'import numpy as np\n'), ((58... |
import numpy as np
class WordEmbeddings(object):
def __init__(self, size=300, n_words=10000):
self.size = size
self.n_words = n_words
width = 0.5 / self.size
self.embeddings = np.random.uniform(min=-width, max=width, size=(n_words, size))
| [
"numpy.random.uniform"
] | [((215, 277), 'numpy.random.uniform', 'np.random.uniform', ([], {'min': '(-width)', 'max': 'width', 'size': '(n_words, size)'}), '(min=-width, max=width, size=(n_words, size))\n', (232, 277), True, 'import numpy as np\n')] |
import os
import json
import numpy as np
from scipy import sparse
from scipy.sparse import csr_matrix
try:
import tensorflow as tf
except ModuleNotFoundError:
tf = None
class Backend:
def __init__(self, dirname):
self.dirname = dirname
def save(self, obj):
# store obj
raise No... | [
"json.dump",
"json.load",
"numpy.vectorize",
"tensorflow.train.import_meta_graph",
"scipy.sparse.load_npz",
"tensorflow.get_collection",
"os.path.exists",
"tensorflow.Session",
"numpy.array",
"scipy.sparse.save_npz",
"tensorflow.Graph",
"os.path.join"
] | [((653, 688), 'os.path.join', 'os.path.join', (['self.dirname', '"""graph"""'], {}), "(self.dirname, 'graph')\n", (665, 688), False, 'import os\n'), ((1446, 1481), 'os.path.join', 'os.path.join', (['self.dirname', '"""graph"""'], {}), "(self.dirname, 'graph')\n", (1458, 1481), False, 'import os\n'), ((1497, 1542), 'os.... |
import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import open3d as o3d
os.environ['PYOPENGL_PLATFORM'] = 'osmesa'
# os.environ['PYOPENGL_PLATFORM'] = 'egl'
# os.environ['EGL_DEVICE_ID'] = os.environ['SLURM_STEP_GPUS']
import numpy as np
import time
from tqdm import tqdm
i... | [
"os.remove",
"argparse.ArgumentParser",
"open3d.visualization.draw_geometries",
"pyrender.Mesh.from_trimesh",
"os.path.join",
"numpy.zeros_like",
"os.path.dirname",
"os.path.exists",
"utils.image_proc.backproject_depth",
"traceback.format_exc",
"utils.pcd_utils.rotate_around_axis",
"NPMs._C.co... | [((1025, 1130), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0, 0.0], [0.0, -1.0, 0.0, 0.0], [0.0, 0.0, -1.0, 0.0], [0.0, \n 0.0, 0.0, 1.0]]'], {}), '([[1.0, 0.0, 0.0, 0.0], [0.0, -1.0, 0.0, 0.0], [0.0, 0.0, -1.0, 0.0\n ], [0.0, 0.0, 0.0, 1.0]])\n', (1033, 1130), True, 'import numpy as np\n'), ((1169, 1232), 'nump... |
import argparse
import tensorflow as tf
import numpy as np
from tfbldr.datasets import fetch_mnist
from collections import namedtuple
import sys
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import copy
parser = argparse.ArgumentParser()
parser.add_argument('direct_model', nargs=1, default=N... | [
"numpy.load",
"numpy.zeros_like",
"copy.deepcopy",
"argparse.ArgumentParser",
"tensorflow.train.import_meta_graph",
"tensorflow.get_collection",
"tensorflow.Session",
"numpy.random.RandomState",
"tensorflow.ConfigProto",
"matplotlib.use",
"numpy.array",
"collections.namedtuple",
"numpy.savez... | [((163, 184), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (177, 184), False, 'import matplotlib\n'), ((240, 265), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (263, 265), False, 'import argparse\n'), ((798, 830), 'numpy.random.RandomState', 'np.random.RandomState', (... |
'''
Hyperspectral Instrument Data Resemblance Algorithm - A simple modular Python simulator for low-resolution spectroscopy
Made by <NAME>, as a part of the thesis work.
2020
'''
import numpy as np
import matplotlib.pyplot as plt
import input_file as inp
import HIDRA
import scipy.signal
import random
def rms(x):
... | [
"numpy.load",
"HIDRA.setup",
"HIDRA.transmission_spec_func",
"matplotlib.pyplot.plot",
"HIDRA.sinusoidal",
"HIDRA.prep_func",
"numpy.zeros",
"numpy.mean",
"random.randrange",
"numpy.random.normal",
"scipy.interpolate.interp1d",
"HIDRA.spatial_dispersion",
"datetime.datetime.now",
"numpy.sq... | [((1284, 1298), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1296, 1298), False, 'from datetime import datetime\n'), ((4277, 4293), 'HIDRA.setup', 'HIDRA.setup', (['inp'], {}), '(inp)\n', (4288, 4293), False, 'import HIDRA\n'), ((4320, 4339), 'numpy.load', 'np.load', (['inp.in_CCD'], {}), '(inp.in_CCD)\n... |
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import training
from chainer.training import extensions
import numpy as np
import random
# 前処理
# 書き方はこれを参考にした:https://github.com/yasunorikudo/chainer-DenseNet
class Preprocess(chainer.dataset.DatasetMixin):
def __init_... | [
"chainer.iterators.SerialIterator",
"chainer.training.extensions.LogReport",
"chainer.links.Linear",
"random.randint",
"chainer.initializers.GlorotNormal",
"chainer.training.extensions.Evaluator",
"chainer.functions.average_pooling_2d",
"chainer.Sequential",
"chainer.training.StandardUpdater",
"ch... | [((3139, 3169), 'chainer.datasets.get_cifar10', 'chainer.datasets.get_cifar10', ([], {}), '()\n', (3167, 3169), False, 'import chainer\n'), ((3248, 3292), 'chainer.iterators.SerialIterator', 'chainer.iterators.SerialIterator', (['train', '(128)'], {}), '(train, 128)\n', (3280, 3292), False, 'import chainer\n'), ((3310,... |
#!/usr/bin/env python
import numpy as np
from ropy.robot.ETS import ETS
from pathlib import Path
class PandaURDF(ETS):
def __init__(self):
fpath = Path('ropy') / 'models' / 'xacro' / 'panda' / 'robots'
fname = 'panda_arm_hand.urdf.xacro'
abspath = fpath.absolute()
args = super(... | [
"pathlib.Path",
"numpy.array"
] | [((579, 616), 'numpy.array', 'np.array', (['[0, 0, 0, 0, 0, 0, 0, 0, 0]'], {}), '([0, 0, 0, 0, 0, 0, 0, 0, 0])\n', (587, 616), True, 'import numpy as np\n'), ((636, 689), 'numpy.array', 'np.array', (['[0, -0.3, 0, -2.2, 0, 2.0, np.pi / 4, 0, 0]'], {}), '([0, -0.3, 0, -2.2, 0, 2.0, np.pi / 4, 0, 0])\n', (644, 689), True... |
# from @有一种悲伤叫颓废
"""
注:
1. 主要用来求三角剖分和维诺图,算法的思路可以看我的这期视频:https://www.bilibili.com/video/BV1Ck4y1z7VT
2. 时间复杂度O(nlogn),一般情况应该够用,如发现bug请联系颓废
3. 只需导入两个函数:DelaunayTrianglation(求德劳内三角剖分), Voronoi(求维诺图)
"""
import numpy as np
from manimlib.mobject.types.vectorized_mobject import VGroup
from manimlib... | [
"manimlib.utils.space_ops.normalize",
"numpy.random.seed",
"manimlib.utils.config_ops.digest_config",
"manimlib.mobject.types.vectorized_mobject.VGroup",
"manimlib.mobject.geometry.Polygon",
"numpy.linalg.det",
"numpy.array",
"numpy.exp",
"numpy.random.randint",
"numpy.dot",
"manimlib.mobject.ge... | [((2436, 2543), 'numpy.linalg.det', 'np.linalg.det', (['[[p[0], p[1], a13, 1], [q[0], q[1], a23, 1], [b[0], b[1], a33, 1], [d[0], d\n [1], a43, 1]]'], {}), '([[p[0], p[1], a13, 1], [q[0], q[1], a23, 1], [b[0], b[1], a33,\n 1], [d[0], d[1], a43, 1]])\n', (2449, 2543), True, 'import numpy as np\n'), ((3336, 3402), ... |
##############################################################################
#
# Copyright (c) 2003-2018 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development unt... | [
"esys.escript.pdetools.TFQMR",
"numpy.size",
"esys.escript.pdetools.Projector",
"esys.escript.pdetools.GMRES",
"numpy.zeros",
"numpy.ones",
"esys.escript.pdetools.MINRES",
"esys.escript.pdetools.NoPDE",
"esys.escript.pdetools.PCG",
"numpy.array",
"numpy.dot",
"esys.escript.pdetools.TimeIntegra... | [((2185, 2217), 'esys.escript.pdetools.TimeIntegrationManager', 'TimeIntegrationManager', (['(0.0)'], {'p': '(1)'}), '(0.0, p=1)\n', (2207, 2217), False, 'from esys.escript.pdetools import Locator, Projector, TimeIntegrationManager, NoPDE, PCG, ArithmeticTuple, GMRES, MINRES, TFQMR, HomogeneousSaddlePointProblem\n'), (... |
from .pondering import proximity_ponderation,outlier_ponderation
from .fitting import fit
import numpy as np
import matplotlib.pyplot as plt
def plot(points,res=256):
#plots each point with it's ponderation, and the function
fig, ax1 = plt.subplots()
points= np.array(points)
xpoints= points[:,0]
... | [
"matplotlib.pyplot.show",
"numpy.amin",
"numpy.amax",
"numpy.array",
"matplotlib.pyplot.subplots"
] | [((246, 260), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (258, 260), True, 'import matplotlib.pyplot as plt\n'), ((274, 290), 'numpy.array', 'np.array', (['points'], {}), '(points)\n', (282, 290), True, 'import numpy as np\n'), ((941, 951), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (9... |
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
from convgru import ConvGRUCell
from gen_models import make_conv_net, make_fc_net, make_upconv_net
import rlkit.torch.pytorch_util as ptu
import numpy as np
from numpy import pi
from numpy import log as np_log
log_... | [
"numpy.log",
"torch.nn.Conv2d",
"gen_models.make_conv_net",
"gen_models.make_upconv_net",
"torch.sigmoid",
"torch.clamp",
"gen_models.make_fc_net",
"torch.exp",
"torch.nn.Linear",
"torch.sum"
] | [((326, 340), 'numpy.log', 'np_log', (['(2 * pi)'], {}), '(2 * pi)\n', (332, 340), True, 'from numpy import log as np_log\n'), ((698, 758), 'gen_models.make_conv_net', 'make_conv_net', (['in_ch', 'in_h', "encoder_specs['conv_part_specs']"], {}), "(in_ch, in_h, encoder_specs['conv_part_specs'])\n", (711, 758), False, 'f... |
import tensorflow as tf
import numpy as np
import cv2
import os
import argparse
parser = argparse.ArgumentParser(description='Shade Sketches')
parser.add_argument('--image-size', type=int, default=320,
help='input image size (default: 320)')
parser.add_argument('--direction', type=str, default='810... | [
"os.makedirs",
"argparse.ArgumentParser",
"os.walk",
"os.path.exists",
"numpy.expand_dims",
"tensorflow.compat.v1.Session",
"cv2.imread",
"numpy.reshape",
"tensorflow.Graph",
"numpy.squeeze",
"tensorflow.import_graph_def",
"tensorflow.compat.v1.GraphDef",
"os.path.join",
"cv2.resize",
"t... | [((90, 143), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Shade Sketches"""'}), "(description='Shade Sketches')\n", (113, 143), False, 'import argparse\n'), ((1167, 1190), 'os.path.exists', 'os.path.exists', (['"""norm/"""'], {}), "('norm/')\n", (1181, 1190), False, 'import os\n'), ((1... |
"""
MIT License
Copyright (c) 2018 <NAME> and <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, publ... | [
"numpy.maximum",
"numpy.argmax",
"scipy.sparse.issparse",
"pyRipser.doRipsFiltrationDMCycles",
"numpy.ones",
"numpy.isnan",
"numpy.arange",
"sklearn.metrics.pairwise.pairwise_distances",
"numpy.max",
"scipy.sparse.coo_matrix",
"pyRipser.doRipsFiltrationDM",
"numpy.minimum",
"numpy.ones_like"... | [((1676, 1955), 'scipy.spatial.distance.squareform', 'squareform', (['[1.0, 1.0, 1.41421356, 1.41421356, 1.0, 1.0, 1.0, 1.41421356, 1.41421356, \n 1.73205081, 1.41421356, 1.0, 1.73205081, 1.41421356, 1.0, 1.41421356, \n 1.73205081, 1.0, 1.41421356, 1.0, 1.41421356, 1.73205081, 1.41421356, \n 1.41421356, 1.0, 1... |
import warnings
warnings.filterwarnings('ignore')
import CONFIG
import DataLoader
import engine
import NERCRFModel
import os
import sys
import pickle
import torch
import torch.nn as nn
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder
def run():
df = pd.read_csv('input/ner_d... | [
"torch.utils.data.sampler.SubsetRandomSampler",
"DataLoader.DataLoader",
"warnings.filterwarnings",
"pandas.read_csv",
"os.path.exists",
"engine.train",
"sklearn.preprocessing.LabelEncoder",
"torch.save",
"engine.eval",
"numpy.arange",
"torch.cuda.is_available",
"DataLoader.MyCollate",
"torc... | [((16, 49), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (39, 49), False, 'import warnings\n'), ((296, 352), 'pandas.read_csv', 'pd.read_csv', (['"""input/ner_dataset.csv"""'], {'encoding': '"""latin-1"""'}), "('input/ner_dataset.csv', encoding='latin-1')\n", (307, 352),... |
#Main program for Project 1 - Algorithms class
import tkinter as tk
from tkinter import *
import csv
import time
import sys
import pandas as pd
import numpy as np
import subprocess
#Application class definition (Tk frame for graphics.)
class Application(tk.Frame):
#Initialization of the class and subsequently GUI.
... | [
"tkinter.Spinbox",
"csv.reader",
"tkinter.Button",
"time.time",
"numpy.array",
"tkinter.Label",
"tkinter.Tk"
] | [((10819, 10826), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (10824, 10826), True, 'import tkinter as tk\n'), ((1262, 1276), 'tkinter.Label', 'tk.Label', (['self'], {}), '(self)\n', (1270, 1276), True, 'import tkinter as tk\n'), ((1595, 1609), 'tkinter.Label', 'tk.Label', (['self'], {}), '(self)\n', (1603, 1609), True, '... |
from __future__ import print_function
import gc
from timeit import default_timer
import matplotlib.pyplot as plt
from numpy import log2
from funcstructs.structures import *
from funcstructs.combinat import productrange
from funcstructs.prototypes.integer_partitions import fixed_lex_partitions
class Stopwatch(objec... | [
"matplotlib.pyplot.show",
"gc.disable",
"matplotlib.pyplot.plot",
"numpy.log2",
"matplotlib.pyplot.legend",
"funcstructs.prototypes.integer_partitions.fixed_lex_partitions",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.xlabel",
"gc.enable"
] | [((5534, 5549), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""x"""'], {}), "('x')\n", (5544, 5549), True, 'import matplotlib.pyplot as plt\n'), ((6696, 6708), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (6706, 6708), True, 'import matplotlib.pyplot as plt\n'), ((6922, 6932), 'matplotlib.pyplot.show', ... |
import numpy as np
import cv2
from cv_utils import add_text
## Convert COCO keypoints to PoseTrack keypoints
def conver_coco_poseTrack(kps):
"""
input: N, 17, 3
kp_names = [0:'nose', 1:'l_eye', 2:'r_eye', 3:'l_ear', 4:'r_ear', 5:'l_shoulder',
6:'r_shoulder', 7:'l_elbow'... | [
"numpy.zeros",
"cv2.rectangle"
] | [((864, 895), 'numpy.zeros', 'np.zeros', (['(kps.shape[0], 15, 3)'], {}), '((kps.shape[0], 15, 3))\n', (872, 895), True, 'import numpy as np\n'), ((1516, 1561), 'cv2.rectangle', 'cv2.rectangle', (['img', 'pt1', 'pt2', '(2, 0, 2)', '(3)', '(2)'], {}), '(img, pt1, pt2, (2, 0, 2), 3, 2)\n', (1529, 1561), False, 'import cv... |
from numpy import array
def scigrid_2011_01_04_20():
ppc = {"version": '2'}
ppc["baseMVA"] = 100.0
ppc["bus"] = array([
[586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9 ],
[589, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9 ],
[590, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1,... | [
"numpy.array"
] | [((115, 79219), 'numpy.array', 'array', (['[[586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9], [589, 2, 0, 0, 0, 0, \n 0, 1.0, 0, 380.0, 0, 1.1, 0.9], [590, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, \n 0, 1.1, 0.9], [593, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9], [594,\n 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 12 14:20:34 2020
@author: sixingliu, yaruchen
"""
import pandas as pd
import numpy as np
#from pandas.core.indexes.numeric import (NumericIndex, Float64Index, # noqa
# Int64Index, UInt64Index)
#from pandas.core.indexes.datetimes import ... | [
"pandas.api.extensions.register_dataframe_accessor",
"pandas.api.extensions.register_series_accessor",
"numpy.array"
] | [((2011, 2061), 'pandas.api.extensions.register_series_accessor', 'pd.api.extensions.register_series_accessor', (['"""freq"""'], {}), "('freq')\n", (2053, 2061), True, 'import pandas as pd\n'), ((2063, 2116), 'pandas.api.extensions.register_dataframe_accessor', 'pd.api.extensions.register_dataframe_accessor', (['"""fre... |
import smtplib
import datetime
import numpy as np
import pandas as pd
from email.mime.text import MIMEText
from yahoo_fin import stock_info as si
from pandas_datareader import DataReader
from email.mime.multipart import MIMEMultipart
from bs4 import BeautifulSoup
from urllib.request import urlopen, Request
from nltk.se... | [
"pandas_datareader.DataReader",
"urllib.request.Request",
"email.mime.text.MIMEText",
"selenium.webdriver.find_element_by_class_name",
"pandas.DataFrame",
"selenium.webdriver.find_elements_by_class_name",
"smtplib.SMTP",
"urllib.request.urlopen",
"email.mime.multipart.MIMEMultipart",
"datetime.tim... | [((797, 806), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (804, 806), False, 'from selenium.webdriver.chrome.options import Options\n'), ((854, 909), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': 'path', 'options': 'options'}), '(executable_path=path, options=op... |
"""
Quick and dirty script to compute shape tensor of a FITS image.
:author: <NAME>
:contact: <EMAIL>
:version: 0.1
"""
import numpy as np
import pyfits as pf
import glob as g
def computeShapeTensor(data):
"""
Computes a shape tensor from 2D imaging array.
:Warning: This function has been adapted from ... | [
"numpy.sqrt",
"numpy.sum",
"pyfits.getdata",
"glob.glob"
] | [((1296, 1312), 'glob.glob', 'g.glob', (['"""*.fits"""'], {}), "('*.fits')\n", (1302, 1312), True, 'import glob as g\n'), ((1387, 1403), 'pyfits.getdata', 'pf.getdata', (['file'], {}), '(file)\n', (1397, 1403), True, 'import pyfits as pf\n'), ((1008, 1051), 'numpy.sqrt', 'np.sqrt', (['((Qxx - Qyy) ** 2 + 4.0 * Qxy * Qx... |
## @ingroup Methods-Aerodynamics-Common-Fidelity_Zero-Lift
# generate_propeller_wake_distribution.py
#
# Created: Sep 2020, <NAME>
# Modified: May 2021, <NAME>
# Jul 2021, <NAME>
# Jul 2021, <NAME>
# Sep 2021, <NAME>
# ------------------------------------------------------------------... | [
"numpy.dot",
"SUAVE.Core.Data",
"numpy.zeros",
"SUAVE.Methods.Aerodynamics.Common.Fidelity_Zero.Lift.compute_wake_contraction_matrix.compute_wake_contraction_matrix",
"numpy.sqrt",
"numpy.append",
"numpy.sin",
"numpy.arange",
"numpy.reshape",
"numpy.linspace",
"numpy.cos",
"numpy.take",
"SUA... | [((17107, 17141), 'numpy.reshape', 'np.reshape', (['Wmid.WD_XA1', 'mat6_size'], {}), '(Wmid.WD_XA1, mat6_size)\n', (17117, 17141), True, 'import numpy as np\n'), ((17158, 17192), 'numpy.reshape', 'np.reshape', (['Wmid.WD_YA1', 'mat6_size'], {}), '(Wmid.WD_YA1, mat6_size)\n', (17168, 17192), True, 'import numpy as np\n'... |
import logging
import numpy, random, time, json, copy
import numpy as np
import os.path as osp
import torch
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader, Subset
from cords.utils.data.data_utils import WeightedSubset
from cords.utils.models import WideResNet, ShakeN... | [
"numpy.random.seed",
"torch.cat",
"cords.selectionstrategies.helpers.ssl_lib.algs.builder.gen_ssl_alg",
"logging.Formatter",
"torch.no_grad",
"os.path.join",
"cords.utils.models.CNN13",
"cords.utils.config_utils.load_config_data",
"torch.utils.data.DataLoader",
"cords.utils.models.CNN",
"torch.m... | [((23483, 23521), 'torch.multiprocessing.freeze_support', 'torch.multiprocessing.freeze_support', ([], {}), '()\n', (23519, 23521), False, 'import torch\n'), ((1166, 1200), 'cords.utils.config_utils.load_config_data', 'load_config_data', (['self.config_file'], {}), '(self.config_file)\n', (1182, 1200), False, 'from cor... |
from copy import copy
import numpy as np
import pytest
import aesara
from aesara import tensor as at
from aesara.scan.utils import ScanArgs
@pytest.fixture(scope="module", autouse=True)
def set_aesara_flags():
with aesara.config.change_flags(cxx="", mode="FAST_COMPILE"):
yield
def create_test_hmm():
... | [
"aesara.scan.utils.ScanArgs.from_node",
"aesara.tensor.iscalar",
"aesara.tensor.random.normal",
"numpy.random.SeedSequence",
"pytest.fixture",
"aesara.shared",
"aesara.scan",
"copy.copy",
"numpy.random.default_rng",
"pytest.raises",
"aesara.tensor.random.categorical",
"aesara.scan.utils.ScanAr... | [((145, 189), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'autouse': '(True)'}), "(scope='module', autouse=True)\n", (159, 189), False, 'import pytest\n'), ((335, 363), 'numpy.random.default_rng', 'np.random.default_rng', (['(23422)'], {}), '(23422)\n', (356, 363), True, 'import numpy as np\n'), ... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator, ScalarFormatter
from .specutils import Spectrum1D
def plot_spectrum(spec, wlmin=None, wlmax=None, ax=None,
dxmaj=None, dxmin=None, dymaj=None, dymin=None,
fillcolor="#cccccc",fillalpha... | [
"numpy.repeat",
"matplotlib.ticker.MultipleLocator",
"matplotlib.pyplot.subplots",
"numpy.concatenate",
"matplotlib.ticker.ScalarFormatter"
] | [((1580, 1608), 'numpy.repeat', 'np.repeat', (['(x[1:] - x[:-1])', '(2)'], {}), '(x[1:] - x[:-1], 2)\n', (1589, 1608), True, 'import numpy as np\n'), ((1623, 1671), 'numpy.concatenate', 'np.concatenate', (['([xstep[0]], xstep, [xstep[-1]])'], {}), '(([xstep[0]], xstep, [xstep[-1]]))\n', (1637, 1671), True, 'import nump... |
# py-motmetrics - Metrics for multiple object tracker (MOT) benchmarking.
# https://github.com/cheind/py-motmetrics/
#
# MIT License
# Copyright (c) 2017-2020 <NAME>, <NAME> and others.
# See LICENSE file for terms.
"""Accumulate tracking events frame by frame."""
from __future__ import absolute_import
from __future_... | [
"numpy.zeros_like",
"pandas.MultiIndex.from_arrays",
"numpy.asarray",
"motmetrics.lap.linear_sum_assignment",
"numpy.isfinite",
"itertools.count",
"numpy.isnan",
"numpy.where",
"numpy.arange",
"pandas.Series",
"pandas.Categorical",
"pandas.MultiIndex",
"pandas.concat",
"numpy.unique",
"n... | [((7820, 7836), 'numpy.asarray', 'np.asarray', (['oids'], {}), '(oids)\n', (7830, 7836), True, 'import numpy as np\n'), ((7859, 7894), 'numpy.zeros_like', 'np.zeros_like', (['oids'], {'dtype': 'np.bool_'}), '(oids, dtype=np.bool_)\n', (7872, 7894), True, 'import numpy as np\n'), ((7910, 7926), 'numpy.asarray', 'np.asar... |
from os import system
import threading
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime as dt
import time
def extract_data(pid):
system("top -H -p "+pid+" -d 0.5 -b >> migrations.txt")
def get_hops(tid):
top_thread = open("migrations.txt")
thread_data ... | [
"pandas.DataFrame",
"threading.Thread",
"os.system",
"time.sleep",
"numpy.array"
] | [((188, 247), 'os.system', 'system', (["('top -H -p ' + pid + ' -d 0.5 -b >> migrations.txt')"], {}), "('top -H -p ' + pid + ' -d 0.5 -b >> migrations.txt')\n", (194, 247), False, 'from os import system\n'), ((798, 814), 'pandas.DataFrame', 'pd.DataFrame', (['df'], {}), '(df)\n', (810, 814), True, 'import pandas as pd\... |
import os
import io
import time
import multiprocessing as mp
from queue import Empty
from PIL import Image
from http import server
import socketserver
import numpy as np
import cv2
import urllib.request
Ncams = 1
streamsVideo = ('http://192.168.0.20:8000', 'http://192.168.0.20:8000',
'http://192.168.0.... | [
"numpy.zeros",
"http.server.serve_forever",
"time.time",
"cv2.VideoCapture",
"time.sleep",
"cv2.rectangle",
"cv2.imencode",
"numpy.array",
"multiprocessing.Queue",
"cv2.VideoWriter",
"multiprocessing.Event",
"multiprocessing.Process",
"cv2.resize"
] | [((3825, 3860), 'cv2.VideoCapture', 'cv2.VideoCapture', (['streamsVideo[cam]'], {}), '(streamsVideo[cam])\n', (3841, 3860), False, 'import cv2\n'), ((4935, 4969), 'cv2.VideoCapture', 'cv2.VideoCapture', (['streamsVideo[-1]'], {}), '(streamsVideo[-1])\n', (4951, 4969), False, 'import cv2\n'), ((7667, 7772), 'numpy.zeros... |
# -*- coding: utf-8 -*-
# @Author: <NAME>
# @Email: <EMAIL>
# @Date: 2019-06-27 13:59:02
# @Last Modified by: <NAME>
# @Last Modified time: 2020-08-08 16:23:59
import os
from sys import getsizeof
import json
import pickle
import re
import numpy as np
from scipy.interpolate import interp1d
from ..utils import isWi... | [
"numpy.moveaxis",
"json.load",
"pickle.dump",
"numpy.asarray",
"os.path.isfile",
"pickle.load",
"numpy.array",
"sys.getsizeof",
"numpy.interp",
"scipy.interpolate.interp1d",
"re.compile"
] | [((17091, 17129), 're.compile', 're.compile', (['f"""^({suffix_pattern})inf$"""'], {}), "(f'^({suffix_pattern})inf$')\n", (17101, 17129), False, 'import re\n'), ((17149, 17187), 're.compile', 're.compile', (['f"""^tau({suffix_pattern})$"""'], {}), "(f'^tau({suffix_pattern})$')\n", (17159, 17187), False, 'import re\n'),... |
import matplotlib.pyplot as plt
from matplotlib.patches import RegularPolygon
from matplotlib.collections import PatchCollection
from pkg_resources import resource_filename
import numpy as np
def load_pixel_coordinates():
filename = resource_filename('iceact', 'resources/pixel_coordinates.txt')
x, y = np.genf... | [
"matplotlib.patches.RegularPolygon",
"numpy.genfromtxt",
"pkg_resources.resource_filename",
"matplotlib.pyplot.gca",
"matplotlib.collections.PatchCollection"
] | [((239, 301), 'pkg_resources.resource_filename', 'resource_filename', (['"""iceact"""', '"""resources/pixel_coordinates.txt"""'], {}), "('iceact', 'resources/pixel_coordinates.txt')\n", (256, 301), False, 'from pkg_resources import resource_filename\n'), ((313, 349), 'numpy.genfromtxt', 'np.genfromtxt', (['filename'], ... |
"""Implement boundary and interior discretization on regular Fourier grid."""
import numpy as np
from src.grid import Grid
from scipy.sparse import vstack as sparse_vstack
def space_points(bdry_x, bdry_y, dx):
"""Space points equally on boundary with distance approximately dx."""
m = 8192
k = np.arange(m+... | [
"numpy.zeros_like",
"numpy.sum",
"scipy.sparse.vstack",
"numpy.arange",
"numpy.linalg.norm",
"numpy.vstack"
] | [((490, 522), 'numpy.linalg.norm', 'np.linalg.norm', (['pts_diff'], {'axis': '(1)'}), '(pts_diff, axis=1)\n', (504, 522), True, 'import numpy as np\n'), ((536, 554), 'numpy.sum', 'np.sum', (['ptwise_len'], {}), '(ptwise_len)\n', (542, 554), True, 'import numpy as np\n'), ((308, 324), 'numpy.arange', 'np.arange', (['(m ... |
from __future__ import division
import numpy as np
import torch.nn as nn
from mmcv.cnn import normal_init
from mmdet.core import (AnchorGenerator, anchor_target_plus,
delta2bbox, force_fp32, multi_apply, multiclass_nms)
from ..builder import build_loss
from ..registry import HEADS
from ..utils import Co... | [
"torch.nn.ReLU",
"mmdet.core.anchor_target_plus",
"numpy.ceil",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"mmdet.core.AnchorGenerator",
"mmdet.core.force_fp32",
"mmdet.core.delta2bbox",
"mmcv.cnn.normal_init",
"mmdet.core.multiclass_nms",
"mmdet.core.multi_apply"
] | [((7508, 7557), 'mmdet.core.force_fp32', 'force_fp32', ([], {'apply_to': "('cls_scores', 'bbox_preds')"}), "(apply_to=('cls_scores', 'bbox_preds'))\n", (7518, 7557), False, 'from mmdet.core import AnchorGenerator, anchor_target_plus, delta2bbox, force_fp32, multi_apply, multiclass_nms\n'), ((9172, 9221), 'mmdet.core.fo... |
#!/usr/bin/python
"""A setuptools-based script for distributing and installing mcd."""
# Copyright 2014, 2015, 2016, 2017 <NAME>
# This file is part of mcd.
# See `License` for details of license and warranty.
import os
import numpy as np
from setuptools import setup
from setuptools.extension import Extension
from s... | [
"setuptools.command.sdist.sdist.run",
"numpy.get_include",
"os.path.exists",
"os.path.join"
] | [((657, 678), 'os.path.exists', 'os.path.exists', (['"""dev"""'], {}), "('dev')\n", (671, 678), False, 'import os\n'), ((1123, 1139), 'setuptools.command.sdist.sdist.run', '_sdist.run', (['self'], {}), '(self)\n', (1133, 1139), True, 'from setuptools.command.sdist import sdist as _sdist\n'), ((2052, 2084), 'os.path.joi... |
# Copyright 2013 Viewfinder Inc. All Rights Reserved.
"""Run analysis over all merged user analytics logs.
Computes speed percentiles for full asset scans (only those lasting more than 1s for more accurate numbers).
Automatically finds the list of merged logs in S3. If --start_date=YYYY-MM-DD is specified, only anal... | [
"viewfinder.backend.storage.object_store.ObjectStore.GetInstance",
"collections.defaultdict",
"sys.exc_info",
"viewfinder.backend.base.util.TimestampUTCToISO8601",
"os.path.join",
"viewfinder.backend.base.dotdict.DotDict",
"logging.error",
"json.loads",
"logging.warning",
"collections.Counter",
... | [((1614, 1735), 'tornado.options.define', 'options.define', (['"""start_date"""'], {'default': 'None', 'help': '"""Start date (filename start key). May be overridden by smart_scan."""'}), "('start_date', default=None, help=\n 'Start date (filename start key). May be overridden by smart_scan.')\n", (1628, 1735), Fals... |
"""
SPDX-License-Identifier: Apache-2.0
Copyright (C) 2021, Arm Limited and contributors
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 requ... | [
"numpy.sum",
"numpy.abs",
"numpy.argmax",
"numpy.histogram",
"numpy.mean",
"six.iteritems",
"six.moves.range",
"numpy.std",
"numpy.equal",
"numpy.max",
"numpy.stack",
"numpy.square",
"numpy.min",
"scipy.special.softmax",
"numpy.digitize",
"sys.exit",
"numpy.quantile",
"numpy.log",
... | [((813, 824), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (821, 824), False, 'import sys\n'), ((2927, 2958), 'scipy.special.softmax', 'sc.softmax', (['output_arr'], {'axis': '(-1)'}), '(output_arr, axis=-1)\n', (2937, 2958), True, 'import scipy.special as sc\n'), ((2999, 3027), 'numpy.mean', 'np.mean', (['predictio... |
import os
import sys
sys.path.insert(0, os.path.abspath('./src/'))
def make_test_rgb(saveflag=True, filename='./test/test_image.tif'):
"""
generate known RGB pixel array and output TIFF file
:param saveflag: flag to save output TIFF file, default True
:param filename: path and filename of saved TFF t... | [
"preprocess.nan_upper_bound",
"preprocess.nan_yellow_pixels",
"os.path.abspath",
"os.remove",
"numpy.empty",
"preprocess.read_tiff",
"preprocess.extract_hist",
"numpy.zeros",
"numpy.allclose",
"numpy.ones",
"numpy.isnan",
"numpy.isfinite",
"PIL.Image.fromarray",
"preprocess.rgb_histogram",... | [((40, 65), 'os.path.abspath', 'os.path.abspath', (['"""./src/"""'], {}), "('./src/')\n", (55, 65), False, 'import os\n'), ((444, 479), 'numpy.zeros', 'np.zeros', (['(h, w, 3)'], {'dtype': 'np.uint8'}), '((h, w, 3), dtype=np.uint8)\n', (452, 479), True, 'import numpy as np\n'), ((989, 1017), 'preprocess.read_tiff', 're... |
# Released under The MIT License (MIT)
# http://opensource.org/licenses/MIT
# Copyright (c) 2013-2015 SCoT Development Team
import unittest
import numpy as np
from numpy.testing import assert_allclose
from scot.varbase import VARBase as VAR
from scot.datatools import acm
epsilon = 1e-10
class TestVAR(unittest.Tes... | [
"numpy.random.seed",
"numpy.abs",
"numpy.random.randn",
"scot.varbase.VARBase",
"numpy.asarray",
"numpy.array",
"scot.datatools.acm",
"numpy.dot",
"numpy.testing.assert_allclose",
"numpy.var",
"numpy.all"
] | [((465, 471), 'scot.varbase.VARBase', 'VAR', (['(2)'], {}), '(2)\n', (468, 471), True, 'from scot.varbase import VARBase as VAR\n'), ((491, 545), 'numpy.array', 'np.array', (['[[0.2, 0.1, 0.4, -0.1], [0.3, -0.2, 0.1, 0]]'], {}), '([[0.2, 0.1, 0.4, -0.1], [0.3, -0.2, 0.1, 0]])\n', (499, 545), True, 'import numpy as np\n... |
# -*- coding: utf-8 -*-
# =============================================================================
# Here we will be testing with mixtures of student-t, 1d
# =============================================================================
import sys
sys.path.insert(0,"../../src2")
import math
import functools
impor... | [
"numpy.load",
"numpy.random.seed",
"torch.manual_seed",
"sys.path.insert",
"numpy.exp",
"numpy.log10",
"matplotlib.pyplot.subplots"
] | [((253, 285), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../src2"""'], {}), "(0, '../../src2')\n", (268, 285), False, 'import sys\n'), ((564, 583), 'numpy.random.seed', 'np.random.seed', (['(100)'], {}), '(100)\n', (578, 583), True, 'import numpy as np\n'), ((584, 606), 'torch.manual_seed', 'torch.manual_see... |
# vim: expandtab:ts=4:sw=4
from __future__ import absolute_import
import numpy as np
from linear_assignment import min_marg_matching
import pdb
def get_unmatched(all_idx, matches, i, marginalization=None):
assigned = [match[i] for match in matches]
unmatched = set(all_idx) - set(assigned)
if marginalizati... | [
"linear_assignment.min_marg_matching",
"numpy.sum",
"numpy.argmax"
] | [((3803, 3898), 'linear_assignment.min_marg_matching', 'min_marg_matching', (['self.marginalizations', 'self.confirmed_tracks', 'self.assignment_threshold'], {}), '(self.marginalizations, self.confirmed_tracks, self.\n assignment_threshold)\n', (3820, 3898), False, 'from linear_assignment import min_marg_matching\n'... |
import numpy as np
import torch
import scipy as sp
# integrated gradients
def integrated_gradients(inputs, model, target_label_idx, predict_and_gradients, steps=50, device=None, baseline=None,
path=None):
if device and "cpu" in inputs.device.type:
inputs = inputs.to(device)
if... | [
"numpy.array",
"numpy.transpose",
"torch.rand_like",
"numpy.average"
] | [((867, 892), 'numpy.average', 'np.average', (['grads'], {'axis': '(0)'}), '(grads, axis=0)\n', (877, 892), True, 'import numpy as np\n'), ((909, 943), 'numpy.transpose', 'np.transpose', (['avg_grads', '(1, 2, 0)'], {}), '(avg_grads, (1, 2, 0))\n', (921, 943), True, 'import numpy as np\n'), ((1883, 1913), 'numpy.averag... |
import pytest
import numpy as np
import numpy.testing as nptest
from ellipse import LsqEllipse
def make_dataset(center, width, height, phi, n_points):
"""Generate Elliptical data with noise"""
t = np.linspace(0, 2 * np.pi, n_points)
x = (center[0]
+ width * np.cos(t) * np.cos(phi)
- h... | [
"numpy.testing.assert_almost_equal",
"ellipse.LsqEllipse",
"pytest.raises",
"numpy.sin",
"numpy.linspace",
"numpy.cos",
"pytest.mark.parametrize",
"numpy.testing.assert_array_almost_equal"
] | [((560, 611), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""center"""', '[[1, 1], [0, 1]]'], {}), "('center', [[1, 1], [0, 1]])\n", (583, 611), False, 'import pytest\n'), ((613, 656), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""width"""', '[0.4, 10]'], {}), "('width', [0.4, 10])\n", (636, ... |
from .utils import sigmoid, tanh
import numpy as np
class LSTM:
def __init__(self, input_shape, output_shape):
self.input_shape = input_shape
self.layer_1 = self.Unit(input_shape, output_shape)
def forward(self, x=.34):
print(self.unit(self.cell_state, self.output_gate, x))
class... | [
"numpy.random.uniform",
"numpy.ones_like",
"numpy.transpose",
"numpy.zeros",
"numpy.random.random",
"numpy.dot"
] | [((1357, 1417), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(1)', '(self.hidden_dim, self.input_shape)'], {}), '(0, 1, (self.hidden_dim, self.input_shape))\n', (1374, 1417), True, 'import numpy as np\n'), ((1448, 1507), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(1)', '(self.hidden_dim, self.hidd... |
import os
import sys
import wget
import numpy as np
from numpy import unique
from Bio.SeqIO import parse as parse_fasta
from .geneontology import *
from .consts import *
cafa3_targets_url = 'http://biofunctionprediction.org/cafa-targets/CAFA3_targets.tgz'
cafa3_train_url = 'http://biofunctionprediction.org/cafa-... | [
"os.remove",
"numpy.invert",
"numpy.zeros",
"os.system",
"os.path.exists",
"wget.download",
"numpy.array",
"os.listdir"
] | [((12276, 12299), 'os.listdir', 'os.listdir', (['targets_dir'], {}), '(targets_dir)\n', (12286, 12299), False, 'import os\n'), ((12595, 12618), 'os.listdir', 'os.listdir', (['mapping_dir'], {}), '(mapping_dir)\n', (12605, 12618), False, 'import os\n'), ((13440, 13471), 'wget.download', 'wget.download', (['url'], {'out'... |
# -*- coding: utf-8 -*-
# linear_regression/test_polynomial.py
"""
Created on Thu Jan 25 19:24:00 2018
@author: jercas
"""
import regression
from matplotlib import cm
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import numpy as np
if __name__ == "__main__"... | [
"numpy.matrix",
"matplotlib.pyplot.show",
"numpy.power",
"matplotlib.pyplot.legend",
"numpy.ones",
"regression.bgd",
"matplotlib.pyplot.figure",
"regression.loadDataSet",
"matplotlib.ticker.FormatStrFormatter",
"numpy.linspace",
"regression.hypothesis"
] | [((330, 373), 'regression.loadDataSet', 'regression.loadDataSet', (['"""./temperature.txt"""'], {}), "('./temperature.txt')\n", (352, 373), False, 'import regression\n'), ((511, 555), 'regression.bgd', 'regression.bgd', (['X', 'y', 'rate', 'maxLoop', 'epsilon'], {}), '(X, y, rate, maxLoop, epsilon)\n', (525, 555), Fals... |
from dataclasses import dataclass
from logging import Logger, getLogger
from typing import Dict, Union
import numpy as np
import pandas as pd
from omegaconf import MISSING
from fseval.types import IncompatibilityError, TerminalColor
from .._experiment import Experiment
from ._config import RankAndValidatePipeline
... | [
"pandas.DataFrame",
"fseval.types.TerminalColor.yellow",
"numpy.ndim",
"fseval.types.IncompatibilityError",
"logging.getLogger"
] | [((750, 769), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (759, 769), False, 'from logging import Logger, getLogger\n'), ((2854, 2881), 'pandas.DataFrame', 'pd.DataFrame', (['[scores_dict]'], {}), '([scores_dict])\n', (2866, 2881), True, 'import pandas as pd\n'), ((1006, 1143), 'fseval.types.I... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.