code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python r""" Interface for viewing images with the ds9 image viewer. Loosely based on XPA, by <NAME>. Before trying to use this, please read Requirements below. Here is a basic summary for use: import opscore.RO.DS9 import numpy ds9Win = opscore.RO.DS9.DS9Win() # show a FITS file in fra...
[ "subprocess.Popen", "os.environ.setdefault", "os.path.join", "numpy.asarray", "time.time", "os.environ.get", "time.sleep", "subprocess.Popen.__init__", "numpy.arange", "warnings.warn", "os.path.expanduser", "sys.exit" ]
[((9406, 9432), 'os.environ.get', 'os.environ.get', (['"""PATH"""', '""""""'], {}), "('PATH', '')\n", (9420, 9432), False, 'import os\n'), ((10949, 11079), 'subprocess.Popen', 'subprocess.Popen', ([], {'args': "('which', appName)", 'shell': '(False)', 'stdin': 'subprocess.PIPE', 'stdout': 'subprocess.PIPE', 'stderr': '...
from __future__ import division # -*- coding: utf-8 -*- ''' Created on 18 Sep, 2014 PyMatrix implementation based on pure python oop charisma Description: @author : <NAME> / YI, Research Associate @ NTU @emial: <EMAIL>, Nanyang Technologcial University @licence: licence ''' __all__ = ["matrixArrayList", "matrixArr...
[ "numpy.array.append", "copy.deepcopy", "traceback.print_exc", "copy.copy", "math.floor", "time.time", "random.randrange", "numpy.array", "functools.reduce" ]
[((587, 593), 'time.time', 'Time', ([], {}), '()\n', (591, 593), True, 'from time import time as Time\n'), ((6803, 6810), 'copy.copy', 'copy', (['l'], {}), '(l)\n', (6807, 6810), False, 'from copy import copy, deepcopy\n'), ((7404, 7411), 'copy.copy', 'copy', (['l'], {}), '(l)\n', (7408, 7411), False, 'from copy import...
""" Modification History: Last modification date: December 15, 2020 Last modification time: 11:00PM Description: Create a function that will stretch or compress audio from a wav file to a specified duration, while preserving the pitch of the original audio. Current inputs: ...
[ "numpy.size", "soundfile.read", "pytsmod.phase_vocoder", "pytsmod.ola", "numpy.isnan", "scipy.io.wavfile.write", "pytsmod.wsola" ]
[((1311, 1328), 'soundfile.read', 'sf.read', (['wav_file'], {}), '(wav_file)\n', (1318, 1328), True, 'import soundfile as sf\n'), ((1370, 1391), 'numpy.isnan', 'np.isnan', (['sample_rate'], {}), '(sample_rate)\n', (1378, 1391), True, 'import numpy as np\n'), ((1450, 1471), 'numpy.size', 'np.size', (['data'], {'axis': '...
# MIT License # # Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020 # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the # r...
[ "numpy.abs", "tensorflow.compat.v1.disable_eager_execution", "lingvo.model_imports.ImportParams", "os.path.isfile", "os.path.join", "tensorflow.compat.v1.global_variables_initializer", "sys.path.append", "lingvo.core.cluster_factory.Cluster", "pkg_resources.get_distribution", "tensorflow.compat.v1...
[((1991, 2018), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2008, 2018), False, 'import logging\n'), ((3512, 3556), 'os.path.join', 'os.path.join', (['config.ART_DATA_PATH', '"""lingvo"""'], {}), "(config.ART_DATA_PATH, 'lingvo')\n", (3524, 3556), False, 'import os\n'), ((7706, 7735),...
#!/usr/bin/env python __author__ = "<NAME>" __copyright__ = "Copyright (c) 2019, Insect Robotics Group," \ "Institude of Perception, Action and Behaviour," \ "School of Informatics, the University of Edinburgh" __credits__ = ["<NAME>"] __license__ = "MIT" __version__ = "1.0.1" __maintai...
[ "numpy.absolute", "numpy.conj", "numpy.fft.fft", "numpy.sin", "numpy.array", "numpy.linspace", "numpy.cos", "numpy.concatenate" ]
[((651, 669), 'numpy.absolute', 'np.absolute', (['theta'], {}), '(theta)\n', (662, 669), True, 'import numpy as np\n'), ((682, 731), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', 'length'], {'endpoint': '(False)'}), '(0, 2 * np.pi, length, endpoint=False)\n', (693, 731), True, 'import numpy as np\n'), ((936,...
# Copyright (c) 2020, NVIDIA CORPORATION. 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 ...
[ "os.makedirs", "argparse.ArgumentParser", "os.path.getsize", "os.path.exists", "numpy.array", "os.path.join" ]
[((3365, 3390), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3388, 3390), False, 'import argparse\n'), ((825, 849), 'os.path.exists', 'os.path.exists', (['dest_dir'], {}), '(dest_dir)\n', (839, 849), False, 'import os\n'), ((859, 880), 'os.makedirs', 'os.makedirs', (['dest_dir'], {}), '(dest...
# ******NOTICE*************** # optimize.py module by <NAME> # # You may copy and use this module as you see fit with no # guarantee implied provided you keep this notice in all copies. # *****END NOTICE************ from __future__ import absolute_import, division, print_function import numpy from numpy import asfar...
[ "numpy.abs", "numpy.add.reduce", "numpy.asfarray", "numpy.zeros", "numpy.argsort", "numpy.min", "numpy.take", "scipy.optimize.optimize.OptimizeResult", "scipy.optimize.optimize.wrap_function", "numpy.array" ]
[((1310, 1335), 'scipy.optimize.optimize.wrap_function', 'wrap_function', (['func', 'args'], {}), '(func, args)\n', (1323, 1335), False, 'from scipy.optimize.optimize import OptimizeResult, _status_message, wrap_function\n'), ((1584, 1623), 'numpy.zeros', 'numpy.zeros', (['(N + 1, N)'], {'dtype': 'x0.dtype'}), '((N + 1...
# coding: utf-8 """ Utilities for fitting orbits to stream data. """ # Third-party import astropy.coordinates as coord import astropy.units as u import numpy as np from scipy.interpolate import InterpolatedUnivariateSpline from scipy.stats import norm from gala.units import galactic # Project from . import galactoce...
[ "numpy.sum", "scipy.interpolate.InterpolatedUnivariateSpline", "numpy.abs", "numpy.log", "scipy.stats.norm.logpdf", "numpy.isfinite", "numpy.argsort", "numpy.cos" ]
[((3006, 3050), 'scipy.stats.norm.logpdf', 'norm.logpdf', (['phi2'], {'loc': '(0.0)', 'scale': 'phi2_sigma'}), '(phi2, loc=0.0, scale=phi2_sigma)\n', (3017, 3050), False, 'from scipy.stats import norm\n'), ((4080, 4099), 'numpy.sum', 'np.sum', (['(w0[3:] ** 2)'], {}), '(w0[3:] ** 2)\n', (4086, 4099), True, 'import nump...
""" Hyperparameters for MJC door opening trajectory optimization. """ from __future__ import division from datetime import datetime import os.path import numpy as np from gps import __file__ as gps_filepath from gps.agent.mjc.agent_mjc import AgentMuJoCo from gps.algorithm.algorithm_mdgps_pilqr import AlgorithmMDGPSP...
[ "numpy.zeros", "gps.gui.config.generate_experiment_info", "numpy.array", "datetime.datetime.now" ]
[((1387, 1437), 'numpy.array', 'np.array', (['[3.09, 1.08, 0.393, 0.674, 0.152, 0.098]'], {}), '([3.09, 1.08, 0.393, 0.674, 0.152, 0.098])\n', (1395, 1437), True, 'import numpy as np\n'), ((3626, 3647), 'numpy.zeros', 'np.zeros', (['(2, 44, 44)'], {}), '((2, 44, 44))\n', (3634, 3647), True, 'import numpy as np\n'), ((5...
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import validation_curve from sklearn.model_selection import train_test_split from sklearn.pipeline import make_pipeline from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import StandardScaler from...
[ "matplotlib.pyplot.xscale", "sklearn.model_selection.validation_curve", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "pandas.read_csv", "sklearn.model_selection.train_test_split", "numpy.std"...
[((374, 411), 'pandas.read_csv', 'pd.read_csv', (['"""wdbc.data"""'], {'header': 'None'}), "('wdbc.data', header=None)\n", (385, 411), True, 'import pandas as pd\n'), ((467, 481), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (479, 481), False, 'from sklearn.preprocessing import LabelEncoder\n...
import os from pathlib import Path import numpy as np from arvet.util.test_helpers import ExtendedTestCase import arvet.util.image_utils as image_utils _test_dir = 'temp-test_image_utils' # An RGB image in array and PNG form, to test image reading _demo_image_rgb = np.array([ [[255 * r, 255 * g, 127.5 * (2 - r -...
[ "os.remove", "arvet.util.image_utils.convert_to_grey", "os.removedirs", "arvet.util.image_utils.to_uint_image", "pathlib.Path", "numpy.mean", "numpy.arange", "os.path.join", "arvet.util.image_utils.resize", "arvet.util.image_utils.read_colour", "numpy.max", "numpy.min", "arvet.util.image_uti...
[((2434, 2479), 'os.path.join', 'os.path.join', (['_test_dir', '"""demo_image_rgb.png"""'], {}), "(_test_dir, 'demo_image_rgb.png')\n", (2446, 2479), False, 'import os\n'), ((2624, 2671), 'os.path.join', 'os.path.join', (['_test_dir', '"""demo_image_depth.png"""'], {}), "(_test_dir, 'demo_image_depth.png')\n", (2636, 2...
import datetime import calendar import os import time import json import numpy as np import osgeo.ogr as ogr import osgeo.osr as osr """ High level description of how this is used. It's easy to think of this as a preprocessing pipeline. In fact, that's exactly what this is. To begin reading the the daily station dat...
[ "numpy.nansum", "osgeo.ogr.CreateGeometryFromWkt", "osgeo.ogr.GetDriverByName", "datetime.date", "json.dumps", "time.time", "osgeo.ogr.FieldDefn", "numpy.isnan", "calendar.monthrange", "os.path.join", "osgeo.osr.SpatialReference" ]
[((25752, 25763), 'time.time', 'time.time', ([], {}), '()\n', (25761, 25763), False, 'import time\n'), ((32586, 32605), 'json.dumps', 'json.dumps', (['outdata'], {}), '(outdata)\n', (32596, 32605), False, 'import json\n'), ((32810, 32847), 'osgeo.ogr.GetDriverByName', 'ogr.GetDriverByName', (['"""ESRI Shapefile"""'], {...
import numpy as np import torch from DREAM_and_DeepCFR.workers.la.sampling_algorithms._SamplerBase import SamplerBase from PokerRL import Poker, StandardLeduc from PokerRL.rl import rl_util CANCEL_BOARD = False CALL_AND_RAISE_ZERO = False class VR_OS_Sampler(SamplerBase): """ How to get to next state: ...
[ "numpy.argmax", "numpy.arange", "torch.zeros", "PokerRL.rl.rl_util.get_legal_action_mask_torch", "torch.tensor" ]
[((1506, 1541), 'numpy.arange', 'np.arange', (['self._env_bldr.N_ACTIONS'], {}), '(self._env_bldr.N_ACTIONS)\n', (1515, 1541), True, 'import numpy as np\n'), ((2745, 2929), 'PokerRL.rl.rl_util.get_legal_action_mask_torch', 'rl_util.get_legal_action_mask_torch', ([], {'n_actions': 'self._env_bldr.N_ACTIONS', 'legal_acti...
"""[Plot]ting functions for feature visualization.""" import matplotlib.pyplot as plt import numpy as np def magresp(freq, resp, ax, units=('rad', 'db')): """Plot the magnitude response from complex frequency response. Parameters ---------- freq : array_like a vector representing the x-axis ...
[ "numpy.abs", "numpy.angle", "matplotlib.pyplot.colorbar", "numpy.max", "numpy.arange", "numpy.log10", "matplotlib.pyplot.subplots" ]
[((840, 852), 'numpy.abs', 'np.abs', (['resp'], {}), '(resp)\n', (846, 852), True, 'import numpy as np\n'), ((2756, 2770), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (2768, 2770), True, 'import matplotlib.pyplot as plt\n'), ((3594, 3617), 'numpy.arange', 'np.arange', (['sig.shape[0]'], {}), '(sig.s...
# region Import libraries import numpy as np import os # endregion class Dataset(object): def __init__(self, path): self.path = path self.instances = [] self.labels = [] def load_dataset(self): for root, _, files in os.walk(self.path): for filename in files: if filename.startswith("task_1"): do...
[ "os.walk", "numpy.array", "os.path.join" ]
[((229, 247), 'os.walk', 'os.walk', (['self.path'], {}), '(self.path)\n', (236, 247), False, 'import os\n'), ((713, 734), 'numpy.array', 'np.array', (['self.labels'], {}), '(self.labels)\n', (721, 734), True, 'import numpy as np\n'), ((324, 352), 'os.path.join', 'os.path.join', (['root', 'filename'], {}), '(root, filen...
# Copyright 2021 cstsunfu. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
[ "dlk.utils.logger.Logger.get_logger", "numpy.random.uniform", "dlk.utils.config.ConfigTool.get_config_by_stage", "tokenizers.Tokenizer.from_file", "dlk.data.subprocessors.subprocessor_config_register", "numpy.array", "dlk.data.subprocessors.subprocessor_register" ]
[((931, 950), 'dlk.utils.logger.Logger.get_logger', 'Logger.get_logger', ([], {}), '()\n', (948, 950), False, 'from dlk.utils.logger import Logger\n'), ((953, 1000), 'dlk.data.subprocessors.subprocessor_config_register', 'subprocessor_config_register', (['"""token_embedding"""'], {}), "('token_embedding')\n", (981, 100...
# License: Apache-2.0 from ._base_imputer import _BaseImputer from imputer import float_imputer_object from imputer import float_imputer from ..util import util import numpy as np from typing import List, Union import pandas as pd import databricks.koalas as ks import warnings class FloatImputer(_BaseImputer): ""...
[ "numpy.array", "warnings.warn", "imputer.float_imputer" ]
[((5598, 5656), 'imputer.float_imputer', 'float_imputer', (['X', 'self.statistics_values', 'self.idx_columns'], {}), '(X, self.statistics_values, self.idx_columns)\n', (5611, 5656), False, 'from imputer import float_imputer\n'), ((3809, 3973), 'warnings.warn', 'warnings.warn', (['"""`X` does not contain columns satisfy...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Various functions used for comparison method: Jeans analysis Created: October 2021 Author: <NAME> """ import numpy as np from scipy.stats import binned_statistic_2d as bin2d from emcee import EnsembleSampler as Sampler from constants import kpc, pi from utils import ...
[ "numpy.stack", "numpy.meshgrid", "numpy.abs", "numpy.sum", "numpy.ones_like", "numpy.tanh", "emcee.EnsembleSampler", "scipy.stats.binned_statistic_2d", "utils.load_dset", "numpy.random.default_rng", "numpy.sort", "numpy.append", "numpy.diff", "numpy.array", "numpy.exp", "numpy.cosh", ...
[((2219, 2266), 'numpy.sum', 'np.sum', (['((nu_data - nu_model) ** 2 / nu_err ** 2)'], {}), '((nu_data - nu_model) ** 2 / nu_err ** 2)\n', (2225, 2266), True, 'import numpy as np\n'), ((2277, 2333), 'numpy.sum', 'np.sum', (['((sig2z_data - sig2z_model) ** 2 / sig2z_err ** 2)'], {}), '((sig2z_data - sig2z_model) ** 2 / ...
#%% import os import sys os.chdir(os.path.dirname(os.getcwd())) # make directory one step up the current directory from pymaid_creds import url, name, password, token import pymaid rm = pymaid.CatmaidInstance(url, token, name, password) import numpy as np import pandas as pd import seaborn as sns import matplotlib.py...
[ "matplotlib.pyplot.figaspect", "pymaid.CatmaidInstance", "matplotlib.pyplot.savefig", "seaborn.heatmap", "pandas.read_csv", "pymaid.get_skids_by_annotation", "numpy.arange", "pymaid.add_annotations", "numpy.unique", "pandas.DataFrame", "matplotlib.colors.LinearSegmentedColormap.from_list", "se...
[((187, 237), 'pymaid.CatmaidInstance', 'pymaid.CatmaidInstance', (['url', 'token', 'name', 'password'], {}), '(url, token, name, password)\n', (209, 237), False, 'import pymaid\n'), ((772, 828), 'connectome_tools.process_matrix.Promat.pull_adj', 'pm.Promat.pull_adj', (['"""ad"""'], {'subgraph': '"""brain and accessory...
import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap import geopandas as gpd from sklearn.neighbors import BallTree from scipy.spatial.distance import pdist, squareform from scipy.optimize import curve_fit from .utils import geometry_to_2d try: import seaborn as sns s...
[ "numpy.mean", "scipy.spatial.distance.pdist", "numpy.fromiter", "matplotlib.colors.ListedColormap", "numpy.nanmean", "numpy.std", "geopandas.GeoDataFrame", "numpy.max", "matplotlib.pyplot.subplots", "seaborn.set_style", "numpy.fill_diagonal", "numpy.median", "scipy.spatial.distance.squarefor...
[((319, 345), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (332, 345), True, 'import seaborn as sns\n'), ((1178, 1191), 'numpy.asarray', 'np.asarray', (['x'], {}), '(x)\n', (1188, 1191), True, 'import numpy as np\n'), ((1215, 1225), 'scipy.spatial.distance.pdist', 'pdist', (['XYs'...
import json import logging import numpy as np from numpy.random import shuffle from collections import Counter from glob import glob from os import walk, mkdir from os.path import dirname, join, basename, isdir, isfile import sys from pymatgen.core.structure import Structure from pymatgen.io.vasp.outputs import Outca...
[ "numpy.load", "numpy.floor", "pymatgen.core.structure.Structure", "numpy.arange", "os.path.dirname", "numpy.max", "numpy.random.shuffle", "json.dump", "numpy.ceil", "numpy.hstack", "numpy.min", "numpy.random.permutation", "numpy.savez", "numpy.delete", "numpy.vstack", "logging.debug", ...
[((400, 420), 'os.path.dirname', 'dirname', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (407, 420), False, 'from os.path import dirname, join, basename, isdir, isfile\n'), ((451, 570), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'f"""{folder}/split_{name}.log"""', 'filemode': '"""w"""', 'level': 'logg...
import numpy as np import scipy.optimize as optimize from .. import sarimage class TSXImage(sarimage.SARImage): def __init__(self): self.img = None self.shape = None self.center_timestamp = None self.row_spacing = None self.col_spacing = None self.cal_factor = No...
[ "scipy.optimize.fmin", "numpy.ndarray" ]
[((1446, 1504), 'scipy.optimize.fmin', 'optimize.fmin', (['cost_function', 'x0y0'], {'xtol': '(1e-05)', 'disp': '(False)'}), '(cost_function, x0y0, xtol=1e-05, disp=False)\n', (1459, 1504), True, 'import scipy.optimize as optimize\n'), ((2441, 2493), 'numpy.ndarray', 'np.ndarray', ([], {'shape': '(size_y, size_x)', 'dt...
import pytest import numpy as np from numpy.testing import assert_almost_equal from acrolib.quaternion import Quaternion from acrolib.sampling import SampleMethod from acrolib.geometry import rotation_matrix_to_rpy from acrobotics.robot import Robot, IKResult from acrobotics.path.tolerance import ( Tolerance, ...
[ "acrobotics.path.tolerance.QuaternionTolerance", "acrobotics.path.tolerance.SymmetricTolerance", "numpy.testing.assert_almost_equal", "numpy.ones", "acrolib.geometry.rotation_matrix_to_rpy", "acrolib.quaternion.Quaternion.distance", "pytest.raises", "acrolib.quaternion.Quaternion", "numpy.array", ...
[((606, 616), 'numpy.ones', 'np.ones', (['(6)'], {}), '(6)\n', (613, 616), True, 'import numpy as np\n'), ((1191, 1254), 'numpy.testing.assert_almost_equal', 'assert_almost_equal', (['joint_solutions[0]', 'IK_RESULT.solutions[0]'], {}), '(joint_solutions[0], IK_RESULT.solutions[0])\n', (1210, 1254), False, 'from numpy....
import atexit import io import json import os import shutil from typing import Union, Optional import matplotlib import matplotlib.font_manager import numpy as np import torch from PIL import Image from matplotlib import pyplot as plt from matplotlib.figure import Figure from torchvision.transforms import transforms ...
[ "atexit.register", "PIL.Image.new", "matplotlib.pyplot.suptitle", "torch.cat", "json.dumps", "matplotlib.pyplot.figure", "shutil.copy", "torch.ones", "matplotlib.font_manager._rebuild", "os.path.exists", "numpy.transpose", "io.BytesIO", "utils.pytorch.ToTensorOrPass", "matplotlib.matplotli...
[((6058, 6121), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'figsize', 'dpi': '(300)', 'frameon': '(False)', 'clear': '(True)'}), '(figsize=figsize, dpi=300, frameon=False, clear=True)\n', (6068, 6121), True, 'from matplotlib import pyplot as plt\n'), ((6153, 6168), 'matplotlib.pyplot.axis', 'plt.axis', ...
# coding: utf-8 """ The ``pychemcurv.vis`` module implements the ``CurvatureViewer`` class in order to visualize a molecule or a periodic structure in a jupyter notebook and map a given properties on the atoms using a color scale. This class needs, `nglview <https://github.com/arose/nglview>`_ and uses ipywidgets i...
[ "nglview.show_pymatgen", "matplotlib.pyplot.show", "matplotlib.cm.get_cmap", "matplotlib.colors.Normalize", "ipywidgets.Output", "numpy.nanmin", "numpy.isnan", "ipywidgets.HBox", "numpy.array", "matplotlib.colorbar.ColorbarBase", "ipywidgets.VBox", "matplotlib.pyplot.subplots", "numpy.nanmax...
[((3495, 3527), 'nglview.show_pymatgen', 'nv.show_pymatgen', (['self.structure'], {}), '(self.structure)\n', (3511, 3527), True, 'import nglview as nv\n'), ((7031, 7067), 'matplotlib.colors.Normalize', 'mpl.colors.Normalize', (['minval', 'maxval'], {}), '(minval, maxval)\n', (7051, 7067), True, 'import matplotlib as mp...
import numpy as np def rectangle_activation(ps, AR): return (ps[:,0]>-1) * (ps[:,0]<1) * (ps[:,1]>-AR) * (ps[:,1]<AR) def moving_circle_activation(ps, x_center, R): return (np.linalg.norm(ps-x_center,axis=1)<R) def activation_fn_dispatcher(_config, t): if _config['activation_fn_type'] == 'const-rectan...
[ "numpy.linalg.norm" ]
[((183, 220), 'numpy.linalg.norm', 'np.linalg.norm', (['(ps - x_center)'], {'axis': '(1)'}), '(ps - x_center, axis=1)\n', (197, 220), True, 'import numpy as np\n')]
#!/usr/bin/python ######################################################################################################################## # # Copyright (c) 2014, Regents of the University of California # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permi...
[ "yaml.load", "imp.find_module", "os.path.exists", "laygo.GridLayoutGenerator", "numpy.array", "bag.BagProject", "numpy.vstack" ]
[((2729, 2745), 'numpy.array', 'np.array', (['[0, 0]'], {}), '([0, 0])\n', (2737, 2745), True, 'import numpy as np\n'), ((7839, 7855), 'numpy.array', 'np.array', (['[0, 0]'], {}), '([0, 0])\n', (7847, 7855), True, 'import numpy as np\n'), ((16131, 16147), 'numpy.array', 'np.array', (['[0, 0]'], {}), '([0, 0])\n', (1613...
from __future__ import division import gym import math import os import random import numpy as np import matplotlib # saving high quality figures matplotlib.use('agg') from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt np.seterr(divide='ignore', invalid='ignore') import torch import torch.nn as nn ...
[ "os.mkdir", "numpy.random.seed", "torch.eye", "numpy.argmax", "torch.autograd.grad", "numpy.random.randint", "torch.no_grad", "math.pow", "os.path.exists", "numpy.append", "torch.nn.Linear", "torch.zeros", "torch.ger", "torch.zeros_like", "torch.manual_seed", "config.GetParameters", ...
[((146, 167), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (160, 167), False, 'import matplotlib\n'), ((240, 284), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""'}), "(divide='ignore', invalid='ignore')\n", (249, 284), True, 'import numpy as np\n'), ((9403...
import argparse import os import sys import numpy as np import torch import torchvision.transforms as transforms from PIL import Image from networks.drn_seg import DRNSeg from utils.tools import * from utils.visualize import * #!python local_detector.py --input_path examples/modified.jpg --model_path weights/local.pth...
[ "argparse.ArgumentParser", "numpy.asarray", "torch.load", "numpy.transpose", "networks.drn_seg.DRNSeg", "PIL.Image.open", "torchvision.transforms.ToTensor", "torch.cuda.is_available", "PIL.Image.fromarray", "torchvision.transforms.Normalize", "torch.no_grad", "os.path.join", "sys.exit", "n...
[((381, 406), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (404, 406), False, 'import argparse\n'), ((1219, 1244), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1242, 1244), False, 'import torch\n'), ((1334, 1343), 'networks.drn_seg.DRNSeg', 'DRNSeg', (['(2)'], {}),...
#!/usr/bin/env python from __future__ import print_function from __future__ import division from __future__ import unicode_literals from __future__ import with_statement import argparse import logging import cv2 import numpy as np from scipy.ndimage import filters # import os # import sys # import platform __heade...
[ "cv2.GaussianBlur", "scipy.ndimage.filters.gaussian_filter", "argparse.ArgumentParser", "logging.basicConfig", "cv2.waitKey", "cv2.imwrite", "numpy.float32", "cv2.destroyAllWindows", "numpy.zeros", "cv2.addWeighted", "numpy.argsort", "cv2.imread", "cv2.warpAffine", "numpy.array", "cv2.ge...
[((1297, 1322), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1320, 1322), False, 'import argparse\n'), ((3070, 3098), 'numpy.argsort', 'np.argsort', (['candidate_values'], {}), '(candidate_values)\n', (3080, 3098), True, 'import numpy as np\n'), ((3168, 3192), 'numpy.zeros', 'np.zeros', (['h...
# # Author: <NAME> <<EMAIL>> # import unittest import tempfile import numpy import scipy.linalg import h5py from pyscf import lib from pyscf import gto from pyscf import scf from pyscf import ao2mo from pyscf import df mol = gto.Mole() mol.build( verbose = 0, atom = '''O 0 0. 0. 1 ...
[ "numpy.random.seed", "numpy.empty", "numpy.allclose", "pyscf.ao2mo.kernel", "numpy.einsum", "unittest.main", "pyscf.df.DF", "pyscf.df.incore.aux_e2", "pyscf.df.incore.fill_2c2e", "numpy.empty_like", "pyscf.gto.conc_env", "pyscf.gto.M", "pyscf.gto.moleintor.getints_by_shell", "pyscf.df.addo...
[((227, 237), 'pyscf.gto.Mole', 'gto.Mole', ([], {}), '()\n', (235, 237), False, 'from pyscf import gto\n'), ((422, 459), 'pyscf.df.addons.make_auxmol', 'df.addons.make_auxmol', (['mol', '"""weigend"""'], {}), "(mol, 'weigend')\n", (443, 459), False, 'from pyscf import df\n'), ((476, 562), 'pyscf.gto.conc_env', 'gto.co...
# coding=utf-8 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
[ "libml.utils.EasyDict", "libml.utils.model_vars", "numpy.argpartition", "libml.utils.get_low_confidence_from_each_clusters", "libml.utils.idx_to_fixlen", "shutil.rmtree", "numpy.prod", "numpy.std", "tensorflow.train.get_or_create_global_step", "libml.utils.get_config", "libml.data.batch", "num...
[((912, 1001), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""train_dir"""', '"""./MMA_exp/"""', '"""Folder where to save training data."""'], {}), "('train_dir', './MMA_exp/',\n 'Folder where to save training data.')\n", (931, 1001), False, 'from absl import flags\n'), ((1018, 1068), 'absl.flags.DEFINE_fl...
import numpy as np import pandas as pd import re import random from gensim.models import LdaMulticore, TfidfModel, CoherenceModel from gensim.models import LdaModel from gensim.corpora import Dictionary from sklearn.metrics import jaccard_score import warnings warnings.filterwarnings("ignore") warnings.filterwarnings(...
[ "numpy.random.dirichlet", "numpy.random.uniform", "warnings.filterwarnings", "random.uniform", "numpy.empty", "gensim.models.TfidfModel", "numpy.ones", "gensim.corpora.Dictionary", "gensim.models.LdaModel", "numpy.mean", "numpy.array", "numpy.random.normal", "numpy.random.choice", "gensim....
[((262, 295), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (285, 295), False, 'import warnings\n'), ((296, 353), 'warnings.filterwarnings', 'warnings.filterwarnings', ([], {'action': '"""ignore"""', 'module': '"""gensim"""'}), "(action='ignore', module='gensim')\n", (319...
# -*- coding: utf-8 -*- import numpy as np from base_validation_case import BaseValidationCase class SetupValidationCase07(BaseValidationCase): def __init__(self, times_per_hour=60, total_days=60): super().__init__(times_per_hour, total_days) def get_building_parameters(self): return { ...
[ "numpy.zeros" ]
[((1258, 1293), 'numpy.zeros', 'np.zeros', (['(self.total_timesteps, 3)'], {}), '((self.total_timesteps, 3))\n', (1266, 1293), True, 'import numpy as np\n'), ((567, 578), 'numpy.zeros', 'np.zeros', (['(1)'], {}), '(1)\n', (575, 578), True, 'import numpy as np\n')]
################################################ # This is a wrapper suing the executable files of SRILM toolkits ############################################### import os import sys import numpy as np import glob from base import * # exact the vocabulary form the corpus def GetVocab(fname, v, unk='<UNK>'): f =...
[ "os.popen", "os.system", "numpy.exp", "os.path.split", "os.path.join" ]
[((3481, 3506), 'os.path.join', 'os.path.join', (['workdir', '""""""'], {}), "(workdir, '')\n", (3493, 3506), False, 'import os\n'), ((3529, 3553), 'os.path.join', 'os.path.join', (['bindir', '""""""'], {}), "(bindir, '')\n", (3541, 3553), False, 'import os\n'), ((10773, 10787), 'os.system', 'os.system', (['cmd'], {}),...
#import some libraries from cycler import cycler import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 2 * np.pi) offsets = np.linspace(0, 2*np.pi, 4, endpoint=False) # Create array with shifted-sine curve along each column yy = np.transpose([np.sin(x + phi) for phi in offsets]) plt.rc('lines', linewi...
[ "cycler.cycler", "numpy.sin", "matplotlib.pyplot.rc", "numpy.linspace", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ]
[((105, 130), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)'], {}), '(0, 2 * np.pi)\n', (116, 130), True, 'import numpy as np\n'), ((141, 185), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(4)'], {'endpoint': '(False)'}), '(0, 2 * np.pi, 4, endpoint=False)\n', (152, 185), True, 'import numpy as np...
##### # reshape the shapes of weights to flat form due to easy to handle # for other algorithms, such as evolutionary algorithmes. # # This code is based on the TF2.4 # # 20201022 markliou ##### import tensorflow as tf import numpy as np def cnn(): Input = tf.keras.Input([28, 28, 1]) conv1 = tf.keras.laye...
[ "numpy.ones_like", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.Dense", "numpy.random.randn", "tensorflow.keras.Input", "tensorflow.reshape", "numpy.ones", "tensorflow.keras.Model", "tensorflow.keras.layers.Flatten" ]
[((267, 294), 'tensorflow.keras.Input', 'tf.keras.Input', (['[28, 28, 1]'], {}), '([28, 28, 1])\n', (281, 294), True, 'import tensorflow as tf\n'), ((950, 991), 'tensorflow.keras.Model', 'tf.keras.Model', ([], {'inputs': 'Input', 'outputs': 'out'}), '(inputs=Input, outputs=out)\n', (964, 991), True, 'import tensorflow ...
import os import random import copy import codecs import spacy from os.path import join as pjoin import numpy as np import torch import torch.nn.functional as F from textworld import EnvInfos import dqn_memory_priortized_replay_buffer from model import KG_Manipulation from generic import to_np, to_pt, _words_to_ids, ...
[ "generic.update_graph_triplets", "numpy.random.seed", "generic.LinearSchedule", "torch.relu", "numpy.argmax", "generic._word_to_id", "torch.argmax", "numpy.sum", "generic.ez_gather_dim_1", "torch.cat", "generic.pad_sequences", "torch.no_grad", "generic.gen_graph_commands", "generic.generat...
[((853, 985), 'model.KG_Manipulation', 'KG_Manipulation', ([], {'config': 'self.config', 'word_vocab': 'self.word_vocab', 'node_vocab': 'self.node_vocab', 'relation_vocab': 'self.relation_vocab'}), '(config=self.config, word_vocab=self.word_vocab, node_vocab=\n self.node_vocab, relation_vocab=self.relation_vocab)\n'...
import matplotlib.pyplot as plt import torch import pickle import numpy as np with open('loss_list', 'rb') as f: loss_list = pickle.load(f) test_loss = [] training_loss = [] for i in range(len(loss_list)): training_loss.append(loss_list[i][1]) test_loss.append(loss_list[i][2]) plt...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.argmin", "numpy.min", "pickle.load", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((317, 363), 'matplotlib.pyplot.plot', 'plt.plot', (['training_loss'], {'label': '"""Training loss"""'}), "(training_loss, label='Training loss')\n", (325, 363), True, 'import matplotlib.pyplot as plt\n'), ((367, 419), 'matplotlib.pyplot.plot', 'plt.plot', (['test_loss'], {'label': '"""Validation loss (3px %)"""'}), "...
import numpy as np from utils.config import Config from math import sqrt as sqrt from itertools import product as product import matplotlib.pyplot as plt mean = [] for k, f in enumerate(Config["feature_maps"]): x,y = np.meshgrid(np.arange(f),np.arange(f)) x = x.reshape(-1) y = y.reshape(-1) ...
[ "matplotlib.pyplot.xlim", "numpy.meshgrid", "numpy.zeros_like", "matplotlib.pyplot.show", "math.sqrt", "matplotlib.pyplot.ylim", "matplotlib.pyplot.scatter", "numpy.clip", "matplotlib.pyplot.Rectangle", "numpy.shape", "matplotlib.pyplot.figure", "numpy.arange", "numpy.reshape", "numpy.lins...
[((957, 976), 'numpy.clip', 'np.clip', (['mean', '(0)', '(1)'], {}), '(mean, 0, 1)\n', (964, 976), True, 'import numpy as np\n'), ((1035, 1150), 'numpy.linspace', 'np.linspace', (["(0.5 * Config['steps'][4])", "(Config['min_dim'] - 0.5 * Config['steps'][4])", "Config['feature_maps'][4]"], {}), "(0.5 * Config['steps'][4...
import pandas as pd import numpy as np import math df = pd.read_csv('temperature.csv',delimiter=";",decimal=",") data = pd.read_csv('temperature2.csv') df = df[df['DateTime'].notna()] df = df.reset_index(drop=True) df= df.drop('DateTime', axis = 1) hours=[12.25-(abs(12.25-((i)%24)))/12.25 for i in range...
[ "pandas.read_csv", "keras.callbacks.ModelCheckpoint", "math.radians", "keras.layers.Dense", "numpy.array", "keras.models.Sequential" ]
[((61, 119), 'pandas.read_csv', 'pd.read_csv', (['"""temperature.csv"""'], {'delimiter': '""";"""', 'decimal': '""","""'}), "('temperature.csv', delimiter=';', decimal=',')\n", (72, 119), True, 'import pandas as pd\n'), ((126, 157), 'pandas.read_csv', 'pd.read_csv', (['"""temperature2.csv"""'], {}), "('temperature2.csv...
"""Implementation of neural style transfer. The style of the reference image is imposed onto the target image. This is the original implementation of neural style transfer proposed by <NAME> et al. 2015. It is preferable to run this script on GPU, for speed. Parts of this implementation are adapted from Google's Cola...
[ "tensorflow.clip_by_value", "tensorflow.reshape", "click.option", "numpy.clip", "tensorflow.matmul", "tensorflow.Variable", "skimage.transform.resize", "skimage.color.rgb2yiq", "click.Path", "click.command", "tensorflow.cast", "skimage.io.imsave", "skimage.io.imread", "numpy.repeat", "te...
[((996, 1032), 'numpy.array', 'np.array', (['[103.939, 116.779, 123.68]'], {}), '([103.939, 116.779, 123.68])\n', (1004, 1032), True, 'import numpy as np\n'), ((9245, 9260), 'click.command', 'click.command', ([], {}), '()\n', (9258, 9260), False, 'import click\n'), ((9542, 9687), 'click.option', 'click.option', (['"""-...
import json import numpy as np import os import pickle SCAN2CAD_DIR = "/home/kejie/ext_disk/datasets/Scan2CAD" CARE_CLASSES = { "03211117": "display", "04379243": "table", "02808440": "bathtub", "02747177": "trashbin", "04256520": "sofa", "03001627": "chair", "02933112": "cabinet", "0...
[ "pickle.dump", "json.load", "numpy.asarray", "numpy.mean", "numpy.cov", "os.path.join" ]
[((505, 517), 'json.load', 'json.load', (['f'], {}), '(f)\n', (514, 517), False, 'import json\n'), ((933, 963), 'numpy.asarray', 'np.asarray', (['sizes_per_class[k]'], {}), '(sizes_per_class[k])\n', (943, 963), True, 'import numpy as np\n'), ((1043, 1065), 'numpy.mean', 'np.mean', (['sizes'], {'axis': '(0)'}), '(sizes,...
"""This file contains methods for importing Bio-Logic mpr-type files""" # This is based on the work by <NAME> # (https://github.com/chatcannon/galvani/blob/master/galvani/BioLogic.py) import os import tempfile import shutil import logging import warnings import time from collections import OrderedDict import datetime i...
[ "os.remove", "cellpy.readers.instruments.biologic_file_format.bl_flags.keys", "os.path.isfile", "cellpy.readers.core.humanize_bytes", "numpy.arange", "shutil.rmtree", "os.path.join", "pandas.DataFrame", "cellpy.readers.core.Cell", "cellpy.log.setup_logging", "tempfile.mkdtemp", "datetime.timed...
[((748, 788), 'datetime.datetime', 'datetime.datetime', (['(1899)', '(12)', '(30)', '(0)', '(0)', '(0)'], {}), '(1899, 12, 30, 0, 0, 0)\n', (765, 788), False, 'import datetime\n'), ((1675, 1725), 'numpy.fromstring', 'np.fromstring', (['hdr_bytes'], {'dtype': 'hdr_dtype', 'count': '(1)'}), '(hdr_bytes, dtype=hdr_dtype, ...
import torch import numpy as np from log_utils import * class DataLoader(object): def __init__(self, data, args): ''' dataset.shape = [num , 3, image_number] dataset[0 , 1, :] # all data from task 0 dataset[0 , 2, :] # all label from task 0 ''' self.dataset = dat...
[ "torch.save", "numpy.sqrt", "torch.cat", "torch.LongTensor" ]
[((2943, 2973), 'torch.save', 'torch.save', (['self.dataset', 'path'], {}), '(self.dataset, path)\n', (2953, 2973), False, 'import torch\n'), ((3734, 3802), 'torch.cat', 'torch.cat', (['([self.dataset[self.current_task][1]] * increase_factor)', '(0)'], {}), '([self.dataset[self.current_task][1]] * increase_factor, 0)\n...
""" Quick plot of the dam break outputs """ import numpy from numpy import zeros import anuga.utilities.plot_utils as util import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as pyplot from math import sqrt, pi, cos, sin from analytical_parabolic_basin import analytic_cannal # Get the sww file p...
[ "matplotlib.pyplot.title", "anuga.utilities.plot_utils.get_output", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "analytical_parabolic_basin.analytic_cannal", "anuga.utilities.plot_utils.get_centroids", "matplotlib.pyplot.legend", "matplotlib.use", "numpy.sin", "numpy.cos", "matplotlib.pyp...
[((146, 167), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (160, 167), False, 'import matplotlib\n'), ((326, 357), 'anuga.utilities.plot_utils.get_output', 'util.get_output', (['"""parabola.sww"""'], {}), "('parabola.sww')\n", (341, 357), True, 'import anuga.utilities.plot_utils as util\n'), ((...
import numpy as np import matplotlib.pyplot as plt from scipy.spatial import Voronoi, voronoi_plot_2d def apothem(s, n): """Finds apothem (distance from polygon center to side midpoint) for n-gon with side length s.""" return s*0.5/np.tan(np.pi/n) def radius(s, n): """Finds radius (distance from polygon ...
[ "scipy.spatial.voronoi_plot_2d", "matplotlib.pyplot.show", "numpy.zeros", "scipy.spatial.Voronoi", "matplotlib.pyplot.figure", "numpy.tan", "numpy.array", "numpy.arange", "numpy.sin", "numpy.cos", "numpy.concatenate", "numpy.sqrt" ]
[((442, 529), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2]]'], {}), '([[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [\n 2, 2]])\n', (450, 529), True, 'import numpy as np\n'), ((719, 734), 'numpy.arange', 'np.arange', (['size'], {}), '(size)\...
# Copyright (c) SenseTime. All Rights Reserved. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import torch import random import torch.nn.functional as F import visdom from pysot.core.config import...
[ "numpy.maximum", "numpy.abs", "numpy.sum", "numpy.argmax", "visdom.Visdom", "torch.cat", "numpy.clip", "numpy.linalg.norm", "numpy.exp", "matplotlib.pyplot.xlabel", "random.randint", "pysot.datasets.anchor_target.AnchorTarget", "numpy.transpose", "torch.sign", "torch.squeeze", "numpy.m...
[((1611, 1642), 'numpy.transpose', 'np.transpose', (['np_var', '(1, 2, 0)'], {}), '(np_var, (1, 2, 0))\n', (1623, 1642), True, 'import numpy as np\n'), ((2156, 2174), 'numpy.sqrt', 'np.sqrt', (['(w_z * h_z)'], {}), '(w_z * h_z)\n', (2163, 2174), True, 'import numpy as np\n'), ((12129, 12160), 'torch.clamp', 'torch.clam...
""" This file generates a toy vector potential for import into GAMER using the OPT__INIT_BFIELD_BYFILE parameter. It does the following: 1. Generates a uniform coordinate grid 2. Defines a vector potential on the coordinate grid 3. Saves the coordinate grid and the vector potential to an HDF5 file The units of the ve...
[ "h5py.File", "numpy.meshgrid", "numpy.zeros", "numpy.ones", "numpy.array", "numpy.linspace" ]
[((891, 923), 'numpy.array', 'np.array', (['([128] * 3)'], {'dtype': '"""int"""'}), "([128] * 3, dtype='int')\n", (899, 923), True, 'import numpy as np\n'), ((1032, 1043), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (1040, 1043), True, 'import numpy as np\n'), ((1049, 1059), 'numpy.ones', 'np.ones', (['(3)'], {}...
import tensorflow as tf import pickle from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout, Flatten from tensorflow.keras.applications.vgg16 import VGG16 from tensorflow.keras.models import Model from sklearn.utils import class_weight import math import numpy as np # MODEL...
[ "pickle.dump", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "math.ceil", "tensorflow.keras.applications.vgg16.VGG16", "numpy.array", "tensorflow.keras.models.Sequential", "tensorflow.keras.callbacks.EarlyStopping", "numpy.unique", "tensorflow.keras.layers.Flatten" ]
[((451, 530), 'tensorflow.keras.applications.vgg16.VGG16', 'VGG16', ([], {'weights': '"""imagenet"""', 'include_top': '(False)', 'input_shape': '(IMG_DIM, IMG_DIM, 3)'}), "(weights='imagenet', include_top=False, input_shape=(IMG_DIM, IMG_DIM, 3))\n", (456, 530), False, 'from tensorflow.keras.applications.vgg16 import V...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ @Time : 2019-09-12 14:23 @Author : <NAME> @Email : <EMAIL> @File : test.py """ import cv2 import numpy as np from PIL import Image import time # BGR end = time.time() img_BGR = cv2.imread('left.png', cv2.IMREAD_COLOR) img_RGB = cv2.cvtColor(img_BGR, cv2.COLOR_...
[ "modules.utils.img_utils.pad_image_to_shape", "cv2.cvtColor", "cv2.imwrite", "time.time", "PIL.Image.open", "cv2.imread", "numpy.array", "cv2.imshow" ]
[((215, 226), 'time.time', 'time.time', ([], {}), '()\n', (224, 226), False, 'import time\n'), ((237, 277), 'cv2.imread', 'cv2.imread', (['"""left.png"""', 'cv2.IMREAD_COLOR'], {}), "('left.png', cv2.IMREAD_COLOR)\n", (247, 277), False, 'import cv2\n'), ((288, 328), 'cv2.cvtColor', 'cv2.cvtColor', (['img_BGR', 'cv2.COL...
#! /usr/bin/env python """ File: integrate_exp.py Copyright (c) 2016 <NAME> License: MIT Description: a module for evaluating the improper integral of f from -inf to +inf given below. The integrator class and the midpoint integrator from HW 9 will be used as it already has running tests. f(x) = e^(-x^2) """ import ...
[ "pandas.DataFrame", "Integrator.Midpoint", "numpy.exp" ]
[((406, 425), 'numpy.exp', 'np.exp', (['(-1 * x ** 2)'], {}), '(-1 * x ** 2)\n', (412, 425), True, 'import numpy as np\n'), ((562, 579), 'Integrator.Midpoint', 'Midpoint', (['a', 'b', 'n'], {}), '(a, b, n)\n', (570, 579), False, 'from Integrator import Midpoint\n'), ((967, 985), 'pandas.DataFrame', 'pd.DataFrame', (['d...
from darts.engines import conn_mesh, ms_well, ms_well_vector, index_vector, value_vector import numpy as np from math import inf, pi from darts.mesh.unstruct_discretizer import UnstructDiscretizer from itertools import compress # Definitions for the unstructured reservoir class: class UnstructReservoir: def __ini...
[ "darts.engines.conn_mesh", "darts.engines.ms_well_vector", "darts.engines.index_vector", "numpy.argmin", "darts.engines.ms_well", "numpy.mean", "numpy.array", "numpy.min", "numpy.max", "darts.engines.value_vector", "numpy.linalg.norm", "darts.mesh.unstruct_discretizer.UnstructDiscretizer", "...
[((1147, 1158), 'darts.engines.conn_mesh', 'conn_mesh', ([], {}), '()\n', (1156, 1158), False, 'from darts.engines import conn_mesh, ms_well, ms_well_vector, index_vector, value_vector\n'), ((1346, 1451), 'darts.mesh.unstruct_discretizer.UnstructDiscretizer', 'UnstructDiscretizer', ([], {'permx': 'permx', 'permy': 'per...
"""Analyses the distribution of ambiguous and nonambiguous VBNs and compares P(v_a| VBN) with P(v_u | VBN)""" import matplotlib.pyplot as plt import numpy as np # lists of ambiguous and unambiguous verb forms from Experiment 1 from the Tabor et al 2004 AMBIGUOUS = ["brought", "painted", "sent", "allowed", "told", "off...
[ "numpy.asarray", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((3302, 3320), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(2)'], {}), '(1, 2)\n', (3314, 3320), True, 'import matplotlib.pyplot as plt\n'), ((3703, 3713), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3711, 3713), True, 'import matplotlib.pyplot as plt\n'), ((4059, 4077), 'matplotlib.pyplot.sub...
import os import configparser import cv2 import torch import numpy as np from tqdm import tqdm import config from constants import CONFIG_PATH class Evaluator: def __init__(self, model, input_path, output_path=None): self._model = model self._input_path = input_path self._output_path = o...
[ "numpy.pad", "numpy.empty_like", "cv2.imread", "config.read_config", "os.path.join", "torch.from_numpy" ]
[((359, 379), 'config.read_config', 'config.read_config', ([], {}), '()\n', (377, 379), False, 'import config\n'), ((446, 477), 'cv2.imread', 'cv2.imread', (['self._input_path', '(0)'], {}), '(self._input_path, 0)\n', (456, 477), False, 'import cv2\n'), ((492, 585), 'numpy.pad', 'np.pad', ([], {'array': 'img', 'pad_wid...
from collections import defaultdict from networks import CEVAE_m import numpy as np import torch from argparse import ArgumentParser import matplotlib.pyplot as plt import statsmodels.discrete.discrete_model as sm from sklearn.ensemble import RandomForestClassifier parser = ArgumentParser() parser.add_argument('-n', t...
[ "numpy.load", "argparse.ArgumentParser", "collections.defaultdict", "statsmodels.discrete.discrete_model.Logit", "matplotlib.pyplot.figure", "numpy.mean", "matplotlib.pyplot.tight_layout", "numpy.round", "numpy.std", "torch.load", "networks.CEVAE_m", "torch.Tensor", "sklearn.ensemble.RandomF...
[((276, 292), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (290, 292), False, 'from argparse import ArgumentParser\n'), ((594, 625), 'numpy.where', 'np.where', (['(data_recon[:, 1] == 0)'], {}), '(data_recon[:, 1] == 0)\n', (602, 625), True, 'import numpy as np\n'), ((639, 670), 'numpy.where', 'np.whe...
"""Definition of a Majority Voting Algorithm.""" import numpy as np from scipy.spatial import distance from medtagger.ground_truth.algorithms.base import GeneratorAlgorithm class MajorityVotingAlgorithm(GeneratorAlgorithm): # pylint: disable=too-few-public-methods """Majority Voting Algorithm implementation.""...
[ "scipy.spatial.distance.cdist", "numpy.argsort", "numpy.mean", "numpy.take" ]
[((706, 732), 'scipy.spatial.distance.cdist', 'distance.cdist', (['data', 'data'], {}), '(data, data)\n', (720, 732), False, 'from scipy.spatial import distance\n'), ((842, 883), 'numpy.argsort', 'np.argsort', (['total_distance_for_each_point'], {}), '(total_distance_for_each_point)\n', (852, 883), True, 'import numpy ...
import librosa import numpy as np import matplotlib.pyplot as plt from rednoise_fun import rednoise, wave2stft, stft2power, get_mean_bandwidths, get_var_bandwidths, stft2wave, savewave, get_date, matchvol, get_pitch,get_pitch2, get_pitch_mean, pitch_sqrt, sound_index, get_energy, get_energy_mean def wave2pitchmeansqr...
[ "rednoise_fun.wave2stft", "rednoise_fun.get_mean_bandwidths", "rednoise_fun.get_date", "rednoise_fun.matchvol", "rednoise_fun.stft2power", "rednoise_fun.get_pitch2", "numpy.corrcoef", "rednoise_fun.get_energy", "rednoise_fun.get_pitch_mean", "rednoise_fun.get_energy_mean", "rednoise_fun.pitch_sq...
[((368, 387), 'rednoise_fun.wave2stft', 'wave2stft', (['wavefile'], {}), '(wavefile)\n', (377, 387), False, 'from rednoise_fun import rednoise, wave2stft, stft2power, get_mean_bandwidths, get_var_bandwidths, stft2wave, savewave, get_date, matchvol, get_pitch, get_pitch2, get_pitch_mean, pitch_sqrt, sound_index, get_ene...
import os import numpy as np from data_slam.TUM_RGBD import get_calib if __name__ == "__main__": proc_dir = "/home/jingwen/data/tum_rgbd/rgbd_dataset_freiburg1_360/processed" K = np.eye(3) intri = get_calib()["fr1"] K[0, 0] = intri[0] K[1, 1] = intri[1] K[0, 2] = intri[2] K[1, 2] = intri[3]...
[ "numpy.eye", "data_slam.TUM_RGBD.get_calib", "os.path.join", "numpy.linalg.inv" ]
[((188, 197), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (194, 197), True, 'import numpy as np\n'), ((210, 221), 'data_slam.TUM_RGBD.get_calib', 'get_calib', ([], {}), '()\n', (219, 221), False, 'from data_slam.TUM_RGBD import get_calib\n'), ((348, 387), 'os.path.join', 'os.path.join', (['proc_dir', '"""raw_poses.n...
# camera_config.py """The KU Camera config app. Designed to produce all the reqequired meta data and finally the registration messages to be sent off to the LinkSmart component """ import argparse from tkinter import * from PIL import Image, ImageTk from pathlib import Path import sys import cv2 import numpy as np sys...
[ "WP5.KU.KUConfigTool.ground_plane_gui.TopDown", "argparse.ArgumentParser", "WP5.KU.KUConfigTool.flow_rois.FlowROI", "WP5.KU.SharedResources.cam_video_streamer.CamVideoStreamer", "WP5.KU.KUConfigTool.config_tools.ConfigTools", "WP5.KU.KUConfigTool.crowd_mask.CrowdMask", "pathlib.Path", "numpy.array", ...
[((807, 937), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Config Tool to create settings files for each camera and the required algorithms."""'}), "(description=\n 'Config Tool to create settings files for each camera and the required algorithms.'\n )\n", (830, 937), False, 'imp...
from __future__ import division import numpy as np from vector_maths import normalize def BlinnPhong_specular(incident_vector, view_vector, surface_norm, shininess_exponent, intensity=1.0): """ Return the Blinn-Phong specular intensity for a given light reflection into a viewpoint on a surface with a shininess f...
[ "numpy.dot", "vector_maths.normalize" ]
[((1721, 1747), 'vector_maths.normalize', 'normalize', (['incident_vector'], {}), '(incident_vector)\n', (1730, 1747), False, 'from vector_maths import normalize\n'), ((652, 689), 'numpy.dot', 'np.dot', (['incident_vector', 'surface_norm'], {}), '(incident_vector, surface_norm)\n', (658, 689), True, 'import numpy as np...
from commons import readcsv import numpy as np import constant import insights.htmlutils as htmlutils def get_timing_insights(csv_filename, max_indices): df = readcsv(csv_filename) for metric in constant.METRICS_COLUMNS: _get_best_timing_based_on(metric, df, max_indices) def _get_best_timing_based_o...
[ "numpy.full", "numpy.set_printoptions", "insights.htmlutils.Table", "numpy.zeros", "numpy.argsort", "numpy.argpartition", "commons.readcsv" ]
[((165, 186), 'commons.readcsv', 'readcsv', (['csv_filename'], {}), '(csv_filename)\n', (172, 186), False, 'from commons import readcsv\n'), ((455, 482), 'numpy.full', 'np.full', (['[24]', '(0)'], {'dtype': 'int'}), '([24], 0, dtype=int)\n', (462, 482), True, 'import numpy as np\n'), ((582, 609), 'numpy.full', 'np.full...
__author__ = 'Charlie' import cv2 import numpy as np def image_resize(image, width=-1, height=-1): shape = image.shape if width == -1: if height == -1: return image else: return cv2.resize(image, (int(height * shape[1] / shape[0]), height)) elif height == -1: ...
[ "cv2.resize", "cv2.GaussianBlur", "cv2.Canny", "cv2.putText", "cv2.filter2D", "numpy.argmax", "numpy.median", "cv2.cvtColor", "numpy.zeros", "cv2.adaptiveThreshold", "numpy.argmin", "cv2.warpAffine", "numpy.diff", "numpy.array", "cv2.boundingRect", "cv2.getRotationMatrix2D", "cv2.fin...
[((570, 586), 'numpy.median', 'np.median', (['image'], {}), '(image)\n', (579, 586), True, 'import numpy as np\n'), ((676, 706), 'cv2.Canny', 'cv2.Canny', (['image', 'lower', 'upper'], {}), '(image, lower, upper)\n', (685, 706), False, 'import cv2\n'), ((777, 862), 'cv2.adaptiveThreshold', 'cv2.adaptiveThreshold', (['i...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 29 09:40:02 2019 @author: ben """ import numpy as np import scipy.interpolate as si from scipy.interpolate import griddata import h5py from PointDatabase.geo_index import geo_index from PointDatabase.point_data import point_data from PointDatabase....
[ "os.mkdir", "os.remove", "numpy.abs", "argparse.ArgumentParser", "numpy.ravel", "numpy.argsort", "os.path.isfile", "matplotlib.pyplot.figure", "numpy.arange", "glob.glob", "PointDatabase.point_data.point_data", "numpy.round", "os.path.abspath", "numpy.zeros_like", "matplotlib.pyplot.clos...
[((1564, 1588), 'os.path.isfile', 'os.path.isfile', (['out_file'], {}), '(out_file)\n', (1578, 1588), False, 'import os\n'), ((2673, 2698), 'numpy.round', 'np.round', (['(D_all.y / bin_W)'], {}), '(D_all.y / bin_W)\n', (2681, 2698), True, 'import numpy as np\n'), ((2716, 2741), 'numpy.round', 'np.round', (['(D_all.x / ...
"""Tests for `confidence` categorical variables.""" import pytest import spotify_confidence import pandas as pd import numpy as np spotify_confidence.options.set_option("randomization_seed", 1) class TestCategorical(object): def setup(self): self.data = pd.DataFrame( { "vari...
[ "pandas.DataFrame", "numpy.random.get_state", "spotify_confidence.BetaBinomial", "numpy.allclose", "pytest.raises", "numpy.array", "numpy.array_equal", "spotify_confidence.options.set_option" ]
[((133, 195), 'spotify_confidence.options.set_option', 'spotify_confidence.options.set_option', (['"""randomization_seed"""', '(1)'], {}), "('randomization_seed', 1)\n", (170, 195), False, 'import spotify_confidence\n'), ((271, 505), 'pandas.DataFrame', 'pd.DataFrame', (["{'variation_name': ['test', 'control', 'test2',...
#import the necessary packages from picamera.array import PiRGBArray from picamera import PiCamera import time import cv2 import numpy as np from motorshield import motorcmd #import VL53L0X # # initialize the camera and grab a reference to the raw camera capture camera = PiCamera() camera.resolution = (320, 240) camer...
[ "cv2.line", "cv2.Canny", "cv2.cvtColor", "cv2.waitKey", "motorshield.motorcmd", "time.sleep", "numpy.sin", "cv2.HoughLines", "picamera.array.PiRGBArray", "numpy.cos", "cv2.imshow", "picamera.PiCamera" ]
[((273, 283), 'picamera.PiCamera', 'PiCamera', ([], {}), '()\n', (281, 283), False, 'from picamera import PiCamera\n'), ((350, 385), 'picamera.array.PiRGBArray', 'PiRGBArray', (['camera'], {'size': '(320, 240)'}), '(camera, size=(320, 240))\n', (360, 385), False, 'from picamera.array import PiRGBArray\n'), ((545, 560),...
from __future__ import print_function import os import hashlib import numpy as np, healpy as hp from lensit.misc.misc_utils import binned, enumerate_progress from lensit.ffs_covs import ell_mat, ffs_specmat def apodize(lib_datalm, mask, sigma_fwhm_armin=12., lmax=None, method='hybrid', mult_factor=3, min_factor=0.1)...
[ "numpy.load", "numpy.maximum", "numpy.sum", "lensit.misc.misc_utils.enumerate_progress", "numpy.ones", "numpy.arange", "numpy.prod", "hashlib.sha1", "lensit.misc.misc_utils.binned", "os.path.exists", "numpy.max", "lensit.ffs_covs.ell_mat.ffs_alm_pyFFTW", "healpy.gauss_beam", "numpy.min", ...
[((508, 585), 'lensit.ffs_covs.ell_mat.ffs_alm_pyFFTW', 'ell_mat.ffs_alm_pyFFTW', (['lib_datalm.ell_mat'], {'filt_func': '(lambda ell: ell <= lmax)'}), '(lib_datalm.ell_mat, filt_func=lambda ell: ell <= lmax)\n', (530, 585), False, 'from lensit.ffs_covs import ell_mat, ffs_specmat\n'), ((665, 730), 'healpy.gauss_beam',...
import numpy as np from sklearn.base import clone from sklearn.base import BaseEstimator, RegressorMixin from sklearn.ensemble import GradientBoostingRegressor from sklearn.utils import check_random_state from sklearn.externals.joblib import Parallel, delayed import numpy as np from scipy.stats import binom_test from s...
[ "keras.backend.learning_phase", "numpy.asarray", "sklearn.preprocessing.MinMaxScaler", "numpy.zeros", "keras.models.Model", "keras.layers.Dense", "numpy.array", "keras.layers.core.Dropout", "keras.layers.Input" ]
[((1753, 1766), 'numpy.asarray', 'np.asarray', (['y'], {}), '(y)\n', (1763, 1766), True, 'import numpy as np\n'), ((1800, 1828), 'sklearn.preprocessing.MinMaxScaler', 'preprocessing.MinMaxScaler', ([], {}), '()\n', (1826, 1828), False, 'from sklearn import preprocessing\n'), ((1965, 1993), 'sklearn.preprocessing.MinMax...
import numpy as np class Camera: def __init__(self,azim,dist,elev,sceneobj,name,viewlimits): self.reset_position() self.copfocalsxyzinfinity = -1000000 self.name = name self.viewlimits = viewlimits # None or [minoflimits,maxoflimits] self.scene = sceneobj self...
[ "numpy.array" ]
[((1631, 1733), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, \n 0.0, 0.0, 1.0]]'], {}), '([[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0],\n [0.0, 0.0, 0.0, 1.0]])\n', (1639, 1733), True, 'import numpy as np\n')]
import numpy as np from experiments import data_source from experiments import data_transformation from savigp.kernel import ExtRBF from savigp.likelihood import UnivariateGaussian from savigp import Savigp # define an automatic obtain kernel function. def get_kernels(input_dim, num_latent_proc, variance = 1, length...
[ "experiments.data_source.boston_data", "numpy.array", "experiments.data_transformation.MeanTransformation", "savigp.Savigp" ]
[((1403, 1491), 'experiments.data_transformation.MeanTransformation', 'data_transformation.MeanTransformation', (["data['train_inputs']", "data['train_outputs']"], {}), "(data['train_inputs'], data[\n 'train_outputs'])\n", (1441, 1491), False, 'from experiments import data_transformation\n'), ((1694, 1811), 'savigp....
import sys sys.path.insert(0, '../LIMEaid/LIMEaid') import numpy as np from view import LIMEdisplay as ld def test_lime_display(): # Input some dummy data so that lime_display has something to # display. data = np.array([[1, 2, 3, 0], [4, 5, 6, 1], [7, 8, 9, 2]], np.int32) lime_bet...
[ "view.LIMEdisplay.lime_display", "numpy.array", "sys.path.insert" ]
[((11, 51), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../LIMEaid/LIMEaid"""'], {}), "(0, '../LIMEaid/LIMEaid')\n", (26, 51), False, 'import sys\n'), ((225, 287), 'numpy.array', 'np.array', (['[[1, 2, 3, 0], [4, 5, 6, 1], [7, 8, 9, 2]]', 'np.int32'], {}), '([[1, 2, 3, 0], [4, 5, 6, 1], [7, 8, 9, 2]], np.int32)\...
import numpy as np import sklearn.metrics as skl_metrics from Orange.data import Table, Domain, Instance, RowInstance from Orange.misc import DistMatrix from Orange.preprocess import SklImpute from Orange.statistics import util # TODO: When we upgrade to numpy 1.13, change use argument copy=False in # nan_to_num ins...
[ "Orange.preprocess.SklImpute", "sklearn.metrics.pairwise.pairwise_distances", "Orange.misc.DistMatrix", "numpy.nan_to_num", "numpy.sum", "numpy.empty", "numpy.zeros", "numpy.isnan", "Orange.data.Domain", "Orange.statistics.util.bincount", "numpy.atleast_2d" ]
[((701, 814), 'Orange.data.Domain', 'Domain', (['[a for a in table.domain.attributes if a.is_continuous]', 'table.domain.class_vars', 'table.domain.metas'], {}), '([a for a in table.domain.attributes if a.is_continuous], table.\n domain.class_vars, table.domain.metas)\n', (707, 814), False, 'from Orange.data import ...
import numpy as np import warnings class Simulation: def __init__(self, model): self.model = model self.CreateArrays(0, 0) pass def CreateArrays(self, pointCount, deltaTms): self.times = np.arange(pointCount) * deltaTms self.Vm = np.empty(pointCount) self.INa ...
[ "numpy.empty", "numpy.arange", "warnings.warn" ]
[((282, 302), 'numpy.empty', 'np.empty', (['pointCount'], {}), '(pointCount)\n', (290, 302), True, 'import numpy as np\n'), ((322, 342), 'numpy.empty', 'np.empty', (['pointCount'], {}), '(pointCount)\n', (330, 342), True, 'import numpy as np\n'), ((361, 381), 'numpy.empty', 'np.empty', (['pointCount'], {}), '(pointCoun...
"""Inherited model class.""" from swarms.lib.model import Model from swarms.lib.time import SimultaneousActivation # RandomActivation, StagedActivation from swarms.lib.space import Grid from swarms.utils.jsonhandler import JsonData from swarms.utils.results import Experiment from swarms.utils.db import Connect from sw...
[ "swarms.lib.time.SimultaneousActivation", "os.mkdir", "swarms.lib.objects.Sites", "numpy.argmax", "numpy.std", "os.getcwd", "swarms.lib.objects.Food", "swarms.lib.space.Grid", "pathlib.Path", "swarms.utils.jsonhandler.JsonData", "numpy.mean", "swarms.utils.jsonhandler.JsonData.load_json_file",...
[((638, 660), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (650, 660), False, 'import pathlib\n'), ((2392, 2412), 'os.mkdir', 'os.mkdir', (['self.pname'], {}), '(self.pname)\n', (2400, 2412), False, 'import os\n'), ((2463, 2488), 'swarms.lib.space.Grid', 'Grid', (['width', 'height', 'grid'], {}),...
#!/usr/bin/env python3 import rospy from nav_msgs.msg import Odometry import rogata_library as rgt import numpy as np def odom_callback( odom, argv): agent = argv[0] rogata = argv[1] pos = np.array([odom.pose.pose.position.x, -odom.pose.pose.position.y])*100+np.array([500,500]) r...
[ "rospy.Subscriber", "numpy.array", "rospy.init_node", "rospy.spin", "rogata_library.rogata_helper" ]
[((381, 413), 'rospy.init_node', 'rospy.init_node', (['"""agent_tracker"""'], {}), "('agent_tracker')\n", (396, 413), False, 'import rospy\n'), ((295, 315), 'numpy.array', 'np.array', (['[500, 500]'], {}), '([500, 500])\n', (303, 315), True, 'import numpy as np\n'), ((441, 460), 'rogata_library.rogata_helper', 'rgt.rog...
import pandas as pd import numpy as np import altair as alt def throughput_cal(size, depth, density, rpm=1, pitch=None, w_flight=None, n_flight=1): """ Calculates the extrusion throughput (Drag Flow) given the screw size, RPM, the channel depth of metering channel, and screw pitch Parameters ...
[ "pandas.DataFrame", "numpy.tanh", "altair.Y", "altair.Chart", "altair.EncodingSortField", "numpy.arange", "pandas.Series", "numpy.cos", "numpy.arctan", "altair.Scale" ]
[((3551, 3584), 'numpy.arctan', 'np.arctan', (['(pitch / (np.pi * size))'], {}), '(pitch / (np.pi * size))\n', (3560, 3584), True, 'import numpy as np\n'), ((3601, 3645), 'numpy.arctan', 'np.arctan', (['(pitch / (np.pi * screw_root_size))'], {}), '(pitch / (np.pi * screw_root_size))\n', (3610, 3645), True, 'import nump...
# coding: utf-8 # In[1]: import theano.tensor as tt import pysal as ps import matplotlib.pyplot as plt import seaborn.apionly as sns import numpy as np import pandas as pd import ops import distributions as spdist import scipy.sparse as spar import scipy.sparse.linalg as spla import pymc3 as mc plt.ion() # In[2]: ...
[ "imp.reload", "pymc3.sample", "pysal.examples.get_path", "pymc3.Model", "pysal.weights.Queen.from_dataframe", "theano.tensor.dot", "numpy.asarray", "pymc3.Normal", "ord.SAR_Error", "matplotlib.pyplot.ion", "pymc3.HalfCauchy", "pysal.spreg.ML_Error", "pymc3.traceplot", "numpy.random.normal"...
[((300, 309), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (307, 309), True, 'import matplotlib.pyplot as plt\n'), ((770, 805), 'pysal.weights.Queen.from_dataframe', 'ps.weights.Queen.from_dataframe', (['df'], {}), '(df)\n', (801, 805), True, 'import pysal as ps\n'), ((864, 914), 'numpy.asarray', 'np.asarray',...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 10 14:43:10 2018 @author: chenxiaoxu """ import numpy as np from sklearn.linear_model import LinearRegression from sklearn.svm import SVR import sklearn.metrics as metrics from sklearn.model_selection import RepeatedKFold saveDirPath = '~/code/...
[ "numpy.load", "sklearn.svm.SVR", "sklearn.metrics.mean_absolute_error", "sklearn.model_selection.RepeatedKFold", "sklearn.metrics.mean_squared_error" ]
[((518, 537), 'numpy.load', 'np.load', (['inputFileX'], {}), '(inputFileX)\n', (525, 537), True, 'import numpy as np\n'), ((546, 565), 'numpy.load', 'np.load', (['inputFileY'], {}), '(inputFileY)\n', (553, 565), True, 'import numpy as np\n'), ((920, 974), 'sklearn.model_selection.RepeatedKFold', 'RepeatedKFold', ([], {...
import argparse import torch import numpy as np parser = argparse.ArgumentParser() parser.add_argument('--ckpt', type=str, required=True, help='The path of the ckpt file') parser.add_argument('--skips', type=str, required=False, nargs='*', help="Skip specific variables") args =...
[ "torch.load", "argparse.ArgumentParser", "numpy.prod" ]
[((59, 84), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (82, 84), False, 'import argparse\n'), ((492, 528), 'torch.load', 'torch.load', (['ckpt'], {'map_location': '"""cpu"""'}), "(ckpt, map_location='cpu')\n", (502, 528), False, 'import torch\n'), ((814, 828), 'numpy.prod', 'np.prod', (['sh...
import pytest import numpy as np from foolbox.attacks import GradientAttack from foolbox.attacks import BinarizationRefinementAttack def test_attack(binarized_bn_adversarial): adv = binarized_bn_adversarial attack = GradientAttack() attack(adv) v1 = adv.distance.value attack = BinarizationRefin...
[ "pytest.raises", "numpy.testing.assert_allclose", "foolbox.attacks.BinarizationRefinementAttack", "foolbox.attacks.GradientAttack" ]
[((228, 244), 'foolbox.attacks.GradientAttack', 'GradientAttack', ([], {}), '()\n', (242, 244), False, 'from foolbox.attacks import GradientAttack\n'), ((303, 333), 'foolbox.attacks.BinarizationRefinementAttack', 'BinarizationRefinementAttack', ([], {}), '()\n', (331, 333), False, 'from foolbox.attacks import Binarizat...
#!/usr/bin/env python3 import numpy as np from nilearn import image as nImage from nilearn import datasets as nDatasets from nilearn.input_data import NiftiLabelsMasker from matplotlib import pyplot ########################### # basic params, file paths ########################### # Base working dir base_dir = '/h...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "nilearn.image.load_img", "nilearn.input_data.NiftiLabelsMasker", "matplotlib.pyplot.legend", "nilearn.datasets.fetch_atlas_harvard_oxford", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xl...
[((1866, 1893), 'nilearn.image.load_img', 'nImage.load_img', (['atlas_file'], {}), '(atlas_file)\n', (1881, 1893), True, 'from nilearn import image as nImage\n'), ((2182, 2203), 'numpy.unique', 'np.unique', (['atlas_data'], {}), '(atlas_data)\n', (2191, 2203), True, 'import numpy as np\n'), ((2678, 2765), 'nilearn.data...
import pickle from ode.Model import SEIR import numpy as np def dCitySEIR(vector,t,params): """ 建立城市之间流动模型的SEIR :param vector: :param t: time :param params:R0,Di,De,Lsi,Lei,Lii,Lri,Lo :return:dF """ S,E,I1,I2,R = vector R0,Di,De,Da,Lsi,Lei,Li1i,Li2i,Lri,Lo= params ...
[ "numpy.array", "numpy.ceil" ]
[((362, 372), 'numpy.ceil', 'np.ceil', (['t'], {}), '(t)\n', (369, 372), True, 'import numpy as np\n'), ((603, 645), 'numpy.array', 'np.array', (['[dSdt, dEdt, dI1dt, dI2dt, dRdt]'], {}), '([dSdt, dEdt, dI1dt, dI2dt, dRdt])\n', (611, 645), True, 'import numpy as np\n')]
import unittest import timeout_decorator from gradescope_utils.autograder_utils.decorators import weight import numpy as np from pydrake.all import (PiecewiseQuaternionSlerp, PiecewisePolynomial, ToleranceType) class TestRobotPainter(unittest.TestCase): def __init__(self, test_name, note...
[ "numpy.asarray", "pydrake.all.PiecewisePolynomial.FirstOrderHold", "gradescope_utils.autograder_utils.decorators.weight", "timeout_decorator.timeout", "pydrake.all.PiecewiseQuaternionSlerp" ]
[((423, 432), 'gradescope_utils.autograder_utils.decorators.weight', 'weight', (['(4)'], {}), '(4)\n', (429, 432), False, 'from gradescope_utils.autograder_utils.decorators import weight\n'), ((438, 468), 'timeout_decorator.timeout', 'timeout_decorator.timeout', (['(1.0)'], {}), '(1.0)\n', (463, 468), False, 'import ti...
import tensorflow as tf import tensorflow.keras.layers as tfkl import tensorflow.keras as tfk import numpy as np import sys import datetime import pydot import graphviz from sklearn.model_selection import train_test_split from occ.models.abstract_occ_model import abstract_occ_model class deep_SVDD(abstract_occ_model)...
[ "tensorflow.keras.layers.Dense", "sklearn.model_selection.train_test_split", "tensorflow.Variable", "tensorflow.keras.models.Sequential", "tensorflow.math.maximum", "tensorflow.math.square", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.Input", "tensorflow.keras.layers.Activation",...
[((1232, 1320), 'tensorflow.keras.optimizers.schedules.ExponentialDecay', 'tfk.optimizers.schedules.ExponentialDecay', (['(0.0001)'], {'decay_steps': '(1000)', 'decay_rate': '(0.98)'}), '(0.0001, decay_steps=1000,\n decay_rate=0.98)\n', (1273, 1320), True, 'import tensorflow.keras as tfk\n'), ((1475, 1562), 'tensorf...
import numpy as np import numba @numba.jit def cross_parents(X, parents, block_size=1000): nblocks = X.shape[1] / block_size rest = X.shape[1] - nblocks * block_size child = np.empty(nblocks * block_size + rest, float) cross_parents_inplace(X, parents, child, block_size=block_size) return child ...
[ "numpy.empty", "numba.jit" ]
[((321, 412), 'numba.jit', 'numba.jit', (['"""void(float64[:,:], int64[:], float64[:], int64)"""'], {'nopython': '(True)', 'nogil': '(True)'}), "('void(float64[:,:], int64[:], float64[:], int64)', nopython=True,\n nogil=True)\n", (330, 412), False, 'import numba\n'), ((188, 232), 'numpy.empty', 'np.empty', (['(nbloc...
"""Scarf algorithm library for python3. Create and solve a stable matching instance with couple using Scarf's algorithm. <NAME> <<EMAIL>> """ import numpy as np from scipy import sparse as sp import scarf.core __all__ = [ "ScarfInstance", "create_instance", "solve", "round" ] def _is_unique(li): """Check i...
[ "numpy.zeros", "numpy.ones", "scipy.sparse.coo_matrix", "numpy.array", "numpy.arange", "scipy.sparse.hstack", "numpy.round", "scipy.sparse.eye" ]
[((3815, 3888), 'numpy.zeros', 'np.zeros', (['(num_hospital + 1, num_single + 2 * num_couple)'], {'dtype': 'np.int32'}), '((num_hospital + 1, num_single + 2 * num_couple), dtype=np.int32)\n', (3823, 3888), True, 'import numpy as np\n'), ((11002, 11035), 'numpy.ones', 'np.ones', (['self._nps'], {'dtype': 'np.int8'}), '(...
import numpy as np from numpy import ones, zeros, prod, where, cov, mean, tile, r_ from numpy import sum as npsum from numpy.linalg import solve def IncludeDataMVE(epsi,last=0): # This function computes the Minimum Volume Ellipsoid enclosing all data. # The location and dispersion parameters that define the e...
[ "numpy.sum", "numpy.diagflat", "numpy.ones", "numpy.mean", "numpy.where", "numpy.tile", "numpy.cov", "numpy.linalg.solve", "numpy.prod" ]
[((979, 1007), 'numpy.mean', 'mean', (['epsi', '(1)'], {'keepdims': '(True)'}), '(epsi, 1, keepdims=True)\n', (983, 1007), False, 'from numpy import ones, zeros, prod, where, cov, mean, tile, r_\n'), ((1017, 1026), 'numpy.cov', 'cov', (['epsi'], {}), '(epsi)\n', (1020, 1026), False, 'from numpy import ones, zeros, prod...
import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" from skimage import io, transform import tensorflow as tf import tensorlayer as tl import numpy as np # 定义 placeholder x = tf.placeholder(tf.float32, shape=[None, 784], name='x') y_ = tf.placeholder(tf.int64, shape=[None, ], name='y_') def main(): sess = tf.Int...
[ "skimage.transform.resize", "tensorlayer.layers.DropoutLayer", "tensorflow.InteractiveSession", "tensorlayer.files.load_and_assign_npz", "tensorlayer.cost.cross_entropy", "tensorflow.nn.softmax", "tensorlayer.layers.DenseLayer", "tensorflow.placeholder", "tensorflow.cast", "tensorlayer.files.load_...
[((176, 231), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, 784]', 'name': '"""x"""'}), "(tf.float32, shape=[None, 784], name='x')\n", (190, 231), True, 'import tensorflow as tf\n'), ((237, 286), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int64'], {'shape': '[None]', 'name': '"""...
#!/usr/bin/env python ''' POS_keras_scikitlearnwrapper.py <NAME> <<EMAIL>> Project: Deep Learning and POS tagging Corpus: Treebank from NLTK, Brown Libary: scikit-learn, keras Model: Neural Network Word Embedding: No Last Updated by <NAME> - Aug 2,2018 Some code modified from https://techblog.cdiscount.com/part-spe...
[ "nltk.corpus.treebank.tagged_sents", "keras.wrappers.scikit_learn.KerasClassifier", "numpy.random.seed", "matplotlib.pyplot.show", "os.makedirs", "keras.layers.Activation", "matplotlib.pyplot.close", "keras.layers.Dropout", "os.path.exists", "sklearn.preprocessing.LabelEncoder", "matplotlib.pypl...
[((3793, 3811), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (3809, 3811), True, 'import matplotlib.pyplot as plt\n'), ((3816, 3826), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3824, 3826), True, 'import matplotlib.pyplot as plt\n'), ((3865, 3879), 'matplotlib.pyplot.close', 'pl...
""" Authors: <NAME>, <NAME> Created: 4 December 2017 """ """ This is a new sequence generator that is compatible with variable cpw """ # standard libraries import itertools # nonstandard libraries import numpy as np from numpy.random import binomial # homegrown libraries from ..defaults import general_options ...
[ "itertools.chain", "numpy.random.seed", "numpy.random.shuffle", "numpy.random.choice" ]
[((1435, 1455), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1449, 1455), True, 'import numpy as np\n'), ((2728, 2788), 'numpy.random.choice', 'np.random.choice', (['num_cells'], {'size': '(cpw,)', 'p': 'cell_frequencies'}), '(num_cells, size=(cpw,), p=cell_frequencies)\n', (2744, 2788), True, 'i...
import pathlib import logging import collections import shelve import numpy as np import pandas as pd import numba import polychrom import polychrom.polymer_analyses import polychrom.hdf5_format def make_log_int_bins(end, start=1, bins_decade=10): lstart = np.log10(start) lend = np.log10(end) num = int...
[ "numpy.abs", "numpy.sum", "pathlib.Path", "numpy.arange", "numpy.exp", "numpy.random.normal", "numpy.round", "pandas.DataFrame", "numpy.bincount", "numpy.log10", "pandas.concat", "numpy.ceil", "numpy.asarray", "numpy.vstack", "numpy.log", "numpy.zeros", "numpy.searchsorted", "loggi...
[((11380, 11404), 'numba.jit', 'numba.jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (11389, 11404), False, 'import numba\n'), ((266, 281), 'numpy.log10', 'np.log10', (['start'], {}), '(start)\n', (274, 281), True, 'import numpy as np\n'), ((293, 306), 'numpy.log10', 'np.log10', (['end'], {}), '(end)\n', (301...
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/master/LICENSE from __future__ import absolute_import import sys import pytest import numpy import awkward1 import awkward1._io def test_0230(): rec = awkward1.zip({"x": awkward1.virtual(lambda: awkward1.Array([1, 2, 3, 4]), length=4)},...
[ "awkward1.to_list", "numpy.array", "awkward1.Array" ]
[((370, 397), 'awkward1.to_list', 'awkward1.to_list', (['rec.x[1:]'], {}), '(rec.x[1:])\n', (386, 397), False, 'import awkward1\n'), ((422, 453), 'awkward1.to_list', 'awkward1.to_list', (['(rec.x[1:] * 2)'], {}), '(rec.x[1:] * 2)\n', (438, 453), False, 'import awkward1\n'), ((533, 561), 'numpy.array', 'numpy.array', ([...
"""Iterators and tools for jackknife estimators""" import random from warnings import warn from time import sleep import numpy as np from scipy.special import comb from itertools import combinations from contextlib import ExitStack from ecogdata.parallel.mproc import parallel_context, make_stderr_logger, timestamp impo...
[ "numpy.random.seed", "ecogdata.parallel.sharedmem.SharedmemManager.shared_ndarray", "numpy.abs", "ecogdata.parallel.mproc.parallel_context.JoinableQueue", "scipy.special.comb", "numpy.mean", "numpy.arange", "ecogdata.parallel.sharedmem.SharedmemManager", "numpy.random.randint", "numpy.std", "eco...
[((1448, 1464), 'numpy.arange', 'np.arange', (['max_n'], {}), '(max_n)\n', (1457, 1464), True, 'import numpy as np\n'), ((26831, 26855), 'numpy.zeros', 'np.zeros', (['t_sample.shape'], {}), '(t_sample.shape)\n', (26839, 26855), True, 'import numpy as np\n'), ((3644, 3664), 'numpy.random.seed', 'np.random.seed', (['seed...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @authors: <NAME>, <NAME>, <NAME>, <NAME> MIT Photovoltaics Laboratory """ import pandas as pd import numpy as np import os import matplotlib import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.tri as tri script_dir = os.path.dirname(__file__) r...
[ "matplotlib.colors.LinearSegmentedColormap", "numpy.sum", "numpy.ravel", "numpy.empty", "numpy.ones", "numpy.arange", "os.path.join", "os.chdir", "matplotlib.ticker.ScalarFormatter", "pandas.DataFrame", "matplotlib.pyplot.register_cmap", "numpy.meshgrid", "matplotlib.colors.Normalize", "os...
[((293, 318), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (308, 318), False, 'import os\n'), ((333, 369), 'os.path.join', 'os.path.join', (['script_dir', '"""Results/"""'], {}), "(script_dir, 'Results/')\n", (345, 369), False, 'import os\n'), ((378, 404), 'os.path.isdir', 'os.path.isdir', ...
# !/usr/bin/env python # Created by "Thieu" at 21:19, 17/03/2020 ----------% # Email: <EMAIL> % # Github: https://github.com/thieu1995 % # --------------------------------------------------% import numpy as np from copy import deepcopy from mealpy.optimizer import Optimizer class BaseMV...
[ "numpy.random.uniform", "copy.deepcopy", "numpy.sum", "numpy.ptp", "numpy.cumsum", "numpy.min", "numpy.array", "numpy.random.normal" ]
[((6533, 6551), 'numpy.cumsum', 'np.cumsum', (['weights'], {}), '(weights)\n', (6542, 6551), True, 'import numpy as np\n'), ((6894, 6911), 'numpy.min', 'np.min', (['d'], {'axis': '(0)'}), '(d, axis=0)\n', (6900, 6911), True, 'import numpy as np\n'), ((7800, 7863), 'numpy.array', 'np.array', (['[item[self.ID_TAR][self.I...
import numpy as np from wann_genetic.util import get_array_field def rearrange_matrix(m, indices): """Rearrange matrix `m` according to provided indices.""" # rearrange i_rows, i_cols = indices m = m[i_rows, :] m = m[:, i_cols] return m def num_used_activation_functions(nodes, available_func...
[ "numpy.unique" ]
[((495, 539), 'numpy.unique', 'np.unique', (["nodes['func']"], {'return_counts': '(True)'}), "(nodes['func'], return_counts=True)\n", (504, 539), True, 'import numpy as np\n')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ the main parts of the training @author: <NAME> """ ########## # This is the file to get all hyperparameters and model from train5_5 import * ########## import numpy as np from collections import deque from numpy import random import pickle import os,time, sys from ...
[ "keras.models.load_model", "os.mkdir", "pickle.dump", "snake_game.snack_pygame", "numpy.argmax", "keras.backend.set_value", "os.path.exists", "numpy.zeros", "numpy.expand_dims", "keras.backend.get_value", "numpy.max", "pickle.load", "numpy.random.random", "snake_game.snake_API", "numpy.r...
[((1090, 1129), 'keras.backend.set_value', 'K.set_value', (['model.optimizer.lr', '(0.0001)'], {}), '(model.optimizer.lr, 0.0001)\n', (1101, 1129), True, 'from keras import backend as K\n'), ((1866, 1894), 'snake_game.snake_API', 'snake_API', ([], {'size': '(rows, cols)'}), '(size=(rows, cols))\n', (1875, 1894), False,...
import speech_recognition as sr import pyttsx3 import datetime import wikipedia import random import json import pickle import numpy as np import nltk from nltk.stem import WordNetLemmatizer from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense,Activation,Dropout f...
[ "pyttsx3.init", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "random.shuffle", "tensorflow.keras.optimizers.SGD", "random.choice", "speech_recognition.Microphone", "nltk.tokenize", "numpy.array", "tensorflow.keras.models.Sequential", "wikipedia.summary", "datetime.dateti...
[((1493, 1517), 'random.shuffle', 'random.shuffle', (['training'], {}), '(training)\n', (1507, 1517), False, 'import random\n'), ((1530, 1548), 'numpy.array', 'np.array', (['training'], {}), '(training)\n', (1538, 1548), True, 'import numpy as np\n'), ((1626, 1638), 'tensorflow.keras.models.Sequential', 'Sequential', (...
import os import time import torch import torch.nn as nn import numpy as np import torch.nn.functional as F from util.evaluation import AverageMeter, accuracy, pairwise_distances from util.utils import length_to_mask from trainer.trainer import Trainer from modules.losses import get_gan_loss, KLLoss from .networks im...
[ "torch.eye", "torch.argmax", "torch.arange", "util.evaluation.AverageMeter", "torch.no_grad", "os.path.join", "torch.ones", "modules.losses.KLLoss", "torch.load", "os.path.exists", "torch.diag", "torch.exp", "torch.zeros", "torch.distributions.multivariate_normal.MultivariateNormal", "nu...
[((1958, 1997), 'os.path.join', 'os.path.join', (['"""./tmp"""', 'self.args.log_id'], {}), "('./tmp', self.args.log_id)\n", (1970, 1997), False, 'import os\n'), ((14394, 14426), 'torch.exp', 'torch.exp', (['g_paras[:, :, :, 3:5]'], {}), '(g_paras[:, :, :, 3:5])\n', (14403, 14426), False, 'import torch\n'), ((14440, 144...
#!/usr/bin/env python import argparse from PIL import Image import numpy as np import math import tensorflow as tf # from keras.datasets import mnist from tensorflow.contrib.layers import conv2d, conv2d_transpose, layer_norm, fully_connected import random import save_images import os import time from dataset impo...
[ "tensorflow.get_collection", "tensorflow.identity", "tensorflow.contrib.layers.flatten", "tensorflow.reshape", "numpy.random.randint", "numpy.arange", "tensorflow.layers.conv2d_transpose", "numpy.prod", "tensorflow.nn.relu", "tensorflow.nn.softmax_cross_entropy_with_logits", "dataset.Dataset", ...
[((571, 608), 'dataset.Dataset', 'Dataset', (['"""raw/grayscale/"""', 'IMG_DIM[0]'], {}), "('raw/grayscale/', IMG_DIM[0])\n", (578, 608), False, 'from dataset import Dataset\n'), ((460, 476), 'numpy.prod', 'np.prod', (['IMG_DIM'], {}), '(IMG_DIM)\n', (467, 476), True, 'import numpy as np\n'), ((2592, 2659), 'tensorflow...