code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
# -*- coding: utf-8 -*- """ Created on Mon May 27 22:05:19 2019 @author: <NAME> """ import pandas as pd from keras.layers import Input, TimeDistributed, Bidirectional, Conv2D, BatchNormalization, MaxPooling2D, Flatten, LSTM, Dense, Lambda, GRU, Activation, Dropout from keras import applications from keras...
[ "cv2.imread", "keras.layers.Flatten", "pandas.read_csv", "cv2.resize", "numpy.argmax", "keras.models.Model", "keras.layers.Activation", "keras.layers.Dense", "numpy.shape", "keras.layers.Dropout", "keras.applications.VGG16" ]
[((579, 673), 'keras.applications.VGG16', 'applications.VGG16', ([], {'weights': '"""imagenet"""', 'include_top': '(False)', 'input_shape': '(width, height, 3)'}), "(weights='imagenet', include_top=False, input_shape=(\n width, height, 3))\n", (597, 673), False, 'from keras import applications\n'), ((1054, 1093), 'k...
import unittest from numpy import max, abs, ones, zeros, copy, sum, sqrt, hstack from cantera import Solution, one_atm, gas_constant import numpy as np from spitfire import ChemicalMechanismSpec from os.path import join, abspath from subprocess import getoutput test_mech_directory = abspath(join('tests', 'test_mechani...
[ "numpy.copy", "subprocess.getoutput", "numpy.abs", "numpy.ones", "numpy.hstack", "spitfire.ChemicalMechanismSpec", "os.path.join", "numpy.sum", "numpy.zeros", "numpy.empty", "numpy.ndarray", "numpy.finfo", "unittest.main", "cantera.Solution" ]
[((293, 337), 'os.path.join', 'join', (['"""tests"""', '"""test_mechanisms"""', '"""old_xmls"""'], {}), "('tests', 'test_mechanisms', 'old_xmls')\n", (297, 337), False, 'from os.path import join, abspath\n'), ((546, 586), 'os.path.join', 'join', (['test_mech_directory', "(mech + '.xml')"], {}), "(test_mech_directory, m...
''' Plots accuracy orig vs. accuracy projected ''' import argparse import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import seaborn as sns import numpy as np sns.set() def parse_args(): parser = argparse.ArgumentParser() parser.add_argument( '--results', default='results....
[ "numpy.mean", "seaborn.set", "matplotlib.pyplot.savefig", "argparse.ArgumentParser", "matplotlib.pyplot.ylabel", "matplotlib.use", "matplotlib.pyplot.plot", "numpy.min", "numpy.max", "numpy.array", "numpy.sum", "matplotlib.pyplot.scatter", "matplotlib.pyplot.tight_layout", "matplotlib.pypl...
[((85, 106), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (99, 106), False, 'import matplotlib\n'), ((180, 189), 'seaborn.set', 'sns.set', ([], {}), '()\n', (187, 189), True, 'import seaborn as sns\n'), ((223, 248), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (246, 2...
"""A collection of Terrestrial Reference Frame sites Description: ------------ """ # Standard library imports import collections import abc # External library imports import numpy as np # Where imports from where.lib import config from where.lib import exceptions from where.lib import log from where.apriori import...
[ "numpy.mean", "where.apriori.trf.get_trf_factory", "where.lib.log.debug", "where.lib.exceptions.UnknownSiteError", "numpy.linalg.norm", "where.lib.config.tech.get" ]
[((5207, 5242), 'where.lib.log.debug', 'log.debug', (['f"""Found site {trf_site}"""'], {}), "(f'Found site {trf_site}')\n", (5216, 5242), False, 'from where.lib import log\n'), ((1023, 1076), 'where.lib.config.tech.get', 'config.tech.get', (['"""reference_frames"""', 'reference_frames'], {}), "('reference_frames', refe...
import numpy as np import pandas as pd # ----------------------------------- # Regression # ----------------------------------- # rmse from sklearn.metrics import mean_squared_error # y_true are the true values、y_pred are the predictions y_true = [1.0, 1.5, 2.0, 1.2, 1.8] y_pred = [0.8, 1.5, 1.8, 1.3, 3.0] rmse = n...
[ "sklearn.metrics.f1_score", "numpy.unique", "sklearn.metrics.cohen_kappa_score", "sklearn.metrics.mean_squared_error", "numpy.array", "sklearn.metrics.log_loss", "sklearn.metrics.accuracy_score", "sklearn.metrics.confusion_matrix" ]
[((959, 989), 'numpy.array', 'np.array', (['[[tp, fp], [fn, tn]]'], {}), '([[tp, fp], [fn, tn]])\n', (967, 989), True, 'import numpy as np\n'), ((1276, 1308), 'sklearn.metrics.confusion_matrix', 'confusion_matrix', (['y_true', 'y_pred'], {}), '(y_true, y_pred)\n', (1292, 1308), False, 'from sklearn.metrics import confu...
# Calibration methods including Histogram Binning and Temperature Scaling import time import keras import keras.backend as K import numpy as np import pandas as pd import sklearn.metrics as metrics from keras.callbacks import EarlyStopping from keras.layers import Activation from keras.layers import Dense from keras....
[ "numpy.clip", "pandas.read_csv", "keras.initializers.Identity", "numpy.log", "keras.backend.cast_to_floatx", "keras.utils.to_categorical", "numpy.array", "keras.backend.np.multiply", "sklearn.metrics.log_loss", "keras.layers.Activation", "keras.layers.Dense", "numpy.arange", "calibration.eva...
[((25557, 25575), 'numpy.clip', 'np.clip', (['x', 'eps', '(1)'], {}), '(x, eps, 1)\n', (25564, 25575), True, 'import numpy as np\n'), ((25587, 25596), 'numpy.log', 'np.log', (['x'], {}), '(x)\n', (25593, 25596), True, 'import numpy as np\n'), ((27464, 27493), 'numpy.argmax', 'np.argmax', (['y_probs'], {'axis': 'axis'})...
# pythonpath modification to make hytra available # for import without requiring it to be installed import os import sys sys.path.insert(0, os.path.abspath('..')) # standard imports import logging import time import h5py import numpy as np import configargparse import hytra.core.hypothesesgraph as hypothesesgraph impo...
[ "logging.getLogger", "hytra.core.ilastikhypothesesgraph.IlastikHypothesesGraph", "hytra.pluginsystem.plugin_manager.TrackingPluginManager", "numpy.array", "pgmlink.countArcs", "hytra.core.probabilitygenerator.ArcIt", "hytra.core.fieldofview.FieldOfView", "numpy.linalg.norm", "configargparse.Argument...
[((141, 162), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (156, 162), False, 'import os\n'), ((533, 802), 'configargparse.ArgumentParser', 'configargparse.ArgumentParser', ([], {'description': '""" \n Given raw data, segmentation, and trained classifiers,\n this script creates a ...
from typing import Tuple, Union, Iterable, List, Callable, Dict, Optional import os import warnings import numpy as np from nnuncert.models._network import MakeNet from nnuncert.models._model_base import BaseModel from nnuncert.models._pred_base import BasePredKDE from nnuncert.models.dnnc._dnnc import DNNCRidgeIWLS...
[ "nnuncert.models.dnnc._dnnc.DNNCRidgeIWLS", "nnuncert.utils.dist.Dist._from_fx", "nnuncert.models.dnnc._eval.DNNCDensity", "os.path.join", "nnuncert.models.dnnc._dnnc.DNNCHorseshoeIWLS", "numpy.exp", "numpy.array", "warnings.warn", "nnuncert.models.dnnc._eval.DNNCEvaluate", "numpy.nan_to_num" ]
[((5365, 5422), 'warnings.warn', 'warnings.warn', (['"""DNNC horseshoe may not function properly"""'], {}), "('DNNC horseshoe may not function properly')\n", (5378, 5422), False, 'import warnings\n'), ((6881, 6903), 'numpy.array', 'np.array', (['self.eval.Ey'], {}), '(self.eval.Ey)\n', (6889, 6903), True, 'import numpy...
"""Utils for Pfam family classification experiments.""" import os import jax import jax.numpy as jnp import numpy as np import tensorflow as tf import pandas as pd import matplotlib.pyplot as plt import scipy.stats import sklearn.metrics as metrics from sklearn.neighbors import KNeighborsClassifier as knn from...
[ "pandas.read_csv", "contextual_lenses.loss_fns.cross_entropy_loss", "sklearn.neighbors.KNeighborsClassifier", "os.path.join", "pkg_resources.resource_filename", "numpy.array", "contextual_lenses.train_utils.create_data_iterator", "google_research.protein_lm.domains.ProteinVocab", "jax.numpy.argmax",...
[((816, 834), 'fs_gcsfs.GCSFS', 'GCSFS', (['bucket_name'], {}), '(bucket_name)\n', (821, 834), False, 'from fs_gcsfs import GCSFS\n'), ((1050, 1067), 'pandas.concat', 'pd.concat', (['shards'], {}), '(shards)\n', (1059, 1067), True, 'import pandas as pd\n'), ((4873, 5115), 'contextual_lenses.train_utils.create_data_iter...
import matplotlib.pyplot as plt import cv2 import numpy as np # Number of Colors in color palette N = 14 def map2img(canvas, colors): image = np.zeros((canvas.shape[0],canvas.shape[1],3)) for i in range(0,canvas.shape[0]): for j in range(0,canvas.shape[1]): image[i,j,:] = colors[int(canvas[i,j]),:] ...
[ "matplotlib.pyplot.close", "numpy.array", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.pause", "matplotlib.pyplot.show" ]
[((1328, 1389), 'numpy.array', 'np.array', (['[[0.0, 0.0, 1.0], [1.0, 0.0, 0.0], [1.0, 0.0, 0.0]]'], {}), '([[0.0, 0.0, 1.0], [1.0, 0.0, 0.0], [1.0, 0.0, 0.0]])\n', (1336, 1389), True, 'import numpy as np\n'), ((147, 194), 'numpy.zeros', 'np.zeros', (['(canvas.shape[0], canvas.shape[1], 3)'], {}), '((canvas.shape[0], c...
#!/usr/bin/env python3 import os from pathlib import Path import gpytorch import matplotlib.pyplot as plt import numpy as np import torch from gpytorch.kernels import RBFKernel, ScaleKernel from gpytorch.means import LinearMean from sklearn.model_selection import train_test_split from torchmetrics import MeanSquaredEr...
[ "GPErks.train.early_stop.SimpleEarlyStoppingCriterion", "gpytorch.means.LinearMean", "gpytorch.kernels.RBFKernel", "GPErks.gp.data.dataset.Dataset", "GPErks.serialization.path.posix_path", "torch.cuda.is_available", "numpy.arange", "GPErks.log.logger.get_logger", "pathlib.Path", "GPErks.serializat...
[((1153, 1165), 'GPErks.log.logger.get_logger', 'get_logger', ([], {}), '()\n', (1163, 1165), False, 'from GPErks.log.logger import get_logger\n'), ((1228, 1242), 'GPErks.utils.random.set_seed', 'set_seed', (['seed'], {}), '(seed)\n', (1236, 1242), False, 'from GPErks.utils.random import set_seed\n'), ((1497, 1550), 'n...
from typing import Dict import cv2 import numpy from . import _debug from ._params import Params as _Params from ._types import DialData from ._utils import float_point_to_int _dial_data_map: Dict[int, Dict[str, DialData]] = {} def get_dial_data(params: _Params) -> Dict[str, DialData]: dial_data = _dial_data_m...
[ "cv2.imshow", "cv2.floodFill", "cv2.circle", "numpy.zeros", "cv2.waitKey" ]
[((629, 693), 'numpy.zeros', 'numpy.zeros', ([], {'shape': 'params.dials_template_size', 'dtype': 'numpy.uint8'}), '(shape=params.dials_template_size, dtype=numpy.uint8)\n', (640, 693), False, 'import numpy\n'), ((1287, 1357), 'numpy.zeros', 'numpy.zeros', (['(mask.shape[0] + 2, mask.shape[1] + 2)'], {'dtype': 'numpy.u...
import numpy as np def f(n): term = 1 logsum = 0 for k in range(1,n): term *= n/k logsum+= term return np.exp(np.log(logsum)-n) print(f(10),f(100),f(1000))
[ "numpy.log" ]
[((143, 157), 'numpy.log', 'np.log', (['logsum'], {}), '(logsum)\n', (149, 157), True, 'import numpy as np\n')]
#!/usr/bin/env python # -*- coding:utf8 -*- # ================================================================================ # Copyright 2022 Alibaba Inc. All Rights Reserved. # # History: # 2022.03.01. Be created by xingzhang.rxz. Used for language identification. # 2018.04.27. Be created by jiangshi.lxq. Forked an...
[ "tensorflow.contrib.framework.load_variable", "tensorflow.logging.set_verbosity", "time.sleep", "tensorflow.contrib.framework.list_variables", "numpy.argsort", "tensorflow.gfile.GFile", "tensorflow.GPUOptions", "tensorflow.variables_initializer", "tensorflow.app.run", "tensorflow.Graph", "os.lis...
[((828, 869), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.INFO'], {}), '(tf.logging.INFO)\n', (852, 869), True, 'import tensorflow as tf\n'), ((2632, 2665), 'tensorflow.get_collection', 'tf.get_collection', (['key_collection'], {}), '(key_collection)\n', (2649, 2665), True, 'import ten...
# -*- coding: utf-8 -*- # @Author: Bao # @Date: 2021-12-11 08:47:12 # @Last Modified by: dorihp # @Last Modified time: 2022-01-07 14:19:15 import json import time import cv2 import numpy as np from onvif import ONVIFCamera class Detector(): def __init__(self, cfg, weights, classes, input_size): ...
[ "cv2.rectangle", "onvif.ONVIFCamera", "cv2.imshow", "numpy.array", "numpy.flip", "cv2.undistort", "numpy.asarray", "cv2.contourArea", "cv2.waitKey", "cv2.getOptimalNewCameraMatrix", "cv2.circle", "cv2.cvtColor", "cv2.undistortPoints", "cv2.findContours", "cv2.inRange", "cv2.bitwise_and...
[((3469, 3494), 'numpy.load', 'np.load', (['"""parameters.npz"""'], {}), "('parameters.npz')\n", (3476, 3494), True, 'import numpy as np\n'), ((3672, 3731), 'cv2.getOptimalNewCameraMatrix', 'cv2.getOptimalNewCameraMatrix', (['mtx', 'dist', '(w, h)', '(1)', '(w, h)'], {}), '(mtx, dist, (w, h), 1, (w, h))\n', (3701, 3731...
from tkinter import * from tkinter.font import Font from ttk import * from tkinter.scrolledtext import ScrolledText from tkinter import messagebox import tensorflow as tf import numpy as np import re import seq2seq # preprocessed data import Final_data import data_utils # load data from pickle and npy files metadat...
[ "data_utils.rand_batch_gen", "seq2seq.Seq2Seq", "Final_data.load_data", "data_utils.split_dataset", "data_utils.decode", "Final_data.pad_seq", "tkinter.font.Font", "tkinter.scrolledtext.ScrolledText", "numpy.zeros", "numpy.array", "re.sub", "Final_data.filter_line", "tkinter.messagebox.showi...
[((338, 380), 'Final_data.load_data', 'Final_data.load_data', ([], {'PATH': '"""./Final_META/"""'}), "(PATH='./Final_META/')\n", (358, 380), False, 'import Final_data\n'), ((434, 472), 'data_utils.split_dataset', 'data_utils.split_dataset', (['idx_q', 'idx_a'], {}), '(idx_q, idx_a)\n', (458, 472), False, 'import data_u...
#!/usr/bin/env python """ train_SVM.py VARPA, University of Coruna <NAME>, <NAME>. 26 Oct 2017 """ from sklearn import metrics import numpy as np class performance_measures: def __init__(self, n): self.n_classes = n self.confusion_matrix = np.empty([]) self.Recall ...
[ "numpy.average", "numpy.dot", "numpy.empty", "sklearn.metrics.accuracy_score", "sklearn.metrics.confusion_matrix" ]
[((1394, 1432), 'numpy.dot', 'np.dot', (['prob_expectedA', 'prob_expectedB'], {}), '(prob_expectedA, prob_expectedB)\n', (1400, 1432), True, 'import numpy as np\n'), ((2117, 2186), 'sklearn.metrics.confusion_matrix', 'metrics.confusion_matrix', (['gt_labels', 'predictions'], {'labels': '[0, 1, 2, 3]'}), '(gt_labels, pr...
import numpy as np class ClassificationMatrix: """Provides measures of performance for prediction against targets. Members: self.classSymbol: self.classes: Unique list of objects that is found in 'targets' and prediction'. It is lexicographically ordered ...
[ "numpy.trace", "numpy.sum", "numpy.diag" ]
[((6648, 6673), 'numpy.diag', 'np.diag', (['self.conf_matrix'], {}), '(self.conf_matrix)\n', (6655, 6673), True, 'import numpy as np\n'), ((7382, 7408), 'numpy.trace', 'np.trace', (['self.conf_matrix'], {}), '(self.conf_matrix)\n', (7390, 7408), True, 'import numpy as np\n'), ((7411, 7435), 'numpy.sum', 'np.sum', (['se...
# -*- coding:utf-8 -*- # ''' landsat时间序列数据分析子窗口:主要是进行时间序列数据的分析和处理 具体:1)landsat数据时间序列曲线获取 ''' from PyQt5 import QtCore, QtWidgets from scipy.optimize import leastsq import numpy as np import data_manager as dm import argrithms as ag import scipy.io import matplotlib.pyplot as plt import matplotlib import gdal matplotli...
[ "gdal.GetDriverByName", "numpy.argsort", "numpy.array", "PyQt5.QtWidgets.QFileDialog.getOpenFileName", "data_manager.dataManagement", "matplotlib.pyplot.imshow", "PyQt5.QtWidgets.QTableWidget", "numpy.mean", "PyQt5.QtWidgets.QComboBox", "numpy.sort", "matplotlib.pyplot.plot", "numpy.max", "s...
[((311, 335), 'matplotlib.use', 'matplotlib.use', (['"""Qt5Agg"""'], {}), "('Qt5Agg')\n", (325, 335), False, 'import matplotlib\n'), ((1470, 1518), 'PyQt5.QtWidgets.QGroupBox', 'QtWidgets.QGroupBox', (['"""Feature Calculation"""', 'self'], {}), "('Feature Calculation', self)\n", (1489, 1518), False, 'from PyQt5 import ...
import numpy as np import matplotlib.pyplot as plt import torch from torch.autograd import Variable import time import math import random import ray import copy, sys from functools import partial # Quaternion utility functions. Due to python relative imports and directory structure can't cleanly use cassie.quaternion_...
[ "numpy.clip", "time.sleep", "math.cos", "numpy.array", "copy.deepcopy", "ray.init", "numpy.save", "numpy.load", "numpy.mean", "numpy.where", "sys.stdout.flush", "random.uniform", "random.choice", "ray.get", "numpy.random.choice", "torch.Tensor", "ray.wait", "time.time", "numpy.co...
[((9054, 9069), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (9067, 9069), False, 'import torch\n'), ((15957, 15972), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (15970, 15972), False, 'import torch\n'), ((375, 394), 'numpy.copy', 'np.copy', (['quaternion'], {}), '(quaternion)\n', (382, 394), True, 'impo...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "os.path.exists", "argparse.ArgumentParser", "parakeet.utils.io.add_yaml_config_to_args", "os.makedirs", "paddle.fluid.dygraph.guard", "paddle.fluid.default_startup_program", "paddle.fluid.dygraph.parallel.Env", "os.path.join", "utils.add_config_options_to_parser", "paddle.fluid.CPUPlace", "rand...
[((2076, 2123), 'os.path.join', 'os.path.join', (['"""runs"""', 'config.model', 'config.name'], {}), "('runs', config.model, config.name)\n", (2088, 2123), False, 'import os\n'), ((2145, 2180), 'os.path.join', 'os.path.join', (['run_dir', '"""checkpoint"""'], {}), "(run_dir, 'checkpoint')\n", (2157, 2180), False, 'impo...
#!/usr/bin/env python3 import torch import os import dgl import torch.utils.data import numpy as np import networkx as nx from glob import glob import dgl.function as fn from torch import nn, optim from torch.nn import functional as F from torch.utils.data import DataLoader, Dataset # changed configuration to this in...
[ "torch.exp", "dgl.mean_nodes", "os.listdir", "numpy.reshape", "torch.mean", "dgl.function.copy_src", "networkx.nx.convert.to_networkx_graph", "numpy.asarray", "networkx.MultiGraph", "dgl.DGLGraph", "torch.randn", "torch.Tensor", "torch.randn_like", "torch.device", "torch.manual_seed", ...
[((566, 586), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (578, 586), False, 'import torch\n'), ((587, 610), 'torch.manual_seed', 'torch.manual_seed', (['SEED'], {}), '(SEED)\n', (604, 610), False, 'import torch\n'), ((2233, 2262), 'dgl.function.copy_src', 'fn.copy_src', ([], {'src': '"""h"""', ...
import tempfile import gzip import shutil import warnings from itertools import chain import numpy as np from heparchy.data.event import ShowerData from heparchy.utils import structure_pmu class HepMC: """Returns an iterator over events in the given HepMC file. Event data is provided as a `heparchy.data.Sho...
[ "heparchy.data.event.ShowerData.empty", "numpy.fromiter", "shutil.copyfileobj", "gzip.open", "heparchy.utils.structure_pmu", "itertools.chain.from_iterable", "typicle.Types", "tempfile.NamedTemporaryFile" ]
[((1731, 1738), 'typicle.Types', 'Types', ([], {}), '()\n', (1736, 1738), False, 'from typicle import Types\n'), ((1813, 1831), 'heparchy.data.event.ShowerData.empty', 'ShowerData.empty', ([], {}), '()\n', (1829, 1831), False, 'from heparchy.data.event import ShowerData\n'), ((3619, 3637), 'heparchy.utils.structure_pmu...
import matplotlib.pyplot as plt import numpy as np from SMYLEutils import colormap_utils as mycolors import cartopy.crs as ccrs import cartopy.feature as cfeature from cartopy.util import add_cyclic_point from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter import matplotlib.ticker as mticker from matpl...
[ "numpy.hstack", "numpy.where", "SMYLEutils.colormap_utils.blue2red_cmap", "cartopy.crs.PlateCarree", "numpy.ma.hstack", "matplotlib.colors.BoundaryNorm", "numpy.concatenate", "SMYLEutils.colormap_utils.blue2red_acc_cmap", "numpy.meshgrid", "numpy.ma.concatenate", "cartopy.util.add_cyclic_point",...
[((1391, 1421), 'numpy.arange', 'np.arange', (['cmin', '(cmax + ci)', 'ci'], {}), '(cmin, cmax + ci, ci)\n', (1400, 1421), True, 'import numpy as np\n'), ((1799, 1831), 'cartopy.util.add_cyclic_point', 'add_cyclic_point', (['dat'], {'coord': 'lon'}), '(dat, coord=lon)\n', (1815, 1831), False, 'from cartopy.util import ...
import numpy as np import scipy.constants as const import scipy.interpolate as si import sys import voigt """ This file contains functions related to atmospheric extinction. extinction(): Function to calculate the extinction coefficients. resamp(): Function to resample an array at different values. downsamp(): Fu...
[ "voigt.V", "numpy.digitize", "numpy.log", "scipy.interpolate.interp1d", "numpy.exp", "numpy.sum", "numpy.zeros", "numpy.linspace" ]
[((2288, 2429), 'numpy.sum', 'np.sum', (['((dia / 2.0 + dias / 2.0) ** 2 * (2.0 * k * T / np.pi) ** 0.5 / c * nd *\n atm[:, 0] * (1.0 / mass + 1.0 / (atm[:, 1] * amu)) ** 0.5)'], {}), '((dia / 2.0 + dias / 2.0) ** 2 * (2.0 * k * T / np.pi) ** 0.5 / c *\n nd * atm[:, 0] * (1.0 / mass + 1.0 / (atm[:, 1] * amu)) ** ...
""" @Author : TeJas.Lotankar Description: ------------ Various filters to apply on image for applying changes - Blur filter - Edge Filter - //TODO Add More filters as per necessity """ import cv2 import numpy as np from matplotlib import pyplot as plt import os import streamlit as st from PIL import Imag...
[ "streamlit.markdown", "PIL.Image.open", "streamlit.image", "PIL.Image.fromarray", "streamlit.file_uploader", "streamlit.slider", "numpy.array", "streamlit.subheader", "streamlit.selectbox", "cv2.Canny", "streamlit.header", "cv2.blur" ]
[((818, 839), 'cv2.blur', 'cv2.blur', (['img', 'kernel'], {}), '(img, kernel)\n', (826, 839), False, 'import cv2\n'), ((2025, 2059), 'cv2.Canny', 'cv2.Canny', (['img_obj', 'minVal', 'maxVal'], {}), '(img_obj, minVal, maxVal)\n', (2034, 2059), False, 'import cv2\n'), ((2106, 2139), 'streamlit.header', 'st.header', (['""...
# -*- coding: utf-8 -*- """ """ # import standard libraries import os import subprocess from itertools import product from math import ceil # import third-party libraries import numpy as np import cv2 from colour import RGB_to_RGB, RGB_COLOURSPACES, RGB_to_XYZ, XYZ_to_xyY # import my libraries import test_pattern_g...
[ "cv2.rectangle", "numpy.clip", "jzazbz.jzczhz_to_jzazbz", "numpy.hstack", "colour.XYZ_to_xyY", "font_control.TextDrawer", "font_control.get_text_width_height", "transfer_functions.eotf_to_luminance", "numpy.array", "color_space.jzazbz_to_rgb", "numpy.sin", "plot_utility.plot_1_graph", "numpy...
[((1615, 1645), 'numpy.hstack', 'np.hstack', (['[idx_even, idx_odd]'], {}), '([idx_even, idx_odd])\n', (1624, 1645), True, 'import numpy as np\n'), ((1831, 1875), 'test_pattern_generator2.img_wirte_float_as_16bit_int', 'tpg.img_wirte_float_as_16bit_int', (['fname', 'img'], {}), '(fname, img)\n', (1863, 1875), True, 'im...
from typing import Union, Any, List, Tuple, Optional, Dict import xarray as xr from tqdm import tqdm from pathlib import Path import numpy as np from rrmpg.models import GR4J import pandas as pd def get_data_dir() -> Path: if Path(".").absolute().home().as_posix() == "/home/leest": data_dir = Path("/Dat...
[ "pathlib.Path", "rrmpg.models.GR4J", "tqdm.tqdm", "xarray.Dataset", "numpy.empty" ]
[((2413, 2434), 'numpy.empty', 'np.empty', (['ds[v].shape'], {}), '(ds[v].shape)\n', (2421, 2434), True, 'import numpy as np\n'), ((2454, 2475), 'numpy.empty', 'np.empty', (['ds[v].shape'], {}), '(ds[v].shape)\n', (2462, 2475), True, 'import numpy as np\n'), ((2495, 2516), 'numpy.empty', 'np.empty', (['ds[v].shape'], {...
# -*- coding: utf-8 -*- """ Created on Fri Jul 19 13:46:40 2019 @author: KemenczkyP """ from __future__ import absolute_import, division, print_function, unicode_literals # TensorFlow and tf.keras import tensorflow as tf from tensorflow import keras # Helper libraries import numpy as np import matplotlib.pyplot as ...
[ "matplotlib.pyplot.imshow", "numpy.uint8", "numpy.reshape", "tensorflow.nn.relu", "kerasmodel.MyModel", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.keras.layers.AveragePooling2D", "tensorflow.GradientTape", "cv2.addWeighted", "numpy.random.randint", "cv2.cvtColor", "he...
[((458, 491), 'tensorflow.RegisterGradient', 'tf.RegisterGradient', (['"""GuidedRelu"""'], {}), "('GuidedRelu')\n", (477, 491), True, 'import tensorflow as tf\n'), ((2963, 2993), 'heatmap.HeatMap', 'HeatMap', (['grad_c', 'guide'], {'dims': '(2)'}), '(grad_c, guide, dims=2)\n', (2970, 2993), False, 'from heatmap import ...
from factualaudio.data import noise from factualaudio.decibel import to_decibels import numpy as np def waveform(axes, wave, sample_rate, *args, **kwargs): return axes.plot(np.arange(0, wave.size) * (1000 / sample_rate), wave, *args, **kwargs) # Equivalent to axes.amplitude_spectrum(), but plots on an RMS amplitu...
[ "numpy.sqrt", "numpy.ones", "factualaudio.data.noise", "numpy.linspace", "numpy.arange" ]
[((840, 871), 'numpy.linspace', 'np.linspace', (['(0)', '(20000)'], {'num': '(1000)'}), '(0, 20000, num=1000)\n', (851, 871), True, 'import numpy as np\n'), ((1060, 1091), 'numpy.linspace', 'np.linspace', (['(0)', '(20000)'], {'num': '(1000)'}), '(0, 20000, num=1000)\n', (1071, 1091), True, 'import numpy as np\n'), ((5...
import example_cy import numpy as np import mbx_fortran import optimized_cy import time size = 9 height = 1 center_x = 4 center_y = 4 width_x = 2 width_y = 2 data = np.zeros((size, size), dtype=np.uint16) num_loop = 10000 loops = list(range(0, num_loop)) start = time.time() for loop in loops: res_c = example_...
[ "numpy.reshape", "example_cy.gaussian", "optimized_cy.gaussian", "mbx_fortran.gaussian", "numpy.zeros", "time.time" ]
[((167, 206), 'numpy.zeros', 'np.zeros', (['(size, size)'], {'dtype': 'np.uint16'}), '((size, size), dtype=np.uint16)\n', (175, 206), True, 'import numpy as np\n'), ((268, 279), 'time.time', 'time.time', ([], {}), '()\n', (277, 279), False, 'import time\n'), ((400, 431), 'numpy.reshape', 'np.reshape', (['res_c', '(size...
import csv import os import numpy as np from foods3 import util from gurobipy import * county_size = 3109 def optimize_gurobi(supply_code, supply_corn, demand_code, demand_corn, dist_mat): env = Env("gurobi_spatial_lca.log") model = Model("lp_for_spatiallca") var = [] # add constraint for corn prod...
[ "os.path.exists", "foods3.util.get_project_root", "numpy.zeros", "os.mkdir", "csv.reader" ]
[((463, 500), 'numpy.zeros', 'np.zeros', (['(no_of_supply * no_of_demand)'], {}), '(no_of_supply * no_of_demand)\n', (471, 500), True, 'import numpy as np\n'), ((3460, 3496), 'numpy.zeros', 'np.zeros', (['(county_size, county_size)'], {}), '((county_size, county_size))\n', (3468, 3496), True, 'import numpy as np\n'), (...
from numpy import array from pandas import DataFrame, Series from unittest.case import TestCase from probability.distributions import Beta from tests.test_questions.question_factories import make_likert_question class TestLikertQuestion(TestCase): def setUp(self) -> None: self.question = make_likert_qu...
[ "pandas.Series", "probability.distributions.Beta", "tests.test_questions.question_factories.make_likert_question", "numpy.array", "pandas.DataFrame" ]
[((306, 328), 'tests.test_questions.question_factories.make_likert_question', 'make_likert_question', ([], {}), '()\n', (326, 328), False, 'from tests.test_questions.question_factories import make_likert_question\n'), ((1387, 1576), 'pandas.DataFrame', 'DataFrame', ([], {'data': "[('1 - strongly disagree', 2), ('2 - di...
## File for training and evaluation of model import os import time from tqdm import tqdm import torch import math import numpy as np from torch.utils.data import DataLoader from torch.nn import DataParallel from nets.attention_model import set_decode_type from utils.log_utils import log_values from utils import move_...
[ "torch.cuda.get_rng_state_all", "torch.as_tensor", "torch.nn.utils.clip_grad_norm_", "tqdm.tqdm", "torch.exp", "torch.reshape", "torch.min", "utils.log_utils.log_values", "nets.attention_model.set_decode_type", "torch.no_grad", "time.gmtime", "utils.move_to", "torch.get_rng_state", "torch....
[((917, 949), 'nets.attention_model.set_decode_type', 'set_decode_type', (['model', '"""greedy"""'], {}), "(model, 'greedy')\n", (932, 949), False, 'from nets.attention_model import set_decode_type\n'), ((3530, 3541), 'time.time', 'time.time', ([], {}), '()\n', (3539, 3541), False, 'import time\n'), ((3998, 4069), 'tor...
""" utils.py Author: <NAME> This script provides coordinate transformations from Geodetic -> ECEF, ECEF -> ENU and Geodetic -> ENU (the composition of the two previous functions). Running the script by itself runs tests. based on https://gist.github.com/govert/1b373696c9a27ff4c72a. It also provides some other useful f...
[ "numpy.random.normal", "sklearn.utils.shuffle", "numpy.log", "math.sqrt", "math.radians", "math.cos", "numpy.max", "numpy.diag", "numpy.dot", "math.sin" ]
[((463, 476), 'sklearn.utils.shuffle', 'shuffle', (['data'], {}), '(data)\n', (470, 476), False, 'from sklearn.utils import shuffle\n'), ((741, 758), 'math.radians', 'math.radians', (['lat'], {}), '(lat)\n', (753, 758), False, 'import math\n'), ((769, 786), 'math.radians', 'math.radians', (['lon'], {}), '(lon)\n', (781...
# -*- coding: utf-8 -*- """ The grid class for swarm framework. Grid: base grid, a simple dictionary. """ import math import numpy as np import re class Grid: """Grid class. Class that defines grid strucutre having attribute Width, height and grid size. """ # pylint: disable=too-many-instance-...
[ "math.ceil", "numpy.arange", "math.floor" ]
[((3956, 3992), 'math.ceil', 'math.ceil', (['(center_grid / width_scale)'], {}), '(center_grid / width_scale)\n', (3965, 3992), False, 'import math\n'), ((1730, 1788), 'numpy.arange', 'np.arange', (['(-self.width / 2)', '(self.width / 2)', 'self.grid_size'], {}), '(-self.width / 2, self.width / 2, self.grid_size)\n', (...
""" Correlation module calculating connectivity values from data """ import logging import numpy as np import os from itertools import islice from pylsl import local_clock from scipy.signal import hilbert from scipy.signal import lfilter from scipy.stats import zscore from astropy.stats import circmean from itertools i...
[ "logging.getLogger", "osc4py3.oscbuildparse.OSCMessage", "osc4py3.oscchannel.terminate_all_channels", "numpy.array", "numpy.nanmean", "numpy.sin", "numpy.imag", "numpy.arange", "numpy.mean", "numpy.multiply", "numpy.real", "numpy.abs", "numpy.diagonal", "os.path.dirname", "numpy.nansum",...
[((459, 492), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (482, 492), False, 'import warnings\n'), ((503, 528), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (518, 528), False, 'import os\n'), ((549, 562), 'pylsl.local_clock', 'local_clock', ...
# 综合分类数据集 from numpy import where from sklearn.datasets import make_classification import matplotlib.pyplot as plt # 定义数据集 X, y = make_classification(n_samples=1000, n_features=2, n_informative=2, n_redundant=0, n_clusters_per_class=1, random_state=4) # 为每个类的样本创建散点图 plt.figure() plt.scatter(X[:,0],X[:,1]) plt.figure() ...
[ "numpy.where", "matplotlib.pyplot.figure", "sklearn.datasets.make_classification", "matplotlib.pyplot.scatter", "matplotlib.pyplot.show" ]
[((130, 255), 'sklearn.datasets.make_classification', 'make_classification', ([], {'n_samples': '(1000)', 'n_features': '(2)', 'n_informative': '(2)', 'n_redundant': '(0)', 'n_clusters_per_class': '(1)', 'random_state': '(4)'}), '(n_samples=1000, n_features=2, n_informative=2,\n n_redundant=0, n_clusters_per_class=1...
import numpy as np def remove_outliers(X:np.ndarray,Y:np.ndarray): assert len(X.shape) == len(Y.shape) == 1 assert X.size == Y.size EPSILON_X = 0.02 EPSILON_Y = 0.04 groups : dict= {0:{0}} block = [(0,X[0],Y[0],0)] for i,(x,y) in enumerate(zip(X[1:],Y[1:]),1): while block an...
[ "numpy.array" ]
[((1865, 1882), 'numpy.array', 'np.array', (['inliers'], {}), '(inliers)\n', (1873, 1882), True, 'import numpy as np\n')]
import typing import sys import numpy as np import numba as nb @nb.njit((nb.b1[:], ), cache=True) def solve(c: np.ndarray) -> typing.NoReturn: n = len(c) a, b = np.sum(c == 1), 0 res = max(a, b) for i in range(n): if c[i] == 1: a -= 1 else: b += 1 res = min(res, max(a, b)) print(...
[ "sys.stdin.buffer.readline", "numpy.sum", "numba.njit" ]
[((69, 101), 'numba.njit', 'nb.njit', (['(nb.b1[:],)'], {'cache': '(True)'}), '((nb.b1[:],), cache=True)\n', (76, 101), True, 'import numba as nb\n'), ((171, 185), 'numpy.sum', 'np.sum', (['(c == 1)'], {}), '(c == 1)\n', (177, 185), True, 'import numpy as np\n'), ((368, 395), 'sys.stdin.buffer.readline', 'sys.stdin.buf...
import numpy as np class Uniform(object): """ Make only a fraction of weights nonzero. """ def __init__(self, scale=.2): self.scale = scale def __str__(self): return f"Uniform distribution on [{-self.scale}, {self.scale}]" def initialize(self, n_rows, n_cols): return ...
[ "numpy.random.uniform" ]
[((320, 394), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(-self.scale)', 'high': 'self.scale', 'size': '(n_rows, n_cols)'}), '(low=-self.scale, high=self.scale, size=(n_rows, n_cols))\n', (337, 394), True, 'import numpy as np\n')]
import numpy as np from rvs import Dolly from math_utils import * from plot_utils import * def Pr_Xnk_leq_x(X, n, k, x): # log(INFO, "x= {}".format(x) ) cdf = 0 for i in range(k, n+1): cdf += binom_(n, i) * X.cdf(x)**i * X.tail(x)**(n-i) return cdf def EXnk(X, n, k, m=1): if k == 0: return 0 i...
[ "numpy.linspace", "rvs.Dolly" ]
[((981, 1004), 'numpy.linspace', 'np.linspace', (['(0)', '(30)', '(100)'], {}), '(0, 30, 100)\n', (992, 1004), True, 'import numpy as np\n'), ((5374, 5381), 'rvs.Dolly', 'Dolly', ([], {}), '()\n', (5379, 5381), False, 'from rvs import Dolly\n'), ((5662, 5669), 'rvs.Dolly', 'Dolly', ([], {}), '()\n', (5667, 5669), False...
# ############################################## # # # Ferdinand 0.40, <NAME>, LLNL # # # # gnd,endf,fresco,azure,hyrma # # # #########################################...
[ "scipy.linalg.eigh", "numpy.matlib.zeros" ]
[((1235, 1254), 'numpy.matlib.zeros', 'zeros', (['[NLEV, NLEV]'], {}), '([NLEV, NLEV])\n', (1240, 1254), False, 'from numpy.matlib import zeros\n'), ((2427, 2445), 'numpy.matlib.zeros', 'zeros', (['[NLEV, NCH]'], {}), '([NLEV, NCH])\n', (2432, 2445), False, 'from numpy.matlib import zeros\n'), ((1917, 1939), 'scipy.lin...
import numpy as np ### from https://github.com/rflamary/POT/blob/master/ot/bregman.py ### def sinkhorn_knopp(a, b, M, reg, numItermax=1000, stopThr=1e-9, verbose=False, log=False, **kwargs): r""" Solve the entropic regularization optimal transport problem and return the OT matrix The fun...
[ "numpy.ones", "numpy.asarray", "numpy.any", "numpy.exp", "numpy.dot", "numpy.empty", "numpy.einsum", "numpy.isnan", "numpy.linalg.norm", "numpy.isinf", "numpy.divide" ]
[((2313, 2344), 'numpy.asarray', 'np.asarray', (['a'], {'dtype': 'np.float64'}), '(a, dtype=np.float64)\n', (2323, 2344), True, 'import numpy as np\n'), ((2353, 2384), 'numpy.asarray', 'np.asarray', (['b'], {'dtype': 'np.float64'}), '(b, dtype=np.float64)\n', (2363, 2384), True, 'import numpy as np\n'), ((2393, 2424), ...
import numpy as np def load_glove(gloveFile): ''' Requires packages: numpy gloveFile: string file path to txt file containing words and glove vectors returns a dictionary of words as keys and their corresponding vectors as values ''' f = open(gloveFile,'r', encoding='utf8') ...
[ "numpy.asarray" ]
[((449, 491), 'numpy.asarray', 'np.asarray', (['splitLine[1:]'], {'dtype': '"""float32"""'}), "(splitLine[1:], dtype='float32')\n", (459, 491), True, 'import numpy as np\n')]
# coding: utf-8 """ Tests of the U.S. 1976 Standard Atmosphere implementation. All of them are validated against the `standard`_. .. _`standard`: http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770009539_1977009539.pdf """ from __future__ import division, absolute_import import numpy as np from numpy.testin...
[ "numpy.testing.assert_array_almost_equal", "numpy.testing.assert_equal", "skaero.atmosphere.util.geometric_to_geopotential", "numpy.testing.assert_almost_equal", "numpy.array", "skaero.atmosphere.coesa.table", "numpy.testing.assert_array_equal" ]
[((846, 860), 'skaero.atmosphere.coesa.table', 'coesa.table', (['h'], {}), '(h)\n', (857, 860), False, 'from skaero.atmosphere import coesa, util\n'), ((866, 893), 'numpy.testing.assert_equal', 'assert_equal', (['h', 'expected_h'], {}), '(h, expected_h)\n', (878, 893), False, 'from numpy.testing import assert_equal, as...
import os import numpy as np from collections import deque from ccontrol.utils import save_scores, save_AC_models, save_configuration class Runner: def __init__(self) -> None: file_location = os.path.dirname(__file__) self.path_score = os.path.join(file_location, r'./../../output/score') ...
[ "numpy.mean", "collections.deque", "ccontrol.utils.save_AC_models", "os.path.join", "numpy.any", "os.path.dirname", "ccontrol.utils.save_configuration", "ccontrol.utils.save_scores" ]
[((209, 234), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (224, 234), False, 'import os\n'), ((261, 312), 'os.path.join', 'os.path.join', (['file_location', '"""./../../output/score"""'], {}), "(file_location, './../../output/score')\n", (273, 312), False, 'import os\n'), ((340, 391), 'os....
import cv2 import numpy as np import time image = cv2.imread('test.png') image = cv2.flip(image,2) rows, cols,_ = image.shape M = cv2.getRotationMatrix2D((cols/2,rows/2),40,1) image = cv2.warpAffine(image,M,(cols,rows)) mask=cv2.inRange(image, np.array([0, 180, 255],dtype='uint8'),np.array([0, 180, 255],dtype='uint8'...
[ "cv2.imshow", "numpy.array", "cv2.HoughLines", "cv2.destroyAllWindows", "cv2.bitwise_or", "numpy.sin", "cv2.erode", "cv2.line", "cv2.waitKey", "cv2.warpAffine", "numpy.size", "numpy.cos", "cv2.getRotationMatrix2D", "cv2.subtract", "time.time", "cv2.imread", "cv2.countNonZero", "cv2...
[((52, 74), 'cv2.imread', 'cv2.imread', (['"""test.png"""'], {}), "('test.png')\n", (62, 74), False, 'import cv2\n'), ((83, 101), 'cv2.flip', 'cv2.flip', (['image', '(2)'], {}), '(image, 2)\n', (91, 101), False, 'import cv2\n'), ((132, 184), 'cv2.getRotationMatrix2D', 'cv2.getRotationMatrix2D', (['(cols / 2, rows / 2)'...
#! python3 """ Pass this program a filename as the first argument """ import sys import pickle import numpy as np import matplotlib.pyplot as plt from robot.base import State import config from logger import augment def add_arrow(line, direction='right', size=15, color=None, n=1): """ add an arrow to a line....
[ "numpy.convolve", "numpy.ones", "pickle.load", "numpy.argmax", "numpy.diff", "logger.augment", "robot.base.State", "numpy.concatenate", "numpy.degrees", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((1595, 1608), 'logger.augment', 'augment', (['data'], {}), '(data)\n', (1602, 1608), False, 'from logger import augment\n'), ((1661, 1689), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(3)'], {'sharex': '(True)'}), '(3, sharex=True)\n', (1673, 1689), True, 'import matplotlib.pyplot as plt\n'), ((2654, 2668), 'mat...
from object_detection.utils import label_map_util, visualization_utils as vis_util import tensorflow as tf import pandas as pd import numpy as np import...
[ "tensorflow.Graph", "tensorflow.gfile.GFile", "pathlib.Path", "tensorflow.Session", "tensorflow.GraphDef", "numpy.squeeze", "collections.defaultdict", "object_detection.utils.label_map_util.convert_label_map_to_categories", "cv2.cvtColor", "numpy.expand_dims", "tensorflow.import_graph_def", "o...
[((469, 483), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (473, 483), False, 'from pathlib import Path\n'), ((929, 975), 'object_detection.utils.label_map_util.load_labelmap', 'label_map_util.load_labelmap', (['self.labels_path'], {}), '(self.labels_path)\n', (957, 975), False, 'from object_detection.ut...
#!/usr/bin/env python from frovedis.exrpc.server import FrovedisServer from frovedis.mllib.tree import DecisionTreeClassifier from frovedis.mllib.tree import DecisionTreeRegressor import sys import numpy as np import pandas as pd #Objective: Run without error # initializing the Frovedis server argvs = sys.argv argc ...
[ "frovedis.exrpc.server.FrovedisServer.shut_down", "frovedis.mllib.tree.DecisionTreeClassifier", "frovedis.mllib.tree.DecisionTreeRegressor", "numpy.array", "frovedis.exrpc.server.FrovedisServer.initialize", "pandas.DataFrame" ]
[((517, 552), 'frovedis.exrpc.server.FrovedisServer.initialize', 'FrovedisServer.initialize', (['argvs[1]'], {}), '(argvs[1])\n', (542, 552), False, 'from frovedis.exrpc.server import FrovedisServer\n'), ((560, 689), 'pandas.DataFrame', 'pd.DataFrame', (['[[10, 0, 1, 0, 0, 1, 0], [0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 0, 1, ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from six.moves import xrange from wtte import transforms as tr def timeline_plot(padded, title='', cmap="jet", plot=True, fig=None, ax=None): if fig is ...
[ "wtte.transforms.right_pad_to_left_pad", "numpy.nanmean", "matplotlib.pyplot.subplots" ]
[((1092, 1166), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'ncols': '(2)', 'nrows': '(2)', 'sharex': '(True)', 'sharey': '(False)', 'figsize': '(12, 8)'}), '(ncols=2, nrows=2, sharex=True, sharey=False, figsize=(12, 8))\n', (1104, 1166), True, 'import matplotlib.pyplot as plt\n'), ((1453, 1485), 'wtte.transfor...
import numpy as np import torch from src.derivatives import jacobian, trace def test_jacobian(): batchsize = int(np.random.randint(1, 10)) # vector * matrix -- # Unbatched rand_lengths = np.random.randint(1, 10, 2) ins = torch.rand(tuple(list(rand_lengths[-1:])), requires_grad=True) facto...
[ "torch.sin", "torch.relu", "src.derivatives.trace", "src.derivatives.jacobian", "numpy.random.randint", "torch.trace", "torch.einsum", "torch.cos", "torch.squeeze", "torch.allclose", "torch.rand" ]
[((210, 237), 'numpy.random.randint', 'np.random.randint', (['(1)', '(10)', '(2)'], {}), '(1, 10, 2)\n', (227, 237), True, 'import numpy as np\n'), ((395, 413), 'src.derivatives.jacobian', 'jacobian', (['out', 'ins'], {}), '(out, ins)\n', (403, 413), False, 'from src.derivatives import jacobian, trace\n'), ((425, 452),...
import math from matplotlib import pyplot as plt import numpy as np listx=[] listy=[] listz=[] listw=[] phi=(1+5**(1/2))/2 def function(x): y=(phi**x)-(phi) return y def function2(x): return (function4(x-1)*(phi**x))-(function4(x-2)*phi**(x-2)) def function4(x): return ((phi**i)-(-1*(phi...
[ "matplotlib.pyplot.plot", "math.log", "numpy.array", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((522, 537), 'numpy.array', 'np.array', (['listx'], {}), '(listx)\n', (530, 537), True, 'import numpy as np\n'), ((545, 560), 'numpy.array', 'np.array', (['listy'], {}), '(listy)\n', (553, 560), True, 'import numpy as np\n'), ((568, 583), 'numpy.array', 'np.array', (['listz'], {}), '(listz)\n', (576, 583), True, 'impo...
from moviepy.editor import * from moviepy.audio.AudioClip import AudioArrayClip import numpy as np import math # 15fps frames = np.concatenate([np.ones([15, 84, 84, 3]), np.zeros([15, 84, 84, 3]), np.ones([15, 84, 84, 3])], axis = 0) audioL = np.array([math.sin(2*math.pi*440*i/44100) for i in range(44100 * 3)]) audioR...
[ "numpy.ones", "moviepy.audio.AudioClip.AudioArrayClip", "math.sin", "numpy.stack", "numpy.zeros", "numpy.transpose" ]
[((402, 436), 'numpy.stack', 'np.stack', (['[audioL, audioR]'], {'axis': '(0)'}), '([audioL, audioR], axis=0)\n', (410, 436), True, 'import numpy as np\n'), ((675, 695), 'numpy.transpose', 'np.transpose', (['audios'], {}), '(audios)\n', (687, 695), True, 'import numpy as np\n'), ((756, 789), 'moviepy.audio.AudioClip.Au...
#!/usr/bin/env python3 from os import mkdir, remove from os.path import isdir from datetime import datetime, timezone, timedelta #import struct import numpy as np from LoLIM.utilities import processed_data_dir, v_air from LoLIM.IO.raw_tbb_IO import filePaths_by_stationName, MultiFile_Dal1, read_station_delays, read...
[ "numpy.random.normal", "numpy.abs", "LoLIM.IO.metadata.ITRF_to_geoditic", "numpy.argmax", "LoLIM.signal_processing.locate_data_loss", "numpy.empty", "numpy.arange" ]
[((2264, 2301), 'numpy.empty', 'np.empty', (['blocksize'], {'dtype': 'np.complex'}), '(blocksize, dtype=np.complex)\n', (2272, 2301), True, 'import numpy as np\n'), ((2322, 2382), 'numpy.empty', 'np.empty', (['(num_station_antennas, blocksize)'], {'dtype': 'np.double'}), '((num_station_antennas, blocksize), dtype=np.do...
# -*- coding: utf-8 -*- # run in py3 !! import os os.environ["CUDA_VISIBLE_DEVICES"] = "1"; import tensorflow as tf config = tf.ConfigProto() # config.gpu_options.per_process_gpu_memory_fraction=0.5 config.gpu_options.allow_growth = True tf.Session(config=config) import numpy as np from sklearn import preprocessing...
[ "pandas.read_csv", "matplotlib.pyplot.ylabel", "hist_figure.his_figures", "numpy.column_stack", "numpy.array", "keras.optimizers.SGD", "keras.layers.Activation", "sys.path.append", "keras.optimizers.Adadelta", "numpy.mean", "numpy.reshape", "tensorflow.Session", "matplotlib.pyplot.plot", "...
[((128, 144), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (142, 144), True, 'import tensorflow as tf\n'), ((241, 266), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (251, 266), True, 'import tensorflow as tf\n'), ((383, 397), 'matplotlib.use', 'mpl.use', (['"""Ag...
# -*- coding: utf-8 -*- import os os.environ["MKL_NUM_THREADS"] = "1" os.environ["NUMEXPR_NUM_THREADS"] = "1" os.environ["OMP_NUM_THREADS"] = "1" from os import path, makedirs import numpy as np np.random.seed(1) import random random.seed(1) import timeit import cv2 import pandas as pd from multiproce...
[ "cv2.ocl.setUseOpenCL", "cv2.setNumThreads", "pandas.read_csv", "os.makedirs", "timeit.default_timer", "os.path.join", "random.seed", "numpy.sum", "numpy.random.seed", "multiprocessing.Pool", "numpy.zeros_like" ]
[((207, 224), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (221, 224), True, 'import numpy as np\n'), ((241, 255), 'random.seed', 'random.seed', (['(1)'], {}), '(1)\n', (252, 255), False, 'import random\n'), ((341, 361), 'cv2.setNumThreads', 'cv2.setNumThreads', (['(0)'], {}), '(0)\n', (358, 361), Fal...
#!/usr/bin/env python # -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by <NAME>, based on code from <NAME> # -------------------------------------------------------- """ Demo script showing detections in sample i...
[ "cv2.rectangle", "cv2.convertScaleAbs", "numpy.hstack", "cv2.imshow", "numpy.array", "nets.vgg16.vgg16", "numpy.mean", "numpy.histogram", "numpy.reshape", "argparse.ArgumentParser", "numpy.where", "utils.timer.Timer", "tensorflow.Session", "nets.resnet_v1.resnetv1", "pyrealsense2.config"...
[((2282, 2322), 'numpy.hstack', 'np.hstack', (['(color_image, depth_colormap)'], {}), '((color_image, depth_colormap))\n', (2291, 2322), True, 'import numpy as np\n'), ((2346, 2377), 'cv2.imshow', 'cv2.imshow', (['"""RealSense"""', 'images'], {}), "('RealSense', images)\n", (2356, 2377), False, 'import os, cv2\n'), ((4...
#! /usr/bin/env python #! coding:utf-8 from pathlib import Path import matplotlib.pyplot as plt from torch import log from tqdm import tqdm import torch import torch.nn as nn import argparse import torch.optim as optim from torch.optim.lr_scheduler import ReduceLROnPlateau from sklearn.metrics import confusion_matrix ...
[ "sys.path.insert", "torch.nn.CrossEntropyLoss", "torch.from_numpy", "utils.makedir", "torch.cuda.is_available", "sys.exit", "time.perf_counter_ns", "logging.info", "argparse.ArgumentParser", "pathlib.Path", "dataloader.shrec_loader.SConfig", "numpy.max", "torchsummary.summary", "torch.opti...
[((617, 670), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./pytorch-summary/torchsummary/"""'], {}), "(0, './pytorch-summary/torchsummary/')\n", (632, 670), False, 'import sys\n'), ((773, 789), 'utils.makedir', 'makedir', (['savedir'], {}), '(savedir)\n', (780, 789), False, 'from utils import makedir\n'), ((790,...
from tqdm import tqdm import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from scipy.optimize import fmin_slsqp from toolz import partial from sklearn.model_selection import KFold, TimeSeriesSplit, RepeatedKFold from sklearn.linear_model import ElasticNetCV, LassoCV, RidgeCV from bay...
[ "sklearn.linear_model.RidgeCV", "sklearn.model_selection.KFold", "numpy.mean", "sklearn.linear_model.ElasticNetCV", "numpy.repeat", "sklearn.model_selection.TimeSeriesSplit", "numpy.linspace", "toolz.partial", "pandas.DataFrame", "sklearn.model_selection.RepeatedKFold", "numpy.abs", "sklearn.l...
[((931, 968), 'numpy.repeat', 'np.repeat', (['(1 / n_features)', 'n_features'], {}), '(1 / n_features, n_features)\n', (940, 968), True, 'import numpy as np\n'), ((1004, 1022), 'numpy.append', 'np.append', (['_w', '_w0'], {}), '(_w, _w0)\n', (1013, 1022), True, 'import numpy as np\n'), ((1861, 1898), 'numpy.repeat', 'n...
import json import os import matplotlib.pyplot as plt import numpy as np import pandas as pd from ImagingReso import _utilities import plotly.tools as tls class Resonance(object): e_min = 1e-5 e_max = 1e8 stack = {} # compound, thickness, atomic_ratio of each layer with isotopes information stack_...
[ "ImagingReso._utilities.calculate_transmission", "ImagingReso._utilities.get_compound_density", "ImagingReso._utilities.formula_to_dictionary", "ImagingReso._utilities.is_element_in_database", "json.dumps", "plotly.tools.mpl_to_plotly", "ImagingReso._utilities.ev_to_s", "ImagingReso._utilities.ev_to_i...
[((3806, 3838), 'json.dumps', 'json.dumps', (['self.stack'], {'indent': '(4)'}), '(self.stack, indent=4)\n', (3816, 3838), False, 'import json\n'), ((3985, 4017), 'json.dumps', 'json.dumps', (['self.stack'], {'indent': '(4)'}), '(self.stack, indent=4)\n', (3995, 4017), False, 'import json\n'), ((4532, 4647), 'ImagingRe...
import unittest import numpy as np import torch from autoagent.models.rl.net import create_dense_net from autoagent.models.rl.policy import CategoricalPolicy, GaussianPolicy, SquashedGaussianPolicy class TestPolicy(unittest.TestCase): def test_categorical_policy(self): state_sizes = [np.random.randint(1...
[ "autoagent.models.rl.net.create_dense_net", "autoagent.models.rl.policy.GaussianPolicy", "numpy.random.randint", "autoagent.models.rl.policy.CategoricalPolicy", "torch.randn" ]
[((301, 325), 'numpy.random.randint', 'np.random.randint', (['(1)', '(20)'], {}), '(1, 20)\n', (318, 325), True, 'import numpy as np\n'), ((369, 393), 'numpy.random.randint', 'np.random.randint', (['(1)', '(10)'], {}), '(1, 10)\n', (386, 393), True, 'import numpy as np\n'), ((492, 547), 'autoagent.models.rl.net.create_...
#!/usr/bin/python3 """ October 25, 2018 Author: <NAME> TOF_Analyzer_DRS4.py This program takes data from a DRS4 data file and computes: Per Channel: Pulse height distributions Rise/Fall Times based on polarity A Combination of possible Time of Flights to establish best two detectors. Future work: - Multi...
[ "matplotlib.pyplot.hist", "scipy.misc.factorial", "numpy.sqrt", "numpy.polyfit", "matplotlib.pyplot.ylabel", "numpy.log", "scipy.signal.savgol_filter", "numpy.array", "numpy.nanmean", "numpy.isfinite", "matplotlib.pyplot.errorbar", "numpy.poly1d", "drs4.DRS4BinaryFile", "numpy.arange", "...
[((1556, 1579), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (1570, 1579), False, 'import matplotlib\n'), ((2316, 2378), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (2337, 237...
from dataclasses import dataclass from io import BytesIO from pathlib import Path import matplotlib.pyplot as plt import numpy import numpy.typing as npt import pandas as pd import pytest from PIL import Image from scipy.cluster import hierarchy from optmath.HCA import ( HCA, Chebyshev, Clu...
[ "optmath.HCA.Chebyshev", "optmath.HCA.Manhattan", "PIL.Image.open", "scipy.cluster.hierarchy.dendrogram", "matplotlib.pyplot.savefig", "pandas.read_csv", "pathlib.Path", "pytest.mark.skip", "optmath.HCA.Euclidean", "dataclasses.dataclass", "io.BytesIO", "numpy.asarray", "optmath.HCA.record.a...
[((493, 515), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (502, 515), False, 'from dataclasses import dataclass\n'), ((3358, 3483), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""Known issue with Ward distance selector - mismatch between scipy and this implementatio...
import csv import numpy as np import cv2 def resize_and_crop(image, img_size): """ Resize an image to the given img_size by first rescaling it and then applying a central crop to fit the given dimension. """ source_size = np.array(image.shape[:2], dtype=float) target_size = np.array(img_size, dtyp...
[ "numpy.array", "csv.reader", "cv2.resize", "numpy.amax", "numpy.round" ]
[((240, 278), 'numpy.array', 'np.array', (['image.shape[:2]'], {'dtype': 'float'}), '(image.shape[:2], dtype=float)\n', (248, 278), True, 'import numpy as np\n'), ((297, 328), 'numpy.array', 'np.array', (['img_size'], {'dtype': 'float'}), '(img_size, dtype=float)\n', (305, 328), True, 'import numpy as np\n'), ((354, 38...
import numpy as np import matplotlib.pyplot as plt #%matplotlib inline #import matplotlib.image as img #import PIL.Image as Image from PIL import Image import math import cmath import time import csv from numpy import binary_repr from fractions import gcd class DCT(object): """ This class DCT implements...
[ "numpy.absolute", "math.sqrt", "numpy.max", "math.cos", "numpy.zeros", "math.log10" ]
[((3022, 3051), 'numpy.zeros', 'np.zeros', (['[N, N]'], {'dtype': 'float'}), '([N, N], dtype=float)\n', (3030, 3051), True, 'import numpy as np\n'), ((3772, 3801), 'numpy.zeros', 'np.zeros', (['[N, N]'], {'dtype': 'float'}), '([N, N], dtype=float)\n', (3780, 3801), True, 'import numpy as np\n'), ((4628, 4648), 'numpy.a...
import warnings import os.path as osp import tensorflow as tf import numpy as np import time from tflearn import is_training from in_out import create_dir from general_utils import iterate_in_chunks from latent_3d_points.neural_net import Neural_Net, MODEL_SAVER_ID try: from latent_3d_points.structural_loss...
[ "latent_3d_points.structural_losses.tf_nndistance.nn_distance", "tensorflow.reduce_mean", "latent_3d_points.structural_losses.tf_approxmatch.approx_match", "in_out.create_dir", "latent_3d_points.neural_net.Neural_Net.__init__", "tensorflow.placeholder", "tensorflow.Session", "numpy.ndim", "tensorflo...
[((803, 841), 'latent_3d_points.neural_net.Neural_Net.__init__', 'Neural_Net.__init__', (['self', 'name', 'graph'], {}), '(self, name, graph)\n', (822, 841), False, 'from latent_3d_points.neural_net import Neural_Net, MODEL_SAVER_ID\n'), ((7874, 7919), 'tensorflow.train.AdamOptimizer', 'tf.train.AdamOptimizer', ([], {'...
import argparse import os import time import numpy as np from config import Config from dataset import DataSet from logger import get_logger logger = get_logger() def decode(dataTest, config): logger.info('Batch Dimensions: ' + str(dataTest.get_feature_shape())) logger.info('Label Dimensions: ' + str(dataT...
[ "argparse.ArgumentParser", "dataset.DataSet", "logger.get_logger", "config.Config", "numpy.asarray", "time.time" ]
[((153, 165), 'logger.get_logger', 'get_logger', ([], {}), '()\n', (163, 165), False, 'from logger import get_logger\n'), ((1595, 1671), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Decode test data using trained model."""'}), "(description='Decode test data using trained model.')\n", ...
# -*- coding: utf-8 -*- """ Created on Fri Jun 14 13:56:58 2019 @author: leoska """ import random import numpy as np from tensorflow.python.keras.utils import to_categorical def create_dataset(filepath): sgn = [] lbl = [] path = filepath + "/{}_data.txt" for i in range(0,10): data = np.loadtx...
[ "tensorflow.python.keras.utils.to_categorical", "numpy.shape", "numpy.asarray", "random.shuffle" ]
[((499, 516), 'random.shuffle', 'random.shuffle', (['c'], {}), '(c)\n', (513, 516), False, 'import random\n'), ((551, 584), 'numpy.asarray', 'np.asarray', (['sgn'], {'dtype': 'np.float64'}), '(sgn, dtype=np.float64)\n', (561, 584), True, 'import numpy as np\n'), ((595, 626), 'numpy.asarray', 'np.asarray', (['lbl'], {'d...
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.compose import ColumnTransformer from sklearn.impute import SimpleImputer from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler from sklearn.metrics import mean_squared...
[ "sklearn.model_selection.GridSearchCV", "pandas.read_csv", "sklearn.model_selection.train_test_split", "statsmodels.distributions.monotone_fn_inverter", "joblib.dump", "sklearn.metrics.mean_squared_error", "sklearn.preprocessing.StandardScaler", "xgboost.XGBRegressor", "sklearn.impute.SimpleImputer"...
[((536, 636), 'xgboost.XGBRegressor', 'XGBRegressor', ([], {'random_state': '(2021)', 'n_estimators': '(900)', 'max_depth': '(9)', 'learning_rate': '(0.1)', 'subsample': '(0.4)'}), '(random_state=2021, n_estimators=900, max_depth=9,\n learning_rate=0.1, subsample=0.4)\n', (548, 636), False, 'from xgboost import XGBR...
import numpy as np from finitefield import GF q=1024 field= GF(q) elts_map = {} for (i, v) in enumerate(field): elts_map[i] =v print(elts_map) rev_elts_map = {v:k for k,v in elts_map.items()} print(rev_elts_map) add_table = np.zeros((q,q)) for i in range(q): for j in range(q): add_table[i][j] = rev_elt...
[ "finitefield.GF", "numpy.zeros" ]
[((61, 66), 'finitefield.GF', 'GF', (['q'], {}), '(q)\n', (63, 66), False, 'from finitefield import GF\n'), ((229, 245), 'numpy.zeros', 'np.zeros', (['(q, q)'], {}), '((q, q))\n', (237, 245), True, 'import numpy as np\n'), ((363, 379), 'numpy.zeros', 'np.zeros', (['(q, q)'], {}), '((q, q))\n', (371, 379), True, 'import...
"""Set of functions for converting outputs.""" import numpy as np from frites.io.io_dependencies import is_pandas_installed, is_xarray_installed def convert_spatiotemporal_outputs(arr, times, roi, astype='array'): """Convert spatio-temporal outputs. Parameters ---------- arr : array_like 2d ...
[ "numpy.unique", "frites.io.io_dependencies.is_xarray_installed", "numpy.asarray", "pandas.MultiIndex.from_arrays", "xarray.DataArray", "pandas.DataFrame", "frites.io.io_dependencies.is_pandas_installed" ]
[((3941, 3956), 'numpy.asarray', 'np.asarray', (['roi'], {}), '(roi)\n', (3951, 3956), True, 'import numpy as np\n'), ((4045, 4082), 'numpy.unique', 'np.unique', (['sources'], {'return_index': '(True)'}), '(sources, return_index=True)\n', (4054, 4082), True, 'import numpy as np\n'), ((4098, 4135), 'numpy.unique', 'np.u...
import sys import warnings if sys.version_info >= (3, 8): from typing import Literal else: from typing_extensions import Literal from typing import Optional, Tuple, Union import igraph as ig import networkx as nx import numpy as np from edgeseraser.misc.backend import ig_erase, ig_extract, nx_erase, nx_extra...
[ "numpy.minimum", "edgeseraser.polya_tools.statistics.polya_cdf", "edgeseraser.misc.backend.nx_erase", "edgeseraser.misc.backend.nx_extract", "edgeseraser.polya_tools.numba_tools.NbComputePolyaCacheDict", "numpy.argwhere", "edgeseraser.polya_tools.numba_tools.NbComputePolyaCacheSzuszik", "edgeseraser.m...
[((727, 773), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""', 'FutureWarning'], {}), "('ignore', FutureWarning)\n", (748, 773), False, 'import warnings\n'), ((1633, 1709), 'edgeseraser.misc.matrix.construct_sp_matrices', 'construct_sp_matrices', (['weights', 'edges', 'num_vertices'], {'is_directed':...
import os, sys, time, copy, glob from collections import deque import gym from gym import spaces import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from ppo.a2c_ppo_acktr import algo from ppo.a2c_ppo_acktr.arguments import get_args from ppo.a2c_ppo_acktr....
[ "numpy.array", "torch.cuda.is_available", "ppo.a2c_ppo_acktr.algo.A2C_ACKTR", "copy.deepcopy", "ppo.a2c_ppo_acktr.utils.get_vec_normalize", "visdom.Visdom", "os.remove", "numpy.mean", "collections.deque", "ppo.a2c_ppo_acktr.model.Policy", "torch.set_num_threads", "ppo.a2c_ppo_acktr.algo.PPO", ...
[((581, 591), 'ppo.a2c_ppo_acktr.arguments.get_args', 'get_args', ([], {}), '()\n', (589, 591), False, 'from ppo.a2c_ppo_acktr.arguments import get_args\n'), ((974, 1002), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (991, 1002), False, 'import torch\n'), ((1003, 1040), 'torch.cuda.ma...
from __future__ import print_function import argparse import torch import os import numpy as np import torch.utils.data from torch import nn, optim, save from PIL import Image from torch.nn import functional as F from torchvision import datasets, transforms from torchvision.utils import save_image from torch.utils.data...
[ "torch.manual_seed", "PIL.Image.open", "argparse.ArgumentParser", "torch.load", "torch.exp", "torch.from_numpy", "numpy.append", "numpy.array", "torch.randn_like", "torch.cuda.is_available", "torch.save", "torch.nn.Linear", "torchvision.transforms.Resize", "torchvision.transforms.ToTensor"...
[((735, 791), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""VAE MNIST Example"""'}), "(description='VAE MNIST Example')\n", (758, 791), False, 'import argparse\n'), ((1491, 1519), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (1508, 1519), False, 'impor...
import networkx as nx from networkx.algorithms import isomorphism from networkx.algorithms.approximation import ramsey import re import os import csv import matplotlib.pyplot as plt import sys from networkx.algorithms.traversal.depth_first_search import dfs_tree from sklearn.cluster import AgglomerativeCluster...
[ "networkx.MultiDiGraph", "networkx.DiGraph", "csv.writer", "networkx.Graph", "networkx.dfs_tree", "graphviz.Digraph", "sklearn.cluster.DBSCAN", "numpy.set_printoptions" ]
[((413, 455), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'sys.maxsize'}), '(threshold=sys.maxsize)\n', (432, 455), True, 'import numpy as np\n'), ((462, 472), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (470, 472), True, 'import networkx as nx\n'), ((479, 489), 'networkx.Graph', 'nx.Graph',...
import numpy as np from hyper_opt import create_mask,model_1D,model_reduced,model_1D_calibrate import load_data import data_preprocessing import generate_result from sklearn.model_selection import train_test_split def main(): # define input file names, directories, and parmaeters train_Con_file_name = 'CV_con....
[ "data_preprocessing.concatination", "numpy.reshape", "data_preprocessing.shuffling", "generate_result.out_result_highprob", "numpy.where", "data_preprocessing.concat", "data_preprocessing.upsampling", "generate_result.out_result", "load_data.find_path", "sklearn.model_selection.train_test_split", ...
[((567, 605), 'load_data.find_path', 'load_data.find_path', (['results_directory'], {}), '(results_directory)\n', (586, 605), False, 'import load_data\n'), ((868, 932), 'load_data.train_data_3d', 'load_data.train_data_3d', (['train_Con_file_name', 'train_AD_file_name'], {}), '(train_Con_file_name, train_AD_file_name)\n...
import torch from torch._C import _parse_source_def import torch.nn as nn import torch.nn.functional as F import gym import random from collections import deque import numpy as np class SimpleNet(nn.Module): def __init__(self, input_size, hidden_size, action_size): super(SimpleNet, self).__init__() ...
[ "random.sample", "collections.deque", "torch.log", "numpy.arange", "torch.randint", "torch.nn.Linear", "gym.make", "torch.cat", "torch.argmax" ]
[((333, 367), 'torch.nn.Linear', 'nn.Linear', (['input_size', 'hidden_size'], {}), '(input_size, hidden_size)\n', (342, 367), True, 'import torch.nn as nn\n'), ((387, 422), 'torch.nn.Linear', 'nn.Linear', (['hidden_size', 'action_size'], {}), '(hidden_size, action_size)\n', (396, 422), True, 'import torch.nn as nn\n'),...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: <NAME> (<EMAIL>) # @Date: 2019-02-19 # @Filename: target.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) # # @Last modified by: <NAME> (<EMAIL>) # @Last modified time: 2019-09-25 15:20:31 import os import pathlib from copy import ...
[ "lvmsurveysim.utils.plot.transform_patch_mollweide", "numpy.average", "pathlib.Path", "os.path.expandvars", "numpy.floor", "astropy.coordinates.SkyCoord", "lvmsurveysim.utils.plot.convert_to_mollweide", "numpy.max", "numpy.array", "lvmsurveysim.ifu.IFU.from_config", "warnings.warn", "copy.copy...
[((8520, 8536), 'copy.copy', 'copy', (['targets[0]'], {}), '(targets[0])\n', (8524, 8536), False, 'from copy import copy\n'), ((14020, 14036), 'numpy.average', 'numpy.average', (['r'], {}), '(r)\n', (14033, 14036), False, 'import numpy\n'), ((14050, 14066), 'numpy.average', 'numpy.average', (['d'], {}), '(d)\n', (14063...
# Sarsa is a value iteration algorithm that learns Q(s,a) # Combined with some policy that is based on Q-values (like eps-greedy) # Task that is somewhat problem dependent in linear SARSA is how to pick the right features # Specifically, these features should predict the value of a particular action given the state d...
[ "click.option", "numpy.array2string", "QFunctions.LinearTilingQApproximator", "math.log", "numpy.zeros", "numpy.random.uniform", "math.exp", "click.command", "gym.make" ]
[((1727, 1742), 'click.command', 'click.command', ([], {}), '()\n', (1740, 1742), False, 'import click\n'), ((1744, 1782), 'click.option', 'click.option', (['"""--episodes"""'], {'default': '(10)'}), "('--episodes', default=10)\n", (1756, 1782), False, 'import click\n'), ((1784, 1820), 'click.option', 'click.option', (...
import matplotlib.pyplot as plt from numpy import arange, ones, zeros from numpy import sum as npsum from scipy.optimize import least_squares from scipy.special import gamma from autocorrelation import autocorrelation def FitFractionalIntegration(dx, l_, d0): # Fit of a fractional integration process on X #...
[ "scipy.optimize.least_squares", "numpy.ones", "autocorrelation.autocorrelation", "numpy.zeros", "scipy.special.gamma", "numpy.arange" ]
[((1530, 1618), 'scipy.optimize.least_squares', 'least_squares', (['objective', 'd0'], {'args': '(dx, l_)', 'bounds': '(lb, ub)', 'ftol': '(1e-09)', 'xtol': '(1e-09)'}), '(objective, d0, args=(dx, l_), bounds=(lb, ub), ftol=1e-09,\n xtol=1e-09)\n', (1543, 1618), False, 'from scipy.optimize import least_squares\n'), ...
""" Path tracking simulation with pure pursuit steering and PID speed control. author: <NAME> (@Atsushi_twi) <NAME> (@Gjacquenot) modified by: <NAME> (@tkortz) Original source: https://github.com/AtsushiSakai/PythonRobotics/blob/master/PathTracking/pure_pursuit/pure_pursuit.py """ import numpy as np import...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.ylabel", "liblitmus.set_task_mode_background", "math.cos", "math.hypot", "numpy.arange", "liblitmus.set_task_mode_litmusrt", "math.tan", "liblitmus.call_wait_for_ts_release", "liblitmus.call_sleep_next_period", "matplotlib.pyplot.xlabel", "matplotli...
[((5401, 5424), 'numpy.arange', 'np.arange', (['(0)', 'xmax', '(0.5)'], {}), '(0, xmax, 0.5)\n', (5410, 5424), True, 'import numpy as np\n'), ((5979, 6007), 'liblitmus.call_init_litmus', 'liblitmus.call_init_litmus', ([], {}), '()\n', (6005, 6007), False, 'import liblitmus\n'), ((6063, 6133), 'liblitmus.call_set_rt_tas...
import conx as cx import numpy as np from keras.datasets import mnist from keras.utils import (to_categorical, get_file) description = """ Original source: http://yann.lecun.com/exdb/mnist/ The MNIST dataset contains 70,000 images of handwritten digits (zero to nine) that have been size-normalized and centered in a s...
[ "keras.datasets.mnist.load_data", "conx.Dataset", "h5py.File", "keras.utils.to_categorical", "keras.utils.get_file", "numpy.concatenate" ]
[((982, 1008), 'keras.utils.get_file', 'get_file', (['path'], {'origin': 'url'}), '(path, origin=url)\n', (990, 1008), False, 'from keras.utils import to_categorical, get_file\n'), ((1018, 1038), 'h5py.File', 'h5py.File', (['path', '"""r"""'], {}), "(path, 'r')\n", (1027, 1038), False, 'import h5py\n'), ((1053, 1065), ...
import sys sys.path.insert(0, "\\Users\\Gebruiker\\Documents\\GitHub\\parcels\\") # Set path to find the newest parcels code import time as ostime import numpy as np from parcels import FieldSet, ParticleSet, AdvectionRK4_3D, ErrorCode from datetime import timedelta from netCDF4 import Dataset,num2date,date2num from...
[ "sys.path.insert", "datetime.timedelta", "functions.DistParticle.setLastID", "netCDF4.num2date", "netCDF4.Dataset", "numpy.asarray", "numpy.concatenate", "numpy.ma.masked_invalid", "numpy.meshgrid", "numpy.ma.masked_array", "netCDF4.date2num", "numpy.abs", "parcels.FieldSet.from_data", "nu...
[((11, 81), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""\\\\Users\\\\Gebruiker\\\\Documents\\\\GitHub\\\\parcels\\\\"""'], {}), "(0, '\\\\Users\\\\Gebruiker\\\\Documents\\\\GitHub\\\\parcels\\\\')\n", (26, 81), False, 'import sys\n'), ((533, 558), 'functions.DistParticle.setLastID', 'DistParticle.setLastID', (['...
# <https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_houghcircles/py_houghcircles.html> import cv2 import numpy as np img = cv2.imread('../src/opencv_logo.png',0) img = cv2.medianBlur(img,5) cimg = cv2.cvtColor(img,cv2.COLOR_GRAY2BGR) circles = cv2.HoughCircles(img,cv2.HOUGH_GRADIENT,1,20,param1=50,pa...
[ "cv2.medianBlur", "cv2.HoughCircles", "cv2.imshow", "cv2.waitKey", "cv2.circle", "cv2.destroyAllWindows", "numpy.around", "cv2.cvtColor", "cv2.imread" ]
[((141, 180), 'cv2.imread', 'cv2.imread', (['"""../src/opencv_logo.png"""', '(0)'], {}), "('../src/opencv_logo.png', 0)\n", (151, 180), False, 'import cv2\n'), ((186, 208), 'cv2.medianBlur', 'cv2.medianBlur', (['img', '(5)'], {}), '(img, 5)\n', (200, 208), False, 'import cv2\n'), ((215, 252), 'cv2.cvtColor', 'cv2.cvtCo...
import os import rnnSMAP import matplotlib import matplotlib.pyplot as plt import numpy as np import scipy import imp import statsmodels.api as sm from rnnSMAP import funPost imp.reload(rnnSMAP) rnnSMAP.reload() trainName = 'CONUSv2f1' out = trainName + '_y15_Forcing_dr60' rootDB = rnnSMAP.kPath['DB_L3_NA'] rootOut =...
[ "matplotlib.rcParams.update", "rnnSMAP.reload", "imp.reload", "os.path.join", "rnnSMAP.funPost.distCDF", "numpy.square", "numpy.stack", "numpy.nanmean", "rnnSMAP.funPost.plotCDF", "numpy.isnan", "matplotlib.pyplot.tight_layout", "statsmodels.api.OLS", "rnnSMAP.classDB.DatasetPost" ]
[((176, 195), 'imp.reload', 'imp.reload', (['rnnSMAP'], {}), '(rnnSMAP)\n', (186, 195), False, 'import imp\n'), ((196, 212), 'rnnSMAP.reload', 'rnnSMAP.reload', ([], {}), '()\n', (210, 212), False, 'import rnnSMAP\n'), ((366, 431), 'os.path.join', 'os.path.join', (["rnnSMAP.kPath['dirResult']", '"""paperSigma"""', '"""...
import pandas as pd import numpy as np import os from sklearn import preprocessing from sklearn.ensemble import RandomForestRegressor from fbprophet import Prophet DATA_URL = "https://raw.githubusercontent.com/OxCGRT/covid-policy-tracker/master/data/OxCGRT_latest.csv" ROOT_DIR = os.path.dirname(os.path.abspath(__file...
[ "sklearn.preprocessing.LabelEncoder", "sklearn.ensemble.RandomForestRegressor", "pandas.read_csv", "os.path.join", "numpy.array", "numpy.stack", "fbprophet.Prophet", "os.path.abspath" ]
[((337, 367), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""data"""'], {}), "(ROOT_DIR, 'data')\n", (349, 367), False, 'import os\n'), ((385, 429), 'os.path.join', 'os.path.join', (['DATA_PATH', '"""OxCGRT_latest.csv"""'], {}), "(DATA_PATH, 'OxCGRT_latest.csv')\n", (397, 429), False, 'import os\n'), ((456, 517), 'o...
""" Adapted from NiftyNet """ import numpy as np import numpy.ma as ma DEFAULT_CUTOFF = (0.01, 0.99) # Functions from NiftyNet def __compute_percentiles(img, mask, cutoff): """ Creates the list of percentile values to be used as landmarks for the linear fitting. :param img: Image on which to dete...
[ "numpy.mean", "numpy.ones_like", "numpy.digitize", "numpy.logical_not", "numpy.asarray", "numpy.max", "numpy.array", "numpy.min", "numpy.nan_to_num" ]
[((1233, 1251), 'numpy.asarray', 'np.asarray', (['cutoff'], {}), '(cutoff)\n', (1243, 1251), True, 'import numpy as np\n'), ((2383, 2403), 'numpy.nan_to_num', 'np.nan_to_num', (['slope'], {}), '(slope)\n', (2396, 2403), True, 'import numpy as np\n'), ((2486, 2527), 'numpy.mean', 'np.mean', (['(s1 - slope * perc_databas...
from __future__ import print_function from orphics import maps,io,cosmology,symcoupling as sc,stats,lensing from enlib import enmap,bench import numpy as np import os,sys cache = True hdv = False deg = 5 px = 1.5 shape,wcs = maps.rect_geometry(width_deg = deg,px_res_arcmin=px) mc = sc.LensingModeCoupling(shape,wcs) ...
[ "orphics.lensing.lensing_noise", "numpy.sqrt", "numpy.nan_to_num", "enlib.bench.show", "orphics.maps.rect_geometry", "orphics.maps.mask_kspace", "orphics.stats.bin_in_annuli", "orphics.io.Plotter", "orphics.cosmology.default_theory", "orphics.symcoupling.LensingModeCoupling", "orphics.maps.gauss...
[((228, 279), 'orphics.maps.rect_geometry', 'maps.rect_geometry', ([], {'width_deg': 'deg', 'px_res_arcmin': 'px'}), '(width_deg=deg, px_res_arcmin=px)\n', (246, 279), False, 'from orphics import maps, io, cosmology, symcoupling as sc, stats, lensing\n'), ((286, 320), 'orphics.symcoupling.LensingModeCoupling', 'sc.Lens...
import os import sys import pickle import matplotlib.pyplot as plt import numpy as np import h5py import argparse from sklearn.decomposition import PCA from sklearn.linear_model import LinearRegression from matplotlib.colors import Normalize sys.path.insert(0, os.getcwd()) from src.utils.helpers import * import statsmo...
[ "argparse.ArgumentParser", "statsmodels.stats.multitest.multipletests", "os.getcwd", "numpy.argwhere", "numpy.isnan", "pdb.set_trace", "numpy.zeros_like" ]
[((609, 700), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Collection of experiments. Runs on the cluster."""'}), "(description=\n 'Collection of experiments. Runs on the cluster.')\n", (632, 700), False, 'import argparse\n'), ((261, 272), 'os.getcwd', 'os.getcwd', ([], {}), '()\n',...
# -*- coding: utf-8 -*- """ Extract slides from course video Method: detect frame difference Pckage need to be installed: opencv: opt 1: conda install -c menpo opencv opt 2: conda install -c conda-forge opencv <NAME>, 2020-04-15 """ import os import cv2 from PIL import Image import numpy as np import matp...
[ "matplotlib.pyplot.ylabel", "argparse.ArgumentParser", "pathlib.Path", "img2pdf.convert", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.max", "os.path.isdir", "matplotlib.pyplot.savefig", "os.path.splitext", "os.path.isfile", "matplotlib.pyplot.title", "cv2.imwrite", "PIL.Im...
[((502, 529), 'PIL.Image.fromarray', 'Image.fromarray', (['img', '"""RGB"""'], {}), "(img, 'RGB')\n", (517, 529), False, 'from PIL import Image\n'), ((925, 940), 'matplotlib.pyplot.plot', 'plt.plot', (['diffs'], {}), '(diffs)\n', (933, 940), True, 'import matplotlib.pyplot as plt\n'), ((943, 984), 'matplotlib.pyplot.xl...
from typing import Callable, Any, List import numpy as np import math import autograd from .dataset import Dataset class DataLoader(object): """ Dataloader class """ def __init__(self, dataset: Dataset, batch_size: int = 1, shuffle: bool = True, collate_fn: Callable[[List], Any] = ...
[ "autograd.stack", "math.ceil", "numpy.arange", "numpy.random.shuffle" ]
[((947, 974), 'numpy.arange', 'np.arange', (['self.dataset_len'], {}), '(self.dataset_len)\n', (956, 974), True, 'import numpy as np\n'), ((1050, 1081), 'numpy.random.shuffle', 'np.random.shuffle', (['self.indexes'], {}), '(self.indexes)\n', (1067, 1081), True, 'import numpy as np\n'), ((1467, 1512), 'math.ceil', 'math...
import numpy as np from yellowbrick.cluster import KElbowVisualizer from sklearn.metrics import silhouette_samples, silhouette_score from sklearn.cluster import AgglomerativeClustering from sklearn.cluster import KMeans import matplotlib.pyplot as plt class AnalyzerSNR: def __init__(self, data): self...
[ "sklearn.cluster.KMeans", "numpy.mean", "matplotlib.pyplot.imshow", "numpy.where", "numpy.array", "yellowbrick.cluster.KElbowVisualizer", "numpy.std", "numpy.percentile", "sklearn.metrics.silhouette_score", "matplotlib.pyplot.show" ]
[((1129, 1170), 'numpy.percentile', 'np.percentile', (['self.snr', '(snr_cutoff * 100)'], {}), '(self.snr, snr_cutoff * 100)\n', (1142, 1170), True, 'import numpy as np\n'), ((4215, 4237), 'sklearn.cluster.KMeans', 'KMeans', ([], {'random_state': '(0)'}), '(random_state=0)\n', (4221, 4237), False, 'from sklearn.cluster...
import numpy as np def predict_density(model, Xtest, feature=0, data_gen_fun=None, mean=False, density=False, burnin=0, MC=None, save=None): """ Predict the density and compute error for a DP or EDP model for the Isotropic example, where the data generating function is a function of the mean of the input s...
[ "numpy.mean", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.colorbar", "numpy.asarray", "numpy.max", "matplotlib.pyplot.close", "numpy.min", "matplotlib.pyplot.title", "matplotlib.pyplot.show" ]
[((1292, 1319), 'numpy.min', 'np.min', (['model.y[:, feature]'], {}), '(model.y[:, feature])\n', (1298, 1319), True, 'import numpy as np\n'), ((1333, 1360), 'numpy.max', 'np.max', (['model.y[:, feature]'], {}), '(model.y[:, feature])\n', (1339, 1360), True, 'import numpy as np\n'), ((2434, 2477), 'matplotlib.pyplot.tit...
# Tutorial "Regresion Basica: Predecir eficiencia de gasolina" # https://www.tensorflow.org/tutorials/keras/regression?hl=es-419 import os import sys os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import numpy as np # noqa: E402 # from scipy import stats # noqa: E402 import matplotlib.pyplot as plt # noqa: E402 import p...
[ "pandas.read_csv", "keras_visualizer.visualizer", "numpy.array2string", "keras.utils.vis_utils.plot_model", "tensorflow.keras.callbacks.EarlyStopping", "numpy.array", "keras.layers.Dense", "numpy.mean", "pandas.DataFrame", "keras.backend.epsilon", "numpy.isinf", "numpy.abs", "numpy.ceil", ...
[((3318, 3360), 'tensorflow.keras.optimizers.Adam', 'keras.optimizers.Adam', ([], {'learning_rate': '(0.001)'}), '(learning_rate=0.001)\n', (3339, 3360), False, 'from tensorflow import keras\n'), ((4321, 4352), 'pandas.DataFrame', 'pd.DataFrame', (['p_history.history'], {}), '(p_history.history)\n', (4333, 4352), True,...
__author__ = 'Dante' import os import math import machines import density_weight as dw from structures.isozyme import BrendaIsozyme as bi from databases import db_queries as dbq from structures import fingerprinter as fptr import numpy as np import routines import pybel CHEMPATH = os.path.join(os.path.di...
[ "pybel.Smarts", "numpy.mean", "routines.dw_exp_ins", "os.path.join", "structures.fingerprinter.reconstruct_fp", "structures.isozyme.BrendaIsozyme", "os.path.dirname", "numpy.array", "machines.svm_clf", "numpy.vstack", "structures.fingerprinter.integer_sim", "density_weight.hyper_distance", "...
[((626, 637), 'structures.isozyme.BrendaIsozyme', 'bi', (['org', 'ec'], {}), '(org, ec)\n', (628, 637), True, 'from structures.isozyme import BrendaIsozyme as bi\n'), ((1763, 1853), 'machines.svm_clf', 'machines.svm_clf', (['a.pos[k]', 'a.neg[k]', 'res'], {'kernel': 'kernel', 'degree': 'degree', 'ent': 'ent', 'C': 'C'}...
from __future__ import division import numpy as np import torch import torch.nn as nn from mmcv.cnn import normal_init from mmdet.core import (PointGenerator, multi_apply, multiclass_nms_kp, point_target_kp) from mmdet.ops import DeformConv from ..builder import build_loss from ..registry impo...
[ "torch.nn.ReLU", "mmdet.core.point_target_kp", "numpy.sqrt", "mmdet.core.PointGenerator", "torch.exp", "mmdet.ops.DeformConv", "numpy.arange", "numpy.repeat", "torch.nn.ModuleList", "numpy.stack", "numpy.tile", "numpy.ceil", "mmdet.core.multi_apply", "torch.std", "torch.cat", "mmdet.co...
[((982, 1022), 'numpy.repeat', 'np.repeat', (['dcn_base_3', 'self.dcn_kernel_3'], {}), '(dcn_base_3, self.dcn_kernel_3)\n', (991, 1022), True, 'import numpy as np\n'), ((1046, 1084), 'numpy.tile', 'np.tile', (['dcn_base_3', 'self.dcn_kernel_3'], {}), '(dcn_base_3, self.dcn_kernel_3)\n', (1053, 1084), True, 'import nump...
import logging as log import os, sys, time import tensorflow as tf import numpy as np import reader flags = tf.app.flags flags.DEFINE_float('learning_rate', 0.1, 'Initial learning rate.') flags.DEFINE_integer('max_epochs', 10, 'Maximum number of epochs.') flags.DEFINE_integer('hidden_dim', 128, 'RNN hidden state siz...
[ "logging.getLogger", "logging.debug", "tensorflow.get_variable", "tensorflow.nn.sparse_softmax_cross_entropy_with_logits", "tensorflow.nn.softmax", "tensorflow.zeros_initializer", "tensorflow.scan", "tensorflow.reduce_mean", "logging.info", "tensorflow.GPUOptions", "tensorflow.app.run", "tenso...
[((1061, 1111), 'logging.basicConfig', 'log.basicConfig', ([], {'stream': 'sys.stderr', 'level': 'log.INFO'}), '(stream=sys.stderr, level=log.INFO)\n', (1076, 1111), True, 'import logging as log\n'), ((7011, 7084), 'reader.prepare_data', 'reader.prepare_data', (['FLAGS.train_data', 'FLAGS.vocab_data', 'FLAGS.vocab_size...
# Evaluacion ## Dataset #Explicar ### Estaciones #### Objetivo #'21057060': PAICOL target = '21057060-WL_CAL_AVG' #### Predictoras # PAICOL preds_cod = ['21017060', '21017040' ,'21087080', '21057050', '21057060'] # Removed PTE balseadero (Data hasta el 2015) 21047010 ### Variables #--NOT-- PR_CAL_ACU -> Precipitacion a...
[ "datetime.datetime", "emjav.emjav_data.tools.cargar_valores_observados", "numpy.ones", "pandas.DataFrame" ]
[((663, 689), 'datetime.datetime', 'datetime', (['(2015)', '(1)', '(1)', '(0)', '(0)'], {}), '(2015, 1, 1, 0, 0)\n', (671, 689), False, 'from datetime import datetime, timedelta\n'), ((704, 730), 'datetime.datetime', 'datetime', (['(2018)', '(1)', '(1)', '(0)', '(0)'], {}), '(2018, 1, 1, 0, 0)\n', (712, 730), False, 'f...