code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
import numpy as np import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func from flask import Flask, jsonify # Database Setup engine = create_engine("sqlite:///Resources/hawaii.sqlite") # reflect an existing database into a new m...
[ "numpy.ravel", "flask.Flask", "sqlalchemy.orm.Session", "flask.jsonify", "sqlalchemy.create_engine", "sqlalchemy.ext.automap.automap_base" ]
[((225, 275), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///Resources/hawaii.sqlite"""'], {}), "('sqlite:///Resources/hawaii.sqlite')\n", (238, 275), False, 'from sqlalchemy import create_engine, func\n'), ((332, 346), 'sqlalchemy.ext.automap.automap_base', 'automap_base', ([], {}), '()\n', (344, 346), F...
import logging import os import re from collections import OrderedDict import numexpr as ne import numpy as np import pandas as pd import yaml from tardis import constants from astropy import units as u from pyne import nucname import tardis from tardis.io.util import get_internal_data_path from IPython import get_ip...
[ "tardis.io.util.get_internal_data_path", "yaml.load", "pandas.read_csv", "yaml.dump", "tqdm.notebook.tqdm", "os.path.join", "numexpr.evaluate", "IPython.display.display", "numpy.loadtxt", "IPython.get_ipython", "numpy.log10", "pyne.nucname.name", "numpy.trapz", "tqdm.tqdm", "astropy.unit...
[((548, 575), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (565, 575), False, 'import logging\n'), ((589, 625), 'os.path.realpath', 'os.path.realpath', (['tardis.__path__[0]'], {}), '(tardis.__path__[0])\n', (605, 625), False, 'import os\n'), ((1036, 1080), 'tardis.io.util.get_internal_...
import numpy as np import torch from torch import nn from ._interfaces import _ABCTorchModel class _BaseTorchModel(nn.Module, _ABCTorchModel): def __init__(self, dtype=torch.float, cdist_compute_mode="use_mm_for_euclid_dist", t_distr=True, must_keep=None, ridge=0.): super(_BaseTorchModel, self).__init__(...
[ "numpy.random.uniform", "numpy.zeros", "numpy.ones", "torch.cdist", "numpy.array", "torch.tensor" ]
[((879, 933), 'torch.tensor', 'torch.tensor', (['X'], {'dtype': 'self.dtype', 'requires_grad': '(False)'}), '(X, dtype=self.dtype, requires_grad=False)\n', (891, 933), False, 'import torch\n'), ((1256, 1329), 'torch.tensor', 'torch.tensor', (['X[:, must_keep == 0]'], {'dtype': 'self.dtype', 'requires_grad': '(False)'})...
import os import numpy as np import sys sys.path.append(os.path.join(os.path.dirname(__file__), "src")) import gc import glob import tensorflow as tf from tensorflow.python.keras import models as models_keras from tensorflow.python.keras import backend as K import vtk from pre_process import swap_labels_back, rescale_...
[ "os.mkdir", "numpy.moveaxis", "numpy.sum", "argparse.ArgumentParser", "numpy.argmax", "tensorflow.python.keras.models.Model", "im_utils.load_vtk_image", "im_utils.get_array_from_vtkImage", "os.path.join", "numpy.unique", "pre_process.swap_labels_back", "os.path.dirname", "model.UNet2D", "n...
[((632, 660), 'numpy.moveaxis', 'np.moveaxis', (['im_vol', 'view', '(0)'], {}), '(im_vol, view, 0)\n', (643, 660), True, 'import numpy as np\n'), ((671, 705), 'numpy.zeros', 'np.zeros', (['[*im_vol.shape, channel]'], {}), '([*im_vol.shape, channel])\n', (679, 705), True, 'import numpy as np\n'), ((929, 940), 'time.time...
################################################################################ # Live Classification on Raspberry Pi 4b ################################################################################ #import RPi.GPIO as GPIO #!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import time from time impor...
[ "serial.Serial", "pandas.DataFrame", "numpy.roll", "numpy.fft.fft", "sklearn.preprocessing.MinMaxScaler", "numpy.zeros", "os.system", "os.path.exists", "can.interface.Bus", "time.sleep", "can.Message", "numpy.linalg.norm", "numpy.reshape", "joblib.load", "datetime.datetime.now", "numpy...
[((1102, 1138), 'os.system', 'os.system', (['"""sudo ifconfig can0 down"""'], {}), "('sudo ifconfig can0 down')\n", (1111, 1138), False, 'import os\n'), ((1218, 1276), 'os.system', 'os.system', (['"""sudo ip link set can0 type can bitrate 250000"""'], {}), "('sudo ip link set can0 type can bitrate 250000')\n", (1227, 1...
import pandas as pd from sklearn.preprocessing import StandardScaler from matplotlib import pyplot as plt import numpy as np import sys import argparse # np.set_printoptions(precision=4) # Print only four digits ''' Author: <NAME> Date: 21/02/2018 22:33:13 UTC+1 Title: Automatic Principal Component Ana...
[ "sklearn.preprocessing.StandardScaler", "argparse.ArgumentParser", "numpy.abs", "pandas.read_csv", "matplotlib.pyplot.figure", "numpy.linalg.norm", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.tight_layout", "pandas.DataFrame", "numpy.linalg.eig", "numpy.cumsum", "numpy.append", "nump...
[((683, 708), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (706, 708), False, 'import argparse\n'), ((3027, 3049), 'pandas.read_csv', 'pd.read_csv', (['inputFile'], {}), '(inputFile)\n', (3038, 3049), True, 'import pandas as pd\n'), ((3946, 3963), 'numpy.cov', 'np.cov', (['numData.T'], {}), '...
# Copyright (c) 2019, 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 appli...
[ "getopt.getopt", "tensorflow.get_collection", "tensorflow.Session", "numpy.savez", "sys.exit" ]
[((1294, 1330), 'getopt.getopt', 'getopt.getopt', (['sys.argv[1:]', '"""hi:o:"""'], {}), "(sys.argv[1:], 'hi:o:')\n", (1307, 1330), False, 'import getopt\n'), ((1967, 1993), 'numpy.savez', 'np.savez', (['output_file'], {}), '(output_file, **m)\n', (1975, 1993), True, 'import numpy as np\n'), ((1609, 1621), 'tensorflow....
# -*- coding: utf-8 -*- from __future__ import absolute_import from packtml.recommendation import ItemItemRecommender import numpy as np from numpy.testing import assert_array_almost_equal from types import GeneratorType # make up a ratings matrix... R = np.array([[1., 0., 3.5, 2., 0., 0., 0., 1.5], ...
[ "packtml.recommendation.ItemItemRecommender", "numpy.testing.assert_array_almost_equal", "numpy.array", "numpy.in1d" ]
[((260, 448), 'numpy.array', 'np.array', (['[[1.0, 0.0, 3.5, 2.0, 0.0, 0.0, 0.0, 1.5], [0.0, 2.0, 3.0, 0.0, 0.0, 2.5, \n 0.0, 0.0], [3.5, 4.0, 2.0, 0.0, 4.5, 3.5, 0.0, 2.0], [3.0, 3.5, 0.0, \n 2.5, 3.0, 0.0, 0.0, 0.0]]'], {}), '([[1.0, 0.0, 3.5, 2.0, 0.0, 0.0, 0.0, 1.5], [0.0, 2.0, 3.0, 0.0, \n 0.0, 2.5, 0.0, ...
import torch import numpy as np import matplotlib.pyplot as plt from collections import defaultdict def moving_average(array, n): cumsum = np.cumsum(array, dtype=float) cumsum[n:] = cumsum[n:] - cumsum[:-n] return cumsum[n-1:] / n def plot_floats(my_def_dict, ma=0, fname=None, title="Untitled", xlabel="Unlabelled...
[ "matplotlib.pyplot.title", "torch.mean", "matplotlib.pyplot.show", "torch.stack", "matplotlib.pyplot.plot", "matplotlib.pyplot.matshow", "numpy.cumsum", "numpy.array", "numpy.tile", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((142, 171), 'numpy.cumsum', 'np.cumsum', (['array'], {'dtype': 'float'}), '(array, dtype=float)\n', (151, 171), True, 'import numpy as np\n'), ((697, 711), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {}), '(x, y)\n', (705, 711), True, 'import matplotlib.pyplot as plt\n'), ((716, 732), 'matplotlib.pyplot.title'...
from nptweak import to_2darray import numpy as np import numpy.testing as npt def test1(): x = np.array([1, 2, 3]) y = to_2darray(x) # flip=False, trans=False target = np.array([[1], [2], [3]]) npt.assert_array_equal(y, target) def test2(): x = np.array([1, 2, 3]) y = to_2darray(x, flip=Tru...
[ "numpy.testing.assert_array_equal", "numpy.array", "nptweak.to_2darray" ]
[((101, 120), 'numpy.array', 'np.array', (['[1, 2, 3]'], {}), '([1, 2, 3])\n', (109, 120), True, 'import numpy as np\n'), ((129, 142), 'nptweak.to_2darray', 'to_2darray', (['x'], {}), '(x)\n', (139, 142), False, 'from nptweak import to_2darray\n'), ((183, 208), 'numpy.array', 'np.array', (['[[1], [2], [3]]'], {}), '([[...
from nilmtk.dataset import DataSet from nilmtk.metergroup import MeterGroup import pandas as pd from nilmtk.losses import * import numpy as np import matplotlib.pyplot as plt import datetime from IPython.display import clear_output class API(): """ The API ia designed for rapid experimentation with NILM Algo...
[ "pandas.DataFrame", "nilmtk.dataset.DataSet", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.figure", "pandas.Series", "matplotlib.pyplot.xticks", "IPython.display.clear_output", "pandas.concat" ]
[((825, 839), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (837, 839), True, 'import pandas as pd\n'), ((899, 913), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (911, 913), True, 'import pandas as pd\n'), ((1055, 1069), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1067, 1069), True, 'import ...
import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from collections import OrderedDict import torch.nn as nn import torch def plot_confusion_matrix(cm, classes, save_path=None, title='Confusion Matrix'): plt.figure(figsize=(16, 8), dpi=100) np.set_printoptions(precisio...
[ "matplotlib.pyplot.title", "seaborn.heatmap", "matplotlib.pyplot.figure", "matplotlib.pyplot.gca", "numpy.prod", "pandas.DataFrame", "numpy.set_printoptions", "numpy.meshgrid", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.xticks", "...
[((251, 287), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(16, 8)', 'dpi': '(100)'}), '(figsize=(16, 8), dpi=100)\n', (261, 287), True, 'import matplotlib.pyplot as plt\n'), ((292, 324), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(2)'}), '(precision=2)\n', (311, 324), True, 'im...
import os import sys import argparse import numpy as np import open3d as o3d from PIL import Image from trimesh.exchange.export import export_mesh from trimesh.util import concatenate as stack_meshes from roca.engine import Predictor def main(args): predictor = Predictor( data_dir=args.data_dir, ...
[ "os.makedirs", "argparse.ArgumentParser", "open3d.geometry.Image", "numpy.asarray", "numpy.clip", "open3d.visualization.draw_geometries", "PIL.Image.fromarray", "trimesh.util.concatenate", "roca.engine.Predictor" ]
[((270, 382), 'roca.engine.Predictor', 'Predictor', ([], {'data_dir': 'args.data_dir', 'model_path': 'args.model_path', 'config_path': 'args.config_path', 'wild': 'args.wild'}), '(data_dir=args.data_dir, model_path=args.model_path, config_path=\n args.config_path, wild=args.wild)\n', (279, 382), False, 'from roca.en...
import numpy as np import scipy.sparse as ssp import tensorflow as tf from Update import UpdateElem import pandas as pd from itertools import chain from sklearn.cluster import KMeans from sklearn.metrics import normalized_mutual_info_score class SSNMF(object): """A wrapper class for UpdateElem""" def __init_...
[ "Update.UpdateElem", "numpy.matrix", "sklearn.cluster.KMeans", "numpy.power", "tensorflow.Session", "tensorflow.global_variable_initializer", "numpy.ones", "scipy.sparse.lil_matrix", "numpy.array", "tensorflow.Graph", "pandas.read_pickle", "itertools.chain.from_iterable" ]
[((3177, 3210), 'pandas.read_pickle', 'pd.read_pickle', (['"""data/karate.pkl"""'], {}), "('data/karate.pkl')\n", (3191, 3210), True, 'import pandas as pd\n'), ((3225, 3262), 'pandas.read_pickle', 'pd.read_pickle', (['"""data/karate_com.pkl"""'], {}), "('data/karate_com.pkl')\n", (3239, 3262), True, 'import pandas as p...
import os import numpy as np import modeling.model_collection as mc import robot_sim._kinematics.jlchain as jl import basis.robot_math as rm import robot_sim.end_effectors.gripper.gripper_interface as gp class CobottaPipette(gp.GripperInterface): def __init__(self, pos=np.zeros(3), rotmat=np.eye(3), cdmesh_type=...
[ "numpy.zeros", "modeling.geometric_model.gen_frame", "modeling.model_collection.ModelCollection", "modeling.geometric_model.gen_dashstick", "basis.robot_math.rotmat_from_axangle", "modeling.geometric_model.gen_mycframe", "numpy.array", "numpy.eye", "visualization.panda.world.World", "os.path.split...
[((8755, 8810), 'visualization.panda.world.World', 'wd.World', ([], {'cam_pos': '[0.5, 0.5, 0.5]', 'lookat_pos': '[0, 0, 0]'}), '(cam_pos=[0.5, 0.5, 0.5], lookat_pos=[0, 0, 0])\n', (8763, 8810), True, 'import visualization.panda.world as wd\n'), ((277, 288), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (285, 288)...
""" Copyright (c) 2021, Electric Power Research Institute All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this li...
[ "pandas.DataFrame", "pandas.period_range", "storagevet.Library.truncate_float", "storagevet.Library.drop_extra_data", "storagevet.ValueStreams.ValueStream.ValueStream.__init__", "numpy.zeros", "cvxpy.NonPos", "random.choice", "storagevet.Library.fill_extra_data", "pandas.Series", "numpy.repeat" ...
[((2296, 2342), 'storagevet.ValueStreams.ValueStream.ValueStream.__init__', 'ValueStream.__init__', (['self', '"""Deferral"""', 'params'], {}), "(self, 'Deferral', params)\n", (2316, 2342), False, 'from storagevet.ValueStreams.ValueStream import ValueStream\n'), ((2974, 2985), 'pandas.Series', 'pd.Series', ([], {}), '(...
#!/usr/bin/python # encoding: utf-8 import random import torch from torch.utils.data import Dataset from torch.utils.data import sampler import torchvision.transforms as transforms from PIL import Image, ImageEnhance, ImageOps import numpy as np import codecs import trans import pytorch_lightning as pl from torch.uti...
[ "trans.Rotate", "numpy.floor", "trans.RandomSharpness", "random.randint", "PIL.ImageOps.invert", "torch.zeros", "trans.Crop", "trans.Compress", "trans.Crop2", "trans.RandomColor", "trans.Exposure", "trans.RandomContrast", "trans.Salt", "trans.Stretch", "trans.Blur", "trans.AdjustResolu...
[((355, 382), 'trans.Crop', 'trans.Crop', ([], {'probability': '(0.1)'}), '(probability=0.1)\n', (365, 382), False, 'import trans\n'), ((391, 419), 'trans.Crop2', 'trans.Crop2', ([], {'probability': '(1.1)'}), '(probability=1.1)\n', (402, 419), False, 'import trans\n'), ((438, 475), 'trans.RandomContrast', 'trans.Rando...
# -*- coding: utf-8 -*- """ An API for a trained segmentation model to predict nodule boundaries and descriptive statistics. """ import numpy as np import scipy.ndimage from ...algorithms.segment.src.models.simple_3d_model import Simple3DModel from ...preprocess.load_ct import load_ct, MetaData from ...preprocess.pre...
[ "numpy.load", "numpy.zeros", "numpy.prod" ]
[((1518, 1544), 'numpy.zeros', 'np.zeros', (['(1, *DATA_SHAPE)'], {}), '((1, *DATA_SHAPE))\n', (1526, 1544), True, 'import numpy as np\n'), ((2819, 2840), 'numpy.load', 'np.load', (['segment_path'], {}), '(segment_path)\n', (2826, 2840), True, 'import numpy as np\n'), ((3342, 3363), 'numpy.prod', 'np.prod', (['meta.spa...
import matplotlib.pyplot as plt import numpy as np import pytest from mpol import coordinates, utils from mpol.constants import * @pytest.fixture def imagekw(): return { "a": 1, "delta_x": 0.3, "delta_y": 0.1, "sigma_x": 0.3, "sigma_y": 0.1, "Omega": 20, } de...
[ "mpol.utils.sky_gaussian_arcsec", "mpol.utils.fourier_gaussian_klambda_arcsec", "numpy.abs", "mpol.coordinates.GridCoords", "mpol.utils.loglinspace", "matplotlib.pyplot.colorbar", "numpy.diff", "numpy.fft.fft2", "matplotlib.pyplot.subplots" ]
[((373, 422), 'mpol.coordinates.GridCoords', 'coordinates.GridCoords', ([], {'cell_size': '(0.005)', 'npix': '(800)'}), '(cell_size=0.005, npix=800)\n', (395, 422), False, 'from mpol import coordinates, utils\n'), ((463, 553), 'mpol.utils.sky_gaussian_arcsec', 'utils.sky_gaussian_arcsec', (['coords.sky_x_centers_2D', '...
# coding=utf-8 # Copyright 2020 The Uncertainty Metrics Authors. # # 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 appl...
[ "absl.testing.absltest.main", "uncertainty_metrics.numpy.plot_rejection_classification_diagram", "uncertainty_metrics.numpy.plot_confidence_vs_accuracy_diagram", "numpy.random.binomial", "uncertainty_metrics.numpy.reliability_diagram", "numpy.array", "numpy.random.rand" ]
[((2611, 2626), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (2624, 2626), False, 'from absl.testing import absltest\n'), ((833, 1054), 'numpy.array', 'np.array', (['[[0.42610548, 0.41748077, 0.15641374, 0], [0.44766216, 0.47721294, \n 0.0751249, 0], [0.1862702, 0.15139402, 0.66233578, 0], [0.057...
#!/usr/bin/env python3 """Pipeline for emig-reimplementation. This can be run as a module with ``python -m gene_prioritization.cli`` or through the installed command ``gene_prioritization. """ import logging import os import time # import rpy2.robjects as ro import pandas as pd import numpy as np from collections im...
[ "sklearn.model_selection.GridSearchCV", "pandas.read_csv", "numpy.logspace", "os.path.dirname", "emig_reimplemented.node_scoring.NodeScorer", "time.time", "collections.defaultdict", "sklearn.metrics.roc_auc_score", "sklearn.linear_model.LogisticRegression", "sklearn.model_selection.StratifiedKFold...
[((635, 662), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (652, 662), False, 'import logging\n'), ((686, 711), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (701, 711), False, 'import os\n'), ((1414, 1431), 'collections.defaultdict', 'defaultdict', (['list']...
import math import random import numpy as np import matplotlib.pyplot as plt class NSGA2: def __init__(self,max_gen, total_particles, crossover_probability, alpha, mutation_probability): self.max_gen=max_gen self.total_particles = total_particles self.pareto_fronts = [] # List to st...
[ "matplotlib.pyplot.show", "math.sqrt", "random.random", "matplotlib.pyplot.pause", "numpy.random.permutation", "matplotlib.pyplot.subplots" ]
[((9059, 9069), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (9067, 9069), True, 'import matplotlib.pyplot as plt\n'), ((9080, 9094), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (9092, 9094), True, 'import matplotlib.pyplot as plt\n'), ((9356, 9368), 'matplotlib.pyplot.pause', 'plt.pause'...
from os.path import join, splitext import tempfile import numpy as np from rastervision.pipeline.file_system import (make_dir, upload_or_copy, zipdir) from rastervision.core.backend import Backend, SampleWriter from rastervision.core.data_sample import DataSample from ra...
[ "numpy.save", "tempfile.TemporaryDirectory", "rastervision.pipeline.file_system.zipdir", "rastervision.pipeline.file_system.upload_or_copy", "rastervision.core.utils.misc.save_img", "rastervision.pytorch_learner.learner.Learner.from_model_bundle", "os.path.splitext", "os.path.join", "rastervision.pi...
[((721, 735), 'os.path.splitext', 'splitext', (['path'], {}), '(path)\n', (729, 735), False, 'from os.path import join, splitext\n'), ((770, 789), 'numpy.save', 'np.save', (['path', 'chip'], {}), '(path, chip)\n', (777, 789), True, 'import numpy as np\n'), ((808, 828), 'rastervision.core.utils.misc.save_img', 'save_img...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 19 12:02:51 2021 @author: theresasawi """ import h5py import numpy as np import sys import pandas as pd from matplotlib import pyplot as plt sys.path.append('functions/') from setParams import setParams # from generators import gen_sgram_QC impo...
[ "sys.path.append", "h5py.File", "pandas.read_csv", "setParams.setParams", "matplotlib.pyplot.imshow", "specufex.BayesianNonparametricNMF", "numpy.array", "tables.file._open_files.close_all", "specufex.BayesianHMM" ]
[((215, 244), 'sys.path.append', 'sys.path.append', (['"""functions/"""'], {}), "('functions/')\n", (230, 244), False, 'import sys\n'), ((330, 365), 'tables.file._open_files.close_all', 'tables.file._open_files.close_all', ([], {}), '()\n', (363, 365), False, 'import tables\n'), ((688, 702), 'setParams.setParams', 'set...
# coding: utf-8 import matplotlib.pyplot as plt import numpy as np from hexgrid.plotting import plot_hexagons_cube from hexgrid.utils import cube_round from hexgrid.conversions import cartesian2cube_pointy_top from matplotlib import colors CUBE2ID = { (0, 0, 0): 0, (0, 1, -1): 1, (0, -1, 1): 2, (-1, 0...
[ "numpy.zeros_like", "matplotlib.pyplot.show", "matplotlib.pyplot.get_cmap", "hexgrid.conversions.cartesian2cube_pointy_top", "matplotlib.pyplot.colorbar", "hexgrid.plotting.plot_hexagons_cube", "hexgrid.utils.cube_round", "numpy.array", "numpy.linspace", "numpy.bincount" ]
[((538, 561), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['"""inferno"""'], {}), "('inferno')\n", (550, 561), True, 'import matplotlib.pyplot as plt\n'), ((809, 842), 'hexgrid.conversions.cartesian2cube_pointy_top', 'cartesian2cube_pointy_top', (['px', 'py'], {}), '(px, py)\n', (834, 842), False, 'from hexgrid.conv...
import pytest import numpy as np from numpy.testing import assert_allclose from sklearn.linear_model import LinearRegression as skLinearRegression from astroML.linear_model import \ LinearRegression, PolynomialRegression, BasisFunctionRegression try: import pymc3 as pm # noqa: F401 HAS_PYMC3 = True exce...
[ "numpy.random.seed", "numpy.eye", "astroML.linear_model.LinearRegressionwithErrors", "astroML.linear_model.PolynomialRegression", "astroML.linear_model.LinearRegression", "numpy.random.RandomState", "sklearn.linear_model.LinearRegression", "astroML.linear_model.BasisFunctionRegression", "numpy.linal...
[((3072, 3107), 'pytest.mark.skipif', 'pytest.mark.skipif', (['"""not HAS_PYMC3"""'], {}), "('not HAS_PYMC3')\n", (3090, 3107), False, 'import pytest\n'), ((416, 444), 'numpy.random.RandomState', 'np.random.RandomState', (['rseed'], {}), '(rseed)\n', (437, 444), True, 'import numpy as np\n'), ((607, 651), 'astroML.line...
import numpy as np import astropy.units as apu import astropy.constants as apc import astropy.cosmology as acosmo def cMpc_to_z(cMpc, cosmology="Planck15"): """ Convert a comoving distance with units Mpc into a redshift. Parameters ---------- cMpc: array-like, shape (N, ) The distance value...
[ "numpy.zeros_like", "numpy.array", "astropy.cosmology.z_at_value" ]
[((4710, 4738), 'numpy.array', 'np.array', (['[1, 10, 100, 1000]'], {}), '([1, 10, 100, 1000])\n', (4718, 4738), True, 'import numpy as np\n'), ((1631, 1656), 'numpy.zeros_like', 'np.zeros_like', (['cMpc.value'], {}), '(cMpc.value)\n', (1644, 1656), True, 'import numpy as np\n'), ((1410, 1458), 'astropy.cosmology.z_at_...
import unittest import pytest import numpy import cupy from cupy._core import core from cupy.cuda import compiler from cupy.cuda import runtime from cupy import testing def _compile_func(kernel_name, code): # workaround for hipRTC extra_source = core._get_header_source() if runtime.is_hip else None mod ...
[ "cupy.ndarray", "numpy.empty", "cupy.empty_like", "cupy._core.core._get_header_source", "cupy.testing.assert_array_equal", "cupy.array", "numpy.dtype", "pytest.raises", "numpy.arange", "cupy.asnumpy", "cupy.cuda.compiler.compile_with_cache", "numpy.random.rand", "numpy.float64" ]
[((322, 382), 'cupy.cuda.compiler.compile_with_cache', 'compiler.compile_with_cache', (['code'], {'extra_source': 'extra_source'}), '(code, extra_source=extra_source)\n', (349, 382), False, 'from cupy.cuda import compiler\n'), ((258, 283), 'cupy._core.core._get_header_source', 'core._get_header_source', ([], {}), '()\n...
from hyperopt.pyll.base import * from nose import SkipTest from nose.tools import assert_raises import numpy as np from hyperopt.pyll import base def test_literal_pprint(): l = Literal(5) print(str(l)) assert str(l) == '0 Literal{5}' def test_literal_apply(): l0 = Literal([1, 2, 3]) print(str(l...
[ "nose.SkipTest", "numpy.arange", "numpy.all", "nose.tools.assert_raises" ]
[((5571, 5622), 'nose.tools.assert_raises', 'assert_raises', (['Exception', 'rec_eval', 'ab'], {'memo': '{i: 2}'}), '(Exception, rec_eval, ab, memo={i: 2})\n', (5584, 5622), False, 'from nose.tools import assert_raises\n'), ((5832, 5887), 'nose.tools.assert_raises', 'assert_raises', (['Exception', 'rec_eval', 'ab'], {'...
import pytest import numpy as np import os import unittest from unittest.mock import MagicMock, PropertyMock, patch import spiceypy as spice import json import ale from ale import util from ale.drivers.lro_drivers import LroLrocNacPds3LabelNaifSpiceDriver from ale.drivers.lro_drivers import LroLrocNacIsisLabelNaifSpic...
[ "os.remove", "json.dumps", "conftest.get_image", "conftest.convert_kernels", "pytest.mark.parametrize", "json.loads", "conftest.compare_dicts", "numpy.testing.assert_almost_equal", "ale.drivers.lro_drivers.LroLrocNacPds3LabelNaifSpiceDriver", "conftest.get_image_kernels", "ale.drivers.lro_driver...
[((876, 906), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (890, 906), False, 'import pytest\n'), ((1296, 1391), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""label_type, kernel_type"""', "[('isis3', 'naif'), ('isis3', 'isis')]"], {}), "('label_type, kernel_ty...
import argparse import matplotlib.pyplot as plt import numpy as np import torch from sklearn.manifold import TSNE from src import project_dir from src.models.model import ImageClassifier from src.data.mnist import MNISTDataModule def parser(): """Parses command line.""" parser = argparse.ArgumentParser( ...
[ "argparse.ArgumentParser", "sklearn.manifold.TSNE", "matplotlib.pyplot.get_cmap", "src.models.model.ImageClassifier.load_from_checkpoint", "torch.no_grad", "matplotlib.pyplot.subplots", "numpy.unique" ]
[((291, 396), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Script for visualizing embeddings created by image classifier"""'}), "(description=\n 'Script for visualizing embeddings created by image classifier')\n", (314, 396), False, 'import argparse\n'), ((1615, 1629), 'matplotlib.p...
import numpy as np #np is convention for numpy def main(): # creates a function named main(): i = 0 # i is a string, declared with a number 0, initialized as variable i n = 10 x = 119.0 # floating point numbers are declared with a . (a decimal number) # floats sets a precision (sig figs) #p...
[ "numpy.zeros" ]
[((522, 546), 'numpy.zeros', 'np.zeros', (['n'], {'dtype': 'float'}), '(n, dtype=float)\n', (530, 546), True, 'import numpy as np\n')]
""" Game of life, but newly born cells are the average color of their parents. Press "r" to reset the universe, click to draw. """ import numpy as np import scipy.ndimage as nd import pygame KERNEL = np.array([[1, 1, 1], [1, 0, 1], [1, 1, 1]], dtype=np.uint8) DIM = 500, 500 windo...
[ "numpy.dstack", "pygame.quit", "pygame.event.get", "pygame.display.set_mode", "scipy.ndimage.convolve", "pygame.init", "pygame.display.update", "numpy.random.randint", "numpy.array", "numpy.where", "pygame.mouse.get_pos" ]
[((202, 261), 'numpy.array', 'np.array', (['[[1, 1, 1], [1, 0, 1], [1, 1, 1]]'], {'dtype': 'np.uint8'}), '([[1, 1, 1], [1, 0, 1], [1, 1, 1]], dtype=np.uint8)\n', (210, 261), True, 'import numpy as np\n'), ((324, 352), 'pygame.display.set_mode', 'pygame.display.set_mode', (['DIM'], {}), '(DIM)\n', (347, 352), False, 'im...
# ########################################################################### # # CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP) # (C) Cloudera, Inc. 2020 # All rights reserved. # # Applicable Open Source License: Apache 2.0 # # NOTE: Cloudera open source products are modular software products # made up of hu...
[ "numpy.random.seed", "os.getcwd", "numpy.random.random", "numpy.arange", "lib.FaissIndex" ]
[((2268, 2288), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (2282, 2288), True, 'import numpy as np\n'), ((2496, 2509), 'lib.FaissIndex', 'FaissIndex', (['d'], {}), '(d)\n', (2506, 2509), False, 'from lib import FaissIndex\n'), ((2382, 2395), 'numpy.arange', 'np.arange', (['nb'], {}), '(nb)\n',...
import argparse import os from pathlib import Path import numpy as np import torch from tqdm import tqdm from config import SAVE_PATTERN_PATH from dataset_utils.load_immigration import load_immigration_val_dataset from dataset_utils.load_misogyny import load_misogyny_val_dataset from utils.cuda import get_device from...
[ "dataset_utils.load_misogyny.load_misogyny_val_dataset", "argparse.ArgumentParser", "numpy.empty", "pathlib.Path", "utils.read_json.load_ids", "utils.entropy.compute_negative_entropy", "torch.matmul", "utils.save_model.load_model", "tqdm.tqdm", "numpy.save", "numpy.average", "torch.sum", "to...
[((980, 1041), 'utils.huggingface.get_tokens_from_sentences', 'get_tokens_from_sentences', (['val_sentences'], {'tokenizer': 'tokenizer'}), '(val_sentences, tokenizer=tokenizer)\n', (1005, 1041), False, 'from utils.huggingface import get_tokens_from_sentences\n'), ((1056, 1068), 'utils.cuda.get_device', 'get_device', (...
from keras.datasets import mnist # Import the MNIST dataset from context import Pulsar import time import numpy as np start_time = time.time() (train_X, train_y), (test_X, test_y) = mnist.load_data() train_X = train_X.reshape(60000, 784) test_X = test_X.reshape(10000, 784) # Converts training labels into one-hot for...
[ "numpy.argmax", "keras.datasets.mnist.load_data", "numpy.zeros", "time.time", "numpy.arange", "context.Pulsar" ]
[((132, 143), 'time.time', 'time.time', ([], {}), '()\n', (141, 143), False, 'import time\n'), ((184, 201), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (199, 201), False, 'from keras.datasets import mnist\n'), ((331, 354), 'numpy.arange', 'np.arange', (['train_y.size'], {}), '(train_y.size)\n...
# -*- coding: utf-8 -*- """ Description ----------- This module defines the :obj:`ParaMol.Optimizers.gradient_descent.GradientDescent` class, which is the ParaMol implementation of the gradient descent method. """ import numpy as np import copy class GradientDescent: """ ParaMol implementation of the gradien...
[ "copy.deepcopy", "numpy.asarray", "numpy.linalg.norm" ]
[((3918, 3940), 'numpy.asarray', 'np.asarray', (['parameters'], {}), '(parameters)\n', (3928, 3940), True, 'import numpy as np\n'), ((4113, 4138), 'copy.deepcopy', 'copy.deepcopy', (['parameters'], {}), '(parameters)\n', (4126, 4138), False, 'import copy\n'), ((4584, 4609), 'copy.deepcopy', 'copy.deepcopy', (['paramete...
import fnmatch import os from hashlib import sha1 from typing import List, Tuple import numpy as np from pydub import AudioSegment from pydub.utils import audioop from dejavu.third_party import wavio from dejavu.third_party.dejavu_timer import DejavuTimer def unique_hash(file_path: str, block_size: int = 2**20) -> ...
[ "fnmatch.filter", "hashlib.sha1", "os.walk", "dejavu.third_party.wavio.readwav", "pydub.AudioSegment.from_file", "os.path.join", "numpy.fromstring", "dejavu.third_party.dejavu_timer.DejavuTimer" ]
[((1587, 1637), 'dejavu.third_party.dejavu_timer.DejavuTimer', 'DejavuTimer', ([], {'name': "(__name__ + '.read()\\t\\t\\t\\t\\t\\t')"}), "(name=__name__ + '.read()\\t\\t\\t\\t\\t\\t')\n", (1598, 1637), False, 'from dejavu.third_party.dejavu_timer import DejavuTimer\n'), ((649, 655), 'hashlib.sha1', 'sha1', ([], {}), '...
#!/usr/bin/env python # coding: utf-8 # # EDA by Vatsal # ![vaccine-image.jpg](Images/head.jpg) # **What do we have**? # # We have a subset of an Eterna dataset comprising over 3000 RNA molecules (which span a panoply of sequences and structures) and their degradation rates at each position. # # There are multiple...
[ "matplotlib.pyplot.title", "numpy.load", "seaborn.heatmap", "pandas.read_csv", "matplotlib.pyplot.figure", "forgi.visual.mplotlib.plot_rna", "numpy.zeros_like", "numpy.triu_indices_from", "collections.Counter", "matplotlib.pyplot.subplots", "seaborn.set_context", "matplotlib.pyplot.show", "f...
[((5316, 5362), 'pandas.read_json', 'pd.read_json', (['f"""{path}/train.json"""'], {'lines': '(True)'}), "(f'{path}/train.json', lines=True)\n", (5328, 5362), True, 'import pandas as pd\n'), ((5372, 5417), 'pandas.read_json', 'pd.read_json', (['f"""{path}/test.json"""'], {'lines': '(True)'}), "(f'{path}/test.json', lin...
# -*- coding: utf-8 -*- """ es7 """ import numpy as np import interpolL as fz import matplotlib.pyplot as plt import math from funzioni_Interpolazione_Polinomiale import InterpL def zeri_Cheb(a,b,n): t1=(a+b)/2 t2=(b-a)/2 x=np.zeros((n+1,)) for k in range(n+1): x[k]=t1+t2*n...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "numpy.abs", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.zeros", "interpolL.interpolL", "numpy.sin", "numpy.linspace", "numpy.cos", "numpy.sinh" ]
[((936, 958), 'numpy.linspace', 'np.linspace', (['a', 'b', '(200)'], {}), '(a, b, 200)\n', (947, 958), True, 'import numpy as np\n'), ((984, 1006), 'interpolL.interpolL', 'fz.interpolL', (['x', 'y', 'xx'], {}), '(x, y, xx)\n', (996, 1006), True, 'import interpolL as fz\n'), ((1088, 1147), 'matplotlib.pyplot.legend', 'p...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA import unittest import chainer from chainer import testing ...
[ "future.standard_library.install_aliases", "chainerrl.distribution.ContinuousDeterministicDistribution", "numpy.ones", "chainerrl.distribution.GaussianDistribution", "numpy.zeros_like", "chainer.functions.gaussian_kl_divergence", "numpy.identity", "chainer.cuda.to_cpu", "numpy.testing.assert_allclos...
[((216, 250), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (248, 250), False, 'from future import standard_library\n'), ((1331, 1349), 'chainer.testing.condition.retry', 'condition.retry', (['(3)'], {}), '(3)\n', (1346, 1349), False, 'from chainer.testing import condi...
import os import math import torch import numpy as np from sklearn.cluster import DBSCAN import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as patches from util import utils_data from data_handle import sid_object def kernel_Gaussian(X, Mu=[0,0], Sigma=[[0.05,0],[0,0.05]]): X = np.arra...
[ "util.utils_data.index2map", "numpy.mean", "data_handle.sid_object.Graph", "sklearn.cluster.DBSCAN", "matplotlib.colors.LinearSegmentedColormap.from_list", "numpy.meshgrid", "matplotlib.pyplot.register_cmap", "numpy.std", "numpy.transpose", "matplotlib.pyplot.colorbar", "torch.exp", "numpy.max...
[((387, 402), 'numpy.array', 'np.array', (['Sigma'], {}), '(Sigma)\n', (395, 402), True, 'import numpy as np\n'), ((1103, 1120), 'numpy.meshgrid', 'np.meshgrid', (['x', 'y'], {}), '(x, y)\n', (1114, 1120), True, 'import numpy as np\n'), ((1218, 1230), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (1226, 1230), Tru...
import matplotlib.pyplot as plt import matplotlib.patches as patches from torchvision import transforms import torch from torchvision.ops import boxes as box_ops import requests from model import get_transform import config from PIL import Image import io from werkzeug.utils import secure_filename import numpy as np ...
[ "io.BytesIO", "matplotlib.patches.Rectangle", "matplotlib.pyplot.margins", "model.get_transform", "requests.Session", "torchvision.transforms.ToPILImage", "matplotlib.pyplot.axis", "werkzeug.utils.secure_filename", "PIL.Image.open", "numpy.where", "torchvision.ops.boxes.nms", "matplotlib.pyplo...
[((429, 455), 'model.get_transform', 'get_transform', ([], {'train': '(False)'}), '(train=False)\n', (442, 455), False, 'from model import get_transform\n'), ((776, 806), 'werkzeug.utils.secure_filename', 'secure_filename', (['file.filename'], {}), '(file.filename)\n', (791, 806), False, 'from werkzeug.utils import sec...
import copy import numpy as np import param from cartopy import crs as ccrs from cartopy.io.img_tiles import GoogleTiles try: from owslib.wmts import WebMapTileService except: WebMapTileService = None from holoviews.core import (Store, HoloMap, Layout, Overlay, CompositeOverlay, E...
[ "param.Integer", "holoviews.core.options.SkipRendering", "param.Number", "holoviews.core.options.Options", "holoviews.core.Store.options", "holoviews.core.Store.register", "holoviews.core.util.match_spec", "param.Boolean", "copy.copy", "numpy.isfinite", "cartopy.io.img_tiles.GoogleTiles", "num...
[((16459, 17028), 'holoviews.core.Store.register', 'Store.register', (['{LineContours: LineContourPlot, FilledContours: FilledContourPlot, Image:\n GeoImagePlot, Feature: FeaturePlot, WMTS: WMTSPlot, Tiles: WMTSPlot,\n Points: GeoPointPlot, VectorField: GeoVectorFieldPlot, Text:\n GeoTextPlot, Layout: LayoutPl...
""" Functions for online analysis of all-atom (AA) simulations. """ import os import time import argparse import traceback import shutil import io import tarfile from time import sleep import numpy as np import MDAnalysis as mda from MDAnalysis.analysis import rms from MDAnalysis.analysis import align from MDAnalysis...
[ "numpy.load", "argparse.ArgumentParser", "mummi_core.utils.Naming.status_flags", "numpy.empty", "os.path.isfile", "numpy.linalg.norm", "MDAnalysis.Merge", "os.path.join", "shutil.copy", "mummi_ras.get_interfaces", "traceback.print_exc", "mummi_ras.get_io", "mummi_core.init", "MDAnalysis.tr...
[((755, 774), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (764, 774), False, 'from logging import getLogger\n'), ((1309, 1331), 'os.path.isdir', 'os.path.isdir', (['outpath'], {}), '(outpath)\n', (1322, 1331), False, 'import os\n'), ((8151, 8182), 'os.path.join', 'os.path.join', (['outpath', '...
import os import sys cwd = os.getcwd() sys.path.append(cwd) import pickle import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from plot.helper import plot_task, plot_weights, plot_rf_z_max, plot_rf, plot_vector_traj tasks = [ 'com_pos', 'com_vel', 'torso_com_link_quat', '...
[ "sys.path.append", "numpy.stack", "matplotlib.pyplot.show", "os.getcwd", "plot.helper.plot_weights", "plot.helper.plot_task", "plot.helper.plot_rf", "matplotlib.use", "pickle.load", "plot.helper.plot_rf_z_max" ]
[((27, 38), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (36, 38), False, 'import os\n'), ((39, 59), 'sys.path.append', 'sys.path.append', (['cwd'], {}), '(cwd)\n', (54, 59), False, 'import sys\n'), ((112, 135), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (126, 135), False, 'import matplotl...
#Gerekli kütüphanelerimizi içeri aktarıyoruz. from keras.datasets import mnist import cv2 import time import numpy as np from keras.layers import Dense, Conv2D, MaxPooling2D, Flatten, Dropout from keras.models import Sequential, load_model from keras.utils import to_categorical #Eğitim ve test verilerimizi aktarıyo...
[ "keras.models.load_model", "keras.datasets.mnist.load_data", "keras.layers.Flatten", "time.sleep", "cv2.imread", "keras.layers.Dense", "keras.layers.Conv2D", "numpy.array", "keras.models.Sequential", "keras.layers.MaxPooling2D", "keras.utils.to_categorical" ]
[((379, 396), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (394, 396), False, 'from keras.datasets import mnist\n'), ((635, 663), 'keras.utils.to_categorical', 'to_categorical', (['train_labels'], {}), '(train_labels)\n', (649, 663), False, 'from keras.utils import to_categorical\n'), ((676, 7...
# -*- coding:utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the ...
[ "os.path.abspath", "numpy.load", "subprocess.Popen", "pickle.dump", "os.path.basename", "torch.cuda.device_count", "os.environ.get", "vega.core.common.UserConfig", "vega.core.common.Config", "traceback.format_exc", "vega.core.common.FileOps.copy_file", "os.path.join", "logging.getLogger" ]
[((829, 856), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (846, 856), False, 'import logging\n'), ((3267, 3297), 'os.path.abspath', 'os.path.abspath', (['models_folder'], {}), '(models_folder)\n', (3282, 3297), False, 'import os\n'), ((4058, 4090), 'os.path.abspath', 'os.path.abspath',...
# - * - coding: utf - 8 - * - """ Beam search for a ply group search """ __version__ = '2.0' __author__ = '<NAME>' import sys import math as ma import numpy as np sys.path.append(r'C:\BELLA_and_LAYLA') from src.divers.pretty_print import print_lampam, print_ss, print_list_ss from src.guidelines.ten_pe...
[ "numpy.invert", "numpy.argmax", "numpy.argmin", "numpy.unique", "sys.path.append", "src.divers.arrays.max_arrays", "numpy.copy", "src.CLA.lampam_functions.calc_lampam_from_delta_lp_matrix", "src.guidelines.ipo_oopo.calc_penalty_ipo_oopo_ss", "numpy.matlib.repmat", "src.LAYLA_V02.pruning.pruning_...
[((179, 217), 'sys.path.append', 'sys.path.append', (['"""C:\\\\BELLA_and_LAYLA"""'], {}), "('C:\\\\BELLA_and_LAYLA')\n", (194, 217), False, 'import sys\n'), ((3715, 3730), 'numpy.copy', 'np.copy', (['ss_bot'], {}), '(ss_bot)\n', (3722, 3730), True, 'import numpy as np\n'), ((4398, 4419), 'numpy.zeros', 'np.zeros', (['...
import numpy as np from scipy.stats import pearsonr def steady_state_correlation(location, batch_targets, batch, process_targets, transient=0.8): selection = [(t in process_targets) for t in batch_targets] selection = np.array(selection, dtype=bool) time = batch[:, 0, :] d...
[ "numpy.array", "scipy.stats.pearsonr" ]
[((257, 288), 'numpy.array', 'np.array', (['selection'], {'dtype': 'bool'}), '(selection, dtype=bool)\n', (265, 288), True, 'import numpy as np\n'), ((425, 457), 'scipy.stats.pearsonr', 'pearsonr', (['traj[0, :]', 'traj[1, :]'], {}), '(traj[0, :], traj[1, :])\n', (433, 457), False, 'from scipy.stats import pearsonr\n')...
import os.path import numpy as np import matplotlib.pyplot as plt #import matplotlib.transforms as plt.transforms from common import ensure_dir_exists import dataReader # data types data_type = 'mnist' repr_dim = 16 # seeds seeds = [0] # samples samples = range(15) # algorithms algorithms = [ # 'pca', # 'ae_l...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "numpy.load", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "common.ensure_dir_exists", "matplotlib.pyplot.savefig" ]
[((1257, 1323), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(tiled[0] * figsize[0], tiled[1] * figsize[1])'}), '(figsize=(tiled[0] * figsize[0], tiled[1] * figsize[1]))\n', (1267, 1323), True, 'import matplotlib.pyplot as plt\n'), ((1469, 1491), 'numpy.load', 'np.load', (['data_filename'], {}), '(data_f...
import tensorflow as tf import numpy as np from tensorflow.contrib import slim from configs import CLASS class YOLONET(object): def __init__(self, is_training=True): self.is_training = is_training self.classes = CLASS self.class_num = len(self.classes) self.image_size = 448 ...
[ "tensorflow.clip_by_value", "tensorflow.maximum", "tensorflow.reshape", "tensorflow.sqrt", "tensorflow.reduce_max", "tensorflow.nn.leaky_relu", "tensorflow.contrib.slim.l2_regularizer", "tensorflow.contrib.slim.conv2d", "tensorflow.losses.add_loss", "tensorflow.variable_scope", "tensorflow.minim...
[((756, 859), 'tensorflow.placeholder', 'tf.placeholder', ([], {'dtype': 'tf.float32', 'name': '"""images"""', 'shape': '[None, self.image_size, self.image_size, 3]'}), "(dtype=tf.float32, name='images', shape=[None, self.\n image_size, self.image_size, 3])\n", (770, 859), True, 'import tensorflow as tf\n'), ((11767...
import numpy as np import nlopt import matplotlib.pyplot as plt from dolfin import * from fenics_helpers.boundary import * from scipy.sparse import lil_matrix, csr_matrix import tqdm ## SIMP def simp(x): p = Constant(3.) _eps = Constant(1.e-6) return _eps + (1 - _eps) * x ** p class FEM: def __init...
[ "tqdm.tqdm", "nlopt.opt", "numpy.asarray", "numpy.zeros", "numpy.ones", "scipy.sparse.csr_matrix", "numpy.linalg.norm" ]
[((3578, 3589), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (3586, 3589), True, 'import numpy as np\n'), ((3658, 3684), 'nlopt.opt', 'nlopt.opt', (['nlopt.LD_MMA', 'n'], {}), '(nlopt.LD_MMA, n)\n', (3667, 3684), False, 'import nlopt\n'), ((2159, 2172), 'scipy.sparse.csr_matrix', 'csr_matrix', (['A'], {}), '(A)\n',...
import pyximport; pyximport.install() import numpy as np from compmech.integrate.integratev import _test_integratev def test_integratev_trapz2d(nx=30, ny=30, method='trapz2d'): out = _test_integratev(nx, ny, method) assert np.allclose(out, (4/np.pi**2, 4/(9*np.pi**2), 4/(25*np.pi**2)), atol=1.e-3...
[ "numpy.allclose", "pyximport.install", "compmech.integrate.integratev._test_integratev" ]
[((18, 37), 'pyximport.install', 'pyximport.install', ([], {}), '()\n', (35, 37), False, 'import pyximport\n'), ((190, 222), 'compmech.integrate.integratev._test_integratev', '_test_integratev', (['nx', 'ny', 'method'], {}), '(nx, ny, method)\n', (206, 222), False, 'from compmech.integrate.integratev import _test_integ...
#!/usr/bin/env python from __future__ import print_function # ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with ...
[ "numpy.testing.Tester" ]
[((1461, 1469), 'numpy.testing.Tester', 'Tester', ([], {}), '()\n', (1467, 1469), False, 'from numpy.testing import Tester\n')]
# -*- coding: utf-8 -*- """ Created on Tue Jan 18 21:34:22 2022 @author: joelr """ # Date (DD/MM/YYYY) # Time (HH.MM.SS) # PT08.S1 (CO) – Variável de predição # Non Metanic HydroCarbons Concentration (mg/m^3) # 4 Benzene Concentration (mg/m^3) # PT08.S2 (NMHC) # NOx Concentration (ppb) # PT08.S3 (NOx) # ...
[ "pandas.DataFrame", "seaborn.heatmap", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pandas.date_range", "pandas.read_csv", "matplotlib.pyplot.scatter", "matplotlib.pyplot.bar", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.boxplot", "datetime.date", "sklearn.linear_mod...
[((747, 838), 'pandas.read_csv', 'pd.read_csv', (['"""C:\\\\Users\\\\joelr\\\\Desktop\\\\Recruit Project\\\\qualidade_do_ar.csv"""'], {'sep': '""";"""'}), "('C:\\\\Users\\\\joelr\\\\Desktop\\\\Recruit Project\\\\qualidade_do_ar.csv',\n sep=';')\n", (758, 838), True, 'import pandas as pd\n'), ((10062, 10088), 'matplo...
import argparse import json import logging import os import threading import time from copy import copy # from concurrent.futures import ThreadPoolExecutor # from queue import Queue import numpy as np import rospy from matplotlib import pyplot as plt from sensor_msgs.msg import JointState from std_msgs.msg import Floa...
[ "argparse.ArgumentParser", "numpy.ones", "numpy.clip", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "alg.sac.SAC", "numpy.linalg.norm", "matplotlib.pyplot.tight_layout", "os.path.join", "model.mujoco_agent.MujocoAgent", "rospy.Time.now", "matplotlib.pyplot.close", "model.mujoc...
[((971, 987), 'copy.copy', 'copy', (['Param_Dict'], {}), '(Param_Dict)\n', (975, 987), False, 'from copy import copy\n'), ((1003, 1020), 'copy.copy', 'copy', (['SENSOR_MODE'], {}), '(SENSOR_MODE)\n', (1007, 1020), False, 'from copy import copy\n'), ((1250, 1277), 'logging.getLogger', 'logging.getLogger', (['__name__'],...
# # Copyright The NOMAD Authors. # # This file is part of NOMAD. See https://nomad-lab.eu for further info. # # 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/licen...
[ "nomad.datamodel.EntryArchive", "pytest.fixture", "pytest.approx", "numpy.shape", "gromacsparser.gromacs_parser.GromacsParser" ]
[((878, 908), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (892, 908), False, 'import pytest\n'), ((836, 874), 'pytest.approx', 'pytest.approx', (['value'], {'abs': 'abs', 'rel': 'rel'}), '(value, abs=abs, rel=rel)\n', (849, 874), False, 'import pytest\n'), ((934, 949), 'gr...
# -*- coding: utf-8 -*- # """ .. math:: \\DeclareMathOperator{\\div}{div} \\DeclareMathOperator{\\curl}{curl} The equation system defined here are largely based on :cite:`Cha97`, with the addition of the material flux :math:`u` of the liquid. Given an electric field :math:`E`, a magnetic field :math:`B`, and ...
[ "dolfin.TrialFunctions", "dolfin.grad", "numpy.empty", "dolfin.DirichletBC", "dolfin.Function", "dolfin.mpi_comm_world", "dolfin.FunctionSpace", "dolfin.TestFunctions", "dolfin.Constant", "dolfin.info", "dolfin.SpatialCoordinate", "dolfin.interpolate", "numpy.dot", "numpy.linalg.solve", ...
[((8564, 8598), 'dolfin.KrylovSolver', 'KrylovSolver', (['"""gmres"""', '"""hypre_amg"""'], {}), "('gmres', 'hypre_amg')\n", (8576, 8598), False, 'from dolfin import info, DOLFIN_EPS, DirichletBC, Function, KrylovSolver, dot, grad, pi, TrialFunctions, TestFunctions, assemble, Constant, project, FunctionSpace, SpatialCo...
from glue.viewers.matplotlib.mpl_axes import init_mpl from matplotlib.figure import Figure import numpy as np class ProjectionMplTransform(object): def __init__(self, projection, x_lim, y_lim, x_scale, y_scale): self._state = {'projection': projection, 'x_lim': x_lim, 'y_lim': y_lim, ...
[ "matplotlib.figure.Figure", "numpy.hsplit" ]
[((958, 975), 'numpy.hsplit', 'np.hsplit', (['res', '(2)'], {}), '(res, 2)\n', (967, 975), True, 'import numpy as np\n'), ((390, 398), 'matplotlib.figure.Figure', 'Figure', ([], {}), '()\n', (396, 398), False, 'from matplotlib.figure import Figure\n')]
import os, errno, sys import h5py import numpy as np def prepare_output_file(filename): try: os.makedirs(os.path.dirname(filename)) except OSError as e: if e.errno != errno.EEXIST: raise e def read_hdf5(filename, datasets=None): if datasets is None: if ':' in filename: ...
[ "numpy.asarray", "h5py.File", "os.path.dirname" ]
[((458, 482), 'h5py.File', 'h5py.File', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (467, 482), False, 'import h5py\n'), ((1067, 1095), 'h5py.File', 'h5py.File', (['filename[:i]', '"""r"""'], {}), "(filename[:i], 'r')\n", (1076, 1095), False, 'import h5py\n'), ((1452, 1484), 'numpy.asarray', 'np.asarray', (['[d...
'''Interface to C functions in the extensions folder.''' import os # python import ctypes # python from numpy.ctypeslib import ndpointer # scipy cextensions = ctypes.cdll.LoadLibrary(os.getcwd() + "/extensions/extensions.so") SetImageToAverageValues = cextensions.SetImageToAverageValues SetImageToAverageValues.resty...
[ "os.getcwd", "numpy.ctypeslib.ndpointer" ]
[((370, 417), 'numpy.ctypeslib.ndpointer', 'ndpointer', (['ctypes.c_float'], {'flags': '"""C_CONTIGUOUS"""'}), "(ctypes.c_float, flags='C_CONTIGUOUS')\n", (379, 417), False, 'from numpy.ctypeslib import ndpointer\n'), ((453, 500), 'numpy.ctypeslib.ndpointer', 'ndpointer', (['ctypes.c_float'], {'flags': '"""C_CONTIGUOUS...
# python3 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import collections from collections import OrderedDict from absl import app from absl import flags import io import numpy as np import tensorflow.compat.v1 as tf tf.disable_e...
[ "numpy.sum", "tensorflow.compat.v1.io.gfile.exists", "tensorflow.compat.v1.disable_eager_execution", "numpy.mean", "absl.flags.DEFINE_boolean", "tensorflow_probability.distributions.Laplace", "tensorflow.compat.v1.compat.v1.global_variables_initializer", "os.path.join", "absl.flags.DEFINE_list", "...
[((308, 336), 'tensorflow.compat.v1.disable_eager_execution', 'tf.disable_eager_execution', ([], {}), '()\n', (334, 336), True, 'import tensorflow.compat.v1 as tf\n'), ((734, 808), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""model"""'], {'default': '"""8schools"""', 'help': '"""Model to be used."""'}), "('...
import numpy as np import pytest from _utils import ( create_test_object, create_test_properties, create_test_tracklet, ) def test_object(): """Test that an object is correctly instantiated, and that the stored data matches the data used for creation.""" obj, data = create_test_object() fo...
[ "_utils.create_test_object", "_utils.create_test_properties", "pytest.mark.parametrize", "numpy.testing.assert_equal", "_utils.create_test_tracklet" ]
[((692, 751), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""track_len"""', '[0, 1, 10, 100, 1000]'], {}), "('track_len', [0, 1, 10, 100, 1000])\n", (715, 751), False, 'import pytest\n'), ((1290, 1349), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""track_len"""', '[0, 1, 10, 100, 1000]'], {})...
import numpy as np def projection_simplex(v, z=1): """Projection onto unit simplex.""" n_features = v.shape[0] u = np.sort(v)[::-1] cssv = np.cumsum(u) - z ind = np.arange(n_features) + 1 cond = u - cssv / ind > 0 rho = ind[cond][-1] theta = cssv[cond][-1] / float(rho) w = np.maximu...
[ "numpy.sort", "numpy.maximum", "numpy.arange", "numpy.cumsum" ]
[((311, 335), 'numpy.maximum', 'np.maximum', (['(v - theta)', '(0)'], {}), '(v - theta, 0)\n', (321, 335), True, 'import numpy as np\n'), ((128, 138), 'numpy.sort', 'np.sort', (['v'], {}), '(v)\n', (135, 138), True, 'import numpy as np\n'), ((156, 168), 'numpy.cumsum', 'np.cumsum', (['u'], {}), '(u)\n', (165, 168), Tru...
import numpy as np from log_utils import * def mds_conf_matrix(n, k): if k == 2: G = np.zeros((2, n)) for j in range(n): if j == 0: G[0, j] = 1 G[1, j] = 0 elif j == 1: G[0, j] = 0 G[1, j] = 1 else: G[0, j] = 1 G[1, j] = j-1 return G el...
[ "numpy.array", "numpy.zeros" ]
[((93, 109), 'numpy.zeros', 'np.zeros', (['(2, n)'], {}), '((2, n))\n', (101, 109), True, 'import numpy as np\n'), ((816, 854), 'numpy.array', 'np.array', (['[[1, 0, 1, 0], [0, 1, 0, 1]]'], {}), '([[1, 0, 1, 0], [0, 1, 0, 1]])\n', (824, 854), True, 'import numpy as np\n'), ((339, 355), 'numpy.zeros', 'np.zeros', (['(3,...
''' Training script for ImageNet Copyright (c) <NAME>, 2017 ''' from __future__ import print_function import argparse import os import shutil import time import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.optim i...
[ "argparse.ArgumentParser", "os.path.isfile", "torchvision.transforms.Normalize", "torch.no_grad", "os.path.join", "random.randint", "torch.nn.parallel.DistributedDataParallel", "torch.load", "os.path.dirname", "random.seed", "torch.manual_seed", "utils.accuracy2", "torch.cuda.is_available", ...
[((890, 954), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch ImageNet Training"""'}), "(description='PyTorch ImageNet Training')\n", (913, 954), False, 'import argparse\n'), ((5111, 5136), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (5134, 5136), False...
# -*- coding: utf-8 -*- import random import numpy as np from keras.models import Sequential, Model from keras.layers import Dense, Dropout, Lambda, Input, Subtract, Add from keras.optimizers import Adam from keras.utils import to_categorical from keras import losses import keras.backend as K import pandas as pd class...
[ "numpy.sum", "numpy.abs", "numpy.invert", "keras.layers.Dropout", "keras.optimizers.Adam", "keras.models.Model", "numpy.isnan", "keras.layers.Add", "keras.layers.Dense", "numpy.array", "numpy.reshape", "keras.layers.Subtract", "keras.backend.mean", "keras.layers.Input", "keras.models.Seq...
[((1148, 1160), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1158, 1160), False, 'from keras.models import Sequential, Model\n'), ((1189, 1201), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1199, 1201), False, 'from keras.models import Sequential, Model\n'), ((5411, 5458), 'keras.utils.to_...
# # ----------------------------- INFO --------------------------- # In this python script we implement and run a BNN for predicting default on # credit card clients. The sampler is based on the NUTS sampler # # ----------------------------- IMPORTS --------------------------- import sys import time import numpy as np...
[ "tensorflow.random.set_seed", "seaborn.set_style", "pymc3.sample", "pymc3.Model", "theano.tensor.dot", "pandas.read_csv", "sklearn.model_selection.train_test_split", "pymc3.Normal", "arviz.utils.Numba.disable_numba", "numpy.ones", "sklearn.metrics.log_loss", "numpy.insert", "time.time", "p...
[((577, 598), 'arviz.utils.Numba.disable_numba', 'Numba.disable_numba', ([], {}), '()\n', (596, 598), False, 'from arviz.utils import Numba\n'), ((692, 714), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('white')\n", (705, 714), True, 'import seaborn as sns\n'), ((1168, 1190), 'tensorflow.random.set_se...
from foolbox.attacks.base import Attack import numpy as np nprng = np.random.RandomState() nprng.seed(31) class GaussAttack(Attack): def __call__(self, input_or_adv, label=None, unpack=True, epsilon=0.03, bounds=(0, 1)): min_, max_ = bounds std = epsilon / np.sqrt(3) * (max_ - mi...
[ "numpy.random.RandomState", "numpy.sqrt" ]
[((68, 91), 'numpy.random.RandomState', 'np.random.RandomState', ([], {}), '()\n', (89, 91), True, 'import numpy as np\n'), ((297, 307), 'numpy.sqrt', 'np.sqrt', (['(3)'], {}), '(3)\n', (304, 307), True, 'import numpy as np\n')]
import image_slicer import nrrd import SimpleITK as sitk import os import sys module_path = os.path.abspath(os.path.join('../../..')) if module_path not in sys.path: sys.path.append(module_path) from PIL import Image import numpy as np import pandas as pd import PIL.ImageDraw as ImageDraw import PIL.Image as Image ...
[ "pandas.DataFrame", "sys.path.append", "numpy.copy", "SimpleITK.ReadImage", "numpy.transpose", "SimpleITK.GetArrayFromImage", "random.randrange", "numpy.array", "PIL.ImageDraw.Draw", "os.path.join" ]
[((526, 540), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (538, 540), True, 'import pandas as pd\n'), ((108, 132), 'os.path.join', 'os.path.join', (['"""../../.."""'], {}), "('../../..')\n", (120, 132), False, 'import os\n'), ((170, 198), 'sys.path.append', 'sys.path.append', (['module_path'], {}), '(module_p...
import numpy as np import matplotlib.pyplot as plt from os.path import basename, exists import warnings from MulensModel.utils import Utils, PlotUtils from MulensModel.satelliteskycoord import SatelliteSkyCoord from MulensModel.coordinates import Coordinates class MulensData(object): """ A set of photometric...
[ "MulensModel.utils.PlotUtils.find_subtract", "os.path.basename", "matplotlib.pyplot.scatter", "numpy.asarray", "numpy.logical_not", "numpy.dtype", "os.path.exists", "MulensModel.coordinates.Coordinates", "MulensModel.utils.Utils.get_mag_and_err_from_flux", "numpy.min", "numpy.array", "MulensMo...
[((15288, 15386), 'MulensModel.utils.PlotUtils.find_subtract', 'PlotUtils.find_subtract', ([], {'subtract_2450000': 'subtract_2450000', 'subtract_2460000': 'subtract_2460000'}), '(subtract_2450000=subtract_2450000, subtract_2460000\n =subtract_2460000)\n', (15311, 15386), False, 'from MulensModel.utils import Utils,...
#!/usr/bin/python3 """ Annotaes and image provided by the allsky software https://github.com/thomasjacquin/allsky This script will take various inputs, see the -h option and use these to overlay test and images on images captured by the allsky software. It is intended to be used in real-time as part ...
[ "os.remove", "ephem.Observer", "csv.reader", "argparse.ArgumentParser", "ephem.previous_new_moon", "numpy.ones", "cv2.warpAffine", "os.path.isfile", "pathlib.Path", "os.path.join", "cv2.getRotationMatrix2D", "cv2.cvtColor", "cv2.imwrite", "os.path.dirname", "os.path.exists", "re.findal...
[((21744, 21769), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (21767, 21769), False, 'import argparse\n'), ((1764, 1789), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1779, 1789), False, 'import os\n'), ((1887, 1934), 'os.path.join', 'os.path.join', (['self._scr...
################################################################# ################################################################# ############### Normalize Dataset ################################################################# ################################################################# #####################...
[ "rpy2.robjects.pandas2ri.py2ri", "warnings.simplefilter", "os.path.realpath", "rpy2.robjects.pandas2ri.activate", "warnings.catch_warnings", "numpy.log10" ]
[((560, 580), 'rpy2.robjects.pandas2ri.activate', 'pandas2ri.activate', ([], {}), '()\n', (578, 580), False, 'from rpy2.robjects import r, pandas2ri\n'), ((1166, 1191), 'warnings.catch_warnings', 'warnings.catch_warnings', ([], {}), '()\n', (1189, 1191), False, 'import warnings\n'), ((1195, 1226), 'warnings.simplefilte...
import matplotlib import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import numpy as np matplotlib.rc('xtick', labelsize=5) matplotlib.rc('ytick', labelsize=5) # Importing the dataset dataset = pd.read_csv('./dati/dpc-covid19-ita-regioni.csv') # time axis days = [t[0] for t in enumerate(np.uni...
[ "matplotlib.pyplot.title", "matplotlib.rc", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "pandas.read_csv", "matplotlib.pyplot.legend", "numpy.unique", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig" ]
[((112, 147), 'matplotlib.rc', 'matplotlib.rc', (['"""xtick"""'], {'labelsize': '(5)'}), "('xtick', labelsize=5)\n", (125, 147), False, 'import matplotlib\n'), ((148, 183), 'matplotlib.rc', 'matplotlib.rc', (['"""ytick"""'], {'labelsize': '(5)'}), "('ytick', labelsize=5)\n", (161, 183), False, 'import matplotlib\n'), (...
import pickle import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from qubo_nn.config import Config from qubo_nn.pipeline import ReverseOptimizer mpl.font_manager._rebuild() plt.rc('font', family='Raleway') plt.rcParams["axes.prop_cycle"] = plt.cycler("color", plt.cm.Set2.colors) kv = { ...
[ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "matplotlib.font_manager._rebuild", "qubo_nn.pipeline.ReverseOptimizer", "matplotlib.pyplot.cycler", "pickle.load", "qubo_nn.config.Config", "matplotlib.pyplot.rc", "numpy.where", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", ...
[((174, 201), 'matplotlib.font_manager._rebuild', 'mpl.font_manager._rebuild', ([], {}), '()\n', (199, 201), True, 'import matplotlib as mpl\n'), ((202, 234), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'family': '"""Raleway"""'}), "('font', family='Raleway')\n", (208, 234), True, 'import matplotlib.pyplot as p...
# # actions-sim.py # # reading BabaMW/actionsFileID7001.fits # from astropy.io import fits as pyfits import math import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib.gridspec as gridspec from matplotlib import patches from scipy import stats from scipy impo...
[ "numpy.sum", "numpy.shape", "numpy.histogram", "numpy.exp", "numpy.interp", "numpy.zeros_like", "matplotlib.patches.Rectangle", "numpy.histogram2d", "numpy.power", "matplotlib.pyplot.close", "numpy.max", "numpy.fabs", "numpy.linspace", "numpy.log10", "matplotlib.pyplot.subplots", "skle...
[((1029, 1048), 'astropy.io.fits.open', 'pyfits.open', (['infile'], {}), '(infile)\n', (1040, 1048), True, 'from astropy.io import fits as pyfits\n'), ((2998, 3019), 'numpy.array', 'np.array', (['[0.0, 1.75]'], {}), '([0.0, 1.75])\n', (3006, 3019), True, 'import numpy as np\n'), ((3030, 3050), 'numpy.array', 'np.array'...
import numpy as np import matplotlib.pyplot as plt mu, sigma = 100, 15 x = np.random.normal(mu, sigma, 10000) # the histogram of the data n, bins, patches = plt.hist(x, 50, facecolor='g', alpha=0.75, density=True) plt.xlabel('Smarts') plt.ylabel('Probability') plt.title('Histogram of IQ') plt.text(60, .025, r'$\mu=...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.hist", "matplotlib.pyplot.axis", "matplotlib.pyplot.text", "numpy.random.normal", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid" ]
[((77, 111), 'numpy.random.normal', 'np.random.normal', (['mu', 'sigma', '(10000)'], {}), '(mu, sigma, 10000)\n', (93, 111), True, 'import numpy as np\n'), ((160, 216), 'matplotlib.pyplot.hist', 'plt.hist', (['x', '(50)'], {'facecolor': '"""g"""', 'alpha': '(0.75)', 'density': '(True)'}), "(x, 50, facecolor='g', alpha=...
import torch import matplotlib.pyplot as plt import numpy as np import time import floris.tools as wfct from .superposition import super_position __author__ = "<NAME>" __copyright__ = "Copyright 2021, CNNwake" __credits__ = ["<NAME>"] __license__ = "MIT" __version__ = "1.0" __email__ = "<EMAIL>" __statu...
[ "numpy.allclose", "FCC_model.FCNN", "numpy.ones", "numpy.clip", "numpy.mean", "torch.no_grad", "numpy.meshgrid", "torch.load", "numpy.append", "numpy.max", "matplotlib.pyplot.rcParams.update", "numpy.linspace", "matplotlib.pyplot.subplots", "floris.tools.floris_interface.FlorisInterface", ...
[((1132, 1189), 'numpy.linspace', 'np.linspace', (['domain_size[0]', 'domain_size[1]', 'nr_points[0]'], {}), '(domain_size[0], domain_size[1], nr_points[0])\n', (1143, 1189), True, 'import numpy as np\n'), ((1199, 1256), 'numpy.linspace', 'np.linspace', (['domain_size[2]', 'domain_size[3]', 'nr_points[1]'], {}), '(doma...
import os import numpy as np from PIL import Image def box_image(im_path, new_w, new_h): orig = Image.open(im_path) w, h = orig.size w_scale = float(new_w) / w h_scale = float(new_h) / h n_w = new_w n_h = new_h if w_scale < h_scale: n_h = int(h * w_scale) else: n_w = i...
[ "os.path.isdir", "random.sample", "numpy.ones", "PIL.Image.open", "os.path.join", "os.listdir" ]
[((102, 121), 'PIL.Image.open', 'Image.open', (['im_path'], {}), '(im_path)\n', (112, 121), False, 'from PIL import Image\n'), ((775, 811), 'os.path.isdir', 'os.path.isdir', (['args.dataset_pic_path'], {}), '(args.dataset_pic_path)\n', (788, 811), False, 'import os\n'), ((528, 577), 'numpy.ones', 'np.ones', (['[new_h, ...
from typing import Optional import numpy as np import optuna from optuna._experimental import experimental from optuna.pruners import BasePruner from optuna.study._study_direction import StudyDirection @experimental("2.8.0") class PatientPruner(BasePruner): """Pruner which wraps another pruner with tolerance. ...
[ "numpy.nanmax", "optuna._experimental.experimental", "numpy.nanmin" ]
[((207, 228), 'optuna._experimental.experimental', 'experimental', (['"""2.8.0"""'], {}), "('2.8.0')\n", (219, 228), False, 'from optuna._experimental import experimental\n'), ((3712, 3744), 'numpy.nanmin', 'np.nanmin', (['scores_after_patience'], {}), '(scores_after_patience)\n', (3721, 3744), True, 'import numpy as n...
""" Authors: Original FORTRAN77 version of i4_sobol by <NAME>. MATLAB version by <NAME>. PYTHON version by <NAME> Original Python version of is_prime by <NAME> Original MATLAB versions of other functions by <NAME>. PYTHON versions by <NAME> Modified Python version by <NAME> Origina...
[ "numpy.full", "numpy.binary_repr", "sklearn.utils.check_random_state", "numpy.floor", "numpy.transpose", "numpy.zeros", "warnings.warn" ]
[((13490, 13507), 'numpy.binary_repr', 'np.binary_repr', (['n'], {}), '(n)\n', (13504, 13507), True, 'import numpy as np\n'), ((13835, 13852), 'numpy.binary_repr', 'np.binary_repr', (['n'], {}), '(n)\n', (13849, 13852), True, 'import numpy as np\n'), ((14760, 14792), 'sklearn.utils.check_random_state', 'check_random_st...
import os import numpy as np import random both_m=[0,7,8,17,19,20] data_txt_path = "/public/zhangjie/3D/ZJ/simple/datasets/modelnet_trigger/test" data_txt_path2 = "/public/zhangjie/3D/ZJ/simple/datasets/shapenet_trigger/trigger_m" if not os.path.exists(data_txt_path2): os.makedirs(data_txt_path2) data = os.list...
[ "numpy.load", "numpy.save", "os.makedirs", "random.randint", "os.path.exists", "os.listdir" ]
[((313, 338), 'os.listdir', 'os.listdir', (['data_txt_path'], {}), '(data_txt_path)\n', (323, 338), False, 'import os\n'), ((242, 272), 'os.path.exists', 'os.path.exists', (['data_txt_path2'], {}), '(data_txt_path2)\n', (256, 272), False, 'import os\n'), ((278, 305), 'os.makedirs', 'os.makedirs', (['data_txt_path2'], {...
#imports import numpy as np #global variables operations_stack = [] clear_grad_stack = [] #functions def prep_data(in_data): if isinstance(in_data, list): out_data = np.array(in_data) return out_data elif isinstance(in_data, np.ndarray): out_data = in_data return ...
[ "numpy.flip", "numpy.sum", "numpy.square", "numpy.zeros", "numpy.ones", "numpy.where", "numpy.array", "numpy.exp", "numpy.matmul" ]
[((986, 1012), 'numpy.zeros', 'np.zeros', (['(y_rows, y_cols)'], {}), '((y_rows, y_cols))\n', (994, 1012), True, 'import numpy as np\n'), ((1532, 1564), 'numpy.zeros', 'np.zeros', (['(yext_rows, yext_cols)'], {}), '((yext_rows, yext_cols))\n', (1540, 1564), True, 'import numpy as np\n'), ((190, 207), 'numpy.array', 'np...
import numpy as _lib_ class Link: def __init__(self, prev_node, next_node, type): self.prev_node = prev_node self.next_node = next_node self.type = type if (self.type == "FULLY_CONNECTED"): self.weights = _lib_.random.randn(self....
[ "numpy.zeros", "numpy.sum", "numpy.matmul", "numpy.random.randn" ]
[((296, 374), 'numpy.random.randn', '_lib_.random.randn', (['self.prev_node.neuron_number', 'self.next_node.neuron_number'], {}), '(self.prev_node.neuron_number, self.next_node.neuron_number)\n', (314, 374), True, 'import numpy as _lib_\n'), ((417, 490), 'numpy.zeros', '_lib_.zeros', (['(self.prev_node.neuron_number, s...
#! /usr/bin/env python # Copyright 2018 <NAME>, <NAME> (<EMAIL>, <EMAIL>) # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this list of conditi...
[ "smarc_msgs.msg.ThrusterRPM", "rospy.Subscriber", "numpy.abs", "std_msgs.msg.Header", "math.atan2", "rospy.ServiceProxy", "rospy.Time", "numpy.linalg.norm", "rospy.get_name", "rospy.loginfo_throttle_identical", "rospy.Duration", "rospy.logwarn", "geometry_msgs.msg.PoseStamped", "rospy.Rate...
[((3077, 3105), 'smarc_msgs.msg.GotoWaypointActionFeedback', 'GotoWaypointActionFeedback', ([], {}), '()\n', (3103, 3105), False, 'from smarc_msgs.msg import GotoWaypointActionFeedback, GotoWaypointResult, GotoWaypointAction, GotoWaypointGoal\n'), ((3120, 3140), 'smarc_msgs.msg.GotoWaypointResult', 'GotoWaypointResult'...
""" Code for 2D rendering, using pygame (without OpenGL) """ import numpy as np from os import environ import logging from rlberry.rendering import Scene logger = logging.getLogger(__name__) environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1' _IMPORT_SUCESSFUL = True try: import pygame as pg except Exception: _IMP...
[ "pygame.quit", "numpy.moveaxis", "pygame.display.set_caption", "pygame.event.get", "pygame.display.set_mode", "pygame.image.fromstring", "pygame.init", "pygame.display.flip", "pygame.time.wait", "pygame.image.tostring", "pygame.surfarray.array3d", "pygame.draw.polygon", "rlberry.rendering.Sc...
[((165, 192), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (182, 192), False, 'import logging\n'), ((854, 861), 'rlberry.rendering.Scene', 'Scene', ([], {}), '()\n', (859, 861), False, 'from rlberry.rendering import Scene\n'), ((3373, 3418), 'pygame.draw.polygon', 'pg.draw.polygon', (['...
""" test_inference_gs.py Author: <NAME> Affiliation: McGill Created on: Wed 25 Mar 2020 09:41:20 EDT Description: """ import os import ares import glob import numpy as np import matplotlib.pyplot as pl def test(): # These go to every calculation zblobs = np.arange(6, 31) base_pars = \ {...
[ "os.remove", "ares.analysis.ModelSet", "ares.inference.ModelFit", "os.environ.get", "distpy.DistributionSet", "numpy.product", "numpy.diff", "numpy.arange", "numpy.exp", "numpy.nanmean", "distpy.UniformDistribution", "ares.inference.FitGlobal21cm" ]
[((275, 291), 'numpy.arange', 'np.arange', (['(6)', '(31)'], {}), '(6, 31)\n', (284, 291), True, 'import numpy as np\n'), ((578, 608), 'ares.inference.FitGlobal21cm', 'ares.inference.FitGlobal21cm', ([], {}), '()\n', (606, 608), False, 'import ares\n'), ((705, 723), 'numpy.arange', 'np.arange', (['(40)', '(200)'], {}),...
from skimage.transform import ProjectiveTransform from scipy.ndimage import map_coordinates import numpy as np import pandas as pd import argparse def _stackcopy(a, b): if a.ndim == 3: a[:] = b[:, :, np.newaxis] else: a[:] = b def warp_img_coords_batch(coord_map, shape, dtype=np.float64, bat...
[ "pandas.DataFrame", "argparse.ArgumentParser", "pandas.read_csv", "numpy.empty", "skimage.transform.ProjectiveTransform", "numpy.max", "numpy.where", "numpy.array", "numpy.arange", "numpy.linalg.inv", "numpy.indices", "scipy.ndimage.map_coordinates" ]
[((493, 528), 'numpy.empty', 'np.empty', (['coords_shape'], {'dtype': 'dtype'}), '(coords_shape, dtype=dtype)\n', (501, 528), True, 'import numpy as np\n'), ((1413, 1455), 'pandas.read_csv', 'pd.read_csv', (['fn_roi_coords'], {'delimiter': '"""\t"""'}), "(fn_roi_coords, delimiter='\\t')\n", (1424, 1455), True, 'import ...
#!/usr/bin/env python # coding: utf-8 import os import argparse import numpy as np import torch from sklearn import metrics from utils import load_dataset, build_word_dict, build_char_dict, Timer, AverageMeter from model import TMmodel from data import MatchDataset,batchify def init_from_scratch(args, train_exs): ...
[ "utils.build_char_dict", "utils.build_word_dict", "argparse.ArgumentParser", "torch.utils.data.DataLoader", "utils.AverageMeter", "data.MatchDataset", "utils.Timer", "torch.utils.data.sampler.SequentialSampler", "sklearn.metrics.f1_score", "model.TMmodel", "numpy.array", "torch.utils.data.samp...
[((403, 435), 'utils.build_word_dict', 'build_word_dict', (['args', 'train_exs'], {}), '(args, train_exs)\n', (418, 435), False, 'from utils import load_dataset, build_word_dict, build_char_dict, Timer, AverageMeter\n'), ((490, 522), 'utils.build_char_dict', 'build_char_dict', (['args', 'train_exs'], {}), '(args, train...
import cv2 import numpy as np import tensorflow as tf class Network: def __init__(self, name, imgs, batch_size, is_training=True, reuse=None, layers=16, deep=2): self.imgs = imgs self.batch_size = batch_size self.is_training = is_training self.reuse = reuse self.conv_counte...
[ "tensorflow.reset_default_graph", "tensorflow.layers.max_pooling2d", "tensorflow.layers.batch_normalization", "tensorflow.nn.softmax", "tensorflow.nn.relu", "tensorflow.pad", "tensorflow.variable_scope", "tensorflow.concat", "tensorflow.placeholder", "tensorflow.cast", "cv2.resize", "tensorflo...
[((2961, 3039), 'tensorflow.layers.conv2d', 'tf.layers.conv2d', (['x', 'filters', '[3, 3]'], {'padding': '"""SAME"""', 'dilation_rate': 'dilatation'}), "(x, filters, [3, 3], padding='SAME', dilation_rate=dilatation)\n", (2977, 3039), True, 'import tensorflow as tf\n'), ((3061, 3171), 'tensorflow.layers.batch_normalizat...
import cv2 import numpy as np from plantcv.plantcv import analyze_object, outputs def test_analyze_object(test_data): """Test for PlantCV.""" # Clear previous outputs outputs.clear() # Read in test data img = cv2.imread(test_data.small_rgb_img) mask = cv2.imread(test_data.small_bin_img, -1) ...
[ "numpy.zeros", "cv2.imread", "numpy.array", "plantcv.plantcv.analyze_object", "plantcv.plantcv.outputs.clear" ]
[((181, 196), 'plantcv.plantcv.outputs.clear', 'outputs.clear', ([], {}), '()\n', (194, 196), False, 'from plantcv.plantcv import analyze_object, outputs\n'), ((231, 266), 'cv2.imread', 'cv2.imread', (['test_data.small_rgb_img'], {}), '(test_data.small_rgb_img)\n', (241, 266), False, 'import cv2\n'), ((278, 317), 'cv2....
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class ThresholdedMSELoss(nn.Module): """ This class contains a loss function that use a mean-squared-error loss for reasonable predictions and an exponential penalty for unreasonable predictions. They inherit from torch....
[ "torch.neg", "numpy.float", "torch.pow", "torch.no_grad", "torch.abs", "torch.div", "torch.tensor" ]
[((2571, 2586), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2584, 2586), False, 'import torch\n'), ((3204, 3231), 'torch.tensor', 'torch.tensor', (['accuracy_list'], {}), '(accuracy_list)\n', (3216, 3231), False, 'import torch\n'), ((3615, 3630), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3628, 3630)...
# 0422.py import cv2 import numpy as np import time dst = np.full((512, 512, 3), (255, 255, 255), dtype = np.uint8) nPoints = 100 pts = np.zeros((1, nPoints, 2), dtype = np.uint16) cv2.setRNGSeed(int(time.time())) cv2.randn(pts, mean = (256, 256), stddev = (50, 50)) # draw points for k in range(nPoints)...
[ "numpy.full", "cv2.circle", "cv2.waitKey", "cv2.destroyAllWindows", "numpy.zeros", "time.time", "cv2.randn", "cv2.imshow" ]
[((64, 119), 'numpy.full', 'np.full', (['(512, 512, 3)', '(255, 255, 255)'], {'dtype': 'np.uint8'}), '((512, 512, 3), (255, 255, 255), dtype=np.uint8)\n', (71, 119), True, 'import numpy as np\n'), ((144, 186), 'numpy.zeros', 'np.zeros', (['(1, nPoints, 2)'], {'dtype': 'np.uint16'}), '((1, nPoints, 2), dtype=np.uint16)\...
"""Train stage 2: Train PMoE and its derivatives to predict actions""" import sys try: sys.path.append("../") except: raise RuntimeError("Can't append root directory of the project the path") import gc from pathlib import Path from datetime import datetime from typing import Union import comet_ml import num...
[ "numpy.random.seed", "gc.collect", "numpy.mean", "torch.autograd.set_detect_anomaly", "torch.no_grad", "utils.io.load_checkpoint", "sys.path.append", "utils.utility.get_conf", "torch.utils.data.DataLoader", "utils.io.save_checkpoint", "torch.optim.lr_scheduler.CosineAnnealingLR", "model.moe.ge...
[((93, 115), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (108, 115), False, 'import sys\n'), ((9671, 9686), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (9684, 9686), False, 'import torch\n'), ((985, 1002), 'utils.utility.get_conf', 'get_conf', (['cfg_dir'], {}), '(cfg_dir)\n', (993, ...
import pytest import os import numpy as np import simpleder import warnings warnings.filterwarnings('ignore') import configparser config = configparser.ConfigParser(allow_no_value=True) config.read("config.ini") from void import voicetools from void.utils import rttm2simple toolbox = voicetools.ToolBox() num_embedd...
[ "os.remove", "void.utils.rttm2simple", "numpy.random.randn", "warnings.filterwarnings", "simpleder.DER", "pytest.raises", "void.voicetools.ToolBox", "configparser.ConfigParser" ]
[((77, 110), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (100, 110), False, 'import warnings\n'), ((141, 187), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {'allow_no_value': '(True)'}), '(allow_no_value=True)\n', (166, 187), False, 'import configparse...
import torch import numpy as np import multiprocessing as mp from tqdm import tqdm from yolox.ops import multiclass_obb_nms from functools import partial from tqdm.contrib.concurrent import process_map # def function(m, prog=None, lock=None): # b, s = m # lock.acquire() # prog.value += 1 # print(prog....
[ "yolox.ops.multiclass_obb_nms", "numpy.array" ]
[((442, 479), 'yolox.ops.multiclass_obb_nms', 'multiclass_obb_nms', (['b', 's'], {'iou_thr': '(0.1)'}), '(b, s, iou_thr=0.1)\n', (460, 479), False, 'from yolox.ops import multiclass_obb_nms\n'), ((523, 667), 'numpy.array', 'np.array', (['[[6.0, 3.0, 8.0, 7.0, 0.0], [3.0, 6.0, 9.0, 11.0, 0.0], [3.0, 7.0, 10.0, \n 12....
import math import time from threading import Thread from aperturedb import ProgressBar import numpy as np class ParallelLoader: """ Parallel and Batch Loader for ApertureDB """ def __init__(self, db, dry_run=False): self.db = db self.dry_run = dry_run self.type = "ele...
[ "threading.Thread", "aperturedb.ProgressBar.ProgressBar", "math.ceil", "numpy.std", "time.time", "numpy.mean", "numpy.array" ]
[((2286, 2297), 'time.time', 'time.time', ([], {}), '()\n', (2295, 2297), False, 'import time\n'), ((3142, 3166), 'numpy.array', 'np.array', (['self.times_arr'], {}), '(self.times_arr)\n', (3150, 3166), True, 'import numpy as np\n'), ((1187, 1232), 'aperturedb.ProgressBar.ProgressBar', 'ProgressBar.ProgressBar', (['sel...
import numpy as np from tqdm import tqdm from baselines.common.runners import AbstractEnvRunner import cv2 class Runner(AbstractEnvRunner): """ We use this object to make a mini batch of experiences __init__: - Initialize the runner run(): - Make a mini batch """ def __init__(self, *, ...
[ "gc.collect", "numpy.asarray", "numpy.zeros_like", "numpy.array" ]
[((795, 807), 'gc.collect', 'gc.collect', ([], {}), '()\n', (805, 807), False, 'import gc\n'), ((5513, 5549), 'numpy.asarray', 'np.asarray', (['mb_obs'], {'dtype': 'np.float32'}), '(mb_obs, dtype=np.float32)\n', (5523, 5549), True, 'import numpy as np\n'), ((5571, 5611), 'numpy.asarray', 'np.asarray', (['mb_rewards'], ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 1 19:02:42 2019 @author: zoescrewvala """ import os import cartopy import matplotlib.pyplot as plt from matplotlib.lines import Line2D import numpy as np import pandas as pd import xarray as xr #%% X-Y PLOT #ds = Dataset(os.getcwd() + '/Output/si...
[ "numpy.average", "os.makedirs", "numpy.sum", "numpy.std", "os.getcwd", "os.path.exists", "matplotlib.pyplot.subplots", "matplotlib.pyplot.MultipleLocator" ]
[((892, 1003), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(2)'], {'squeeze': '(False)', 'sharex': '(False)', 'sharey': '(False)', 'gridspec_kw': "{'wspace': 0.2, 'hspace': 0.05}"}), "(1, 2, squeeze=False, sharex=False, sharey=False, gridspec_kw={\n 'wspace': 0.2, 'hspace': 0.05})\n", (904, 1003), True, ...