code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import os import sys import warnings import glob import cv2 import numpy as np from io_utils import PostprocessUtils from io_utils import LabelFilter class AnnotationWriter(): def __init__(self, cfg): self.base_path = cfg.BASE_PATH self.data_def = cfg.DATA_DEF[0] self.batch_glob = cfg....
[ "numpy.unique", "numpy.where", "os.path.join", "cv2.imread", "glob.glob" ]
[((449, 491), 'os.path.join', 'os.path.join', (['self.base_path', 'cfg.OUT_FILE'], {}), '(self.base_path, cfg.OUT_FILE)\n', (461, 491), False, 'import os\n'), ((1370, 1415), 'os.path.join', 'os.path.join', (['self.base_path', 'self.batch_glob'], {}), '(self.base_path, self.batch_glob)\n', (1382, 1415), False, 'import o...
#!/usr/bin/env python import argparse import cv2 import time import numpy as np BLUE = 'blue' GREEN = 'green' RED = 'red' ORANGE = 'orange' YELLOW = 'yellow' BGR = 'bgr' HSV = 'hsv' HSV_MIN = 'hsv_min' HSV_MAX = 'hsv_max' COLOUR_MAP = { BLUE : { HSV_MIN : (110, 50, 50), HSV_MAX : (130, 255, 25...
[ "argparse.ArgumentParser", "cv2.inRange", "cv2.erode", "numpy.fliplr", "cv2.imshow", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.cvtColor", "cv2.moments", "cv2.waitKey", "cv2.namedWindow" ]
[((935, 960), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (958, 960), False, 'import argparse\n'), ((1733, 1757), 'cv2.namedWindow', 'cv2.namedWindow', (['"""Input"""'], {}), "('Input')\n", (1748, 1757), False, 'import cv2\n'), ((1762, 1784), 'cv2.namedWindow', 'cv2.namedWindow', (['"""HSV""...
__copyright__ = """ Copyright (C) 2020 <NAME> Copyright (C) 2020 <NAME> """ __license__ = """ 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 ...
[ "numpy.random.rand", "numpy.minimum", "numpy.searchsorted", "numpy.log", "scipy.integrate.solve_ivp", "scipy.stats.poisson.rvs", "numpy.array", "numpy.zeros", "numpy.quantile", "numpy.empty", "numpy.unravel_index", "numpy.random.seed", "numpy.empty_like", "numpy.cumsum", "numpy.zeros_lik...
[((4129, 4165), 'numpy.zeros', 'np.zeros', ([], {'shape': '(self.chunk_length,)'}), '(shape=(self.chunk_length,))\n', (4137, 4165), True, 'import numpy as np\n'), ((6745, 6781), 'numpy.zeros', 'np.zeros', ([], {'shape': '(self.chunk_length,)'}), '(shape=(self.chunk_length,))\n', (6753, 6781), True, 'import numpy as np\...
# Author: <NAME>, <<EMAIL>> # # License: BSD (3-clause) import numpy as np from numpy.testing import assert_array_equal from nose.tools import assert_raises, assert_true, assert_equal from mne.utils import requires_version from mne.decoding.search_light import SlidingEstimator, GeneralizingEstimator from mne.decoding...
[ "numpy.ones_like", "numpy.abs", "numpy.random.rand", "numpy.arange", "sklearn.linear_model.Ridge", "sklearn.metrics.make_scorer", "sklearn.linear_model.LogisticRegression", "nose.tools.assert_raises", "nose.tools.assert_true", "sklearn.metrics.roc_auc_score", "sklearn.ensemble.BaggingClassifier"...
[((646, 681), 'mne.utils.requires_version', 'requires_version', (['"""sklearn"""', '"""0.17"""'], {}), "('sklearn', '0.17')\n", (662, 681), False, 'from mne.utils import requires_version\n'), ((5184, 5219), 'mne.utils.requires_version', 'requires_version', (['"""sklearn"""', '"""0.17"""'], {}), "('sklearn', '0.17')\n",...
# This script is going to add subspace to each direction. import os import pickle as pkl import argparse import numpy as np import math import torch import torch.nn as nn import torch.optim as optim from derivable_models.derivable_generator import get_derivable_generator from utils.file_utils import check_transformer...
[ "utils.file_utils.get_dir_lists", "torch.pow", "torch.from_numpy", "torch.sum", "torch.repeat_interleave", "torchvision.utils.save_image", "utils.file_utils.post_proC", "argparse.ArgumentParser", "utils.file_utils.get_generator_info", "torch.eye", "torch.relu", "utils.file_utils.prepare_test_z...
[((1172, 1197), 'torch.cat', 'torch.cat', (['results'], {'dim': '(0)'}), '(results, dim=0)\n', (1181, 1197), False, 'import torch\n'), ((1678, 1718), 'os.makedirs', 'os.makedirs', (['args.outputs'], {'exist_ok': '(True)'}), '(args.outputs, exist_ok=True)\n', (1689, 1718), False, 'import os\n'), ((1743, 1801), 'utils.fi...
"""Analysis tools.""" import ast import json import os from typing import Any, Dict, Optional, Union import matplotlib.dates as dates import matplotlib.pyplot as plt import numpy as np import pandas as pd def analyze() -> None: """Return info messages as dict, plot prize timeline and save both. Notes --...
[ "matplotlib.dates.date2num", "os.path.exists", "matplotlib.pyplot.savefig", "pandas.read_csv", "numpy.polyfit", "pandas.DatetimeIndex", "os.makedirs", "json.dump", "numpy.poly1d", "pandas.DataFrame", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.show" ]
[((966, 1005), 'pandas.read_csv', 'pd.read_csv', (['"""input/input.csv"""'], {'sep': '""";"""'}), "('input/input.csv', sep=';')\n", (977, 1005), True, 'import pandas as pd\n'), ((872, 905), 'os.path.exists', 'os.path.exists', (['"""input/input.csv"""'], {}), "('input/input.csv')\n", (886, 905), False, 'import os\n'), (...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This function simulates a variable speed pumping system. First, you enter in the pump and system curve information. The function then calculates a curve relating rpm to flow and rpm to kW. This is useful for estimating the flow of variable speed pumping systems w...
[ "numpy.polyfit", "numpy.max", "numpy.append", "numpy.array", "numpy.sign" ]
[((4096, 4113), 'numpy.max', 'np.max', (['RPM_range'], {}), '(RPM_range)\n', (4102, 4113), True, 'import numpy as np\n'), ((4219, 4231), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (4227, 4231), True, 'import numpy as np\n'), ((4559, 4571), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (4567, 4571), True, '...
#!/usr/bin/env python # coding: utf-8 # # Nineth exercice: non-Cartesian MR image reconstruction # ============================================= # In this tutorial we will reconstruct an MRI image from radial undersampled kspace measurements. Let us denote $\Omega$ the undersampling mask, the under-sampled Fourier tr...
[ "matplotlib.pyplot.imshow", "numpy.abs", "mri.operators.WaveletUD2", "mri.operators.NonCartesianFFT", "mri.reconstructors.SingleChannelReconstructor", "mri.operators.WaveletN", "pysap.data.get_sample_data", "modopt.math.metrics.ssim", "matplotlib.pyplot.figure", "numpy.linspace", "mri.operators....
[((2381, 2406), 'pysap.data.get_sample_data', 'get_sample_data', (['"""2d-mri"""'], {}), "('2d-mri')\n", (2396, 2406), False, 'from pysap.data import get_sample_data\n'), ((2421, 2458), 'pysap.data.get_sample_data', 'get_sample_data', (['"""mri-radial-samples"""'], {}), "('mri-radial-samples')\n", (2436, 2458), False, ...
import numpy as np from numpy.testing import assert_allclose from qiskit.quantum_info import random_density_matrix from mps_tomo.uncert import R_hat, iteration, pauli_proj from mps_tomo.utils import fidelity, pauli_group def test_pauli_proj(): NUM_QUBITS = 3 SEED = 7777 TOL = 100 * np.spacing(np.complex1...
[ "mps_tomo.utils.pauli_group", "numpy.trace", "qiskit.quantum_info.random_density_matrix", "numpy.eye", "numpy.reshape", "numpy.testing.assert_allclose", "mps_tomo.uncert.pauli_proj", "numpy.size", "numpy.complex128", "numpy.zeros", "mps_tomo.uncert.iteration", "numpy.einsum", "numpy.random.s...
[((350, 399), 'qiskit.quantum_info.random_density_matrix', 'random_density_matrix', (['(2 ** NUM_QUBITS)'], {'seed': 'SEED'}), '(2 ** NUM_QUBITS, seed=SEED)\n', (371, 399), False, 'from qiskit.quantum_info import random_density_matrix\n'), ((487, 547), 'numpy.testing.assert_allclose', 'assert_allclose', (['reconstructe...
#Developed by <NAME> #Github link: https://github.com/Hemraj183 import cv2 import numpy as np import face_recognition import os import pyttsx3 path = 'Images' engine = pyttsx3.init('sapi5') voices = engine.getProperty('voices') engine.setProperty('voice', voices[1].id) print(voices[0].id) speed = 150 e...
[ "cv2.rectangle", "face_recognition.face_locations", "os.listdir", "pyttsx3.init", "os.path.splitext", "cv2.imshow", "cv2.putText", "face_recognition.face_distance", "cv2.waitKey", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.cvtColor", "face_recognition.face_encodings", "face_recognit...
[((180, 201), 'pyttsx3.init', 'pyttsx3.init', (['"""sapi5"""'], {}), "('sapi5')\n", (192, 201), False, 'import pyttsx3\n'), ((495, 511), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (505, 511), False, 'import os\n'), ((1039, 1058), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (1055, 1058),...
import numpy as np from trimesh.voxel.ops import points_to_marching_cubes from trimesh.voxel.ops import points_to_indices class MeshOccupancy: """ Mesh which is backed by an occupancy function. """ def __init__(self, occupancy_function, iso_level, bounds, resolution = [64, 64, 64]): self...
[ "numpy.array", "numpy.meshgrid", "numpy.linspace", "trimesh.voxel.ops.points_to_marching_cubes" ]
[((758, 819), 'numpy.linspace', 'np.linspace', (['self.lower[0]', 'self.upper[0]', 'self.resolution[0]'], {}), '(self.lower[0], self.upper[0], self.resolution[0])\n', (769, 819), True, 'import numpy as np\n'), ((838, 899), 'numpy.linspace', 'np.linspace', (['self.lower[1]', 'self.upper[1]', 'self.resolution[1]'], {}), ...
#!/usr/bin/python3 # Roding: utf-8 """ Extract frames from video """ import argparse import logging as log from pathlib import Path import cv2 import numpy as np from tqdm import tqdm def get_desired_frames(length, n_frames, uniform=True): if uniform: interval = int((length) / n_frames) desired_...
[ "logging.basicConfig", "argparse.ArgumentParser", "pathlib.Path", "numpy.hstack", "cv2.VideoCapture", "logging.info", "numpy.arange" ]
[((669, 688), 'numpy.hstack', 'np.hstack', (['(X1, X2)'], {}), '((X1, X2))\n', (678, 688), True, 'import numpy as np\n'), ((761, 784), 'pathlib.Path', 'Path', (['(out_dir / episode)'], {}), '(out_dir / episode)\n', (765, 784), False, 'from pathlib import Path\n'), ((1021, 1049), 'cv2.VideoCapture', 'cv2.VideoCapture', ...
# hyperparameter optimization from ray import tune from ray.tune.schedulers import ASHAScheduler from model import GRU # set processing device import torch import torch.nn as nn device = torch.device("cuda:0") if torch.cuda.is_available() else torch.device("cpu") # data from torchtext.legacy.data import Field, Tabu...
[ "ray.tune.report", "torchtext.legacy.data.TabularDataset.splits", "torch.cuda.is_available", "ray.tune.checkpoint_dir", "ray.tune.loguniform", "ray.tune.CLIReporter", "ray.tune.choice", "torch.save", "model.GRU", "ray.tune.schedulers.ASHAScheduler", "torch.nn.SmoothL1Loss", "torch.device", "...
[((214, 239), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (237, 239), False, 'import torch\n'), ((188, 210), 'torch.device', 'torch.device', (['"""cuda:0"""'], {}), "('cuda:0')\n", (200, 210), False, 'import torch\n'), ((245, 264), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu'...
#!/usr/bin/env python3 import numpy as np from . import tshark def get_result(input_files, filter): time_list = [] for file in input_files: cmd_result = tshark.fields(file, filter, ['frame.time_delta_displayed']) time_list.extend([float(result) for result in cmd_result]) if len(time_list...
[ "numpy.histogram" ]
[((353, 381), 'numpy.histogram', 'np.histogram', (['time_list', '(100)'], {}), '(time_list, 100)\n', (365, 381), True, 'import numpy as np\n')]
from torch.utils.data import Dataset from utils.visual_augmentation import ColorDistort, pixel_jitter import numpy as np import copy import json import random import cv2 from utils.augmentation import Rotate_aug, Affine_aug, Mirror, Padding_aug, Img_dropout from utils.headpose import get_head_pose import time from util...
[ "utils.visual_augmentation.pixel_jitter", "numpy.array", "utils.visual_augmentation.ColorDistort", "copy.deepcopy", "utils.turbo.TurboJPEG.TurboJPEG", "utils.headpose.get_head_pose", "utils.augmentation.Affine_aug", "utils.augmentation.Img_dropout", "numpy.concatenate", "random.uniform", "random...
[((363, 374), 'utils.turbo.TurboJPEG.TurboJPEG', 'TurboJPEG', ([], {}), '()\n', (372, 374), False, 'from utils.turbo.TurboJPEG import TurboJPEG\n'), ((1088, 1114), 'random.shuffle', 'random.shuffle', (['self.metas'], {}), '(self.metas)\n', (1102, 1114), False, 'import random\n'), ((1451, 1465), 'utils.visual_augmentati...
import numpy as np import pytest from sklego.common import flatten from sklego.mixture import GMMClassifier from sklego.testing import check_shape_remains_same_classifier from tests.conftest import nonmeta_checks, general_checks, classifier_checks @pytest.mark.parametrize("test_fn", flatten([ nonmeta_checks, ...
[ "numpy.random.normal", "numpy.ones", "sklego.mixture.GMMClassifier", "sklego.common.flatten", "numpy.zeros", "pytest.raises" ]
[((450, 465), 'sklego.mixture.GMMClassifier', 'GMMClassifier', ([], {}), '()\n', (463, 465), False, 'from sklego.mixture import GMMClassifier\n'), ((287, 388), 'sklego.common.flatten', 'flatten', (['[nonmeta_checks, general_checks, classifier_checks,\n check_shape_remains_same_classifier]'], {}), '([nonmeta_checks, ...
import numpy as np class MAX_POOL_LAYER: """MAX_POOL_LAYER only reduce dimensions of height and width by a factor. It does not put max filter on same input twice i.e. stride = factor = kernel_dimension """ def __init__(self, **params): self.factor = params.get('stride', 2) def forward(s...
[ "numpy.zeros", "numpy.repeat" ]
[((1790, 1807), 'numpy.zeros', 'np.zeros', (['X.shape'], {}), '(X.shape)\n', (1798, 1807), True, 'import numpy as np\n'), ((1566, 1609), 'numpy.repeat', 'np.repeat', (['self.feature_map', 'factor'], {'axis': '(2)'}), '(self.feature_map, factor, axis=2)\n', (1575, 1609), True, 'import numpy as np\n'), ((1652, 1684), 'nu...
# %load_ext autoreload # %autoreload 2 import numpy as np from pyhamimports import * from spectrum import Spectrum import glob from tqdm import tqdm from subprocess import check_output datestr = check_output(["/bin/date","+%F"]) datestr = datestr.decode().replace('\n', '') singleTemp_dir = "resources/templates/" SB...
[ "subprocess.check_output", "numpy.ones", "numpy.where", "tqdm.tqdm", "numpy.array", "numpy.zeros", "numpy.empty", "glob.glob", "spectrum.Spectrum", "numpy.arange" ]
[((198, 232), 'subprocess.check_output', 'check_output', (["['/bin/date', '+%F']"], {}), "(['/bin/date', '+%F'])\n", (210, 232), False, 'from subprocess import check_output\n'), ((733, 793), 'numpy.array', 'np.array', (["['O', 'B', 'A', 'F', 'G', 'K', 'M', 'L', 'C', 'D']"], {}), "(['O', 'B', 'A', 'F', 'G', 'K', 'M', 'L...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import mxnet as mx import numpy as np import progressbar import six import math from scipy.signal import savgol_filter from scipy import interpolate from .homography_estimator import HomographyEstimator from...
[ "numpy.ones", "scipy.signal.savgol_filter", "progressbar.progressbar", "scipy.interpolate.interp1d", "numpy.array", "numpy.isnan" ]
[((4900, 4916), 'numpy.array', 'np.array', (['points'], {}), '(points)\n', (4908, 4916), True, 'import numpy as np\n'), ((4934, 4950), 'numpy.array', 'np.array', (['values'], {}), '(values)\n', (4942, 4950), True, 'import numpy as np\n'), ((5919, 5951), 'progressbar.progressbar', 'progressbar.progressbar', (['results']...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn # import torch.nn.functional as F import torch.optim as optim import utils.utils as util import utils.quantizati...
[ "torch.optim.lr_scheduler.LambdaLR", "torch.nn.CrossEntropyLoss", "torch.optim.lr_scheduler.MultiStepLR", "torch.max", "torch.cuda.device_count", "numpy.array", "torch.cuda.is_available", "os.path.exists", "argparse.ArgumentParser", "torchvision.transforms.ToTensor", "collections.OrderedDict", ...
[((630, 694), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch CIFAR-10 Training"""'}), "(description='PyTorch CIFAR-10 Training')\n", (653, 694), False, 'import argparse\n'), ((2007, 2082), 'torchvision.transforms.Normalize', 'transforms.Normalize', ([], {'mean': '[0.485, 0.456, 0...
#!/usr/bin/env python3 # coding:utf-8 import cv2 import numpy as np import rospy from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError from paddle.inference import Config from paddle.inference import PrecisionType from paddle.inference import create_predictor import yaml import time # ————...
[ "paddle.inference.Config", "rospy.init_node", "yaml.load", "paddle.inference.create_predictor", "numpy.max", "cv2.imshow", "cv_bridge.CvBridge", "numpy.array", "numpy.zeros", "rospy.spin", "numpy.min", "cv2.resize", "rospy.Subscriber", "cv2.waitKey" ]
[((556, 577), 'numpy.min', 'np.min', (['im_shape[0:2]'], {}), '(im_shape[0:2])\n', (562, 577), True, 'import numpy as np\n'), ((596, 617), 'numpy.max', 'np.max', (['im_shape[0:2]'], {}), '(im_shape[0:2])\n', (602, 617), True, 'import numpy as np\n'), ((742, 799), 'cv2.resize', 'cv2.resize', (['img', 'None', 'None'], {'...
import csv import random from pathlib import Path import numpy as np import time as t from data.model import Record, calculate_ranges from data.utils import bin_array from visualise import graph_power from matplotlib import pyplot as plt from model.model import LSTM, ClassicRNN from tqdm import tqdm parent = Path(__fil...
[ "numpy.mean", "matplotlib.pyplot.show", "pathlib.Path", "numpy.delete", "numpy.max", "numpy.append", "numpy.array", "numpy.load", "data.model.Record", "numpy.expand_dims", "numpy.min", "csv.reader", "numpy.save", "model.model.ClassicRNN", "time.time", "data.utils.bin_array", "matplot...
[((310, 324), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (314, 324), False, 'from pathlib import Path\n'), ((521, 540), 'numpy.min', 'np.min', (['arr'], {'axis': '(0)'}), '(arr, axis=0)\n', (527, 540), True, 'import numpy as np\n'), ((551, 570), 'numpy.max', 'np.max', (['arr'], {'axis': '(0)'}), '(arr,...
# -*- coding: utf-8 -*- # # Creating Sequence to Sequence Models #------------------------------------- # Here we show how to implement sequence to sequence models. # Specifically, we will build an English to German translation model. # import os import re import string import requests import io import numpy as np i...
[ "os.path.exists", "tensorflow.python.framework.ops.reset_default_graph", "os.makedirs", "matplotlib.pyplot.ylabel", "tensorflow.variable_scope", "tensorflow.Session", "matplotlib.pyplot.plot", "os.path.join", "matplotlib.pyplot.xlabel", "requests.get", "io.BytesIO", "collections.Counter", "t...
[((653, 678), 'tensorflow.python.framework.ops.reset_default_graph', 'ops.reset_default_graph', ([], {}), '()\n', (676, 678), False, 'from tensorflow.python.framework import ops\n'), ((705, 717), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (715, 717), True, 'import tensorflow as tf\n'), ((1110, 1144), 'os.pat...
import numpy as np def softmax(x): """Stable softmax""" x -= np.max(x, axis=0) e_x = np.exp(x) return e_x / np.sum(e_x, axis=0) def get_idx_aug_baseline(LOO_influences): """Returns points randomly""" idxs = np.random.choice( len(LOO_influences), len(LOO_influences), ...
[ "numpy.abs", "numpy.max", "numpy.exp", "sample_dpp.oct_sample_k_dpp", "numpy.sum", "numpy.min" ]
[((71, 88), 'numpy.max', 'np.max', (['x'], {'axis': '(0)'}), '(x, axis=0)\n', (77, 88), True, 'import numpy as np\n'), ((99, 108), 'numpy.exp', 'np.exp', (['x'], {}), '(x)\n', (105, 108), True, 'import numpy as np\n'), ((541, 576), 'numpy.abs', 'np.abs', (['LOO_influences'], {'dtype': 'float'}), '(LOO_influences, dtype...
# importing packages import numpy as np import pandas as pd import matplotlib.pyplot as plt import math from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import mean_squared_error from keras.models import Sequential from keras.layers import LSTM, Dense # convert an array of values int...
[ "numpy.reshape", "pandas.read_csv", "matplotlib.pyplot.plot", "keras.models.Sequential", "sklearn.metrics.mean_squared_error", "keras.layers.LSTM", "numpy.array", "numpy.empty_like", "numpy.random.seed", "keras.layers.Dense", "sklearn.preprocessing.MinMaxScaler", "matplotlib.pyplot.show" ]
[((670, 688), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (684, 688), True, 'import numpy as np\n'), ((719, 758), 'pandas.read_csv', 'pd.read_csv', (['"""./airline-passengers.csv"""'], {}), "('./airline-passengers.csv')\n", (730, 758), True, 'import pandas as pd\n'), ((843, 877), 'sklearn.preproces...
import sys import numpy as np INF = 10 ** 18 def main(): x, y, z, K = map(int, sys.stdin.readline().split()) abc = np.array(sys.stdin.read().split(), dtype=np.int64) a = np.append(abc[:x], INF) b = np.append(abc[x:x + y], INF) c = np.append(abc[x + y:x + y+ z], INF) a = np.sort(a)...
[ "numpy.append", "numpy.sort", "sys.stdin.readline", "sys.stdin.read" ]
[((194, 217), 'numpy.append', 'np.append', (['abc[:x]', 'INF'], {}), '(abc[:x], INF)\n', (203, 217), True, 'import numpy as np\n'), ((227, 255), 'numpy.append', 'np.append', (['abc[x:x + y]', 'INF'], {}), '(abc[x:x + y], INF)\n', (236, 255), True, 'import numpy as np\n'), ((265, 301), 'numpy.append', 'np.append', (['ab...
# # Author: <NAME> # Copyright 2016 # import logging import isceobj import mroipac import os import numpy as np from isceobj.Util.decorators import use_api logger = logging.getLogger('isce.insar.VerifyDEM') def runVerifyDEM(self): ''' Make sure that a DEM is available for processing the given data. ''' ...
[ "logging.getLogger", "os.path.exists", "numpy.ceil", "numpy.floor", "isceobj.createDemImage" ]
[((167, 208), 'logging.getLogger', 'logging.getLogger', (['"""isce.insar.VerifyDEM"""'], {}), "('isce.insar.VerifyDEM')\n", (184, 208), False, 'import logging\n'), ((464, 488), 'isceobj.createDemImage', 'isceobj.createDemImage', ([], {}), '()\n', (486, 488), False, 'import isceobj\n'), ((551, 592), 'os.path.exists', 'o...
import os import cv2 import numpy as np from torch.utils.data import DataLoader, Dataset, sampler from kaggle_runner.datasets.coders import run_length_decode from kaggle_runner.datasets.transfomers import get_transforms class SIIMDataset(Dataset): def __init__(self, df, fnames, data_folder, size, mean, std, pha...
[ "kaggle_runner.datasets.coders.run_length_decode", "os.path.join", "numpy.zeros", "kaggle_runner.datasets.transfomers.get_transforms", "cv2.imread" ]
[((504, 542), 'kaggle_runner.datasets.transfomers.get_transforms', 'get_transforms', (['phase', 'size', 'mean', 'std'], {}), '(phase, size, mean, std)\n', (518, 542), False, 'from kaggle_runner.datasets.transfomers import get_transforms\n'), ((800, 842), 'os.path.join', 'os.path.join', (['self.root', "(image_id + '.png...
from styx_msgs.msg import TrafficLight import tensorflow as tf import numpy as np import cv2 import rospy import math class TLClassifier(object): def __init__(self): #TODO load classifier self.MODEL_NAME = 'ssd_mobilenet_v1_coco_2017_11_17' model_file = self.MODEL_NAME + '/frozen_inference_...
[ "cv2.rectangle", "tensorflow.Graph", "numpy.average", "tensorflow.Session", "numpy.asarray", "tensorflow.GraphDef", "numpy.squeeze", "numpy.array", "numpy.expand_dims", "cv2.cvtColor", "tensorflow.gfile.GFile", "tensorflow.import_graph_def" ]
[((362, 372), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (370, 372), True, 'import tensorflow as tf\n'), ((2831, 2869), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2RGB'], {}), '(image, cv2.COLOR_BGR2RGB)\n', (2843, 2869), False, 'import cv2\n'), ((2889, 2921), 'numpy.asarray', 'np.asarray', (['imag...
# -*- coding: utf-8 -*- # Imports #================================================== import json, keras, gensim, codecs import tensorflow as tf import numpy as np import keras.preprocessing.text as kpt from keras.callbacks import Callback from keras.layers import Dropout, Input, Dense, Embedding, LSTM, Bidirectional ...
[ "keras.initializers.RandomUniform", "keras.preprocessing.text.Tokenizer", "keras.models.load_model", "sklearn.model_selection.train_test_split", "sklearn.metrics.classification_report", "keras.layers.add", "sklearn.metrics.precision_recall_fscore_support", "keras_contrib.layers.CRF", "numpy.array", ...
[((5429, 5455), 'keras.preprocessing.text.Tokenizer', 'kpt.Tokenizer', ([], {'lower': '(False)'}), '(lower=False)\n', (5442, 5455), True, 'import keras.preprocessing.text as kpt\n'), ((5925, 5951), 'keras.preprocessing.text.Tokenizer', 'kpt.Tokenizer', ([], {'lower': '(False)'}), '(lower=False)\n', (5938, 5951), True, ...
import numpy as np def list_to_mat(data, dims): m, n = dims n_obs = len(data[:, 0]) out1 = np.zeros((m, n)) out2 = np.zeros((m, n)) for ind in range(n_obs): i, j = data[ind, :2] i = int(i) j = int(j) out1[i, j] = data[ind, -1] out2[i, j] = 1 return out1...
[ "numpy.abs", "numpy.log", "numpy.sum", "numpy.zeros", "numpy.shape" ]
[((104, 120), 'numpy.zeros', 'np.zeros', (['(m, n)'], {}), '((m, n))\n', (112, 120), True, 'import numpy as np\n'), ((132, 148), 'numpy.zeros', 'np.zeros', (['(m, n)'], {}), '((m, n))\n', (140, 148), True, 'import numpy as np\n'), ((485, 528), 'numpy.sum', 'np.sum', (['(U[i_obs, :] * V[:, j_obs].T)'], {'axis': '(1)'}),...
import pandas as pd import numpy as np from rdkit.Chem import PandasTools, AllChem from rdkit import Chem from rdkit.Chem.rdMolDescriptors import GetMorganFingerprint, GetMorganFingerprintAsBitVect from rdkit import DataStructs import os from scipy.stats import lognorm import time #%%% Read in the InStock i chunks db ...
[ "numpy.zeros", "pandas.concat", "pandas.read_csv", "rdkit.Chem.MolFromSmiles" ]
[((1196, 1298), 'pandas.read_csv', 'pd.read_csv', (['"""../data/original/COCONUT_DB_NPL.smi"""'], {'sep': '"""\t"""', 'header': 'None', 'names': "['smiles', 'npl']"}), "('../data/original/COCONUT_DB_NPL.smi', sep='\\t', header=None,\n names=['smiles', 'npl'])\n", (1207, 1298), True, 'import pandas as pd\n'), ((335, ...
"""Base class for Cameras.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import os import numpy as np from robovat.math import get_transform from robovat.math import Pose from robovat.math import Orientation class Camera(object): """...
[ "numpy.prod", "numpy.tile", "numpy.ones", "numpy.logical_and", "robovat.math.Orientation", "os.path.join", "numpy.indices", "robovat.math.Pose", "numpy.array", "numpy.dot", "robovat.math.get_transform", "numpy.linalg.inv", "numpy.matmul", "numpy.load", "numpy.round" ]
[((1778, 1819), 'robovat.math.Pose', 'Pose', (['[self._translation, self._rotation]'], {}), '([self._translation, self._rotation])\n', (1782, 1819), False, 'from robovat.math import Pose\n'), ((3213, 3252), 'os.path.join', 'os.path.join', (['path', '"""IR_intrinsics.npy"""'], {}), "(path, 'IR_intrinsics.npy')\n", (3225...
from __future__ import print_function import numpy as np np.set_printoptions(threshold='nan') import h5py import theano import argparse import itertools import subprocess import logging import time import codecs import os from copy import deepcopy import math import sys from data_generator import VisualWordDataGener...
[ "logging.getLogger", "math.log", "numpy.argsort", "numpy.array", "copy.deepcopy", "os.listdir", "argparse.ArgumentParser", "sys.stdout.flush", "subprocess.check_call", "models.MRNN", "itertools.takewhile", "numpy.argmax", "h5py.File", "data_generator.VisualWordDataGenerator", "codecs.ope...
[((58, 94), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': '"""nan"""'}), "(threshold='nan')\n", (77, 94), True, 'import numpy as np\n'), ((356, 414), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'stream': 'sys.stdout'}), '(level=logging.INFO, stream=sys.stdout)\n', ...
from copy import deepcopy from typing import List from rdkit import Chem from icolos.core.step_utils.obabel_structconvert import OBabelStructConvert from icolos.utils.enums.compound_enums import ( CompoundContainerEnum, EnumerationContainerEnum, ) from icolos.utils.enums.program_parameters import SchrodingerEx...
[ "icolos.utils.enums.compound_enums.CompoundContainerEnum", "numpy.min", "numpy.max", "icolos.utils.enums.write_out_enums.WriteOutEnum", "icolos.core.step_utils.obabel_structconvert.OBabelStructConvert", "rdkit.Chem.SDMolSupplier", "copy.deepcopy", "rdkit.Chem.SDWriter", "icolos.utils.enums.compound_...
[((588, 602), 'icolos.utils.enums.write_out_enums.WriteOutEnum', 'WriteOutEnum', ([], {}), '()\n', (600, 602), False, 'from icolos.utils.enums.write_out_enums import WriteOutEnum\n'), ((610, 638), 'icolos.utils.enums.program_parameters.SchrodingerExecutablesEnum', 'SchrodingerExecutablesEnum', ([], {}), '()\n', (636, 6...
#!/usr/bin/python3 ''' Abstract: This is a program for ploting Usage: plot_signal_noise_ratio.py [sed data] The input sed data should arranged like that: [ S1, S2, S3, ..., N1, N2, N3, ...], [ S1, S2, S3, ..., N1, N2, N3, ...], ... Editor: Jacob975 #################################...
[ "numpy.loadtxt", "numpy.logspace", "time.time", "matplotlib.pyplot.subplots" ]
[((837, 848), 'time.time', 'time.time', ([], {}), '()\n', (846, 848), False, 'import time\n'), ((1269, 1289), 'numpy.loadtxt', 'np.loadtxt', (['sed_name'], {}), '(sed_name)\n', (1279, 1289), True, 'import numpy as np\n'), ((1635, 1699), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(3)', '(3)'], {'figsize': '(16, 12...
"""Windpower and PV power calculation from ERA5 weather data using Feedinlib module. This script gets input parameters from the config.mk file. These parameters can be changed depending on the user interest. target_file:=ERA5_data.nc : Netcdf file of weather data downloaded from CDS using feedinlib module start_date...
[ "feedinlib.Photovoltaic", "os.path.join", "numpy.isnan", "feedinlib.WindPowerPlant", "pandas.to_datetime" ]
[((2263, 2293), 'feedinlib.WindPowerPlant', 'WindPowerPlant', ([], {}), '(**turbine_spec)\n', (2277, 2293), False, 'from feedinlib import Photovoltaic, WindPowerPlant\n'), ((2838, 2865), 'feedinlib.Photovoltaic', 'Photovoltaic', ([], {}), '(**system_data)\n', (2850, 2865), False, 'from feedinlib import Photovoltaic, Wi...
# -*- coding: utf-8 -*- # @Time : 2021/2/10 11:58 上午 # @Author : <NAME> # @FileName: __init__.py # @Software: PyCharm # @Blog :https://lesliewongcv.github.io/ import numpy as np import matplotlib.pyplot as plt import sys sys.path.append('../') import GenericAlgorithm as GA from math import * def fitness_score(in...
[ "numpy.random.random", "numpy.zeros", "sys.path.append" ]
[((228, 250), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (243, 250), False, 'import sys\n'), ((342, 354), 'numpy.zeros', 'np.zeros', (['NP'], {}), '(NP)\n', (350, 354), True, 'import numpy as np\n'), ((608, 633), 'numpy.random.random', 'np.random.random', (['[NP, D]'], {}), '([NP, D])\n', (...
import numpy as np def unflatten(w, weights): sizes = [x.size for x in weights] split_idx = np.cumsum(sizes) update_ravelled = np.split(w, split_idx)[:-1] shapes = [x.shape for x in weights] update_list = [np.reshape(u, s) for s, u in zip(shapes, update_ravelled)] return update_list def flatt...
[ "numpy.cumsum", "numpy.split", "numpy.reshape" ]
[((102, 118), 'numpy.cumsum', 'np.cumsum', (['sizes'], {}), '(sizes)\n', (111, 118), True, 'import numpy as np\n'), ((141, 163), 'numpy.split', 'np.split', (['w', 'split_idx'], {}), '(w, split_idx)\n', (149, 163), True, 'import numpy as np\n'), ((228, 244), 'numpy.reshape', 'np.reshape', (['u', 's'], {}), '(u, s)\n', (...
import sys import os import cv2 import numpy as np import json from PIL import Image, ImageFont, ImageDraw from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from urllib.request import urlretrieve import requests from keras.mod...
[ "yolo_multiple_output.YOLO", "PyQt5.QtWidgets.QMessageBox", "PyQt5.QtGui.QPixmap.fromImage", "PyQt5.QtGui.QImage", "numpy.argsort", "numpy.array", "PIL.ImageDraw.Draw", "PyQt5.QtWidgets.QApplication", "PyQt5.QtWidgets.QVBoxLayout", "os.listdir", "urllib.request.urlretrieve", "numpy.where", "...
[((596, 602), 'yolo_multiple_output.YOLO', 'YOLO', ([], {}), '()\n', (600, 602), False, 'from yolo_multiple_output import YOLO, YOLO2\n'), ((612, 619), 'yolo_multiple_output.YOLO2', 'YOLO2', ([], {}), '()\n', (617, 619), False, 'from yolo_multiple_output import YOLO, YOLO2\n'), ((635, 648), 'yolo_detector.YOLO_detect',...
# import libraries import numpy as np import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LogisticRegression from sklearn.model_selection import GridSearchCV # load data # data set used: https://www.kaggle.com/sulianova/cardiovascular-disease-dataset/data df = pd.read_...
[ "pandas.read_csv", "sklearn.linear_model.LogisticRegression", "sklearn.preprocessing.StandardScaler", "pandas.to_numeric", "numpy.logspace" ]
[((312, 352), 'pandas.read_csv', 'pd.read_csv', (['"""cardio_train.csv"""'], {'sep': '""","""'}), "('cardio_train.csv', sep=',')\n", (323, 352), True, 'import pandas as pd\n'), ((790, 836), 'pandas.to_numeric', 'pd.to_numeric', (["df['years']"], {'downcast': '"""integer"""'}), "(df['years'], downcast='integer')\n", (80...
import numpy as np from helpers import get_signal, number_of_frames, first_last_frame_number import os import cv2 import seaborn as sns; sns.set() mode = 1024 fps = 20 signal_list = ['range', 'reflectivity', 'signal', 'ambient'] signal_name = input("Signal to display:") for idx, val in enumerate(signal_list): if ...
[ "seaborn.set", "cv2.merge", "helpers.get_signal", "cv2.VideoWriter", "os.chdir", "helpers.number_of_frames", "numpy.zeros", "cv2.VideoWriter_fourcc", "numpy.rot90" ]
[((137, 146), 'seaborn.set', 'sns.set', ([], {}), '()\n', (144, 146), True, 'import seaborn as sns\n'), ((417, 487), 'os.chdir', 'os.chdir', (['"""/media/nizar/Transcend/test in the lab/Data/myFormat/Lidar"""'], {}), "('/media/nizar/Transcend/test in the lab/Data/myFormat/Lidar')\n", (425, 487), False, 'import os\n'), ...
import sys import open3d import numpy as np import time import os from geometric_registration.utils import get_pcd, get_keypts, get_desc, loadlog import cv2 from functools import partial def build_correspondence(source_desc, target_desc): """ Find the mutually closest point pairs in feature space. source ...
[ "numpy.sqrt", "open3d.PointCloud", "numpy.array", "geometric_registration.utils.get_desc", "open3d.TransformationEstimationPointToPoint", "os.path.exists", "os.listdir", "numpy.asarray", "geometric_registration.utils.loadlog", "open3d.registration.Feature", "os.mkdir", "numpy.min", "numpy.ar...
[((411, 457), 'numpy.sqrt', 'np.sqrt', (['(2 - 2 * (source_desc @ target_desc.T))'], {}), '(2 - 2 * (source_desc @ target_desc.T))\n', (418, 457), True, 'import numpy as np\n'), ((475, 502), 'numpy.argmin', 'np.argmin', (['distance'], {'axis': '(1)'}), '(distance, axis=1)\n', (484, 502), True, 'import numpy as np\n'), ...
import pytest import numpy as np from jina.excepts import BadClientCallback from jina.flow import Flow def validate(x): raise NotImplementedError @pytest.mark.parametrize('restful', [False, True]) def test_client_on_error(restful): # In this particular test, when you write two tests in a row, you are testi...
[ "numpy.random.random", "pytest.mark.parametrize", "jina.flow.Flow" ]
[((156, 205), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""restful"""', '[False, True]'], {}), "('restful', [False, True])\n", (179, 205), False, 'import pytest\n'), ((1196, 1220), 'numpy.random.random', 'np.random.random', (['[5, 4]'], {}), '([5, 4])\n', (1212, 1220), True, 'import numpy as np\n'), ((79...
import numpy as np import scipy as sp from scipy.linalg import cho_factor, cho_solve import time start_time = time.time() #float_formatter = '{:.4f}'.format #np.set_printoptions(formatter={'float_kind':float_formatter}) N = 1000 print('N: ', N) #Filling N*N array to initialize it A1 = np.zeros((N,N), float) A2 = np....
[ "scipy.linalg.cho_solve", "numpy.ones", "scipy.linalg.cho_factor", "numpy.fill_diagonal", "numpy.zeros", "time.time" ]
[((110, 121), 'time.time', 'time.time', ([], {}), '()\n', (119, 121), False, 'import time\n'), ((289, 312), 'numpy.zeros', 'np.zeros', (['(N, N)', 'float'], {}), '((N, N), float)\n', (297, 312), True, 'import numpy as np\n'), ((317, 340), 'numpy.zeros', 'np.zeros', (['(N, N)', 'float'], {}), '((N, N), float)\n', (325, ...
#!/usr/bin/env python # coding: utf-8 # # Import Base Packages # In[ ]: import pandas as pd import numpy as np import warnings warnings.filterwarnings('ignore') # # Interface function to feature engineering data # In[ ]: from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import Standard...
[ "sklearn.preprocessing.LabelEncoder", "sklearn.preprocessing.PolynomialFeatures", "matplotlib.pyplot.grid", "pandas.read_csv", "matplotlib.pyplot.ylabel", "sklearn.metrics.classification_report", "sklearn.metrics.auc", "numpy.hstack", "sklearn.tree.export_graphviz", "numpy.array", "sklearn.metri...
[((132, 165), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (155, 165), False, 'import warnings\n'), ((822, 836), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (834, 836), False, 'from sklearn.preprocessing import LabelEncoder\n'), ((846, 862), '...
from Textures import VOICE_MODULATION, DIALOGBOX_READOUT, NAMIKO, FRAMEBORDER __author__ = "<NAME>" __copyright__ = "Copyright 2007, Cobra Project" __credits__ = ["<NAME>"] __license__ = "GPL" __version__ = "1.0.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __status__ = "Demo" from numpy import lins...
[ "pygame.init", "pygame.quit", "pygame.sprite.RenderUpdates", "pygame.transform.scale", "Textures.FRAMEBORDER.blit", "pygame.display.set_mode", "pygame.transform.smoothscale", "pygame.display.flip", "numpy.linspace", "pygame.freetype.init", "pygame.image.load", "pygame.Rect", "random.randint"...
[((13983, 13996), 'pygame.init', 'pygame.init', ([], {}), '()\n', (13994, 13996), False, 'import pygame\n'), ((14002, 14045), 'pygame.freetype.init', 'freetype.init', ([], {'cache_size': '(64)', 'resolution': '(72)'}), '(cache_size=64, resolution=72)\n', (14015, 14045), False, 'from pygame import freetype\n'), ((14064,...
# Copyright (c) 2019 Uber Technologies, 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...
[ "hypothesis.extra.numpy.order_check", "hypothesis.strategies.builds", "hypothesis.strategies.fixed_dictionaries", "hypothesis.strategies.integers", "hypothesis.extra.numpy.arrays", "hypothesis.strategies.just", "collections.defaultdict", "hypothesis.internal.validation.check_valid_bound", "numpy.bro...
[((2688, 2721), 'hypothesis.internal.validation.check_valid_bound', 'check_valid_bound', (['min_size', 'name'], {}), '(min_size, name)\n', (2705, 2721), False, 'from hypothesis.internal.validation import check_type, check_valid_bound\n'), ((2726, 2759), 'hypothesis.internal.validation.check_valid_bound', 'check_valid_b...
#!/usr/bin/python # # Author: <NAME> (<EMAIL>) # Date: 19th May 2016 # Fusion Tables API: # https://developers.google.com/resources/api-libraries/documentation/fusiontables/v2/python/latest/index.html """ Includes functions to integrate with Google Fusion Tables. The results and implementation is based on the API provi...
[ "logging.getLogger", "os.path.exists", "csv.DictWriter", "traceback.format_exc", "pykml.factory.KML_ElementMaker.MultiGeometry", "threading.current_thread", "os.makedirs", "pykml.factory.KML_ElementMaker.Polygon", "colorker.security.CredentialManager.get_fusion_tables_service", "googleapiclient.ht...
[((844, 871), 'logging.getLogger', 'logging.getLogger', (['"""worker"""'], {}), "('worker')\n", (861, 871), False, 'import logging\n'), ((2041, 2099), 'colorker.security.CredentialManager.get_fusion_tables_service', 'CredentialManager.get_fusion_tables_service', (['user_settings'], {}), '(user_settings)\n', (2084, 2099...
# general libraries import warnings import numpy as np # image processing libraries from scipy import ndimage from skimage.transform import radon from skimage.measure.fit import _dynamic_max_trials from ..generic.test_tools import \ construct_phase_plane, cross_spectrum_to_coordinate_list from ..generic.data_tool...
[ "numpy.radians", "numpy.random.default_rng", "numpy.argsort", "numpy.array", "numpy.sin", "scipy.ndimage.rotate", "numpy.imag", "numpy.arange", "numpy.multiply", "numpy.real", "numpy.dot", "numpy.linalg.lstsq", "numpy.linalg.eigh", "numpy.argmin", "numpy.remainder", "numpy.round", "n...
[((622, 634), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (630, 634), True, 'import numpy as np\n'), ((653, 665), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (661, 665), True, 'import numpy as np\n'), ((670, 682), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (678, 682), True, 'import numpy as np\n')...
""" Plots mooring records. Specific to a request from <NAME>, 2020_11. """ # setup import netCDF4 as nc import matplotlib.pyplot as plt import numpy as np import matplotlib.dates as mdates from datetime import datetime import os; import sys sys.path.append(os.path.abspath('../alpha')) import Lfun import zfun Ldir...
[ "numpy.nanmean", "matplotlib.dates.DayLocator", "numpy.sin", "datetime.datetime", "netCDF4.Dataset", "matplotlib.pyplot.close", "numpy.rad2deg", "matplotlib.dates.num2date", "Lfun.modtime_to_mdate_vec", "matplotlib.dates.DateFormatter", "zfun.filt_hanning_mat", "numpy.cos", "matplotlib.pyplo...
[((323, 336), 'Lfun.Lstart', 'Lfun.Lstart', ([], {}), '()\n', (334, 336), False, 'import Lfun\n'), ((664, 678), 'netCDF4.Dataset', 'nc.Dataset', (['fn'], {}), '(fn)\n', (674, 678), True, 'import netCDF4 as nc\n'), ((733, 766), 'Lfun.modtime_to_mdate_vec', 'Lfun.modtime_to_mdate_vec', (['ot_vec'], {}), '(ot_vec)\n', (75...
#!/usr/bin/env python # -*- coding:utf-8 -*- # @Filename: field.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) import numpy as np import fitsio import scipy.optimize as optimize import matplotlib.pyplot as plt import ortools.sat.python.cp_model as cp_model import kaiju import kaiju.ro...
[ "numpy.sqrt", "numpy.argsort", "numpy.array", "numpy.arctan2", "numpy.sin", "numpy.arange", "kaiju.robotGrid.RobotGridFilledHex", "numpy.where", "numpy.float64", "fitsio.read", "fitsio.FITS", "fitsio.read_header", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylim", "numpy.dtype", "o...
[((504, 733), 'numpy.dtype', 'np.dtype', (["[('ra', np.float64), ('dec', np.float64), ('catalogid', np.int64), (\n 'category', np.unicode_, 30), ('program', np.unicode_, 30), (\n 'fiberType', np.unicode_, 30), ('priority', np.int32), ('within', np.int32)\n ]"], {}), "([('ra', np.float64), ('dec', np.float64), ...
import numpy as np import pandas as pd from pathlib import Path from typing import Dict, List, Union from collections import OrderedDict from pathos.multiprocessing import ThreadPool as Pool from tqdm import tqdm from src.utils import remap_label, get_type_instances from .metrics import PQ, AJI, AJI_plus, DICE2, split...
[ "pandas.DataFrame.from_records", "numpy.unique", "pathlib.Path", "src.utils.remap_label", "pathos.multiprocessing.ThreadPool", "src.utils.get_type_instances", "pandas.DataFrame", "pandas.concat" ]
[((4430, 4464), 'pandas.DataFrame.from_records', 'pd.DataFrame.from_records', (['metrics'], {}), '(metrics)\n', (4455, 4464), True, 'import pandas as pd\n'), ((8377, 8391), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (8389, 8391), True, 'import pandas as pd\n'), ((1074, 1091), 'src.utils.remap_label', 'remap_...
import numpy as np from sympy import sin, Abs from devito import (Grid, Inc, Operator, Function, SubDomain, Eq, SubDimension, ConditionalDimension, switchconfig) from devito.tools import memoized_meth __all__ = ['Model'] def initialize_damp(damp, nbpml, spacing, mask=False): """ Initial...
[ "sympy.sin", "devito.SubDimension.left", "devito.ConditionalDimension", "devito.Function", "devito.Operator", "numpy.log", "numpy.max", "numpy.array", "devito.Eq", "numpy.min", "devito.SubDimension.right", "devito.Grid" ]
[((955, 1025), 'devito.SubDimension.left', 'SubDimension.left', ([], {'name': "('abc_%s_l' % d.name)", 'parent': 'd', 'thickness': 'nbpml'}), "(name='abc_%s_l' % d.name, parent=d, thickness=nbpml)\n", (972, 1025), False, 'from devito import Grid, Inc, Operator, Function, SubDomain, Eq, SubDimension, ConditionalDimensio...
#!/people/chen423/sw/anaconda3/bin/python import numpy as np import xarray as xr import scipy.io as sio import sys scenario = 'HIST' year = int(sys.argv[1]) month = int(sys.argv[2]) para_b = int(10) def compute_moisture_intensity(in_ARtag, in_uIVT, in_ET, ref_mask): uIVT_total = in_uIVT[:,0][in_ARtag[:,0]==1].s...
[ "scipy.io.savemat", "numpy.floor", "numpy.zeros", "xarray.open_dataset", "numpy.arange" ]
[((1654, 1666), 'numpy.zeros', 'np.zeros', (['nt'], {}), '(nt)\n', (1662, 1666), True, 'import numpy as np\n'), ((1678, 1690), 'numpy.zeros', 'np.zeros', (['nt'], {}), '(nt)\n', (1686, 1690), True, 'import numpy as np\n'), ((1704, 1716), 'numpy.zeros', 'np.zeros', (['nt'], {}), '(nt)\n', (1712, 1716), True, 'import num...
import random import math import csv import pickle import os import numpy as np from .helpers.transforms import is_valid_vertical_offset, deg2rad controller_dir = os.path.dirname(os.path.realpath(__file__)) TEST_CASES_PKL = os.path.join(controller_dir, "test_cases/test_cases.pkl") TEST_CASES_CSV = os.path.join(contr...
[ "csv.DictWriter", "random.choice", "pickle.dump", "os.path.join", "pickle.load", "os.path.realpath", "numpy.linalg.norm", "numpy.arange" ]
[((227, 284), 'os.path.join', 'os.path.join', (['controller_dir', '"""test_cases/test_cases.pkl"""'], {}), "(controller_dir, 'test_cases/test_cases.pkl')\n", (239, 284), False, 'import os\n'), ((302, 359), 'os.path.join', 'os.path.join', (['controller_dir', '"""test_cases/test_cases.csv"""'], {}), "(controller_dir, 'te...
""" ======================================================= Reconstruction with Constrained Spherical Deconvolution ======================================================= This example shows how to use Constrained Spherical Deconvolution (CSD) introduced by Tournier et al. [Tournier2007]_. This method is mainly usefu...
[ "numpy.mean", "dipy.data.fetch_stanford_hardi", "dipy.reconst.dti.fractional_anisotropy", "dipy.reconst.dti.TensorModel", "dipy.viz.fvtk.sphere_funcs", "numpy.where", "dipy.data.get_sphere", "numpy.array", "dipy.viz.fvtk.add", "numpy.isnan", "numpy.nonzero", "dipy.reconst.csdeconv.ConstrainedS...
[((770, 792), 'dipy.data.fetch_stanford_hardi', 'fetch_stanford_hardi', ([], {}), '()\n', (790, 792), False, 'from dipy.data import fetch_stanford_hardi, read_stanford_hardi\n'), ((805, 826), 'dipy.data.read_stanford_hardi', 'read_stanford_hardi', ([], {}), '()\n', (824, 826), False, 'from dipy.data import fetch_stanfo...
###################################################################### # # # Copyright 2009-2019 <NAME>. # # This file is part of gdspy, distributed under the terms of the # # Boost Software License - Version 1.0. See the accom...
[ "gdspy._hobby", "numpy.abs", "numpy.arccos", "gdspy._zero.reshape", "gdspy._func_bezier", "numpy.array", "numpy.linspace", "numpy.empty_like", "numpy.vstack", "numpy.cos", "numpy.empty", "numpy.sin", "numpy.sign" ]
[((3112, 3136), 'numpy.array', 'numpy.array', (['self.points'], {}), '(self.points)\n', (3123, 3136), False, 'import numpy\n'), ((7440, 7526), 'numpy.linspace', 'numpy.linspace', (['(initial_angle - rotation)', '(final_angle - rotation)', 'number_of_points'], {}), '(initial_angle - rotation, final_angle - rotation,\n ...
import numpy as np import cv2 import glob import helpers warping_from = np.float32([[200, 720], [604, 450], [696, 450], [1120, 720]]) warping_to = np.float32([[200, 720], [200, 0], [1120, 0], [1120, 720]]) def calibrate(): criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) objp = np.z...
[ "cv2.getPerspectiveTransform", "cv2.undistort", "cv2.getOptimalNewCameraMatrix", "numpy.zeros", "cv2.warpPerspective", "cv2.cvtColor", "cv2.calibrateCamera", "cv2.findChessboardCorners", "cv2.resize", "cv2.cornerSubPix", "cv2.imread", "numpy.float32", "glob.glob" ]
[((73, 134), 'numpy.float32', 'np.float32', (['[[200, 720], [604, 450], [696, 450], [1120, 720]]'], {}), '([[200, 720], [604, 450], [696, 450], [1120, 720]])\n', (83, 134), True, 'import numpy as np\n'), ((148, 206), 'numpy.float32', 'np.float32', (['[[200, 720], [200, 0], [1120, 0], [1120, 720]]'], {}), '([[200, 720],...
import numpy as np from collections import defaultdict import sys import argparse # we rely on ordered dictionaries here assert sys.version_info >= (3, 6) def read_fasta(fasta_path, alphabet='ACDEFGHIKLMNPQRSTVWY-', default_index=20): # read all the sequences into a dictionary seq_dict = {} with open(fa...
[ "numpy.unique", "argparse.ArgumentParser", "numpy.array", "numpy.zeros", "numpy.sum" ]
[((984, 1012), 'numpy.array', 'np.array', (['seq_msa'], {'dtype': 'int'}), '(seq_msa, dtype=int)\n', (992, 1012), True, 'import numpy as np\n'), ((1059, 1082), 'numpy.zeros', 'np.zeros', (['seq_msa.shape'], {}), '(seq_msa.shape)\n', (1067, 1082), True, 'import numpy as np\n'), ((1473, 1491), 'numpy.sum', 'np.sum', (['s...
import argparse import sys from tqdm import tqdm import json import subprocess import os import random import numpy as np import torch from sklearn.metrics import (roc_auc_score, auc, precision_recall_curve, r2_score, accuracy_score, log_loss) # optimization goal for various metrics METRI...
[ "sklearn.metrics.auc", "sklearn.metrics.roc_auc_score", "numpy.array", "sklearn.metrics.log_loss", "numpy.bitwise_not", "sklearn.metrics.r2_score", "argparse.ArgumentParser", "subprocess.Popen", "sys.stdout.flush", "random.shuffle", "sklearn.metrics.precision_recall_curve", "torch.einsum", "...
[((1393, 1403), 'tqdm.tqdm', 'tqdm', (['iter'], {}), '(iter)\n', (1397, 1403), False, 'from tqdm import tqdm\n'), ((2389, 2407), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (2405, 2407), False, 'import sys\n'), ((2578, 2635), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'shell': '(True)', 'executabl...
import gradio as gr import pandas as pd import numpy as np from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import cross_val_score from sklearn.neighbors import KNeighborsClassifier def load_data(): ''' Загрузка данных ''' data = pd.read_csv('data/occupancy_datatraining.txt',...
[ "numpy.mean", "gradio.Interface", "pandas.read_csv", "gradio.outputs.Label", "sklearn.neighbors.KNeighborsClassifier", "gradio.outputs.Textbox", "gradio.outputs.KeyValues", "gradio.inputs.Slider", "sklearn.preprocessing.MinMaxScaler" ]
[((1410, 1502), 'gradio.inputs.Slider', 'gr.inputs.Slider', ([], {'minimum': '(1)', 'maximum': '(300)', 'step': '(1)', 'default': '(5)', 'label': '"""Количество соседей"""'}), "(minimum=1, maximum=300, step=1, default=5, label=\n 'Количество соседей')\n", (1426, 1502), True, 'import gradio as gr\n'), ((1510, 1600), ...
""" Load a part config for inclusion into whole config """ import numpy as np from dlpoly.config import Atom from dlpoly.field import Molecule from dlpoly.utility import read_line, build_3d_rotation_matrix class CFG(Molecule): ''' Load a partial configuration ''' def __init__(self, source=None): Molec...
[ "dlpoly.utility.build_3d_rotation_matrix", "numpy.asarray", "numpy.max", "numpy.sum", "numpy.matmul", "numpy.min", "dlpoly.utility.read_line", "dlpoly.field.Molecule.__init__" ]
[((315, 338), 'dlpoly.field.Molecule.__init__', 'Molecule.__init__', (['self'], {}), '(self)\n', (332, 338), False, 'from dlpoly.field import Molecule\n'), ((1334, 1385), 'dlpoly.utility.build_3d_rotation_matrix', 'build_3d_rotation_matrix', (['alpha', 'beta', 'gamma', '"""deg"""'], {}), "(alpha, beta, gamma, 'deg')\n"...
import numpy as np import matplotlib.pyplot as plt from IPython.html.widgets import interactive, IntSlider, widget, FloatText, FloatSlider, Checkbox, ToggleButtons sigmin = 0.01 sigmax = 0.1 sigma_0 = 0 # conductivity of the air h_1 = 1. h_boom = 0. h_boom_max = 2. zmax = 4. z = np.linspace(0.,zmax,1000) phi_v...
[ "numpy.ones", "IPython.html.widgets.FloatSlider", "numpy.linspace", "matplotlib.pyplot.tight_layout", "IPython.html.widgets.ToggleButtons", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((287, 315), 'numpy.linspace', 'np.linspace', (['(0.0)', 'zmax', '(1000)'], {}), '(0.0, zmax, 1000)\n', (298, 315), True, 'import numpy as np\n'), ((1288, 1323), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(3)'], {'figsize': '(11, 6)'}), '(1, 3, figsize=(11, 6))\n', (1300, 1323), True, 'import matplotlib.p...
"""Mutual information using binnings. All the functions inside this file can be compiled using Numba. """ import numpy as np import logging from frites.utils import jit logger = logging.getLogger('frites') ############################################################################### #############################...
[ "logging.getLogger", "numpy.histogram", "numpy.int64", "numpy.unique", "numpy.sum", "numpy.zeros", "numpy.nonzero", "frites.utils.jit", "numpy.log2", "numpy.float32" ]
[((181, 208), 'logging.getLogger', 'logging.getLogger', (['"""frites"""'], {}), "('frites')\n", (198, 208), False, 'import logging\n'), ((787, 803), 'frites.utils.jit', 'jit', (['"""f4(f4[:])"""'], {}), "('f4(f4[:])')\n", (790, 803), False, 'from frites.utils import jit\n'), ((1364, 1387), 'frites.utils.jit', 'jit', ([...
#!/usr/bin/python # The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt # # This example program shows how to use dlib's implementation of the paper: # One Millisecond Face Alignment with an Ensemble of Regression Trees by # <NAME> and <NAME>, CVPR 2014 # # In particular, we...
[ "matplotlib.pyplot.imshow", "os.path.exists", "contextlib.redirect_stdout", "os.makedirs", "matplotlib.use", "dlib.rectangle", "os.path.join", "dlib.shape_predictor", "matplotlib.pyplot.close", "skimage.io.imread", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.scatter", "nu...
[((1469, 1490), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (1483, 1490), False, 'import matplotlib\n'), ((2457, 2515), 'dlib.shape_predictor', 'dlib.shape_predictor', (["(checkpoint_folder + '/predictor.dat')"], {}), "(checkpoint_folder + '/predictor.dat')\n", (2477, 2515), False, 'import dli...
import numpy as np class Problem: """ General linear programming optimization problem. Requires a vector to define the objective function. Accepts box and linear constraints. """ def __init__( self, N, Nconslin=0 ): """ linear programming optimization problem Argument...
[ "numpy.asfortranarray", "numpy.zeros", "numpy.ones" ]
[((1651, 1672), 'numpy.asfortranarray', 'np.asfortranarray', (['lb'], {}), '(lb)\n', (1668, 1672), True, 'import numpy as np\n'), ((1693, 1714), 'numpy.asfortranarray', 'np.asfortranarray', (['ub'], {}), '(ub)\n', (1710, 1714), True, 'import numpy as np\n'), ((2367, 2387), 'numpy.asfortranarray', 'np.asfortranarray', (...
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches from scipy import linalg as la from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter from cycler import cycler #FUNCAO CONTINUA def potv(xa,multi,lw): x=abs(xa)/lw return mu...
[ "numpy.sort", "numpy.tanh", "scipy.linalg.eig", "numpy.zeros", "numpy.linspace", "numpy.array", "matplotlib.patches.Patch", "matplotlib.pyplot.subplots", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((748, 779), 'numpy.zeros', 'np.zeros', (['(n + 1, n + 1)', 'float'], {}), '((n + 1, n + 1), float)\n', (756, 779), True, 'import numpy as np\n'), ((1044, 1054), 'scipy.linalg.eig', 'la.eig', (['vp'], {}), '(vp)\n', (1050, 1054), True, 'from scipy import linalg as la\n'), ((1067, 1102), 'numpy.sort', 'np.sort', (['(Av...
from distanceclosure.distance import pairwise_proximity, _jaccard_coef_scipy, _jaccard_coef_binary, _jaccard_coef_set, _jaccard_coef_weighted_numpy import numpy as np from scipy.sparse import csr_matrix B = np.array([ [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 0, 0], [1, 0, 0, 0], ]) N = np.array([ [2, 3,...
[ "distanceclosure.distance._jaccard_coef_set", "distanceclosure.distance._jaccard_coef_weighted_numpy", "numpy.isclose", "distanceclosure.distance.pairwise_proximity", "numpy.array", "distanceclosure.distance._jaccard_coef_scipy", "distanceclosure.distance._jaccard_coef_binary", "scipy.sparse.csr_matri...
[((208, 274), 'numpy.array', 'np.array', (['[[1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 0, 0], [1, 0, 0, 0]]'], {}), '([[1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 0, 0], [1, 0, 0, 0]])\n', (216, 274), True, 'import numpy as np\n'), ((299, 365), 'numpy.array', 'np.array', (['[[2, 3, 4, 2], [2, 3, 4, 2], [2, 3, 3, 2], [2, 1, 3, 4]]'], {...
from ..util import cached, search, llist, WeakRefProperty, SourceError from ..containers.basereader import Track import threading import numpy from collections import OrderedDict from itertools import count from copy import deepcopy import weakref def notifyIterate(iterator, func): for item in iterator: f...
[ "collections.OrderedDict", "numpy.ones", "numpy.int0", "threading.RLock", "itertools.count", "copy.deepcopy", "weakref.ref", "numpy.arange" ]
[((1703, 1720), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (1718, 1720), False, 'import threading\n'), ((1787, 1803), 'weakref.ref', 'weakref.ref', (['mon'], {}), '(mon)\n', (1798, 1803), False, 'import weakref\n'), ((4184, 4197), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (4195, 4197), Fa...
import h5py import numpy as np from tensorflow.keras.utils import to_categorical import os # to test generator, values = next(generator) in code def ensureDir(filePath): ''' This function checks if the folder at filePath exists. If not, it creates it. ''' if not os.path.exists(filePath): os.makedirs(filePath...
[ "os.path.exists", "tensorflow.keras.utils.to_categorical", "os.makedirs", "numpy.asarray", "numpy.expand_dims" ]
[((272, 296), 'os.path.exists', 'os.path.exists', (['filePath'], {}), '(filePath)\n', (286, 296), False, 'import os\n'), ((300, 321), 'os.makedirs', 'os.makedirs', (['filePath'], {}), '(filePath)\n', (311, 321), False, 'import os\n'), ((465, 513), 'numpy.expand_dims', 'np.expand_dims', (["h5file['RNASeq'][index]"], {'a...
from PIL import Image import tensorflow as tf from config import MODEL_META_DATA as model_meta from maxfw.model import MAXModelWrapper import io import numpy as np import logging from config import PATH_TO_CKPT, PATH_TO_LABELS, NUM_CLASSES # TODO maybe a better way to import this? import sys sys.path.insert(0, '../') ...
[ "logging.getLogger", "tensorflow.Graph", "utils.label_map_util.load_labelmap", "sys.path.insert", "tensorflow.slice", "tensorflow.Session", "io.BytesIO", "tensorflow.GraphDef", "utils.label_map_util.convert_label_map_to_categories", "utils.label_map_util.create_category_index", "tensorflow.impor...
[((294, 319), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../"""'], {}), "(0, '../')\n", (309, 319), False, 'import sys\n'), ((363, 382), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (380, 382), False, 'import logging\n'), ((627, 637), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (635, 637), ...
import sys import numpy as np import random from keras.models import Sequential, load_model from keras.layers.core import Dense, Activation, Dropout from keras.layers.recurrent import LSTM, SimpleRNN from keras.layers.wrappers import TimeDistributed import os import re #generate_length = int(sys.argv[1]) #Number of cha...
[ "os.get_terminal_size", "keras.layers.core.Activation", "keras.models.Sequential", "numpy.zeros", "keras.layers.core.Dense", "re.sub", "keras.layers.recurrent.LSTM" ]
[((503, 536), 'numpy.zeros', 'np.zeros', (['(1, length, vocab_size)'], {}), '((1, length, vocab_size))\n', (511, 536), True, 'import numpy as np\n'), ((1615, 1627), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1625, 1627), False, 'from keras.models import Sequential, load_model\n'), ((2532, 2557), 're.su...
# coding=utf-8 import sys import numpy as np import random import math import torch import tensorflow as tf #梯度裁剪功能 def clip_func(clip_bound,clip_type,input): if(clip_bound<=0): return input if(clip_type=="norm1"): return tf.clip_by_value(input,-1*clip_bound,clip_bound) elif(clip_type=="no...
[ "tensorflow.nn.moments", "math.sqrt", "math.log", "tensorflow.gather", "tensorflow.clip_by_value", "numpy.random.laplace", "tensorflow.reshape", "random.gauss", "tensorflow.norm" ]
[((548, 585), 'numpy.random.laplace', 'np.random.laplace', (['(0)', 'beta'], {'size': 'size'}), '(0, beta, size=size)\n', (565, 585), True, 'import numpy as np\n'), ((623, 645), 'random.gauss', 'random.gauss', (['(0)', 'sigma'], {}), '(0, sigma)\n', (635, 645), False, 'import random\n'), ((1021, 1048), 'tensorflow.resh...
import os.path as path import json import numpy as np import tensorflow as tf from .tool_generate_data import GenerateData from .hmm import HMM thisdir = path.dirname(path.realpath(__file__)) generator = GenerateData(num_time=7) # Make data states, emissions = generator.data() # Check reference hmm = HMM(generator...
[ "os.path.realpath", "numpy.transpose", "os.path.join" ]
[((169, 192), 'os.path.realpath', 'path.realpath', (['__file__'], {}), '(__file__)\n', (182, 192), True, 'import os.path as path\n'), ((581, 615), 'numpy.transpose', 'np.transpose', (['emissions', '[1, 0, 2]'], {}), '(emissions, [1, 0, 2])\n', (593, 615), True, 'import numpy as np\n'), ((652, 693), 'os.path.join', 'pat...
import numpy as np import tensorflow as tf import copy np.random.seed(1) tf.set_random_seed(1) class PolicyGradient: def __init__( self, n_actions=2, n_features=87, learning_rate=0.01, reward_decay=0.95, prob_clip=0.06, output_grap...
[ "tensorflow.train.RMSPropOptimizer", "tensorflow.nn.rnn_cell.BasicLSTMCell", "tensorflow.Session", "tensorflow.contrib.layers.fully_connected", "tensorflow.placeholder", "tensorflow.reduce_sum", "tensorflow.nn.dynamic_rnn", "tensorflow.global_variables_initializer", "numpy.array", "tensorflow.name...
[((55, 72), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (69, 72), True, 'import numpy as np\n'), ((73, 94), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(1)'], {}), '(1)\n', (91, 94), True, 'import tensorflow as tf\n'), ((764, 776), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (774...
import pytest import numpy as np from sklearn.datasets import make_blobs from sklearn.datasets import load_diabetes from tests.utils import resample_data from deeprob.spn.structure.node import Sum, Product from deeprob.spn.structure.leaf import Bernoulli, Gaussian from deeprob.spn.learning.wrappers import learn_estim...
[ "deeprob.spn.structure.node.Sum", "numpy.isclose", "deeprob.spn.structure.leaf.Gaussian", "numpy.median", "deeprob.spn.structure.node.Product", "sklearn.datasets.make_blobs", "deeprob.spn.learning.em.expectation_maximization", "deeprob.spn.learning.wrappers.learn_estimator", "sklearn.datasets.load_d...
[((491, 521), 'sklearn.datasets.load_diabetes', 'load_diabetes', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (504, 521), False, 'from sklearn.datasets import load_diabetes\n'), ((743, 860), 'sklearn.datasets.make_blobs', 'make_blobs', ([], {'n_samples': '(1000)', 'n_features': '(2)', 'random_state': '(1337)'...
# Visualizations for debugging and Tensorboard import matplotlib import socket if socket.gethostname() != 'arch': matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import io import tensorflow as tf from matplotlib.patches import Circle from matplotlib.patches import Patch # Keep colors consi...
[ "matplotlib.pyplot.ylabel", "io.BytesIO", "numpy.imag", "tensorflow.summary.image", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.real", "matplotlib.pyplot.scatter", "socket.gethostname", "matplotlib.use", "matplotlib.pyplot.gca", "matplotlib.pyplot.axes", "matplotlib.patches....
[((82, 102), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (100, 102), False, 'import socket\n'), ((118, 139), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (132, 139), False, 'import matplotlib\n'), ((936, 948), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (946, 9...
from Beam import Beam from OpticalElement import Optical_element from Shape import BoundaryRectangle import numpy as np from SurfaceConic import SurfaceConic import matplotlib.pyplot as plt from CompoundOpticalElement import CompoundOpticalElement from Vector import Vector from numpy.testing import assert_almost_equal ...
[ "Beam.Beam", "numpy.where", "CompoundOpticalElement.CompoundOpticalElement.initialize_as_kirkpatrick_baez", "Shadow.Beam", "numpy.testing.assert_almost_equal", "Shadow.Source", "Shape.BoundaryRectangle", "matplotlib.pyplot.show" ]
[((664, 677), 'Shadow.Beam', 'Shadow.Beam', ([], {}), '()\n', (675, 677), False, 'import Shadow\n'), ((688, 703), 'Shadow.Source', 'Shadow.Source', ([], {}), '()\n', (701, 703), False, 'import Shadow\n'), ((1628, 1634), 'Beam.Beam', 'Beam', ([], {}), '()\n', (1632, 1634), False, 'from Beam import Beam\n'), ((1953, 2012...
from scipy.optimize import minimize import numpy as np import glog as log def get_objective_function(ball_center, normal_vector): func = lambda x: -np.dot(x-ball_center, normal_vector) # minimize (negative sign) jac = lambda x: -normal_vector # jac是梯度/导数公式 return func, jac def get_constraints(x_origina...
[ "numpy.random.rand", "scipy.optimize.minimize", "numpy.square", "numpy.dot", "glog.info" ]
[((1043, 1075), 'numpy.random.rand', 'np.random.rand', (['ball_center.size'], {}), '(ball_center.size)\n', (1057, 1075), True, 'import numpy as np\n'), ((1312, 1451), 'scipy.optimize.minimize', 'minimize', (['objective_func', 'initial_x'], {'jac': 'objective_func_deriv', 'method': '"""SLSQP"""', 'bounds': 'bounds', 'co...
# # Created by <NAME> on 05/02/2019. # from typing import List import numpy as np from numpy.random import RandomState from sklearn.utils import resample from phenotrex.util.logging import get_logger from phenotrex.structure.records import TrainingRecord class TrainingRecordResampler: """ Instantiates an ob...
[ "phenotrex.util.logging.get_logger", "numpy.array", "sklearn.utils.resample", "phenotrex.structure.records.TrainingRecord", "numpy.random.RandomState" ]
[((781, 836), 'phenotrex.util.logging.get_logger', 'get_logger', ([], {'initname': 'self.__class__.__name__', 'verb': 'verb'}), '(initname=self.__class__.__name__, verb=verb)\n', (791, 836), False, 'from phenotrex.util.logging import get_logger\n'), ((2064, 2094), 'numpy.array', 'np.array', (['total_pos_featureset'], {...
# Copyright (c) 2017, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only # under the conditions described in the aforementioned license. The license # is also available online at http://www.ent...
[ "traits.api.Instance", "traits.api.on_trait_change", "numpy.unique", "functools.wraps", "numpy.stack", "numpy.zeros" ]
[((1710, 1737), 'traits.api.Instance', 'Instance', (['CellularAutomaton'], {}), '(CellularAutomaton)\n', (1718, 1737), False, 'from traits.api import Callable, HasStrictTraits, Instance, List, on_trait_change\n'), ((4046, 4079), 'traits.api.on_trait_change', 'on_trait_change', (['"""automaton:tick"""'], {}), "('automat...
import json import numpy as np learning_map = { 0 : 0, # "unlabeled" 1 : 0, # "outlier" mapped to "unlabeled" --------------------------mapped 10: 1, # "car" 11: 2, # "bicycle" 13: 5, # "bus" mapped to "other-vehicle" --------------------------mapped 15: 3, # "motorcycle" 16: 5, ...
[ "numpy.fromfile", "numpy.unique", "numpy.array", "numpy.sum", "json.load", "numpy.vectorize" ]
[((1973, 1985), 'json.load', 'json.load', (['f'], {}), '(f)\n', (1982, 1985), False, 'import json\n'), ((2214, 2233), 'numpy.array', 'np.array', (['lbl_count'], {}), '(lbl_count)\n', (2222, 2233), True, 'import numpy as np\n'), ((1507, 1550), 'numpy.fromfile', 'np.fromfile', (["('../' + file_)"], {'dtype': 'np.uint32'}...
import numpy as np from . import stereonet_math def fit_girdle(*args, **kwargs): """ Fits a plane to a scatter of points on a stereonet (a.k.a. a "girdle"). Input arguments will be interpreted as poles, lines, rakes, or "raw" longitudes and latitudes based on the ``measurement`` keyword argument. ...
[ "numpy.allclose", "numpy.hstack", "numpy.random.choice", "numpy.squeeze", "numpy.linalg.eigh", "numpy.cov" ]
[((8249, 8262), 'numpy.cov', 'np.cov', (['xyz.T'], {}), '(xyz.T)\n', (8255, 8262), True, 'import numpy as np\n'), ((8286, 8305), 'numpy.linalg.eigh', 'np.linalg.eigh', (['cov'], {}), '(cov)\n', (8300, 8305), True, 'import numpy as np\n'), ((15470, 15496), 'numpy.random.choice', 'np.random.choice', (['lon', 'num'], {}),...
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow # https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow # https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow from __future__ import print_function, division from builtins import range #...
[ "numpy.mean", "theano.shared", "numpy.sqrt", "theano.function", "matplotlib.pyplot.show", "sklearn.utils.shuffle", "theano.tensor.matrix", "matplotlib.pyplot.plot", "theano.tensor.ivector", "theano.tensor.arange", "numpy.zeros", "theano.tensor.argmax", "builtins.range", "numpy.random.randn...
[((584, 607), 'numpy.random.randn', 'np.random.randn', (['M1', 'M2'], {}), '(M1, M2)\n', (599, 607), True, 'import numpy as np\n'), ((610, 627), 'numpy.sqrt', 'np.sqrt', (['(2.0 / M1)'], {}), '(2.0 / M1)\n', (617, 627), True, 'import numpy as np\n'), ((797, 809), 'numpy.zeros', 'np.zeros', (['M2'], {}), '(M2)\n', (805,...
from objects.CSCG._2d.mesh.domain.regions.region.interpolations.allocator import InterpolationSearcher from objects.CSCG._2d.mesh.domain.regions.region.edge_geometries.allocator import EdgeGeometryDispatcher from objects.CSCG._2d.mesh.domain.regions.region.types_wrt_metric.allocator import TypeWr2MetricGiver from ob...
[ "screws.decorators.accepts.accepts", "objects.CSCG._2d.mesh.domain.regions.region.edges.main.Edges", "objects.CSCG._2d.mesh.domain.regions.region.types_wrt_metric.allocator.TypeWr2MetricGiver", "objects.CSCG._2d.mesh.domain.regions.region.edge_geometries.allocator.EdgeGeometryDispatcher", "numpy.array", "...
[((716, 741), 'screws.decorators.accepts.accepts', 'accepts', (['"""self"""', 'int', 'str'], {}), "('self', int, str)\n", (723, 741), False, 'from screws.decorators.accepts import accepts\n'), ((3200, 3221), 'screws.decorators.accepts.accepts', 'accepts', (['"""self"""', 'dict'], {}), "('self', dict)\n", (3207, 3221), ...
# Copyright 2015-2016 <NAME> and The University of British Columbia # 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.sqrt", "numpy.ones", "pandas.read_csv", "datetime.datetime.strptime", "carbonate.calc_carbonate", "xarray.DataArray", "pandas.DataFrame", "datetime.timedelta", "pandas.concat" ]
[((1462, 1559), 'pandas.read_csv', 'pd.read_csv', (['filename'], {'delim_whitespace': '(True)', 'header': '(0)', 'names': 'field_names', 'skiprows': '(index + 1)'}), '(filename, delim_whitespace=True, header=0, names=field_names,\n skiprows=index + 1)\n', (1473, 1559), True, 'import pandas as pd\n'), ((3029, 3149), ...
import sys try: #TODO this is a hack, at minimum should be done s.t. it'll work for aaaany ros distribution sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages') sys.path.append('/opt/ros/kinetic/lib/python2.7/dist-packages') except Exception as e: print(e) print("no ros kinetic found in p...
[ "numpy.abs", "numpy.ones", "rospy.is_shutdown", "cv2.findHomography", "sys.path.remove", "numpy.array", "numpy.linalg.inv", "numpy.linspace", "numpy.zeros", "rospy.sleep", "numpy.load", "sys.path.append", "numpy.save" ]
[((116, 179), 'sys.path.remove', 'sys.path.remove', (['"""/opt/ros/kinetic/lib/python2.7/dist-packages"""'], {}), "('/opt/ros/kinetic/lib/python2.7/dist-packages')\n", (131, 179), False, 'import sys\n'), ((184, 247), 'sys.path.append', 'sys.path.append', (['"""/opt/ros/kinetic/lib/python2.7/dist-packages"""'], {}), "('...
""" Copyright (c) 2018 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
[ "mo.utils.unittest.graph.build_graph_with_attrs", "numpy.array", "mo.graph.graph.Node", "numpy.array_equal", "extensions.middle.lstm_sequence_normalize.LSTMSequenceNormalize" ]
[((921, 944), 'extensions.middle.lstm_sequence_normalize.LSTMSequenceNormalize', 'LSTMSequenceNormalize', ([], {}), '()\n', (942, 944), False, 'from extensions.middle.lstm_sequence_normalize import LSTMSequenceNormalize\n'), ((1005, 1047), 'numpy.array', 'np.array', (['[10, 1, 20, 128]'], {'dtype': 'np.int64'}), '([10,...
#!/usr/bin/env python import numpy as np def ltr_parts(parts_dict): # when we flip image left parts became right parts and vice versa. This is the list of parts to exchange each other. leftParts = [ parts_dict[p] for p in ["Lsho", "Lelb", "Lwri", "Lhip", "Lkne", "Lank", "Leye", "Lear"] ] rightParts = [ p...
[ "numpy.zeros", "numpy.minimum" ]
[((2382, 2456), 'numpy.zeros', 'np.zeros', (['(joints.shape[0], RmpeGlobalConfig.num_parts, 3)'], {'dtype': 'np.float'}), '((joints.shape[0], RmpeGlobalConfig.num_parts, 3), dtype=np.float)\n', (2390, 2456), True, 'import numpy as np\n'), ((3453, 3548), 'numpy.minimum', 'np.minimum', (['joints[both_shoulders_known, Rsh...
import numpy as np import random from scipy.misc import imresize from PIL import Image import math # from torchvision import transforms import torch class MultiRescale(object): """MultiScale the input image in a sample by given scales. Args: scales_list (tuple or int): Desired output scale list. ...
[ "random.choice", "numpy.where", "numpy.asarray", "numpy.array", "numpy.zeros", "scipy.misc.imresize", "numpy.zeros_like" ]
[((3411, 3456), 'numpy.zeros', 'np.zeros', (['[num_pixel, col_]'], {'dtype': 'np.float32'}), '([num_pixel, col_], dtype=np.float32)\n', (3419, 3456), True, 'import numpy as np\n'), ((3471, 3516), 'numpy.zeros', 'np.zeros', (['[row_, num_pixel]'], {'dtype': 'np.float32'}), '([row_, num_pixel], dtype=np.float32)\n', (347...
import torch from tqdm import tqdm import os import numpy as np train_features=torch.load('train_features.pt') n = len(list(np.load('/facebook/data/images/train_imlist.npy'))) print(n) os.makedirs('/siim/sim_pt_256', exist_ok=True) for i in tqdm(range(n)): a=torch.mm(train_features[i:i+1],train_features.t()) to...
[ "os.makedirs", "torch.load", "os.path.join", "numpy.array", "torch.argsort", "numpy.load" ]
[((79, 110), 'torch.load', 'torch.load', (['"""train_features.pt"""'], {}), "('train_features.pt')\n", (89, 110), False, 'import torch\n'), ((185, 231), 'os.makedirs', 'os.makedirs', (['"""/siim/sim_pt_256"""'], {'exist_ok': '(True)'}), "('/siim/sim_pt_256', exist_ok=True)\n", (196, 231), False, 'import os\n'), ((641, ...
"""Functions for plotting data files.""" from __future__ import print_function import numpy as np import matplotlib.pyplot as plt def rivet_paths(file_name): """Return all :py:mod:`rivet` paths found at file_name.""" from . import yodaplot return yodaplot.data_object_names(file_name) def gridplot(file...
[ "numpy.ravel", "matplotlib.pyplot.sca", "matplotlib.pyplot.subplots" ]
[((698, 712), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (710, 712), True, 'import matplotlib.pyplot as plt\n'), ((821, 862), 'matplotlib.pyplot.subplots', 'plt.subplots', (['nrows', 'ncols'], {'squeeze': '(False)'}), '(nrows, ncols, squeeze=False)\n', (833, 862), True, 'import matplotlib.pyplot as...
from enum import Enum import numpy as np import scipy.stats as scistats import matplotlib.pyplot as plt from tqdm import tqdm class Noise(Enum): NORMAL = 1 CAUCHY = 2 def generate( n_steps=101, plate_width=10, plate_height=10, dx=0.1, dy=0.1, thermal_diffusivity=4, temperature_co...
[ "numpy.clip", "numpy.random.normal", "numpy.ones", "numpy.array", "numpy.zeros", "numpy.empty", "scipy.stats.cauchy.rvs" ]
[((2971, 2988), 'numpy.array', 'np.array', (['latents'], {}), '(latents)\n', (2979, 2988), True, 'import numpy as np\n'), ((2999, 3012), 'numpy.array', 'np.array', (['obs'], {}), '(obs)\n', (3007, 3012), True, 'import numpy as np\n'), ((4373, 4391), 'numpy.empty', 'np.empty', (['(nx, ny)'], {}), '((nx, ny))\n', (4381, ...
import unittest import numpy as np from iScore.graphrank.graph import iscore_graph from iScore.graphrank.kernel import Kernel class TestKernel(unittest.TestCase): """Test the kernels.""" def test_kernel(self): # init and load the data ker = Kernel( testIDs="./kernel/testID.lst"...
[ "unittest.main", "numpy.all", "iScore.graphrank.kernel.Kernel", "iScore.graphrank.graph.iscore_graph" ]
[((1030, 1045), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1043, 1045), False, 'import unittest\n'), ((271, 406), 'iScore.graphrank.kernel.Kernel', 'Kernel', ([], {'testIDs': '"""./kernel/testID.lst"""', 'trainIDs': '"""./kernel/trainID.lst"""', 'test_graph': '"""./kernel/graph/"""', 'train_graph': '"""./kern...
from flask import Flask, render_template, request import jsonify import requests import pickle import numpy as np import sklearn from sklearn.preprocessing import StandardScaler app = Flask(__name__) model = pickle.load(open('random_forest_regression_model_car_prices.pkl','rb')) @app.route('/',methods=['GE...
[ "sklearn.preprocessing.StandardScaler", "flask.render_template", "numpy.log", "flask.Flask" ]
[((191, 206), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (196, 206), False, 'from flask import Flask, render_template, request\n'), ((399, 415), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (413, 415), False, 'from sklearn.preprocessing import StandardScaler\n'), ((352, 3...
import os import pickle import matplotlib.pyplot as plt from matplotlib.patches import Ellipse import numpy as np import colorsys plt.rc('text', usetex=True) plt.rc('font', family='serif') number2name_ml10 = { 0: 'reach-v1', 1: 'push-v1', 2: 'pick-place-v1', 3: 'door-open-v1', 4: 'drawer-close-v1'...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.legend", "numpy.argmax", "numpy.max", "numpy.array", "matplotlib.pyplot.rc", "numpy.expand_dims", "matplotlib.pyplot.tight_layout", "matplotlib.patches.Ellipse", "matplotlib.pyplot.subplots", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.s...
[((131, 158), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (137, 158), True, 'import matplotlib.pyplot as plt\n'), ((159, 189), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'family': '"""serif"""'}), "('font', family='serif')\n", (165, 189), True, 'import m...
__all__ = ["BoundaryConditions", "BoundaryConditionsConf"] from collections import namedtuple import numpy as np from ef.config.section import register, ConfigSection from ef.config.component import ConfigComponent class BoundaryConditions(ConfigComponent): def __init__(self, potential=0): self.potenti...
[ "numpy.array", "collections.namedtuple" ]
[((765, 939), 'collections.namedtuple', 'namedtuple', (['"""BoundaryConditionsTuple"""', "('boundary_phi_right', 'boundary_phi_left', 'boundary_phi_bottom',\n 'boundary_phi_top', 'boundary_phi_near', 'boundary_phi_far')"], {}), "('BoundaryConditionsTuple', ('boundary_phi_right',\n 'boundary_phi_left', 'boundary_p...
import glob import json import os.path import math from functools import reduce from typing import Union from collections.abc import Iterable from datetime import datetime import numpy as np import scipy.interpolate from matplotlib import transforms, rcParams import matplotlib.pyplot as plt from matplotlib.patches imp...
[ "numpy.prod", "numpy.ptp", "icecream.ic", "numpy.sqrt", "matplotlib.pyplot.ylabel", "math.acos", "math.floor", "math.sqrt", "seaborn.set_style", "numpy.array", "numpy.sin", "numpy.cov", "matplotlib.pyplot.arrow", "pint.UnitRegistry", "numpy.mean", "numpy.repeat", "seaborn.color_palet...
[((578, 603), 'seaborn.set_style', 'sns.set_style', (['"""darkgrid"""'], {}), "('darkgrid')\n", (591, 603), True, 'import seaborn as sns\n'), ((632, 651), 'pint.UnitRegistry', 'pint.UnitRegistry', ([], {}), '()\n', (649, 651), False, 'import pint\n'), ((802, 814), 'json.load', 'json.load', (['f'], {}), '(f)\n', (811, 8...
import numpy as np from PIL import Image import json import open3d as o3d import cv2 def ply_vtx(path): f = open(path) assert f.readline().strip() == "ply" f.readline() f.readline() N = int(f.readline().split()[-1]) while f.readline().strip() != "end_header": continue pts = [] f...
[ "numpy.identity", "numpy.mean", "numpy.sqrt", "numpy.finfo", "PIL.Image._show", "numpy.linalg.det", "numpy.append", "numpy.array", "numpy.zeros", "numpy.dot", "open3d.io.read_triangle_mesh", "open3d.utility.Vector3dVector", "open3d.geometry.PointCloud", "open3d.io.write_point_cloud", "js...
[((1285, 1329), 'numpy.array', 'np.array', (['[[0, 0, 1], [1, 0, 0], [0, -1, 0]]'], {}), '([[0, 0, 1], [1, 0, 0], [0, -1, 0]])\n', (1293, 1329), True, 'import numpy as np\n'), ((1536, 1559), 'json.load', 'json.load', (['fixed_config'], {}), '(fixed_config)\n', (1545, 1559), False, 'import json\n'), ((1578, 1646), 'nump...