code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
""" This module defines the Gate class, which represents a quantum gate, as well as implementations of many common Gates. Through the use of KroneckerGate and ProductGate, Gates can be formed for complex circuit structures. The matrix and mat_jac functions are used for numerical optimization of parameterized gates. ...
[ "numpy.pad", "numpy.eye", "numpy.log", "numpy.shape", "numpy.sin", "numpy.array", "numpy.exp", "numpy.cos", "numpy.matmul", "numpy.kron", "numpy.dot", "numpy.random.random", "numpy.sqrt" ]
[((19155, 19459), '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, \n 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, \n 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, ...
import nltk from sklearn.preprocessing import normalize import numpy as np from gensim.models import KeyedVectors from mabed.es_connector import Es_connector model_path = "./word2vec_twitter_model.bin" model = KeyedVectors.load_word2vec_format(model_path, binary=True,unicode_errors='ignore') # the index to be read an...
[ "numpy.zeros", "sklearn.preprocessing.normalize", "gensim.models.KeyedVectors.load_word2vec_format", "numpy.add", "nltk.word_tokenize" ]
[((211, 299), 'gensim.models.KeyedVectors.load_word2vec_format', 'KeyedVectors.load_word2vec_format', (['model_path'], {'binary': '(True)', 'unicode_errors': '"""ignore"""'}), "(model_path, binary=True, unicode_errors=\n 'ignore')\n", (244, 299), False, 'from gensim.models import KeyedVectors\n'), ((773, 797), 'nltk...
# -*- coding: utf-8 -*- import sys import numpy as np from numpy import pi, sqrt, exp, sin, cos, tan, log, log10 import scipy as sp import scipy.interpolate import h5py import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.collections import PatchCollection from matplotlib.patches import Rectangl...
[ "matplotlib.rc", "h5py.File", "numpy.concatenate", "matplotlib.lines.Line2D", "matplotlib.patches.Rectangle", "matplotlib.pyplot.subplots", "numpy.append", "matplotlib.collections.PatchCollection", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.savefig" ]
[((1214, 1244), 'matplotlib.rc', 'mpl.rc', (['"""font"""'], {'family': '"""serif"""'}), "('font', family='serif')\n", (1220, 1244), True, 'import matplotlib as mpl\n'), ((1245, 1271), 'matplotlib.rc', 'mpl.rc', (['"""font"""'], {'size': '"""6.0"""'}), "('font', size='6.0')\n", (1251, 1271), True, 'import matplotlib as ...
# -*- coding: utf-8 -*- import numpy as np import os import logging from keras import backend as K from keras.models import load_model from sklearn.metrics import classification_report from keras.callbacks import ModelCheckpoint from keras.models import Model import tensorflow as tf import random as rn from ...
[ "keras.models.load_model", "numpy.load", "numpy.random.seed", "argparse.ArgumentParser", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score", "sklearn.preprocessing.MinMaxScaler", "keras.models.Model", "tensorflow.ConfigProto", "gc.collect", "sklearn.metrics.f1_score", ...
[((718, 772), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""TTSS_classifier"""'}), "(description='TTSS_classifier')\n", (741, 772), False, 'import argparse\n'), ((1553, 1648), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s : %(levelname)s : %(message)s"""'...
from abc import ABCMeta, abstractmethod import numpy as np import os import pandas as pd from covid_xprize.standard_predictor.xprize_predictor import XPrizePredictor import time SEED = 0 DEFAULT_TEST_COST = 'covid_xprize/validation/data/uniform_random_costs.csv' TEST_CONFIGS = [ # ('Default', {'start_date': '2020-...
[ "numpy.random.uniform", "os.path.abspath", "covid_xprize.standard_predictor.xprize_predictor.XPrizePredictor", "pandas.DataFrame.from_dict", "numpy.random.seed", "pandas.read_csv", "time.time", "numpy.timedelta64", "pandas.to_datetime", "os.path.join", "pandas.concat" ]
[((2012, 2053), 'os.path.join', 'os.path.join', (['ROOT_DIR', 'os.pardir', '"""data"""'], {}), "(ROOT_DIR, os.pardir, 'data')\n", (2024, 2053), False, 'import os\n'), ((2072, 2115), 'os.path.join', 'os.path.join', (['DATA_DIR', '"""OxCGRT_latest.csv"""'], {}), "(DATA_DIR, 'OxCGRT_latest.csv')\n", (2084, 2115), False, '...
import pickle import numpy as np import pandas as pd import sys sys.path.insert(1, '../src/MyAIGuide/data') from fitbitDataGatheredFromWebExport import fitbitDataGatheredFromWebExport from movesDataGatheredFromWebExport import movesDataGatheredFromWebExport from googleFitGatheredFromWebExport import googleFitGatheredF...
[ "pandas.DataFrame", "fitbitDataGatheredFromWebExport.fitbitDataGatheredFromWebExport", "pickle.dump", "pandas.date_range", "googleFitGatheredFromWebExport.googleFitGatheredFromWebExport", "storeManicTime.storeManicTime", "sys.path.insert", "retrieve_mentalstate_participant1.retrieve_mentalstate_partic...
[((64, 107), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../src/MyAIGuide/data"""'], {}), "(1, '../src/MyAIGuide/data')\n", (79, 107), False, 'import sys\n'), ((734, 786), 'pandas.date_range', 'pd.date_range', (['"""2015-11-19"""'], {'periods': '(1700)', 'freq': '"""1D"""'}), "('2015-11-19', periods=1700, freq='...
""" - Takes fixed points data from fixed point dictionary file - Computes matrix L and eigenvalues for the fixpoint, located, corresponding to a wave with wave numbers (k1,k2). - Creates a subfolder and save the result INPUT: - args: k1, k2, delta0, tol - fixpoint_dict.pkl -> dictionary of fixed points """ import sys ...
[ "scipy.linalg.solve", "pickle.dump", "numpy.save", "carpet.get_mean_phase", "os.makedirs", "numpy.log", "sim_physics.get_mtwist", "os.path.dirname", "sim_physics.solve_cycle", "numpy.zeros", "scipy.linalg.eig", "numpy.ones", "pickle.load", "numpy.array", "scipy.linalg.norm", "os.path.j...
[((586, 611), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (601, 611), False, 'import os\n'), ((5553, 5594), 'os.makedirs', 'os.makedirs', (['output_folder'], {'exist_ok': '(True)'}), '(output_folder, exist_ok=True)\n', (5564, 5594), False, 'import os\n'), ((5664, 5691), 'numpy.save', 'np.s...
import os import random import cv2 as cv import keras.backend as K import numpy as np from config import colors from data_generator import get_label from data_generator import get_y from data_generator import random_choice from data_generator import safe_crop from model import build_encoder_decoder if __name__ == '...
[ "data_generator.random_choice", "numpy.argmax", "random.sample", "numpy.empty", "data_generator.get_y", "numpy.zeros", "cv2.imread", "data_generator.safe_crop", "numpy.reshape", "data_generator.get_label", "os.path.join", "keras.backend.clear_session", "model.build_encoder_decoder" ]
[((452, 475), 'model.build_encoder_decoder', 'build_encoder_decoder', ([], {}), '()\n', (473, 475), False, 'from model import build_encoder_decoder\n'), ((668, 692), 'random.sample', 'random.sample', (['names', '(10)'], {}), '(names, 10)\n', (681, 692), False, 'import random\n'), ((2391, 2408), 'keras.backend.clear_ses...
from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QAction, QTableWidget,QTableWidgetItem,QVBoxLayout,QFileDialog from PyQt5.QtGui import QIcon from PyQt5.QtCore import pyqtSlot from libs.utils import addActions, newAction from functools import partial import os import numpy as np import pandas as pd cl...
[ "pandas.DataFrame", "functools.partial", "PyQt5.QtWidgets.QTableWidget", "numpy.array", "libs.utils.addActions", "os.path.split", "PyQt5.QtWidgets.QFileDialog" ]
[((525, 539), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (533, 539), True, 'import numpy as np\n'), ((653, 676), 'os.path.split', 'os.path.split', (['save_dir'], {}), '(save_dir)\n', (666, 676), False, 'import os\n'), ((1138, 1162), 'functools.partial', 'partial', (['newAction', 'self'], {}), '(newAction, s...
"""Convenience functions for Gaussian filtering and smoothing. We support the following methods: - ekf0: Extended Kalman filtering based on a zero-th order Taylor approximation [1]_, [2]_, [3]_. Also known as "PFOS". - ekf1: Extended Kalman filtering [3]_. - ukf: Unscented Kalman filtering [3]_. ...
[ "probnum.diffeq.odefiltsmooth.ivp2filter.ivp2ekf1", "probnum.diffeq.odefiltsmooth.ivp2filter.ivp2ukf", "probnum.filtsmooth.statespace.IOUP", "probnum.diffeq.steprule.AdaptiveSteps", "probnum.filtsmooth.statespace.Matern", "probnum.diffeq.odefiltsmooth.ivp2filter.ivp2ekf0", "probnum.diffeq.steprule.Const...
[((8447, 8507), 'probnum.diffeq.odefiltsmooth.ivpfiltsmooth.GaussianIVPFilter', 'GaussianIVPFilter', (['ivp', 'gfilt'], {'with_smoothing': 'with_smoothing'}), '(ivp, gfilt, with_smoothing=with_smoothing)\n', (8464, 8507), False, 'from probnum.diffeq.odefiltsmooth.ivpfiltsmooth import GaussianIVPFilter\n'), ((9004, 9032...
""" NCL_polyg_18.py =============== This script illustrates the following concepts: - Adding lines, markers, and polygons to a map - Drawing lines, markers, polygons, and text in inset axes See following URLs to see the reproduced NCL plot & script: - Original NCL script: https://www.ncl.ucar.edu/Application...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "geocat.viz.util.set_titles_and_labels", "matplotlib.patches.Rectangle", "cartopy.mpl.ticker.LongitudeFormatter", "cartopy.feature.NaturalEarthFeature", "cartopy.crs.PlateCarree", "matplotlib.patches.Circle", "matplotlib.pyplot.figure", "geoca...
[((1163, 1191), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 10)'}), '(figsize=(10, 10))\n', (1173, 1191), True, 'import matplotlib.pyplot as plt\n'), ((1244, 1275), 'matplotlib.pyplot.GridSpec', 'plt.GridSpec', (['(2)', '(20)'], {'figure': 'fig'}), '(2, 20, figure=fig)\n', (1256, 1275), True, 'impo...
import numpy as np class StanleyControl: def __init__(self, kp=0.5): self.path = None self.kp = kp def set_path(self, path): self.path = path.copy() def _search_nearest(self, pos): min_dist = 99999999 min_id = -1 for i in range(self.path.shape[0]): ...
[ "sys.path.append", "path_generator.path2", "numpy.arctan2", "numpy.deg2rad", "cv2.waitKey", "bicycle_model.KinematicModel", "numpy.ones", "numpy.hypot", "cv2.flip", "numpy.dot", "cv2.imshow" ]
[((2604, 2626), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (2619, 2626), False, 'import sys\n'), ((2695, 2717), 'path_generator.path2', 'path_generator.path2', ([], {}), '()\n', (2715, 2717), False, 'import path_generator\n'), ((2733, 2755), 'numpy.ones', 'np.ones', (['(600, 600, 3)'], {}),...
import pandas as pd import numpy as np import warnings warnings.filterwarnings('ignore') import os print(os.getcwd()) train = pd.read_csv('../data/prep/train3.csv') test = pd.read_csv('../data/prep/test3.csv') submission = pd.read_csv('../data/raw/housing/sample_submission.csv') train = train.iloc[:, 1:] test = ...
[ "numpy.abs", "warnings.filterwarnings", "pandas.read_csv", "os.getcwd", "numpy.std", "numpy.zeros", "sklearn.model_selection.KFold", "ngboost.NGBRegressor", "numpy.expm1", "sklearn.metrics.make_scorer", "numpy.mean", "catboost.Pool" ]
[((59, 92), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (82, 92), False, 'import warnings\n'), ((132, 170), 'pandas.read_csv', 'pd.read_csv', (['"""../data/prep/train3.csv"""'], {}), "('../data/prep/train3.csv')\n", (143, 170), True, 'import pandas as pd\n'), ((178, 215...
from unittest import TestCase import numpy as np from copulas.bivariate.independence import Independence class TestIndependence(TestCase): def test___init__(self): """Independence copula can be instantiated directly.""" # Setup / Run instance = Independence() # Check as...
[ "numpy.array", "copulas.bivariate.independence.Independence" ]
[((278, 292), 'copulas.bivariate.independence.Independence', 'Independence', ([], {}), '()\n', (290, 292), False, 'from copulas.bivariate.independence import Independence\n'), ((558, 572), 'copulas.bivariate.independence.Independence', 'Independence', ([], {}), '()\n', (570, 572), False, 'from copulas.bivariate.indepen...
#!/usr/bin/env python import os import json import torch import pprint import argparse import importlib import numpy as np import cv2 import matplotlib matplotlib.use("Agg") from config import system_configs from nnet.py_factory import NetworkFactory from config import system_configs from utils import crop_image, no...
[ "argparse.ArgumentParser", "nnet.py_factory.NetworkFactory", "numpy.clip", "pprint.pprint", "cv2.rectangle", "cv2.imshow", "os.path.join", "config.system_configs.update_config", "utils.normalize_", "cv2.resize", "numpy.partition", "utils.crop_image", "cv2.waitKey", "external.nms.soft_nms_m...
[((153, 174), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (167, 174), False, 'import matplotlib\n'), ((1435, 1488), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Demo CornerNet"""'}), "(description='Demo CornerNet')\n", (1458, 1488), False, 'import argparse\n')...
''' Table.py A module/class for creating LaTeX deluxetable's. In a nutshell, you create a table instance, add columns, set options, then call the pring method. written by <NAME>, http://users.obs.carnegiescience.edu/~cburns/site/?p=22 ''' from __future__ import print_function from __future__ import absolute_import ...
[ "numpy.shape", "numpy.isnan" ]
[((4405, 4425), 'numpy.shape', 'numpy.shape', (['data[0]'], {}), '(data[0])\n', (4416, 4425), False, 'import numpy\n'), ((4624, 4644), 'numpy.shape', 'numpy.shape', (['sigfigs'], {}), '(sigfigs)\n', (4635, 4644), False, 'import numpy\n'), ((4296, 4314), 'numpy.shape', 'numpy.shape', (['datum'], {}), '(datum)\n', (4307,...
#!/usr/bin/env python from __future__ import print_function import argparse import functools import imghdr import sys import time from random import randint import cv2 as cv import numpy as np def strtime(millsec, form="%i:%02i:%06.3f"): """ Time formating function Args: millsec(int): Number o...
[ "numpy.abs", "argparse.ArgumentParser", "cv2.bitwise_and", "cv2.medianBlur", "cv2.getPerspectiveTransform", "cv2.arcLength", "cv2.approxPolyDP", "numpy.argmax", "numpy.ones", "numpy.argmin", "cv2.floodFill", "cv2.rectangle", "cv2.absdiff", "cv2.imshow", "cv2.inRange", "cv2.warpPerspect...
[((1006, 1027), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (1021, 1027), False, 'import functools\n'), ((33858, 33899), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'desc'}), '(description=desc)\n', (33881, 33899), False, 'import argparse\n'), ((1083, 1094), 'time.ti...
import pandas as pd import numpy as np from melusine.prepare_email.body_header_extraction import extract_last_body from melusine.prepare_email.body_header_extraction import extract_body from melusine.prepare_email.body_header_extraction import extract_header structured_body = [ { "meta": {"date": None, "f...
[ "pandas.DataFrame", "melusine.prepare_email.body_header_extraction.extract_body", "melusine.prepare_email.body_header_extraction.extract_header", "numpy.testing.assert_string_equal", "pandas.Series", "pandas.testing.assert_series_equal" ]
[((1557, 1609), 'pandas.DataFrame', 'pd.DataFrame', (["{'structured_body': [structured_body]}"], {}), "({'structured_body': [structured_body]})\n", (1569, 1609), True, 'import pandas as pd\n'), ((1627, 1676), 'pandas.Series', 'pd.Series', (["['Je vous remercie pour le document ']"], {}), "(['Je vous remercie pour le do...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
[ "os.mkdir", "src.config.config.logger.info", "src.config.config.logger.save_args", "numpy.load", "numpy.argmax", "mindspore.ops.operations.Cast", "mindspore.Tensor", "numpy.argsort", "src.utils.var_init.load_pretrain_model", "src.utils.logging.get_logger", "src.model_utils.moxing_adapter.moxing_...
[((4820, 4836), 'src.model_utils.moxing_adapter.moxing_wrapper', 'moxing_wrapper', ([], {}), '()\n', (4834, 4836), False, 'from src.model_utils.moxing_adapter import moxing_wrapper\n'), ((2158, 2201), 'src.utils.logging.get_logger', 'get_logger', (['config.outputs_dir', 'config.rank'], {}), '(config.outputs_dir, config...
import tensorflow as tf import os import glob import vng_model as md import numpy as np import csv FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string('checkpoint_dir', '', """Direction where the trained weights of model is save""") tf.app.flags.DEFINE_string('eval_data_path', '', ...
[ "tensorflow.train.Coordinator", "tensorflow.get_collection", "tensorflow.train.batch", "tensorflow.app.flags.DEFINE_integer", "os.path.join", "tensorflow.train.start_queue_runners", "tensorflow.placeholder", "tensorflow.squeeze", "tensorflow.train.string_input_producer", "tensorflow.train.get_chec...
[((128, 236), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""checkpoint_dir"""', '""""""', '"""Direction where the trained weights of model is save"""'], {}), "('checkpoint_dir', '',\n 'Direction where the trained weights of model is save')\n", (154, 236), True, 'import tensorflow as tf\n'...
#!/usr/bin/env python import numpy as np # scientific computing lib import sounddevice as sd # sounddevice / hostapi handling import sys # used for printing err to std stream import matplotlib.pyplot as plt # plots and graphs import os ...
[ "matplotlib.pyplot.title", "PyQt5.QtWidgets.QApplication.palette", "PyQt5.QtWidgets.QGridLayout", "PyQt5.QtWidgets.QPushButton", "scipy.io.wavfile.read", "numpy.arange", "PyQt5.QtWidgets.QApplication", "PyQt5.QtWidgets.QApplication.setAttribute", "PyQt5.QtWidgets.QTabWidget", "os.path.join", "py...
[((1407, 1483), 'PyQt5.QtWidgets.QApplication.setAttribute', 'QtWidgets.QApplication.setAttribute', (['QtCore.Qt.AA_EnableHighDpiScaling', '(True)'], {}), '(QtCore.Qt.AA_EnableHighDpiScaling, True)\n', (1442, 1483), False, 'from PyQt5 import QtWidgets\n'), ((1504, 1577), 'PyQt5.QtWidgets.QApplication.setAttribute', 'Qt...
from scipy.spatial.distance import cdist import numpy as np class DBScan(): """This is a simple implementation of clustering using the DBScan algorithm. My algorithm will return labels for clusters, -1 indicating an outlier""" def __init__(self, max_dist, min_pts): self.data = None ...
[ "numpy.reshape" ]
[((1520, 1542), 'numpy.reshape', 'np.reshape', (['P', '(-1, 2)'], {}), '(P, (-1, 2))\n', (1530, 1542), True, 'import numpy as np\n'), ((1542, 1575), 'numpy.reshape', 'np.reshape', (['self.data[i]', '(-1, 2)'], {}), '(self.data[i], (-1, 2))\n', (1552, 1575), True, 'import numpy as np\n'), ((3100, 3133), 'numpy.reshape',...
from pathlib import Path import random from typing import Optional import numpy as np import ase from ase.utils.ff import Morse, Angle, Dihedral, VdW from ase.calculators.ff import ForceField from ase.optimize.precon import FF, PreconLBFGS from ase.optimize.precon.neighbors import get_neighbours from rdkit import Ch...
[ "random.randint", "numpy.deg2rad", "ase.optimize.precon.neighbors.get_neighbours", "ase.optimize.precon.PreconLBFGS", "rdkit.Chem.AllChem.MMFFGetMoleculeForceField", "ase.Atom", "ase.utils.ff.Dihedral", "ase.calculators.ff.ForceField", "pathlib.Path", "ase.utils.ff.Morse", "ase.optimize.precon.F...
[((1718, 1729), 'ase.Atoms', 'ase.Atoms', ([], {}), '()\n', (1727, 1729), False, 'import ase\n'), ((1970, 1996), 'rdkit.Chem.MolFromSmiles', 'Chem.MolFromSmiles', (['smiles'], {}), '(smiles)\n', (1988, 1996), False, 'from rdkit import Chem\n'), ((2007, 2022), 'rdkit.Chem.AddHs', 'Chem.AddHs', (['mol'], {}), '(mol)\n', ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ In this script we find outlier traces based on their distance from outhers. Every trace isbecomivng a vector which contain information both from the structure and times. Then based on the k and r we found the outlyiers. """ import datetime from pm4py.algo.filtering.l...
[ "sklearn.preprocessing.StandardScaler", "mtree.MTree", "datetime.timedelta", "numpy.array", "pm4py.algo.filtering.log.attributes.attributes_filter.get_attribute_values", "os.listdir", "pm4py.objects.log.importer.xes.factory.apply" ]
[((699, 762), 'pm4py.algo.filtering.log.attributes.attributes_filter.get_attribute_values', 'log_attributes_filter.get_attribute_values', (['log', '"""concept:name"""'], {}), "(log, 'concept:name')\n", (741, 762), True, 'from pm4py.algo.filtering.log.attributes import attributes_filter as log_attributes_filter\n'), ((4...
# 3 - simple plot """ Please note, this script is for python3+. If you are using python2+, please modify it accordingly. """ import matplotlib.pyplot as plt import numpy as np x = np.linspace(-1, 1, 100) y = 2*x + 1 plt.plot(x, y) plt.show()
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.linspace" ]
[((182, 205), 'numpy.linspace', 'np.linspace', (['(-1)', '(1)', '(100)'], {}), '(-1, 1, 100)\n', (193, 205), True, 'import numpy as np\n'), ((218, 232), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {}), '(x, y)\n', (226, 232), True, 'import matplotlib.pyplot as plt\n'), ((233, 243), 'matplotlib.pyplot.show', 'plt...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Two-dimensional simulation code for buoyancy driven convection below an evaporating salt lake. Allows for input of different simulation parameters (see main.py -h for all available options) as well as different boundary conditions. This source code is subject to the term...
[ "numpy.fft.ifftshift", "numpy.abs", "os.makedirs", "argparse.ArgumentParser", "os.getcwd", "numpy.fft.fft", "os.path.exists", "numpy.zeros", "numpy.transpose", "time.time", "numpy.array", "numpy.matmul", "os.path.join", "sys.exit" ]
[((2103, 2243), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '(\'Simulation of two-dimensional \' + \'porous media flow\' +\n """ \nCopyright (C) 2017 <NAME> & <NAME>""")'}), '(description=\'Simulation of two-dimensional \' +\n \'porous media flow\' + """ \nCopyright (C) 2017 <NAME> ...
# -*- coding: utf-8 -*- """ test_celllab_cts.py: Unit-test function for CellLabCTS. Created on Thu Jul 9 08:20:06 2015 @author: gtucker """ from nose.tools import assert_equal from numpy.testing import assert_array_equal from landlab import RasterModelGrid, HexModelGrid from landlab.ca.celllab_cts import Transition...
[ "landlab.ca.oriented_raster_cts.OrientedRasterCTS", "landlab.HexModelGrid", "landlab.RasterModelGrid", "landlab.ca.celllab_cts.Transition", "heapq.heappush", "numpy.testing.assert_array_equal", "landlab.ca.oriented_hex_cts.OrientedHexCTS", "nose.tools.assert_equal", "heapq.heappop", "numpy.arange"...
[((1258, 1356), 'landlab.ca.celllab_cts.Transition', 'Transition', (['(0, 0, 0)', '(1, 1, 0)', '(1.0)'], {'name': '"""test"""', 'swap_properties': '(False)', 'prop_update_fn': 'None'}), "((0, 0, 0), (1, 1, 0), 1.0, name='test', swap_properties=False,\n prop_update_fn=None)\n", (1268, 1356), False, 'from landlab.ca.c...
# -*- coding: utf-8 -*- # File: maputils.py # Copyright 2021 Dr. <NAME>. 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...
[ "numpy.random.uniform", "numpy.asarray", "numpy.zeros", "termcolor.colored", "numpy.histogram", "tabulate.tabulate", "numpy.arange", "functools.wraps" ]
[((4073, 4094), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (4088, 4094), False, 'import functools\n'), ((5213, 5242), 'numpy.arange', 'np.arange', (['(1)', '(cat_numbers + 2)'], {}), '(1, cat_numbers + 2)\n', (5222, 5242), True, 'import numpy as np\n'), ((5266, 5287), 'numpy.zeros', 'np.zeros', (...
__author__ = '<NAME>' import numpy as np from matplotlib import pyplot as plt def PlotData(Data, size=50, showGr = 1, newWin = 1, titleT = None): if newWin: plt.figure() if titleT != None: plt.title(titleT) plt.scatter(Data[:,1][Data[:,0]==0], Data[:,2][Data[:,0]==0], color...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "numpy.sum", "numpy.argmax", "matplotlib.pyplot.scatter", "numpy.argmin", "numpy.argsort", "matplotlib.pyplot.figure", "numpy.max", "numpy.unique" ]
[((253, 348), 'matplotlib.pyplot.scatter', 'plt.scatter', (['Data[:, 1][Data[:, 0] == 0]', 'Data[:, 2][Data[:, 0] == 0]'], {'color': '"""red"""', 's': 'size'}), "(Data[:, 1][Data[:, 0] == 0], Data[:, 2][Data[:, 0] == 0], color\n ='red', s=size)\n", (264, 348), True, 'from matplotlib import pyplot as plt\n'), ((343, ...
import numpy as np x=1.0 y=2.0 #exponents and logarithms print(np.exp(x)) #e^x print(np.log(x)) #ln x print(np.log10(x)) #log_10 x print(np.log2(x)) #log_2 x #min/max/misc print(np.fabs(x)) print(np.fmin(x,y)) print(np.fmax(x,y)) #populate arrays n=100 z=np.arange(n,dtype=float) z*=2.0*np.pi/float(n-1) sin_z=np...
[ "numpy.fmin", "numpy.fmax", "numpy.log", "numpy.log2", "numpy.sin", "numpy.arange", "numpy.exp", "numpy.fabs", "numpy.interp", "numpy.log10" ]
[((263, 288), 'numpy.arange', 'np.arange', (['n'], {'dtype': 'float'}), '(n, dtype=float)\n', (272, 288), True, 'import numpy as np\n'), ((318, 327), 'numpy.sin', 'np.sin', (['z'], {}), '(z)\n', (324, 327), True, 'import numpy as np\n'), ((65, 74), 'numpy.exp', 'np.exp', (['x'], {}), '(x)\n', (71, 74), True, 'import nu...
""" Data preparation script for GNN tracking. This script processes h5 files of the ntuple and produces graph data on disk. Will also save a csv file of the time to build each graph The differences between Savannah's code is: - CMS geometry instead of TrackML geometry (main difference is just the layers that conn...
[ "yaml.load", "numpy.arctan2", "argparse.ArgumentParser", "os.path.isfile", "numpy.arange", "os.path.join", "csv.DictWriter", "sys.path.append", "pandas.read_hdf", "IPython.embed", "numpy.tan", "pandas.concat", "numpy.stack", "functools.partial", "os.path.expandvars", "multiprocessing.P...
[((569, 591), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (584, 591), False, 'import sys\n'), ((737, 815), 'collections.namedtuple', 'namedtuple', (['"""Graph"""', "['x', 'edge_attr', 'edge_index', 'y', 'pid', 'pt', 'eta']"], {}), "('Graph', ['x', 'edge_attr', 'edge_index', 'y', 'pid', 'pt',...
# -*- coding: UTF-8 -*- import tensorflow.compat.v1 as tf import os, sys import numpy as np from PIL import Image import cv2 as cv def image_processing(image, height, width): # 解码图像数据 image = tf.image.decode_jpeg(image, channels=3) # 归一化,归一化区间是[-1, 1] image = (tf.cast(image, dtype=tf.float32) - 127.0) ...
[ "tensorflow.compat.v1.train.batch_join", "tensorflow.compat.v1.train.string_input_producer", "os.path.join", "tensorflow.compat.v1.image.resize_bilinear", "tensorflow.compat.v1.name_scope", "tensorflow.compat.v1.FIFOQueue", "tensorflow.compat.v1.squeeze", "tensorflow.compat.v1.expand_dims", "numpy.r...
[((201, 240), 'tensorflow.compat.v1.image.decode_jpeg', 'tf.image.decode_jpeg', (['image'], {'channels': '(3)'}), '(image, channels=3)\n', (221, 240), True, 'import tensorflow.compat.v1 as tf\n'), ((376, 400), 'tensorflow.compat.v1.expand_dims', 'tf.expand_dims', (['image', '(0)'], {}), '(image, 0)\n', (390, 400), True...
# -*- coding: utf-8 -*- """This module defines various layout objects one can add and manipulate in a template. """ from typing import TYPE_CHECKING, Union, List, Tuple, Optional, Dict, Any, Iterator, Iterable, \ Generator import abc import numpy as np from copy import deepcopy from .util import transform_table,...
[ "numpy.absolute", "copy.deepcopy", "numpy.linalg.norm", "numpy.array", "numpy.dot" ]
[((37893, 37921), 'numpy.array', 'np.array', (['pt_list'], {'dtype': 'int'}), '(pt_list, dtype=int)\n', (37901, 37921), True, 'import numpy as np\n'), ((41007, 41025), 'numpy.array', 'np.array', (['[dx, dy]'], {}), '([dx, dy])\n', (41015, 41025), True, 'import numpy as np\n'), ((41396, 41414), 'numpy.array', 'np.array'...
import numpy as np def calculate(list): if (len(list)<9): raise ValueError('List must contain nine numbers.') else : arr = np.asarray(list) arr = arr.reshape(3,3) calculations = {'mean':[],'variance':[] ,'standard deviation':[],'max':[],'min':[],'sum':[]} t1 = np.mean(arr, axis = 0) t1 =...
[ "numpy.sum", "numpy.std", "numpy.asarray", "numpy.max", "numpy.mean", "numpy.min", "numpy.var" ]
[((138, 154), 'numpy.asarray', 'np.asarray', (['list'], {}), '(list)\n', (148, 154), True, 'import numpy as np\n'), ((289, 309), 'numpy.mean', 'np.mean', (['arr'], {'axis': '(0)'}), '(arr, axis=0)\n', (296, 309), True, 'import numpy as np\n'), ((342, 362), 'numpy.mean', 'np.mean', (['arr'], {'axis': '(1)'}), '(arr, axi...
import numpy as np import pandas as pd from requests.exceptions import HTTPError import xarray as xr from toffy.mibitracker_utils import MibiRequests from toffy import qc_comp from toffy import settings import ark.utils.io_utils as io_utils import ark.utils.misc_utils as misc_utils import ark.utils.test_utils as test_...
[ "os.mkdir", "toffy.qc_comp.visualize_qc_metrics", "pandas.read_csv", "numpy.allclose", "toffy.qc_comp.download_mibitracker_data", "pathlib.Path", "toffy.qc_comp.compute_nonzero_mean_intensity", "numpy.arange", "pytest.mark.parametrize", "os.path.join", "pandas.DataFrame", "tempfile.TemporaryDi...
[((1974, 2093), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_fovs,test_chans,test_sub_folder,actual_points,actual_ids"""', 'FOVS_CHANS_TEST_MIBI'], {}), "(\n 'test_fovs,test_chans,test_sub_folder,actual_points,actual_ids',\n FOVS_CHANS_TEST_MIBI)\n", (1997, 2093), False, 'import pytest\n'), ((...
"""Comparison of RBF and polynomial kernels for SVM""" import numpy as np from pmlb import classification_dataset_names, fetch_data from sklearn.dummy import DummyClassifier, DummyRegressor from sklearn.model_selection import (GridSearchCV, cross_val_score, train_test_split) from sk...
[ "sklearn.dummy.DummyClassifier", "sklearn.preprocessing.StandardScaler", "sklearn.model_selection.cross_val_score", "numpy.logspace", "pmlb.fetch_data", "numpy.mean", "sklearn.svm.SVC", "numpy.round" ]
[((1183, 1208), 'pmlb.fetch_data', 'fetch_data', (['dataset', '(True)'], {}), '(dataset, True)\n', (1193, 1208), False, 'from pmlb import classification_dataset_names, fetch_data\n'), ((1433, 1477), 'sklearn.model_selection.cross_val_score', 'cross_val_score', (['poly', 'X', 'y'], {'cv': '(5)', 'n_jobs': '(-1)'}), '(po...
import numpy as np import sys ''' v0.2 Nov. 23, 2017 - add test_circumcenterSphTri() v0.1 Nov. 23, 2017 - add calc_xc() - add calc_gamma() - add calc_beta() - add calc_denom() - add calc_alpha() - add calc_dotProduct_2d() - add calc_verticesDistance() - add circumcenterSphTri() ''' def calc_dotProd...
[ "numpy.sum", "numpy.cross", "numpy.array", "numpy.tile", "numpy.dot" ]
[((503, 516), 'numpy.array', 'np.array', (['res'], {}), '(res)\n', (511, 516), True, 'import numpy as np\n'), ((1087, 1105), 'numpy.cross', 'np.cross', (['lhs', 'rhs'], {}), '(lhs, rhs)\n', (1095, 1105), True, 'import numpy as np\n'), ((1156, 1175), 'numpy.array', 'np.array', (['(crs * crs)'], {}), '(crs * crs)\n', (11...
from kivy.properties import ListProperty, ObjectProperty, StringProperty, \ NumericProperty from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.label import Label from kivy.lang import Builder from kivy.graphics import Color, Line from kivy.app import App import numpy as np im...
[ "kivy.properties.ListProperty", "kivy.graphics.Line", "kivy.lang.Builder.load_string", "numpy.random.randn", "kivy.properties.StringProperty", "kivy.uix.button.Button", "kivy.uix.boxlayout.BoxLayout", "random.random", "kivy.graphics.Color", "kivy.properties.ObjectProperty" ]
[((411, 1693), 'kivy.lang.Builder.load_string', 'Builder.load_string', (['"""\n#: import platform sys.platform\n<LegendLabel>:\n orientation: \'horizontal\'\n Label:\n size_hint_x: 0.25\n canvas.before:\n Color:\n hsv: root.hsv + [1]\n Line:\n widt...
import pymesh import json import pathlib import copy import math import itertools import numpy from scipy.spatial.transform import Rotation import context from fixture_utils import save_fixture, get_fixture_dir_path, get_meshes_dir_path scale = 1 barring = { "mesh": "507-movements/227-chain-pully/barring.obj",...
[ "copy.deepcopy", "fixture_utils.get_meshes_dir_path", "pymesh.form_mesh", "numpy.arctan2", "scipy.spatial.transform.Rotation.from_euler", "fixture_utils.get_fixture_dir_path", "numpy.empty", "numpy.zeros", "numpy.hstack", "numpy.sin", "numpy.linalg.norm", "numpy.array", "numpy.cos", "numpy...
[((1068, 1093), 'numpy.zeros', 'numpy.zeros', (['angles.shape'], {}), '(angles.shape)\n', (1079, 1093), False, 'import numpy\n'), ((1105, 1128), 'numpy.hstack', 'numpy.hstack', (['[x, y, z]'], {}), '([x, y, z])\n', (1117, 1128), False, 'import numpy\n'), ((1184, 1215), 'numpy.empty', 'numpy.empty', (['(num_links + 1, 3...
import numpy as np import pandas as pd from neural_network import Neural_Network from sklearn.metrics import accuracy_score from sklearn.linear_model import LogisticRegression from visualization import plot_decision_boundary def read_data(x_file, y_file): data = [] labels = [] with open(x_file, "r") as x_...
[ "pandas.read_csv", "sklearn.metrics.accuracy_score", "numpy.zeros", "sklearn.linear_model.LogisticRegression", "numpy.array" ]
[((610, 640), 'pandas.read_csv', 'pd.read_csv', (['file'], {'header': 'None'}), '(file, header=None)\n', (621, 640), True, 'import pandas as pd\n'), ((938, 958), 'sklearn.linear_model.LogisticRegression', 'LogisticRegression', ([], {}), '()\n', (956, 958), False, 'from sklearn.linear_model import LogisticRegression\n')...
import numpy as np import pytest from pyinfraformat.core.utils import ( custom_float, custom_int, info_fi, is_number, print_info, ) @pytest.mark.parametrize( "nums", [ (1, True), ("1", True), ("1.1", True), ("1j", True), ("1.j", True), ("-",...
[ "pyinfraformat.core.utils.is_number", "pyinfraformat.core.utils.print_info", "numpy.isnan", "pytest.raises", "pyinfraformat.core.utils.custom_int", "pytest.mark.parametrize", "pyinfraformat.core.utils.info_fi", "pyinfraformat.core.utils.custom_float" ]
[((156, 304), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""nums"""', "[(1, True), ('1', True), ('1.1', True), ('1j', True), ('1.j', True), ('-', \n True), ('a', False), ('1a', False)]"], {}), "('nums', [(1, True), ('1', True), ('1.1', True), (\n '1j', True), ('1.j', True), ('-', True), ('a', False)...
from __future__ import print_function from .cmseq import CMSEQ_DEFAULTS from .cmseq import BamFile import pandas as pd import numpy as np import argparse def bd_from_file(): parser = argparse.ArgumentParser(description="calculate the Breadth and Depth of coverage of BAMFILE.") parser.add_argument('BAMFILE', hel...
[ "numpy.nanmean", "argparse.ArgumentParser", "numpy.isnan", "numpy.nanmedian" ]
[((189, 288), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""calculate the Breadth and Depth of coverage of BAMFILE."""'}), "(description=\n 'calculate the Breadth and Depth of coverage of BAMFILE.')\n", (212, 288), False, 'import argparse\n'), ((2596, 2625), 'numpy.isnan', 'np.isnan'...
""" Author : <NAME> (<EMAIL>) Institution : Vrije Universiteit Brussel (VUB) Date : November 2019 Main script for heat calculation and plotting """ #%% # ------------------------------------------------------------------------- # PYTHON PACKAGES # ---------------------------------------------------------...
[ "os.getcwd", "cdo.Cdo", "numpy.load" ]
[((417, 422), 'cdo.Cdo', 'Cdo', ([], {}), '()\n', (420, 422), False, 'from cdo import Cdo\n'), ((2078, 2089), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2087, 2089), False, 'import os\n'), ((377, 388), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (386, 388), False, 'import os\n'), ((5760, 5821), 'numpy.load', 'np.load...
# This source code is part of the Biotite package and is distributed # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further # information. __name__ = "biotite.sequence.graphics" __author__ = "<NAME>" __all__ = ["plot_sequence_logo"] import numpy as np from ...visualize import set_font_size_in_coord fr...
[ "numpy.sum", "numpy.log2", "numpy.zeros", "numpy.argsort", "warnings.warn" ]
[((2665, 2700), 'numpy.argsort', 'np.argsort', (['symbols_heights'], {'axis': '(1)'}), '(symbols_heights, axis=1)\n', (2675, 2700), True, 'import numpy as np\n'), ((3801, 3821), 'numpy.zeros', 'np.zeros', (['freq.shape'], {}), '(freq.shape)\n', (3809, 3821), True, 'import numpy as np\n'), ((1818, 1935), 'warnings.warn'...
from env_suite.envs import controlTableLine import time import numpy as np global isWindows isWindows = False try: from win32api import STD_INPUT_HANDLE from win32console import GetStdHandle, KEY_EVENT, ENABLE_ECHO_INPUT, ENABLE_LINE_INPUT, ENABLE_PROCESSED_INPUT isWindows = True except ImportError as e: ...
[ "sys.stdin.read", "termios.tcgetattr", "env_suite.envs.controlTableLine", "win32console.GetStdHandle", "numpy.zeros", "termios.tcsetattr", "time.sleep", "select.select", "numpy.array", "sys.stdin.fileno" ]
[((2464, 2482), 'env_suite.envs.controlTableLine', 'controlTableLine', ([], {}), '()\n', (2480, 2482), False, 'from env_suite.envs import controlTableLine\n'), ((495, 525), 'win32console.GetStdHandle', 'GetStdHandle', (['STD_INPUT_HANDLE'], {}), '(STD_INPUT_HANDLE)\n', (507, 525), False, 'from win32console import GetSt...
from sys import exit import numpy as np import h5py from .plot import Plot from .utils import load_posteriors, create_templates from .conf import set_plot_params class Validation: """ Internal class for performing validation on the univariate and/or multivariate posterior PDFs of the test samples generate...
[ "numpy.stack", "h5py.File", "numpy.sum", "numpy.empty", "numpy.zeros", "numpy.min", "numpy.max", "numpy.arange", "numpy.linspace", "sys.exit" ]
[((2339, 2458), 'h5py.File', 'h5py.File', (["(self.path + self.validation_folder + 'validation.h5')", '"""w"""'], {'driver': '"""core"""', 'backing_store': 'save_validation'}), "(self.path + self.validation_folder + 'validation.h5', 'w', driver\n ='core', backing_store=save_validation)\n", (2348, 2458), False, 'impo...
import copy import os import numpy as np import matplotlib matplotlib.use('Agg') try: from sklearn.model_selection import train_test_split except ImportError: from sklearn.cross_validation import train_test_split from libact.base.dataset import Dataset, import_libsvm_sparse from libact.query_strategies.random_s...
[ "matplotlib.pyplot.title", "sklearn.cross_validation.train_test_split", "copy.deepcopy", "numpy.load", "matplotlib.pyplot.show", "libact.labelers.ideal_labeler.IdealLabeler", "libact.base.dataset.Dataset", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "os.path.realpath", "matplotlib.use"...
[((59, 80), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (73, 80), False, 'import matplotlib\n'), ((1458, 1501), 'sklearn.cross_validation.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': 'test_size'}), '(X, y, test_size=test_size)\n', (1474, 1501), False, 'from sklearn.cross_v...
import numpy as np import xarray as xr # from concurrent.futures import ProcessPoolExecutor # pool = ProcessPoolExecutor() from functools import partial import logging log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) double_array = partial(np.asarray, dtype='f8') def gen_sq_mean(sq): sqa =...
[ "functools.partial", "numpy.dtype", "numpy.einsum", "xarray.Dataset.from_dict", "logging.NullHandler", "numpy.fromiter", "logging.getLogger" ]
[((176, 203), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (193, 203), False, 'import logging\n'), ((258, 289), 'functools.partial', 'partial', (['np.asarray'], {'dtype': '"""f8"""'}), "(np.asarray, dtype='f8')\n", (265, 289), False, 'from functools import partial\n'), ((219, 240), 'log...
""" This modules defines the board of the game based on the configuration the user has requested """ import numpy as np import pawn import math ##DIRECTIONS## NORTHWEST = "northwest" NORTHEAST = "northeast" SOUTHWEST = "southwest" SOUTHEAST = "southeast" # Constant for Obstacle in the game, 21 because max pawn_id in ...
[ "pawn.Pawn", "numpy.random.randint", "numpy.zeros", "math.ceil" ]
[((510, 548), 'numpy.zeros', 'np.zeros', (['(numOfSquares, numOfSquares)'], {}), '((numOfSquares, numOfSquares))\n', (518, 548), True, 'import numpy as np\n'), ((1448, 1484), 'math.ceil', 'math.ceil', (['(num_of_pawns / (cols / 2))'], {}), '(num_of_pawns / (cols / 2))\n', (1457, 1484), False, 'import math\n'), ((17954,...
from pathlib import Path import numpy as np import joblib from keras.preprocessing import image from keras.applications import vgg16 from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten # Path to folders with training data dog_path = Path("img") / "dogs" not_dog_path = Path("img") / "n...
[ "keras.models.Sequential", "keras.layers.Dropout", "keras.layers.Flatten", "numpy.expand_dims", "keras.preprocessing.image.img_to_array", "keras.preprocessing.image.load_img", "pathlib.Path", "numpy.array", "keras.layers.Dense", "keras.applications.vgg16.VGG16", "keras.applications.vgg16.preproc...
[((1161, 1177), 'numpy.array', 'np.array', (['images'], {}), '(images)\n', (1169, 1177), True, 'import numpy as np\n'), ((1232, 1248), 'numpy.array', 'np.array', (['labels'], {}), '(labels)\n', (1240, 1248), True, 'import numpy as np\n'), ((1299, 1330), 'keras.applications.vgg16.preprocess_input', 'vgg16.preprocess_inp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 7 18:44:59 2017 @author: pramos Usufull functions for UVW velocity-space treatments """ import numpy as np #constants incl=np.deg2rad(62.87124882) #inclination of galactic plane alom=np.deg2rad(282.8594813) #RA of the equatorial node lom=n...
[ "numpy.arctan2", "numpy.deg2rad", "numpy.zeros", "numpy.arcsin", "numpy.sin", "numpy.tan", "numpy.cos", "numpy.dot", "numpy.sqrt" ]
[((198, 221), 'numpy.deg2rad', 'np.deg2rad', (['(62.87124882)'], {}), '(62.87124882)\n', (208, 221), True, 'import numpy as np\n'), ((261, 284), 'numpy.deg2rad', 'np.deg2rad', (['(282.8594813)'], {}), '(282.8594813)\n', (271, 284), True, 'import numpy as np\n'), ((319, 342), 'numpy.deg2rad', 'np.deg2rad', (['(32.936805...
import unittest import numpy as np from .. import getisord from libpysal.weights.distance import DistanceBand from libpysal.common import pandas POINTS = [(10, 10), (20, 10), (40, 10), (15, 20), (30, 20), (30, 30)] W = DistanceBand(POINTS, threshold=15) Y = np.array([2, 3, 3.2, 5, 8, 7]) PANDAS_EXTINCT = pandas is N...
[ "pandas.DataFrame", "unittest.skipIf", "numpy.random.seed", "unittest.TextTestRunner", "unittest.TestSuite", "numpy.array", "unittest.TestLoader", "libpysal.weights.distance.DistanceBand", "numpy.testing.assert_allclose", "numpy.unique" ]
[((221, 255), 'libpysal.weights.distance.DistanceBand', 'DistanceBand', (['POINTS'], {'threshold': '(15)'}), '(POINTS, threshold=15)\n', (233, 255), False, 'from libpysal.weights.distance import DistanceBand\n'), ((260, 290), 'numpy.array', 'np.array', (['[2, 3, 3.2, 5, 8, 7]'], {}), '([2, 3, 3.2, 5, 8, 7])\n', (268, 2...
""" Inspect a model with specific parameters defined in config_sandbox.py """ from __future__ import print_function import visualutil import setuputil import yaml import numpy import lensutil import os from astropy.io import fits from subprocess import call import sample_vis import uvutil def plot(cleanup=True, ...
[ "yaml.load", "numpy.abs", "sample_vis.uvmodel", "scipy.stats.norm", "numpy.isfinite", "numpy.append", "lensutil.sbmap", "setuputil.loadParams", "uvutil.uvload", "uvutil.pcdload", "os.system", "subprocess.call", "astropy.io.fits.open", "os.getpid", "numpy.log", "astropy.io.fits.writeto"...
[((594, 615), 'yaml.load', 'yaml.load', (['configfile'], {}), '(configfile)\n', (603, 615), False, 'import yaml\n'), ((634, 662), 'setuputil.loadParams', 'setuputil.loadParams', (['config'], {}), '(config)\n', (654, 662), False, 'import setuputil\n'), ((677, 708), 'setuputil.fixParams', 'setuputil.fixParams', (['paramS...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 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.apache.org/licenses/LICENSE-2.0 # # Unl...
[ "numpy.load", "numpy.save", "os.makedirs", "os.getcwd", "os.path.isdir", "neural_compressor.utils.utility.LazyImport", "neural_compressor.utils.utility.logger.warning", "os.path.dirname", "os.path.exists", "neural_compressor.utils.utility.logger.info", "os.path.isfile", "neural_compressor.conf...
[((975, 994), 'neural_compressor.utils.utility.LazyImport', 'LazyImport', (['"""torch"""'], {}), "('torch')\n", (985, 994), False, 'from neural_compressor.utils.utility import logger, LazyImport\n'), ((3368, 3409), 'os.path.join', 'os.path.join', (['res_save_path', '"""NASResults"""'], {}), "(res_save_path, 'NASResults...
## @ingroupMethods-Noise-Fidelity_One-Airframe # noise_clean_wing.py # # Created: Jun 2015, <NAME> # Modified: Jan 2016, <NAME> # ---------------------------------------------------------------------- # Imports # ---------------------------------------------------------------------- import numpy as np...
[ "numpy.abs", "numpy.zeros", "numpy.sin", "numpy.cos", "numpy.log10" ]
[((2524, 2535), 'numpy.cos', 'np.cos', (['phi'], {}), '(phi)\n', (2530, 2535), True, 'import numpy as np\n'), ((2613, 2625), 'numpy.zeros', 'np.zeros', (['(24)'], {}), '(24)\n', (2621, 2625), True, 'import numpy as np\n'), ((2570, 2581), 'numpy.sin', 'np.sin', (['phi'], {}), '(phi)\n', (2576, 2581), True, 'import numpy...
import random import perimeter import numpy as np import unittest import slice from util import printBigArray class PerimeterTest(unittest.TestCase): def test_lines_to_pixels(self): test = [[(0, 0, 0), (3, 0, 0)], [(9, 9, 0), (3, 9, 0)], [(3, 0, 0), (9, 9, 0)], ...
[ "unittest.main", "perimeter.linesToVoxels", "perimeter.onLine", "numpy.zeros" ]
[((1617, 1632), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1630, 1632), False, 'import unittest\n'), ((365, 395), 'numpy.zeros', 'np.zeros', (['(13, 13)'], {'dtype': 'bool'}), '((13, 13), dtype=bool)\n', (373, 395), True, 'import numpy as np\n'), ((404, 441), 'perimeter.linesToVoxels', 'perimeter.linesToVoxel...
# ------------------------------------------------------------------------------------------------- # scientific import numpy as np # ------------------------------------------------------------------------------------------------- # system from math import sqrt from PyQuantum.Common.html import * import copy # -------...
[ "numpy.shape", "webbrowser.open", "numpy.sum", "math.sqrt" ]
[((1600, 1617), 'numpy.sum', 'np.sum', (['self.DIME'], {}), '(self.DIME)\n', (1606, 1617), True, 'import numpy as np\n'), ((5895, 5920), 'webbrowser.open', 'webbrowser.open', (['filename'], {}), '(filename)\n', (5910, 5920), False, 'import webbrowser\n'), ((3328, 3354), 'numpy.shape', 'np.shape', (['self.matrix.data'],...
import sys import matplotlib.pyplot as plt import numpy as np def isReal(txt): try: float(txt) return True except ValueError: return False #dicionários med_dic={1:{'ID':1,'Nome Comercial':0,'Composto principal':0,'Fórmula Química':0,'Meia-vida de eliminação':0,'Número de ...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "matplotlib.pyplot.bar", "matplotlib.pyplot.legend", "numpy.arange", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.subplots", "sys.exit" ]
[((9062, 9076), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (9074, 9076), True, 'import matplotlib.pyplot as plt\n'), ((9086, 9098), 'numpy.arange', 'np.arange', (['i'], {}), '(i)\n', (9095, 9098), True, 'import numpy as np\n'), ((9144, 9235), 'matplotlib.pyplot.bar', 'plt.bar', (['index', 'mpef_lis...
"""Module that allows calibrating image matrices using calibration vectors. The calibration formula is Γ² = γ * α² where Γ is the calibrated matrix, γ is the uncorrected matrix, and α is the calibration vector. Note that α and γ must share the same dimension (if the matrix of pixels is m by n , then α must be length m...
[ "json.load", "numpy.sqrt" ]
[((2299, 2312), 'json.load', 'json.load', (['fd'], {}), '(fd)\n', (2308, 2312), False, 'import json\n'), ((3024, 3053), 'numpy.sqrt', 'np.sqrt', (['(matrix * vector ** 2)'], {}), '(matrix * vector ** 2)\n', (3031, 3053), True, 'import numpy as np\n')]
import tensorflow as tf import numpy as np import time from imageLoader import getPaddedROI,training_data_feeder import math ''' created by <NAME> a sub-model for human pose estimation ''' #input data feeder !!! important !!! The hintSetx_norm_batches are 5d tensors!!! To accommodate, the batch size are fixed to 2 def...
[ "tensorflow.reduce_sum", "tensorflow.trainable_variables", "tensorflow.constant_initializer", "tensorflow.reshape", "numpy.shape", "tensorflow.nn.relu6", "tensorflow.subtract", "tensorflow.variable_scope", "tensorflow.stack", "tensorflow.placeholder", "tensorflow.cast", "tensorflow.summary.Fil...
[((8997, 9072), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '(16, roi_size, roi_size, 3)'], {'name': '"""inputs_b1h1"""'}), "(tf.float32, (16, roi_size, roi_size, 3), name='inputs_b1h1')\n", (9011, 9072), True, 'import tensorflow as tf\n'), ((9088, 9163), 'tensorflow.placeholder', 'tf.placeholder', (['t...
import numpy as np import scipy as sp from argparse import ArgumentParser from sklearn.datasets import load_breast_cancer, load_iris, load_boston, load_wine from sklearn.model_selection import train_test_split from sklearn.metrics import r2_score, roc_auc_score from gp_lib.gp import ConstantMeanGP from gp_lib.sparse im...
[ "numpy.random.seed", "argparse.ArgumentParser", "numpy.std", "sklearn.model_selection.train_test_split", "sklearn.metrics.r2_score", "numpy.ones", "sklearn.datasets.load_boston", "numpy.mean", "numpy.random.shuffle" ]
[((397, 416), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (411, 416), True, 'import numpy as np\n'), ((434, 450), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (448, 450), False, 'from argparse import ArgumentParser\n'), ((851, 868), 'sklearn.datasets.load_boston', 'load_boston',...
import numpy as np # Define conversions in x and y from pixels space to meters ym_per_pix = 30/720 # meters per pixel in y dimension xm_per_pix = 3.7/700 # meters per pixel in x dimension def measure(ploty, leftx, rightx): ''' Calculates the curvature of polynomial functions in meters. ''' left_fit_cr = np.poly...
[ "numpy.absolute", "numpy.max", "numpy.polyfit" ]
[((313, 366), 'numpy.polyfit', 'np.polyfit', (['(ploty * ym_per_pix)', '(leftx * xm_per_pix)', '(2)'], {}), '(ploty * ym_per_pix, leftx * xm_per_pix, 2)\n', (323, 366), True, 'import numpy as np\n'), ((379, 433), 'numpy.polyfit', 'np.polyfit', (['(ploty * ym_per_pix)', '(rightx * xm_per_pix)', '(2)'], {}), '(ploty * ym...
""" Credits: Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME> (Sinergise) Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise) Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME> (Sinergise) This source code is licensed under the MIT license found in the LICENSE file in the root director...
[ "unittest.main", "numpy.count_nonzero", "numpy.amin", "numpy.median", "shapely.geometry.Polygon.from_bounds", "eolearn.core.EOPatch.load", "os.path.realpath", "numpy.amax", "numpy.mean", "numpy.array_equal", "eolearn.geometry.VectorToRaster", "eolearn.geometry.RasterToVector" ]
[((14518, 14533), 'unittest.main', 'unittest.main', ([], {}), '()\n', (14531, 14533), False, 'import unittest\n'), ((7715, 7739), 'eolearn.core.EOPatch.load', 'EOPatch.load', (['patch_path'], {}), '(patch_path)\n', (7727, 7739), False, 'from eolearn.core import EOPatch, FeatureType\n'), ((8283, 8317), 'shapely.geometry...
#! /usr/bin/env python2 import ioutil import cv2 import dlib import base64 import numpy as np import json from camShift import camshiftTracker, meanshiftTracker from demo_config import Config LOG = ioutil.getLogger(__name__) def clamp(n, minn, maxn): return max(min(maxn, n), minn) # Tracking class TrackerInit...
[ "numpy.minimum", "numpy.maximum", "cv2.putText", "cv2.cvtColor", "cv2.imwrite", "camShift.meanshiftTracker", "ioutil.getLogger", "dlib.rectangles", "json.dumps", "cv2.rectangle", "base64.b64encode", "cv2.imencode", "dlib.correlation_tracker", "dlib.rectangle", "cv2.resize", "cv2.Laplac...
[((201, 227), 'ioutil.getLogger', 'ioutil.getLogger', (['__name__'], {}), '(__name__)\n', (217, 227), False, 'import ioutil\n'), ((540, 566), 'dlib.correlation_tracker', 'dlib.correlation_tracker', ([], {}), '()\n', (564, 566), False, 'import dlib\n'), ((2345, 2372), 'cv2.imencode', 'cv2.imencode', (['""".jpg"""', 'fra...
import numpy as np from tqdm import tqdm import torch import torch.cuda import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable from torch.utils.data import TensorDataset, DataLoader import torchvision.models use_cuda = torch.cuda.is_available() if use_cu...
[ "numpy.load", "tqdm.tqdm", "numpy.sum", "torch.nn.ReLU", "torch.utils.data.DataLoader", "torch.autograd.Variable", "torch.nn.Conv2d", "numpy.transpose", "torch.nn.CrossEntropyLoss", "torch.nn.BatchNorm2d", "torch.cuda.is_available", "torch.utils.data.TensorDataset", "torch.nn.Softmax", "to...
[((285, 310), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (308, 310), False, 'import torch\n'), ((434, 454), 'numpy.load', 'np.load', (['"""train.npz"""'], {}), "('train.npz')\n", (441, 454), True, 'import numpy as np\n'), ((513, 531), 'numpy.load', 'np.load', (['"""val.npz"""'], {}), "('val...
from math import cos, sin, pi, exp, sqrt import numpy as np positions = [] rotations = [] scales = [] shift_factor = np.array(shift_factor) spiral_types = ['archimedean', 'hyperbolic', 'fermat', 'lituus', 'log'] if spiral_type not in spiral_types: spiral_type = 'archimedean' # iterate through each element for i...
[ "math.exp", "math.sqrt", "math.sin", "numpy.array", "math.cos" ]
[((118, 140), 'numpy.array', 'np.array', (['shift_factor'], {}), '(shift_factor)\n', (126, 140), True, 'import numpy as np\n'), ((1039, 1060), 'numpy.array', 'np.array', (['base_radius'], {}), '(base_radius)\n', (1047, 1060), True, 'import numpy as np\n'), ((1107, 1127), 'numpy.array', 'np.array', (['base_scale'], {}),...
import argparse import cv2 import numpy as np import os import sys import torch from utils.model_opr import load_model from utils.common import tensor2img, calculate_psnr, calculate_ssim, bgr2ycbcr def get_network(model_path): if 'REDS' in model_path: from exps.MuCAN_REDS.config import config fr...
[ "argparse.ArgumentParser", "torch.device", "torch.no_grad", "os.path.join", "torch.nn.functional.pad", "utils.common.tensor2img", "cv2.imwrite", "os.path.exists", "numpy.transpose", "exps.LAPAR_C_x4.config.config.MODEL.KERNEL_PATH.replace", "numpy.stack", "exps.LAPAR_C_x4.network.Network", "...
[((2054, 2079), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2077, 2079), False, 'import argparse\n'), ((2629, 2649), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (2641, 2649), False, 'import torch\n'), ((2683, 2730), 'utils.model_opr.load_model', 'load_model', (['mode...
""" example using distutils The great thing is that python provides a nice tool called distutils. Let it do all the hard compiling work for you. """ from distutils.core import setup, Extension import numpy as np try: numpy_include = np.get_include() except AttributeError: numpy_include = np.get_numpy_include...
[ "distutils.core.Extension", "numpy.get_numpy_include", "numpy.get_include", "distutils.core.setup" ]
[((333, 438), 'distutils.core.Extension', 'Extension', ([], {'name': '"""_u_numpy"""', 'sources': "['u_numpy.cpp', 'u_numpy_wrap.cxx']", 'include_dirs': '[numpy_include]'}), "(name='_u_numpy', sources=['u_numpy.cpp', 'u_numpy_wrap.cxx'],\n include_dirs=[numpy_include])\n", (342, 438), False, 'from distutils.core imp...
""" Spherical Harmonic Coefficient and Grid classes """ import numpy as _np import matplotlib as _mpl import matplotlib.pyplot as _plt from mpl_toolkits.axes_grid1 import make_axes_locatable as _make_axes_locatable import copy as _copy import warnings as _warnings from scipy.special import factorial as _factorial i...
[ "numpy.load", "numpy.triu", "numpy.random.seed", "numpy.abs", "matplotlib.cm.get_cmap", "cartopy.mpl.ticker.LongitudeFormatter", "numpy.empty", "matplotlib.pyplot.figure", "numpy.sin", "numpy.arange", "matplotlib.colors.LogNorm", "numpy.mean", "numpy.random.normal", "matplotlib.pyplot.Norm...
[((9883, 9907), 'numpy.iscomplexobj', '_np.iscomplexobj', (['coeffs'], {}), '(coeffs)\n', (9899, 9907), True, 'import numpy as _np\n'), ((15106, 15120), 'numpy.arange', '_np.arange', (['nl'], {}), '(nl)\n', (15116, 15120), True, 'import numpy as _np\n'), ((22676, 22700), 'numpy.iscomplexobj', '_np.iscomplexobj', (['coe...
# Copyright 2020 Makani Technologies 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 to...
[ "makani.lib.python.h5_utils.numpy_utils.Vec3ToArray", "numpy.degrees", "numpy.min", "numpy.fabs", "numpy.max" ]
[((1371, 1403), 'numpy.min', 'np.min', (["timeseries['water_line']"], {}), "(timeseries['water_line'])\n", (1377, 1403), True, 'import numpy as np\n'), ((2526, 2560), 'numpy.degrees', 'np.degrees', (['buoy_yaw_angle_from_eq'], {}), '(buoy_yaw_angle_from_eq)\n', (2536, 2560), True, 'import numpy as np\n'), ((3257, 3283)...
import os.path import numpy as np import pandas as pd import pytest from packerlabimaging.utils.io import import_obj LOCAL_DATA_PATH = '/Users/prajayshah/data/oxford-data-to-process/' REMOTE_DATA_PATH = '/home/pshah/mnt/qnap/Data/' BASE_PATH = LOCAL_DATA_PATH SUITE2P_FRAMES_SPONT_t005t006 = [0, 14880] SUITE2P_FRAM...
[ "pandas.DataFrame", "packerlabimaging.processing.suite2p.s2p_loader", "pytest.fixture", "packerlabimaging.utils.io.import_obj", "numpy.random.random", "numpy.arange", "numpy.random.choice" ]
[((340, 371), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (354, 371), False, 'import pytest\n'), ((810, 841), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (824, 841), False, 'import pytest\n'), ((1235, 1266), 'pytest.fixtur...
# -*- coding: utf-8 -*- """SHERIFS Seismic Hazard and Earthquake Rates In Fault Systems Version 1.2 @author: <NAME> """ import numpy as np class bg(): """ Extract the geometry and properities of the background. """ def geom(model_name,file_geom): Lon_bg = [] Lat_bg = [...
[ "numpy.array", "numpy.genfromtxt" ]
[((404, 471), 'numpy.genfromtxt', 'np.genfromtxt', (['file_geom'], {'dtype': "['U100', 'f8', 'f8']", 'skip_header': '(1)'}), "(file_geom, dtype=['U100', 'f8', 'f8'], skip_header=1)\n", (417, 471), True, 'import numpy as np\n'), ((598, 620), 'numpy.array', 'np.array', (['column_model'], {}), '(column_model)\n', (606, 62...
# -*- coding: future_fstrings -*- import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import pathlib _COLS = ('wavelength', 'nlines', 'depth', 'fwhm', 'EW', 'EWerr', 'amplitude', 'sigma', 'mean') class ARES: def __init__(self, *arg, **kwargs): self._c...
[ "numpy.sum", "matplotlib.pyplot.plot", "pandas.read_csv", "os.system", "pathlib.Path", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((5449, 5469), 'numpy.arange', 'np.arange', (['(1)', '(8)', '(0.1)'], {}), '(1, 8, 0.1)\n', (5458, 5469), True, 'import numpy as np\n'), ((1990, 2019), 'os.system', 'os.system', (['"""ARES > /dev/null"""'], {}), "('ARES > /dev/null')\n", (1999, 2019), False, 'import os\n'), ((2615, 2663), 'pandas.read_csv', 'pd.read_c...
import copy import pickle import sys from pathlib import Path from sklearn.cluster import KMeans, DBSCAN import numpy as np from skimage import io import mayavi.mlab as mlab import os os.environ["CUDA_VISIBLE_DEVICES"] = "3" from ..ops.roiaware_pool3d import roiaware_pool3d_utils from ..utils import ( box_utils, ...
[ "pickle.dump", "numpy.maximum", "torch.sqrt", "torch.cat", "numpy.ones", "numpy.argsort", "pathlib.Path", "numpy.sin", "numpy.arange", "pickle.load", "os.path.join", "sklearn.cluster.DBSCAN", "sys.path.append", "numpy.zeros_like", "numpy.meshgrid", "sklearn.cluster.KMeans", "mayavi.m...
[((560, 629), 'sys.path.append', 'sys.path.append', (['"""/home/xharlie/dev/occlusion_pcd/tools/visual_utils"""'], {}), "('/home/xharlie/dev/occlusion_pcd/tools/visual_utils')\n", (575, 629), False, 'import sys\n'), ((6286, 6375), 'visualize_utils.draw_scenes_multi', 'vu.draw_scenes_multi', (['box_pnt_lst', 'colors_lst...
import logging import pickle import random import re import time from logging import Logger from typing import List, Optional, Type, Union import matplotlib.pyplot as plt import numpy as np from mohou.model.autoencoder import VariationalAutoEncoder try: from moviepy.editor import ImageSequenceClip except Excepti...
[ "mohou.dataset.AutoEncoderDataset.from_chunk", "mohou.utils.canvas_to_ndarray", "random.shuffle", "time.strftime", "logging.getLogger", "matplotlib.pyplot.figure", "mohou.trainer.TrainCache.load", "mohou.trainer.TrainCache", "pickle.load", "moviepy.editor.ImageSequenceClip", "mohou.file.get_subp...
[((1076, 1103), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1093, 1103), False, 'import logging\n'), ((1545, 1571), 'logging.getLogger', 'logging.getLogger', (['"""mohou"""'], {}), "('mohou')\n", (1562, 1571), False, 'import logging\n'), ((2305, 2369), 'mohou.dataset.AutoEncoderDatase...
''' # Example dictionary containing information on power excess and shortage for the current timestep # {key:[Qsum,Qchp_nom,Qchp_min,Qboiler_nom,Qboiler_min,Q_tes_in,Q_tes_out]} dict_Qlhn={'1001': {'Qsum':[10,10],'Qchp_nom':[8,8],'Qchp_min':[5,5],'Qboiler_nom':[2,2],'Qboiler_min':[1,1]}, '1002': {'Qsum...
[ "pickle.dump", "pycity_calc.toolbox.dimensioning.dim_networks.estimate_u_value", "pycity_calc.toolbox.networks.network_ops.get_list_with_energy_net_con_node_ids", "pycity_calc.toolbox.dimensioning.dim_networks.calc_pipe_power_loss", "numpy.zeros", "pycity_calc.simulation.energy_balance_optimization.energy...
[((2919, 2964), 'pycity_calc.cities.city.City', 'cit.City', ([], {'environment': 'City_Object.environment'}), '(environment=City_Object.environment)\n', (2927, 2964), True, 'import pycity_calc.cities.city as cit\n'), ((3022, 3146), 'pycity_calc.toolbox.networks.network_ops.get_list_with_energy_net_con_node_ids', 'netop...
import numpy as np from base64 import b64decode from json import loads import matplotlib.pyplot as plt """ algorithm to classify unlabeled data into K classes using K_means_clustering algorithm devloper -> <NAME> bilding the K means clusturing machine learning model from scrach """ class k_mea...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "json.loads", "numpy.zeros", "numpy.ones", "numpy.argmin", "base64.b64decode", "matplotlib.pyplot.figure", "numpy.array" ]
[((7205, 7221), 'numpy.array', 'np.array', (['digits'], {}), '(digits)\n', (7213, 7221), True, 'import numpy as np\n'), ((6598, 6606), 'json.loads', 'loads', (['x'], {}), '(x)\n', (6603, 6606), False, 'from json import loads\n'), ((7646, 7658), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (7656, 7658), T...
""" This module declares the Bayesian regression tree models: * PerpendicularRegressionTree * HyperplaneRegressionTree """ import numpy as np from abc import ABC from scipy.special import gammaln from sklearn.base import RegressorMixin from bayesian_decision_tree.base import BaseTree from bayesian_decision_tree.base_h...
[ "numpy.log", "bayesian_decision_tree.base_perpendicular.BasePerpendicularTree.__init__", "bayesian_decision_tree.base.BaseTree.__init__", "bayesian_decision_tree.base_hyperplane.BaseHyperplaneTree.__init__", "numpy.array", "numpy.arange", "scipy.special.gammaln" ]
[((809, 917), 'bayesian_decision_tree.base.BaseTree.__init__', 'BaseTree.__init__', (['self', 'partition_prior', 'prior', 'delta', 'prune', 'child_type', '(True)', 'split_precision', 'level'], {}), '(self, partition_prior, prior, delta, prune, child_type, \n True, split_precision, level)\n', (826, 917), False, 'from...
import matplotlib.pyplot as plt import numpy as np import scipy.interpolate from oneibl.one import ONE from ibllib.io import spikeglx import alf.io from scipy.io import savemat from brainbox.io.one import load_channel_locations from scipy import signal import brainbox as bb from pathlib import Path import pandas as pd...
[ "matplotlib.pyplot.title", "numpy.load", "numpy.abs", "matplotlib.pyplot.suptitle", "os.walk", "numpy.argsort", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "pathlib.Path", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "ibllib.io.spi...
[((503, 512), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (510, 512), True, 'import matplotlib.pyplot as plt\n'), ((1791, 1796), 'oneibl.one.ONE', 'ONE', ([], {}), '()\n', (1794, 1796), False, 'from oneibl.one import ONE\n'), ((2900, 2953), 'numpy.save', 'np.save', (["('/home/mic/saturation_scan2/%s.npy' % ei...
import pandas as pd from sentinelsat import * from collections import OrderedDict from datetime import datetime,timedelta, date import numpy as np from rasterio.features import sieve from Python.prep_raster import computeIndexStack,compute_index from Python.mlc import * from Python.pred_raster import dtc_pred_stack fro...
[ "numpy.radians", "numpy.sum", "Python.prep_raster.compute_index", "Python.prep_raster.computeIndexStack", "numpy.where", "numpy.array", "rasterio.features.sieve", "datetime.timedelta", "glob.glob", "collections.OrderedDict", "Python.pred_raster.dtc_pred_stack", "sklearn.cluster.DBSCAN" ]
[((1019, 1032), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1030, 1032), False, 'from collections import OrderedDict\n'), ((3097, 3142), 'numpy.sum', 'np.sum', (['[mlc_img, dtc_img, slice_img]'], {'axis': '(0)'}), '([mlc_img, dtc_img, slice_img], axis=0)\n', (3103, 3142), True, 'import numpy as np\n'),...
# -*- coding: utf-8 -*- import pathlib # change to pathlib from Python 3.4 instead of os import tifffile, cv2, datetime, pickle import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec from libraries import OFlowCalc, Filters, plotfunctions, helpfunctions, PeakDetection, videoreader ...
[ "pickle.dump", "numpy.sum", "numpy.abs", "libraries.plotfunctions.plot_TimeAveragedMotions", "libraries.helpfunctions.scale_ImageStack", "pickle.load", "numpy.arange", "libraries.helpfunctions.read_config", "numpy.nanmean", "numpy.copy", "libraries.videoreader.import_video", "numpy.max", "li...
[((1581, 1610), 'libraries.PeakDetection.PeakDetection', 'PeakDetection.PeakDetection', ([], {}), '()\n', (1608, 1610), False, 'from libraries import OFlowCalc, Filters, plotfunctions, helpfunctions, PeakDetection, videoreader\n'), ((1840, 1867), 'libraries.helpfunctions.read_config', 'helpfunctions.read_config', ([], ...
import sys import os import pytest from numpy import array, array_equal, allclose import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from lxmls.readers import galton tolerance = 1e-5 @pytest.fixture(scope='module') def galton_data(): return galton.load() def test_galton_data(galton_data)...
[ "matplotlib.pyplot.hist", "numpy.allclose", "pytest.fixture", "pytest.main", "matplotlib.use", "numpy.array", "lxmls.readers.galton.load" ]
[((101, 122), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (115, 122), False, 'import matplotlib\n'), ((210, 240), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (224, 240), False, 'import pytest\n'), ((271, 284), 'lxmls.readers.galton.load', 'galton....
# -*- coding: utf-8 -*- import os import numpy as np import glob import re import multiprocessing as mp from parameters import ovfParms class OvfFile: def __init__(self, path, parms=None): self._path = path if parms is None: self._parms = ovfParms() else: ...
[ "numpy.load", "os.path.isdir", "numpy.allclose", "os.path.realpath", "parameters.ovfParms", "re.findall", "numpy.array", "glob.glob", "numpy.savez", "multiprocessing.cpu_count" ]
[((1600, 1624), 'numpy.allclose', 'np.allclose', (['self', 'other'], {}), '(self, other)\n', (1611, 1624), True, 'import numpy as np\n'), ((4557, 4648), 'numpy.savez', 'np.savez', (['path'], {'array': 'self.array', 'headers': 'self.headers', 'path': 'self._path', 'time': 'self.time'}), '(path, array=self.array, headers...
"""Copyright (c) Microsoft Corporation. Licensed under the MIT license. Uniter for RE model """ from collections import defaultdict import torch from torch import nn import random import numpy as np from .layer import GELU from .model import UniterPreTrainedModel, UniterModel try: from apex.normalization.fused_l...
[ "numpy.random.uniform", "random.randint", "torch.argsort", "torch.cat", "torch.nn.CrossEntropyLoss", "collections.defaultdict", "torch.nn.LayerNorm", "torch.sigmoid", "torch.clamp", "torch.nn.Linear", "torch.zeros", "torch.tensor" ]
[((1566, 1599), 'collections.defaultdict', 'defaultdict', (['(lambda : None)', 'batch'], {}), '(lambda : None, batch)\n', (1577, 1599), False, 'from collections import defaultdict\n'), ((3675, 3721), 'torch.argsort', 'torch.argsort', (['scores'], {'dim': '(-1)', 'descending': '(True)'}), '(scores, dim=-1, descending=Tr...
import numpy as np # importing from alphaBetaLab the needed components from alphaBetaLab.abOptionManager import abOptions from alphaBetaLab.abEstimateAndSave import triMeshSpecFromMshFile, abEstimateAndSaveTriangularEtopo1 # definition of the spectral grid dirs = np.linspace(0, 2*np.pi, 25) nfreq = 25 minfrq = .04118...
[ "alphaBetaLab.abEstimateAndSave.abEstimateAndSaveTriangularEtopo1", "alphaBetaLab.abOptionManager.abOptions", "alphaBetaLab.abEstimateAndSave.triMeshSpecFromMshFile", "numpy.linspace" ]
[((266, 295), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(25)'], {}), '(0, 2 * np.pi, 25)\n', (277, 295), True, 'import numpy as np\n'), ((482, 513), 'alphaBetaLab.abEstimateAndSave.triMeshSpecFromMshFile', 'triMeshSpecFromMshFile', (['mshfile'], {}), '(mshfile)\n', (504, 513), False, 'from alphaBetaLab....
import numpy as np import scipy import scipy.misc import os def save_img(img, dir, name, count): if os.path.isdir(dir) is False: os.makedirs(dir) n = int(np.sqrt(img.shape[0])) img = img.data.cpu().numpy().transpose(0,2,3,1) out_img = np.zeros((64*n,64*n,3)) for r in range(n): for c...
[ "os.path.isdir", "numpy.zeros", "os.makedirs", "numpy.sqrt" ]
[((260, 289), 'numpy.zeros', 'np.zeros', (['(64 * n, 64 * n, 3)'], {}), '((64 * n, 64 * n, 3))\n', (268, 289), True, 'import numpy as np\n'), ((105, 123), 'os.path.isdir', 'os.path.isdir', (['dir'], {}), '(dir)\n', (118, 123), False, 'import os\n'), ((142, 158), 'os.makedirs', 'os.makedirs', (['dir'], {}), '(dir)\n', (...
import numpy as np import scipy.signal import matplotlib.pyplot as plt def compare_filters(iir_b, iir_a, fir_b, fs=1): # compute response for IIR filter w_iir, h_iir = scipy.signal.freqz(iir_b, iir_a, fs=fs, worN=2048) # compute response for FIR filter w_fir, h_fir = scipy.signal.freqz(fir_b, fs=fs)...
[ "matplotlib.pyplot.xscale", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "numpy.abs", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid" ]
[((426, 471), 'matplotlib.pyplot.plot', 'plt.plot', (['w_iir', 'h_iir_db'], {'label': '"""IIR filter"""'}), "(w_iir, h_iir_db, label='IIR filter')\n", (434, 471), True, 'import matplotlib.pyplot as plt\n'), ((476, 529), 'matplotlib.pyplot.plot', 'plt.plot', (['w_fir', 'h_fir_db'], {'label': '"""FIR approx. filter"""'})...
from .petitradtrans import petitRADTRANSModel import numpy as np from taurex.exceptions import InvalidModelException from taurex.core import fitparam class DirectImageRADTRANS(petitRADTRANSModel): @classmethod def input_keywords(self): return ['directimage-petitrad', 'direct-petitrad', ] de...
[ "astropy.units.spectral_density", "numpy.zeros", "numpy.isnan" ]
[((1719, 1741), 'numpy.isnan', 'np.isnan', (['petit_flux_W'], {}), '(petit_flux_W)\n', (1727, 1741), True, 'import numpy as np\n'), ((1814, 1861), 'numpy.zeros', 'np.zeros', ([], {'shape': '(self.nLayers, wngrid.shape[0])'}), '(shape=(self.nLayers, wngrid.shape[0]))\n', (1822, 1861), True, 'import numpy as np\n'), ((14...
import unittest import numpy as np from utils import gaussian_mixture, add_outliers class MyTestCase(unittest.TestCase): def test_gaussian_mixture(self): X = gaussian_mixture(n_samples=100, n_clusters=4, n_outliers=10, n_features=2, means=np.array...
[ "unittest.main", "utils.add_outliers", "numpy.linalg.norm", "numpy.array" ]
[((1339, 1354), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1352, 1354), False, 'import unittest\n'), ((1109, 1175), 'utils.add_outliers', 'add_outliers', (['X'], {'n_outliers': '(10)', 'dist_factor': '(100)', 'return_index': '(True)'}), '(X, n_outliers=10, dist_factor=100, return_index=True)\n', (1121, 1175),...
"""TEsting functions """ import numpy as np from energy_demand.basic import basic_functions from energy_demand.basic import lookup_tables def test_if_minus_value_in_array(arraytotest):#, tolerance_min_max=0.00000000001): """Test if array has negative value according to a tolerance criteria Arguments ...
[ "energy_demand.basic.lookup_tables.basic_lookups", "energy_demand.basic.basic_functions.test_if_sector", "numpy.sum", "numpy.min" ]
[((5408, 5437), 'energy_demand.basic.lookup_tables.basic_lookups', 'lookup_tables.basic_lookups', ([], {}), '()\n', (5435, 5437), False, 'from energy_demand.basic import lookup_tables\n'), ((3401, 3461), 'energy_demand.basic.basic_functions.test_if_sector', 'basic_functions.test_if_sector', (['fuel_tech_fueltype_p[endu...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ "unittest.main", "functools.partial", "program_config.OpConfig", "hypothesis.strategies.sampled_from", "hypothesis.strategies.booleans", "numpy.random.random", "hypothesis.strategies.integers" ]
[((5410, 5425), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5423, 5425), False, 'import unittest\n'), ((3732, 4092), 'program_config.OpConfig', 'OpConfig', ([], {'type': '"""matmul_v2"""', 'inputs': "{'X': ['input_data1'], 'Y': ['input_data2']}", 'outputs': "{'Out': ['matmul_output']}", 'attrs': "{'trans_x': k...
#ZADANIE 1 #Napisz program realizujacy poszukiwanie miejsc zerowych #powyzszych funkcji z punktu a) i b). Wykorzystaj metode graficzna, #liniowej inkrementacji i bisekcji. Stworz odpowiednie funkcje #implementujace wymienione metody poszukiwania miejsc zerowych. #Dobierz odpowiednio obszary wyszukiwania. Wykonaj analiz...
[ "numpy.absolute", "matplotlib.pyplot.show", "numpy.arange", "matplotlib.pyplot.grid" ]
[((1245, 1266), 'numpy.arange', 'np.arange', (['(-3)', '(3)', '(0.1)'], {}), '(-3, 3, 0.1)\n', (1254, 1266), True, 'import numpy as np\n'), ((1293, 1307), 'matplotlib.pyplot.grid', 'plt.grid', (['(True)'], {}), '(True)\n', (1301, 1307), True, 'import matplotlib.pyplot as plt\n'), ((1308, 1318), 'matplotlib.pyplot.show'...
from config_generator import configurator import numpy as np from random import uniform, randint algorithms = ['xstream'] TuningMode = True if TuningMode is False: names = [] for i in range(24): name = input() names.append(name) for algo in algorithms: if(algo == 'xstrea...
[ "numpy.dstack", "numpy.meshgrid", "numpy.concatenate", "config_generator.configurator" ]
[((1594, 1616), 'numpy.meshgrid', 'np.meshgrid', (['chains', 'k'], {}), '(chains, k)\n', (1605, 1616), True, 'import numpy as np\n'), ((1633, 1652), 'numpy.dstack', 'np.dstack', (['[xs, ys]'], {}), '([xs, ys])\n', (1642, 1652), True, 'import numpy as np\n'), ((1770, 1806), 'numpy.concatenate', 'np.concatenate', (['(tmp...
import numpy as np def swap(arr, i, j): """ Swap two elements in an array Parameters ---------- arr: list The array i: int Index of first element j: int Index of second element """ temp = arr[i] arr[i] = arr[j] arr[j] = temp def merge(x, y, i1, ...
[ "numpy.random.randint", "numpy.random.seed" ]
[((1759, 1776), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1773, 1776), True, 'import numpy as np\n'), ((1781, 1810), 'numpy.random.randint', 'np.random.randint', (['(0)', '(100)', '(20)'], {}), '(0, 100, 20)\n', (1798, 1810), True, 'import numpy as np\n')]
import binascii import gzip import json import logging import os import glob import fnmatch import shutil import time import zlib import io import pickle import tempfile import re from abc import ABC, abstractmethod from collections import OrderedDict from functools import total_ordering from typing ...
[ "dpu_utils.utils.dataloading.save_json_gz", "numpy.load", "os.remove", "pickle.dump", "os.unlink", "dpu_utils.utils.dataloading.save_jsonl_gz", "os.path.isfile", "pickle.load", "azure.storage.blob.ContainerClient.from_container_url", "azure.identity.DefaultAzureCredential", "azure.storage.blob.C...
[((833, 872), 'logging.getLogger', 'logging.getLogger', (['"""azure.storage.blob"""'], {}), "('azure.storage.blob')\n", (850, 872), False, 'import logging\n'), ((898, 929), 'logging.getLogger', 'logging.getLogger', (['"""azure.core"""'], {}), "('azure.core')\n", (915, 929), False, 'import logging\n'), ((12008, 12032), ...
import numpy as np import itertools import time import argparse import torch from torch.autograd import Variable from torch.autograd import grad as torchgrad import torch.nn.functional as F from utils.ais import ais_trajectory from utils.simulate import simulate_data from utils.hparams import HParams from utils.math_...
[ "numpy.flip", "argparse.ArgumentParser", "utils.ais.ais_trajectory", "torch.load", "utils.simulate.simulate_data", "numpy.mean", "torch.cuda.is_available", "utils.math_ops.sigmoidial_schedule", "numpy.linspace", "itertools.tee", "utils.hparams.HParams" ]
[((397, 452), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""bidirectional_mc"""'}), "(description='bidirectional_mc')\n", (420, 452), False, 'import argparse\n'), ((2198, 2223), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2221, 2223), False, 'import torch\n'...
import argparse import gzip import logging import multiprocessing import os import pathlib import traceback from itertools import repeat import numpy as np from CONFIG.FOLDER_STRUCTURE import TARGET_DB_NAME, ATOMS, SEQUENCES, STRUCTURE_FILES_PATH, SEQ_ATOMS_DATASET_PATH, MMSEQS_DATABASES_PATH from CONFIG.RUNTIME_PARA...
[ "itertools.repeat", "utils.mmseqs_utils.mmseqs_createdb", "utils.utils.create_unix_time_folder", "CPP_lib.libAtomDistanceIO.initialize", "argparse.ArgumentParser", "utils.mmseqs_utils.mmseqs_createindex", "gzip.open", "utils.structure_files_parsers.parse_mmcif.parse_mmcif", "utils.structure_files_pa...
[((859, 1061), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Read structure files from -i to extract sequence and atom positions. Save them in -o as .faa and .bin files. Create and index new MMSEQS2 database in -db"""'}), "(description=\n 'Read structure files from -i to extract sequ...
"""Experiment to quantify the correlation between the streamline distance (MAM or MDF) against the Euclidean distance on the corresponding dissimilarity representation embedding of the streamlines. """ import numpy as np import nibabel as nib from euclidean_embeddings import dissimilarity from functools import partial...
[ "matplotlib.pyplot.title", "numpy.random.seed", "matplotlib.pyplot.figure", "numpy.linalg.norm", "os.path.exists", "nibabel.streamlines.load", "numpy.minimum", "numpy.corrcoef", "matplotlib.pyplot.legend", "matplotlib.pyplot.ion", "dipy.tracking.streamline.set_number_of_points", "numpy.random....
[((4344, 4375), 'numpy.concatenate', 'np.concatenate', (['streamline1_idx'], {}), '(streamline1_idx)\n', (4358, 4375), True, 'import numpy as np\n'), ((4398, 4429), 'numpy.concatenate', 'np.concatenate', (['streamline2_idx'], {}), '(streamline2_idx)\n', (4412, 4429), True, 'import numpy as np\n'), ((4454, 4487), 'numpy...
from netCDF4 import Dataset import numpy as np import pandas as pd import canyon_tools.readout_tools as rout #from MITgcmutils import rdmds # cant make it work #CGrid = '/data/kramosmu/results/TracerExperiments/CNTDIFF/run38/gridGlob.nc' # #phiHyd = '/data/kramosmu/results/TracerExperiments/CNTDIFF/run38/phiHydGlob.n...
[ "netCDF4.Dataset", "pandas.DataFrame", "numpy.zeros", "numpy.expand_dims", "numpy.shape", "numpy.ma.array", "canyon_tools.readout_tools.getMask", "canyon_tools.readout_tools.getField" ]
[((509, 524), 'netCDF4.Dataset', 'Dataset', (['phiHyd'], {}), '(phiHyd)\n', (516, 524), False, 'from netCDF4 import Dataset\n'), ((536, 550), 'netCDF4.Dataset', 'Dataset', (['CGrid'], {}), '(CGrid)\n', (543, 550), False, 'from netCDF4 import Dataset\n'), ((660, 686), 'canyon_tools.readout_tools.getField', 'rout.getFiel...
from .CarDEC_optimization import grad_reconstruction as grad, MSEloss from .CarDEC_dataloaders import simpleloader, aeloader import tensorflow as tf from tensorflow.keras import Model, Sequential from tensorflow.keras.layers import Dense, concatenate from tensorflow.keras.optimizers import Adam from tensorflow.keras.b...
[ "tensorflow.random.set_seed", "os.mkdir", "numpy.random.seed", "tensorflow.keras.layers.Dense", "tensorflow.keras.metrics.Mean", "os.path.isdir", "tensorflow.keras.backend.clear_session", "numpy.zeros", "time.time", "tensorflow.zeros", "tensorflow.keras.optimizers.Adam", "random.seed", "tens...
[((444, 465), 'tensorflow.keras.backend.set_floatx', 'set_floatx', (['"""float32"""'], {}), "('float32')\n", (454, 465), False, 'from tensorflow.keras.backend import set_floatx\n'), ((645, 651), 'tensorflow.keras.optimizers.Adam', 'Adam', ([], {}), '()\n', (649, 651), False, 'from tensorflow.keras.optimizers import Ada...