code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import argparse
import csv
import numpy as np
from imbDRL.metrics import classification_metrics
from sklearn.model_selection import train_test_split
from tensorflow.keras import backend
from tensorflow.keras.layers import (Concatenate, Conv2D, Dense, Dropout,
Flatten, Input, MaxPoo... | [
"csv.DictWriter",
"numpy.column_stack",
"numpy.isin",
"tensorflow.keras.utils.plot_model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.metrics.Recall",
"numpy.arange",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Conv2D",
"argparse.ArgumentParser",
"tensorflow.keras.models.Mo... | [((676, 764), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generates tf.dataset based on Path argument."""'}), "(description=\n 'Generates tf.dataset based on Path argument.')\n", (699, 764), False, 'import argparse\n'), ((1143, 1175), 'histology_preprocessing.generate_dataset', 'ge... |
import unittest
import numpy as np
from radbm.utils.torch import torch_cast_cpu
class TorchCast(unittest.TestCase):
def test_torch_cast_cpu(self):
a = np.zeros((4,5), dtype=np.float32)
b = torch_cast_cpu(a)
self.assertTrue((a==b.numpy()).all())
| [
"radbm.utils.torch.torch_cast_cpu",
"numpy.zeros"
] | [((164, 198), 'numpy.zeros', 'np.zeros', (['(4, 5)'], {'dtype': 'np.float32'}), '((4, 5), dtype=np.float32)\n', (172, 198), True, 'import numpy as np\n'), ((210, 227), 'radbm.utils.torch.torch_cast_cpu', 'torch_cast_cpu', (['a'], {}), '(a)\n', (224, 227), False, 'from radbm.utils.torch import torch_cast_cpu\n')] |
import gzip
import pickle
import json
import torch
import numpy as np
import os
from os.path import join
from tqdm import tqdm
from numpy.random import shuffle
from envs import DATASET_FOLDER
IGNORE_INDEX = -100
def get_cached_filename(f_type, config):
assert f_type in ['examples', 'features', '... | [
"gzip.open",
"torch.LongTensor",
"torch.Tensor",
"os.path.join",
"pickle.load",
"torch.from_numpy",
"torch.zeros_like",
"torch.FloatTensor",
"numpy.random.shuffle"
] | [((5897, 5944), 'torch.LongTensor', 'torch.LongTensor', (['self.bsz', 'self.max_seq_length'], {}), '(self.bsz, self.max_seq_length)\n', (5913, 5944), False, 'import torch\n'), ((5969, 6016), 'torch.LongTensor', 'torch.LongTensor', (['self.bsz', 'self.max_seq_length'], {}), '(self.bsz, self.max_seq_length)\n', (5985, 60... |
# Copyright (c) 2021 PaddlePaddle 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 appli... | [
"numpy.abs",
"argparse.ArgumentParser",
"pathlib.Path",
"concurrent.futures.ThreadPoolExecutor",
"logging.warning",
"jsonlines.open",
"librosa.time_to_samples",
"parakeet.data.get_feats.LogMelFBank",
"config.get_cfg_default",
"librosa.get_duration",
"praatio.tgio.openTextgrid",
"operator.itemg... | [((1485, 1515), 'librosa.get_duration', 'librosa.get_duration', (['y'], {'sr': 'sr'}), '(y, sr=sr)\n', (1505, 1515), False, 'import librosa\n'), ((1576, 1607), 'praatio.tgio.openTextgrid', 'tgio.openTextgrid', (['alignment_fp'], {}), '(alignment_fp)\n', (1593, 1607), False, 'from praatio import tgio\n'), ((2260, 2315),... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
import argparse
import os
import numpy as np
import math
from collections import defaultdict, Counter
import pdb
"""
This script processes an input text file to produce data in binary
format to be used with the autoencoder (bin... | [
"os.path.exists",
"numpy.savez",
"numpy.random.get_state",
"numpy.random.set_state",
"math.ceil",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.join",
"collections.Counter",
"numpy.array",
"numpy.empty",
"collections.defaultdict",
"numpy.full",
"numpy.random.shuffle"
] | [((689, 698), 'collections.Counter', 'Counter', ([], {}), '()\n', (696, 698), False, 'from collections import defaultdict, Counter\n'), ((718, 727), 'collections.Counter', 'Counter', ([], {}), '()\n', (725, 727), False, 'from collections import defaultdict, Counter\n'), ((1636, 1668), 'collections.defaultdict', 'defaul... |
from dataclasses import dataclass
import random
from typing_extensions import Self
import numpy as np
from nn.layers.base import BaseLayer
@dataclass()
class Dense(BaseLayer):
"""A layer, where each input is connected to all outputs."""
weights: np.ndarray
biases: np.ndarray
def __init__(self, inpu... | [
"numpy.random.random",
"dataclasses.dataclass",
"numpy.ndindex",
"numpy.dot",
"numpy.random.randn"
] | [((143, 154), 'dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (152, 154), False, 'from dataclasses import dataclass\n'), ((503, 544), 'numpy.random.randn', 'np.random.randn', (['neuron_count', 'input_size'], {}), '(neuron_count, input_size)\n', (518, 544), True, 'import numpy as np\n'), ((567, 599), 'numpy.rand... |
import sys
import cv2
import numpy as np
import torch
from models import Resnet18_gray
def detect_keypoints(img_size, save=False):
# capture image from camera
cap = cv2.VideoCapture(-1)
width = int(cap.get(3))
height = int(cap.get(4))
fps = int(cap.get(5))
## load models
# face detecto... | [
"models.Resnet18_gray",
"cv2.flip",
"cv2.line",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.VideoWriter_fourcc",
"cv2.CascadeClassifier",
"cv2.resize",
"cv2.waitKey",
"numpy.round",
"torch.device"
] | [((178, 198), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(-1)'], {}), '(-1)\n', (194, 198), False, 'import cv2\n'), ((341, 429), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""detector_architectures/haarcascade_frontalface_default.xml"""'], {}), "(\n 'detector_architectures/haarcascade_frontalface_default.x... |
#!/usr/bin/env python
# computeKMeans.py: python code to compute kmeans clusters from
# tshirt point cloud data
# Requirements: baxter SDK installed and required libraries installed
# Author: <NAME>
# Date: 2015/10/18
# Source: sklearn tutorial on kmeans clustering
# import basic linear algebra and plotting libraries... | [
"sklearn.cluster.KMeans",
"argparse.ArgumentParser",
"numpy.array",
"numpy.empty",
"numpy.savetxt"
] | [((685, 758), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argFmt', 'description': 'main.__doc__'}), '(formatter_class=argFmt, description=main.__doc__)\n', (708, 758), False, 'import argparse\n'), ((1454, 1541), 'sklearn.cluster.KMeans', 'KMeans', ([], {'n_clusters': 'clusterNum', 'i... |
# Copyright (c) 2018 PaddlePaddle 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 app... | [
"numpy.allclose",
"paddle.fluid.data",
"numpy.random.rand",
"paddle.allclose",
"paddle.enable_static",
"numpy.array",
"paddle.disable_static",
"paddle.to_tensor",
"unittest.main",
"paddle.static.Program"
] | [((4519, 4534), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4532, 4534), False, 'import unittest\n'), ((2567, 2590), 'paddle.disable_static', 'paddle.disable_static', ([], {}), '()\n', (2588, 2590), False, 'import paddle\n'), ((2608, 2630), 'numpy.random.rand', 'np.random.rand', (['(10)', '(10)'], {}), '(10, 1... |
from rdkit import Chem
from rdkit.Chem import AllChem, Descriptors
import numpy as np
from rdkit.ML.Descriptors import MoleculeDescriptors
from sklearn import preprocessing
import random
from hyperopt import tpe, fmin, Trials
from sklearn.metrics import average_precision_score, roc_auc_score
from sklearn.model_selectio... | [
"hyperopt.fmin",
"numpy.mean",
"random.sample",
"sklearn.metrics.average_precision_score",
"rdkit.Chem.AllChem.GetMorganFingerprintAsBitVect",
"sklearn.metrics.roc_auc_score",
"sklearn.model_selection.StratifiedKFold",
"numpy.array",
"datetime.datetime.now",
"imxgboost.imbalance_xgb.imbalance_xgbo... | [((456, 514), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'RuntimeWarning'}), "('ignore', category=RuntimeWarning)\n", (479, 514), False, 'import warnings\n'), ((830, 864), 'numpy.array', 'np.array', (['Morgan'], {'dtype': 'np.float32'}), '(Morgan, dtype=np.float32)\n', (838, 8... |
import numpy as np
import pygame
import sys
import os
from collisionutils import *
from colors import *
from utilutils import *
from chassis import AutoPathFollower, RobotDrive
import initObstacles
os.chdir(os.path.dirname(os.path.realpath(__file__)))
size = (1340, 684)
def allDisplay(obstacles, screen):
display... | [
"numpy.sqrt",
"pygame.init",
"pygame.quit",
"chassis.AutoPathFollower",
"pygame.draw.line",
"pygame.display.set_mode",
"pygame.event.get",
"pygame.display.flip",
"pygame.draw.polygon",
"numpy.random.rand",
"os.path.realpath",
"pygame.key.get_pressed",
"pygame.draw.rect",
"chassis.RobotDriv... | [((3155, 3168), 'pygame.init', 'pygame.init', ([], {}), '()\n', (3166, 3168), False, 'import pygame\n'), ((3178, 3207), 'pygame.display.set_mode', 'pygame.display.set_mode', (['size'], {}), '(size)\n', (3201, 3207), False, 'import pygame\n'), ((3235, 3254), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (3... |
#!/usr/bin/env python3
import sys
import argparse
import numpy as np
from qcore.timeseries import BBSeis
from qcore.timeseries import HFSeis
# the ratio of allowed zero's before being flagged as failed, 0.01 = 1%
ZERO_COUNT_THRESHOLD = 0.01
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parse... | [
"numpy.trim_zeros",
"sys.exit",
"argparse.ArgumentParser",
"numpy.count_nonzero",
"numpy.min"
] | [((285, 310), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (308, 310), False, 'import argparse\n'), ((3419, 3430), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (3427, 3430), False, 'import sys\n'), ((749, 760), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (757, 760), False, 'import sys\... |
import numpy as np
import matplotlib.pyplot as plt
def insert_zeros(trace, tt=None):
"""Insert zero locations in data trace and tt vector based on linear fit"""
if tt is None:
tt = np.arange(len(trace))
# Find zeros
zc_idx = np.where(np.diff(np.signbit(trace)))[0]
x1 = tt[zc_idx]
x2... | [
"numpy.signbit",
"matplotlib.pyplot.gca",
"numpy.diff",
"numpy.array",
"numpy.split",
"numpy.zeros",
"numpy.std",
"numpy.random.randn",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((485, 509), 'numpy.split', 'np.split', (['tt', '(zc_idx + 1)'], {}), '(tt, zc_idx + 1)\n', (493, 509), True, 'import numpy as np\n'), ((528, 555), 'numpy.split', 'np.split', (['trace', '(zc_idx + 1)'], {}), '(trace, zc_idx + 1)\n', (536, 555), True, 'import numpy as np\n'), ((3615, 3624), 'matplotlib.pyplot.gca', 'pl... |
import streamlit as st
from streamlit_agraph import agraph, Node, Edge, Config
import pandas as pd
import numpy as np
@st.cache(suppress_st_warning=True)
def get_graph(file):
nodes = []
edges = []
df = pd.read_csv(file)
for x in np.unique(df[["Source", "Target"]].values):
nodes.append(Node(id=... | [
"streamlit_agraph.Node",
"streamlit.cache",
"numpy.unique",
"pandas.read_csv",
"streamlit_agraph.agraph",
"streamlit_agraph.Config",
"streamlit_agraph.Edge"
] | [((120, 154), 'streamlit.cache', 'st.cache', ([], {'suppress_st_warning': '(True)'}), '(suppress_st_warning=True)\n', (128, 154), True, 'import streamlit as st\n'), ((216, 233), 'pandas.read_csv', 'pd.read_csv', (['file'], {}), '(file)\n', (227, 233), True, 'import pandas as pd\n'), ((247, 289), 'numpy.unique', 'np.uni... |
import pandas as pd
import joblib
import numpy as np
import argparse
import os
# Inputs:
# --sct_train_file: Pickle file that was holds the a list of the dataset used for training.
# Can be downloaded at: https://github.com/sct-data/deepseg_sc_models
# train_valid_test column: 1 fo... | [
"pandas.read_pickle",
"argparse.ArgumentParser",
"numpy.in1d",
"pandas.merge",
"os.path.join"
] | [((1937, 1969), 'pandas.read_pickle', 'pd.read_pickle', (['dataset_sct_file'], {}), '(dataset_sct_file)\n', (1951, 1969), True, 'import pandas as pd\n'), ((3618, 3643), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3641, 3643), False, 'import argparse\n'), ((1159, 1214), 'os.path.join', 'os.p... |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | [
"numpy.reshape",
"numpy.testing.assert_equal",
"qf_lib.backtesting.events.time_event.regular_time_event.market_close_event.MarketCloseEvent.trigger_time",
"qf_lib.backtesting.events.time_event.regular_time_event.market_open_event.MarketOpenEvent.trigger_time",
"numpy.testing.assert_almost_equal",
"qf_lib.... | [((1505, 1563), 'qf_lib.common.utils.dateutils.string_to_date.str_to_date', 'str_to_date', (['"""2014-12-25 00:00:00.00"""', 'DateFormat.FULL_ISO'], {}), "('2014-12-25 00:00:00.00', DateFormat.FULL_ISO)\n", (1516, 1563), False, 'from qf_lib.common.utils.dateutils.string_to_date import str_to_date\n'), ((1584, 1642), 'q... |
import numpy as np
import scipy
from scipy import stats
from networkx.algorithms import bipartite
import scipy.linalg as la
from numpy.linalg import matrix_rank, norm
import community
from community import community_louvain
import pandas as pd
import copy
def ger_matrix_from_poly(model, dataset, poly_m):
# L_m... | [
"networkx.algorithms.bipartite.average_clustering",
"numpy.multiply",
"community.community_louvain.best_partition",
"numpy.unique",
"community.modularity",
"pandas.DataFrame",
"numpy.where",
"numpy.linalg.norm",
"numpy.argmax",
"numpy.array",
"numpy.zeros",
"copy.deepcopy",
"numpy.linalg.svd... | [((530, 547), 'numpy.unique', 'np.unique', (['poly_m'], {}), '(poly_m)\n', (539, 547), True, 'import numpy as np\n'), ((2259, 2284), 'numpy.argmax', 'np.argmax', (['preds'], {'axis': '(-1)'}), '(preds, axis=-1)\n', (2268, 2284), True, 'import numpy as np\n'), ((3189, 3244), 'numpy.linalg.svd', 'np.linalg.svd', (['m'], ... |
from distutils.core import setup
from Cython.Build import cythonize
import numpy
setup(ext_modules = cythonize('chimeramate_main.pyx'),include_dirs=[numpy.get_include()])
| [
"Cython.Build.cythonize",
"numpy.get_include"
] | [((102, 135), 'Cython.Build.cythonize', 'cythonize', (['"""chimeramate_main.pyx"""'], {}), "('chimeramate_main.pyx')\n", (111, 135), False, 'from Cython.Build import cythonize\n'), ((150, 169), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (167, 169), False, 'import numpy\n')] |
#!/usr/bin/python3
from src import storage_connection as sc
import numpy as np
"""
Last edited by : Shawn
Last edited time : 29/11/2021
Version Status: dev
TO DO:
The functions in this file are for reading and preparing the inputs for the NN.
Required: Path to NN_input.txt
Path to vector.csv
"""
def get_... | [
"numpy.array",
"src.storage_connection.storage_connection_sequence",
"src.storage_connection.storage_connection_embedding"
] | [((587, 659), 'src.storage_connection.storage_connection_embedding', 'sc.storage_connection_embedding', (['credential_path', '"""pca_lookup_table.csv"""'], {}), "(credential_path, 'pca_lookup_table.csv')\n", (618, 659), True, 'from src import storage_connection as sc\n'), ((708, 771), 'src.storage_connection.storage_co... |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import glob, csv, librosa, os, subprocess, time
import numpy as np
import pandas as pd
import data_vn
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
__author__ = '<EMAIL>'
# data ... | [
"os.path.exists",
"data_vn.str2index",
"os.makedirs",
"csv.writer",
"librosa.feature.mfcc",
"pandas.read_table",
"data_vn.index2str",
"numpy.save",
"librosa.load"
] | [((516, 551), 'csv.writer', 'csv.writer', (['csv_file'], {'delimiter': '""","""'}), "(csv_file, delimiter=',')\n", (526, 551), False, 'import glob, csv, librosa, os, subprocess, time\n'), ((646, 737), 'pandas.read_table', 'pd.read_table', (['content_filename'], {'usecols': "['ID']", 'index_col': '(False)', 'delim_white... |
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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... | [
"numpy.clip",
"PIL.Image.fromarray",
"random.randint",
"random.shuffle",
"tools.infer.utility.get_rotate_crop_image",
"numpy.array",
"numpy.deg2rad",
"numpy.random.randint",
"shapely.geometry.Polygon",
"numpy.cos",
"cv2.cvtColor",
"numpy.sin",
"cv2.getRotationMatrix2D",
"ppocr.data.imaug.r... | [((5747, 5764), 'numpy.deg2rad', 'np.deg2rad', (['angle'], {}), '(angle)\n', (5757, 5764), True, 'import numpy as np\n'), ((5901, 5960), 'cv2.getRotationMatrix2D', 'cv2.getRotationMatrix2D', (['(nw * 0.5, nh * 0.5)', 'angle', 'scale'], {}), '((nw * 0.5, nh * 0.5), angle, scale)\n', (5924, 5960), False, 'import cv2\n'),... |
#%%
import random
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.keras as keras
import seaborn as sns
import numpy as np
import pickle
from sklearn.model_selection import StratifiedKFold
from math import log2, ceil
import sys
sys.path.append("../src/")
from lifelong_dnn import LifeLongDN... | [
"numpy.eye",
"matplotlib.pyplot.savefig",
"numpy.ones",
"seaborn.color_palette",
"numpy.sin",
"pickle.load",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.zeros",
"numpy.random.uniform",
"numpy.random.seed",
"numpy.concatenate",
"matplotlib.pyplot.tight_layout",
"numpy.cos",
"numpy.c... | [((258, 284), 'sys.path.append', 'sys.path.append', (['"""../src/"""'], {}), "('../src/')\n", (273, 284), False, 'import sys\n'), ((2427, 2463), 'numpy.concatenate', 'np.concatenate', (['(n1s, n2s + n1s[-1])'], {}), '((n1s, n2s + n1s[-1]))\n', (2441, 2463), True, 'import numpy as np\n'), ((2598, 2635), 'seaborn.color_p... |
"""(Non-central) F distribution."""
import numpy
from scipy import special
from ..baseclass import Dist
from ..operators.addition import Add
class f(Dist):
"""F distribution."""
def __init__(self, dfn, dfd, nc):
Dist.__init__(self, dfn=dfn, dfd=dfd, nc=nc)
def _pdf(self, x, dfn, dfd, nc):
... | [
"scipy.special.ncfdtr",
"scipy.special.assoc_laguerre",
"scipy.special.beta",
"numpy.exp",
"scipy.special.ncfdtri",
"scipy.special.gammaln"
] | [((451, 483), 'scipy.special.gammaln', 'special.gammaln', (['((n1 + n2) / 2.0)'], {}), '((n1 + n2) / 2.0)\n', (466, 483), False, 'from scipy import special\n'), ((492, 507), 'numpy.exp', 'numpy.exp', (['term'], {}), '(term)\n', (501, 507), False, 'import numpy\n'), ((616, 704), 'scipy.special.assoc_laguerre', 'special.... |
from unittest import TestCase, mock
import layers
import numpy as np
import pytest
class TestPoolForward(TestCase):
def test_max(self):
pool = layers.pool.Pool(
size=2,
stride=2,
operation=np.max,
)
data = np.zeros((4, 4, 3))
data[:,:,0] = np.... | [
"numpy.array",
"numpy.zeros",
"layers.pool.Pool"
] | [((159, 211), 'layers.pool.Pool', 'layers.pool.Pool', ([], {'size': '(2)', 'stride': '(2)', 'operation': 'np.max'}), '(size=2, stride=2, operation=np.max)\n', (175, 211), False, 'import layers\n'), ((275, 294), 'numpy.zeros', 'np.zeros', (['(4, 4, 3)'], {}), '((4, 4, 3))\n', (283, 294), True, 'import numpy as np\n'), (... |
from copy import deepcopy
import numpy as np
from numpy.lib.npyio import _savez
from matplotlib.collections import LineCollection
import matplotlib.pyplot as plt
from seispy.trace import Trace, FourierDomainTrace
from seispy.errors import EmptyStreamError, DataTypeError, \
SamplingError, SamplingRateError, NptsErro... | [
"numpy.random.rand",
"numpy.hstack",
"numpy.column_stack",
"matplotlib.collections.LineCollection",
"numpy.argsort",
"numpy.array",
"copy.deepcopy",
"seispy.errors.EmptyStreamError",
"numpy.arange",
"obspy.core.stream.Stream",
"numpy.lib.npyio._savez",
"numpy.asarray",
"numpy.max",
"numpy.... | [((18253, 18263), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (18261, 18263), True, 'import matplotlib.pyplot as plt\n'), ((1020, 1034), 'copy.deepcopy', 'deepcopy', (['self'], {}), '(self)\n', (1028, 1034), False, 'from copy import deepcopy\n'), ((2048, 2073), 'obspy.core.stream.Stream', 'ObspyStream', (['... |
import os
import sys
import _pickle as pickle
import numpy as np
import tensorflow as tf
import chess.pgn
import pgn_tensors_utils
import bz2
def read_data(data_path, num_valids=20000):
print("-" * 80)
print("Reading data")
nb_games = 200
#nb_games = sys.maxsize
boards, labels, results = {}, {}, {}
train... | [
"numpy.reshape",
"numpy.asarray",
"os.path.join",
"os.path.isfile",
"numpy.concatenate",
"pgn_tensors_utils.tensors_labels_from_games",
"numpy.transpose"
] | [((1321, 1345), 'os.path.isfile', 'os.path.isfile', (['bz2_path'], {}), '(bz2_path)\n', (1335, 1345), False, 'import os\n'), ((1652, 1676), 'os.path.isfile', 'os.path.isfile', (['pgn_path'], {}), '(pgn_path)\n', (1666, 1676), False, 'import os\n'), ((4081, 4100), 'numpy.asarray', 'np.asarray', (['tensors'], {}), '(tens... |
import numpy as np
from toolkit.methods.pnpl import CvxPnPL, DLT, EPnPL, OPnPL
from toolkit.suites import parse_arguments, PnPLReal
from toolkit.datasets import Linemod, Occlusion
# reproducibility is a great thing
np.random.seed(0)
np.random.seed(42)
# parse console arguments
args = parse_arguments()
# Just a lo... | [
"toolkit.suites.PnPLReal.load",
"toolkit.datasets.Linemod",
"numpy.random.seed",
"toolkit.suites.parse_arguments",
"toolkit.suites.PnPLReal",
"toolkit.datasets.Occlusion"
] | [((218, 235), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (232, 235), True, 'import numpy as np\n'), ((236, 254), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (250, 254), True, 'import numpy as np\n'), ((290, 307), 'toolkit.suites.parse_arguments', 'parse_arguments', ([], {}), '()... |
import pandas as pd
import numpy as np
import time
from datetime import timedelta, date, datetime
class TransformData(object):
def __init__(self):
pass
# get data and preprocessing
def format_timestamp(self, utc_datetime):
now_timestamp = time.time()
offset = datetime.fromtimestamp... | [
"datetime.datetime.utcfromtimestamp",
"datetime.datetime.fromtimestamp",
"numpy.around",
"time.time",
"pandas.to_datetime"
] | [((269, 280), 'time.time', 'time.time', ([], {}), '()\n', (278, 280), False, 'import time\n'), ((298, 335), 'datetime.datetime.fromtimestamp', 'datetime.fromtimestamp', (['now_timestamp'], {}), '(now_timestamp)\n', (320, 335), False, 'from datetime import timedelta, date, datetime\n'), ((338, 378), 'datetime.datetime.u... |
'''
@Author: <NAME>
@Github: https://github.com/wsustcid
@Version: 1.0.0
@Date: 2020-09-11 23:42:23
@LastEditTime: 2020-10-13 22:32:20
'''
import os
import sys
import argparse
from datetime import datetime
import time
from tqdm import tqdm
import time
import numpy as np
import tensorflow as tf
base_dir = os.path.dir... | [
"numpy.hstack",
"sys.path.append",
"data_gen.DataLoader",
"tensorflow.Graph",
"argparse.ArgumentParser",
"tensorflow.placeholder",
"tensorflow.Session",
"numpy.concatenate",
"tensorflow.ConfigProto",
"numpy.square",
"models.flowdrivenet.FlowDriveNet",
"time.time",
"tensorflow.minimum",
"ut... | [((352, 377), 'sys.path.append', 'sys.path.append', (['base_dir'], {}), '(base_dir)\n', (367, 377), False, 'import sys\n'), ((503, 528), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (526, 528), False, 'import argparse\n'), ((2181, 2226), 'os.path.join', 'os.path.join', (['base_dir', '"""logs"... |
import numpy as np
fwhm_m = 2 * np.sqrt(2 * np.log(2))
def fwhm(sigma):
"""
Get full width at half maximum (FWHM) for a provided sigma /
standard deviation, assuming a Gaussian distribution.
"""
return fwhm_m * sigma
def gaussian(x_mean, x_std, shape):
return np.random.normal(x_mean, x_... | [
"numpy.random.normal",
"numpy.random.chisquare",
"numpy.log"
] | [((293, 331), 'numpy.random.normal', 'np.random.normal', (['x_mean', 'x_std', 'shape'], {}), '(x_mean, x_std, shape)\n', (309, 331), True, 'import numpy as np\n'), ((45, 54), 'numpy.log', 'np.log', (['(2)'], {}), '(2)\n', (51, 54), True, 'import numpy as np\n'), ((909, 952), 'numpy.random.chisquare', 'np.random.chisqua... |
import time
import numpy as np
from sklearn.preprocessing import OneHotEncoder, MinMaxScaler
from sklearn.gaussian_process import GaussianProcess
from sklearn.linear_model import Ridge, Lasso
from sklearn.svm import NuSVR, SVR
import scipy
from util import Logger, get_rmse
class Linear():
def __init_... | [
"sklearn.linear_model.Lasso",
"numpy.hstack",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.linear_model.Ridge",
"numpy.array",
"scipy.sparse.hstack",
"numpy.vstack",
"sklearn.svm.NuSVR",
"sklearn.svm.SVR",
"sklearn.preprocessing.MinMaxScaler"
] | [((1141, 1189), 'numpy.hstack', 'np.hstack', (['(m[:, 23:24], m[:, 37:38], m[:, 52:])'], {}), '((m[:, 23:24], m[:, 37:38], m[:, 52:]))\n', (1150, 1189), True, 'import numpy as np\n'), ((1474, 1491), 'numpy.array', 'np.array', (['train_X'], {}), '(train_X)\n', (1482, 1491), True, 'import numpy as np\n'), ((1516, 1533), ... |
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import glob
import sys
import matplotlib.pyplot as plt
import pysam
import collections
import numpy as np
import os
OUTPUT_LOG_FILE_NAME = None
HP_TAG = "HP"
UNCLASSIFIED = 'u'
IN_CIS = 'c'
IN_TRANS = 't'
UNKNOWN = 'k'
def parse_args(args =... | [
"numpy.mean",
"numpy.median",
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"matplotlib.pyplot.close",
"collections.defaultdict",
"os.path.basename",
"numpy.std",
"matplotlib.pyplot.cm.get_cmap",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((341, 462), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Compares phasing for haplotagged reads. Calculates local accuracy and switch errors"""'], {}), "(\n 'Compares phasing for haplotagged reads. Calculates local accuracy and switch errors'\n )\n", (364, 462), False, 'import argparse\n'), ((4... |
from sklearn.ensemble import RandomForestRegressor
from sklearn.datasets import make_regression
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
import numpy as np, tensorflow as tf
from sklearn.preprocessing import OneHotEncoder
impor... | [
"sklearn.model_selection.GridSearchCV",
"pandas.read_csv",
"numpy.array",
"copy.deepcopy",
"xgboost.sklearn.XGBRegressor",
"sklearn.gaussian_process.GaussianProcessRegressor",
"sklearn.ensemble.RandomForestRegressor",
"numpy.asarray",
"numpy.diff",
"numpy.concatenate",
"pyflux.ARIMAX",
"pandas... | [((3779, 3809), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.float32'}), '([], dtype=np.float32)\n', (3787, 3809), True, 'import numpy as np, tensorflow as tf\n'), ((3833, 3863), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.float32'}), '([], dtype=np.float32)\n', (3841, 3863), True, 'import numpy as np, tenso... |
import os, sys
def _assert_file_path(file_path):
assert os.path.isfile(file_path), "no such file: {}".format(file_path)
try:
import numpy as np
import torch
# =============================================
# Bokeh server - main runnable script
# =============================================
... | [
"bokeh.layouts.column",
"bokeh.layouts.row",
"multimodal_affinities.bokeh_server.visualization_widget.VisualizationWidget",
"multimodal_affinities.bokeh_server.bokeh_logger.BokehLogger",
"bokeh.models.widgets.Button",
"bokeh.models.widgets.CheckboxGroup",
"multimodal_affinities.pipeline.algorithm_api.Co... | [((61, 86), 'os.path.isfile', 'os.path.isfile', (['file_path'], {}), '(file_path)\n', (75, 86), False, 'import os, sys\n'), ((402, 426), 'sys.path.append', 'sys.path.append', (['SRC_DIR'], {}), '(SRC_DIR)\n', (417, 426), False, 'import os, sys\n'), ((682, 703), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "... |
import pytest
import numpy as np
from engine.base_classes import Location, AbsLoc, RelLoc
@pytest.fixture(params=[
[1, 2], [[2, 3]], (3, 3), [(3, 4)], [(3, 3), (4, 4)],
np.random.randint(0, 10, (5, 2))])
def coord2d(request):
return request.param
@pytest.fixture
def loc2d(coord2d):
return Location(c... | [
"numpy.ones",
"engine.base_classes.Location",
"numpy.array",
"numpy.random.randint",
"pytest.raises",
"pytest.fixture",
"engine.base_classes.Location.intersect",
"engine.base_classes.Location.intersect_mask"
] | [((331, 369), 'pytest.fixture', 'pytest.fixture', ([], {'params': '[1, 2, 3, 4, 5]'}), '(params=[1, 2, 3, 4, 5])\n', (345, 369), False, 'import pytest\n'), ((310, 327), 'engine.base_classes.Location', 'Location', (['coord2d'], {}), '(coord2d)\n', (318, 327), False, 'from engine.base_classes import Location, AbsLoc, Rel... |
# coding: utf-8
# import networkx as nx
# import matplotlib.pyplot as plt
# import operator
# from collections import defaultdict
# from collections import Counter
# from collections import deque
# from functools import reduce
# from math import log
# from itertools import combinations, permutations, product
import pic... | [
"timeit.default_timer",
"numpy.asarray",
"numpy.argmax"
] | [((2778, 2785), 'timeit.default_timer', 'timer', ([], {}), '()\n', (2783, 2785), True, 'from timeit import default_timer as timer\n'), ((2835, 2842), 'timeit.default_timer', 'timer', ([], {}), '()\n', (2840, 2842), True, 'from timeit import default_timer as timer\n'), ((531, 556), 'numpy.asarray', 'np.asarray', (['ii']... |
import os
import numpy as np
import matplotlib.pyplot as plt
from . import helper_generic as hlp
from . import helper_site_response as sr
from . import helper_signal_processing as sig
from PySeismoSoil.class_frequency_spectrum import Frequency_Spectrum as FS
from PySeismoSoil.class_Vs_profile import Vs_Profile
class... | [
"numpy.mean",
"numpy.abs",
"matplotlib.pyplot.plot",
"numpy.column_stack",
"os.path.split",
"numpy.linspace",
"numpy.zeros",
"matplotlib.pyplot.figure",
"PySeismoSoil.class_frequency_spectrum.Frequency_Spectrum",
"numpy.savetxt",
"matplotlib.pyplot.axes"
] | [((4967, 5023), 'numpy.linspace', 'np.linspace', (['(0)', '(self.dt * (self.npts - 1))'], {'num': 'self.npts'}), '(0, self.dt * (self.npts - 1), num=self.npts)\n', (4978, 5023), True, 'import numpy as np\n'), ((7482, 7487), 'PySeismoSoil.class_frequency_spectrum.Frequency_Spectrum', 'FS', (['x'], {}), '(x)\n', (7484, 7... |
#!/usr/bin/python3
# Copyright 2017 <NAME>. All Rights Reserved.
#
# This file is part of Bonnet.
#
# Bonnet is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | [
"cv2.randn",
"cv2.warpAffine",
"cv2.getRotationMatrix2D",
"cv2.flip",
"cv2.bitwise_and",
"numpy.zeros",
"cv2.getAffineTransform",
"numpy.full",
"cv2.resize",
"numpy.float32"
] | [((2952, 3009), 'cv2.resize', 'cv2.resize', (['img', '(cols, new_rows)'], {'interpolation': 'interpol'}), '(img, (cols, new_rows), interpolation=interpol)\n', (2962, 3009), False, 'import cv2\n'), ((3170, 3239), 'cv2.resize', 'cv2.resize', (['resized_img', '(new_cols, new_rows)'], {'interpolation': 'interpol'}), '(resi... |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 08 2020
@author: Akash
"""
#%%
# importing required libraries
import argparse
import os
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
import scipy.io
import scipy.misc
import numpy as np
import pandas as pd
import PIL
import cv2... | [
"yolo_utils.preprocess_image",
"tensorflow.boolean_mask",
"keras.backend.learning_phase",
"cv2.imshow",
"yolo_utils.draw_boxes",
"cv2.destroyAllWindows",
"tensorflow.variables_initializer",
"yolo_utils.generate_colors",
"numpy.multiply",
"yolo_utils.read_anchors",
"keras.backend.max",
"keras.b... | [((6873, 6888), 'keras.backend.get_session', 'K.get_session', ([], {}), '()\n', (6886, 6888), True, 'from keras import backend as K\n'), ((6960, 7003), 'yolo_utils.read_classes', 'read_classes', (['"""model_data/coco_classes.txt"""'], {}), "('model_data/coco_classes.txt')\n", (6972, 7003), False, 'from yolo_utils impor... |
# Adapted from https://github.com/lengstrom/fast-style-transfer/blob/master/evaluate.py
from __future__ import print_function,division
import argparse
import sys
import os, random, subprocess, shutil, time
import numpy as np
import json
import scipy
from utils import preserve_colors_np
from utils import get_files, get... | [
"numpy.hstack",
"utils.preserve_colors_np",
"scipy.misc.imresize",
"os.path.exists",
"os.listdir",
"utils.resize_to",
"argparse.ArgumentParser",
"os.path.isdir",
"utils.save_img",
"random.randint",
"wct.WCT",
"os.path.splitext",
"utils.get_img",
"os.path.isfile",
"utils.get_files",
"ut... | [((462, 487), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (485, 487), False, 'import argparse\n'), ((428, 452), 'random.randint', 'random.randint', (['(0)', '(99999)'], {}), '(0, 99999)\n', (442, 452), False, 'import os, random, subprocess, shutil, time\n'), ((2676, 2854), 'wct.WCT', 'WCT', ... |
import tensorflow as tf
import numpy as np
import corpus_handel
import json
#Corpus builder
#=====================================================
new_question = input("Ask a question: ")
new_question = new_question.strip()
new_question = corpus_handel.clean_str(new_question)
new_question = new_question.split(" ")
se... | [
"tensorflow.Graph",
"tensorflow.ConfigProto",
"corpus_handel.clean_str",
"corpus_handel.load_data_and_labels",
"corpus_handel.build_vocab",
"tensorflow.Session",
"numpy.array",
"corpus_handel.batch_iter",
"corpus_handel.pad_sentences",
"numpy.concatenate",
"tensorflow.train.latest_checkpoint",
... | [((239, 276), 'corpus_handel.clean_str', 'corpus_handel.clean_str', (['new_question'], {}), '(new_question)\n', (262, 276), False, 'import corpus_handel\n'), ((336, 372), 'corpus_handel.load_data_and_labels', 'corpus_handel.load_data_and_labels', ([], {}), '()\n', (370, 372), False, 'import corpus_handel\n'), ((534, 57... |
"""
Copyright 2020 The OneFlow 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 applicable law or agr... | [
"traceback.format_stack",
"numpy.copy",
"oneflow.python.framework.c_api_util.JobBuildAndInferCtx_MirroredBlobGetSubLbi",
"oneflow.python.framework.compile_context.CurJobAddMirroredOp",
"oneflow_api.distribute.auto",
"oneflow.python.framework.compile_context.CurJobAddConsistentOp",
"functools.reduce",
... | [((13187, 13219), 'oneflow.python.oneflow_export.oneflow_export', 'oneflow_export', (['"""FixedTensorDef"""'], {}), "('FixedTensorDef')\n", (13201, 13219), False, 'from oneflow.python.oneflow_export import oneflow_export\n'), ((13988, 14023), 'oneflow.python.oneflow_export.oneflow_export', 'oneflow_export', (['"""Mirro... |
import numpy as np
import tensorflow as tf
import gym
from atari_wrappers import wrap_deepmind
from ppo import PPO, DEFAULT_LOGDIR
def ortho_init(scale=1.0):
# (copied from OpenAI baselines)
def _ortho_init(shape, dtype, partition_info=None):
# lasagne ortho init for tf
shape = tuple(shape)
... | [
"numpy.random.normal",
"numpy.prod",
"tensorflow.equal",
"numpy.sqrt",
"tensorflow.layers.flatten",
"argparse.ArgumentParser",
"atari_wrappers.wrap_deepmind",
"json.load",
"tensorflow.name_scope",
"numpy.linalg.svd",
"tensorflow.reduce_mean",
"tensorflow.cast",
"gym.make"
] | [((3395, 3420), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3418, 3420), False, 'import argparse\n'), ((546, 584), 'numpy.random.normal', 'np.random.normal', (['(0.0)', '(1.0)', 'flat_shape'], {}), '(0.0, 1.0, flat_shape)\n', (562, 584), True, 'import numpy as np\n'), ((603, 640), 'numpy.li... |
import numpy as np
import matplotlib.pyplot as plt
import skimage
from skimage import filters
import skimage.io
from skimage.color import rgb2gray
from scipy.signal import convolve2d
def grad_energy(img, sigma = 3):
"""
Compute the gradient magnitude of an image by doing
1D convolutions with the derivativ... | [
"matplotlib.pyplot.imshow",
"scipy.signal.convolve2d",
"skimage.color.rgb2gray",
"numpy.sqrt",
"numpy.ones",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"numpy.exp",
"numpy.linspace",
"numpy.zeros",
"skimage.io.imread",
"skimage.io.imsave",
"matplotlib.pyplot.figure",
"numpy.min",
... | [((5017, 5053), 'skimage.io.imsave', 'skimage.io.imsave', (['"""Result.png"""', 'img'], {}), "('Result.png', img)\n", (5034, 5053), False, 'import skimage\n'), ((559, 572), 'skimage.color.rgb2gray', 'rgb2gray', (['img'], {}), '(img)\n', (567, 572), False, 'from skimage.color import rgb2gray\n'), ((604, 641), 'numpy.lin... |
import numpy as np
from PIL import Image
from src.neural_networks.art_fuzzy import ARTFUZZY
from src.utils.functions import *
import os
path = os.getcwd()
circ_imgs_paths = path+"/imgs/Retangulo10x10/"
rect_imgs_paths = path+"/imgs/Circulo10x10/"
list_circ_imgs = os.listdir(circ_imgs_paths)
list_rect... | [
"numpy.array",
"src.neural_networks.art_fuzzy.ARTFUZZY",
"os.listdir",
"os.getcwd"
] | [((157, 168), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (166, 168), False, 'import os\n'), ((283, 310), 'os.listdir', 'os.listdir', (['circ_imgs_paths'], {}), '(circ_imgs_paths)\n', (293, 310), False, 'import os\n'), ((330, 357), 'os.listdir', 'os.listdir', (['rect_imgs_paths'], {}), '(rect_imgs_paths)\n', (340, 357)... |
# -*- coding: utf-8 -*-
"""
This module contains functions related to Hertz contact theory. As of now, the
equations are limited to elliptical and circular contacts. Equations for line
contacts (cylinder-on-flat or cylinder-on-cylinder) are currently not
implemented.
"""
import copy
import warnings
from math import ... | [
"tribology.boundary_element.__secant",
"numpy.abs",
"numpy.amin",
"tribology.tribology.profball",
"numpy.delete",
"math.sqrt",
"math.log",
"numpy.append",
"copy.deepcopy",
"warnings.warn",
"numpy.amax"
] | [((5105, 5120), 'math.sqrt', 'sqrt', (['(r_a * r_b)'], {}), '(r_a * r_b)\n', (5109, 5120), False, 'from math import sqrt, pi, log, floor\n'), ((9179, 9248), 'math.sqrt', 'sqrt', (['((x_cords[0] - x_cords[1]) ** 2 + (y_cords[0] - y_cords[1]) ** 2)'], {}), '((x_cords[0] - x_cords[1]) ** 2 + (y_cords[0] - y_cords[1]) ** 2... |
# Author: <NAME> <<EMAIL>>
import os
import numpy as np
from numpy.testing import assert_array_equal
import pytest
from eelbrain import Dataset, Factor, Var
from eelbrain._exceptions import DefinitionError
from eelbrain.pipeline import *
from eelbrain.testing import assert_dataobj_equal, TempDir
SUBJECT = 'CheeseMo... | [
"eelbrain.Var",
"os.makedirs",
"numpy.testing.assert_array_equal",
"eelbrain.Factor",
"os.path.join",
"eelbrain.Dataset",
"eelbrain.testing.assert_dataobj_equal",
"pytest.raises",
"eelbrain.testing.TempDir",
"numpy.arange"
] | [((448, 473), 'numpy.arange', 'np.arange', (['(1001)', '(1441)', '(55)'], {}), '(1001, 1441, 55)\n', (457, 473), True, 'import numpy as np\n'), ((418, 433), 'numpy.arange', 'np.arange', (['(1)', '(5)'], {}), '(1, 5)\n', (427, 433), True, 'import numpy as np\n'), ((522, 531), 'eelbrain.testing.TempDir', 'TempDir', ([], ... |
# PyZX - Python library for quantum circuit rewriting
# and optimization using the ZX-calculus
# Copyright (C) 2018 - <NAME> and <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... | [
"numpy.identity",
"numpy.abs",
"numpy.allclose",
"numpy.sqrt",
"numpy.ones",
"numpy.tensordot",
"math.sqrt",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.transpose",
"numpy.set_printoptions"
] | [((1450, 1484), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (1469, 1484), True, 'import numpy as np\n'), ((1844, 1880), 'numpy.zeros', 'np.zeros', (['([2] * arity)'], {'dtype': 'complex'}), '([2] * arity, dtype=complex)\n', (1852, 1880), True, 'import numpy as np\... |
# -*- coding: utf8
from __future__ import division, print_function
from numpy.testing import assert_equal
from numpy.testing import assert_array_equal
from phoenix import models
from phoenix import ode
import numpy as np
def tests_the_phoenix_r_method():
'''Tests the phoenix r w period model'''
exp_tseries ... | [
"phoenix.models.phoenix_r_with_period",
"numpy.testing.assert_equal",
"numpy.zeros",
"phoenix.ode.shock",
"phoenix.models.WavePhoenixR",
"phoenix.models.FixedStartPhoenixR",
"numpy.testing.assert_array_equal"
] | [((322, 346), 'numpy.zeros', 'np.zeros', (['(150)'], {'dtype': '"""d"""'}), "(150, dtype='d')\n", (330, 346), True, 'import numpy as np\n'), ((367, 404), 'phoenix.ode.shock', 'ode.shock', (['(0.01)', '(0)', '(0.8)', '(1000)', '(2)', '(200)'], {}), '(0.01, 0, 0.8, 1000, 2, 200)\n', (376, 404), False, 'from phoenix impor... |
def show_all_cv_processing_output():
# Start to implement new version of algorithm
import matplotlib.pyplot as plt
import os
import pydicom
import numpy as np
import cv2
import copy
import seaborn as sns
from numpy.random import randn
import matplotlib as mpl
from scipy ... | [
"numpy.uint8",
"cv2.fitEllipse",
"copy.deepcopy",
"matplotlib.pyplot.imshow",
"os.listdir",
"cv2.line",
"numpy.max",
"os.path.isdir",
"numpy.maximum",
"cv2.drawContours",
"os.path.isfile",
"seaborn.desaturate",
"matplotlib.pyplot.axes",
"cv2.cvtColor",
"matplotlib.pyplot.show",
"numpy.... | [((2470, 2488), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (2480, 2488), False, 'import os\n'), ((3309, 3379), 'cv2.findContours', 'cv2.findContours', (['gray_image', 'cv2.RETR_EXTERNAL', 'cv2.CHAIN_APPROX_NONE'], {}), '(gray_image, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)\n', (3325, 3379), False, 'im... |
import numpy as np
height = [1.47, 1.50, 1.52, 1.55, 1.57, 1.60, 1.63,
1.65, 1.68, 1.70, 1.73, 1.75, 1.78, 1.80, 1.83]
weight = [52.21, 53.12, 54.48, 55.84, 57.20, 58.57, 59.93,
61.29, 63.11, 64.47, 66.28, 68.10, 69.92, 72.19, 74.46]
X = np.array(height)[:, None]**range(3)
y = weight
print(np.linalg.lstsq(X,... | [
"numpy.array",
"numpy.linalg.lstsq"
] | [((248, 264), 'numpy.array', 'np.array', (['height'], {}), '(height)\n', (256, 264), True, 'import numpy as np\n'), ((302, 323), 'numpy.linalg.lstsq', 'np.linalg.lstsq', (['X', 'y'], {}), '(X, y)\n', (317, 323), True, 'import numpy as np\n')] |
import typing
import numpy as np
import pytest
from ebonite.core.objects import Model, ModelWrapper
from ebonite.core.objects.artifacts import Blobs
from ebonite.core.objects.core import EvaluationResults
from ebonite.core.objects.metric import Metric
from ebonite.core.objects.wrapper import PickleModelIO
class Eva... | [
"numpy.mean",
"numpy.ones",
"numpy.sum",
"pytest.raises",
"ebonite.core.objects.wrapper.PickleModelIO",
"ebonite.core.objects.artifacts.Blobs"
] | [((843, 870), 'numpy.mean', 'np.mean', (['float_data'], {'axis': '(1)'}), '(float_data, axis=1)\n', (850, 870), True, 'import numpy as np\n'), ((549, 570), 'numpy.mean', 'np.mean', (['data'], {'axis': '(1)'}), '(data, axis=1)\n', (556, 570), True, 'import numpy as np\n'), ((617, 638), 'numpy.mean', 'np.mean', (['data']... |
"""
Defines the DataRange1D class.
"""
# Major library imports
from math import ceil, floor, log
import six
import six.moves as sm
from numpy import compress, inf, isinf, isnan, ndarray
# Enthought library imports
from traits.api import Bool, CFloat, Enum, Float, Property, Trait, \
... | [
"traits.api.Enum",
"math.ceil",
"math.floor",
"traits.api.CFloat",
"traits.api.Trait",
"numpy.isnan",
"traits.api.Bool",
"numpy.isinf",
"six.moves.zip",
"traits.api.Float"
] | [((1769, 1779), 'traits.api.Bool', 'Bool', (['(True)'], {}), '(True)\n', (1773, 1779), False, 'from traits.api import Bool, CFloat, Enum, Float, Property, Trait, Callable\n'), ((2115, 2126), 'traits.api.Float', 'Float', (['(0.05)'], {}), '(0.05)\n', (2120, 2126), False, 'from traits.api import Bool, CFloat, Enum, Float... |
# -*- coding: utf-8 -*-
import dash
import dash_auth
import json
import dash_core_components as dcc
import dash_daq as daq
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output
from plotly.subplots import make_subplots
import plotly.graph_objects as go
i... | [
"pandas.to_timedelta",
"pandas.read_csv",
"dash_html_components.H3",
"dash.dependencies.Input",
"pandas.to_datetime",
"dash.Dash",
"numpy.arange",
"plotly.express.density_contour",
"plotly.graph_objects.Bar",
"plotly.express.scatter",
"dash.dependencies.Output",
"dash_html_components.Br",
"p... | [((506, 596), 'dash.Dash', 'dash.Dash', (['__name__'], {'meta_tags': "[{'name': 'viewport', 'content': 'width=device-width'}]"}), "(__name__, meta_tags=[{'name': 'viewport', 'content':\n 'width=device-width'}])\n", (515, 596), False, 'import dash\n'), ((607, 662), 'dash_auth.BasicAuth', 'dash_auth.BasicAuth', (['app... |
# Copyright 2016 Quantopian, 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 agreed to in writ... | [
"catalyst.data.dispatch_bar_reader.AssetDispatchSessionBarReader",
"catalyst.data.resample.MinuteResampleSessionBarReader",
"numpy.testing.assert_almost_equal",
"catalyst.data.resample.ReindexMinuteBarReader",
"numpy.array",
"catalyst.data.resample.ReindexSessionBarReader",
"pandas.DataFrame",
"pandas... | [((1641, 1674), 'pandas.Timestamp', 'Timestamp', (['"""2016-08-22"""'], {'tz': '"""UTC"""'}), "('2016-08-22', tz='UTC')\n", (1650, 1674), False, 'from pandas import DataFrame, Timestamp\n'), ((1690, 1723), 'pandas.Timestamp', 'Timestamp', (['"""2016-08-24"""'], {'tz': '"""UTC"""'}), "('2016-08-24', tz='UTC')\n", (1699,... |
import numpy as np
# sigmoid function
def sigmoid(x):
return 1 / (1 + np.exp(-x))
# print function
def identity_function(x):
return x
# 1st -> 2nd layer
X = np.array([1.0, 0.5])
W1 = np.array([[0.1, 0.3, 0.5], [0.2, 0.4, 0.6]])
B1 = np.array([0.1, 0.2, 0.3])
A1 = np.dot(X, W1) + B1
Z1 = sigmoid(A1)
print... | [
"numpy.exp",
"numpy.array",
"numpy.dot"
] | [((171, 191), 'numpy.array', 'np.array', (['[1.0, 0.5]'], {}), '([1.0, 0.5])\n', (179, 191), True, 'import numpy as np\n'), ((197, 241), 'numpy.array', 'np.array', (['[[0.1, 0.3, 0.5], [0.2, 0.4, 0.6]]'], {}), '([[0.1, 0.3, 0.5], [0.2, 0.4, 0.6]])\n', (205, 241), True, 'import numpy as np\n'), ((247, 272), 'numpy.array... |
import os
import numpy as np
import yaml
from typing import Dict, TYPE_CHECKING, List, Tuple
def parse_options(param):
# function to parse read parameters, sets "None" to None and "[]" to []
for key in list(param.__annotations__.keys()):
if param.__getattribute__(key) == "None":
param._... | [
"os.path.exists",
"argparse.ArgumentParser",
"os.path.join",
"yaml.safe_load",
"numpy.array",
"pydantic.dataclasses.dataclass"
] | [((542, 553), 'pydantic.dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (551, 553), False, 'from pydantic.dataclasses import dataclass\n'), ((6846, 6907), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'formatter_class': 'ArgumentDefaultsHelpFormatter'}), '(formatter_class=ArgumentDefaultsHelpFormatter)\n', ... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
"tensorflow.expand_dims",
"audio_synthesis.datasets.maestro_dataset.get_maestro_waveform_dataset",
"audio_synthesis.structures.learned_basis_function.Discriminator",
"audio_synthesis.models.wgan.get_interpolation",
"tensorflow.keras.optimizers.Adam",
"tensorflow.GradientTape",
"audio_synthesis.structure... | [((3284, 3342), 'audio_synthesis.datasets.maestro_dataset.get_maestro_waveform_dataset', 'maestro_dataset.get_maestro_waveform_dataset', (['MAESTRO_PATH'], {}), '(MAESTRO_PATH)\n', (3328, 3342), False, 'from audio_synthesis.datasets import maestro_dataset\n'), ((3370, 3392), 'copy.copy', 'copy.copy', (['raw_maestro'], ... |
import visualization.panda.world as wd
import modeling.geometric_model as gm
import robot_sim.robots.xarm_shuidi.xarm_shuidi as xsm
import robot_con.xarm_shuidi_grpc.xarm_shuidi_client as xsc
import drivers.devices.kinect_azure.pykinectazure as pk
import cv2
import cv2.aruco as aruco
import numpy as np
from vision.dept... | [
"numpy.mean",
"cv2.aruco.drawDetectedMarkers",
"vision.depth_camera.calibrator.load_calibration_data",
"time.sleep",
"cv2.aruco.DetectorParameters_create",
"cv2.imshow",
"cv2.aruco.Dictionary_get",
"modeling.geometric_model.gen_frame",
"robot_sim.robots.xarm_shuidi.xarm_shuidi.XArmShuidi",
"robot_... | [((2775, 2793), 'drivers.devices.kinect_azure.pykinectazure.PyKinectAzure', 'pk.PyKinectAzure', ([], {}), '()\n', (2791, 2793), True, 'import drivers.devices.kinect_azure.pykinectazure as pk\n'), ((2801, 2850), 'visualization.panda.world.World', 'wd.World', ([], {'cam_pos': '[3, 3, 3]', 'lookat_pos': '[0, 0, 1]'}), '(c... |
#!/usr/local/anaconda3/envs/py36 python
# -*- coding: utf-8 -*-
# Plotting
import matplotlib; matplotlib.use('TkAgg')
import matplotlib.pyplot as pl
import seaborn as sns; sns.set_style('ticks')
import matplotlib as mpl
# from matplotlib.ticker import FormatStrFormatter
params = {
'axes.labelsize': 16,
'font.... | [
"numpy.log10",
"numpy.log",
"scipy.interpolate.interp1d",
"seaborn.set_style",
"numpy.array",
"corner.corner",
"lmfit.Parameters",
"numpy.genfromtxt",
"numpy.arange",
"numpy.mean",
"lmfit.Minimizer",
"numpy.diff",
"astropy.units.spectral_density",
"matplotlib.pyplot.savefig",
"matplotlib... | [((95, 118), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (109, 118), False, 'import matplotlib\n'), ((173, 195), 'seaborn.set_style', 'sns.set_style', (['"""ticks"""'], {}), "('ticks')\n", (186, 195), True, 'import seaborn as sns\n'), ((438, 465), 'matplotlib.rcParams.update', 'mpl.rcParam... |
from Environments import ChessEnvironment
from collections import defaultdict
from constants import N_ACTIONS
from dummy import generate_action_dict
import numpy as np
import time
from threading import Thread
# TODO: Tidy this up
a2m, m2a = generate_action_dict()
C_PUCT = 2
class MasterNode():
""" A placeholde... | [
"threading.Thread.__init__",
"numpy.sqrt",
"dummy.generate_action_dict",
"time.perf_counter",
"numpy.argmax",
"numpy.invert",
"numpy.argsort",
"numpy.zeros",
"collections.defaultdict",
"Environments.ChessEnvironment"
] | [((243, 265), 'dummy.generate_action_dict', 'generate_action_dict', ([], {}), '()\n', (263, 265), False, 'from dummy import generate_action_dict\n'), ((3431, 3465), 'numpy.zeros', 'np.zeros', (['N_ACTIONS'], {'dtype': 'np.bool'}), '(N_ACTIONS, dtype=np.bool)\n', (3439, 3465), True, 'import numpy as np\n'), ((3581, 3600... |
import os
import cv2
import time
import argparse
import numpy as np
import subprocess as sp
import json
import tensorflow as tf
import serial
import matplotlib.pyplot as plt
import math
from queue import Queue
from threading import Thread
from utils.app_utils import FPS, HLSVideoStream, WebcamVideoStream, draw_boxes_a... | [
"numpy.polyfit",
"cv2.imshow",
"numpy.array",
"cv2.destroyAllWindows",
"numpy.poly1d",
"tensorflow.gfile.GFile",
"math.atan",
"utils.app_utils.FPS",
"tensorflow.Graph",
"argparse.ArgumentParser",
"tensorflow.Session",
"tensorflow.GraphDef",
"object_detection.utils.label_map_util.load_labelma... | [((772, 819), 'numpy.array', 'np.array', (['[(6.52, 0.5), (56, 4.5), (92.3, 7.5)]'], {}), '([(6.52, 0.5), (56, 4.5), (92.3, 7.5)])\n', (780, 819), True, 'import numpy as np\n'), ((882, 925), 'numpy.array', 'np.array', (['[(12, 0.5), (13, 4.5), (16, 7.5)]'], {}), '([(12, 0.5), (13, 4.5), (16, 7.5)])\n', (890, 925), True... |
import logging
import numpy as np
from scipy.integrate import quad
from scipy.interpolate import BarycentricInterpolator
from pySDC.core.Errors import CollocationError
class CollBase(object):
"""
Abstract class for collocation
Derived classes will contain everything to do integration over intervals and... | [
"logging.getLogger",
"numpy.roll",
"pySDC.core.Errors.CollocationError",
"scipy.integrate.quad",
"numpy.size",
"numpy.dot",
"numpy.zeros",
"numpy.arange"
] | [((1704, 1736), 'logging.getLogger', 'logging.getLogger', (['"""collocation"""'], {}), "('collocation')\n", (1721, 1736), False, 'import logging\n'), ((2685, 2706), 'numpy.dot', 'np.dot', (['weights', 'data'], {}), '(weights, data)\n', (2691, 2706), True, 'import numpy as np\n'), ((3175, 3199), 'numpy.zeros', 'np.zeros... |
# @Author: <NAME> <varoon>
# @Date: 18-08-2017
# @Filename: kernel_convolution_ex.py
# @Last modified by: varoon
# @Last modified time: 18-08-2017
import cv2
import numpy as np
#GOAL: Apply the following kernel convolution to an image: [-1,0,1||-1,5,-1||0,-1,0]
#applying a sharpening kernel convolution manually... | [
"numpy.array",
"numpy.zeros",
"cv2.cvtColor",
"cv2.filter2D"
] | [((918, 977), 'numpy.array', 'np.array', (['[[0, -1, 0], [-1, 5, -1], [0, -1, 0]]', 'np.float32'], {}), '([[0, -1, 0], [-1, 5, -1], [0, -1, 0]], np.float32)\n', (926, 977), True, 'import numpy as np\n'), ((1011, 1038), 'cv2.filter2D', 'cv2.filter2D', (['I', '(-1)', 'kernel'], {}), '(I, -1, kernel)\n', (1023, 1038), Fal... |
#ShengpingJiang- Face recognition model as a flask application
import pickle
import numpy as np
from flask import Flask, request
#model = None
app = Flask(__name__)
def load_model():
global model
# model variable refers to the global variable
with open('face_model_file_frg', 'rb') as f:
model = ... | [
"flask.request.get_json",
"numpy.fromstring",
"pickle.load",
"flask.Flask"
] | [((151, 166), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (156, 166), False, 'from flask import Flask, request\n'), ((320, 334), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (331, 334), False, 'import pickle\n'), ((593, 611), 'flask.request.get_json', 'request.get_json', ([], {}), '()\n', (609, 6... |
import logging
import unittest
import numpy as np
import pandas as pd
import scipy.stats as stats
from batchglm.api.models.tf1.glm_nb import Simulator
import diffxpy.api as de
class TestConstrained(unittest.TestCase):
def test_forfatal_from_string(self):
"""
Test if _from_string interface is wo... | [
"logging.getLogger",
"pandas.DataFrame",
"batchglm.api.models.tf1.glm_nb.Simulator",
"diffxpy.api.utils.constraint_matrix_from_string",
"scipy.stats.kstest",
"numpy.zeros",
"numpy.random.seed",
"unittest.main",
"diffxpy.api.test.wald",
"diffxpy.api.utils.design_matrix"
] | [((8905, 8920), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8918, 8920), False, 'import unittest\n'), ((619, 636), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (633, 636), True, 'import numpy as np\n'), ((695, 752), 'batchglm.api.models.tf1.glm_nb.Simulator', 'Simulator', ([], {'num_observati... |
import numpy as np
from PTSS import PtssJoint as ptssjnt
from PTSS import Ptss as ptss
from CFNS import CyFns as cfns
# define the 4th order Runge-Kutta algorithm.
class RK4:
def rk4(self, y0, dy, step):
k1 = step * dy
k2 = step * (dy + 1 / 2 * k1)
k3 = step * (dy + 1 / 2 * k2)
k4 ... | [
"numpy.radians",
"numpy.sqrt",
"numpy.random.rand",
"CFNS.CyFns",
"PTSS.Ptss.parse",
"numpy.array",
"numpy.linalg.norm",
"numpy.sin",
"numpy.arange",
"PTSS.PtssJoint",
"numpy.random.random",
"numpy.heaviside",
"numpy.exp",
"numpy.degrees",
"numpy.arctan",
"numpy.abs",
"numpy.ones",
... | [((509, 515), 'CFNS.CyFns', 'cfns', ([], {}), '()\n', (513, 515), True, 'from CFNS import CyFns as cfns\n'), ((886, 913), 'numpy.heaviside', 'np.heaviside', (['(thresh - x)', '(0)'], {}), '(thresh - x, 0)\n', (898, 913), True, 'import numpy as np\n'), ((986, 1016), 'numpy.heaviside', 'np.heaviside', (['(out - -thresh)'... |
import typing
import numpy as np
ExampleSet = typing.Dict[str, typing.Any]
class MathSet(object):
def project(self, state):
raise NotImplementedError()
def distance_to_set(self, states):
raise NotImplementedError()
def describe(self):
raise NotImplementedError()
class DebugSe... | [
"numpy.array",
"numpy.zeros",
"numpy.random.randint",
"numpy.random.uniform",
"numpy.linalg.norm"
] | [((4518, 4545), 'numpy.random.uniform', 'np.random.uniform', (['(-4)', '(4)', '(1)'], {}), '(-4, 4, 1)\n', (4535, 4545), True, 'import numpy as np\n'), ((4734, 4761), 'numpy.random.uniform', 'np.random.uniform', (['(-4)', '(4)', '(1)'], {}), '(-4, 4, 1)\n', (4751, 4761), True, 'import numpy as np\n'), ((4775, 4802), 'n... |
import os
import time
from tqdm import tqdm
import torch
import math
import numpy as np
from sklearn.utils.class_weight import compute_class_weight
from torch.utils.data import DataLoader, RandomSampler
from torch.nn import DataParallel
from utils.log_utils import log_values, log_values_sl
from utils.data_utils impo... | [
"torch.cuda.get_rng_state_all",
"numpy.unique",
"torch.nn.utils.clip_grad_norm_",
"tqdm.tqdm",
"utils.log_utils.log_values",
"time.gmtime",
"utils.log_utils.log_values_sl",
"torch.get_rng_state",
"utils.move_to",
"utils.data_utils.BatchedRandomSampler",
"torch.utils.data.DataLoader",
"torch.no... | [((2988, 2999), 'time.time', 'time.time', ([], {}), '()\n', (2997, 2999), False, 'import time\n'), ((3504, 3606), 'torch.utils.data.DataLoader', 'DataLoader', (['train_dataset'], {'batch_size': 'opts.batch_size', 'shuffle': '(False)', 'num_workers': 'opts.num_workers'}), '(train_dataset, batch_size=opts.batch_size, shu... |
# modified according to https://github.com/zhixuhao/unet
import keras
import numpy as np
import os
# import glob
import skimage.io as io
import skimage.transform as trans
from keras import backend as K
from keras.applications.vgg19 import VGG19
from keras.preprocessing import image
from keras.applications.vgg19 import... | [
"numpy.reshape",
"os.path.join",
"keras.preprocessing.image.ImageDataGenerator",
"numpy.max",
"numpy.zeros",
"keras.models.Model",
"skimage.transform.resize"
] | [((3768, 3802), 'keras.models.Model', 'Model', ([], {'input': 'inputs', 'output': 'conv10'}), '(input=inputs, output=conv10)\n', (3773, 3802), False, 'from keras.models import Model\n'), ((4644, 4674), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {}), '(**aug_dict)\n', (4662, 4674), False,... |
"""Module for correcting PERKEO data."""
import configparser
import copy
import numpy as np
from panter.base.corrBase import CorrBase
from panter.config import conf_path
from panter.config.params import delt_pmt
from panter.config.params import k_pmt_fix
from panter.data.dataHistPerkeo import HistPerkeo
from panter.... | [
"panter.eval.evalFunctions.calc_acorr_ratedep",
"numpy.abs",
"numpy.ones",
"configparser.ConfigParser",
"panter.data.dataloaderPerkeo.DLPerkeo",
"panter.eval.evalDriftGPR.GPRDrift",
"numpy.asarray",
"torch.tensor",
"panter.eval.pedPerkeo.PedPerkeo",
"panter.data.dataMisc.FilePerkeo",
"numpy.arra... | [((561, 588), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (586, 588), False, 'import configparser\n'), ((16256, 16274), 'panter.data.dataloaderPerkeo.DLPerkeo', 'DLPerkeo', (['data_dir'], {}), '(data_dir)\n', (16264, 16274), False, 'from panter.data.dataloaderPerkeo import DLPerkeo\n'), ... |
import os
import numpy as np
from scipy.io import loadmat
def fetch(label_path, data_dir):
""" Return the articulatory(ema) and acoustic(mfcc) data for a certain speech wave, with its label path given as an input.
Parameters
----------
label_path: str
path of a label transcription file (has... | [
"numpy.delete",
"os.path.join"
] | [((1050, 1106), 'numpy.delete', 'np.delete', (['ema', '[1, 4, 7, 10, 12, 13, 14, 15, 16, 17]', '(0)'], {}), '(ema, [1, 4, 7, 10, 12, 13, 14, 15, 16, 17], 0)\n', (1059, 1106), True, 'import numpy as np\n'), ((1235, 1269), 'os.path.join', 'os.path.join', (['mfcc_dir', 'splits[-1]'], {}), '(mfcc_dir, splits[-1])\n', (1247... |
import json
import xnet
import glob
import numpy as np
import matplotlib.pyplot as plt
from igraph import *
from scipy import signal
from read_file import load_data
from itertools import combinations
from collections import defaultdict
def create_nets_by_year():
# CRIA AS REDES POR ANO
file = 'data/plos_one_2019_su... | [
"json.loads",
"xnet.xnet2igraph",
"matplotlib.pyplot.savefig",
"read_file.load_data",
"xnet.igraph2xnet",
"numpy.arange",
"numpy.histogram",
"numpy.convolve",
"numpy.power",
"itertools.combinations",
"collections.defaultdict",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
... | [((1328, 1353), 'json.loads', 'json.loads', (['complete_data'], {}), '(complete_data)\n', (1338, 1353), False, 'import json\n'), ((1485, 1559), 'read_file.load_data', 'load_data', (['"""data/plos_one_2019_breakpoints_k4_original1_data_filtered.txt"""'], {}), "('data/plos_one_2019_breakpoints_k4_original1_data_filtered.... |
import logging
from typing import Union, Annotated
from beartype import beartype
from beartype.vale import Is
from UQpy.distributions import *
import numpy as np
import scipy.stats as stats
from UQpy.utilities.Utilities import nearest_psd, calculate_gauss_quadrature_2d
from UQpy.utilities.Utilities import bi_variate_n... | [
"logging.getLogger",
"numpy.sqrt",
"scipy.linalg.cholesky",
"numpy.array",
"numpy.isfinite",
"numpy.linalg.norm",
"UQpy.utilities.Utilities.nearest_psd",
"scipy.stats.norm.cdf",
"numpy.atleast_2d",
"numpy.dot",
"numpy.eye",
"UQpy.utilities.Utilities.calculate_gauss_quadrature_2d",
"numpy.siz... | [((4434, 4461), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (4451, 4461), False, 'import logging\n'), ((5825, 5858), 'scipy.linalg.cholesky', 'cholesky', (['self.corr_z'], {'lower': '(True)'}), '(self.corr_z, lower=True)\n', (5833, 5858), False, 'from scipy.linalg import cholesky\n'), ... |
import argparse
import time
import os
import numpy as np
import pandas as pd
import tqdm
import h5py
from generation.config import DF_DIR, EVENTS_PATH, DETECTORS_PATH, FULL_SIGNALS_DIR, PROCESSING_TIME_NORM_COEF, \
SIGNAL_DIM, SPACAL_DATA_PATH, FRAC_SIGNALS_DIR, H5_DATASET_NAME, POSTPROCESSED_SIGNALS_DIR
def cr... | [
"os.path.exists",
"pandas.read_parquet",
"os.path.join",
"h5py.File",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.linspace",
"os.mkdir",
"numpy.load"
] | [((443, 463), 'h5py.File', 'h5py.File', (['path', '"""w"""'], {}), "(path, 'w')\n", (452, 463), False, 'import h5py\n'), ((593, 613), 'h5py.File', 'h5py.File', (['path', '"""r"""'], {}), "(path, 'r')\n", (602, 613), False, 'import h5py\n'), ((871, 884), 'numpy.load', 'np.load', (['path'], {}), '(path)\n', (878, 884), T... |
# PLOT STREAMFUNCTION
from __future__ import print_function
path = '/home/mkloewer/python/swm/'
import os; os.chdir(path) # change working directory
import numpy as np
from scipy import sparse
from scipy.integrate import cumtrapz
import matplotlib.pyplot as plt
import time as tictoc
from netCDF4 import Dataset
import g... | [
"os.chdir",
"numpy.load",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((107, 121), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (115, 121), False, 'import os\n'), ((1321, 1365), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(2)'], {'sharex': '(True)', 'sharey': '(True)'}), '(1, 2, sharex=True, sharey=True)\n', (1333, 1365), True, 'import matplotlib.pyplot as plt\n'), ((... |
import importlib
from hydroDL.master import basins
from hydroDL.app import waterQuality
from hydroDL import kPath
from hydroDL.model import trainTS
from hydroDL.data import gageII, usgs
from hydroDL.post import axplot, figplot
import torch
import os
import json
import numpy as np
import pandas as pd
import matplotlib.... | [
"hydroDL.post.axplot.mapPoint",
"hydroDL.post.figplot.clickMap",
"hydroDL.data.gageII.readData",
"matplotlib.pyplot.plot",
"hydroDL.master.basins.testModelSeq",
"hydroDL.app.waterQuality.DataModelWQ",
"numpy.datetime64",
"hydroDL.master.basins.loadSeq",
"hydroDL.post.axplot.plotTS",
"matplotlib.py... | [((344, 375), 'hydroDL.app.waterQuality.DataModelWQ', 'waterQuality.DataModelWQ', (['"""HBN"""'], {}), "('HBN')\n", (368, 375), False, 'from hydroDL.app import waterQuality\n'), ((1227, 1246), 'matplotlib.pyplot.plot', 'plt.plot', (['a', 'b', '"""*"""'], {}), "(a, b, '*')\n", (1235, 1246), True, 'import matplotlib.pypl... |
import numpy as np
from nilearn.image import new_img_like, resample_to_img
from unet3d.utils.affine import get_extent_from_image, adjust_affine_spacing
def pad_image(image, mode='edge', pad_width=1):
affine = np.copy(image.affine)
spacing = np.copy(image.header.get_zooms()[:3])
affine[:3, 3] -= spacing *... | [
"nilearn.image.new_img_like",
"numpy.copy",
"unet3d.utils.affine.get_extent_from_image",
"numpy.zeros",
"nilearn.image.resample_to_img"
] | [((216, 237), 'numpy.copy', 'np.copy', (['image.affine'], {}), '(image.affine)\n', (223, 237), True, 'import numpy as np\n'), ((891, 910), 'numpy.zeros', 'np.zeros', (['new_shape'], {}), '(new_shape)\n', (899, 910), True, 'import numpy as np\n'), ((927, 975), 'nilearn.image.new_img_like', 'new_img_like', (['image', 'ne... |
from gl0learn.gl0learn_core import (
check_is_coordinate_subset,
)
from hypothesis import given
from hypothesis import strategies as st
import numpy as np
@st.composite
def size_and_subset(draw: st.DrawFn, max_columns: int = 10):
n = draw(st.integers(min_value=1, max_value=max_columns))
n = (n - 1) * n //... | [
"numpy.triu_indices",
"hypothesis.strategies.integers",
"gl0learn.gl0learn_core.check_is_coordinate_subset"
] | [((727, 767), 'gl0learn.gl0learn_core.check_is_coordinate_subset', 'check_is_coordinate_subset', (['full', 'subset'], {}), '(full, subset)\n', (753, 767), False, 'from gl0learn.gl0learn_core import check_is_coordinate_subset\n'), ((249, 296), 'hypothesis.strategies.integers', 'st.integers', ([], {'min_value': '(1)', 'm... |
"""
Manages parameters for models.
A parameter has a lower bound, upper bound, and value.
Parameters are an lmfit collection of parameter.
A parameter collection is a collection of parameters.
"""
from SBstoat import _constants as cn
import matplotlib.pyplot as plt
import numpy as np
import lmfit
LOWER_PARAMETER_M... | [
"lmfit.Parameter",
"numpy.isclose",
"lmfit.Parameters"
] | [((919, 946), 'numpy.isclose', 'np.isclose', (['self.lower', '(0.0)'], {}), '(self.lower, 0.0)\n', (929, 946), True, 'import numpy as np\n'), ((991, 1018), 'numpy.isclose', 'np.isclose', (['self.upper', '(0.0)'], {}), '(self.upper, 0.0)\n', (1001, 1018), True, 'import numpy as np\n'), ((1810, 1916), 'lmfit.Parameter', ... |
"""Linear Predictive Coding analysis and resynthesis for audio."""
import numpy as np
import scipy.signal
def lpcfit(x, p=12, h=128, w=None, overlaps=True):
"""Perform LPC analysis of short-time windows of a waveform.
Args:
x: 1D np.array containing input audio waveform.
p: int, order of LP models to fit... | [
"numpy.hanning",
"numpy.mean",
"numpy.sqrt",
"numpy.hstack",
"numpy.round",
"numpy.argmax",
"numpy.max",
"numpy.zeros",
"numpy.correlate",
"numpy.random.randn",
"numpy.arange"
] | [((1150, 1174), 'numpy.zeros', 'np.zeros', (['(nhops, p + 1)'], {}), '((nhops, p + 1))\n', (1158, 1174), True, 'import numpy as np\n'), ((1179, 1194), 'numpy.zeros', 'np.zeros', (['nhops'], {}), '(nhops)\n', (1187, 1194), True, 'import numpy as np\n'), ((1366, 1382), 'numpy.arange', 'np.arange', (['nhops'], {}), '(nhop... |
import pytest
import numpy as np
import time
from ding.utils.time_helper import build_time_helper, WatchDog, TimeWrapperTime, EasyTimer
@pytest.mark.unittest
class TestTimeHelper:
def test_naive(self):
class NaiveObject(object):
pass
cfg = NaiveObject()
setattr(cfg, 'common'... | [
"numpy.isscalar",
"ding.utils.time_helper.EasyTimer",
"numpy.random.random",
"time.sleep",
"pytest.raises",
"ding.utils.time_helper.build_time_helper",
"ding.utils.time_helper.WatchDog"
] | [((612, 634), 'ding.utils.time_helper.build_time_helper', 'build_time_helper', (['cfg'], {}), '(cfg)\n', (629, 634), False, 'from ding.utils.time_helper import build_time_helper, WatchDog, TimeWrapperTime, EasyTimer\n'), ((657, 695), 'ding.utils.time_helper.build_time_helper', 'build_time_helper', ([], {'wrapper_type':... |
import time
from types import SimpleNamespace
import argparse
import cv2
import matplotlib.pyplot as plt
import numpy as np
import toml
from astar import Astar
from dwa import DWA
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--map", default="circuit", help="The name of the map. See config.toml for ... | [
"numpy.array",
"numpy.arctan2",
"numpy.sin",
"matplotlib.pyplot.imshow",
"numpy.flip",
"argparse.ArgumentParser",
"astar.Astar",
"matplotlib.pyplot.plot",
"dwa.DWA",
"numpy.linspace",
"toml.load",
"matplotlib.pyplot.scatter",
"types.SimpleNamespace",
"numpy.cos",
"cv2.cvtColor",
"matpl... | [((193, 218), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (216, 218), False, 'import argparse\n'), ((348, 372), 'toml.load', 'toml.load', (['"""config.toml"""'], {}), "('config.toml')\n", (357, 372), False, 'import toml\n'), ((415, 447), 'types.SimpleNamespace', 'SimpleNamespace', ([], {}), ... |
import numpy as np
class Tensor(np.ndarray):
"""
"""
def __init__(self, *args, **kwargs):
self.grad = None
def from_array(arr):
"""Convert the input array-like to a tensor."""
t = arr.view(Tensor)
t.grad = None
return t
def zeros(shape):
"""Return a new tensor of given shap... | [
"numpy.random.normal",
"pdb.set_trace"
] | [((758, 773), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (771, 773), False, 'import pdb\n'), ((661, 711), 'numpy.random.normal', 'np.random.normal', ([], {'loc': 'loc', 'scale': 'scale', 'size': 'shape'}), '(loc=loc, scale=scale, size=shape)\n', (677, 711), True, 'import numpy as np\n')] |
"""
echelle2d.py
A generic set of code to process echelle 2d spectra that are stored in a
multi-extension fits format. This code is used by some of the ESI and NIRES
code that are in the keckcode repository
"""
import numpy as np
from matplotlib import pyplot as plt
from astropy.io import fits as pf
from astropy.t... | [
"astropy.table.Table",
"astropy.io.fits.PrimaryHDU",
"numpy.arange",
"matplotlib.pyplot.gcf",
"astropy.io.fits.ImageHDU",
"matplotlib.pyplot.plot",
"specim.specfuncs.Spec2d",
"numpy.zeros",
"numpy.array",
"astropy.io.fits.open",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim",
"matplotlib... | [((7950, 7983), 'matplotlib.pyplot.subplots_adjust', 'plt.subplots_adjust', ([], {'hspace': '(0.001)'}), '(hspace=0.001)\n', (7969, 7983), True, 'from matplotlib import pyplot as plt\n'), ((8079, 8088), 'matplotlib.pyplot.gcf', 'plt.gcf', ([], {}), '()\n', (8086, 8088), True, 'from matplotlib import pyplot as plt\n'), ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from scipy import misc
import tensorflow as tf
import numpy as np
import sys
import os
import copy
import argparse
import facenet
import align.detect_face
import pickle
from flask import Flask,request
from fla... | [
"flask.Flask",
"scipy.misc.imresize",
"tensorflow.GPUOptions",
"facenet.load_model",
"flask.jsonify",
"tensorflow.Graph",
"argparse.ArgumentParser",
"tensorflow.Session",
"numpy.asarray",
"numpy.subtract",
"numpy.stack",
"scipy.misc.imread",
"facenet.prewhiten",
"tensorflow.ConfigProto",
... | [((346, 361), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (351, 361), False, 'from flask import Flask, request\n'), ((371, 383), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (381, 383), True, 'import tensorflow as tf\n'), ((384, 427), 'facenet.load_model', 'facenet.load_model', (['"""../2018040... |
#!/usr/bin/env python
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
import sys
import seaborn as sns
from pandas import read_pickle, qcut
from itertools import product
import matplotlib.pyplot as plt
from pandas import get_dummies
from pandas import groupby
import nump... | [
"pandas.read_pickle",
"seaborn.set_palette",
"matplotlib.pyplot.savefig",
"pandas.qcut",
"matplotlib.use",
"itertools.product",
"seaborn.set_context",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"seaborn.violinplot",
"numpy.percentile",
"seaborn.jointplot",
"seaborn.axes_style",
... | [((41, 62), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (55, 62), False, 'import matplotlib\n'), ((350, 384), 'seaborn.set_palette', 'sns.set_palette', (['"""deep"""'], {'desat': '(0.6)'}), "('deep', desat=0.6)\n", (365, 384), True, 'import seaborn as sns\n'), ((384, 430), 'seaborn.set_context... |
import rematbal.matbal as mb
import numpy as np
from scipy.optimize import fsolve
import pandas as pd
def mbal_inner_calc(dict, P, Pres_calc, We, aquifer_pres, step):
Np, Wp, Gp, N, Wei, pvt_oil_pressure, pvt_oil_Bo, pvt_oil_Bg, pvt_oil_Rs, Rsb, \
Bti, Bgi, Pi, m, Boi, cw, Swi, cf, Rsi, Bw, Winj, Bwinj, Ginj, ... | [
"scipy.optimize.fsolve",
"rematbal.matbal.production_injection_balance",
"rematbal.matbal.VEH_aquifer_influx",
"rematbal.matbal.pore_volume_reduction_connate_water_expansion",
"numpy.array",
"rematbal.matbal.dissolved_oil_and_gas_expansion",
"numpy.exp",
"rematbal.matbal.gas_cap_expansion",
"rematba... | [((413, 455), 'numpy.interp', 'np.interp', (['P', 'pvt_oil_pressure', 'pvt_oil_Bo'], {}), '(P, pvt_oil_pressure, pvt_oil_Bo)\n', (422, 455), True, 'import numpy as np\n'), ((465, 507), 'numpy.interp', 'np.interp', (['P', 'pvt_oil_pressure', 'pvt_oil_Bg'], {}), '(P, pvt_oil_pressure, pvt_oil_Bg)\n', (474, 507), True, 'i... |
from abc import ABC, abstractmethod
from collections import defaultdict
from datetime import datetime, timedelta
import json
import logging
from multiprocessing import Pool, cpu_count
import os
import pathlib
import posixpath
import shutil
import tarfile
import tempfile
from time import time
from typing import Union
i... | [
"logging.getLogger",
"wget.download",
"tarfile.open",
"scipy.spatial.cKDTree",
"pyschism.dates.localize_datetime",
"shapely.ops.linemerge",
"appdirs.user_data_dir",
"pyschism.dates.nearest_cycle",
"multiprocessing.cpu_count",
"shapely.geometry.Point",
"numpy.array",
"datetime.timedelta",
"nu... | [((961, 988), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (978, 988), False, 'import logging\n'), ((869, 906), 'appdirs.user_data_dir', 'appdirs.user_data_dir', (['"""pyschism/nwm"""'], {}), "('pyschism/nwm')\n", (890, 906), False, 'import appdirs\n'), ((12600, 12613), 'netCDF4.Dataset... |
'''
Bremerton Weak Lensing Round Trip Module for CosmoSIS
ATTRIBUTION: CFHTLens
because this is a copy of the CFHTLens module with some minor modifications.
'''
from cosmosis.datablock import option_section, names as section_names
import bremerton_like
from bremerton_like import n_z_bin
import numpy as np
def setup(... | [
"bremerton_like.BremertonLikelihood",
"numpy.concatenate"
] | [((640, 698), 'bremerton_like.BremertonLikelihood', 'bremerton_like.BremertonLikelihood', (['covmat_file', 'data_file'], {}), '(covmat_file, data_file)\n', (674, 698), False, 'import bremerton_like\n'), ((1008, 1038), 'numpy.concatenate', 'np.concatenate', (['(theta, theta)'], {}), '((theta, theta))\n', (1022, 1038), T... |
# encoding: utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from xmuda.models.LMSCNet import SegmentationHead
from xmuda.models.CP_baseline import CPBaseline
from xmuda.models.CP_implicit import CPImplicit
from xmuda.models.CP_v5 import CPMegaVoxels
#from xmuda.models.CP_v6 ... | [
"xmuda.models.LMSCNet.SegmentationHead",
"numpy.ones",
"torch.cuda.is_available",
"xmuda.models.modules.Process",
"xmuda.models.modules.Upsample",
"xmuda.models.CP_v5.CPMegaVoxels",
"xmuda.models.modules.Downsample",
"torch.rand"
] | [((1790, 1859), 'xmuda.models.modules.Upsample', 'Upsample', (['(self.feature * 8)', '(self.feature * 4)', 'norm_layer', 'bn_momentum'], {}), '(self.feature * 8, self.feature * 4, norm_layer, bn_momentum)\n', (1798, 1859), False, 'from xmuda.models.modules import Process, Upsample, Downsample\n'), ((1884, 1953), 'xmuda... |
from numbers import Number
from typing import TypeVar
import numpy as np
from matplotlib import pyplot as plt
x = np.linspace(0.01, 1, 100)
T = TypeVar("T", Number, np.ndarray)
gamma_vector = np.vectorize(np.math.gamma)
def factorial(a: T) -> T:
return gamma_vector(a + 1)
def R(x: T, N: int) -> T:
retur... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.linspace",
"numpy.vectorize",
"matplotlib.pyplot.legend",
"typing.TypeVar"
] | [((116, 141), 'numpy.linspace', 'np.linspace', (['(0.01)', '(1)', '(100)'], {}), '(0.01, 1, 100)\n', (127, 141), True, 'import numpy as np\n'), ((147, 179), 'typing.TypeVar', 'TypeVar', (['"""T"""', 'Number', 'np.ndarray'], {}), "('T', Number, np.ndarray)\n", (154, 179), False, 'from typing import TypeVar\n'), ((196, 2... |
"""
This example shows how to use a variant of a 1 dimensional
Moving Least Squares (MLS) algorithm to project a cloud
of unordered points to become a smooth line.
The parameter f controls the size of the local regression.
If showNLines>0 an actor is built demonstrating the
details of the regression for some random poi... | [
"numpy.random.shuffle"
] | [((768, 790), 'numpy.random.shuffle', 'np.random.shuffle', (['pts'], {}), '(pts)\n', (785, 790), True, 'import numpy as np\n')] |
import argparse
import os
import torch
import torch.nn as nn
import torch.utils.data
import torch.nn.functional as F
import utils.logger as logger
import torch.backends.cudnn as cudnn
# https://forums.developer.nvidia.com/t/onnx-to-tensorrt-conversion-fails/180953/5
# https://github.com/NVIDIA/TensorRT/issues/805
# --... | [
"onnx.save",
"numpy.array",
"onnx.load",
"tensorrt.Builder",
"tensorrt.OnnxParser",
"argparse.ArgumentParser",
"torch2trt.torch2trt",
"os.path.isdir",
"onnx_graphsurgeon.export_onnx",
"common.GiB",
"torch.onnx.export",
"mmcv.onnx.symbolic.register_extra_symbolics",
"onnxsim.simplify",
"uti... | [((568, 630), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Anynet fintune on KITTI"""'}), "(description='Anynet fintune on KITTI')\n", (591, 630), False, 'import argparse\n'), ((2634, 2664), 'tensorrt.Logger', 'trt.Logger', (['trt.Logger.WARNING'], {}), '(trt.Logger.WARNING)\n', (2644,... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 10 16:37:54 2018
Modified on Mon Jul 22
@author: Purnendu Mishra
"""
import cv2
import numpy as np
import pandas as pd
from skimage import io,color
from keras import backend as K
from keras.utils import Sequence, to_categorical
#from keras.prep... | [
"cv2.warpAffine",
"keras.backend.image_data_format",
"numpy.isscalar",
"random.shuffle",
"xml.etree.ElementTree.parse",
"numpy.random.random",
"utility.point_form",
"pathlib.Path.home",
"keras.utils.to_categorical",
"numpy.array",
"skimage.io.imread",
"numpy.zeros",
"numpy.random.seed",
"n... | [((1031, 1046), 'skimage.io.imread', 'io.imread', (['path'], {}), '(path)\n', (1040, 1046), False, 'from skimage import io, color\n'), ((1086, 1145), 'cv2.resize', 'cv2.resize', (['img', 'target_size'], {'interpolation': 'cv2.INTER_CUBIC'}), '(img, target_size, interpolation=cv2.INTER_CUBIC)\n', (1096, 1145), False, 'i... |
from __future__ import division
#/usr/bin/python
__version__ = '0.324.2'
__author__ = '<EMAIL>'
##
## Generic imports
import os
import csv
import PyPDF2
import warnings
import peakutils
import matplotlib
import collections
import numpy as np
import scipy as sp
matplotlib.use('Agg')
import logging as log
import seabor... | [
"logging.getLogger",
"matplotlib.pyplot.ylabel",
"peakutils.indexes",
"numpy.array",
"scipy.stats.sem",
"PyPDF2.PdfFileWriter",
"numpy.arange",
"os.remove",
"numpy.mean",
"seaborn.set",
"os.listdir",
"numpy.where",
"matplotlib.pyplot.xlabel",
"numpy.asarray",
"matplotlib.pyplot.close",
... | [((263, 284), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (277, 284), False, 'import matplotlib\n'), ((1340, 1365), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (1363, 1365), False, 'import collections\n'), ((3494, 3687), 'sklearn.svm.LinearSVC', 'svm.LinearSVC', ([]... |
import numpy as np
from scipy.stats import gamma
from evalml.data_checks import (
DataCheck,
DataCheckMessageCode,
DataCheckWarning
)
from evalml.utils import _convert_woodwork_types_wrapper, infer_feature_types
class OutliersDataCheck(DataCheck):
"""Checks if there are any outliers in input data by ... | [
"scipy.stats.gamma.cdf",
"evalml.utils.infer_feature_types",
"numpy.log",
"numpy.exp",
"numpy.percentile",
"evalml.data_checks.DataCheckWarning"
] | [((1959, 1981), 'evalml.utils.infer_feature_types', 'infer_feature_types', (['X'], {}), '(X)\n', (1978, 1981), False, 'from evalml.utils import _convert_woodwork_types_wrapper, infer_feature_types\n'), ((4913, 4932), 'numpy.log', 'np.log', (['num_records'], {}), '(num_records)\n', (4919, 4932), True, 'import numpy as n... |
"""Uniform hazard spectra benchmark tests"""
import os
import pathlib
import yaml
import pytest
import pandas as pd
import numpy as np
from gmhazard_calc import site
from gmhazard_calc import uhs
from gmhazard_calc import gm_data
from gmhazard_calc import constants
from gmhazard_calc.im import IMType, IM_COMPONENT_MA... | [
"gmhazard_calc.uhs.EnsembleUHSResult.combine_results",
"pandas.read_csv",
"pathlib.Path",
"os.getenv",
"numpy.asanyarray",
"yaml.safe_load",
"pytest.fixture",
"pandas.testing.assert_frame_equal",
"gmhazard_calc.gm_data.Ensemble",
"gmhazard_calc.site.get_site_from_name"
] | [((342, 372), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (356, 372), False, 'import pytest\n'), ((532, 549), 'yaml.safe_load', 'yaml.safe_load', (['f'], {}), '(f)\n', (546, 549), False, 'import yaml\n'), ((835, 884), 'pandas.testing.assert_frame_equal', 'pd.testing.assert... |
'''This module implements concrete agent controllers for the rollout worker'''
import copy
import time
from collections import OrderedDict
import math
import numpy as np
import rospy
import logging
from gazebo_msgs.msg import ModelState
from std_msgs.msg import Float64
from shapely.geometry import Point
from markov.vi... | [
"markov.agent_ctrl.utils.get_speed_factor",
"markov.visual_effects.effects.blink_effect.BlinkEffect",
"shapely.geometry.Point",
"numpy.array",
"markov.gazebo_tracker.trackers.set_model_state_tracker.SetModelStateTracker.get_instance",
"math.isinf",
"markov.agent_ctrl.utils.set_reward_and_metrics",
"co... | [((2006, 2036), 'markov.agent_ctrl.utils.Logger', 'Logger', (['__name__', 'logging.INFO'], {}), '(__name__, logging.INFO)\n', (2012, 2036), False, 'from markov.agent_ctrl.utils import set_reward_and_metrics, send_action, load_action_space, get_speed_factor, get_normalized_progress, Logger\n'), ((2690, 2732), 'markov.re... |
import cv2
from cv2 import cvtColor
import numpy as np
def get_detect_lanes(image, filter='laplacian'):
grayscale_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
if filter.lower() == 'laplacian':
edge_kernel = np.array([
[0, 1, 0],
[1, -4, 1],
... | [
"cv2.filter2D",
"cv2.imshow",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.Canny",
"cv2.waitKey"
] | [((565, 616), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""videos/lane_detection_video.mp4"""'], {}), "('videos/lane_detection_video.mp4')\n", (581, 616), False, 'import cv2\n'), ((850, 873), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (871, 873), False, 'import cv2\n'), ((128, 167), 'cv2.cvtCo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.