code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2018 <NAME>
""" Container class for optical usage information
.. Created on Thu Jan 25 11:01:04 2018
.. codeauthor: <NAME>
"""
import math
import numpy as np
from rayoptics.parax.firstorder import compute_first_order, list_parax_trace
from rayoptics.raytr... | [
"rayoptics.raytr.trace.aim_chief_ray",
"rayoptics.parax.firstorder.compute_first_order",
"math.sqrt",
"rayoptics.optical.model_enums.get_ape_type_for_key",
"numpy.array",
"rayoptics.util.colors.accent_colors",
"opticalglass.spectral_lines.get_wavelength",
"numpy.deg2rad",
"rayoptics.optical.model_en... | [((5738, 5780), 'rayoptics.parax.firstorder.list_parax_trace', 'list_parax_trace', (['self.opt_model'], {}), '(self.opt_model, **kwargs)\n', (5754, 5780), False, 'from rayoptics.parax.firstorder import compute_first_order, list_parax_trace\n'), ((7233, 7255), 'rayoptics.util.colors.accent_colors', 'colors.accent_colors... |
# -*- coding: utf-8 -*-
import numpy as np
import chainer
from chainer import cuda, Function, gradient_check, Variable
from chainer import optimizers, serializers, utils
from chainer import Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
import sys
sys.path.append("//tera/user/boku/study/... | [
"chainer.functions.mean_squared_error",
"numpy.fromfile",
"matplotlib.pyplot.grid",
"pickle.dump",
"numpy.average",
"chainer.optimizers.Adam",
"chainer.Variable",
"matplotlib.pyplot.plot",
"pickle.load",
"csv.writer",
"numpy.max",
"chainer.links.Linear",
"numpy.min",
"sys.path.append",
"... | [((280, 324), 'sys.path.append', 'sys.path.append', (['"""//tera/user/boku/study/nn"""'], {}), "('//tera/user/boku/study/nn')\n", (295, 324), False, 'import sys\n'), ((784, 817), 'numpy.fromfile', 'np.fromfile', (['argvs[1]', 'np.float64'], {}), '(argvs[1], np.float64)\n', (795, 817), True, 'import numpy as np\n'), ((9... |
# -*- coding: utf-8 -*-
"""
examples from: https://likegeeks.com/python-gui-examples-tkinter-tutorial/
"""
import numpy as np
from tkinter import *
window = Tk()
window.title("Welcome")
window.geometry('400x600')
# 1st func
n = 0
lbl = Label(window, text="Extract continuous pages")
lbl.grid(colu... | [
"tkinter.Menu",
"numpy.sign"
] | [((3736, 3748), 'tkinter.Menu', 'Menu', (['window'], {}), '(window)\n', (3740, 3748), False, 'from tkinter import Menu\n'), ((3762, 3772), 'tkinter.Menu', 'Menu', (['menu'], {}), '(menu)\n', (3766, 3772), False, 'from tkinter import Menu\n'), ((3786, 3796), 'tkinter.Menu', 'Menu', (['menu'], {}), '(menu)\n', (3790, 379... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class UNet(nn.Module):
def __init__(self, nefilters=24):
super(UNet, self).__init__()
print('random unet')
nlayers = 12
self.num_layers = nlayers
self.nefilters = nefilters
... | [
"torch.nn.functional.upsample",
"torch.nn.functional.leaky_relu",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.ModuleList",
"torch.nn.BatchNorm1d",
"numpy.random.randint",
"torch.nn.Conv1d",
"torch.cat"
] | [((427, 442), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (440, 442), True, 'import torch.nn as nn\n'), ((468, 483), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (481, 483), True, 'import torch.nn as nn\n'), ((509, 524), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (522, 524), Tr... |
# Copyright (c) OpenMMLab. All rights reserved.
from re import L
import numpy as np
import torch
from logging import warning
def limit_period(val, offset=0.5, period=np.pi):
"""Limit the value into a period for periodic function.
Args:
val (torch.Tensor): The value to be converted.
offset (fl... | [
"torch.ones_like",
"logging.warning.warn",
"torch.eye",
"torch.atan2",
"torch.sin",
"torch.floor",
"torch.stack",
"torch.cos",
"torch.einsum",
"numpy.cos",
"numpy.concatenate",
"torch.zeros_like",
"torch.zeros",
"torch.cat",
"numpy.arctan"
] | [((1162, 1179), 'torch.sin', 'torch.sin', (['angles'], {}), '(angles)\n', (1171, 1179), False, 'import torch\n'), ((1194, 1211), 'torch.cos', 'torch.cos', (['angles'], {}), '(angles)\n', (1203, 1211), False, 'import torch\n'), ((1223, 1247), 'torch.ones_like', 'torch.ones_like', (['rot_cos'], {}), '(rot_cos)\n', (1238,... |
import os
from typing import Any, Dict, List
import numpy as np
import pytest
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
from torchmetrics.functional.text.bert import bert_score as metrics_bert_score
from torchmetrics.text.bert import BERTScore
from torchmetrics.utilities.imports... | [
"torchmetrics.text.bert.BERTScore",
"numpy.allclose",
"torch.distributed.destroy_process_group",
"torch.multiprocessing.spawn",
"pytest.mark.parametrize",
"bert_score.score",
"pytest.mark.skipif",
"torch.distributed.is_available",
"torch.distributed.init_process_group",
"torchmetrics.functional.te... | [((1884, 1944), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""preds,targets"""', '[(preds, targets)]'], {}), "('preds,targets', [(preds, targets)])\n", (1907, 1944), False, 'import pytest\n'), ((1957, 2036), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not _BERTSCORE_AVAILABLE)'], {'reason': '"""test r... |
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import json
import os
import os.path as osp
import numpy as np
import itertools
DIV_LINE_WIDTH = 50
# Global vars for tracking and labeling data at load time.
exp_idx = 0
units = dict()
def smoothed(data, window):
"""
smooth data with... | [
"numpy.convolve",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.fill_between",
"os.walk",
"seaborn.set",
"os.listdir",
"argparse.ArgumentParser",
"seaborn.color_palette",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.asarray",
"os.path.isdir",
"matplotlib.pyplot.savefig",
"... | [((582, 597), 'numpy.ones', 'np.ones', (['window'], {}), '(window)\n', (589, 597), True, 'import numpy as np\n'), ((1214, 1262), 'seaborn.set', 'sns.set', ([], {'style': '"""darkgrid"""', 'font_scale': 'font_scale'}), "(style='darkgrid', font_scale=font_scale)\n", (1221, 1262), True, 'import seaborn as sns\n'), ((1270,... |
"""
Nonnegative CP decomposition by Hierarchical alternating least squares (HALS).
Author: <NAME> <<EMAIL>>
"""
import numpy as np
import numba
from tensortools.operations import unfold, khatri_rao
from tensortools.tensors import KTensor
from tensortools.optimize import FitResult, optim_utils
def ncp_hals(
... | [
"tensortools.optimize.optim_utils._check_cpd_inputs",
"numpy.copy",
"numpy.mean",
"numpy.prod",
"tensortools.operations.khatri_rao",
"tensortools.operations.unfold",
"numpy.sqrt",
"tensortools.optimize.FitResult",
"tensortools.optimize.optim_utils._get_initial_ktensor",
"numpy.sum",
"numba.jit",... | [((5575, 5599), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (5584, 5599), False, 'import numba\n'), ((3403, 3441), 'tensortools.optimize.optim_utils._check_cpd_inputs', 'optim_utils._check_cpd_inputs', (['X', 'rank'], {}), '(X, rank)\n', (3432, 3441), False, 'from tensortools.optimize i... |
#pythran export conv(float[][], float[][])
#runas import numpy as np ; x = np.tri(300,300)*0.5 ; w = np.tri(5,5)*0.25 ; conv(x,w)
#bench import numpy as np ; x = np.tri(150,150)*0.5 ; w = np.tri(5,5)*0.25 ; conv(x,w)
import numpy as np
def clamp(i, offset, maxval):
j = max(0, i + offset)
return min(j, maxval)
... | [
"numpy.zeros_like"
] | [((499, 515), 'numpy.zeros_like', 'np.zeros_like', (['x'], {}), '(x)\n', (512, 515), True, 'import numpy as np\n')] |
"""
MIT License
Copyright (c) 2017 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... | [
"numpy.exp",
"numpy.array",
"numpy.zeros",
"itertools.count",
"numpy.linalg.norm"
] | [((1351, 1377), 'numpy.zeros', 'np.zeros', (['(h, w, dim_feat)'], {}), '((h, w, dim_feat))\n', (1359, 1377), True, 'import numpy as np\n'), ((1544, 1560), 'numpy.zeros', 'np.zeros', (['(h, w)'], {}), '((h, w))\n', (1552, 1560), True, 'import numpy as np\n'), ((2277, 2294), 'itertools.count', 'itertools.count', ([], {})... |
import numpy as np
from .other import clip_boxes
from .text_proposal_graph_builder import TextProposalGraphBuilder
class TextProposalConnector:
def __init__(self):
self.graph_builder=TextProposalGraphBuilder()
def group_text_proposals(self, text_proposals, scores, im_size):
graph=self... | [
"numpy.max",
"numpy.sum",
"numpy.min",
"numpy.polyfit"
] | [((568, 585), 'numpy.sum', 'np.sum', (['(X == X[0])'], {}), '(X == X[0])\n', (574, 585), True, 'import numpy as np\n'), ((645, 664), 'numpy.polyfit', 'np.polyfit', (['X', 'Y', '(1)'], {}), '(X, Y, 1)\n', (655, 664), True, 'import numpy as np\n'), ((1067, 1096), 'numpy.min', 'np.min', (['text_line_boxes[:, 0]'], {}), '(... |
from typing import List
import numpy as np
import pandas as pd
from category_encoders.backward_difference import BackwardDifferenceEncoder
from category_encoders.cat_boost import CatBoostEncoder
from category_encoders.helmert import HelmertEncoder
from category_encoders.james_stein import JamesSteinEncoder
from catego... | [
"category_encoders.target_encoder.TargetEncoder",
"category_encoders.backward_difference.BackwardDifferenceEncoder",
"category_encoders.one_hot.OneHotEncoder",
"category_encoders.james_stein.JamesSteinEncoder",
"numpy.unique",
"category_encoders.cat_boost.CatBoostEncoder",
"numpy.hstack",
"category_en... | [((10098, 10114), 'pandas.DataFrame', 'pd.DataFrame', (['{}'], {}), '({})\n', (10110, 10114), True, 'import pandas as pd\n'), ((10248, 10281), 'category_encoders.cat_boost.CatBoostEncoder', 'CatBoostEncoder', ([], {'cols': "['cat_col']"}), "(cols=['cat_col'])\n", (10263, 10281), False, 'from category_encoders.cat_boost... |
import pickle
import struct
from unittest import mock
import numpy as np
import pytest
import pygeos
from .common import all_types, empty_point, point, point_z
# fmt: off
POINT11_WKB = b"\x01\x01\x00\x00\x00" + struct.pack("<2d", 1.0, 1.0)
NAN = struct.pack("<d", float("nan"))
POINT_NAN_WKB = b'\x01\x01\x00\x00\x00... | [
"pygeos.equals",
"pickle.dumps",
"pygeos.set_srid",
"numpy.int32",
"numpy.array",
"pygeos.to_wkb",
"pygeos.is_geometry",
"pygeos.from_wkt",
"pickle.loads",
"pygeos.geometrycollections",
"unittest.mock.patch",
"numpy.arange",
"pygeos.to_wkt",
"pygeos.get_srid",
"pygeos.Geometry",
"pytes... | [((3519, 3561), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""geom"""', 'all_types'], {}), "('geom', all_types)\n", (3542, 3561), False, 'import pytest\n'), ((3703, 3819), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""wkt"""', "('POINT EMPTY', 'LINESTRING EMPTY', 'POLYGON EMPTY', 'GEOMETRYCO... |
#!/usr/bin/env python3
# coding: utf8
"""
Normalizes real and imagninary matrix values, used for the leakyrelu model.
"""
__author__ = '<NAME>, <NAME>, <NAME>'
__email__ = "<EMAIL>"
import numpy as np
import math
name = 'norm_real_imag'
def normalize(track_complex):
"""
Normalizes training data to use onl... | [
"numpy.abs",
"numpy.reshape",
"numpy.angle"
] | [((357, 378), 'numpy.abs', 'np.abs', (['track_complex'], {}), '(track_complex)\n', (363, 378), True, 'import numpy as np\n'), ((395, 440), 'numpy.reshape', 'np.reshape', (['magnitude', '(magnitude.shape + (1,))'], {}), '(magnitude, magnitude.shape + (1,))\n', (405, 440), True, 'import numpy as np\n'), ((609, 672), 'num... |
# Copyright 2020 MONAI Consortium
# 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 writing, s... | [
"parameterized.parameterized.expand",
"numpy.testing.assert_allclose",
"numpy.stack",
"unittest.main",
"monai.transforms.RandRotate"
] | [((833, 1030), 'parameterized.parameterized.expand', 'parameterized.expand', (["[(90, True, 'bilinear', 'border', False), (45, True, 'nearest', 'border', \n False), (180, False, 'nearest', 'zeros', True), ((-45, 0), False,\n 'nearest', 'zeros', True)]"], {}), "([(90, True, 'bilinear', 'border', False), (45, True,... |
'''
Example of VRAE on text data
VRAE, like VAE, has a modular design. encoder, decoder, and VRAE are 3 models that share weights. After training the VRAE model,
the encoder can be used to generate latent vectors of text data(sentences/documents).
The decoder can be used to generate embedding vector of text by sampling... | [
"keras.backend.shape",
"keras.backend.sum",
"matplotlib.pyplot.ylabel",
"numpy.array",
"keras.layers.Dense",
"keras.preprocessing.sequence.pad_sequences",
"numpy.arange",
"matplotlib.pyplot.imshow",
"keras.datasets.imdb.load_data",
"argparse.ArgumentParser",
"keras.utils.plot_model",
"matplotl... | [((4022, 4060), 'keras.datasets.imdb.load_data', 'imdb.load_data', ([], {'num_words': 'max_features'}), '(num_words=max_features)\n', (4036, 4060), False, 'from keras.datasets import imdb\n'), ((4188, 4234), 'keras.preprocessing.sequence.pad_sequences', 'sequence.pad_sequences', (['x_train'], {'maxlen': 'maxlen'}), '(x... |
import numpy as np
import sys,os
import cv2
caffe_root = '/home/yaochuanqi/work/tmp/ssd/'
sys.path.insert(0, caffe_root + 'python')
import caffe
net_file= 'ssdlite/coco/deploy.prototxt'
caffe_model='ssdlite/deploy.caffemodel'
test_dir = "images"
caffe.set_mode_cpu()
net = caffe.Net(net_file,caffe_model,caf... | [
"cv2.rectangle",
"sys.path.insert",
"os.listdir",
"cv2.imshow",
"cv2.putText",
"numpy.array",
"cv2.waitKey",
"caffe.Net",
"caffe.set_mode_cpu",
"cv2.resize",
"cv2.imread"
] | [((94, 135), 'sys.path.insert', 'sys.path.insert', (['(0)', "(caffe_root + 'python')"], {}), "(0, caffe_root + 'python')\n", (109, 135), False, 'import sys, os\n'), ((259, 279), 'caffe.set_mode_cpu', 'caffe.set_mode_cpu', ([], {}), '()\n', (277, 279), False, 'import caffe\n'), ((286, 330), 'caffe.Net', 'caffe.Net', (['... |
import rospy
import rospkg
import numpy as np
import os
import sys
import tensorflow as tf
from collections import defaultdict
from utils import label_map_util
from utils import visualization_utils as vis_util
import time
from styx_msgs.msg import TrafficLight
SIM_MODEL_PATH = 'light_classification/model_files/frozen... | [
"utils.label_map_util.load_labelmap",
"tensorflow.Graph",
"tensorflow.Session",
"os.path.join",
"tensorflow.GraphDef",
"utils.label_map_util.convert_label_map_to_categories",
"os.getcwd",
"numpy.squeeze",
"utils.label_map_util.create_category_index",
"numpy.expand_dims",
"tensorflow.import_graph... | [((633, 644), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (642, 644), False, 'import os\n'), ((656, 694), 'os.path.join', 'os.path.join', (['CWD_PATH', 'SIM_MODEL_PATH'], {}), '(CWD_PATH, SIM_MODEL_PATH)\n', (668, 694), False, 'import os\n'), ((784, 819), 'os.path.join', 'os.path.join', (['CWD_PATH', 'LABELS_PATH'], {}... |
import numpy as np
import pandas as pd
from scipy.linalg import toeplitz
import sys
import os
from config import config
import timecorr as tc
from matplotlib import pyplot as plt
import seaborn as sns
sim_function = sys.argv[1]
r = sys.argv[2] #reps
F = int(sys.argv[3]) #number of features
T = int(sys.argv[4]) #numbe... | [
"os.path.exists",
"numpy.eye",
"numpy.sqrt",
"os.makedirs",
"timecorr.vec2mat",
"timecorr.mat2vec",
"pandas.read_csv",
"timecorr.timecorr",
"numpy.corrcoef",
"os.path.isfile",
"numpy.kron",
"numpy.zeros",
"timecorr.simulate_data",
"pandas.DataFrame",
"numpy.arange"
] | [((777, 790), 'timecorr.vec2mat', 'tc.vec2mat', (['v'], {}), '(v)\n', (787, 790), True, 'import timecorr as tc\n'), ((797, 836), 'numpy.zeros', 'np.zeros', (['[v.shape[0], m.shape[0] ** 2]'], {}), '([v.shape[0], m.shape[0] ** 2])\n', (805, 836), True, 'import numpy as np\n'), ((1278, 1287), 'numpy.eye', 'np.eye', (['T'... |
'''
#TODO refactor this module
'''
import numpy as np
from pathlib import Path
import pandas as pd
import sys
from file_py_helper.ExtraInfo import EC_Properties
if __name__ == "__main__":
pass
import logging
logger = logging.getLogger(__name__)
def RHE_potential_assignment(ovv_row):
"""
This function... | [
"logging.getLogger",
"numpy.abs",
"numpy.isclose",
"pathlib.Path",
"file_py_helper.ExtraInfo.EC_Properties.guess_RHE_from_Electrolyte",
"pandas.Timedelta",
"numpy.array"
] | [((226, 253), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (243, 253), False, 'import logging\n'), ((823, 843), 'numpy.abs', 'np.abs', (['CVrow.RHE_fn'], {}), '(CVrow.RHE_fn)\n', (829, 843), True, 'import numpy as np\n'), ((921, 941), 'numpy.abs', 'np.abs', (['CVrow.RHE_fn'], {}), '(CVr... |
import threading, queue, time
from queue import Queue
from threading import Thread, currentThread
import os
from CalibrateTransfer.img_operation import ScreenSHot_batch
from CalibrateTransfer.data_preprocess import write_data_to_json_file, read_data_from_json_file_v2
import numpy as np
import torch.utils.data as data... | [
"ReID_model.utils.dataset_loader.ReID_imgs_load_by_home_and_away",
"utils.log.Log",
"os.path.exists",
"numpy.histogram",
"os.listdir",
"numpy.where",
"utils.timer.Timer",
"utils_BINGO.K_Means.k_means",
"os.getpid",
"torchvision.transforms.ToTensor",
"SVHN.svhn.load_in_Svhn_model",
"threading.c... | [((1524, 1593), 'CalibrateTransfer.data_preprocess.read_data_from_json_file_v2', 'read_data_from_json_file_v2', (['self.root_path', 'self.file_name', 'self.opt'], {}), '(self.root_path, self.file_name, self.opt)\n', (1551, 1593), False, 'from CalibrateTransfer.data_preprocess import write_data_to_json_file, read_data_f... |
# command time python /gale/ddn/snm3C/humanPFC/code/impute_cell.py --indir /gale/raidix/rdx-5/zhoujt/projects/methylHiC/PFC_batch_merged/smoothed_matrix/1cell/${res0}b_resolution/chr${c}/ --outdir /gale/ddn/snm3C/humanPFC/smoothed_matrix/${res0}b_resolution/chr${c}/ --cell ${sample} --chrom ${c} --res ${res} --chrom_fi... | [
"os.path.exists",
"cv2.useOptimized",
"numpy.abs",
"numpy.sqrt",
"numpy.triu_indices",
"scipy.sparse.eye",
"numpy.logical_and",
"pandas.read_csv",
"numpy.log2",
"h5py.File",
"scipy.sparse.csr_matrix",
"scipy.sparse.linalg.norm",
"numpy.loadtxt",
"time.time",
"numpy.arange"
] | [((906, 924), 'cv2.useOptimized', 'cv2.useOptimized', ([], {}), '()\n', (922, 924), False, 'import cv2\n'), ((2938, 2949), 'time.time', 'time.time', ([], {}), '()\n', (2947, 2949), False, 'import time\n'), ((2999, 3035), 'numpy.loadtxt', 'np.loadtxt', (['f"""{indir}{cell}_{c}.txt"""'], {}), "(f'{indir}{cell}_{c}.txt')\... |
# _*_ coding: utf-8 _*_
__author__ = 'LelandYan'
__date__ = '2019/5/19 7:42'
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage as ndi
import skimage as sm
from skimage import morphology
from skimage.feature import peak_local_max
from skimage.io import imshow
from skimage.color imp... | [
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.approxPolyDP",
"matplotlib.pyplot.imshow",
"cv2.threshold",
"cv2.erode",
"cv2.arcLength",
"scipy.ndimage.label",
"cv2.contourArea",
"cv2.waitKey",
"skimage.morphology.watershed",
"scipy.ndimage.distance_transform_edt",
"cv2.drawContours",
"numpy.... | [((1813, 1843), 'cv2.imread', 'cv2.imread', (['"""./raw_data/4.jpg"""'], {}), "('./raw_data/4.jpg')\n", (1823, 1843), False, 'import cv2\n'), ((1851, 1890), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2GRAY'], {}), '(image, cv2.COLOR_BGR2GRAY)\n', (1863, 1890), False, 'import cv2\n'), ((1905, 1973), 'cv2.t... |
"""Sub-classes for vtk.vtkRectilinearGrid and vtk.vtkImageData."""
import pathlib
import logging
import numpy as np
import pyvista
from pyvista import _vtk
from pyvista.utilities import abstract_class
from .dataset import DataSet
from .filters import _get_output, UniformGridFilters
log = logging.getLogger(__name__)... | [
"logging.getLogger",
"pyvista._vtk.vtkRectilinearGridToPointSet",
"pyvista._vtk.numpy_to_vtk",
"numpy.full",
"pyvista.RectilinearGrid",
"numpy.array",
"pyvista._vtk.vtkImageToStructuredGrid",
"numpy.meshgrid"
] | [((293, 320), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (310, 320), False, 'import logging\n'), ((5379, 5429), 'numpy.meshgrid', 'np.meshgrid', (['self.x', 'self.y', 'self.z'], {'indexing': '"""ij"""'}), "(self.x, self.y, self.z, indexing='ij')\n", (5390, 5429), True, 'import numpy a... |
from matrix_builder import UserItemMatrix
from repr_learner import RepresentationLearner
from user_matcher import UserMatcher
from user_pool_manager import UserPoolManager
from threading import Lock
import scipy
import pandas as pd
import numpy as np
import thread
import time
import sets
PlayingUserPool = []
PlayingU... | [
"threading.Lock",
"time.sleep",
"numpy.array",
"user_matcher.UserMatcher",
"user_pool_manager.UserPoolManager",
"thread.start_new_thread",
"repr_learner.RepresentationLearner.load"
] | [((330, 336), 'threading.Lock', 'Lock', ([], {}), '()\n', (334, 336), False, 'from threading import Lock\n'), ((348, 365), 'user_pool_manager.UserPoolManager', 'UserPoolManager', ([], {}), '()\n', (363, 365), False, 'from user_pool_manager import UserPoolManager\n'), ((2655, 2696), 'thread.start_new_thread', 'thread.st... |
import numpy
import pint.compat
from openff.evaluator import unit
class ParameterGradientKey:
@property
def tag(self):
return self._tag
@property
def smirks(self):
return self._smirks
@property
def attribute(self):
return self._attribute
def __init__(self, tag=N... | [
"numpy.allclose"
] | [((4281, 4320), 'numpy.allclose', 'numpy.allclose', (['self.value', 'other.value'], {}), '(self.value, other.value)\n', (4295, 4320), False, 'import numpy\n')] |
"""Define the ExternalCodeComp and ExternalCodeImplicitComp classes."""
from __future__ import print_function
import os
import sys
import numpy.distutils
from numpy.distutils.exec_command import find_executable
from openmdao.core.analysis_error import AnalysisError
from openmdao.core.explicitcomponent import Explici... | [
"os.path.exists",
"openmdao.core.analysis_error.AnalysisError",
"openmdao.utils.shell_proc.ShellProc",
"numpy.distutils.exec_command.find_executable",
"openmdao.utils.general_utils.warn_deprecation"
] | [((7245, 7280), 'numpy.distutils.exec_command.find_executable', 'find_executable', (['program_to_execute'], {}), '(program_to_execute)\n', (7260, 7280), False, 'from numpy.distutils.exec_command import find_executable\n'), ((7637, 7738), 'openmdao.utils.shell_proc.ShellProc', 'ShellProc', (['command_for_shell_proc', 'c... |
# coding=utf-8
# Copyright 2020 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"trax.layers.metrics._Accuracy",
"numpy.ones",
"trax.shapes.signature",
"numpy.testing.assert_allclose",
"trax.layers.metrics._WeightedMean",
"absl.testing.absltest.main",
"numpy.array",
"trax.layers.AccuracyScalar",
"trax.layers.metrics._WeightedSequenceMean",
"trax.layers.CrossEntropyLoss",
"t... | [((3654, 3669), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (3667, 3669), False, 'from absl.testing import absltest\n'), ((869, 892), 'trax.layers.metrics._CrossEntropy', 'metrics._CrossEntropy', ([], {}), '()\n', (890, 892), False, 'from trax.layers import metrics\n'), ((1056, 1075), 'trax.layers.... |
import copy
import numpy as np
import sys
import vnmrjpy as vj
import time
class Admm():
"""Alternating Direction Method of Multipliers solver for Aloha
Tuned for ALOHA MRI reconstruction framework, not for general use yet.
Lmafit estimates the rank, then Admm is used to enforce the hankel structure
... | [
"vnmrjpy.aloha.construct_hankel",
"numpy.eye",
"vnmrjpy.aloha.deconstruct_hankel",
"numpy.ones",
"numpy.array",
"numpy.zeros",
"copy.deepcopy"
] | [((1379, 1419), 'numpy.array', 'np.array', (['hankel_mask'], {'dtype': '"""complex64"""'}), "(hankel_mask, dtype='complex64')\n", (1387, 1419), True, 'import numpy as np\n'), ((2167, 2193), 'copy.deepcopy', 'copy.deepcopy', (['fiber_stage'], {}), '(fiber_stage)\n', (2180, 2193), False, 'import copy\n'), ((2242, 2283), ... |
import nltk
nltk.download('punkt')
nltk.download('wordnet')
nltk.download('omw-1.4')
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
import pickle
import numpy as np
from keras.models import load_model
model = load_model('weights/chatbot_model.h5')
import json
import random
intents = json.load... | [
"random.choice",
"keras.models.load_model",
"nltk.word_tokenize",
"nltk.download",
"nltk.stem.WordNetLemmatizer",
"numpy.array"
] | [((12, 34), 'nltk.download', 'nltk.download', (['"""punkt"""'], {}), "('punkt')\n", (25, 34), False, 'import nltk\n'), ((35, 59), 'nltk.download', 'nltk.download', (['"""wordnet"""'], {}), "('wordnet')\n", (48, 59), False, 'import nltk\n'), ((60, 84), 'nltk.download', 'nltk.download', (['"""omw-1.4"""'], {}), "('omw-1.... |
import uuid
class Pedestrian:
def __init__(self,bbox,label,confidence):
self.id = str(uuid.uuid4())
self.bbox = bbox
self.label = label
self.centroid = find_centroid(bbox)
self.confidence = confidence
def find_centroid(self,bbox):
'''This function computes the coordinates of the cente... | [
"numpy.ones",
"uuid.uuid4",
"numpy.diag",
"numpy.array",
"numpy.dot",
"scipy.linalg.block_diag",
"scipy.linalg.inv"
] | [((1922, 2179), 'numpy.array', 'np.array', (['[[1, self.dt, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, self.\n dt, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, self.dt, 0, \n 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1, self.dt], [0, 0, 0,\n 0, 0, 0, 0, 1]]'], {}), '([[1, self.dt, ... |
import matplotlib.pyplot as plt
import os
import numpy as np
from scipy import ndimage
from eratosthenes.generic.mapping_io import read_geo_image, make_geo_im
from eratosthenes.generic.mapping_tools import \
pix2map
from eratosthenes.generic.handler_im import \
bilinear_interpolation, rescale_image
from erat... | [
"numpy.radians",
"matplotlib.pyplot.hist",
"numpy.sqrt",
"eratosthenes.processing.coupling_tools.match_pair",
"eratosthenes.preprocessing.image_transforms.gamma_adjustment",
"numpy.arctan2",
"eratosthenes.preprocessing.image_transforms.normalize_histogram",
"numpy.divide",
"eratosthenes.generic.mapp... | [((1709, 1738), 'eratosthenes.input.read_sentinel2.list_central_wavelength_msi', 'list_central_wavelength_msi', ([], {}), '()\n', (1736, 1738), False, 'from eratosthenes.input.read_sentinel2 import list_central_wavelength_msi\n'), ((2005, 2039), 'os.path.join', 'os.path.join', (['s2path', '"""shadow.tif"""'], {}), "(s2... |
import os
from classy_blocks.classes.mesh import Mesh
from classy_blocks.classes.operations import Face, Extrude
import numpy as np
def load_airfoil_file(filename, chord=1):
points_upper = []
points_lower = []
def line_to_numbers(line):
line = line.strip()
p2d = [float(s) for s in line.s... | [
"numpy.flip",
"os.path.join",
"classy_blocks.classes.operations.Face",
"numpy.array",
"classy_blocks.classes.operations.Extrude",
"classy_blocks.classes.mesh.Mesh"
] | [((2551, 2594), 'classy_blocks.classes.operations.Face', 'Face', (['face_top_1_vertices', 'face_top_1_edges'], {}), '(face_top_1_vertices, face_top_1_edges)\n', (2555, 2594), False, 'from classy_blocks.classes.operations import Face, Extrude\n'), ((2678, 2708), 'classy_blocks.classes.operations.Extrude', 'Extrude', (['... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 05 16:40:31 2015
@author: <NAME>
"""
import numpy as np
import sklearn.metrics as skm
import sklearn.ensemble as ske
import sklearn.cross_validation as skcv
"""
Selects some trips from a main driver, and some trips from other drivers from the feature matrix... | [
"numpy.mean",
"numpy.reshape",
"numpy.ones",
"sklearn.cross_validation.cross_val_score",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"numpy.array",
"numpy.zeros",
"numpy.random.randint",
"numpy.count_nonzero",
"numpy.vstack",
... | [((1369, 1392), 'numpy.shape', 'np.shape', (['featureMatrix'], {}), '(featureMatrix)\n', (1377, 1392), True, 'import numpy as np\n'), ((1410, 1457), 'numpy.transpose', 'np.transpose', (['featureMatrix[:, :, mainDriverId]'], {}), '(featureMatrix[:, :, mainDriverId])\n', (1422, 1457), True, 'import numpy as np\n'), ((150... |
import unittest
import numpy as np
import numpy.testing as npt
import wisdem.drivetrainse.layout as lay
import wisdem.drivetrainse.drive_structure as ds
from wisdem.commonse import gravity
npts = 12
class TestDirectStructure(unittest.TestCase):
def setUp(self):
self.inputs = {}
self.outputs = {}... | [
"unittest.TestSuite",
"wisdem.drivetrainse.layout.GearedLayout",
"wisdem.drivetrainse.drive_structure.Bedplate_IBeam_Frame",
"wisdem.drivetrainse.layout.DirectLayout",
"numpy.ones",
"unittest.makeSuite",
"wisdem.drivetrainse.drive_structure.HSS_Frame",
"numpy.array",
"numpy.testing.assert_almost_equ... | [((33603, 33623), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (33621, 33623), False, 'import unittest\n'), ((935, 945), 'numpy.ones', 'np.ones', (['(5)'], {}), '(5)\n', (942, 945), True, 'import numpy as np\n'), ((2104, 2160), 'numpy.array', 'np.array', (['[1000000.0, 500000.0, 500000.0, 0.0, 0.0, 0.0... |
import pdb, sys, os, time, requests, json
import numpy as np
import matplotlib.pyplot as plt
try:
import pysynphot
pysynphotImport = True
except:
pysynphotImport = False
import math
from urllib.parse import quote as urlencode
"""
readStellarTrack()
planetMassFromRadius()
solarSystem()
computeTSM()
"""
RSU... | [
"numpy.log10",
"numpy.sqrt",
"requests.post",
"numpy.longdouble",
"numpy.array",
"numpy.isfinite",
"numpy.arange",
"pysynphot.FileSpectrum",
"json.dumps",
"matplotlib.pyplot.plot",
"numpy.ndim",
"numpy.max",
"numpy.exp",
"numpy.linspace",
"numpy.min",
"pysynphot.Icat",
"numpy.abs",
... | [((563, 588), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (578, 588), False, 'import pdb, sys, os, time, requests, json\n'), ((606, 659), 'os.path.join', 'os.path.join', (['idir', '"""tess-response-function-v2.0.csv"""'], {}), "(idir, 'tess-response-function-v2.0.csv')\n", (618, 659), Fals... |
from typing import Tuple, List, Dict
from numpy.typing import NDArray
import numpy as np
import pandas as pd
from ..ray_tracer.obj_reader import ObjToTriangles
from ...utils import VecNorm, VecDistance, VecAngle, PosBetweenXZ, SortPointsFromPlaneY
from ...utils.constants import EPSILON, MIN_ROOF_EDGE_DISTANCE, ROOF_M... | [
"numpy.copy",
"numpy.sqrt",
"numpy.tan",
"numpy.array",
"numpy.dot",
"numpy.linspace",
"numpy.cos",
"pandas.DataFrame"
] | [((1164, 1180), 'numpy.array', 'np.array', (['tx_pos'], {}), '(tx_pos)\n', (1172, 1180), True, 'import numpy as np\n'), ((1198, 1214), 'numpy.array', 'np.array', (['rx_pos'], {}), '(rx_pos)\n', (1206, 1214), True, 'import numpy as np\n'), ((1877, 1893), 'numpy.array', 'np.array', (['tx_pos'], {}), '(tx_pos)\n', (1885, ... |
import numpy as np
from scipy.stats import multivariate_normal as normal
import matplotlib.pyplot as plt
from matplotlib import cm
from itertools import product
from mpl_toolkits.mplot3d import Axes3D
import tensorflow as tf
from reactions import GMM as tf_GMM
class GMM:
def __init__(self, n=6, ndim=3, cov=0.15, ... | [
"numpy.prod",
"numpy.random.rand",
"numpy.array",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.global_variables_initializer",
"numpy.arange",
"tensorflow.placeholder",
"matplotlib.pyplot.plot",
"itertools.product",
"numpy.max",
"numpy.min",
"matplotlib.cm.get_cmap",
"numpy.random.no... | [((1571, 1592), 'numpy.arange', 'np.arange', (['(0)', '(1)', '(0.01)'], {}), '(0, 1, 0.01)\n', (1580, 1592), True, 'import numpy as np\n'), ((1625, 1638), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (1635, 1638), True, 'import matplotlib.pyplot as plt\n'), ((1643, 1657), 'matplotlib.pyplot.plot', ... |
import numpy as np
import tensorflow as tf
interpreter = tf.lite.Interpreter(model_path="hair_segmentation_512x512_float32.tflite")
# interpreter = tf.lite.Interpreter(model_path="hair_segmentation_512x512_weight_quant.tflite")
interpreter.allocate_tensors()
input_details = interpreter.get_input_details()
output_detai... | [
"tensorflow.lite.Interpreter",
"numpy.random.random_sample"
] | [((58, 132), 'tensorflow.lite.Interpreter', 'tf.lite.Interpreter', ([], {'model_path': '"""hair_segmentation_512x512_float32.tflite"""'}), "(model_path='hair_segmentation_512x512_float32.tflite')\n", (77, 132), True, 'import tensorflow as tf\n'), ((497, 533), 'numpy.random.random_sample', 'np.random.random_sample', (['... |
"""Script to evaluate a dataset fold under a model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from magenta.models.coconet import lib_data
from magenta.models.coconet import lib_evaluation
from magenta.models.coconet import lib_graph
from ... | [
"magenta.models.coconet.lib_evaluation.BaseEvaluator.make",
"tensorflow.logging.set_verbosity",
"magenta.models.coconet.lib_graph.load_checkpoint",
"tensorflow.gfile.MakeDirs",
"tensorflow.app.run",
"magenta.models.coconet.lib_evaluation.evaluate",
"numpy.sort",
"magenta.models.coconet.lib_data.get_da... | [((2340, 2381), 'magenta.models.coconet.lib_graph.load_checkpoint', 'lib_graph.load_checkpoint', (['checkpoint_dir'], {}), '(checkpoint_dir)\n', (2365, 2381), False, 'from magenta.models.coconet import lib_graph\n'), ((2635, 2735), 'magenta.models.coconet.lib_evaluation.BaseEvaluator.make', 'lib_evaluation.BaseEvaluato... |
from pymesh import separate_mesh
from pymesh import merge_meshes
from pymesh import form_mesh
from pymesh import generate_box_mesh
from pymesh.TestCase import TestCase
import numpy as np
class SeparateMeshTest(TestCase):
def test_simple(self):
mesh_1 = generate_box_mesh(np.zeros(3), np.ones(3));
m... | [
"numpy.ones",
"pymesh.merge_meshes",
"numpy.array",
"numpy.zeros",
"pymesh.form_mesh",
"pymesh.separate_mesh"
] | [((405, 435), 'pymesh.merge_meshes', 'merge_meshes', (['[mesh_1, mesh_2]'], {}), '([mesh_1, mesh_2])\n', (417, 435), False, 'from pymesh import merge_meshes\n'), ((459, 482), 'pymesh.separate_mesh', 'separate_mesh', (['out_mesh'], {}), '(out_mesh)\n', (472, 482), False, 'from pymesh import separate_mesh\n'), ((723, 801... |
# 2nd order rotational pressure correction for Stokes equation
# Author: <NAME>, <EMAIL>
import numpy as np
from sympy import symbols, sin, cos, lambdify
from shenfun import *
import matplotlib.pyplot as plt
from matplotlib.ticker import NullFormatter, ScalarFormatter
from mpltools import annotation
pa = {'fill': Fal... | [
"matplotlib.ticker.NullFormatter",
"sympy.sin",
"matplotlib.pyplot.text",
"sympy.cos",
"numpy.ceil",
"matplotlib.pyplot.loglog",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"numpy.arange",
"matplotlib.pyplot.gca",
"sympy.lambdify",
"numpy.log",
"sympy.symbols",
"matplotlib.pypl... | [((422, 451), 'sympy.symbols', 'symbols', (['"""x, y, t"""'], {'real': '(True)'}), "('x, y, t', real=True)\n", (429, 451), False, 'from sympy import symbols, sin, cos, lambdify\n'), ((522, 528), 'sympy.sin', 'sin', (['t'], {}), '(t)\n', (525, 528), False, 'from sympy import symbols, sin, cos, lambdify\n'), ((569, 575),... |
from DejaVu.colorMap import ColorMap
from numpy import array
cm = ColorMap('rwb256')
cfg = {'name': 'rwb256', 'ramp': array([[ 1. , 0. , 0. , 1. ],
[ 0.00798478, 0.006 , 1. , 1. ],
[ 0.01297748, 0.011 , 1. , 1. ],
[ 0.02495463... | [
"numpy.array",
"DejaVu.colorMap.ColorMap"
] | [((66, 84), 'DejaVu.colorMap.ColorMap', 'ColorMap', (['"""rwb256"""'], {}), "('rwb256')\n", (74, 84), False, 'from DejaVu.colorMap import ColorMap\n'), ((118, 9097), 'numpy.array', 'array', (['[[1.0, 0.0, 0.0, 1.0], [0.00798478, 0.006, 1.0, 1.0], [0.01297748, 0.011, \n 1.0, 1.0], [0.02495463, 0.023, 1.0, 1.0], [0.03... |
# -*- coding: utf-8 -*-
"""
Created on 17-8-1
@author: hy_qiu
"""
import base64
import random
import time
import cv2
import numpy
import requests
MAIN_WINDOW_NAME = 'verify'
value1 = 4
max_value2 = 18 #最大旋转角度,10的倍数
value2 = max_value2 // 2 #起始角度,90
value3 = 2
curidx = 0
#RGB Format
COLORS = [... | [
"numpy.uint8",
"numpy.copyto",
"cv2.rectangle",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.imdecode",
"base64.standard_b64decode",
"cv2.resizeWindow",
"cv2.threshold",
"cv2.erode",
"numpy.where",
"cv2.minMaxLoc",
"cv2.addWeighted",
"cv2.distanceTransform",
"cv2.connectedComponents",
"... | [((1368, 1405), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2GRAY'], {}), '(img, cv2.COLOR_BGR2GRAY)\n', (1380, 1405), False, 'import cv2\n'), ((1418, 1437), 'numpy.float32', 'numpy.float32', (['gray'], {}), '(gray)\n', (1431, 1437), False, 'import numpy\n'), ((1449, 1483), 'cv2.cornerHarris', 'cv2.cornerHar... |
# %% [markdown]
# # 📃 Solution for Exercise M5.01
#
# In the previous notebook, we showed how a tree with a depth of 1 level was
# working. The aim of this exercise is to repeat part of the previous
# experiment for a depth with 2 levels to show how the process of partitioning
# is repeated over time.
#
# Before to st... | [
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"numpy.arange",
"sklearn.model_selection.train_test_split",
"sklearn.tree.DecisionTreeClassifier",
"seaborn.scatterplot",
"sklearn.tree.plot_tree",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.legend"
] | [((522, 576), 'pandas.read_csv', 'pd.read_csv', (['"""../datasets/penguins_classification.csv"""'], {}), "('../datasets/penguins_classification.csv')\n", (533, 576), True, 'import pandas as pd\n'), ((1019, 1065), 'sklearn.model_selection.train_test_split', 'train_test_split', (['data', 'target'], {'random_state': '(0)'... |
from trafpy.generator.src.dists import val_dists, node_dists
from trafpy.generator.src import tools
import numpy as np
import time
import copy
import random
from collections import defaultdict # use for initialising arbitrary length nested dict
def create_flow_centric_demand_data(num_demands,
... | [
"trafpy.generator.src.dists.node_dists.gen_node_demands",
"random.choice",
"numpy.delete",
"numpy.sort",
"trafpy.generator.src.tools.gen_event_times",
"numpy.argsort",
"numpy.array",
"collections.defaultdict",
"copy.deepcopy",
"time.time"
] | [((714, 725), 'time.time', 'time.time', ([], {}), '()\n', (723, 725), False, 'import time\n'), ((1442, 1550), 'trafpy.generator.src.dists.node_dists.gen_node_demands', 'node_dists.gen_node_demands', ([], {'eps': 'eps', 'node_dist': 'node_dist', 'num_demands': 'num_demands', 'duplicate': 'duplicate'}), '(eps=eps, node_d... |
import logging
import numpy as np
import tensorflow as tf
from tf_agents.specs import TensorSpec
from envs.utils import Epsilon, TFUniformReplayBufferWrapper
class BaseEnvWrapper:
def __init__(
self,
env,
eval_env,
name,
in_interactor,
out_interactor,
replay... | [
"logging.debug",
"numpy.random.rand",
"envs.utils.Epsilon",
"numpy.random.randint",
"tf_agents.specs.TensorSpec",
"tensorflow.convert_to_tensor",
"tensorflow.expand_dims",
"logging.info"
] | [((700, 873), 'envs.utils.Epsilon', 'Epsilon', ([], {'initial_value': 'epsilon_initial_value', 'end_value': 'epsilon_end_value', 'decay_steps': 'epsilon_decay_steps', 'power': 'epsilon_power', 'identifier': 'f"""Epsilon ({self.name})"""'}), "(initial_value=epsilon_initial_value, end_value=epsilon_end_value,\n decay_... |
# third party
import numpy as np
import pyarrow as pa
import torch
# relative
from ...core.common.serde.serializable import serializable
from ...experimental_flags import ApacheArrowCompression
from ...experimental_flags import flags
from ...proto.lib.numpy.array_pb2 import NumpyProto
from ..torch.tensor_util import t... | [
"pyarrow.BufferOutputStream",
"pyarrow.ipc.write_tensor",
"pyarrow.BufferReader",
"pyarrow.decompress",
"torch.from_numpy",
"pyarrow.compress",
"pyarrow.ipc.read_tensor",
"pyarrow.Tensor.from_numpy",
"numpy.dtype"
] | [((752, 770), 'numpy.dtype', 'np.dtype', (['"""uint16"""'], {}), "('uint16')\n", (760, 770), True, 'import numpy as np\n'), ((786, 804), 'numpy.dtype', 'np.dtype', (['"""uint32"""'], {}), "('uint32')\n", (794, 804), True, 'import numpy as np\n'), ((820, 838), 'numpy.dtype', 'np.dtype', (['"""uint64"""'], {}), "('uint64... |
"""
Author: <NAME>
Modified: <NAME>
"""
import os
import warnings
import numpy as np
import pandas as pd
import pytest
from numpy.testing import assert_almost_equal, assert_allclose
from statsmodels.tools.sm_exceptions import EstimationWarning
from statsmodels.tsa.holtwinters import (ExponentialSmoothing,
... | [
"statsmodels.tsa.holtwinters.Holt",
"pandas.infer_freq",
"statsmodels.tsa.holtwinters.SimpleExpSmoothing",
"numpy.array",
"numpy.arange",
"pandas.date_range",
"pytest.mark.xpass",
"statsmodels.tsa.holtwinters.ExponentialSmoothing",
"pytest.mark.xfail",
"numpy.testing.assert_allclose",
"numpy.asa... | [((16997, 17091), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""trend_seasonal"""', "(('mul', None), (None, 'mul'), ('mul', 'mul'))"], {}), "('trend_seasonal', (('mul', None), (None, 'mul'), (\n 'mul', 'mul')))\n", (17020, 17091), False, 'import pytest\n'), ((17319, 17365), 'pytest.mark.parametrize', '... |
import tensorflow as tf
from baconian.core.core import Basic, EnvSpec
import numpy as np
import abc
from baconian.core.parameters import Parameters
from typeguard import typechecked
from tensorflow.python.ops.parallel_for.gradients import batch_jacobian as tf_batch_jacobian
from baconian.common.logging import Recorder
... | [
"baconian.core.status.StatusWithSingleInfo",
"baconian.common.logging.ConsoleLogger",
"baconian.core.status.register_counter_info_to_status_decorator",
"baconian.common.data_pre_processing.IdenticalDataScaler",
"tensorflow.python.ops.parallel_for.gradients.batch_jacobian",
"tensorflow.split",
"baconian.... | [((2872, 2951), 'baconian.core.status.register_counter_info_to_status_decorator', 'register_counter_info_to_status_decorator', ([], {'increment': '(1)', 'info_key': '"""step_counter"""'}), "(increment=1, info_key='step_counter')\n", (2913, 2951), False, 'from baconian.core.status import register_counter_info_to_status_... |
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: <NAME>, <NAME>, <NAME>
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
from itertools import chain
import numpy as np
import pytest
from... | [
"pymor.operators.constructions.SelectionOperator",
"numpy.allclose",
"pymortests.algorithms.MonomOperator",
"pymor.vectorarrays.numpy.NumpyVectorArray",
"pymortests.pickle.assert_picklable_without_dumps_function",
"pymortests.vectorarray.valid_inds",
"pymortests.vectorarray.invalid_inds",
"pymortests.... | [((1008, 1024), 'pymortests.algorithms.MonomOperator', 'MonomOperator', (['(1)'], {}), '(1)\n', (1021, 1024), False, 'from pymortests.algorithms import MonomOperator\n'), ((1184, 1293), 'pymor.operators.constructions.SelectionOperator', 'SelectionOperator', ([], {'operators': '[p1]', 'boundaries': '[]', 'parameter_func... |
"""
CIE Chromaticity Diagrams Plotting
==================================
Defines the *CIE* chromaticity diagrams plotting objects:
- :func:`colour.plotting.plot_chromaticity_diagram_CIE1931`
- :func:`colour.plotting.plot_chromaticity_diagram_CIE1960UCS`
- :func:`colour.plotting.plot_chromaticity_diagram_CIE197... | [
"numpy.hstack",
"colour.utilities.is_string",
"colour.utilities.validate_method",
"numpy.array",
"colour.algebra.normalise_vector",
"colour.utilities.optional",
"colour.colorimetry.sd_to_XYZ",
"numpy.reshape",
"colour.models.xy_to_XYZ",
"colour.utilities.as_float_array",
"numpy.linspace",
"col... | [((2442, 2458), 'colour.plotting.override_style', 'override_style', ([], {}), '()\n', (2456, 2458), False, 'from colour.plotting import CONSTANTS_COLOUR_STYLE, CONSTANTS_ARROW_STYLE, XYZ_to_plotting_colourspace, artist, filter_cmfs, filter_illuminants, override_style, render, update_settings_collection\n'), ((10574, 10... |
from numpy.random import normal
from numpy import rint
import random
import time
from ortools.linear_solver import pywraplp
def main():
#-------------------------------------------
#randomize code created by Jeremy;
def prMatrix(x):
for row in x:
for val in row:
print(v... | [
"numpy.random.normal",
"time.time",
"ortools.linear_solver.pywraplp.Solver"
] | [((1508, 1601), 'ortools.linear_solver.pywraplp.Solver', 'pywraplp.Solver', (['"""SolveAssignmentProblem"""', 'pywraplp.Solver.CBC_MIXED_INTEGER_PROGRAMMING'], {}), "('SolveAssignmentProblem', pywraplp.Solver.\n CBC_MIXED_INTEGER_PROGRAMMING)\n", (1523, 1601), False, 'from ortools.linear_solver import pywraplp\n'), ... |
# coding: utf-8
from __future__ import print_function, division
import numpy as np
import pyexotica as exo
__all__ = ["check_dynamics_solver_derivatives"]
def check_dynamics_solver_derivatives(name, urdf=None, srdf=None, joint_group=None):
ds = None
if urdf is not None and srdf is not None and joint_group is... | [
"numpy.random.random",
"numpy.testing.assert_allclose",
"pyexotica.Initializers.Initializer",
"pyexotica.Initializers.SceneInitializer",
"pyexotica.Setup.create_dynamics_solver"
] | [((861, 887), 'numpy.random.random', 'np.random.random', (['(ds.nx,)'], {}), '((ds.nx,))\n', (877, 887), True, 'import numpy as np\n'), ((995, 1021), 'numpy.random.random', 'np.random.random', (['(ds.nu,)'], {}), '((ds.nu,))\n', (1011, 1021), True, 'import numpy as np\n'), ((1754, 1815), 'numpy.testing.assert_allclose'... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
from .analysis import polyfit
#for task 2E
def plot_water_levels(station, dates, levels):
"""displays a plot of the water level data against time for a station"""
# Plot
plt.plot(dates, levels)
... | [
"matplotlib.dates.date2num",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axhline",
"numpy.linspace",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((296, 319), 'matplotlib.pyplot.plot', 'plt.plot', (['dates', 'levels'], {}), '(dates, levels)\n', (304, 319), True, 'import matplotlib.pyplot as plt\n'), ((417, 445), 'matplotlib.pyplot.axhline', 'plt.axhline', ([], {'y': 'levelRange[0]'}), '(y=levelRange[0])\n', (428, 445), True, 'import matplotlib.pyplot as plt\n')... |
import numpy as np
from copy import deepcopy
from scipy.spatial import distance_matrix
from scipy.spatial.distance import cdist
import networkx as nx
from molfunc.atoms import NNAtom, Atom
from molfunc.atoms import smiles_to_atoms, xyz_file_to_atoms
from molfunc.bonds import get_avg_bond_length
from molfunc.exceptions ... | [
"molfunc.atoms.xyz_file_to_atoms",
"molfunc_ext.get_minimised_coords",
"molfunc.atoms.NNAtom",
"scipy.spatial.distance_matrix",
"molfunc.utils.requires_atoms",
"networkx.Graph",
"molfunc.bonds.get_avg_bond_length",
"numpy.array",
"numpy.argsort",
"copy.deepcopy",
"rdkit.rdBase.DisableLog",
"mo... | [((440, 472), 'rdkit.rdBase.DisableLog', 'rdBase.DisableLog', (['"""rdApp.error"""'], {}), "('rdApp.error')\n", (457, 472), False, 'from rdkit import rdBase\n'), ((497, 513), 'molfunc.utils.requires_atoms', 'requires_atoms', ([], {}), '()\n', (511, 513), False, 'from molfunc.utils import requires_atoms\n'), ((1806, 182... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import numpy as np
import pytest
from zarr.util import (normalize_shape, normalize_chunks, is_total_slice,
normalize_resize_args, human_readable_size, normalize_order,
guess_chunks,... | [
"zarr.util.normalize_resize_args",
"zarr.util.human_readable_size",
"zarr.util.is_total_slice",
"zarr.util.info_html_report",
"zarr.util.info_text_report",
"zarr.util.normalize_order",
"pytest.raises",
"zarr.util.normalize_shape",
"numpy.dtype",
"zarr.util.normalize_chunks",
"zarr.util.guess_chu... | [((1719, 1752), 'zarr.util.normalize_chunks', 'normalize_chunks', (['None', '(100,)', '(1)'], {}), '(None, (100,), 1)\n', (1735, 1752), False, 'from zarr.util import normalize_shape, normalize_chunks, is_total_slice, normalize_resize_args, human_readable_size, normalize_order, guess_chunks, info_html_report, info_text_... |
import numpy as np
import os
import pickle
import shutil
from jina.executors.encoders.numeric import TransformEncoder
from jina.executors import BaseExecutor
from .. import FastICAEncoder
input_dim = 28
target_output_dim = 2
train_data = np.random.rand(2000, input_dim)
def rm_files(tmp_files):
for file in tmp_fi... | [
"jina.executors.encoders.numeric.TransformEncoder",
"os.path.exists",
"numpy.random.rand",
"os.path.isfile",
"os.path.isdir",
"jina.executors.BaseExecutor.load_config",
"shutil.rmtree",
"jina.executors.BaseExecutor.load",
"numpy.testing.assert_array_equal",
"os.remove"
] | [((240, 271), 'numpy.random.rand', 'np.random.rand', (['(2000)', 'input_dim'], {}), '(2000, input_dim)\n', (254, 271), True, 'import numpy as np\n'), ((1320, 1357), 'jina.executors.encoders.numeric.TransformEncoder', 'TransformEncoder', ([], {'model_path': 'filename'}), '(model_path=filename)\n', (1336, 1357), False, '... |
import csv
import os
import json
from os import path
import cv2
import shutil
import numpy as np
import skimage.draw
import skimage.io
images = {}
with open('awe-translation.csv', 'r') as f:
reader = csv.reader(f)
c = [x for x in reader][1:]
images = {x[1]: {"src": x[0], "subject": int(x[2])} for x in c}
... | [
"cv2.imwrite",
"os.listdir",
"cv2.threshold",
"os.path.join",
"cv2.findContours",
"os.path.dirname",
"numpy.stack",
"cv2.cvtColor",
"shutil.copy",
"json.load",
"numpy.full",
"csv.reader",
"numpy.save",
"cv2.imread"
] | [((339, 363), 'os.listdir', 'os.listdir', (['"""AWEDataset"""'], {}), "('AWEDataset')\n", (349, 363), False, 'import os\n'), ((206, 219), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (216, 219), False, 'import csv\n'), ((386, 415), 'os.path.join', 'os.path.join', (['"""AWEDataset"""', 'x'], {}), "('AWEDataset', x)... |
"""
Deep CCA
===========================
This example demonstrates how to easily train Deep CCA models and variants
"""
import numpy as np
import pytorch_lightning as pl
from matplotlib import pyplot as plt
from torch.utils.data import Subset
# %%
from cca_zoo.data import Split_MNIST_Dataset
from cca_zoo.deepmodels ... | [
"cca_zoo.deepmodels.CCALightning",
"cca_zoo.deepmodels.BarlowTwins",
"matplotlib.pyplot.colorbar",
"pytorch_lightning.Trainer",
"cca_zoo.deepmodels.DCCA",
"matplotlib.pyplot.subplots",
"cca_zoo.data.Split_MNIST_Dataset",
"cca_zoo.deepmodels.get_dataloaders",
"cca_zoo.deepmodels.architectures.Encoder... | [((1137, 1188), 'cca_zoo.data.Split_MNIST_Dataset', 'Split_MNIST_Dataset', ([], {'mnist_type': '"""MNIST"""', 'train': '(True)'}), "(mnist_type='MNIST', train=True)\n", (1156, 1188), False, 'from cca_zoo.data import Split_MNIST_Dataset\n'), ((1347, 1406), 'cca_zoo.deepmodels.get_dataloaders', 'get_dataloaders', (['trai... |
import torch
import numpy as np
import math
from scipy.stats import norm
import matplotlib.pyplot as plt
def plot_gaussian_mixture_1d(var, weights, mu=None):
"""
Visualize 1D Gaussian mixture
"""
if mu is None:
mu = np.zeros_like(var)
x = np.linspace(start = -10, stop = 10, num = 2000)
y_cum = np.zeros... | [
"torch.mul",
"math.sqrt",
"torch.sqrt",
"torch.exp",
"math.log",
"torch.sin",
"torch.cos",
"torch.sum",
"numpy.mean",
"torch.eye",
"matplotlib.pyplot.plot",
"torch.prod",
"numpy.linspace",
"torch.matmul",
"torch.abs",
"torch.cholesky",
"torch.solve",
"numpy.std",
"torch.log",
"... | [((254, 295), 'numpy.linspace', 'np.linspace', ([], {'start': '(-10)', 'stop': '(10)', 'num': '(2000)'}), '(start=-10, stop=10, num=2000)\n', (265, 295), True, 'import numpy as np\n'), ((312, 328), 'numpy.zeros_like', 'np.zeros_like', (['x'], {}), '(x)\n', (325, 328), True, 'import numpy as np\n'), ((454, 472), 'matplo... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import bs4 as bs
import requests
import yfinance as yf
#import fix_yahoo_finance as yf
import datetime
import io
import cv2
import skimage
import datetime
from PIL import Image
from pandas_datareader import data as pdr
from skimage import measure
fr... | [
"numpy.sqrt",
"numpy.random.default_rng",
"io.BytesIO",
"yfinance.pdr_override",
"numpy.array",
"cv2.imdecode",
"numpy.arange",
"pandas_datareader.data.get_data_yahoo",
"datetime.datetime",
"numpy.reshape",
"matplotlib.pyplot.plot",
"numpy.max",
"matplotlib.pyplot.close",
"numpy.min",
"p... | [((10861, 10881), 'datetime.datetime', 'datetime', (['(1920)', '(1)', '(1)'], {}), '(1920, 1, 1)\n', (10869, 10881), False, 'from datetime import datetime\n'), ((10886, 10907), 'datetime.datetime', 'datetime', (['(2020)', '(7)', '(31)'], {}), '(2020, 7, 31)\n', (10894, 10907), False, 'from datetime import datetime\n'),... |
import librosa
import numpy as np
import os
from librosa.display import specshow
import matplotlib.pyplot as plt
import IPython.display as ipd
from alcokit import HOP_LENGTH, SR, N_FFT
import pickle
def save_pickle(obj, path):
with open(path, "wb") as f:
f.write(pickle.dumps(obj))
return None
def lo... | [
"librosa.istft",
"pickle.dumps",
"matplotlib.pyplot.colorbar",
"os.path.join",
"librosa.display.specshow",
"matplotlib.pyplot.figure",
"IPython.display.Audio",
"numpy.zeros",
"numpy.concatenate",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"os.walk",
"librosa.griffinlim"
] | [((656, 674), 'os.walk', 'os.walk', (['directory'], {}), '(directory)\n', (663, 674), False, 'import os\n'), ((2933, 2968), 'numpy.concatenate', 'np.concatenate', (['iterable'], {'axis': 'axis'}), '(iterable, axis=axis)\n', (2947, 2968), True, 'import numpy as np\n'), ((3168, 3220), 'librosa.display.specshow', 'specsho... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"tvm.tir.EQ",
"tvm.tir.ir_builder.create",
"tvm.tir.PrimFunc",
"tvm.te.size_var",
"numpy.ones",
"tvm.tir.transform.MakePackedAPI",
"tvm.runtime.String",
"numpy.zeros",
"tvm.tir.call_packed",
"tvm.testing.MakeAPILegacy",
"tvm.driver.build",
"tvm.runtime.enabled",
"tvm.IRModule.from_expr",
"... | [((1384, 1409), 'tvm.IRModule.from_expr', 'tvm.IRModule.from_expr', (['f'], {}), '(f)\n', (1406, 1409), False, 'import tvm\n'), ((1672, 1688), 'tvm.te.size_var', 'te.size_var', (['"""n"""'], {}), "('n')\n", (1683, 1688), False, 'from tvm import te\n'), ((1698, 1734), 'tvm.tir.decl_buffer', 'tvm.tir.decl_buffer', (['(n,... |
import numpy as np
from scipy import optimize
#%matplotlib inline
import matplotlib.pyplot as plt
def keynesian_cross(T, I, G, NX, a, b):
""" Draws the Keynesian cross with the 45-degree line and
the planned total spending as a function of total production.
Args:
T (float): Taxs
a (f... | [
"numpy.linspace",
"scipy.optimize.minimize",
"matplotlib.pyplot.figure"
] | [((624, 643), 'numpy.linspace', 'np.linspace', (['(0)', '(300)'], {}), '(0, 300)\n', (635, 643), True, 'import numpy as np\n'), ((744, 771), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 5)'}), '(figsize=(10, 5))\n', (754, 771), True, 'import matplotlib.pyplot as plt\n'), ((2355, 2374), 'numpy.linspa... |
"""
act.retrievals.stability_indices
--------------------------------
Module that adds stability indicies to a dataset.
"""
import warnings
import numpy as np
try:
from pkg_resources import DistributionNotFound
import metpy.calc as mpcalc
METPY_AVAILABLE = True
except ImportError:
METPY_AVAILABLE = F... | [
"numpy.abs",
"numpy.ones",
"metpy.calc.lcl",
"metpy.calc.most_unstable_cape_cin",
"numpy.argsort",
"numpy.array",
"metpy.calc.lfc",
"warnings.warn",
"metpy.calc.parcel_profile",
"metpy.calc.surface_based_cape_cin"
] | [((2642, 2660), 'numpy.array', 'np.array', (['t.values'], {}), '(t.values)\n', (2650, 2660), True, 'import numpy as np\n'), ((2677, 2696), 'numpy.array', 'np.array', (['td.values'], {}), '(td.values)\n', (2685, 2696), True, 'import numpy as np\n'), ((2712, 2730), 'numpy.array', 'np.array', (['p.values'], {}), '(p.value... |
#
# tempoGAN: A Temporally Coherent, Volumetric GAN for Super-resolution Fluid Flow
# Copyright 2018 <NAME>, <NAME>, <NAME>, <NAME>
#
# Plume data generation, 2D
#
from manta import *
import os, shutil, math, sys
import numpy as np
sys.path.append("../tools")
import paramhelpers as ph
simId = 2006
simPath = '../2ddat... | [
"paramhelpers.getNextSimPath",
"sys.path.append",
"numpy.savez_compressed"
] | [((233, 260), 'sys.path.append', 'sys.path.append', (['"""../tools"""'], {}), "('../tools')\n", (248, 260), False, 'import os, shutil, math, sys\n'), ((344, 377), 'paramhelpers.getNextSimPath', 'ph.getNextSimPath', (['simId', 'simPath'], {}), '(simId, simPath)\n', (361, 377), True, 'import paramhelpers as ph\n'), ((402... |
"""
### BEGIN NODE INFO
[info]
name = ARTIQ Server
version = 1.0
description = Pulser using the ARTIQ box. Backwards compatible with old pulse sequences and experiments.
instancename = ARTIQ Server
[startup]
cmdline = %PYTHON% %FILE%
timeout = 20
[shutdown]
message = 987654321
timeout = 20
### END NODE INFO
"""
# la... | [
"sipyco.pc_rpc.Client",
"numpy.log10",
"twisted.internet.threads.deferToThread",
"twisted.internet.defer.DeferredLock",
"artiq.master.databases.DeviceDB",
"labrad.server.LabradServer.__init__",
"twisted.internet.defer.returnValue",
"artiq_api.ARTIQ_api",
"labrad.server.setting",
"labrad.server.Sig... | [((2001, 2053), 'labrad.server.Signal', 'Signal', (['TTLSIGNAL_ID', '"""signal: ttl changed"""', '"""(sib)"""'], {}), "(TTLSIGNAL_ID, 'signal: ttl changed', '(sib)')\n", (2007, 2053), False, 'from labrad.server import LabradServer, setting, Signal\n'), ((2071, 2123), 'labrad.server.Signal', 'Signal', (['DACSIGNAL_ID', ... |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"numpy.clip",
"re.compile",
"inspect.currentframe",
"os.sys.path.insert",
"os.path.dirname",
"numpy.array",
"pybullet.getQuaternionFromEuler",
"motion_imitation.envs.locomotion_gym_config.ScalarField"
] | [((789, 821), 'os.sys.path.insert', 'os.sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (807, 821), False, 'import os\n'), ((1712, 1746), 'numpy.array', 'np.array', (['[1, 1, 1, 1, 1, 1, 1, 1]'], {}), '([1, 1, 1, 1, 1, 1, 1, 1])\n', (1720, 1746), True, 'import numpy as np\n'), ((1898, 1955), 'numpy.ar... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
from typing import Dict, List
import numpy as np
import pandas as pd
from reagent.replay_memory.circular_replay_buffer import ReplayBuffer
logger = logging.getLogger(__name__)
DEFAULT_DS = "2019-01-01"
d... | [
"logging.getLogger",
"numpy.unique",
"pandas.DataFrame.from_dict"
] | [((262, 289), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (279, 289), False, 'import logging\n'), ((2869, 2897), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['rows'], {}), '(rows)\n', (2891, 2897), True, 'import pandas as pd\n'), ((1599, 1622), 'numpy.unique', 'np.unique',... |
from __future__ import print_function
from os import path
import sys
import warnings
import numpy as np
if sys.version_info[0] > 2:
from urllib.request import URLopener
from urllib.error import HTTPError, URLError
exceptions = (HTTPError, URLError, OSError)
else:
from urllib import URLopener
excepti... | [
"numpy.copy",
"numpy.median",
"os.path.join",
"os.path.isfile",
"numpy.array",
"numpy.zeros",
"urllib.URLopener",
"numpy.isfinite",
"numpy.sum",
"astropy.io.fits.open",
"numpy.arange"
] | [((766, 816), 'os.path.join', 'path.join', (['MCPM.MODULE_PATH', '"""data"""', '"""K2C9"""', '"""tpf"""'], {}), "(MCPM.MODULE_PATH, 'data', 'K2C9', 'tpf')\n", (775, 816), False, 'from os import path\n'), ((1905, 1927), 'astropy.io.fits.open', 'pyfits.open', (['file_name'], {}), '(file_name)\n', (1916, 1927), True, 'fro... |
import os
import sys
import numpy as np
import time
import matplotlib.pyplot as plt
import pandas as pd
from utils import *
def sliding_dot_product(q, t):
n = t.size
m = q.size
# Append t with n zeros
ta = np.append(t, np.zeros(n))
# Reverse Q
qr = np.flip(q, 0)
# Append qra
qra = ... | [
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"numpy.cumsum",
"numpy.arange",
"numpy.divide",
"os.walk",
"numpy.flip",
"numpy.multiply",
"numpy.mean",
"matplotlib.pyplot.xlabel",
"numpy.fft.fft",
"matplotlib.pyplot.plot",
"numpy.subtract",
"numpy.max",
"numpy.concatenate",
"numpy.min",
"... | [((278, 291), 'numpy.flip', 'np.flip', (['q', '(0)'], {}), '(q, 0)\n', (285, 291), True, 'import numpy as np\n'), ((386, 401), 'numpy.fft.fft', 'np.fft.fft', (['qra'], {}), '(qra)\n', (396, 401), True, 'import numpy as np\n'), ((412, 426), 'numpy.fft.fft', 'np.fft.fft', (['ta'], {}), '(ta)\n', (422, 426), True, 'import... |
# USAGE
# python anpr_char_det_train.py --modelPath models --imagePath ./../datasets/lplates/train
# You can either pass the annFile (xml annotations file), or if you don't then annotations are loaded from the file name
# labelbinarizer
# Fit to full set of 10 numeric and 26 alphas
# lb.fit(['0','1', ... ,'9','a','b'... | [
"matplotlib.pyplot.ylabel",
"base2designs.preprocessing.SimplePreprocessor",
"keras.preprocessing.image.ImageDataGenerator",
"os.path.sep.join",
"sys.exit",
"numpy.arange",
"os.path.exists",
"argparse.ArgumentParser",
"base2designs.datasets.AnprLabelProcessor",
"keras.utils.plot_model",
"matplot... | [((4159, 4184), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4182, 4184), False, 'import argparse\n'), ((5592, 5762), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'rotation_range': '(4)', 'width_shift_range': '(0.05)', 'height_shift_range': '(0.05)', 'shear_ran... |
import tensorflow as tf
from tensorflow.python.framework import constant_op
from tensorflow.python.ops import gradient_checker
import numpy as np
import pytest
import os
import imageio
import matplotlib as mpl
import dps
from dps.datasets.load import load_backgrounds
from dps.datasets.base import EmnistDataset
from dp... | [
"numpy.uint8",
"numpy.clip",
"auto_yolo.tf_ops.render_sprites.render_sprites",
"numpy.random.rand",
"dps.datasets.load.load_backgrounds",
"numpy.array",
"dps.utils.resize_image",
"matplotlib.colors.to_rgb",
"pytest.xfail",
"dps.datasets.base.EmnistDataset",
"tensorflow.Graph",
"tensorflow.Sess... | [((587, 618), 'numpy.array', 'np.array', (['val'], {'dtype': 'np.float32'}), '(val, dtype=np.float32)\n', (595, 618), True, 'import numpy as np\n'), ((849, 873), 'matplotlib.colors.to_rgb', 'mpl.colors.to_rgb', (['color'], {}), '(color)\n', (866, 873), True, 'import matplotlib as mpl\n'), ((929, 952), 'numpy.uint8', 'n... |
# -*- coding: utf-8 -*-
import pickle
from itertools import permutations
import numpy as np
import pandas as pd
import pandas.testing as pdt
import pyarrow as pa
import pyarrow.parquet as pq
import pytest
import simplejson
from dask.dataframe.utils import make_meta as dask_make_meta
from kartothek.core._compat impo... | [
"kartothek.core.common_metadata._get_common_metadata_key",
"kartothek.core.common_metadata.read_schema_metadata",
"pyarrow.schema",
"pyarrow.BufferOutputStream",
"kartothek.core.common_metadata.make_meta",
"pickle.dumps",
"kartothek.core.common_metadata.validate_compatible",
"pyarrow.timestamp",
"nu... | [((6869, 6926), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""remove_metadata"""', '[True, False]'], {}), "('remove_metadata', [True, False])\n", (6892, 6926), False, 'import pytest\n'), ((6928, 6983), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ignore_pandas"""', '[True, False]'], {}), "(... |
import os
import torch, cv2
import random
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
def get_pascal_labels():
"""Load the mapping that associates pascal classes with label colors
Returns:
np.ndarray with dimensions (21, 3)
"""
retu... | [
"matplotlib.pyplot.imshow",
"numpy.all",
"torch.nn.CrossEntropyLoss",
"numpy.asarray",
"numpy.append",
"numpy.array",
"numpy.zeros",
"cv2.resize",
"matplotlib.pyplot.show"
] | [((323, 649), 'numpy.asarray', 'np.asarray', (['[[0, 0, 0], [128, 0, 0], [0, 128, 0], [128, 128, 0], [0, 0, 128], [128, 0, \n 128], [0, 128, 128], [128, 128, 128], [64, 0, 0], [192, 0, 0], [64, 128,\n 0], [192, 128, 0], [64, 0, 128], [192, 0, 128], [64, 128, 128], [192, \n 128, 128], [0, 64, 0], [128, 64, 0], ... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"numpy.random.rand",
"tensorflow.contrib.learn.python.learn.datasets.load_iris",
"tensorflow.contrib.learn.python.learn.datasets.load_boston",
"random.seed",
"tensorflow.test.main",
"tensorflow.contrib.learn.python.learn.TensorFlowEstimator",
"tempfile.mkdtemp",
"tensorflow.contrib.learn.python.learn.... | [((6403, 6417), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (6415, 6417), True, 'import tensorflow as tf\n'), ((1427, 1442), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (1438, 1442), False, 'import random\n'), ((1451, 1471), 'numpy.random.rand', 'np.random.rand', (['(1000)'], {}), '(1000)\n', ... |
# import modules
import numpy as np
from unitvector import unitvector
from azimuthangle import azimuthangle
'''
tangentlineatcirclept means: 'tangent--line at circle point'
# Description.
Calculates a line that is tangent to a specificed point that belongs to a
circular arc. The code verifies if the point b... | [
"numpy.array",
"numpy.dot",
"azimuthangle.azimuthangle",
"unitvector.unitvector"
] | [((2920, 2940), 'unitvector.unitvector', 'unitvector', (['ptCenVec'], {}), '(ptCenVec)\n', (2930, 2940), False, 'from unitvector import unitvector\n'), ((3712, 3761), 'numpy.array', 'np.array', (['[unitPtCenVec[1], -1 * unitPtCenVec[0]]'], {}), '([unitPtCenVec[1], -1 * unitPtCenVec[0]])\n', (3720, 3761), True, 'import ... |
import cv2
import sys
import os
import time
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from time import sleep
from keras.models import load_model
from scipy import stats
from collections import Counter
class EmotionFacePredictor():
'''
Class for handling model building and new dat... | [
"cv2.rectangle",
"os.path.exists",
"cv2.imwrite",
"keras.models.load_model",
"matplotlib.pyplot.title",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.plot",
"collections.Counter",
"numpy.array",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"time.time",
"numpy... | [((1060, 1091), 'os.path.exists', 'os.path.exists', (['self.model_path'], {}), '(self.model_path)\n', (1074, 1091), False, 'import os\n'), ((1279, 1312), 'os.path.exists', 'os.path.exists', (['self.cascade_file'], {}), '(self.cascade_file)\n', (1293, 1312), False, 'import os\n'), ((1532, 1547), 'cv2.imread', 'cv2.imrea... |
# Copyright 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import torch, numpy as np, glob, math, torch.utils.data, scipy.ndimage, multiprocessing as mp
def make_data_loader(cfg, i... | [
"numpy.clip",
"numpy.random.rand",
"numpy.hstack",
"torch.LongTensor",
"torch.max",
"multiprocessing.cpu_count",
"torch.from_numpy",
"math.cos",
"numpy.array",
"torch.sum",
"numpy.linspace",
"numpy.matmul",
"torch.randn",
"numpy.abs",
"numpy.eye",
"numpy.ones",
"numpy.nonzero",
"nu... | [((616, 701), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 24, 28, 33, 34, 36, 39]'], {}), '([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 24, 28, 33, 34, 36,\n 39])\n', (624, 701), True, 'import torch, numpy as np, glob, math, torch.utils.data, scipy.ndimage, multiprocessing as mp... |
import math
import numpy as np
import gym
from gym import spaces
from gym.utils import seeding
import sys
sys.path.extend(['../../../gym-guidance-collision-avoidance-single'])
from gym_guidance_collision_avoidance_single.envs.config import Config
__author__ = "<NAME> <<EMAIL>>"
class SingleAircraftEnv(gym.Env):
... | [
"numpy.random.normal",
"os.path.join",
"gym.spaces.Discrete",
"gym.spaces.Box",
"math.cos",
"numpy.array",
"numpy.zeros",
"gym.envs.classic_control.rendering.Transform",
"sys.path.extend",
"numpy.random.uniform",
"gym.envs.classic_control.rendering.Viewer",
"numpy.linalg.norm",
"os.getcwd",
... | [((107, 176), 'sys.path.extend', 'sys.path.extend', (["['../../../gym-guidance-collision-avoidance-single']"], {}), "(['../../../gym-guidance-collision-avoidance-single'])\n", (122, 176), False, 'import sys\n'), ((11829, 11880), 'numpy.linalg.norm', 'np.linalg.norm', (['(object1.position - object2.position)'], {}), '(o... |
#!/usr/bin/env python
import gzip
import pandas as pd
from fact.io import write_data
import click
import logging
import numpy as np
import os
from tqdm import tqdm
from gridmap import Job, process_jobs
logging.basicConfig(format='%(asctime)s|%(levelname)s|%(message)s',
datefmt='%m/%d/%Y %I:%M:%S %... | [
"logging.basicConfig",
"logging.getLogger",
"click.Choice",
"click.option",
"tqdm.tqdm",
"os.path.splitext",
"numpy.array_split",
"fact.io.write_data",
"click.Path",
"gridmap.process_jobs",
"click.command",
"pandas.concat",
"pandas.read_json"
] | [((204, 328), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s|%(levelname)s|%(message)s"""', 'datefmt': '"""%m/%d/%Y %I:%M:%S %p"""', 'level': 'logging.INFO'}), "(format='%(asctime)s|%(levelname)s|%(message)s', datefmt\n ='%m/%d/%Y %I:%M:%S %p', level=logging.INFO)\n", (223, 328), False... |
"""Plot the example figure for object localisation.
<NAME> <<EMAIL>>
Research School of Astronomy and Astrophysics
The Australian National University
2017
"""
import aplpy
import astropy.io.fits
import matplotlib.patches as patches, numpy
import matplotlib
# http://bkanuka.com/articles/native-latex-plots/
def figsi... | [
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.savefig",
"numpy.sqrt",
"matplotlib.rcParams.update",
"matplotlib.pyplot.gca",
"aplpy.FITSFigure"
] | [((1029, 1071), 'matplotlib.rcParams.update', 'matplotlib.rcParams.update', (['pgf_with_latex'], {}), '(pgf_with_latex)\n', (1055, 1071), False, 'import matplotlib\n'), ((1149, 1193), 'aplpy.FITSFigure', 'aplpy.FITSFigure', (['radio_path'], {'figsize': '(5, 5)'}), '(radio_path, figsize=(5, 5))\n', (1165, 1193), False, ... |
import os
from rpgpy import spectra2moments
from rpgpy import spcutil
from rpgpy import read_rpg
import numpy as np
from time import time
from numpy.testing import assert_array_almost_equal
FILE_PATH = os.path.dirname(os.path.realpath(__file__))
class TestFindPeaks:
def test_main_peak_1(self):
data = np... | [
"numpy.mean",
"rpgpy.spectra2moments",
"rpgpy.spcutil.calc_spectral_LDR",
"rpgpy.spcutil.find_peak_edges",
"os.path.realpath",
"numpy.array",
"numpy.isnan",
"rpgpy.read_rpg",
"time.time"
] | [((219, 245), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (235, 245), False, 'import os\n'), ((1517, 1537), 'rpgpy.read_rpg', 'read_rpg', (['input_file'], {}), '(input_file)\n', (1525, 1537), False, 'from rpgpy import read_rpg\n'), ((1561, 1585), 'numpy.mean', 'np.mean', (["data['TotSpec... |
# coding=utf-8
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) HuggingFace Inc. team.
#
# 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... | [
"torchvision.transforms.CenterCrop",
"json.loads",
"torch.nn.Sequential",
"PIL.Image.new",
"torch.stack",
"os.path.join",
"collections.Counter",
"os.path.dirname",
"imblearn.over_sampling.RandomOverSampler",
"torchvision.models.resnet152",
"numpy.array",
"torch.nn.AdaptiveAvgPool2d",
"torchv... | [((3986, 4033), 'torch.zeros', 'torch.zeros', (['bsz', 'max_seq_len'], {'dtype': 'torch.long'}), '(bsz, max_seq_len, dtype=torch.long)\n', (3997, 4033), False, 'import torch\n'), ((4052, 4099), 'torch.zeros', 'torch.zeros', (['bsz', 'max_seq_len'], {'dtype': 'torch.long'}), '(bsz, max_seq_len, dtype=torch.long)\n', (40... |
import numpy as np
from scipy.ndimage import morphological_gradient
def _is_iterable(x):
try:
iter(x)
except TypeError:
return False
else:
return True
def _norm_along_last_axis(x):
"""Compute the norm of x along the last axis.
"""
return np.sqrt(np.sum(np.square(x), a... | [
"numpy.mean",
"numpy.square",
"numpy.array",
"numpy.concatenate",
"numpy.nonzero",
"numpy.percentile"
] | [((3119, 3147), 'numpy.array', 'np.array', (['hausdorffs_label_1'], {}), '(hausdorffs_label_1)\n', (3127, 3147), True, 'import numpy as np\n'), ((3149, 3177), 'numpy.array', 'np.array', (['hausdorffs_label_2'], {}), '(hausdorffs_label_2)\n', (3157, 3177), True, 'import numpy as np\n'), ((3349, 3393), 'numpy.concatenate... |
# Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"numpy.iinfo",
"jax.random.fold_in",
"jax.random.split",
"tensorflow.compat.v2.convert_to_tensor",
"tensorflow.compat.v2.random.stateless_normal",
"tensorflow_probability.python.internal.prefer_static.concat",
"numpy.uint64",
"tensorflow.compat.v2.random.stateless_categorical",
"tensorflow_probabili... | [((1357, 1394), 'tensorflow.compat.v2.constant', 'tf.constant', (['[0, 0]'], {'dtype': 'SEED_DTYPE'}), '([0, 0], dtype=SEED_DTYPE)\n', (1368, 1394), True, 'import tensorflow.compat.v2 as tf\n'), ((1780, 1818), 'tensorflow.compat.v2.name_scope', 'tf.name_scope', (["(name or 'sanitize_seed')"], {}), "(name or 'sanitize_s... |
import glob
import cv2
import numpy as np
import torch
import pandas as pd
import queue
from pathlib import Path
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.data import MetadataCatalog
from detectron2.utils.visualizer import ColorMode, Visualizer
from detectron2 ... | [
"numpy.array",
"detectron2.model_zoo.get_config_file",
"torch.cuda.is_available",
"annolid.data.videos.key_frames",
"detectron2.config.get_cfg",
"detectron2.data.datasets.register_coco_instances",
"pathlib.Path",
"annolid.annotation.masks.mask_iou",
"torchvision.ops.nms",
"annolid.data.videos.fram... | [((1326, 1348), 'queue.PriorityQueue', 'queue.PriorityQueue', (['(3)'], {}), '(3)\n', (1345, 1348), False, 'import queue\n'), ((1382, 1404), 'queue.PriorityQueue', 'queue.PriorityQueue', (['(3)'], {}), '(3)\n', (1401, 1404), False, 'import queue\n'), ((1439, 1461), 'queue.PriorityQueue', 'queue.PriorityQueue', (['(3)']... |
""" Module implementing GAN which will be trained using the Progressive growing
technique -> https://arxiv.org/abs/1710.10196
"""
import datetime
import os
import time
import timeit
import copy
import numpy as np
import torch as th
class Generator(th.nn.Module):
""" Generator of the GAN network """
def _... | [
"MSG_GAN.CustomLayers.DisFinalBlock",
"numpy.sqrt",
"MSG_GAN.CustomLayers.DisGeneralConvBlock",
"MSG_GAN.utils.iter_utils.hn_wrapper",
"copy.deepcopy",
"datetime.timedelta",
"torch.nn.ModuleList",
"MSG_GAN.CustomLayers._equalized_conv2d",
"os.path.isdir",
"MSG_GAN.CustomLayers.GenInitialBlock",
... | [((3641, 3669), 'torch.clamp', 'th.clamp', (['data'], {'min': '(0)', 'max': '(1)'}), '(data, min=0, max=1)\n', (3649, 3669), True, 'import torch as th\n'), ((5466, 5478), 'torch.nn.ModuleList', 'ModuleList', ([], {}), '()\n', (5476, 5478), False, 'from torch.nn import ModuleList\n'), ((5641, 5653), 'torch.nn.ModuleList... |
"""
Frontend for xESMF, exposed to users.
"""
import warnings
import cf_xarray as cfxr
import numpy as np
import scipy.sparse as sps
import xarray as xr
from xarray import DataArray
from .backend import Grid, LocStream, Mesh, add_corner, esmf_regrid_build, esmf_regrid_finalize
from .smm import _combine_weight_multip... | [
"dask.array.map_blocks",
"numpy.asarray",
"xarray.Dataset",
"numpy.array",
"xarray.DataArray",
"numpy.expand_dims",
"warnings.warn",
"numpy.meshgrid",
"xarray.apply_ufunc",
"cf_xarray.bounds_to_vertices"
] | [((2146, 2201), 'cf_xarray.bounds_to_vertices', 'cfxr.bounds_to_vertices', (['lon_bnds', '"""bounds"""'], {'order': 'None'}), "(lon_bnds, 'bounds', order=None)\n", (2169, 2201), True, 'import cf_xarray as cfxr\n'), ((2214, 2269), 'cf_xarray.bounds_to_vertices', 'cfxr.bounds_to_vertices', (['lat_bnds', '"""bounds"""'], ... |
import os
import platform
import numpy as np
from simtk import unit
import time
import pytest
from testsystems.relative import hif2a_ligand_pair
from md.builders import build_water_system
from md.minimizer import minimize_host_4d
from fe.free_energy import AbsoluteFreeEnergy
from md.states import CoordsVelBox
from... | [
"numpy.array",
"md.barostat.utils.get_bond_list",
"platform.version",
"numpy.mean",
"numpy.testing.assert_array_almost_equal",
"numpy.testing.assert_allclose",
"numpy.asarray",
"fe.free_energy.AbsoluteFreeEnergy",
"numpy.random.seed",
"md.thermostat.utils.sample_velocities",
"timemachine.lib.cus... | [((1057, 1077), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1071, 1077), True, 'import numpy as np\n'), ((1306, 1335), 'fe.free_energy.AbsoluteFreeEnergy', 'AbsoluteFreeEnergy', (['mol_a', 'ff'], {}), '(mol_a, ff)\n', (1324, 1335), False, 'from fe.free_energy import AbsoluteFreeEnergy\n'), ((161... |
"""
The MIT License (MIT)
Copyright (c) 2017 <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, publi... | [
"numpy.eye",
"numpy.poly",
"harold.minimal_realization",
"harold.matrix_slice",
"harold.hessenberg_realization",
"numpy.testing.assert_raises",
"numpy.triu_indices_from",
"harold.staircase",
"numpy.any",
"numpy.array",
"numpy.testing.assert_almost_equal",
"numpy.zeros",
"numpy.empty",
"num... | [((1435, 1647), 'numpy.array', 'array', (['[[-6.5, 0.5, 6.5, -6.5, 0.0, 1.0, 0.0], [-0.5, -5.5, -5.5, 5.5, 2.0, 1.0, \n 2.0], [-0.5, 0.5, 0.5, -6.5, 3.0, 4.0, 3.0], [-0.5, 0.5, -5.5, -0.5, \n 3.0, 2.0, 3.0], [1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0]]'], {}), '([[-6.5, 0.5, 6.5, -6.5, 0.0, 1.0, 0.0], [-0.5, -5.5, -5.5, ... |
#!/usr/bin/python
import numpy as np
class BLC:
'Black Level Compensation'
def __init__(self, img, parameter, bayer_pattern, clip):
self.img = img
self.parameter = parameter
self.bayer_pattern = bayer_pattern
self.clip = clip
def clipping(self):
np.clip(self.img, 0... | [
"numpy.clip",
"numpy.empty"
] | [((301, 346), 'numpy.clip', 'np.clip', (['self.img', '(0)', 'self.clip'], {'out': 'self.img'}), '(self.img, 0, self.clip, out=self.img)\n', (308, 346), True, 'import numpy as np\n'), ((682, 716), 'numpy.empty', 'np.empty', (['(raw_h, raw_w)', 'np.int16'], {}), '((raw_h, raw_w), np.int16)\n', (690, 716), True, 'import n... |
import sys
import os
import torch
import pandas as pd
import datetime
from argparse import ArgumentParser
import numpy as np
from torch import nn, optim
import torch.nn.functional as F
from torch.utils.data import DataLoader, random_split
import pytorch_lightning as pl
from pytorch_lightning.metrics import functional ... | [
"utils.focalloss_weights.FocalLoss",
"pytorch_lightning.metrics.functional.accuracy",
"utils.helpers.create_results_directory",
"argparse.ArgumentParser",
"torch.mean",
"torch.load",
"network.ecgresnet_auxout.ECGResNet_AuxOut",
"torch.tensor",
"utils.helpers.create_weights_directory",
"datetime.da... | [((3405, 3440), 'utils.focalloss_weights.FocalLoss', 'FocalLoss', ([], {'gamma': '(1)', 'weights': 'weights'}), '(gamma=1, weights=weights)\n', (3414, 3440), False, 'from utils.focalloss_weights import FocalLoss\n'), ((3451, 3477), 'utils.helpers.create_weights_directory', 'create_weights_directory', ([], {}), '()\n', ... |
import logging
import numpy as np
import kubric as kb
from kubric.renderer.blender import Blender as KubricBlender
from kubric.simulator.pybullet import PyBullet as KubricSimulator
logging.basicConfig(level="DEBUG") # < CRITICAL, ERROR, WARNING, INFO, DEBUG
# --- create scene and attach a renderer and simulator
scen... | [
"logging.basicConfig",
"kubric.DirectionalLight",
"kubric.write_image_dict",
"kubric.Cube",
"numpy.random.default_rng",
"kubric.random_hue_color",
"kubric.Scene",
"kubric.simulator.pybullet.PyBullet",
"kubric.move_until_no_overlap",
"kubric.Sphere",
"kubric.renderer.blender.Blender",
"kubric.P... | [((182, 216), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '"""DEBUG"""'}), "(level='DEBUG')\n", (201, 216), False, 'import logging\n'), ((324, 355), 'kubric.Scene', 'kb.Scene', ([], {'resolution': '(256, 256)'}), '(resolution=(256, 256))\n', (332, 355), True, 'import kubric as kb\n'), ((519, 539), 'kub... |
from textwrap import dedent
import numpy as np
import pytest
from pandas import (
DataFrame,
MultiIndex,
option_context,
)
pytest.importorskip("jinja2")
from pandas.io.formats.style import Styler
from pandas.io.formats.style_render import (
_parse_latex_cell_styles,
_parse_latex_css_conversion,
... | [
"textwrap.dedent",
"pandas.io.formats.style_render._parse_latex_css_conversion",
"pandas.io.formats.style.Styler",
"pandas.MultiIndex.from_product",
"pandas.io.formats.style_render._parse_latex_header_span",
"pandas.option_context",
"pytest.mark.parametrize",
"pytest.importorskip",
"pytest.raises",
... | [((138, 167), 'pytest.importorskip', 'pytest.importorskip', (['"""jinja2"""'], {}), "('jinja2')\n", (157, 167), False, 'import pytest\n'), ((2891, 2942), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""env"""', "[None, 'longtable']"], {}), "('env', [None, 'longtable'])\n", (2914, 2942), False, 'import pytes... |
import numpy as np
import matplotlib
# if you get the error: "TypeError: 'figure' is an unknown keyword argument"
# uncomment the line below:
# matplotlib.use('Qt4Agg')
try:
# pylint: disable=g-import-not-at-top
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
except ImportError as e:
... | [
"matplotlib.pyplot.savefig",
"sklearn.manifold.TSNE",
"matplotlib.pyplot.annotate",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"numpy.load",
"matplotlib.pyplot.show"
] | [((581, 609), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(18, 18)'}), '(figsize=(18, 18))\n', (591, 609), True, 'import matplotlib.pyplot as plt\n'), ((939, 960), 'matplotlib.pyplot.savefig', 'plt.savefig', (['filename'], {}), '(filename)\n', (950, 960), True, 'import matplotlib.pyplot as plt\n'), ((11... |
import mock
import numpy as np
from emukit.core import ParameterSpace
from emukit.core.acquisition import Acquisition
from emukit.core.constraints import IConstraint
from emukit.core.optimization.anchor_points_generator import ObjectiveAnchorPointsGenerator
def test_objective_anchor_point_generator():
num_sample... | [
"mock.create_autospec",
"numpy.array",
"emukit.core.optimization.anchor_points_generator.ObjectiveAnchorPointsGenerator",
"numpy.arange"
] | [((349, 382), 'mock.create_autospec', 'mock.create_autospec', (['Acquisition'], {}), '(Acquisition)\n', (369, 382), False, 'import mock\n'), ((473, 509), 'mock.create_autospec', 'mock.create_autospec', (['ParameterSpace'], {}), '(ParameterSpace)\n', (493, 509), False, 'import mock\n'), ((626, 711), 'emukit.core.optimiz... |
import datetime, dateutil.relativedelta
import pandas as pd
import numpy as np
from .settings import WORLD_CPI, WORLD_CY, WORLD_ER
def _get_value(date, df, type_, fpath=None):
"""
_get_value looks up the value of a cell for a given date (date) in a table provided by the Federal Statistical Office.
:param ... | [
"datetime.datetime.strptime",
"datetime.date.today",
"numpy.isnan",
"pandas.read_csv"
] | [((4071, 4105), 'pandas.read_csv', 'pd.read_csv', (['filename_'], {'skiprows': '(4)'}), '(filename_, skiprows=4)\n', (4082, 4105), True, 'import pandas as pd\n'), ((4743, 4776), 'pandas.read_csv', 'pd.read_csv', (['WORLD_CY'], {'skiprows': '(4)'}), '(WORLD_CY, skiprows=4)\n', (4754, 4776), True, 'import pandas as pd\n'... |
from __future__ import division, print_function, absolute_import
from warnings import warn
import numpy as np
from numpy import (atleast_2d, ComplexWarning, arange, zeros_like, imag, diag,
iscomplexobj, tril, triu, argsort, empty_like)
from .decomp import _asarray_validated
from .lapack import get_... | [
"numpy.diag",
"numpy.argsort",
"numpy.iscomplexobj",
"numpy.array",
"numpy.empty_like",
"numpy.tril",
"warnings.warn",
"numpy.triu",
"numpy.zeros_like",
"numpy.arange"
] | [((7625, 7634), 'numpy.arange', 'arange', (['n'], {}), '(n)\n', (7631, 7634), False, 'from numpy import atleast_2d, ComplexWarning, arange, zeros_like, imag, diag, iscomplexobj, tril, triu, argsort, empty_like\n'), ((7648, 7676), 'numpy.zeros_like', 'zeros_like', (['swap_'], {'dtype': 'int'}), '(swap_, dtype=int)\n', (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.