code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np import pylab as pl import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages global file_name global extension,path path='/Users/yves/fortran/GEOCLIM4/calibration/PD/' # / at the end of the line opath='/Users/yves/fortran/GEOCLIM4/python/figs/' extension=('out') #,...
[ "matplotlib.pyplot.show", "pylab.contourf", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.loadtxt" ]
[((473, 490), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'num': '(1)'}), '(num=1)\n', (483, 490), True, 'import matplotlib.pyplot as plt\n'), ((512, 559), 'numpy.loadtxt', 'np.loadtxt', (["(path + file_label + '.' + extension)"], {}), "(path + file_label + '.' + extension)\n", (522, 559), True, 'import numpy as np...
#!/usr/bin/env python # coding: utf-8 # In[ ]: #ensure dask and toolz are installed! # https://github.com/pydata/xarray/issues/4164 import xarray as xr import numpy as np import pandas as pd import pyresample import pyproj from pyproj import Transformer import matplotlib.pyplot as plt import glob from natsort import...
[ "pyresample.create_area_def", "numpy.flip", "numpy.log", "xarray.apply_ufunc", "pyresample.kd_tree.resample_custom", "numpy.zeros", "numpy.dtype", "pyproj.Transformer.from_crs", "xarray.Dataset", "xarray.concat", "numpy.sin", "pyresample.geometry.SwathDefinition", "numpy.arange", "numpy.co...
[((515, 563), 'xarray.open_mfdataset', 'xr.open_mfdataset', (['"""out.nc"""'], {'combine': '"""by_coords"""'}), "('out.nc', combine='by_coords')\n", (532, 563), True, 'import xarray as xr\n'), ((651, 697), 'xarray.apply_ufunc', 'xr.apply_ufunc', (['logu', "gem['u']"], {'dask': '"""allowed"""'}), "(logu, gem['u'], dask=...
import numpy as np import random import matplotlib.pyplot as plt from tqdm import tqdm def read_data_set(path, add_intercept=False): # read data set at given path features = [] classes = [] with open(path, "r") as f: for line in f.readlines(): sample = line.strip().split("\t") ...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.std", "matplotlib.pyplot.legend", "numpy.min", "numpy.max", "numpy.arange", "numpy.array", "numpy.exp", "numpy.mean", "numpy.random.rand", "numpy.dot" ]
[((1728, 1740), 'numpy.dot', 'np.dot', (['x', 'w'], {}), '(x, w)\n', (1734, 1740), True, 'import numpy as np\n'), ((2181, 2198), 'numpy.random.rand', 'np.random.rand', (['m'], {}), '(m)\n', (2195, 2198), True, 'import numpy as np\n'), ((3141, 3158), 'numpy.random.rand', 'np.random.rand', (['m'], {}), '(m)\n', (3155, 31...
import numpy as np from scipy.interpolate import interp1d x = np.array([5,10,20,40,60,80]) nx = len(x) flist = ('exp_r_Z_05.dat', 'exp_r_Z_10.dat', 'exp_r_Z_20.dat', 'exp_r_Z_40.dat', 'exp_r_Z_60.dat', 'exp_r_Z_80.dat') print(flist) fwhm_y = np.zeros(nx) for i,file in enumerate(flist): data = np.loadtxt(file) ...
[ "numpy.savetxt", "numpy.zeros", "numpy.max", "numpy.min", "numpy.array", "numpy.loadtxt", "numpy.vstack" ]
[((63, 96), 'numpy.array', 'np.array', (['[5, 10, 20, 40, 60, 80]'], {}), '([5, 10, 20, 40, 60, 80])\n', (71, 96), True, 'import numpy as np\n'), ((243, 255), 'numpy.zeros', 'np.zeros', (['nx'], {}), '(nx)\n', (251, 255), True, 'import numpy as np\n'), ((660, 696), 'numpy.array', 'np.array', (['[0, 5, 10, 20, 40, 60, 8...
# -*- coding: utf-8 -*- """ Test the FlowModel object. """ import numpy as np import pickle import pytest import torch from unittest.mock import create_autospec, MagicMock, patch from nessai.flowmodel import update_config, FlowModel @pytest.fixture() def data_dim(): return 2 @pytest.fixture() def model(): ...
[ "unittest.mock.create_autospec", "unittest.mock.MagicMock", "nessai.flowmodel.FlowModel.get_optimiser", "numpy.random.randn", "nessai.flowmodel.FlowModel", "pytest.fixture", "nessai.flowmodel.FlowModel.initialise", "unittest.mock.patch", "nessai.flowmodel.FlowModel.save_weights", "pytest.raises", ...
[((238, 254), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (252, 254), False, 'import pytest\n'), ((287, 303), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (301, 303), False, 'import pytest\n'), ((358, 390), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n",...
""" Copyright (c) 2019 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 writing,...
[ "numpy.arange", "numpy.exp", "numpy.argmax" ]
[((2114, 2161), 'numpy.arange', 'np.arange', ([], {'start': '(1)', 'stop': '(add_conf_out_count + 1)'}), '(start=1, stop=add_conf_out_count + 1)\n', (2123, 2161), True, 'import numpy as np\n'), ((4234, 4257), 'numpy.argmax', 'np.argmax', (['action_confs'], {}), '(action_confs)\n', (4243, 4257), True, 'import numpy as n...
from typing import Optional import pandas as pd import statsmodels.api as sm import numpy as np from statsmodels.regression.linear_model import RegressionResults from finstmt.exc import ForecastNotFitException from finstmt.forecast.models.base import ForecastModel class LinearTrendModel(ForecastModel): model: O...
[ "finstmt.exc.ForecastNotFitException", "numpy.arange", "numpy.concatenate", "statsmodels.api.OLS" ]
[((508, 525), 'statsmodels.api.OLS', 'sm.OLS', (['series', 'X'], {}), '(series, X)\n', (514, 525), True, 'import statsmodels.api as sm\n'), ((1065, 1108), 'numpy.concatenate', 'np.concatenate', (['(self.model.exog, future_X)'], {}), '((self.model.exog, future_X))\n', (1079, 1108), True, 'import numpy as np\n'), ((1129,...
import numpy as np import pandas as pd from datetime import datetime import json from src.models.model_def import get_callbacks, get_model from src.features.prepare_data import prepare_data from statistics import mean, stdev from sklearn.model_selection import KFold #TODO port loading + processing data to function...
[ "json.dump", "numpy.random.seed", "src.features.prepare_data.prepare_data", "src.models.model_def.get_model", "statistics.stdev", "sklearn.model_selection.KFold", "pandas.read_json", "statistics.mean", "src.models.model_def.get_callbacks", "datetime.datetime.now" ]
[((4040, 4059), 'numpy.random.seed', 'np.random.seed', (['(966)'], {}), '(966)\n', (4054, 4059), True, 'import numpy as np\n'), ((4143, 4181), 'pandas.read_json', 'pd.read_json', (["(DATA_PATH + 'train.json')"], {}), "(DATA_PATH + 'train.json')\n", (4155, 4181), True, 'import pandas as pd\n'), ((4188, 4224), 'pandas.re...
import torch import numpy as np from dataclasses import dataclass from typing import List, Optional, Union, NamedTuple, Dict @dataclass(frozen=True) class InputExample: """ A single training/test example for multiple choice Args: example_id: Unique id for the example. question: string. T...
[ "torch.stack", "numpy.hstack", "numpy.array", "dataclasses.dataclass", "torch.tensor" ]
[((129, 151), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (138, 151), False, 'from dataclasses import dataclass\n'), ((1101, 1123), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (1110, 1123), False, 'from dataclasses import dataclass\n'), (...
# -*- coding: utf-8 -*- """ Useful extra functions """ import numpy as np import pandas as pd import numpy.linalg as LA from collections import OrderedDict import pdb def calculate_error(x, y, error_type): """Calculate the normalised error of x relative to y as a percentage""" # remove NaNs notnan = ~np.i...
[ "pandas.read_csv", "numpy.interp", "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.isnan", "numpy.linalg.norm", "numpy.linspace", "numpy.column_stack", "collections.OrderedDict" ]
[((347, 377), 'numpy.linalg.norm', 'LA.norm', (['(x[notnan] - y[notnan])'], {}), '(x[notnan] - y[notnan])\n', (354, 377), True, 'import numpy.linalg as LA\n'), ((683, 725), 'numpy.zeros', 'np.zeros', (['(var.shape[0], var.shape[1] + 1)'], {}), '((var.shape[0], var.shape[1] + 1))\n', (691, 725), True, 'import numpy as n...
# coding: UTF-8 import torch import numpy as np import torch.nn.functional as F class ATModel: """ base train class, without adversarial training """ def __init__(self, model, emb_name="embedding"): self.model = model self.epsilon = 0.1 # 扰动的scale self.emb_backup = ...
[ "torch.zeros_like", "torch.norm", "torch.nn.functional.cross_entropy", "numpy.sign", "torch.isnan" ]
[((1122, 1154), 'torch.nn.functional.cross_entropy', 'F.cross_entropy', (['outputs', 'labels'], {}), '(outputs, labels)\n', (1137, 1154), True, 'import torch.nn.functional as F\n'), ((1873, 1895), 'torch.norm', 'torch.norm', (['param.grad'], {}), '(param.grad)\n', (1883, 1895), False, 'import torch\n'), ((1493, 1512), ...
# -*- coding: utf-8 -*- # @Date : 2020/6/1 # @Author: Luokun # @Email : <EMAIL> import sys from os.path import dirname, abspath import numpy as np sys.path.append(dirname(dirname(abspath(__file__)))) def test_em(): from models.em import SimpleEM y = np.array([1, 1, 0, 1, 0, 0, 1, 0, 1, 1]) em = Simple...
[ "os.path.abspath", "numpy.array", "models.em.SimpleEM" ]
[((264, 304), 'numpy.array', 'np.array', (['[1, 1, 0, 1, 0, 0, 1, 0, 1, 1]'], {}), '([1, 1, 0, 1, 0, 0, 1, 0, 1, 1])\n', (272, 304), True, 'import numpy as np\n'), ((314, 344), 'models.em.SimpleEM', 'SimpleEM', (['[0.5, 0.5, 0.5]', '(100)'], {}), '([0.5, 0.5, 0.5], 100)\n', (322, 344), False, 'from models.em import Sim...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # Copyright (c) 2020 University of Dundee. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright not...
[ "numpy.stack", "ilastik.app.parse_args", "numpy.dstack", "getpass.getpass", "ilastik.app.main", "omero.gateway.BlitzGateway" ]
[((1755, 1815), 'omero.gateway.BlitzGateway', 'BlitzGateway', (['username', 'password'], {'host': 'hostname', 'secure': '(True)'}), '(username, password, host=hostname, secure=True)\n', (1767, 1815), False, 'from omero.gateway import BlitzGateway\n'), ((3675, 3694), 'numpy.stack', 'numpy.stack', (['values'], {}), '(val...
"""Module for common card entities and operations.""" import numpy as np import tkinter as tk import os from functools import partial from os.path import join RESOURSES_DIR = os.path.join(os.path.dirname(__file__), "..", 'resources') try: from playsound import playsound playsound(join(RESOURSES_DIR, 'sound...
[ "functools.partial", "tkinter.PhotoImage", "numpy.ceil", "tkinter.Button", "os.path.dirname", "numpy.zeros", "numpy.setdiff1d", "numpy.arange", "numpy.random.choice", "os.path.join" ]
[((192, 217), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (207, 217), False, 'import os\n'), ((294, 335), 'os.path.join', 'join', (['RESOURSES_DIR', '"""sounds/shuffle.wav"""'], {}), "(RESOURSES_DIR, 'sounds/shuffle.wav')\n", (298, 335), False, 'from os.path import join\n'), ((823, 861), '...
# SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ # SPDX-FileCopyrightText: 2021 <NAME> # SPDX-License-Identifier: MIT import unittest import numpy as np from simpa.utils.libraries.tissue_library import TISSUE_LIBRARY from simpa.utils import Tags from simpa.utils.settings import Settings fro...
[ "simpa.utils.libraries.tissue_library.TISSUE_LIBRARY.muscle", "simpa.utils.settings.Settings", "numpy.sqrt", "simpa.utils.libraries.structure_library.EllipticalTubularStructure" ]
[((497, 507), 'simpa.utils.settings.Settings', 'Settings', ([], {}), '()\n', (505, 507), False, 'from simpa.utils.settings import Settings\n'), ((765, 775), 'simpa.utils.settings.Settings', 'Settings', ([], {}), '()\n', (773, 775), False, 'from simpa.utils.settings import Settings\n'), ((1130, 1153), 'simpa.utils.libra...
import numpy as np class DataClass1(object): """docstring for A""" def __init__(self): self.data = np.zeros((60,3,32,32)) self.indexes = np.arange(self.data.shape[0]) print(self.data.shape, self.indexes) def __len__(self): return self.data.shape[0] if __name__ == '__main_...
[ "numpy.zeros", "numpy.arange" ]
[((116, 141), 'numpy.zeros', 'np.zeros', (['(60, 3, 32, 32)'], {}), '((60, 3, 32, 32))\n', (124, 141), True, 'import numpy as np\n'), ((163, 192), 'numpy.arange', 'np.arange', (['self.data.shape[0]'], {}), '(self.data.shape[0])\n', (172, 192), True, 'import numpy as np\n')]
import torch from torch import nn, optim from torch.nn.modules.loss import TripletMarginLoss import numpy as np import matplotlib.pyplot as plt class NeuralNet(nn.Module): def __init__(self, descriptor_size, hidden_dim, embedding_dim): super(NeuralNet, self).__init__() self.descriptor_size = des...
[ "torch.empty", "torch.cat", "torch.arange", "torch.nn.functional.normalize", "torch.square", "numpy.meshgrid", "torch.multiply", "torch.exp", "torch.Tensor", "numpy.linspace", "torch.nn.Linear", "torch.nn.Parameter", "torch.max", "torch.unsqueeze", "torch.nn.init.ones_", "torch.reshape...
[((534, 559), 'torch.nn.Parameter', 'nn.Parameter', (['self.mu_rho'], {}), '(self.mu_rho)\n', (546, 559), False, 'from torch import nn, optim\n'), ((642, 677), 'torch.nn.init.ones_', 'torch.nn.init.ones_', (['self.sigma_rho'], {}), '(self.sigma_rho)\n', (661, 677), False, 'import torch\n'), ((750, 777), 'torch.nn.Param...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2015-2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
[ "silx.gui.qt.Signal", "xsocs.io.FitH5.FitH5", "numpy.where", "silx.gui.qt.QDataStream" ]
[((1657, 1674), 'silx.gui.qt.Signal', 'Qt.Signal', (['object'], {}), '(object)\n', (1666, 1674), True, 'from silx.gui import qt as Qt\n'), ((2281, 2330), 'silx.gui.qt.QDataStream', 'Qt.QDataStream', (['qByteArray', 'Qt.QIODevice.ReadOnly'], {}), '(qByteArray, Qt.QIODevice.ReadOnly)\n', (2295, 2330), True, 'from silx.gu...
import numpy as np from scipy.special import erfinv def std_from_equipment(tolerance=0.1, probability=0.95): """ Converts tolerance `tolerance` for precision of measurement equipment to a standard deviation, scaling so that (100`probability`) percent of measurements are within `tolerance`. A mean ...
[ "numpy.divide", "numpy.sum", "scipy.special.erfinv", "numpy.amax", "numpy.finfo", "numpy.linalg.svd", "numpy.array", "numpy.round", "numpy.vstack", "numpy.sqrt" ]
[((4371, 4407), 'numpy.linalg.svd', 'np.linalg.svd', (['A'], {'full_matrices': '(True)'}), '(A, full_matrices=True)\n', (4384, 4407), True, 'import numpy as np\n'), ((4554, 4580), 'numpy.sum', 'np.sum', (['(s > tol)'], {'dtype': 'int'}), '(s > tol, dtype=int)\n', (4560, 4580), True, 'import numpy as np\n'), ((2314, 234...
import sys from sysconfig import get_path from setuptools import setup, find_namespace_packages, Extension from setuptools.command.build_ext import build_ext from frds import ( __version__, __description__, __author__, __author_email__, __github_url__, ) try: import numpy except ImportError: ...
[ "setuptools.find_namespace_packages", "numpy.get_include", "sys.exit", "sysconfig.get_path" ]
[((366, 377), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (374, 377), False, 'import sys\n'), ((1586, 1611), 'setuptools.find_namespace_packages', 'find_namespace_packages', ([], {}), '()\n', (1609, 1611), False, 'from setuptools import setup, find_namespace_packages, Extension\n'), ((872, 895), 'sysconfig.get_path...
import numpy as np import scipy import scipy.optimize from . import units, utils def center(coordinates, masses): """ Given coordinates and masses, return coordinates with center of mass at 0. Also works to remove COM translational motion. Args: coordinates ({nparticle, ndim} ndarray): xyz (t...
[ "numpy.random.uniform", "numpy.zeros_like", "numpy.abs", "numpy.concatenate", "numpy.linalg.lstsq", "numpy.sum", "numpy.shape", "numpy.min", "numpy.max", "numpy.array", "numpy.reshape", "numpy.random.normal", "numpy.eye", "scipy.stats.maxwell.ppf", "numpy.vstack", "numpy.sqrt" ]
[((1329, 1356), 'numpy.reshape', 'np.reshape', (['masses', '(-1, 1)'], {}), '(masses, (-1, 1))\n', (1339, 1356), True, 'import numpy as np\n'), ((2590, 2617), 'numpy.reshape', 'np.reshape', (['masses', '(-1, 1)'], {}), '(masses, (-1, 1))\n', (2600, 2617), True, 'import numpy as np\n'), ((2943, 3001), 'numpy.vstack', 'n...
""" Basic script to mimic the behavior of Pyneal during an actual scan. This is a quick and dirty server set up to mimic the behavior of Pyneal. It will listen for incoming data over an assigned port using the same methods that Pyneal would use during a real scan. This tool allows you to test components of Pyneal Scan...
[ "nibabel.Nifti1Image", "os.path.abspath", "argparse.ArgumentParser", "json.loads", "numpy.frombuffer", "numpy.zeros", "time.sleep", "nibabel.save", "zmq.Context.instance" ]
[((1675, 1697), 'zmq.Context.instance', 'zmq.Context.instance', ([], {}), '()\n', (1695, 1697), False, 'import zmq\n'), ((3939, 4013), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Simulate Receiving thread of Pyneal"""'}), "(description='Simulate Receiving thread of Pyneal')\n", (3962,...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 19 23:18:44 2021 @author: fa19 """ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 27 14:16:37 2020 @author: fa19 """ from scipy.interpolate import griddata import os import params from params import gen_id import sys impo...
[ "os.path.join", "data_utils.utils.load_dataset_graph", "torch.load", "os.path.exists", "params.parse", "utils.train_graph", "torch.cuda.set_device", "utils.validate_graph", "utils.load_optimiser", "data_utils.utils.load_dataset_arrays", "json.dump", "numpy.save", "data_utils.utils.make_fig",...
[((872, 903), 'os.path.expanduser', 'os.path.expanduser', (['args.logdir'], {}), '(args.logdir)\n', (890, 903), False, 'import os\n'), ((917, 960), 'os.path.join', 'os.path.join', (['logdir', 'args.model', 'args.task'], {}), '(logdir, args.model, args.task)\n', (929, 960), False, 'import os\n'), ((965, 999), 'os.makedi...
from matplotlib.colors import hsv_to_rgb from matplotlib import colors from matplotlib import pyplot as plt from scipy import ndimage from sklearn.preprocessing import StandardScaler from skimage.feature import greycomatrix, greycoprops import numpy as np import pandas as pd import cv2 import glob import math...
[ "cv2.GaussianBlur", "cv2.medianBlur", "cv2.arcLength", "numpy.histogram", "numpy.mean", "numpy.arange", "glob.glob", "cv2.minAreaRect", "pandas.DataFrame", "cv2.contourArea", "cv2.filter2D", "cv2.cvtColor", "skimage.feature.greycoprops", "skimage.feature.greycomatrix", "numpy.finfo", "...
[((360, 375), 'glob.glob', 'glob.glob', (['ruta'], {}), '(ruta)\n', (369, 375), False, 'import glob\n'), ((6808, 6834), 'pandas.DataFrame', 'pd.DataFrame', (['texturas_val'], {}), '(texturas_val)\n', (6820, 6834), True, 'import pandas as pd\n'), ((485, 516), 'numpy.arange', 'np.arange', (['(0)', 'np.pi', '(np.pi / 16)'...
import numpy as np import csv from os import listdir from scipy import interpolate from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from . import bases class Dispersion3D(bases.Bzone2D): """Intersect 2D band structure with electron plane. Can be used for 3D da...
[ "numpy.set_printoptions", "matplotlib.pyplot.show", "matplotlib.pyplot.figure", "matplotlib.pyplot.rcParams.update", "numpy.max", "numpy.min", "numpy.arctan" ]
[((853, 891), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 14}"], {}), "({'font.size': 14})\n", (872, 891), True, 'from matplotlib import pyplot as plt\n'), ((900, 932), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(3)'}), '(precision=3)\n', (919, 932), True, 'imp...
import numpy as np from core.Functions.cuda import * from core.Layers import im2col import time from core.Initializer import xavieruniform input = np.random.randn(3, 280, 280, 32).astype(np.float32) input_gpu = cuda.to_device(input) lbl = [0, 1, 0, 0, 0, 0, 0, 0, 0, 0] kernel_shape = [3, 3, 32, 32] col_gpu = cu_im2col...
[ "numpy.random.randn", "core.Layers.im2col", "time.time", "numpy.matmul", "core.Initializer.xavieruniform", "numpy.prod" ]
[((384, 411), 'core.Layers.im2col', 'im2col', (['input', 'kernel_shape'], {}), '(input, kernel_shape)\n', (390, 411), False, 'from core.Layers import im2col\n'), ((1121, 1159), 'numpy.matmul', 'np.matmul', (['col', 'random_kernel_reshaped'], {}), '(col, random_kernel_reshaped)\n', (1130, 1159), True, 'import numpy as n...
#=============================================================================== # Copyright 2021 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.a...
[ "numpy.full", "numpy.ravel", "numpy.asarray", "numpy.all", "numpy.ones", "numpy.searchsorted", "numpy.shape", "numpy.any", "sklearn.utils.validation.assert_all_finite", "numpy.ascontiguousarray", "numpy.unique", "sklearn.utils.validation.check_array" ]
[((848, 861), 'numpy.asarray', 'np.asarray', (['y'], {}), '(y)\n', (858, 861), True, 'import numpy as np\n'), ((875, 886), 'numpy.shape', 'np.shape', (['y'], {}), '(y)\n', (883, 886), True, 'import numpy as np\n'), ((2196, 2230), 'numpy.unique', 'np.unique', (['y_'], {'return_inverse': '(True)'}), '(y_, return_inverse=...
import numpy as np import torch from torch import nn import sys import re import struct,logging import itertools import torchvision import pandas as pd import json import numpy as np import sys import re import struct import subprocess from subprocess import Popen def open_or_fd(file, mode='rb'): """ fd = open_or_...
[ "json.dump", "json.load", "pandas.read_csv", "numpy.frombuffer", "re.match", "numpy.max", "numpy.min", "numpy.array", "re.search", "numpy.concatenate" ]
[((4105, 4133), 'pandas.read_csv', 'pd.read_csv', (['"""vox2_meta.csv"""'], {}), "('vox2_meta.csv')\n", (4116, 4133), True, 'import pandas as pd\n'), ((6904, 6923), 'numpy.array', 'np.array', (['full_data'], {}), '(full_data)\n', (6912, 6923), True, 'import numpy as np\n'), ((7349, 7368), 'numpy.array', 'np.array', (['...
import numpy as np from distfit import distfit def test_distfit(): X = np.random.normal(0, 2, 1000) y = [-14,-8,-6,0,1,2,3,4,5,6,7,8,9,10,11,15] # Initialize dist = distfit() assert np.all(np.isin(['method', 'alpha', 'bins', 'distr', 'multtest', 'n_perm'], dir(dist))) # Fit and transform data ...
[ "numpy.isin", "numpy.abs", "numpy.unique", "scipy.stats.binom", "random.seed", "numpy.random.normal", "distfit.distfit", "numpy.round", "numpy.all" ]
[((76, 104), 'numpy.random.normal', 'np.random.normal', (['(0)', '(2)', '(1000)'], {}), '(0, 2, 1000)\n', (92, 104), True, 'import numpy as np\n'), ((182, 191), 'distfit.distfit', 'distfit', ([], {}), '()\n', (189, 191), False, 'from distfit import distfit\n'), ((732, 750), 'distfit.distfit', 'distfit', ([], {'distr': ...
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation #loading the data from data directory anti_ferromagnetic = np.load('./data/anti-ferromagnetic.npy') fig = plt.figure() frames = [] #empty list to put snaps of lat...
[ "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.close", "matplotlib.pyplot.imshow", "matplotlib.animation.ArtistAnimation", "matplotlib.pyplot.figure" ]
[((156, 196), 'numpy.load', 'np.load', (['"""./data/anti-ferromagnetic.npy"""'], {}), "('./data/anti-ferromagnetic.npy')\n", (163, 196), True, 'import numpy as np\n'), ((204, 216), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (214, 216), True, 'import matplotlib.pyplot as plt\n'), ((609, 671), 'matplotli...
import gc import multiprocessing import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D def gen_params(): from math import ceil from itertools import chain for width in chain( # range(2, 100, 1), # range(70, 100, 1) range(50, 100, 5)...
[ "matplotlib.pyplot.switch_backend", "numpy.load", "numpy.save", "gc.disable", "matplotlib.pyplot.show", "numpy.logical_and", "math.ceil", "matplotlib.pyplot.legend", "numpy.logical_not", "os.path.exists", "gc.enable", "gc.collect", "time.time_ns", "multiprocessing.Pool", "matplotlib.pypl...
[((866, 878), 'gc.disable', 'gc.disable', ([], {}), '()\n', (876, 878), False, 'import gc\n'), ((888, 902), 'time.time_ns', 'time.time_ns', ([], {}), '()\n', (900, 902), False, 'import time\n'), ((1010, 1024), 'time.time_ns', 'time.time_ns', ([], {}), '()\n', (1022, 1024), False, 'import time\n'), ((1064, 1076), 'gc.co...
from sklearn.externals import joblib from skimage import feature as skft from sklearn import svm import re import os from tqdm import tqdm import numpy as np import cv2 from numpy import * import json import copy import tensorflow as tf train_label=np.zeros( (2700) ) train_data=np.zeros((2700,512,512)) ...
[ "sklearn.externals.joblib.dump", "skimage.feature.local_binary_pattern", "cv2.cvtColor", "numpy.zeros", "cv2.imread", "sklearn.externals.joblib.load", "numpy.histogram", "numpy.arange", "numpy.array", "sklearn.svm.SVC", "os.path.join", "os.listdir", "cv2.resize" ]
[((264, 278), 'numpy.zeros', 'np.zeros', (['(2700)'], {}), '(2700)\n', (272, 278), True, 'import numpy as np\n'), ((295, 321), 'numpy.zeros', 'np.zeros', (['(2700, 512, 512)'], {}), '((2700, 512, 512))\n', (303, 321), True, 'import numpy as np\n'), ((550, 566), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (5...
import struct import os import cv2 import re import numpy as np from polygon import Bbox def send_data(socket, data): data = struct.pack('>I', len(data)) + data socket.sendall(data) def recv_data(sock): # Read message length and unpack it into an integer raw_msglen = recvall(sock, 4) if not raw_...
[ "struct.unpack", "numpy.max", "numpy.min", "polygon.Bbox", "re.compile" ]
[((748, 770), 're.compile', 're.compile', (['"""([0-9]+)"""'], {}), "('([0-9]+)')\n", (758, 770), False, 'import re\n'), ((1053, 1083), 'polygon.Bbox', 'Bbox', (['x1', 'y1', '(x2 - x1)', '(y2 - y1)'], {}), '(x1, y1, x2 - x1, y2 - y1)\n', (1057, 1083), False, 'from polygon import Bbox\n'), ((361, 392), 'struct.unpack', ...
import random import numpy as np import torch def set_seed(seed: int, use_cuda: bool): random.seed(seed) np.random.seed(seed) torch.random.manual_seed(seed) if use_cuda: torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) def generate_y(x, roots=[0.0, 0.0]): ...
[ "numpy.random.seed", "torch.random.manual_seed", "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "random.seed" ]
[((107, 124), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (118, 124), False, 'import random\n'), ((129, 149), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (143, 149), True, 'import numpy as np\n'), ((154, 184), 'torch.random.manual_seed', 'torch.random.manual_seed', (['seed'], {}), '...
# Copyright 2020 The MuLT Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
[ "numpy.std", "numpy.quantile", "numpy.array", "correlation.xfs" ]
[((1336, 1566), 'numpy.array', 'np.array', (['[-0.8848630975791922, 4.600451633673629, 3.615872144716864, \n 1.1838667374310157, -0.7000817701614678, -0.018821646628496263, -\n 0.2313025930161946, 0.2103729053368249, -4.060631004415739, \n 0.14208357407079072]'], {}), '([-0.8848630975791922, 4.600451633673629,...
import os import time import sys import re from subprocess import call import numpy as np from nltk import TweetTokenizer from nltk.tokenize.stanford import StanfordTokenizer FASTTEXT_EXEC_PATH = os.path.abspath("./fasttext") BASE_SNLP_PATH = "stanford-postagger/" SNLP_TAGGER_JAR = os.path.join(BASE_SNLP_PATH, "stanf...
[ "os.path.abspath", "os.remove", "numpy.concatenate", "time.time", "nltk.tokenize.stanford.StanfordTokenizer", "subprocess.call", "numpy.array", "sys.exit", "os.path.join", "re.sub" ]
[((197, 226), 'os.path.abspath', 'os.path.abspath', (['"""./fasttext"""'], {}), "('./fasttext')\n", (212, 226), False, 'import os\n'), ((285, 339), 'os.path.join', 'os.path.join', (['BASE_SNLP_PATH', '"""stanford-postagger.jar"""'], {}), "(BASE_SNLP_PATH, 'stanford-postagger.jar')\n", (297, 339), False, 'import os\n'),...
#!/usr/bin/python import matplotlib.pyplot as plt import numpy as np # sample 2D array x = np.random.random((100, 100)) plt.imshow(x, cmap="gray") plt.show()
[ "matplotlib.pyplot.imshow", "numpy.random.random", "matplotlib.pyplot.show" ]
[((97, 125), 'numpy.random.random', 'np.random.random', (['(100, 100)'], {}), '((100, 100))\n', (113, 125), True, 'import numpy as np\n'), ((128, 154), 'matplotlib.pyplot.imshow', 'plt.imshow', (['x'], {'cmap': '"""gray"""'}), "(x, cmap='gray')\n", (138, 154), True, 'import matplotlib.pyplot as plt\n'), ((155, 165), 'm...
import numpy as np import open3d from ..configs import config # from open3d.open3d.geometry import voxel_down_sample, estimate_normals, orient_normals_towards_camera_location class PointCloud: def __init__(self, cloud: open3d.geometry.PointCloud, visualization=False): self.cloud = cloud self.visua...
[ "open3d.visualization.draw_geometries", "numpy.asarray", "open3d.geometry.KDTreeSearchParamHybrid", "numpy.zeros" ]
[((1146, 1157), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (1154, 1157), True, 'import numpy as np\n'), ((1962, 1992), 'numpy.asarray', 'np.asarray', (['self.cloud.normals'], {}), '(self.cloud.normals)\n', (1972, 1992), True, 'import numpy as np\n'), ((417, 442), 'numpy.asarray', 'np.asarray', (['cloud.normals'...
import numpy as np import re from datetime import datetime, timedelta def setDimensions(OBS): ''' Takes an observation structure, calculate unique survey_times and number of observations within each survey. Returns OBS ''' OBS.toarray() OBS.survey_time=np.unique(OBS.time) OBS.Nsurvey=le...
[ "numpy.ones_like", "re.split", "numpy.ediff1d", "datetime.timedelta", "numpy.array", "numpy.argwhere", "datetime.datetime.now", "numpy.unique", "re.compile" ]
[((281, 300), 'numpy.unique', 'np.unique', (['OBS.time'], {}), '(OBS.time)\n', (290, 300), True, 'import numpy as np\n'), ((2889, 2909), 're.compile', 're.compile', (['"""(\\\\d+)"""'], {}), "('(\\\\d+)')\n", (2899, 2909), False, 'import re\n'), ((377, 406), 'numpy.ones_like', 'np.ones_like', (['OBS.survey_time'], {}),...
import numpy as np def contaminate_signal(X, noise_rate=10, noise_type='AWGN', missing_ratio=0): ''' Contaminates data with AWGN and random missing elements. Parameters: X: np.array(), double Original data tensor. noise_rate: double. For 'AWGN', target SNR in dB. For...
[ "numpy.random.uniform", "numpy.random.binomial", "numpy.unravel_index", "numpy.ma.array", "numpy.random.standard_normal", "numpy.linalg.norm", "numpy.log10", "numpy.sqrt" ]
[((1482, 1507), 'numpy.ma.array', 'np.ma.array', (['Y'], {'mask': 'mask'}), '(Y, mask=mask)\n', (1493, 1507), True, 'import numpy as np\n'), ((901, 923), 'numpy.log10', 'np.log10', (['signal_power'], {}), '(signal_power)\n', (909, 923), True, 'import numpy as np\n'), ((1026, 1046), 'numpy.sqrt', 'np.sqrt', (['noise_pow...
#!/usr/bin/env python import os, sys, glob sys.path.append('/Users/vincentvoelz/scripts/ratespec') import scipy from scipy.linalg import pinv import numpy as np import matplotlib from pylab import * from RateSpecClass import * from RateSpecTools import * from PlottingTools import * # For nice plots :) matplotlib....
[ "sys.path.append", "scipy.loadtxt", "matplotlib.pyplot.clf", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "matplotlib.use", "numpy.arange", "matplotlib.pyplot.rc", "matplotlib.pyplot.savefig" ]
[((44, 99), 'sys.path.append', 'sys.path.append', (['"""/Users/vincentvoelz/scripts/ratespec"""'], {}), "('/Users/vincentvoelz/scripts/ratespec')\n", (59, 99), False, 'import os, sys, glob\n'), ((309, 330), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (323, 330), False, 'import matplotlib\n'), ...
import numpy as np class CategoricalAccuracy: def __init__(self): self.accuracy_sums = 0 self.iter = 1e-12 def __call__(self, y_true, y_pred): print(y_pred.shape) y_pred = np.argmax(y_pred, axis=0) y_true = np.argmax(y_true, axis=0) accuracy = np.sum(y_pred == y_...
[ "numpy.sum", "numpy.argmax" ]
[((213, 238), 'numpy.argmax', 'np.argmax', (['y_pred'], {'axis': '(0)'}), '(y_pred, axis=0)\n', (222, 238), True, 'import numpy as np\n'), ((256, 281), 'numpy.argmax', 'np.argmax', (['y_true'], {'axis': '(0)'}), '(y_true, axis=0)\n', (265, 281), True, 'import numpy as np\n'), ((301, 325), 'numpy.sum', 'np.sum', (['(y_p...
""" aberrations.py mostly copied over from the original by Rupert in MEDIS collection of functions that deal with making aberration maps in proper for a given optical element. Two initialize functions set up the ques for creating, saving, and reading FITs files of aberration maps. In general, for an optical element i...
[ "proper.prop_begin", "proper.prop_zernikes", "numpy.random.uniform", "os.makedirs", "os.path.isdir", "numpy.zeros", "proper.prop_add_phase", "os.path.isfile", "numpy.array", "proper.prop_psd_errormap", "numpy.random.normal" ]
[((3214, 3276), 'proper.prop_begin', 'proper.prop_begin', (['lens_diam', '(1.0)', 'sp.grid_size', 'sp.beam_ratio'], {}), '(lens_diam, 1.0, sp.grid_size, sp.beam_ratio)\n', (3231, 3276), False, 'import proper\n'), ((3292, 3333), 'numpy.zeros', 'np.zeros', (['(1, sp.grid_size, sp.grid_size)'], {}), '((1, sp.grid_size, sp...
import matplotlib.pyplot as plt from matplotlib import colors from matplotlib import cm import numpy as np import pandas as pd from sklearn import metrics from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split def logistic_model(data, cell_types, sparsity=0.2, fractio...
[ "matplotlib.pyplot.title", "sklearn.model_selection.train_test_split", "numpy.arange", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.axvline", "matplotlib.colors.Normalize", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.ylim", "sklearn.linear_model.LogisticRegres...
[((411, 462), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'cell_types'], {'test_size': 'fraction'}), '(X, cell_types, test_size=fraction)\n', (427, 462), False, 'from sklearn.model_selection import train_test_split\n'), ((473, 517), 'sklearn.linear_model.LogisticRegression', 'LogisticRegressi...
import cv2 import time import math import random import argparse import numpy as np import numpy.matlib as npmatlib import matplotlib.pyplot as plt from PIL import Image, ImageFilter import statistics as stat from skimage import io from skimage import data from skimage import color from skimage.color impor...
[ "matplotlib.pyplot.title", "numpy.absolute", "cv2.medianBlur", "numpy.ones", "cv2.adaptiveThreshold", "skimage.data.copy", "numpy.around", "numpy.sin", "cv2.erode", "cv2.imshow", "numpy.full", "cv2.dilate", "cv2.imwrite", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "skimage...
[((734, 750), 'numpy.median', 'np.median', (['image'], {}), '(image)\n', (743, 750), True, 'import numpy as np\n'), ((964, 994), 'cv2.Canny', 'cv2.Canny', (['image', 'lower', 'upper'], {}), '(image, lower, upper)\n', (973, 994), False, 'import cv2\n'), ((1112, 1123), 'skimage.data.copy', 'data.copy', ([], {}), '()\n', ...
# SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ # SPDX-FileCopyrightText: 2021 <NAME> # SPDX-License-Identifier: MIT from abc import abstractmethod, ABC from simpa.log import Logger from simpa.utils import Settings import numpy as np from numpy import ndarray import hashlib import uuid fro...
[ "hashlib.md5", "numpy.asarray", "simpa.log.Logger", "numpy.array", "numpy.linalg.norm", "numpy.add" ]
[((1628, 1636), 'simpa.log.Logger', 'Logger', ([], {}), '()\n', (1634, 1636), False, 'from simpa.log import Logger\n'), ((4254, 4513), 'numpy.asarray', 'np.asarray', (['[position[0] + field_of_view_extent[0], position[0] + field_of_view_extent[\n 1], position[1] + field_of_view_extent[2], position[1] +\n field_of...
import numpy as np import os dir_path = os.path.dirname(os.path.realpath(__file__)) imagenet_example_label = 'hammerhead, hammerhead shark' imagenet_example_id = 4 imagenet_example = np.load(dir_path + '/imagenet_249.npy') if __name__ == "__main__": img = imagenet_example print('img size: ', img.size) pr...
[ "numpy.load", "os.path.realpath" ]
[((185, 224), 'numpy.load', 'np.load', (["(dir_path + '/imagenet_249.npy')"], {}), "(dir_path + '/imagenet_249.npy')\n", (192, 224), True, 'import numpy as np\n'), ((56, 82), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (72, 82), False, 'import os\n')]
"""Test patches.datasets.pilgrimm.simple_models. """ import unittest import numpy as np from .. import simple_models as models class TestCGM(unittest.TestCase): """Test the compositional geometric model. """ def test_cgm(self): """Test the CGM.""" cgm = models.compositional_geometric_mo...
[ "numpy.unique", "numpy.all" ]
[((1896, 1945), 'numpy.all', 'np.all', (['(lat_array[1:, 0] + lat_array[:-1, 0] == 1)'], {}), '(lat_array[1:, 0] + lat_array[:-1, 0] == 1)\n', (1902, 1945), True, 'import numpy as np\n'), ((1970, 2019), 'numpy.all', 'np.all', (['(lat_array[1:, 1] + lat_array[:-1, 1] == 1)'], {}), '(lat_array[1:, 1] + lat_array[:-1, 1] ...
# !/usr/bin/env python # -*- coding:utf-8 -*- """ Copyright 2020 Tianshu AI Platform. 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/LICEN...
[ "skimage.morphology.binary_closing", "scipy.ndimage.binary_fill_holes", "sched.scheduler", "skimage.measure.label", "skimage.measure.find_contours", "os.path.join", "skimage.measure.regionprops", "os.path.exists", "skimage.morphology.binary_erosion", "skimage.segmentation.clear_border", "json.du...
[((1143, 1181), 'sched.scheduler', 'sched.scheduler', (['time.time', 'time.sleep'], {}), '(time.time, time.sleep)\n', (1158, 1181), False, 'import sched\n'), ((2103, 2154), 'logging.info', 'logging.info', (['"""all dcms in one task are processed."""'], {}), "('all dcms in one task are processed.')\n", (2115, 2154), Fal...
from __future__ import print_function import glob import itertools import math import os import sys import time import numpy as np from ..apply.get_simulation_screenshot import get_simulation_screenshot, TEMP_PATH from ..infer.inference_wrapper_single_line import InferenceWrapperSingleLine from ..model.evolutionary_...
[ "os.remove", "math.sqrt", "os.rename", "os.system", "itertools.count", "time.time", "numpy.random.normal", "glob.iglob", "os.path.expanduser", "sys.exit" ]
[((1641, 1672), 'glob.iglob', 'glob.iglob', (["(TEMP_PATH + '*sim*')"], {}), "(TEMP_PATH + '*sim*')\n", (1651, 1672), False, 'import glob\n'), ((1757, 1804), 'os.system', 'os.system', (["('echo 0.0 > %s-1sim.txt' % TEMP_PATH)"], {}), "('echo 0.0 > %s-1sim.txt' % TEMP_PATH)\n", (1766, 1804), False, 'import os\n'), ((191...
import numpy as np import pandas as pd import tensorflow as tf from params import * from network_utils import * from training_utils import * from data_utils import load_data, lift_drag ### load model best_model = invariant_edge_model(edge_feature_dims, num_filters, initializer) best_model.load_weights('./best_mode...
[ "pandas.read_csv", "tensorflow.convert_to_tensor", "tensorflow.math.subtract", "tensorflow.reshape", "numpy.zeros", "tensorflow.concat", "tensorflow.constant", "numpy.savetxt", "tensorflow.gather", "numpy.arange", "numpy.reshape", "numpy.vstack", "numpy.unique" ]
[((1082, 1119), 'numpy.unique', 'np.unique', (['edges'], {'return_inverse': '(True)'}), '(edges, return_inverse=True)\n', (1091, 1119), True, 'import numpy as np\n'), ((1128, 1154), 'numpy.reshape', 'np.reshape', (['edges', '(-1, 2)'], {}), '(edges, (-1, 2))\n', (1138, 1154), True, 'import numpy as np\n'), ((1163, 1215...
""" @author: <NAME> @time: 2022/01/28 @description: Holistic 3D Vision Challenge on General Room Layout Estimation Track Evaluation Package https://github.com/bertjiazheng/indoor-layout-evaluation """ from scipy.optimize import linear_sum_assignment import numpy as np import scipy HEIGHT, WIDTH = 512, 1024 MAX_DISTA...
[ "scipy.spatial.distance.cdist", "numpy.zeros_like", "numpy.copy", "numpy.isinf", "numpy.isfinite", "numpy.sqrt", "numpy.prod", "scipy.optimize.linear_sum_assignment" ]
[((326, 359), 'numpy.sqrt', 'np.sqrt', (['(HEIGHT ** 2 + WIDTH ** 2)'], {}), '(HEIGHT ** 2 + WIDTH ** 2)\n', (333, 359), True, 'import numpy as np\n'), ((427, 479), 'scipy.spatial.distance.cdist', 'scipy.spatial.distance.cdist', (['gt_corners', 'dt_corners'], {}), '(gt_corners, dt_corners)\n', (455, 479), False, 'impor...
""" Created: Thu Jul 25 12:29:27 2019 @author: <NAME> <<EMAIL>> """ # %% Import, compile and load from numpy import array, linspace from fffi import FortranLibrary, FortranModule libfortmod = FortranLibrary('fortmod') fortmod = FortranModule(libfortmod, 'fortmod') # member variable and subroutine definition stub # T...
[ "fffi.FortranModule", "fffi.FortranLibrary", "numpy.array", "numpy.linspace" ]
[((194, 219), 'fffi.FortranLibrary', 'FortranLibrary', (['"""fortmod"""'], {}), "('fortmod')\n", (208, 219), False, 'from fffi import FortranLibrary, FortranModule\n'), ((230, 266), 'fffi.FortranModule', 'FortranModule', (['libfortmod', '"""fortmod"""'], {}), "(libfortmod, 'fortmod')\n", (243, 266), False, 'from fffi i...
__author__ = 'nmearl' from pynamic import photometry, optimizers import numpy as np class Optimizer(object): def __init__(self, params, photo_data_file='', rv_data_file='', rv_body=0, chain_file=''): self.params = params self.photo_data = np.loadtxt(photo_data_file, ...
[ "pynamic.optimizers.minimizer", "numpy.load", "numpy.save", "numpy.sum", "pynamic.photometry.generate", "pynamic.optimizers.hammer", "pynamic.optimizers.multinest", "numpy.savetxt", "numpy.zeros", "numpy.isfinite", "numpy.append", "numpy.loadtxt", "numpy.vstack", "numpy.in1d" ]
[((279, 338), 'numpy.loadtxt', 'np.loadtxt', (['photo_data_file'], {'unpack': '(True)', 'usecols': '(0, 1, 2)'}), '(photo_data_file, unpack=True, usecols=(0, 1, 2))\n', (289, 338), True, 'import numpy as np\n'), ((399, 415), 'numpy.zeros', 'np.zeros', (['(3, 0)'], {}), '((3, 0))\n', (407, 415), True, 'import numpy as n...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generate figure showing the distribution of memorization values for models trained with two different learning rates. Author: <NAME> License: See LICENSE file. Copyright: 2021, The Alan Turing Institute """ import argparse import numpy as np from fitter import Fit...
[ "numpy.load", "numpy.quantile", "argparse.ArgumentParser", "analysis_utils.dict2tex", "fitter.Fitter" ]
[((394, 419), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (417, 419), False, 'import argparse\n'), ((4602, 4624), 'numpy.load', 'np.load', (['args.lr3_file'], {}), '(args.lr3_file)\n', (4609, 4624), True, 'import numpy as np\n'), ((4639, 4661), 'numpy.load', 'np.load', (['args.lr4_file'], {}...
import tensorflow as tf import re import os import json import numpy as np import codecs from configs.event_config import event_config from data_processing.event_prepare_data import EventRolePrepareMRC, EventTypeClassificationPrepare from tensorflow.contrib import predictor from pathlib import Path from argparse impo...
[ "argparse.ArgumentParser", "codecs.open", "json.loads", "configs.event_config.event_config.get", "data_processing.event_prepare_data.EventRolePrepareMRC", "json.dumps", "tensorflow.contrib.predictor.from_saved_model", "pathlib.Path", "numpy.mean", "numpy.array", "numpy.argwhere", "os.listdir",...
[((15619, 15663), 'configs.event_config.event_config.get', 'event_config.get', (['args.event_type_model_path'], {}), '(args.event_type_model_path)\n', (15635, 15663), False, 'from configs.event_config import event_config\n'), ((26481, 26497), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (26495, 26497)...
import argparse import time import os import logging.config import sys import math import numpy as np import torch import torch.nn as nn from jazz_rnn.utils.utils import WeightDrop from jazz_rnn.utilspy.log import ResultsLog, setup_logging from jazz_rnn.utilspy.meters import AverageMeter, accuracy from jazz_rnn.C_rew...
[ "torch.nn.Dropout", "numpy.random.seed", "argparse.ArgumentParser", "time.strftime", "numpy.arange", "torch.no_grad", "os.path.join", "torch.nn.MSELoss", "jazz_rnn.utilspy.meters.AverageMeter", "torch.load", "os.path.exists", "torch.sign", "torch.nn.Linear", "torch.mean", "torch.unique",...
[((507, 573), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Jazz RNN/LSTM Model"""'}), "(description='PyTorch Jazz RNN/LSTM Model')\n", (530, 573), False, 'import argparse\n'), ((5180, 5213), 'torch.manual_seed', 'torch.manual_seed', (['self.args.seed'], {}), '(self.args.seed)\n...
import cv2 import numpy as np from .grasp_learner import grasp_obj from .grasp_predictor import Predictors from .shake_learner import shake_obj from .force_filter_learner import force_filter_obj from .five_filter_learner import five_filter_obj from .shake_predictor import Predictors as Adv_Predictors from .grasp_learne...
[ "cv2.circle", "cv2.putText", "grasp.utils.mjcf_utils.root_path_completion2", "numpy.argmax", "cv2.imwrite", "grasp.utils.mjcf_utils.root_path_completion", "time.time", "termcolor.colored", "cv2.imread", "numpy.max", "gc.collect", "numpy.array", "numpy.random.randint", "numpy.cos", "numpy...
[((1000, 1099), 'numpy.array', 'np.array', (['[[-grasp_l, -grasp_w], [grasp_l, -grasp_w], [grasp_l, grasp_w], [-grasp_l,\n grasp_w]]'], {}), '([[-grasp_l, -grasp_w], [grasp_l, -grasp_w], [grasp_l, grasp_w], [-\n grasp_l, grasp_w]])\n', (1008, 1099), True, 'import numpy as np\n'), ((1884, 1933), 'cv2.circle', 'cv2...
import numpy as np import re import os import argparse from sklearn.manifold import TSNE import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import glob from tqdm import tqdm import time import pdb import random from matplotlib import cm from matplotlib.colors import ListedColormap, LinearSegmentedC...
[ "numpy.random.uniform", "matplotlib.pyplot.xlim", "numpy.load", "os.makedirs", "matplotlib.cm.get_cmap", "sklearn.manifold.TSNE", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "numpy.asarray", "matplotlib.pyplot.scatter", "os.path.exists", "matplotlib.pyplot.legend", "os.path.basename...
[((107, 128), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (121, 128), False, 'import matplotlib\n'), ((873, 909), 'glob.glob', 'glob.glob', (["(self.emb_indir + '/*.npy')"], {}), "(self.emb_indir + '/*.npy')\n", (882, 909), False, 'import glob\n'), ((1701, 1712), 'time.time', 'time.time', ([],...
import numpy as np import torch import torch.nn.functional as F from skimage.util import img_as_bool def avg_iou(target, prediction): with torch.no_grad(): run_iou = 0.0 batch_size = target.shape[0] assert batch_size == prediction.shape[0] true_mask = img_as_bool(target.cpu().num...
[ "torch.no_grad", "numpy.logical_or", "numpy.logical_and" ]
[((963, 987), 'numpy.logical_and', 'np.logical_and', (['im1', 'im2'], {}), '(im1, im2)\n', (977, 987), True, 'import numpy as np\n'), ((1000, 1023), 'numpy.logical_or', 'np.logical_or', (['im1', 'im2'], {}), '(im1, im2)\n', (1013, 1023), True, 'import numpy as np\n'), ((2035, 2059), 'numpy.logical_and', 'np.logical_and...
#!/usr/bin/env python3 """ A file for creating a one-hot encoding of all characters, including madd and harakat, in Tarteel's Qur'an dataset. The output pickle file will contain an object with the one-hot encoded Qur'an, an encoding function, and a decoding function. Author: <NAME> Date: Jan. 12, 2019 """ import cop...
[ "json.load", "argparse.ArgumentParser", "numpy.argmax", "dill.load", "numpy.array", "numpy.arange", "dill.dump" ]
[((422, 493), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Tarteel Arabic One Hot Encoding Generator"""'}), "(description='Tarteel Arabic One Hot Encoding Generator')\n", (436, 493), False, 'from argparse import ArgumentParser\n'), ((2894, 2942), 'numpy.array', 'np.array', (['[char_to_int[char]...
#!/usr/bin/env python3 # Copyright 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
[ "torch.linalg.cholesky", "torch.eye", "torch.stack", "torch.autograd.grad", "torch.meshgrid", "torch.exp", "torch.Tensor", "torch.empty_like", "torch.cos", "torch.distributions.MultivariateNormal", "torch.nn.functional.relu", "torch.zeros", "torch.linspace", "torch.linalg.eigvalsh", "num...
[((12890, 12907), 'numpy.sqrt', 'np.sqrt', (['sigma2_w'], {}), '(sigma2_w)\n', (12897, 12907), True, 'import numpy as np\n'), ((12922, 12939), 'numpy.sqrt', 'np.sqrt', (['sigma2_b'], {}), '(sigma2_b)\n', (12929, 12939), True, 'import numpy as np\n'), ((20397, 20447), 'torch.linspace', 'torch.linspace', (['(-cube_size)'...
"""Class definition for generic convnet labeler.""" import numpy as np from kaishi.core.pipeline_component import PipelineComponent from kaishi.image.model import Model class LabelerGenericConvnet(PipelineComponent): """Use pre-trained ConvNet to predict image labels (e.g. stretched, rotated, etc.). This lab...
[ "kaishi.image.model.Model", "numpy.argmax" ]
[((973, 980), 'kaishi.image.model.Model', 'Model', ([], {}), '()\n', (978, 980), False, 'from kaishi.image.model import Model\n'), ((1295, 1318), 'numpy.argmax', 'np.argmax', (['pred[i, 1:5]'], {}), '(pred[i, 1:5])\n', (1304, 1318), True, 'import numpy as np\n')]
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np import os import PIL import time from IPython import display import imageio import glob import tensorflow as tf import matplotlib # import matplotlib.pyplot as plt matplotlib.use('Agg') """DCGAN_CIFAR10.ipynb Automatically generated by Colab...
[ "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.zeros_like", "tensorflow.keras.layers.LeakyReLU", "matplotlib.pyplot.figure", "tensorflow.train.latest_checkpoint", "tensorflow.keras.Sequential", "glob.glob", "os.path.join", "tensorflow.keras.layers.Flatten", "tens...
[((241, 262), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (255, 262), False, 'import matplotlib\n'), ((1697, 1734), 'tensorflow.keras.datasets.cifar10.load_data', 'tf.keras.datasets.cifar10.load_data', ([], {}), '()\n', (1732, 1734), True, 'import tensorflow as tf\n'), ((7138, 7178), 'tensorfl...
import argparse import csv from PIL import Image from tqdm import tqdm from random import randint import numpy as np import os def get_args(): parser = argparse.ArgumentParser() parser.add_argument("--file", help="The CSV file to read and extract GPS coordinates from", required=True, type=str) parser.add_a...
[ "tqdm.tqdm", "csv.reader", "os.makedirs", "argparse.ArgumentParser", "random.randint", "PIL.Image.open", "numpy.array", "numpy.eye", "os.path.join", "numpy.concatenate" ]
[((157, 182), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (180, 182), False, 'import argparse\n'), ((1234, 1293), 'os.path.join', 'os.path.join', (['args.images', 'f"""street_view_{coord_index}.jpg"""'], {}), "(args.images, f'street_view_{coord_index}.jpg')\n", (1246, 1293), False, 'import o...
import argparse import random import threading import time from yattag import Doc import cv2 import mss import numpy as np import os from util import autolog, drop from util.core import client, keyboard, mouse from util.core.ssd.ssd_inference import SSD parser = argparse.ArgumentParser(description = 'Debug') parser....
[ "argparse.ArgumentParser", "cv2.VideoWriter_fourcc", "cv2.waitKey", "cv2.destroyAllWindows", "os.path.dirname", "cv2.imshow", "yattag.Doc", "cv2.rectangle", "mss.mss", "numpy.array", "cv2.VideoWriter", "numpy.round", "util.core.client.Client", "os.path.join", "util.core.ssd.ssd_inference...
[((265, 309), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Debug"""'}), "(description='Debug')\n", (288, 309), False, 'import argparse\n'), ((444, 459), 'util.core.client.Client', 'client.Client', ([], {}), '()\n', (457, 459), False, 'from util.core import client, keyboard, mouse\n'), ...
import numpy as np import cv2 import os # from tabulate import tabulate import classifier from PIL import Image from kafka import KafkaConsumer from json import loads import pickle import logging import time import pymongo import sys import yaml time.sleep(10) print('--------------------------------------') path_of_s...
[ "pymongo.MongoClient", "pickle.loads", "yaml.load", "logging.error", "cv2.dnn.NMSBoxes", "numpy.argmax", "os.path.realpath", "cv2.dnn.blobFromImage", "cv2.dnn.readNetFromDarknet", "classifier.Classifier", "time.sleep", "numpy.array", "sys.exit", "os.path.join", "kafka.KafkaConsumer" ]
[((247, 261), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (257, 261), False, 'import time\n'), ((344, 370), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (360, 370), False, 'import os\n'), ((449, 472), 'classifier.Classifier', 'classifier.Classifier', ([], {}), '()\n', (470, 472)...
# --- external --- import numpy as np # --- internal --- from .constants import CONST as const def compute_blackbody_q1(T): """ Computes flux of photons at HeI line for black body of temperature T """ # convert to unitless energy x = (const.E_HeI / const.eV_erg) / (const.k_boltz * T) q1...
[ "numpy.exp" ]
[((3461, 3475), 'numpy.exp', 'np.exp', (['(-i * x)'], {}), '(-i * x)\n', (3467, 3475), True, 'import numpy as np\n'), ((4055, 4069), 'numpy.exp', 'np.exp', (['(-i * x)'], {}), '(-i * x)\n', (4061, 4069), True, 'import numpy as np\n'), ((4739, 4753), 'numpy.exp', 'np.exp', (['(-i * x)'], {}), '(-i * x)\n', (4745, 4753),...
# do not run this code from keras.models import Model from keras import layers from keras import Input # build network model with multi-input text_vocabulary_size = 10000 # the first 10000 words used most frequently; 10000 as the input dim in Embedding layer. question_vocabulary_size = 10000 # question text input. ...
[ "keras.Input", "keras.layers.LSTM", "keras.models.Model", "numpy.random.randint", "keras.layers.Dense", "keras.layers.Embedding", "keras.layers.concatenate", "keras.utils.to_categorical" ]
[((421, 469), 'keras.Input', 'Input', ([], {'shape': '(None,)', 'dtype': '"""int32"""', 'name': '"""text"""'}), "(shape=(None,), dtype='int32', name='text')\n", (426, 469), False, 'from keras import Input\n'), ((793, 845), 'keras.Input', 'Input', ([], {'shape': '(None,)', 'dtype': '"""int32"""', 'name': '"""question"""...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Apr 18 21:20:01 2020 @author: yehuawei This file generates an testing case where all parameters are specified in the main function The testing case is saved into a .pkl file where its prefix is 'input', followed by 'mX' where X specifies the number of ...
[ "pickle.dump", "numpy.zeros", "numpy.ones" ]
[((815, 830), 'numpy.ones', 'np.ones', (['(m, n)'], {}), '((m, n))\n', (822, 830), True, 'import numpy as np\n'), ((902, 918), 'numpy.zeros', 'np.zeros', (['(m, n)'], {}), '((m, n))\n', (910, 918), True, 'import numpy as np\n'), ((958, 974), 'numpy.zeros', 'np.zeros', (['(m, n)'], {}), '((m, n))\n', (966, 974), True, '...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 18 17:12:36 2021 @author: duttar Edited from <NAME> """ from shutil import copyfile from osgeo import gdal ## GDAL support for reading virtual files import os ## To create and remove directories import matplotlib....
[ "numpy.abs", "argparse.ArgumentParser", "numpy.angle", "matplotlib.pyplot.figure", "glob.glob", "numpy.vstack", "osgeo.gdal.Open", "matplotlib.pyplot.savefig" ]
[((499, 589), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Utility to plot multiple simple complex arrays"""'}), "(description=\n 'Utility to plot multiple simple complex arrays')\n", (522, 589), False, 'import argparse\n'), ((2183, 2215), 'glob.glob', 'glob.glob', (['GDALfilename_w...
""" """ import numpy as np from nltk import word_tokenize from nltk.corpus import stopwords from nltk.stem.snowball import FrenchStemmer def avg_document(model, document): """ computes the average vector of the words in document in the word2vec model space Parameters ---------- model : word2vec....
[ "nltk.stem.snowball.FrenchStemmer", "numpy.zeros", "numpy.mean", "numpy.array", "nltk.corpus.stopwords.words", "nltk.word_tokenize", "numpy.vstack" ]
[((634, 674), 'numpy.zeros', 'np.zeros', (['(n_features,)'], {'dtype': '"""float64"""'}), "((n_features,), dtype='float64')\n", (642, 674), True, 'import numpy as np\n'), ((1432, 1450), 'numpy.array', 'np.array', (['features'], {}), '(features)\n', (1440, 1450), True, 'import numpy as np\n'), ((2270, 2299), 'nltk.word_...
""" Power law grain size distribution with an exponential cut-off at the large end """ import numpy as np from scipy.integrate import trapz from newdust.graindist import shape __all__ = ['ExpCutoff'] # Some default values RHO = 3.0 # g cm^-3 (average grain material density) NA = 100 # default num...
[ "scipy.integrate.trapz", "numpy.power", "newdust.graindist.shape.vol", "numpy.exp", "numpy.linspace", "newdust.graindist.shape.Sphere", "numpy.log10" ]
[((613, 627), 'newdust.graindist.shape.Sphere', 'shape.Sphere', ([], {}), '()\n', (625, 627), False, 'from newdust.graindist import shape\n'), ((1853, 1888), 'numpy.linspace', 'np.linspace', (['amin', '(acut * nfold)', 'na'], {}), '(amin, acut * nfold, na)\n', (1864, 1888), True, 'import numpy as np\n'), ((1975, 2000),...
""" Example3 is demo of E2EPipeline with transformers nonstandard from the sklearn perspective. """ import logging import numpy as np from sklearn.base import BaseEstimator from src.e2epipeline import E2EPipeline class TransformerX(BaseEstimator): def fit(self, X, y=None): self.num = len(X) ret...
[ "numpy.array", "logging.StreamHandler", "logging.debug" ]
[((1246, 1268), 'logging.debug', 'logging.debug', (['"""start"""'], {}), "('start')\n", (1259, 1268), False, 'import logging\n'), ((1273, 1316), 'numpy.array', 'np.array', (['[[4, 2, 3], [3, 5, 7], [5, 8, 4]]'], {}), '([[4, 2, 3], [3, 5, 7], [5, 8, 4]])\n', (1281, 1316), True, 'import numpy as np\n'), ((1335, 1354), 'n...
import math import datetime as dt import numpy as np from typing import Tuple, Dict from dataclasses import dataclass from scipy.optimize import least_squares from voltoolbox import BusinessTimeMeasure, bs_implied_volatility, longest_increasing_subsequence from voltoolbox.fit.option_quotes import OptionQuoteSlice, Quo...
[ "voltoolbox.fit.fit_utils.act365_time", "numpy.maximum", "numpy.abs", "math.sqrt", "voltoolbox.longest_increasing_subsequence", "voltoolbox.fit.fit_utils.filter_quotes", "voltoolbox.fit.option_quotes.VolQuoteSlice", "scipy.optimize.least_squares", "voltoolbox.fit.option_quotes.VolSlice", "numpy.ed...
[((5142, 5164), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (5151, 5164), False, 'from dataclasses import dataclass\n'), ((1458, 1485), 'math.sqrt', 'math.sqrt', (['time_to_maturity'], {}), '(time_to_maturity)\n', (1467, 1485), False, 'import math\n'), ((1496, 1529), 'numpy.arra...
#System import numpy as np import sys import os import random from glob import glob from skimage import io from PIL import Image import random import SimpleITK as sitk #Torch from torch.autograd import Variable from torch.utils.data import Dataset, DataLoader import torch.optim as optim import torch.nn.functional as F ...
[ "sklearn.svm.SVR", "numpy.load", "os.makedirs", "torch.utils.data.DataLoader", "sklearn.feature_selection.RFE", "os.path.exists", "torch.nn.Linear", "numpy.where", "numpy.array", "sklearn.svm.SVC", "numpy.squeeze", "os.path.join", "numpy.concatenate" ]
[((905, 930), 'os.path.exists', 'os.path.exists', (['ckpt_path'], {}), '(ckpt_path)\n', (919, 930), False, 'import os\n'), ((936, 958), 'os.makedirs', 'os.makedirs', (['ckpt_path'], {}), '(ckpt_path)\n', (947, 958), False, 'import os\n'), ((4072, 4168), 'torch.utils.data.DataLoader', 'DataLoader', ([], {'dataset': 'tra...
import cv2 import numpy as np import matplotlib.pyplot as plt img = cv2.imread('./picture/dog1.jpg') mask = np.zeros(img.shape[:2], np.uint8) bgdModel = np.zeros((1, 65), np.float64) fgdModel = np.zeros((1, 65), np.float64) rect = (80, 10, 260, 215) # cv2.rectangle(img, (80,10),(260,215), (255,0,0), 1) cv2.grabCut(...
[ "cv2.grabCut", "matplotlib.pyplot.show", "cv2.cvtColor", "matplotlib.pyplot.imshow", "numpy.zeros", "matplotlib.pyplot.colorbar", "cv2.imread", "numpy.where" ]
[((69, 101), 'cv2.imread', 'cv2.imread', (['"""./picture/dog1.jpg"""'], {}), "('./picture/dog1.jpg')\n", (79, 101), False, 'import cv2\n'), ((109, 142), 'numpy.zeros', 'np.zeros', (['img.shape[:2]', 'np.uint8'], {}), '(img.shape[:2], np.uint8)\n', (117, 142), True, 'import numpy as np\n'), ((155, 184), 'numpy.zeros', '...
import numpy as np import pandas as pd import pickle import os import seaborn as sns import matplotlib.pyplot as plt import pystan # original model code varying_intercept = """ data { int<lower=0> J; # number of counties int<lower=0> N; # number of observations int<lower=1,upper=J> county[N]; # which coun...
[ "pandas.read_csv", "numpy.log" ]
[((2570, 2602), 'pandas.read_csv', 'pd.read_csv', (['"""../data/srrs2.dat"""'], {}), "('../data/srrs2.dat')\n", (2581, 2602), True, 'import pandas as pd\n'), ((2750, 2780), 'pandas.read_csv', 'pd.read_csv', (['"""../data/cty.dat"""'], {}), "('../data/cty.dat')\n", (2761, 2780), True, 'import pandas as pd\n'), ((3004, 3...
import numpy as np from keras.layers import Input, LSTM, RepeatVector from keras.models import Model from sklearn.preprocessing import MinMaxScaler def encode(X_list, epochs=50, latent_factor=2): # start_time = time.time() for i in range(1, len(X_list)): X_list[i] -= X_list[i - 1] scaler = Min...
[ "numpy.stack", "keras.layers.LSTM", "sklearn.preprocessing.MinMaxScaler", "keras.models.Model", "keras.layers.Input", "keras.layers.RepeatVector" ]
[((317, 341), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {'copy': '(False)'}), '(copy=False)\n', (329, 341), False, 'from sklearn.preprocessing import MinMaxScaler\n'), ((404, 428), 'numpy.stack', 'np.stack', (['X_list'], {'axis': '(1)'}), '(X_list, axis=1)\n', (412, 428), True, 'import numpy as np\n'),...
import numpy as np from tqdm.auto import tqdm def reciprocal_rank(y_true,y_score,k=10): ''' Reciprocal rank at k Parameters ---------- y_true : array-like, shape = [n_samples] Ground truth (true relevance labels). y_score : array-like, shape = [n_samples] Predicted scores. k...
[ "numpy.sum", "numpy.asarray", "numpy.argsort", "numpy.mean", "numpy.take", "numpy.round", "numpy.unique" ]
[((1961, 1978), 'numpy.unique', 'np.unique', (['y_true'], {}), '(y_true)\n', (1970, 1978), True, 'import numpy as np\n'), ((2116, 2143), 'numpy.sum', 'np.sum', (['(y_true == pos_label)'], {}), '(y_true == pos_label)\n', (2122, 2143), True, 'import numpy as np\n'), ((3250, 3276), 'numpy.take', 'np.take', (['y_true', 'or...
# Copyright 2017-2021 Reveal Energy Services, 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 applicab...
[ "hamcrest.has_length", "numpy.testing.assert_allclose", "toolz.curried.map" ]
[((4279, 4379), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['context.easting_array[sample_indices]', 'expected_eastings'], {'rtol': '(0.001)'}), '(context.easting_array[sample_indices],\n expected_eastings, rtol=0.001)\n', (4305, 4379), True, 'import numpy as np\n'), ((4380, 4482), 'numpy.testin...
import numpy as np from precise.skaters.location.empirical import emp_d0 def avg_factory(y, fs, s:dict, k=1, e=1, draw_probability=1.0, **f_kwargs): """ Average the predictions of several cov skaters fs list of cov skaters p Probability of using any given data point for any given skater ...
[ "numpy.shape", "precise.skaters.location.empirical.emp_d0", "numpy.random.rand", "numpy.ravel" ]
[((766, 796), 'precise.skaters.location.empirical.emp_d0', 'emp_d0', ([], {'y': 'x_mean', 's': 'avg_mean_s'}), '(y=x_mean, s=avg_mean_s)\n', (772, 796), False, 'from precise.skaters.location.empirical import emp_d0\n'), ((843, 858), 'numpy.shape', 'np.shape', (['x_cov'], {}), '(x_cov)\n', (851, 858), True, 'import nump...
import numpy as np import pandas as pd import math import shap import matplotlib import matplotlib.pyplot as plt from textwrap import wrap from risk_calculator.languages.english import English from risk_calculator.languages.german import German from risk_calculator.languages.italian import Italian from risk_calculator...
[ "risk_calculator.languages.english.English", "matplotlib.pyplot.axis", "numpy.isnan", "numpy.around", "matplotlib.use", "risk_calculator.languages.spanish.Spanish", "risk_calculator.languages.italian.Italian", "risk_calculator.languages.german.German" ]
[((497, 518), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (511, 518), False, 'import matplotlib\n'), ((364, 373), 'risk_calculator.languages.english.English', 'English', ([], {}), '()\n', (371, 373), False, 'from risk_calculator.languages.english import English\n'), ((375, 383), 'risk_calculat...
import numpy as np import pika import pickle import time import random from copy import deepcopy from multiprocessing import Process, Manager from pygamoo.utils import RpcClient, assigning_gens from pygamoo.utils import evaluate_call, get_not_dominated, front_suppression class AGAMOO: def __init__(self, nobjs, nv...
[ "pygamoo.utils.RpcClient", "pygamoo.utils.evaluate_call", "numpy.reshape", "pika.BasicProperties", "pickle.dumps", "pickle.loads", "copy.deepcopy", "pika.ConnectionParameters", "numpy.hstack", "time.sleep", "numpy.min", "pygamoo.utils.assigning_gens", "numpy.vstack", "pygamoo.utils.front_s...
[((2377, 2405), 'copy.deepcopy', 'deepcopy', (['self._shared_front'], {}), '(self._shared_front)\n', (2385, 2405), False, 'from copy import deepcopy\n'), ((3739, 3793), 'multiprocessing.Process', 'Process', ([], {'target': 'self._best_pull_consumer', 'args': '(self,)'}), '(target=self._best_pull_consumer, args=(self,))...
import numpy as np from afib import BaseRisk POAF_PTS = [1,2,3,1,1,1,1,1,1] def poaf(age, copd, egfr, emrgncy, pibp, lvef, vs): arr = np.array([60 <= age <= 69, 70 <= age <= 79, age >= 80, copd, egfr < 15, emrg...
[ "numpy.array" ]
[((141, 264), 'numpy.array', 'np.array', (['[60 <= age <= 69, 70 <= age <= 79, age >= 80, copd, egfr < 15, emrgncy,\n pibp, lvef < 30 / 100, vs]'], {'dtype': 'int'}), '([60 <= age <= 69, 70 <= age <= 79, age >= 80, copd, egfr < 15,\n emrgncy, pibp, lvef < 30 / 100, vs], dtype=int)\n', (149, 264), True, 'import nu...
from param import Param from grid import Grid from fluid2d import Fluid2d import numpy as np param = Param('default.xml') param.modelname = 'euler' param.expname = 'turb2d_forced_ss' # domain and resolution param.nx = 64*2 param.ny = param.nx param.Ly = param.Lx param.npx = 1 param.npy = 1 param.geometry = 'perio' #...
[ "numpy.meshgrid", "numpy.random.seed", "numpy.zeros_like", "grid.Grid", "numpy.zeros", "numpy.round", "numpy.array", "numpy.exp", "numpy.random.normal", "numpy.arange", "numpy.fft.ifft2", "fluid2d.Fluid2d", "numpy.sqrt", "param.Param" ]
[((102, 122), 'param.Param', 'Param', (['"""default.xml"""'], {}), "('default.xml')\n", (107, 122), False, 'from param import Param\n'), ((2755, 2766), 'grid.Grid', 'Grid', (['param'], {}), '(param)\n', (2759, 2766), False, 'from grid import Grid\n'), ((2801, 2821), 'fluid2d.Fluid2d', 'Fluid2d', (['param', 'grid'], {})...
import numpy as np from sklearn.base import check_array from cvxopt import solvers, matrix from adapt.base import BaseAdaptEstimator, make_insert_doc from adapt.metrics import linear_discrepancy from adapt.utils import set_random_seed @make_insert_doc() class LDM(BaseAdaptEstimator): """ LDM : Linear Discrep...
[ "numpy.stack", "adapt.metrics.linear_discrepancy", "cvxopt.matrix", "adapt.utils.set_random_seed", "numpy.zeros", "numpy.ones", "adapt.base.make_insert_doc", "cvxopt.solvers.conelp", "numpy.array", "numpy.eye", "sklearn.base.check_array", "numpy.concatenate" ]
[((239, 256), 'adapt.base.make_insert_doc', 'make_insert_doc', ([], {}), '()\n', (254, 256), False, 'from adapt.base import BaseAdaptEstimator, make_insert_doc\n'), ((2118, 2133), 'sklearn.base.check_array', 'check_array', (['Xs'], {}), '(Xs)\n', (2129, 2133), False, 'from sklearn.base import check_array\n'), ((2147, 2...
import argparse import numpy as np import os import copy import spglib from numpy.linalg import norm, solve from pymatgen.io.vasp.inputs import Poscar from ase.io import write, read from ase.utils import gcd, basestring from ase.build import bulk from pymatgen.core.structure import Structure from pymatgen.core.lattice ...
[ "os.remove", "ase.build.bulk", "numpy.asarray", "numpy.floor", "numpy.cross", "copy.copy", "pymatgen.core.structure.Structure", "numpy.array", "ase.io.read", "pymatgen.symmetry.analyzer.SpacegroupAnalyzer", "numpy.linalg.norm", "numpy.linalg.inv", "numpy.dot", "ase.utils.gcd", "pymatgen....
[((1088, 1107), 'numpy.asarray', 'np.asarray', (['indices'], {}), '(indices)\n', (1098, 1107), True, 'import numpy as np\n'), ((2693, 2715), 'numpy.floor', 'np.floor', (['(scaled + tol)'], {}), '(scaled + tol)\n', (2701, 2715), True, 'import numpy as np\n'), ((3703, 3736), 'pymatgen.symmetry.analyzer.SpacegroupAnalyzer...
#!/usr/bin/env python import os import argparse import yaml import sys from collections import defaultdict import logging import numpy as np import platform from phantom_analysis import dicom_util, scalar_analysis, voi_analysis, phantom_definitions WINDOWS = True if platform.system() == 'Windows' else False CLAMP = ...
[ "phantom_analysis.scalar_analysis.voi_stats", "argparse.ArgumentParser", "numpy.abs", "yaml.dump", "collections.defaultdict", "logging.Formatter", "phantom_analysis.scalar_analysis.calculate_adc", "numpy.mean", "yaml.safe_load", "os.path.join", "os.path.abspath", "os.path.exists", "yaml.add_...
[((1210, 1243), 'collections.defaultdict', 'defaultdict', (['(lambda : defaultdict)'], {}), '(lambda : defaultdict)\n', (1221, 1243), False, 'from collections import defaultdict\n'), ((6621, 6699), 'yaml.add_representer', 'yaml.add_representer', (['defaultdict', 'yaml.representer.Representer.represent_dict'], {}), '(de...
from util import extract_features, rgb, slide_window, draw_boxes, make_heatmap, get_hog_features, color_hist, bin_spatial import cv2 import matplotlib.pyplot as plt import numpy as np from scipy.ndimage.measurements import label as label_image from skimage.filters.rank import windowed_histogram import time class Detec...
[ "util.make_heatmap", "numpy.concatenate", "numpy.ravel", "scipy.ndimage.measurements.label", "numpy.ones", "time.clock", "numpy.min", "numpy.where", "numpy.max", "util.get_hog_features", "util.rgb", "matplotlib.pyplot.subplots", "cv2.resize" ]
[((892, 926), 'util.make_heatmap', 'make_heatmap', (['img.shape[0:2]', 'hits'], {}), '(img.shape[0:2], hits)\n', (904, 926), False, 'from util import extract_features, rgb, slide_window, draw_boxes, make_heatmap, get_hog_features, color_hist, bin_spatial\n'), ((1196, 1215), 'scipy.ndimage.measurements.label', 'label_im...
""" Define the Chow_liu Tree class """ # from __future__ import print_function import sys import os import glob from scipy.sparse import csr_matrix from scipy.sparse.csgraph import depth_first_order from scipy.sparse.csgraph import minimum_spanning_tree import numpy as np from Util import * ''' Class Chow-Liu Tre...
[ "numpy.sum", "numpy.log", "numpy.zeros", "numpy.ones", "numpy.all", "numpy.random.default_rng", "scipy.sparse.csr_matrix", "glob.glob", "sys.exit", "os.path.join", "scipy.sparse.csgraph.depth_first_order" ]
[((6104, 6142), 'os.path.join', 'os.path.join', (['folder_path', '"""*.ts.data"""'], {}), "(folder_path, '*.ts.data')\n", (6116, 6142), False, 'import os\n'), ((6164, 6192), 'glob.glob', 'glob.glob', (['data_path_pattern'], {}), '(data_path_pattern)\n', (6173, 6192), False, 'import glob\n'), ((1222, 1254), 'numpy.ones'...
import numpy from numpy.testing import assert_raises from fuel.datasets import CalTech101Silhouettes from tests import skip_if_not_available def test_caltech101_silhouettes16(): skip_if_not_available(datasets=['caltech101_silhouettes16.hdf5']) for which_set, size, num_examples in ( ('train', 16, ...
[ "numpy.testing.assert_raises", "tests.skip_if_not_available", "fuel.datasets.CalTech101Silhouettes" ]
[((185, 250), 'tests.skip_if_not_available', 'skip_if_not_available', ([], {'datasets': "['caltech101_silhouettes16.hdf5']"}), "(datasets=['caltech101_silhouettes16.hdf5'])\n", (206, 250), False, 'from tests import skip_if_not_available\n'), ((869, 947), 'numpy.testing.assert_raises', 'assert_raises', (['ValueError', '...
import math import numpy as np from random import randint, seed class Agent: """ The Agent class represents the agent in the Predator-Prey task. ... Attributes ---------- loc : [float] Location of the agent [x, y] feasted : bool Says whether the agent has caught the prey o...
[ "math.dist", "random.randint", "numpy.floor", "numpy.array", "numpy.linalg.norm", "random.seed" ]
[((1886, 1893), 'random.seed', 'seed', (['(1)'], {}), '(1)\n', (1890, 1893), False, 'from random import randint, seed\n'), ((4749, 4767), 'numpy.array', 'np.array', (['self.loc'], {}), '(self.loc)\n', (4757, 4767), True, 'import numpy as np\n'), ((4848, 4873), 'numpy.array', 'np.array', (['agent_perceived'], {}), '(age...
import lightkurve as lk from astropy.table import Table from lightkurve.correctors import download_tess_cbvs from lightkurve.correctors import CBVCorrector from lightkurve.correctors import DesignMatrix import numpy as np import glob import matplotlib.pyplot as plt def correccion_curva_de_luz(archivo): tpf = lk....
[ "lightkurve.correctors.download_tess_cbvs", "astropy.table.Table", "lightkurve.read", "lightkurve.correctors.CBVCorrector", "numpy.array", "numpy.arange", "glob.glob", "lightkurve.correctors.DesignMatrix" ]
[((2543, 2581), 'glob.glob', 'glob.glob', (['"""**/*.fits"""'], {'recursive': '(True)'}), "('**/*.fits', recursive=True)\n", (2552, 2581), False, 'import glob\n'), ((317, 333), 'lightkurve.read', 'lk.read', (['archivo'], {}), '(archivo)\n', (324, 333), True, 'import lightkurve as lk\n'), ((346, 1075), 'numpy.array', 'n...
from sklearn.base import BaseEstimator, ClassifierMixin import numpy as np from Node import Node class CartDecisionTreeClassifier(BaseEstimator, ClassifierMixin): """ A decision tree model for classification It currently only supports continuous features. It supports multi-class labels and assumes the la...
[ "numpy.array", "numpy.unique" ]
[((3620, 3652), 'numpy.unique', 'np.unique', (['y'], {'return_counts': '(True)'}), '(y, return_counts=True)\n', (3629, 3652), True, 'import numpy as np\n'), ((5341, 5360), 'numpy.unique', 'np.unique', (['X_values'], {}), '(X_values)\n', (5350, 5360), True, 'import numpy as np\n'), ((7470, 7507), 'numpy.unique', 'np.uni...
from Crypto.Cipher import AES from Crypto import Random import numpy as np import math def countByte(data): countedData = [0] * 256 for k in data: countedData[k] += 1 return countedData def calculateSecrecy(key, cipher): countedKey = countByte(key) countedCipher = countByte(cipher) ...
[ "numpy.log2", "numpy.fromstring", "Crypto.Random.new", "Crypto.Cipher.AES.new" ]
[((642, 654), 'Crypto.Cipher.AES.new', 'AES.new', (['key'], {}), '(key)\n', (649, 654), False, 'from Crypto.Cipher import AES\n'), ((967, 1007), 'numpy.fromstring', 'np.fromstring', (['ciphertxt'], {'dtype': 'np.uint8'}), '(ciphertxt, dtype=np.uint8)\n', (980, 1007), True, 'import numpy as np\n'), ((1026, 1060), 'numpy...
""" Paper: Session-based Recommendations with Recurrent Neural Networks Author: <NAME>, <NAME>, <NAME>, and <NAME> Reference: https://github.com/hidasib/GRU4Rec https://github.com/Songweiping/GRU4Rec_TensorFlow @author: <NAME> """ import numpy as np from model.AbstractRecommender import SeqAbstractRecommend...
[ "numpy.sum", "numpy.maximum", "tensorflow.reshape", "util.l2_loss", "numpy.ones", "tensorflow.nn.rnn_cell.DropoutWrapper", "tensorflow.matmul", "numpy.argsort", "tensorflow.Variable", "numpy.arange", "numpy.unique", "tensorflow.gather", "tensorflow.matrix_diag_part", "numpy.cumsum", "ten...
[((1877, 1927), 'numpy.unique', 'np.unique', (['self.data_uit[:, 1]'], {'return_counts': '(True)'}), '(self.data_uit[:, 1], return_counts=True)\n', (1886, 1927), True, 'import numpy as np\n'), ((1949, 1963), 'numpy.cumsum', 'np.cumsum', (['pop'], {}), '(pop)\n', (1958, 1963), True, 'import numpy as np\n'), ((2272, 2306...
import numpy as np import cv2 from pathlib import Path class MappingPoints: def __init__(self, settings_map): if settings_map.get('interceptor'): settings_map['frame_points'] = (np.array(settings_map['frame_points']) - np.array(settings_map['intercep...
[ "numpy.divide", "cv2.waitKey", "numpy.float32", "cv2.imshow", "numpy.ones", "cv2.addWeighted", "cv2.VideoCapture", "cv2.imread", "numpy.array", "numpy.int32", "cv2.destroyAllWindows", "numpy.concatenate" ]
[((3612, 3647), 'cv2.imshow', 'cv2.imshow', (['"""Image"""', 'frame_with_map'], {}), "('Image', frame_with_map)\n", (3622, 3647), False, 'import cv2\n'), ((3652, 3666), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (3663, 3666), False, 'import cv2\n'), ((3671, 3694), 'cv2.destroyAllWindows', 'cv2.destroyAllWind...
import os from datetime import datetime import numpy as np import scipy.io as sio import re from decimal import Decimal import pathlib import datajoint as dj from pipeline import (reference, subject, acquisition, stimulation, analysis, virus, intracellular, behavior, utilities) # =============...
[ "pipeline.stimulation.PhotoStimulation.proj", "pipeline.subject.AlleleAlias.fetch", "pipeline.stimulation.PhotoStimulationProtocol.insert1", "pipeline.reference.WholeCellDevice.insert1", "pipeline.utilities.parse_date", "pipeline.acquisition.Session.insert1", "pipeline.acquisition.Session.proj", "pipe...
[((447, 481), 'os.path.join', 'os.path.join', (['data_dir', '"""metadata"""'], {}), "(data_dir, 'metadata')\n", (459, 481), False, 'import os\n'), ((498, 533), 'os.path.join', 'os.path.join', (['data_dir', '"""datafiles"""'], {}), "(data_dir, 'datafiles')\n", (510, 533), False, 'import os\n'), ((604, 629), 'os.listdir'...
import numpy as np import sys import warnings from timer import Timer from scon import scon from custom_parser import parse_argv from tensors.ndarray_svd import svd, eig from tensors.tensorcommon import TensorCommon from tensors.tensor import Tensor from tensors.symmetrytensors import TensorZ2, TensorU1, TensorZ3 """ ...
[ "numpy.trace", "numpy.abs", "numpy.sum", "numpy.allclose", "numpy.argsort", "numpy.random.randint", "numpy.diag", "timer.Timer", "warnings.simplefilter", "numpy.transpose", "numpy.max", "custom_parser.parse_argv", "tensors.ndarray_svd.svd", "numpy.random.shuffle", "tensors.ndarray_svd.ei...
[((429, 472), 'warnings.simplefilter', 'warnings.simplefilter', (['"""error"""', 'UserWarning'], {}), "('error', UserWarning)\n", (450, 472), False, 'import warnings\n'), ((481, 1195), 'custom_parser.parse_argv', 'parse_argv', (['sys.argv', "('test_to_and_from_ndarray', 'bool', True)", "('test_arithmetic_and_comparison...