code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
"sklearn.datasets.load_iris",
"sklearn.model_selection.train_test_split",
"sklearn.decomposition.PCA",
"numpy.append",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.scatter",
"qiskit.aqua.MissingOptionalLibraryError",
"matplotlib.pyplot.title",
"sklearn.preprocessing.MinMaxScaler",
"m... | [((908, 943), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (926, 943), False, 'from sklearn import datasets\n'), ((1011, 1071), 'sklearn.model_selection.train_test_split', 'train_test_split', (['data', 'target'], {'test_size': '(1)', 'random_state': '(42)'})... |
import os
import sys
import random
import datetime
import gym
from gym import spaces
import numpy as np
from env.IDM import IDM
from env.Road import Road
from env.Vehicle import Vehicle
import math
# add sumo/tools into python environment
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], ... | [
"math.sqrt",
"env.IDM.IDM",
"traci.vehicle.getSpeedFactor",
"sys.exit",
"env.Vehicle.Vehicle",
"math.exp",
"sys.path.append",
"traci.simulation.getDeltaT",
"numpy.empty",
"traci.vehicle.setSpeed",
"traci.vehicle.getLaneID",
"env.Road.Road",
"traci.vehicle.setSpeedMode",
"gym.spaces.Discret... | [((282, 328), 'os.path.join', 'os.path.join', (["os.environ['SUMO_HOME']", '"""tools"""'], {}), "(os.environ['SUMO_HOME'], 'tools')\n", (294, 328), False, 'import os\n'), ((333, 355), 'sys.path.append', 'sys.path.append', (['tools'], {}), '(tools)\n', (348, 355), False, 'import sys\n'), ((387, 446), 'sys.exit', 'sys.ex... |
#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
import curses
import sys
from collections import deque
from datetime import datetime
import numpy as np
import rospy
from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus
from geometry_msgs.msg import PoseStamped
from ... | [
"rospy.init_node",
"mavros_msgs.msg.State",
"curses.curs_set",
"rospy.Rate",
"curses.nocbreak",
"numpy.mean",
"collections.deque",
"scipy.spatial.transform.Rotation.from_euler",
"sensor_msgs.msg.NavSatFix",
"curses.init_pair",
"rospy.Subscriber",
"numpy.rad2deg",
"curses.color_pair",
"curs... | [((831, 855), 'curses.color_pair', 'curses.color_pair', (['color'], {}), '(color)\n', (848, 855), False, 'import curses\n'), ((1120, 1139), 'numpy.isnan', 'np.isnan', (['frequency'], {}), '(frequency)\n', (1128, 1139), True, 'import numpy as np\n'), ((1094, 1112), 'numpy.mean', 'np.mean', (['durations'], {}), '(duratio... |
try:
import importlib.resources as pkg_resources
except ImportError:
# Try backported to PY<37 `importlib_resources`.
import importlib_resources as pkg_resources
from . import images
from gym import Env, spaces
from time import time
import numpy as np
from copy import copy
import colorsys
import pygame
f... | [
"numpy.prod",
"pygame.init",
"pygame.quit",
"colorsys.hsv_to_rgb",
"numpy.array",
"copy.copy",
"importlib_resources.path",
"pygame.display.set_mode",
"pygame.display.flip",
"numpy.ndenumerate",
"pygame.draw.rect",
"numpy.ones",
"gym.spaces.MultiDiscrete",
"numpy.indices",
"numpy.any",
... | [((567, 586), 'numpy.prod', 'np.prod', (['grid_shape'], {}), '(grid_shape)\n', (574, 586), True, 'import numpy as np\n'), ((1274, 1312), 'gym.spaces.MultiDiscrete', 'spaces.MultiDiscrete', (['nvec_observation'], {}), '(nvec_observation)\n', (1294, 1312), False, 'from gym import Env, spaces\n'), ((1336, 1368), 'numpy.ar... |
import numpy as np
import cv2
import os
import json
import glob
from PIL import Image, ImageDraw
plate_diameter = 25 #cm
plate_depth = 1.5 #cm
plate_thickness = 0.2 #cm
def Max(x, y):
if (x >= y):
return x
else:
return y
def polygons_to_mask(img_shape, polygons):
mask = np.zeros(img_shape... | [
"PIL.Image.fromarray",
"cv2.pointPolygonTest",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.argwhere",
"PIL.ImageDraw.Draw",
"numpy.min",
"json.load",
"cv2.imread"
] | [((2774, 2798), 'cv2.imread', 'cv2.imread', (['"""out.png"""', '(0)'], {}), "('out.png', 0)\n", (2784, 2798), False, 'import cv2\n'), ((302, 337), 'numpy.zeros', 'np.zeros', (['img_shape'], {'dtype': 'np.uint8'}), '(img_shape, dtype=np.uint8)\n', (310, 337), True, 'import numpy as np\n'), ((349, 370), 'PIL.Image.fromar... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cntk as C
import numpy as np
from .common import floatx, epsilon, image_dim_ordering, image_data_format
from collections import defaultdict
from contextlib import contextmanager
import warnings
C.set_g... | [
"cntk.cntk_py.Value",
"cntk.constant",
"cntk.element_select",
"numpy.random.binomial",
"cntk.assign",
"cntk.swapaxes",
"cntk.relu",
"cntk.pooling",
"cntk.initializer.normal",
"cntk.log",
"numpy.random.seed",
"warnings.warn",
"cntk.less_equal",
"cntk.sin",
"cntk.one_hot",
"cntk.sequence... | [((313, 349), 'cntk.set_global_option', 'C.set_global_option', (['"""align_axis"""', '(1)'], {}), "('align_axis', 1)\n", (332, 349), True, 'import cntk as C\n'), ((371, 400), 'cntk.device.use_default_device', 'C.device.use_default_device', ([], {}), '()\n', (398, 400), True, 'import cntk as C\n'), ((854, 933), 'cntk.co... |
import torch
import torch.nn as nn
import numpy as np
import math
class ForwardKinematics:
def __init__(self, args, edges):
self.topology = [-1] * (len(edges) + 1)
self.rotation_map = []
for i, edge in enumerate(edges):
self.topology[edge[1]] = edge[0]
self.rotation... | [
"torch.optim.Adam",
"torch.sin",
"torch.nn.MSELoss",
"torch.norm",
"torch.cos",
"numpy.array",
"torch.tensor",
"torch.matmul",
"torch.empty",
"torch.zeros"
] | [((2281, 2344), 'torch.empty', 'torch.empty', (['(rotation.shape[:-1] + (3,))'], {'device': 'position.device'}), '(rotation.shape[:-1] + (3,), device=position.device)\n', (2292, 2344), False, 'import torch\n'), ((2363, 2405), 'torch.norm', 'torch.norm', (['rotation'], {'dim': '(-1)', 'keepdim': '(True)'}), '(rotation, ... |
import time
import h5py
import hdbscan
import numpy as np
import torch
from sklearn.cluster import MeanShift
from pytorch3dunet.datasets.hdf5 import SliceBuilder
from pytorch3dunet.unet3d.utils import get_logger
from pytorch3dunet.unet3d.utils import unpad
logger = get_logger('UNet3DPredictor')
class _AbstractPred... | [
"numpy.bitwise_or",
"numpy.unique",
"sklearn.cluster.MeanShift",
"pytorch3dunet.unet3d.utils.unpad",
"pytorch3dunet.datasets.hdf5.SliceBuilder._build_slices",
"numpy.argmax",
"h5py.File",
"pytorch3dunet.unet3d.utils.get_logger",
"numpy.max",
"numpy.zeros",
"numpy.bitwise_and",
"numpy.expand_di... | [((269, 298), 'pytorch3dunet.unet3d.utils.get_logger', 'get_logger', (['"""UNet3DPredictor"""'], {}), "('UNet3DPredictor')\n", (279, 298), False, 'from pytorch3dunet.unet3d.utils import get_logger\n'), ((3293, 3325), 'h5py.File', 'h5py.File', (['self.output_file', '"""w"""'], {}), "(self.output_file, 'w')\n", (3302, 33... |
"""
Random Variables.
This module implements random variables. Random variables are the main in- and outputs
of probabilistic numerical methods.
"""
from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union
import numpy as np
from probnum import utils as _utils
from probnum.type import (
... | [
"numpy.prod",
"probnum.utils.as_shape",
"numpy.sqrt",
"numpy.isscalar",
"numpy.promote_types",
"probnum.utils.as_random_state",
"numpy.asarray",
"probnum.utils.as_numpy_scalar",
"numpy.diag",
"numpy.issubdtype",
"numpy.empty",
"probnum.utils.derive_random_seed",
"numpy.dtype",
"typing.Type... | [((658, 678), 'typing.TypeVar', 'TypeVar', (['"""ValueType"""'], {}), "('ValueType')\n", (665, 678), False, 'from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union\n'), ((4355, 4377), 'probnum.utils.as_shape', '_utils.as_shape', (['shape'], {}), '(shape)\n', (4370, 4377), True, 'from probnum i... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 28 12:10:11 2019
@author: Omer
"""
## File handler
## This file was initially intended purely to generate the matrices for the near earth code found in: https://public.ccsds.org/Pubs/131x1o2e2s.pdf
## The values from the above pdf were copied manually to a txt file, and ... | [
"numpy.eye",
"sys.path.insert",
"numpy.hstack",
"pathlib.Path",
"os.environ.get",
"os.path.join",
"numpy.array",
"numpy.zeros",
"scipy.linalg.circulant",
"numpy.vstack",
"os.walk"
] | [((694, 716), 'os.environ.get', 'os.environ.get', (['"""LDPC"""'], {}), "('LDPC')\n", (708, 716), False, 'import os\n'), ((907, 937), 'sys.path.insert', 'sys.path.insert', (['(1)', 'projectDir'], {}), '(1, projectDir)\n', (922, 937), False, 'import sys\n'), ((1038, 1097), 'numpy.array', 'np.array', (['[8, 4, 2, 1]'], {... |
# -*- coding: utf-8 -*-
"""
Showcases *ICTCP* *colour encoding* computations.
"""
import numpy as np
import colour
from colour.utilities import message_box
message_box('"ICTCP" Colour Encoding Computations')
RGB = np.array([0.45620519, 0.03081071, 0.04091952])
message_box(('Converting from "ITU-R BT.2020" colourspa... | [
"colour.ICTCP_to_RGB",
"colour.utilities.message_box",
"numpy.array",
"colour.RGB_to_ICTCP"
] | [((159, 210), 'colour.utilities.message_box', 'message_box', (['""""ICTCP" Colour Encoding Computations"""'], {}), '(\'"ICTCP" Colour Encoding Computations\')\n', (170, 210), False, 'from colour.utilities import message_box\n'), ((218, 264), 'numpy.array', 'np.array', (['[0.45620519, 0.03081071, 0.04091952]'], {}), '([... |
"""
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | [
"numpy.zeros"
] | [((5319, 5337), 'numpy.zeros', 'np.zeros', (['(28, 28)'], {}), '((28, 28))\n', (5327, 5337), True, 'import numpy as np\n')] |
import numpy as np
import sys
import os
from PIL import Image
from visu.helper_functions import save_image
from scipy.spatial.transform import Rotation as R
from helper import re_quat
import copy
import torch
import numpy as np
import k3d
class Visualizer():
def __init__(self, p_visu, writer=None):
if p_v... | [
"k3d.plot",
"PIL.Image.fromarray",
"os.path.exists",
"PIL.Image.open",
"numpy.ones",
"numpy.add",
"os.makedirs",
"scipy.spatial.transform.Rotation.from_quat",
"numpy.array",
"numpy.dot",
"copy.deepcopy",
"os.system"
] | [((4150, 4173), 'k3d.plot', 'k3d.plot', ([], {'name': '"""points"""'}), "(name='points')\n", (4158, 4173), False, 'import k3d\n'), ((4842, 4865), 'k3d.plot', 'k3d.plot', ([], {'name': '"""points"""'}), "(name='points')\n", (4850, 4865), False, 'import k3d\n'), ((1091, 1109), 'copy.deepcopy', 'copy.deepcopy', (['img'], ... |
import os
from PIL import Image
import cv2
from os import listdir
from os.path import join
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.colors import LogNorm
from io_utils.io_common import create_folder
from viz_utils.constants import PlotMode, BackgroundType
import pylab
import numpy as np
import... | [
"io_utils.io_common.create_folder",
"cv2.destroyAllWindows",
"numpy.rot90",
"numpy.flip",
"os.listdir",
"numpy.asarray",
"matplotlib.pyplot.close",
"cv2.VideoWriter_fourcc",
"numpy.amin",
"cartopy.crs.PlateCarree",
"numpy.isnan",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"PIL.Im... | [((3165, 3183), 'cartopy.crs.PlateCarree', 'ccrs.PlateCarree', ([], {}), '()\n', (3181, 3183), True, 'import cartopy.crs as ccrs\n'), ((12073, 12171), 'cartopy.feature.NaturalEarthFeature', 'cfeature.NaturalEarthFeature', ([], {'category': '"""cultural"""', 'name': '"""roads"""', 'scale': '"""10m"""', 'facecolor': '"""... |
from os import listdir
from os.path import isfile, join
from path import Path
import numpy as np
import cv2
# Dataset path
target_path = Path('target/')
annotation_images_path = Path('dataset/ade20k/annotations/training/').abspath()
dataset = [ f for f in listdir(annotation_images_path) if isfile(join(annotation_image... | [
"os.listdir",
"numpy.where",
"numpy.asarray",
"os.path.join",
"path.Path"
] | [((138, 153), 'path.Path', 'Path', (['"""target/"""'], {}), "('target/')\n", (142, 153), False, 'from path import Path\n'), ((577, 613), 'numpy.asarray', 'np.asarray', (['images[n]'], {'dtype': 'np.int8'}), '(images[n], dtype=np.int8)\n', (587, 613), True, 'import numpy as np\n'), ((734, 769), 'numpy.where', 'np.where'... |
import os
import numpy as np
import cv2
import albumentations
from PIL import Image
from torch.utils.data import Dataset
from taming.data.sflckr import SegmentationBase # for examples included in repo
class Examples(SegmentationBase):
def __init__(self, size=256, random_crop=False, interpolation="bicubic"):
... | [
"numpy.eye",
"PIL.Image.open",
"os.path.join",
"albumentations.RandomCrop",
"numpy.array",
"albumentations.CenterCrop",
"albumentations.SmallestMaxSize"
] | [((3811, 3844), 'PIL.Image.open', 'Image.open', (["example['file_path_']"], {}), "(example['file_path_'])\n", (3821, 3844), False, 'from PIL import Image\n'), ((4090, 4131), 'PIL.Image.open', 'Image.open', (["example['segmentation_path_']"], {}), "(example['segmentation_path_'])\n", (4100, 4131), False, 'from PIL impor... |
# -*- coding: utf-8 -*-
import argparse
import os
import shutil
import time
import numpy as np
import random
from collections import OrderedDict
import torch
import torch.backends.cudnn as cudnn
from callbacks import AverageMeter
from data_utils.causal_data_loader_frames import VideoFolder
from utils impo... | [
"torch.nn.CrossEntropyLoss",
"utils.save_results",
"numpy.array",
"model.model_lib.BboxInteractionLatentModel",
"argparse.ArgumentParser",
"model.model_lib.BboxVisualModel",
"numpy.linspace",
"numpy.concatenate",
"model.model_lib.ConcatFusionModel",
"callbacks.AverageMeter",
"os.path.isfile",
... | [((371, 428), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Counterfactual CAR"""'}), "(description='Counterfactual CAR')\n", (394, 428), False, 'import argparse\n'), ((6328, 6342), 'model.model_lib.BboxVisualModel', 'RGBModel', (['args'], {}), '(args)\n', (6336, 6342), True, 'from mode... |
import os
import sys
import click
import pickle
import sncosmo
import numpy as np
from astropy.table import Table
DATA_PATH = '/home/samdixon/jla_light_curves/'
def modify_error(lc, error_floor=0.):
"""Add an error floor of `error_floor` times the maximum flux of the band
to each observation
"""
... | [
"numpy.mean",
"sncosmo.fit_lc",
"numpy.sqrt",
"os.listdir",
"astropy.table.Table",
"os.makedirs",
"os.path.join",
"numpy.max",
"os.path.isdir",
"sncosmo.select_data",
"sncosmo.CCM89Dust",
"sys.stdout.flush",
"sncosmo.photdata.photometric_data"
] | [((841, 868), 'astropy.table.Table', 'Table', (['new_lc'], {'meta': 'lc.meta'}), '(new_lc, meta=lc.meta)\n', (846, 868), False, 'from astropy.table import Table\n'), ((693, 720), 'numpy.max', 'np.max', (['data.flux[band_cut]'], {}), '(data.flux[band_cut])\n', (699, 720), True, 'import numpy as np\n'), ((759, 835), 'num... |
""" Unit tests for the system interface."""
import unittest
from six import assertRaisesRegex
from six.moves import cStringIO
import numpy as np
from openmdao.api import Problem, Group, IndepVarComp, ExecComp
from openmdao.test_suite.components.options_feature_vector import VectorDoublingComp
from openmdao.utils.ass... | [
"openmdao.utils.assert_utils.assert_rel_error",
"openmdao.api.ExecComp",
"numpy.ones",
"openmdao.utils.assert_utils.assert_warning",
"openmdao.test_suite.scripts.circuit_analysis.Circuit",
"openmdao.api.IndepVarComp",
"openmdao.api.Group",
"numpy.zeros",
"six.assertRaisesRegex",
"unittest.main",
... | [((10995, 11010), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11008, 11010), False, 'import unittest\n'), ((467, 474), 'openmdao.api.Group', 'Group', ([], {}), '()\n', (472, 474), False, 'from openmdao.api import Problem, Group, IndepVarComp, ExecComp\n'), ((698, 705), 'openmdao.api.Group', 'Group', ([], {}), ... |
# -*- coding: utf-8 -*-
"""
Script to execute example covarying MMGP regression forecasting model
with full Krhh.
Inputs: Data training and test sets (dictionary pickle)
Data for example:
- normalised solar data for 25 sites for 15 minute forecast
- N_train = 4200, N_test = 2276, P = 25, D = 51
- Xtr[:, :5... | [
"mmgp.ExplicitSCMMGP",
"mmgp.losses.MeanAbsError",
"numpy.mean",
"mmgp.kernels.PeriodicSliceFixed",
"mmgp.util.util.get_flags",
"numpy.concatenate",
"tensorflow.train.AdamOptimizer",
"mmgp.kernels.RadialBasisSlice",
"csv.writer",
"pickle.load",
"numpy.savetxt",
"mmgp.kernels.CompactSlice",
"... | [((2670, 2691), 'mmgp.util.util.get_flags', 'util.util.get_flags', ([], {}), '()\n', (2689, 2691), False, 'from mmgp import util\n'), ((6258, 6331), 'mmgp.likelihoods.CovaryingRegressionNetwork', 'likelihoods.CovaryingRegressionNetwork', (['output_dim', 'node_dim'], {'std_dev': '(0.2)'}), '(output_dim, node_dim, std_de... |
#!/usr/bin/env python3
import sys
import os
import logging
import numpy as np
import pandas as pd
import dateutil
def tempF2C(x): return (x-32.0)*5.0/9.0
def tempC2F(x): return (x*9.0/5.0)+32.0
def load_temperature_hdf5(temps_fn, local_time_offset, basedir=None, start_year=None, truncate_to_full_day=False):
## ... | [
"pandas.Series",
"pandas.isnull",
"pandas.read_csv",
"numpy.arange",
"numpy.searchsorted",
"pandas.Timedelta",
"os.path.join",
"numpy.arcsin",
"dateutil.tz.tzoffset",
"pandas.read_hdf",
"numpy.isnan",
"numpy.cos",
"pandas.concat",
"pandas.to_datetime"
] | [((562, 592), 'pandas.read_hdf', 'pd.read_hdf', (['temps_fn', '"""table"""'], {}), "(temps_fn, 'table')\n", (573, 592), True, 'import pandas as pd\n'), ((688, 732), 'dateutil.tz.tzoffset', 'dateutil.tz.tzoffset', (['local_time_offset', 'tmp'], {}), '(local_time_offset, tmp)\n', (708, 732), False, 'import dateutil\n'), ... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
NumPy Array Editor Dialog based on Qt
"""
# pylint: disable=C0103
# pylint: disable=R0903
# pylint: disable=R0911
# pylint: disable=R0201
# Stand... | [
"qtpy.QtWidgets.QComboBox",
"spyder.utils.qthelpers.add_actions",
"qtpy.QtWidgets.QGridLayout",
"spyder.py3compat.to_text_string",
"spyder.utils.qthelpers.keybinding",
"numpy.array",
"spyder.py3compat.to_binary_string",
"qtpy.QtWidgets.QDialog.accept",
"spyder.py3compat.is_binary_string",
"spyder.... | [((20131, 20137), 'qtpy.QtCore.Slot', 'Slot', ([], {}), '()\n', (20135, 20137), False, 'from qtpy.QtCore import QAbstractTableModel, QItemSelection, QLocale, QItemSelectionRange, QModelIndex, Qt, Slot\n'), ((30224, 30254), 'qtpy.QtCore.Slot', 'Slot', (['QModelIndex', 'QModelIndex'], {}), '(QModelIndex, QModelIndex)\n',... |
""" Defines the PolygonPlot class.
"""
from __future__ import with_statement
# Major library imports
import numpy as np
# Enthought library imports.
from enable.api import LineStyle, black_color_trait, \
transparent_color_trait
from kiva.agg import points_in_polygon
from traits.api ... | [
"traits.api.Enum",
"traits.api.on_trait_change",
"traits.api.Property",
"kiva.agg.points_in_polygon",
"base_xy_plot.BaseXYPlot.hittest",
"numpy.array",
"numpy.vstack",
"traits.api.Float"
] | [((1659, 1669), 'traits.api.Float', 'Float', (['(1.0)'], {}), '(1.0)\n', (1664, 1669), False, 'from traits.api import Enum, Float, Tuple, Property, cached_property, on_trait_change\n'), ((1923, 1952), 'traits.api.Enum', 'Enum', (['"""poly"""', '"""point"""', '"""line"""'], {}), "('poly', 'point', 'line')\n", (1927, 195... |
import os
import os.path as osp
import numpy as np
from joblib import Parallel, delayed
from tensorflow.keras.utils import get_file
from tqdm import tqdm
from spektral.data import Dataset, Graph
from spektral.utils import label_to_one_hot, sparse
from spektral.utils.io import load_csv, load_sdf
ATOM_TYPES = [1, 6, 7... | [
"spektral.utils.io.load_sdf",
"spektral.utils.label_to_one_hot",
"numpy.ones_like",
"spektral.utils.io.load_csv",
"tqdm.tqdm",
"os.path.join",
"joblib.Parallel",
"numpy.array",
"tensorflow.keras.utils.get_file",
"numpy.concatenate",
"joblib.delayed",
"spektral.data.Graph"
] | [((2701, 2749), 'spektral.utils.label_to_one_hot', 'label_to_one_hot', (["atom['atomic_num']", 'ATOM_TYPES'], {}), "(atom['atomic_num'], ATOM_TYPES)\n", (2717, 2749), False, 'from spektral.utils import label_to_one_hot, sparse\n'), ((2840, 2895), 'numpy.concatenate', 'np.concatenate', (['(atomic_num, coords, [charge, i... |
import numpy as np
board = np.zeros(shape=(9, 9))
count = 0
def solve():
global count
count += 1
if count % 1000 == 0:
print('\rCurrent number of computations made:', count, end='')
freePos = find()
if freePos is None:
return True
i = freePos[0]
j = freePos[1]
for w in... | [
"numpy.zeros"
] | [((28, 50), 'numpy.zeros', 'np.zeros', ([], {'shape': '(9, 9)'}), '(shape=(9, 9))\n', (36, 50), True, 'import numpy as np\n')] |
from multiprocessing import Pool
import EnvEq as ee
import numpy as np
import itertools as it
import os
#parsing input into numpy arrays
from input import *
y0=np.array([y0_Tpos,y0_Tpro,y0_Tneg,y0_o2,y0_test])
p=np.array([p_o2,p_test])
mu=np.array([[mu_o2Tpos,mu_o2Tpro,mu_o2Tneg],[mu_testTpos,mu_testTpro,0]])
lam=np.a... | [
"EnvEq.solve_eq",
"os.makedirs",
"numpy.append",
"numpy.array",
"numpy.empty",
"multiprocessing.Pool",
"numpy.arange"
] | [((161, 214), 'numpy.array', 'np.array', (['[y0_Tpos, y0_Tpro, y0_Tneg, y0_o2, y0_test]'], {}), '([y0_Tpos, y0_Tpro, y0_Tneg, y0_o2, y0_test])\n', (169, 214), True, 'import numpy as np\n'), ((213, 237), 'numpy.array', 'np.array', (['[p_o2, p_test]'], {}), '([p_o2, p_test])\n', (221, 237), True, 'import numpy as np\n'),... |
import numpy as np
import xml.etree.ElementTree as ET
class Geom(object):
def __init__(self, geom):
self.xml = geom
self.params = []
def get_params(self):
return self.params.copy()
def set_params(self, new_params):
self.params = new_params
def update_point(self, p, ne... | [
"xml.etree.ElementTree.parse",
"os.makedirs",
"os.path.join",
"numpy.sum",
"numpy.array",
"numpy.concatenate",
"gym.make"
] | [((9394, 9425), 'gym.make', 'gym.make', (['"""RoboschoolHopper-v1"""'], {}), "('RoboschoolHopper-v1')\n", (9402, 9425), False, 'import gym, roboschool\n'), ((9625, 9659), 'os.makedirs', 'os.makedirs', (['outdir'], {'exist_ok': '(True)'}), '(outdir, exist_ok=True)\n', (9636, 9659), False, 'import os\n'), ((1671, 1691), ... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
"tensorflow.python.eager.def_function.function",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.models.load_model",
"tensorflow.keras.experimental.export_saved_model",
"tensorflow.compat.as_bytes",
"tensorflow.python.ops.variables.Variable",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.gl... | [((1826, 1850), 'tensorflow.keras.layers.Input', 'keras.layers.Input', (['(3,)'], {}), '((3,))\n', (1844, 1850), False, 'from tensorflow import keras\n'), ((2177, 2236), 'tensorflow.keras.models.Model', 'keras.models.Model', ([], {'inputs': '[input_tensor]', 'outputs': '[output]'}), '(inputs=[input_tensor], outputs=[ou... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import sys
sys.path.append("../")
from quelea import *
nx = 217
ny = 133
x0 = 0
x1 = 30 # lambdas
y0 = 0
y1 = 20 # lambdas
xs = np.linspace(x0, x1, nx)
ys = np.linspace(y0, y1, ny)
# 2d array of (x, y, z, t)
coords = np.array( [ [x, y, 0, 0] for ... | [
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.clim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.colorbar",
"numpy.array",
"numpy.linspace",
"sys.path.append"
] | [((81, 103), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (96, 103), False, 'import sys\n'), ((201, 224), 'numpy.linspace', 'np.linspace', (['x0', 'x1', 'nx'], {}), '(x0, x1, nx)\n', (212, 224), True, 'import numpy as np\n'), ((230, 253), 'numpy.linspace', 'np.linspace', (['y0', 'y1', 'ny'], ... |
import h5py
import numpy as np
np.set_printoptions(threshold=np.nan)
from shutil import copyfile
copyfile("dummy_lutnet.h5", "pretrained_bin.h5") # create pretrained.h5 using datastructure from dummy.h5
bl = h5py.File("baseline_pruned.h5", 'r')
#dummy = h5py.File("dummy.h5", 'r')
pretrained = h5py.File("pretrained_b... | [
"numpy.tile",
"numpy.random.shuffle",
"numpy.reshape",
"numpy.ones",
"numpy.logical_and",
"numpy.logical_not",
"numpy.logical_or",
"h5py.File",
"numpy.argsort",
"numpy.array",
"shutil.copyfile",
"numpy.zeros",
"numpy.shape",
"numpy.arange",
"numpy.set_printoptions"
] | [((31, 68), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.nan'}), '(threshold=np.nan)\n', (50, 68), True, 'import numpy as np\n'), ((99, 147), 'shutil.copyfile', 'copyfile', (['"""dummy_lutnet.h5"""', '"""pretrained_bin.h5"""'], {}), "('dummy_lutnet.h5', 'pretrained_bin.h5')\n", (107, 147), Fa... |
import pandas as pd
import numpy as np
from src.si.util.util import label_gen
__all__ = ['Dataset']
class Dataset:
def __init__(self, X=None, Y=None,
xnames: list = None,
yname: str = None):
""" Tabular Dataset"""
if X is None:
raise Exception("Trying ... | [
"src.si.util.util.label_gen",
"numpy.mean",
"numpy.unique",
"numpy.max",
"numpy.savetxt",
"numpy.min",
"pandas.DataFrame",
"numpy.genfromtxt",
"numpy.var"
] | [((878, 916), 'numpy.genfromtxt', 'np.genfromtxt', (['filename'], {'delimiter': 'sep'}), '(filename, delimiter=sep)\n', (891, 916), True, 'import numpy as np\n'), ((2885, 2928), 'numpy.savetxt', 'np.savetxt', (['filename', 'fullds'], {'delimiter': 'sep'}), '(filename, fullds, delimiter=sep)\n', (2895, 2928), True, 'imp... |
from __future__ import absolute_import, division, print_function
import logging
import sys
logging.basicConfig(
stream=sys.stdout,
level=logging.DEBUG,
format='%(asctime)s %(name)s-%(levelname)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
import numpy as np
import utils
logger = logging.getLogger("ind... | [
"logging.basicConfig",
"logging.getLogger",
"numpy.sum",
"numpy.zeros",
"numpy.empty",
"numpy.rint"
] | [((93, 249), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.DEBUG', 'format': '"""%(asctime)s %(name)s-%(levelname)s: %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""'}), "(stream=sys.stdout, level=logging.DEBUG, format=\n '%(asctime)s %(name)s-%(levelname)s: %(mess... |
# Copyright 2020 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | [
"numpy.sqrt",
"cirq.protocols.decompose",
"cirq.AnyIntegerPowerGateFamily",
"cirq._compat.deprecated",
"networkx.from_edgelist",
"cirq._compat.deprecated_class",
"cirq.protocols.obj_to_dict_helper",
"cirq_pasqal.PasqalGateset"
] | [((10990, 11116), 'cirq._compat.deprecated_class', '_compat.deprecated_class', ([], {'deadline': '"""v0.16"""', 'fix': '"""Use cirq.optimize_for_target_gateset(circuit, gateset=PasqalGateset())."""'}), "(deadline='v0.16', fix=\n 'Use cirq.optimize_for_target_gateset(circuit, gateset=PasqalGateset()).')\n", (11014, 1... |
import base64
import io
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output
import numpy as np
import tensorflow as tf
from PIL import Image
from constants import CLASSES
import yaml
with open('app.ya... | [
"dash_bootstrap_components.DropdownMenuItem",
"dash.dependencies.Output",
"base64.b64encode",
"io.BytesIO",
"dash_html_components.H5",
"base64.b64decode",
"dash.dependencies.Input",
"dash_html_components.Pre",
"yaml.safe_load",
"numpy.array",
"dash_html_components.Div",
"tensorflow.keras.model... | [((524, 562), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (['PATH_MODEL'], {}), '(PATH_MODEL)\n', (550, 562), True, 'import tensorflow as tf\n'), ((1083, 1171), 'dash.Dash', 'dash.Dash', (['"""Traffic Signs Recognition"""'], {'external_stylesheets': '[dbc.themes.BOOTSTRAP]'}), "('Traffic Signs R... |
import gym.envs.mujoco.hopper as hopper
import numpy as np
class HopperEnv(hopper.HopperEnv):
def _get_obs(self):
return np.concatenate([
self.sim.data.qpos.flat[1:],
self.sim.data.qvel.flat,
])
def reset_obs(self, obs):
state = np.insert(obs, 0, 0.)
qp... | [
"numpy.insert",
"numpy.concatenate"
] | [((135, 205), 'numpy.concatenate', 'np.concatenate', (['[self.sim.data.qpos.flat[1:], self.sim.data.qvel.flat]'], {}), '([self.sim.data.qpos.flat[1:], self.sim.data.qvel.flat])\n', (149, 205), True, 'import numpy as np\n'), ((288, 310), 'numpy.insert', 'np.insert', (['obs', '(0)', '(0.0)'], {}), '(obs, 0, 0.0)\n', (297... |
# Copyright (c) 2016-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | [
"caffe2.python.test_util.rand_array",
"caffe2.python.workspace.RunOperatorOnce",
"caffe2.python.workspace.FetchBlob",
"numpy.array",
"numpy.random.randint",
"numpy.zeros",
"numpy.stack",
"numpy.empty",
"caffe2.python.core.CreateOperator",
"unittest.main",
"numpy.testing.assert_array_equal",
"c... | [((7638, 7653), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7651, 7653), False, 'import unittest\n'), ((2004, 2082), 'caffe2.python.core.CreateOperator', 'core.CreateOperator', (['"""Partition"""', 'ins', 'outs'], {'pack_first_input': '(1 if pack else 0)'}), "('Partition', ins, outs, pack_first_input=1 if pack... |
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
__author__ = ["<NAME>"]
__all__ = ["_StatsModelsAdapter"]
import numpy as np
import pandas as pd
from sktime.forecasting.base._base import DEFAULT_ALPHA
from sktime.forecasting.base._sktime import _OptionalForecastingHorizonMixin
from sktime.forecasting.base._sktime ... | [
"numpy.testing.assert_array_equal",
"pandas.RangeIndex"
] | [((3433, 3475), 'pandas.RangeIndex', 'pd.RangeIndex', (['y.index[0]', '(y.index[-1] + 1)'], {}), '(y.index[0], y.index[-1] + 1)\n', (3446, 3475), True, 'import pandas as pd\n'), ((3493, 3542), 'numpy.testing.assert_array_equal', 'np.testing.assert_array_equal', (['y.index', 'new_index'], {}), '(y.index, new_index)\n', ... |
import numpy as np
import scipy.sparse
__all__ = ['save_npz', 'load_npz']
# Make loading safe vs. malicious input
PICKLE_KWARGS = dict(allow_pickle=False)
def save_npz(file, matrix, compressed=True):
""" Save a sparse matrix to a file using ``.npz`` format.
Parameters
----------
file : str or file... | [
"numpy.savez_compressed",
"numpy.load",
"numpy.savez"
] | [((2426, 2466), 'numpy.savez_compressed', 'np.savez_compressed', (['file'], {}), '(file, **arrays_dict)\n', (2445, 2466), True, 'import numpy as np\n'), ((2485, 2514), 'numpy.savez', 'np.savez', (['file'], {}), '(file, **arrays_dict)\n', (2493, 2514), True, 'import numpy as np\n'), ((4018, 4048), 'numpy.load', 'np.load... |
'''
This code is based on https://github.com/jrieke/shape-detection/
'''
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import tensorflow as tf
import datetime
class JriekeBboxDataset:
def generate(self):
print('Generating...')
self.WIDTH = 8
self.HEIGHT = 8
... | [
"matplotlib.pyplot.imshow",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.gca",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((440, 476), 'numpy.zeros', 'np.zeros', (['(num_imgs, num_objects, 4)'], {}), '((num_imgs, num_objects, 4))\n', (448, 476), True, 'import numpy as np\n'), ((497, 542), 'numpy.zeros', 'np.zeros', (['(num_imgs, self.WIDTH, self.HEIGHT)'], {}), '((num_imgs, self.WIDTH, self.HEIGHT))\n', (505, 542), True, 'import numpy as... |
#!/usr/bin/env python
# Copyright 2017 Calico 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agr... | [
"basenji.seqnn.SeqNN",
"numpy.array",
"basenji.dna_io.read_job_params",
"basenji.batcher.BatcherF",
"seaborn.set",
"numpy.reshape",
"seaborn.distplot",
"matplotlib.pyplot.xlabel",
"basenji.batcher.Batcher",
"tensorflow.Session",
"numpy.max",
"matplotlib.pyplot.close",
"os.path.isdir",
"bas... | [((829, 850), 'matplotlib.use', 'matplotlib.use', (['"""PDF"""'], {}), "('PDF')\n", (843, 850), False, 'import matplotlib\n'), ((1670, 1689), 'optparse.OptionParser', 'OptionParser', (['usage'], {}), '(usage)\n', (1682, 1689), False, 'from optparse import OptionParser\n'), ((3270, 3290), 'h5py.File', 'h5py.File', (['da... |
"""
Functions for testing independence of several distributions.
The functions in this module provide methods for testing if
the samples generated from two random vectors are independent.
"""
import numpy as np
import scipy.stats
from . import _dcor_internals, _hypothesis
from ._dcor import u_distance_correlation_sqr... | [
"numpy.sqrt"
] | [((9268, 9292), 'numpy.sqrt', 'np.sqrt', (['(1 - bcdcor ** 2)'], {}), '(1 - bcdcor ** 2)\n', (9275, 9292), True, 'import numpy as np\n'), ((9242, 9256), 'numpy.sqrt', 'np.sqrt', (['(v - 1)'], {}), '(v - 1)\n', (9249, 9256), True, 'import numpy as np\n')] |
#coding=utf-8
#性别识别
import cv2
from keras.models import load_model
import numpy as np
import chineseText
img = cv2.imread("img/gather.png")
face_classifier = cv2.CascadeClassifier(
"d:\Python36\Lib\site-packages\opencv-master\data\haarcascades\haarcascade_frontalface_default.xml"
)
gray = cv2.cvtColor(img, cv2.CO... | [
"cv2.rectangle",
"keras.models.load_model",
"cv2.imshow",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.cvtColor",
"numpy.expand_dims",
"cv2.CascadeClassifier",
"cv2.resize",
"cv2.imread",
"chineseText.cv2ImgAddText"
] | [((113, 141), 'cv2.imread', 'cv2.imread', (['"""img/gather.png"""'], {}), "('img/gather.png')\n", (123, 141), False, 'import cv2\n'), ((160, 299), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""d:\\\\Python36\\\\Lib\\\\site-packages\\\\opencv-master\\\\data\\\\haarcascades\\\\haarcascade_frontalface_default.xm... |
"""
Project for Udacity Danaodgree in Deep Reinforcement Learning
This script train an agent to navigate (and collect bananas!) in a large, square world.
A reward of +1 is provided for collecting a yellow banana, and a reward of -1 is provided for collecting a blue banana. Thus, the goal of your agent is to collect a... | [
"numpy.mean",
"collections.deque",
"dqn_agent.Agent",
"unityagents.UnityEnvironment",
"torch.cuda.is_available"
] | [((1524, 1564), 'unityagents.UnityEnvironment', 'UnityEnvironment', ([], {'file_name': '"""Banana.app"""'}), "(file_name='Banana.app')\n", (1540, 1564), False, 'from unityagents import UnityEnvironment\n'), ((1829, 1905), 'dqn_agent.Agent', 'Agent', ([], {'state_size': 'state_size', 'action_size': 'action_size', 'seed'... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | [
"flax.training.common_utils.shard",
"flax.optim.Adam",
"tensorflow.compat.v2.random.set_seed",
"latent_programmer.tasks.robust_fill.tokens.build_token_tables",
"absl.logging.info",
"jax.tree_map",
"latent_programmer.decode.beam_search",
"flax.training.common_utils.onehot",
"jax.jit",
"sys.path.app... | [((1590, 1615), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (1605, 1615), False, 'import sys\n'), ((1658, 1724), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""seed"""', '(0)', '"""Fixed random seed for training."""'], {}), "('seed', 0, 'Fixed random seed for training.')\n"... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import click
import numba
def prepare_data(data_pd, parameter):
lon_set = set(data_pd["lon"])
lat_set = set(data_pd["lat"])
dep_set = set(data_pd["dep"])
lon_list = sorted(lon_set)
lat_list = sorted(lat_set)
dep_list = sor... | [
"matplotlib.pyplot.ylabel",
"numpy.arange",
"pandas.read_pickle",
"matplotlib.pyplot.contourf",
"click.option",
"numpy.where",
"matplotlib.pyplot.xlabel",
"numpy.max",
"numpy.linspace",
"numpy.min",
"numpy.meshgrid",
"click.command",
"matplotlib.pyplot.gca",
"numba.njit",
"numpy.deg2rad"... | [((1443, 1455), 'numba.njit', 'numba.njit', ([], {}), '()\n', (1453, 1455), False, 'import numba\n'), ((1691, 1703), 'numba.njit', 'numba.njit', ([], {}), '()\n', (1701, 1703), False, 'import numba\n'), ((1753, 1765), 'numba.njit', 'numba.njit', ([], {}), '()\n', (1763, 1765), False, 'import numba\n'), ((2009, 2021), '... |
from typing import Tuple
import numpy as np
import rasterio.warp
from opensfm import features
from .orthophoto_manager import OrthoPhotoManager
from .view import View
class OrthoPhotoView(View):
def __init__(
self,
main_ui,
path: str,
init_lat: float,
init_lon: float,
... | [
"numpy.mean",
"numpy.array"
] | [((3748, 3761), 'numpy.mean', 'np.mean', (['xlim'], {}), '(xlim)\n', (3755, 3761), True, 'import numpy as np\n'), ((3763, 3776), 'numpy.mean', 'np.mean', (['ylim'], {}), '(ylim)\n', (3770, 3776), True, 'import numpy as np\n'), ((2286, 2304), 'numpy.array', 'np.array', (['[[x, y]]'], {}), '([[x, y]])\n', (2294, 2304), T... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import random
class JuliaSet:
def __init__(self):
"""
Constructor of the JuliaSet class
:param size: size in pixels (for both width and height)
:param dpi: dots per inch (default 300)
"""
... | [
"matplotlib.pyplot.imshow",
"numpy.flip",
"random.uniform",
"random.choice",
"numpy.abs",
"numpy.ones",
"numpy.sqrt",
"random.randrange",
"matplotlib.pyplot.gcf",
"numpy.concatenate",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show"
] | [((3661, 3683), 'random.choice', 'random.choice', (['cpxList'], {}), '(cpxList)\n', (3674, 3683), False, 'import random\n'), ((4146, 4172), 'random.randrange', 'random.randrange', (['(-1)', '(1)', '(2)'], {}), '(-1, 1, 2)\n', (4162, 4172), False, 'import random\n'), ((4374, 4400), 'random.uniform', 'random.uniform', ([... |
import numpy as np
from keras import backend as K
import os
import sys
K.set_image_dim_ordering('tf')
def patch_path(path):
return os.path.join(os.path.dirname(__file__), path)
def main():
sys.path.append(patch_path('..'))
data_dir_path = patch_path('very_large_data')
model_dir_path = patch_path('... | [
"keras_video_classifier.library.utility.ucf.UCF101_loader.load_ucf",
"numpy.random.shuffle",
"os.path.dirname",
"keras_video_classifier.library.convolutional.CnnVideoClassifier.get_weight_file_path",
"numpy.random.seed",
"keras_video_classifier.library.convolutional.CnnVideoClassifier.get_config_file_path... | [((72, 102), 'keras.backend.set_image_dim_ordering', 'K.set_image_dim_ordering', (['"""tf"""'], {}), "('tf')\n", (96, 102), True, 'from keras import backend as K\n'), ((545, 600), 'keras_video_classifier.library.convolutional.CnnVideoClassifier.get_config_file_path', 'CnnVideoClassifier.get_config_file_path', (['model_... |
'''
-------------------------------------
Assignment 2 - EE2703 (Jan-May 2020)
Done by <NAME> (EE18B122)
Created on 18/01/20
Last Modified on 04/02/20
-------------------------------------
'''
# importing necessary libraries
import sys
import cmath
import numpy as np
import pandas as pd
# To improve readability
C... | [
"numpy.linalg.solve",
"cmath.rect",
"numpy.zeros",
"sys.exit",
"pandas.DataFrame"
] | [((3524, 3564), 'sys.exit', 'sys.exit', (['"""Invalid number of arguments!"""'], {}), "('Invalid number of arguments!')\n", (3532, 3564), False, 'import sys\n'), ((17150, 17188), 'sys.exit', 'sys.exit', (['"""Given file does not exist!"""'], {}), "('Given file does not exist!')\n", (17158, 17188), False, 'import sys\n'... |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | [
"fat.fat_bert_nq.ppr.kb_csr_io.CsrData",
"numpy.where",
"tensorflow.logging.info",
"numpy.argsort",
"numpy.zeros",
"fat.fat_bert_nq.ppr.apr_algo.csr_personalized_pagerank",
"fat.fat_bert_nq.ppr.apr_algo.csr_topk_fact_extractor"
] | [((1590, 1599), 'fat.fat_bert_nq.ppr.kb_csr_io.CsrData', 'CsrData', ([], {}), '()\n', (1597, 1599), False, 'from fat.fat_bert_nq.ppr.kb_csr_io import CsrData\n'), ((2084, 2148), 'fat.fat_bert_nq.ppr.apr_algo.csr_personalized_pagerank', 'csr_personalized_pagerank', (['seeds', 'self.data.adj_mat_t_csr', 'alpha'], {}), '(... |
import warnings
from collections import OrderedDict
from distutils.version import LooseVersion
from functools import partial
from inspect import isclass
from typing import Callable, Optional, Dict, Union
import numpy as np
import torch
import tqdm
from torch import Tensor, nn
from torch.nn import functional as F
from... | [
"torch.cuda.Event",
"collections.OrderedDict",
"numpy.median",
"inspect.isclass",
"torch.cuda.synchronize",
"torch.tensor",
"torch.zeros_like",
"adv_lib.utils.ForwardCounter",
"torch.nn.functional.cross_entropy",
"adv_lib.utils.BackwardCounter",
"distutils.version.LooseVersion",
"warnings.warn... | [((5060, 5169), 'collections.OrderedDict', 'OrderedDict', (["[('linf', linf_distances), ('l0', l0_distances), ('l1', l1_distances), (\n 'l2', l2_distances)]"], {}), "([('linf', linf_distances), ('l0', l0_distances), ('l1',\n l1_distances), ('l2', l2_distances)])\n", (5071, 5169), False, 'from collections import O... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Module for graph representations of crystals.
"""
import copy
import logging
import os.path
import subprocess
import warnings
from collections import defaultdict, namedtuple
from itertools import combinati... | [
"logging.getLogger",
"networkx.readwrite.json_graph.adjacency_graph",
"pymatgen.util.coord.lattice_points_in_supercell",
"scipy.spatial.KDTree",
"pymatgen.core.PeriodicSite",
"numpy.array",
"networkx.weakly_connected_components",
"copy.deepcopy",
"operator.itemgetter",
"igraph.Graph",
"networkx.... | [((1010, 1037), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1027, 1037), False, 'import logging\n'), ((1243, 1307), 'collections.namedtuple', 'namedtuple', (['"""ConnectedSite"""', '"""site, jimage, index, weight, dist"""'], {}), "('ConnectedSite', 'site, jimage, index, weight, dist')... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module define a WulffShape class to generate the Wulff shape from
a lattice, a list of indices and their corresponding surface energies,
and the total area and volume of the wulff shape,the weighted su... | [
"logging.getLogger",
"numpy.sqrt",
"pymatgen.core.structure.Structure",
"matplotlib.colorbar.ColorbarBase",
"numpy.array",
"numpy.linalg.norm",
"scipy.cross",
"mpl_toolkits.mplot3d.art3d.Poly3DCollection",
"numpy.dot",
"matplotlib.cm.ScalarMappable",
"matplotlib.pyplot.Rectangle",
"warnings.wa... | [((1126, 1153), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1143, 1153), False, 'import logging\n'), ((1738, 1749), 'numpy.array', 'np.array', (['b'], {}), '(b)\n', (1746, 1749), True, 'import numpy as np\n'), ((1752, 1763), 'numpy.array', 'np.array', (['a'], {}), '(a)\n', (1760, 1763... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, <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 Lic... | [
"logging.getLogger",
"tensorflow.python.keras.backend.batch_set_value",
"torch.load",
"torch.from_numpy",
"numpy.squeeze",
"numpy.expand_dims",
"os.path.abspath",
"re.sub",
"numpy.transpose"
] | [((802, 829), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (819, 829), False, 'import logging\n'), ((1569, 1614), 're.sub', 're.sub', (['"""/[^/]*___([^/]*)/"""', '"""/\\\\1/"""', 'tf_name'], {}), "('/[^/]*___([^/]*)/', '/\\\\1/', tf_name)\n", (1575, 1614), False, 'import re\n'), ((1901... |
import attr
from firedrake import *
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from scipy.linalg import svd
from scipy.sparse.linalg import svds
from scipy.sparse import csr_matrix
from slepc4py import SLEPc
import pandas as pd
from tqdm import tqdm
import os
matplotlib.use('Agg')
@attr.s
c... | [
"numpy.ma.masked_values",
"slepc4py.SLEPc.SVD",
"os.makedirs",
"matplotlib.use",
"numpy.delete",
"numpy.array",
"scipy.sparse.linalg.svds",
"scipy.linalg.svd",
"pandas.DataFrame",
"numpy.all",
"matplotlib.pyplot.subplots",
"attr.ib"
] | [((287, 308), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (301, 308), False, 'import matplotlib\n'), ((367, 376), 'attr.ib', 'attr.ib', ([], {}), '()\n', (374, 376), False, 'import attr\n'), ((398, 407), 'attr.ib', 'attr.ib', ([], {}), '()\n', (405, 407), False, 'import attr\n'), ((431, 440), ... |
import numpy as np
from yt.geometry.selection_routines import GridSelector
from yt.utilities.io_handler import BaseIOHandler
from yt.utilities.logger import ytLogger as mylog
from yt.utilities.on_demand_imports import _h5py as h5py
_convert_mass = ("particle_mass", "mass")
_particle_position_names = {}
class IOHan... | [
"yt.utilities.on_demand_imports._h5py.File",
"yt.utilities.io_handler.BaseIOHandler.__init__",
"numpy.empty",
"yt.utilities.logger.ytLogger.debug"
] | [((550, 584), 'yt.utilities.on_demand_imports._h5py.File', 'h5py.File', (['grid.filename'], {'mode': '"""r"""'}), "(grid.filename, mode='r')\n", (559, 584), True, 'from yt.utilities.on_demand_imports import _h5py as h5py\n'), ((7940, 7972), 'yt.utilities.io_handler.BaseIOHandler.__init__', 'BaseIOHandler.__init__', (['... |
import matplotlib.pyplot as plt
import random
import pickle
from skimage.transform import rotate
from scipy import ndimage
from skimage.util import img_as_ubyte
from joblib import Parallel, delayed
from sklearn.ensemble.forest import _generate_unsampled_indices
from sklearn.ensemble.forest import _generate_sample_indic... | [
"keras.layers.Conv2D",
"keras.layers.Dense",
"sys.path.append",
"scipy.ndimage.zoom",
"numpy.arange",
"keras.Sequential",
"numpy.mean",
"skimage.transform.rotate",
"numpy.where",
"keras.datasets.cifar100.load_data",
"skimage.util.img_as_ubyte",
"numpy.random.seed",
"numpy.concatenate",
"ke... | [((638, 673), 'sys.path.append', 'sys.path.append', (['"""../../proglearn/"""'], {}), "('../../proglearn/')\n", (653, 673), False, 'import sys\n'), ((7056, 7091), 'keras.datasets.cifar100.load_data', 'keras.datasets.cifar100.load_data', ([], {}), '()\n', (7089, 7091), False, 'import keras\n'), ((7101, 7134), 'numpy.con... |
# <NAME>
# S = 1/2, I = 1/2
# Spin 1/2 electron coupled to spin 1/2 nuclei
import numpy as np
from scipy.linalg import expm
from matplotlib.pylab import *
from matplotlib import cm
sigma_x = 0.5*np.r_[[[0, 1],[1, 0]]]
sigma_y = 0.5*np.r_[[[0,-1j],[1j, 0]]]
sigma_z = 0.5*np.r_[[[1, 0],[0, -1]]]
Identity = np.eye(2)
... | [
"numpy.eye",
"numpy.allclose",
"numpy.linalg.eig",
"numpy.kron",
"numpy.dot"
] | [((308, 317), 'numpy.eye', 'np.eye', (['(2)'], {}), '(2)\n', (314, 317), True, 'import numpy as np\n'), ((325, 351), 'numpy.kron', 'np.kron', (['sigma_x', 'Identity'], {}), '(sigma_x, Identity)\n', (332, 351), True, 'import numpy as np\n'), ((357, 383), 'numpy.kron', 'np.kron', (['sigma_y', 'Identity'], {}), '(sigma_y,... |
'''
Created on Mar 6, 2018
@author: cef
hp functions for workign with dictionaries
'''
import logging, os, sys, math, copy, inspect
from collections import OrderedDict
from weakref import WeakValueDictionary as wdict
import numpy as np
import hp.basic
mod_logger = logging.getLogger(__name__) #... | [
"logging.getLogger",
"numpy.all",
"copy.copy",
"copy.deepcopy"
] | [((291, 318), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (308, 318), False, 'import logging, os, sys, math, copy, inspect\n'), ((4046, 4062), 'copy.copy', 'copy.copy', (['d_big'], {}), '(d_big)\n', (4055, 4062), False, 'import logging, os, sys, math, copy, inspect\n'), ((11902, 11920)... |
import pytest
import numpy as np
from numpy.testing import assert_allclose
from keras import backend as K
from keras import activations
def get_standard_values():
'''
These are just a set of floats used for testing the activation
functions, and are useful in multiple tests.
'''
return np.array([[... | [
"keras.activations.linear",
"keras.backend.floatx",
"keras.activations.hard_sigmoid",
"numpy.testing.assert_allclose",
"keras.backend.placeholder",
"numpy.tanh",
"pytest.main",
"numpy.max",
"numpy.exp",
"keras.activations.softmax",
"keras.activations.sigmoid",
"numpy.size",
"keras.activation... | [((575, 596), 'keras.backend.placeholder', 'K.placeholder', ([], {'ndim': '(2)'}), '(ndim=2)\n', (588, 596), True, 'from keras import backend as K\n'), ((761, 806), 'numpy.testing.assert_allclose', 'assert_allclose', (['result', 'expected'], {'rtol': '(1e-05)'}), '(result, expected, rtol=1e-05)\n', (776, 806), False, '... |
##############################################################################
#
# Copyright (c) 2003-2020 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development unt... | [
"numpy.ones",
"math.sqrt",
"math.cos",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"math.sin"
] | [((3470, 3576), 'numpy.array', 'numpy.array', (['[x[1] * y[2] - x[2] * y[1], x[2] * y[0] - x[0] * y[2], x[0] * y[1] - x[1] *\n y[0]]', '_TYPE'], {}), '([x[1] * y[2] - x[2] * y[1], x[2] * y[0] - x[0] * y[2], x[0] * y\n [1] - x[1] * y[0]], _TYPE)\n', (3481, 3576), False, 'import numpy\n'), ((1609, 1626), 'numpy.zer... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script run neural network model on a camera live stream
"""
import argparse
import cv2
import numpy as np
import os
import time
import sys
COMMANDS = {0: "move_forward", 1: "go_down", 2: "rot_10_deg",
3: "go_up", 4: "take_off", 5: "land", 6: "idle"}... | [
"numpy.prod",
"time.sleep",
"cv2.imshow",
"homemade_framework.framework.LossMSE",
"homemade_framework.framework.Softmax",
"cv2.destroyAllWindows",
"tensorflow.keras.models.load_model",
"sys.path.append",
"homemade_framework.framework.LeakyReLU",
"argparse.ArgumentParser",
"cv2.threshold",
"num... | [((1221, 1246), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1244, 1246), False, 'import argparse\n'), ((3712, 3747), 'sys.path.append', 'sys.path.append', (['args.pyparrot_path'], {}), '(args.pyparrot_path)\n', (3727, 3747), False, 'import sys\n'), ((3833, 3885), 'pyparrot.Anafi.Anafi', 'An... |
import numpy as np
from hypernet.src.general import const
from hypernet.src.general import utils
from hypernet.src.thermophysicalModels.reactionThermo.mixture import Basic
class MultiComponent(Basic):
# Initialization
###########################################################################
def __init... | [
"hypernet.src.general.utils.convert_to_array",
"numpy.sum",
"numpy.concatenate"
] | [((2710, 2723), 'numpy.sum', 'np.sum', (['dhedY'], {}), '(dhedY)\n', (2716, 2723), True, 'import numpy as np\n'), ((1649, 1666), 'numpy.concatenate', 'np.concatenate', (['R'], {}), '(R)\n', (1663, 1666), True, 'import numpy as np\n'), ((1968, 1985), 'numpy.concatenate', 'np.concatenate', (['n'], {}), '(n)\n', (1982, 19... |
from __future__ import print_function
from scipy.linalg import block_diag
from scipy.stats import norm as ndist
from scipy.interpolate import interp1d
import collections
import numpy as np
from numpy import log
from numpy.linalg import norm, qr, inv, eig
import pandas as pd
import regreg.api as rr
from .randomization... | [
"regreg.api.simple_problem",
"numpy.sqrt",
"numpy.hstack",
"scipy.interpolate.interp1d",
"numpy.array",
"numpy.linalg.norm",
"scipy.stats.norm.cdf",
"numpy.multiply",
"numpy.linalg.qr",
"numpy.reshape",
"regreg.api.identity_quadratic",
"regreg.api.group_lasso",
"numpy.flatnonzero",
"numpy.... | [((31360, 31406), 'scipy.linalg.block_diag', 'block_diag', (['*[i for gp in to_diag for i in gp]'], {}), '(*[i for gp in to_diag for i in gp])\n', (31370, 31406), False, 'from scipy.linalg import block_diag\n'), ((33085, 33101), 'numpy.array', 'np.array', (['groups'], {}), '(groups)\n', (33093, 33101), True, 'import nu... |
import BoltzmannMachine as bm
import QHO as qho
import numpy as np
import datetime
# Visualization imports
from IPython.display import clear_output
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['figure.dpi']=300
def sigmoid(x):
return .5 * (1 + np.tanh(x / 2.))
# Set t... | [
"numpy.fabs",
"QHO.QHOGas",
"PIL.Image.fromarray",
"matplotlib.pyplot.ylabel",
"numpy.average",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"numpy.tanh",
"IPython.display.clear_output",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.figure",
"numpy.dot",
"BoltzmannMachin... | [((447, 462), 'QHO.QHOGas', 'qho.QHOGas', ([], {'N': 'N'}), '(N=N)\n', (457, 462), True, 'import QHO as qho\n'), ((3637, 3681), 'BoltzmannMachine.BoltzmannMachine', 'bm.BoltzmannMachine', ([], {'num_hidden': 'hidden_units'}), '(num_hidden=hidden_units)\n', (3656, 3681), True, 'import BoltzmannMachine as bm\n'), ((3849,... |
#! /usr/bin/env python3
# Copyright 2020 Tier IV, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
"rclpy.spin",
"case_converter.pascal2snake",
"argparse.ArgumentParser",
"self_pose_listener.SelfPoseListener",
"geometry_msgs.msg.PoseStamped",
"rtree.index.Index",
"math.hypot",
"numpy.argmin",
"rclpy.init",
"rclpy.shutdown"
] | [((5663, 5675), 'rclpy.init', 'rclpy.init', ([], {}), '()\n', (5673, 5675), False, 'import rclpy\n'), ((5690, 5715), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5713, 5715), False, 'import argparse\n'), ((5854, 5887), 'rclpy.spin', 'rclpy.spin', (['stop_reason2pose_node'], {}), '(stop_reaso... |
import mtrain
import numpy as np
import pandas as pd
import random
def simulate_games(num_players=4, domino_size=12, num_games=250, collect_data=True,
debug=False, players=["Random", "Greedy", "Probability", "Neural"],
file_name="PlayData/data4_12_250"):
"""
Runs the m... | [
"numpy.mean",
"random.choice",
"numpy.ndarray",
"pandas.concat",
"pandas.DataFrame",
"pandas.ExcelWriter",
"mtrain.mexicantrain"
] | [((1844, 1880), 'numpy.ndarray', 'np.ndarray', (['(num_players, num_games)'], {}), '((num_players, num_games))\n', (1854, 1880), True, 'import numpy as np\n'), ((1892, 1928), 'numpy.ndarray', 'np.ndarray', (['(num_players, num_games)'], {}), '((num_players, num_games))\n', (1902, 1928), True, 'import numpy as np\n'), (... |
##############################################################################
#
# Below code is inspired on
# https://github.com/facebookresearch/detectron2/blob/master/detectron2/data/datasets/pascal_voc.py
# --------------------------------------------------------
# Detectron2
# Licensed under the Apache 2.0 license... | [
"random.sample",
"xml.etree.ElementTree.parse",
"argparse.ArgumentParser",
"os.path.join",
"cv2.waitKey",
"cv2.destroyAllWindows",
"detectron2.data.MetadataCatalog.get",
"numpy.loadtxt",
"cv2.imread",
"detectron2.data.DatasetCatalog.get"
] | [((2443, 2468), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2466, 2468), False, 'import argparse\n'), ((2808, 2840), 'detectron2.data.DatasetCatalog.get', 'DatasetCatalog.get', (['dataset_name'], {}), '(dataset_name)\n', (2826, 2840), False, 'from detectron2.data import DatasetCatalog, Meta... |
"""
kissim.cli.encode
Encode structures (generate fingerprints) from CLI arguments.
"""
import numpy as np
from kissim.api import encode
from kissim.cli.utils import configure_logger
def encode_from_cli(args):
"""
Encode structures.
Parameters
----------
args : argsparse.Namespace
CLI ... | [
"kissim.cli.utils.configure_logger",
"kissim.api.encode",
"numpy.genfromtxt"
] | [((344, 373), 'kissim.cli.utils.configure_logger', 'configure_logger', (['args.output'], {}), '(args.output)\n', (360, 373), False, 'from kissim.cli.utils import configure_logger\n'), ((443, 508), 'kissim.api.encode', 'encode', (['structure_klifs_ids', 'args.output', 'args.local', 'args.ncores'], {}), '(structure_klifs... |
import numpy as np
from util import *
def naiveDistanceProfile(tsA, idx, m, tsB = None):
"""Return the distance profile of query against ts. Use the naive all pairs comparison algorithm.
>>> np.round(naiveDistanceProfile(np.array([0.0, 1.0, -1.0, 0.0]), 0, 4, np.array([-1, 1, 0, 0, -1, 1])), 3)
array([[ 2... | [
"numpy.full",
"doctest.testmod"
] | [((1672, 1689), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (1687, 1689), False, 'import doctest\n'), ((887, 923), 'numpy.full', 'np.full', (['(n - m + 1)', 'idx'], {'dtype': 'float'}), '(n - m + 1, idx, dtype=float)\n', (894, 923), True, 'import numpy as np\n'), ((1581, 1617), 'numpy.full', 'np.full', (['(... |
from itertools import product
from unittest.mock import patch
import pytest
import numpy as np
import pandas as pd
from pandas.util.testing import assert_frame_equal
from sm.engine.annotation.fdr import FDR, run_fdr_ranking
from sm.engine.formula_parser import format_modifiers
FDR_CONFIG = {'decoy_sample_size': 2}
... | [
"pandas.Series",
"numpy.isclose",
"sm.engine.annotation.fdr.FDR",
"sm.engine.formula_parser.format_modifiers",
"itertools.product",
"sm.engine.annotation.fdr.run_fdr_ranking",
"pytest.mark.parametrize",
"pandas.DataFrame",
"unittest.mock.patch"
] | [((322, 385), 'unittest.mock.patch', 'patch', (['"""sm.engine.annotation.fdr.DECOY_ADDUCTS"""', "['+He', '+Li']"], {}), "('sm.engine.annotation.fdr.DECOY_ADDUCTS', ['+He', '+Li'])\n", (327, 385), False, 'from unittest.mock import patch\n'), ((1185, 1286), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""anal... |
from __future__ import (division)
from pomegranate import *
from pomegranate.io import DataGenerator
from pomegranate.io import DataFrameGenerator
from nose.tools import with_setup
from nose.tools import assert_almost_equal
from nose.tools import assert_equal
from nose.tools import assert_not_equal
from nose.tools im... | [
"numpy.testing.assert_array_almost_equal",
"nose.tools.assert_almost_equal",
"nose.tools.with_setup",
"pomegranate.io.DataGenerator",
"pickle.dumps",
"pandas.DataFrame",
"nose.tools.assert_equal"
] | [((3258, 3307), 'nose.tools.with_setup', 'with_setup', (['setup_multivariate_gaussian', 'teardown'], {}), '(setup_multivariate_gaussian, teardown)\n', (3268, 3307), False, 'from nose.tools import with_setup\n'), ((3449, 3495), 'nose.tools.with_setup', 'with_setup', (['setup_multivariate_mixed', 'teardown'], {}), '(setu... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 5 05:47:03 2018
@author: zg
"""
import numpy as np
#from scipy import io
import scipy.io
#import pickle
from sklearn.model_selection import StratifiedKFold
#import sklearn
from scipy.sparse import spdiags
from scipy.spatial import distance
#impo... | [
"sklearn.model_selection.StratifiedKFold",
"numpy.array",
"numpy.argsort",
"numpy.nanmean",
"copy.deepcopy",
"numpy.where",
"numpy.float64",
"numpy.sort",
"numpy.argmin",
"numpy.eye",
"numpy.argmax",
"numpy.fill_diagonal",
"numpy.finfo",
"sklearn.svm.SVC",
"numpy.copy",
"numpy.unique",... | [((4652, 4676), 'numpy.fill_diagonal', 'np.fill_diagonal', (['sim', '(0)'], {}), '(sim, 0)\n', (4668, 4676), True, 'import numpy as np\n'), ((5076, 5111), 'numpy.logical_or', 'np.logical_or', (['aRankNet', 'aRankNet.T'], {}), '(aRankNet, aRankNet.T)\n', (5089, 5111), True, 'import numpy as np\n'), ((5200, 5233), 'numpy... |
#########################
#########################
# Need to account for limit in input period
#########################
#########################
# Baseline M67 long script -- NO crowding
# New script copied from quest - want to take p and ecc from each population (all, obs, rec) and put them into separate file
# Do... | [
"numpy.log10",
"numpy.sqrt",
"pandas.read_csv",
"numpy.array",
"numpy.arange",
"numpy.histogram",
"astropy.modeling.models.PowerLaw1D",
"os.listdir",
"numpy.diff",
"numpy.concatenate",
"pandas.DataFrame",
"matplotlib.use",
"scipy.integrate.quad",
"astropy.modeling.fitting.LevMarLSQFitter",... | [((710, 731), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (724, 731), False, 'import matplotlib\n'), ((1380, 1431), 'astropy.modeling.models.PowerLaw1D', 'models.PowerLaw1D', ([], {'amplitude': '(0.5)', 'x_0': '(1)', 'alpha': '(-1.0)'}), '(amplitude=0.5, x_0=1, alpha=-1.0)\n', (1397, 1431), Fa... |
import numpy as np
from itertools import product
from typing import List
from src.config import ConfigChess
from src.chess.board import Board
from src.chess.move import Move
def get_all_possible_moves() -> List[Move]:
all_possible_moves = set()
array = np.zeros((ConfigChess.board_size, ConfigChess.board_size... | [
"numpy.zeros",
"src.chess.board.Board.piece_symbol_to_int",
"src.chess.board.Board"
] | [((715, 745), 'src.chess.board.Board.piece_symbol_to_int', 'Board.piece_symbol_to_int', (['"""P"""'], {}), "('P')\n", (740, 745), False, 'from src.chess.board import Board\n'), ((885, 915), 'src.chess.board.Board.piece_symbol_to_int', 'Board.piece_symbol_to_int', (['"""p"""'], {}), "('p')\n", (910, 915), False, 'from s... |
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | [
"monai.handlers.SurfaceDistance",
"ignite.engine.Engine",
"numpy.zeros",
"unittest.main",
"torch.zeros_like",
"torch.ones"
] | [((1895, 1927), 'torch.zeros_like', 'torch.zeros_like', (['sampler_sphere'], {}), '(sampler_sphere)\n', (1911, 1927), False, 'import torch\n'), ((1285, 1319), 'numpy.zeros', 'np.zeros', (['im_shape'], {'dtype': 'np.int32'}), '(im_shape, dtype=np.int32)\n', (1293, 1319), True, 'import numpy as np\n'), ((3383, 3398), 'un... |
#!/usr/bin/env python3
import sys
import logging
import yaml
import pandas as pd
import numpy as np
from collections import defaultdict
from sklearn.model_selection import train_test_split
from sklearn.ensemble import IsolationForest
from sklearn.impute import SimpleImputer
from anoflows.hpo import find_best_flows
... | [
"logging.getLogger",
"numpy.mean",
"anoflows.anoflow_bagging.AnoFlowBagging",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.IsolationForest",
"logging.info",
"numpy.isin",
"numpy.array",
"collections.defaultdict",
"sklearn.impute.SimpleImputer",
"numpy.std",
"logging.error",
... | [((556, 576), 'data_loading.load_data', 'load_data', (['spec_file'], {}), '(spec_file)\n', (565, 576), False, 'from data_loading import load_data\n'), ((729, 746), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (740, 746), False, 'from collections import defaultdict\n'), ((2144, 2183), 'logging.i... |
"""Helper functions to tests."""
import numpy as np
def norm(vs: np.array) -> float:
"""Compute the norm of a vector."""
return np.sqrt(np.dot(vs, vs))
def create_random_matrix(size: int) -> np.array:
"""Create a numpy random matrix."""
return np.random.normal(size=size ** 2).reshape(size, size)
... | [
"numpy.random.normal",
"numpy.dot"
] | [((147, 161), 'numpy.dot', 'np.dot', (['vs', 'vs'], {}), '(vs, vs)\n', (153, 161), True, 'import numpy as np\n'), ((265, 297), 'numpy.random.normal', 'np.random.normal', ([], {'size': '(size ** 2)'}), '(size=size ** 2)\n', (281, 297), True, 'import numpy as np\n'), ((705, 739), 'numpy.dot', 'np.dot', (['matrix', 'eigen... |
#pylint:disable=no-member
import cv2 as cv
import numpy as np
img = cv.imread('/Users/webileapp/Desktop/niharika_files/projects/opencv_course_master/Resources/Photos/cats.jpg')
cv.imshow('Cats', img)
#
blank = np.zeros(img.shape[:2], dtype='uint8')
cv.imshow('Blank', blank)
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)... | [
"cv2.drawContours",
"cv2.threshold",
"cv2.Canny",
"cv2.imshow",
"numpy.zeros",
"cv2.waitKey",
"cv2.cvtColor",
"cv2.findContours",
"cv2.GaussianBlur",
"cv2.imread"
] | [((70, 188), 'cv2.imread', 'cv.imread', (['"""/Users/webileapp/Desktop/niharika_files/projects/opencv_course_master/Resources/Photos/cats.jpg"""'], {}), "(\n '/Users/webileapp/Desktop/niharika_files/projects/opencv_course_master/Resources/Photos/cats.jpg'\n )\n", (79, 188), True, 'import cv2 as cv\n'), ((179, 201... |
"""Read, write, create Brainvoyager VMR file format."""
import struct
import numpy as np
from bvbabel.utils import (read_variable_length_string,
write_variable_length_string)
# =============================================================================
def read_vmr(filename):
"""Read... | [
"bvbabel.utils.write_variable_length_string",
"numpy.reshape",
"struct.pack",
"numpy.zeros",
"numpy.transpose",
"bvbabel.utils.read_variable_length_string"
] | [((3535, 3605), 'numpy.zeros', 'np.zeros', (["(header['DimZ'] * header['DimY'] * header['DimX'])"], {'dtype': '"""<B"""'}), "(header['DimZ'] * header['DimY'] * header['DimX'], dtype='<B')\n", (3543, 3605), True, 'import numpy as np\n'), ((3752, 3822), 'numpy.reshape', 'np.reshape', (['data_img', "(header['DimZ'], heade... |
from dataset.baseset import BaseSet
import random, cv2
import numpy as np
class iNaturalist(BaseSet):
def __init__(self, mode='train', cfg=None, transform=None):
super(iNaturalist, self).__init__(mode, cfg, transform)
random.seed(0)
self.class_dict = self._get_class_dict()
... | [
"random.choice",
"random.randint",
"random.seed",
"numpy.arange"
] | [((248, 262), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (259, 262), False, 'import random, cv2\n'), ((1059, 1088), 'random.choice', 'random.choice', (['sample_indexes'], {}), '(sample_indexes)\n', (1072, 1088), False, 'import random, cv2\n'), ((651, 690), 'random.randint', 'random.randint', (['(0)', '(self.... |
import inspect
from typing import List, Union, Set, Any
import numpy as np
from fruits.cache import Cache, CoquantileCache
from fruits.scope import force_input_shape, FitTransform
from fruits.core.callback import AbstractCallback
from fruits.signature.iss import SignatureCalculator, CachePlan
from fruits.words.word i... | [
"fruits.signature.iss.CachePlan",
"numpy.random.choice",
"fruits.signature.iss.SignatureCalculator",
"numpy.array",
"numpy.random.randint",
"fruits.scope.force_input_shape",
"inspect.isclass",
"fruits.cache.CoquantileCache",
"numpy.nan_to_num"
] | [((6257, 6299), 'numpy.nan_to_num', 'np.nan_to_num', (['result'], {'copy': '(False)', 'nan': '(0.0)'}), '(result, copy=False, nan=0.0)\n', (6270, 6299), True, 'import numpy as np\n'), ((15954, 15971), 'fruits.cache.CoquantileCache', 'CoquantileCache', ([], {}), '()\n', (15969, 15971), False, 'from fruits.cache import C... |
import numpy as np
from sklearn.metrics import fbeta_score, roc_curve, auc, confusion_matrix
from sklearn.decomposition import PCA
from sklearn import random_projection
from sklearn import svm
from sklearn.ensemble import IsolationForest
import matplotlib.pyplot as plt
from keras.layers import Dense, Input, Dropout
fro... | [
"matplotlib.pyplot.ylabel",
"sklearn.metrics.auc",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.metrics.roc_curve",
"keras.layers.Dense",
"matplotlib.pyplot.semilogy",
"sklearn.decomposition.PCA",
"sklearn.random_projection.SparseRandomProjection",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot... | [((6712, 6744), 'keras.layers.Input', 'Input', ([], {'shape': '(x_train.shape[1],)'}), '(shape=(x_train.shape[1],))\n', (6717, 6744), False, 'from keras.layers import Dense, Input, Dropout\n'), ((6920, 6948), 'keras.models.Model', 'Model', (['input_vector', 'decoded'], {}), '(input_vector, decoded)\n', (6925, 6948), Fa... |
# Copyright 2020 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... | [
"mindspore.log.info",
"util.save_and_check_md5",
"numpy.mean",
"util.diff_mse",
"mindspore.dataset.vision.py_transforms.Resize",
"mindspore.dataset.vision.py_transforms.ToPIL",
"util.visualize_list",
"mindspore.dataset.vision.c_transforms.Resize",
"mindspore.dataset.vision.py_transforms.Invert",
"... | [((1160, 1196), 'mindspore.log.info', 'logger.info', (['"""Test Invert Python op"""'], {}), "('Test Invert Python op')\n", (1171, 1196), True, 'from mindspore import log as logger\n'), ((1235, 1293), 'mindspore.dataset.ImageFolderDataset', 'ds.ImageFolderDataset', ([], {'dataset_dir': 'DATA_DIR', 'shuffle': '(False)'})... |
import numpy
g = open('/home/srallaba/mgc/transposed/arctic_a0404.mgc','w')
x = numpy.loadtxt('/home/srallaba/mgc_spaces/arctic_a0404.mgc')
numpy.savetxt(g, numpy.transpose(x))
g.close()
| [
"numpy.loadtxt",
"numpy.transpose"
] | [((82, 141), 'numpy.loadtxt', 'numpy.loadtxt', (['"""/home/srallaba/mgc_spaces/arctic_a0404.mgc"""'], {}), "('/home/srallaba/mgc_spaces/arctic_a0404.mgc')\n", (95, 141), False, 'import numpy\n'), ((159, 177), 'numpy.transpose', 'numpy.transpose', (['x'], {}), '(x)\n', (174, 177), False, 'import numpy\n')] |
"""Miscellaneous utility functions."""
from functools import reduce
from PIL import Image
import numpy as np
from matplotlib.colors import rgb_to_hsv, hsv_to_rgb
def compose(*funcs):
"""Compose arbitrarily many functions, evaluated left to right.
Reference: https://mathieularose.com/function-composition-in-... | [
"PIL.Image.open",
"numpy.random.rand",
"numpy.logical_and",
"PIL.Image.new",
"numpy.asarray",
"numpy.max",
"numpy.array",
"numpy.zeros",
"matplotlib.colors.hsv_to_rgb",
"numpy.min",
"numpy.random.shuffle"
] | [((847, 886), 'PIL.Image.new', 'Image.new', (['"""RGB"""', 'size', '(128, 128, 128)'], {}), "('RGB', size, (128, 128, 128))\n", (856, 886), False, 'from PIL import Image\n'), ((1257, 1276), 'PIL.Image.open', 'Image.open', (['line[0]'], {}), '(line[0])\n', (1267, 1276), False, 'from PIL import Image\n'), ((2591, 2632), ... |
"""
A class hierarchy relating to fields of all kinds.
"""
from __future__ import print_function, division
import numpy as np
from ciabatta.meta import make_repr_str
from fealty import lattice, field_numerics, walled_field_numerics
class Space(object):
def __init__(self, L, dim):
self.L = L
self.... | [
"numpy.logical_not",
"fealty.field_numerics.density_3d",
"fealty.walled_field_numerics.grad_3d",
"fealty.field_numerics.div_1d",
"fealty.lattice.i_to_r",
"ciabatta.meta.make_repr_str",
"fealty.walled_field_numerics.grad_i_1d",
"fealty.field_numerics.grad_i_1d",
"numpy.empty",
"fealty.walled_field_... | [((3872, 3896), 'fealty.lattice.r_to_i', 'lattice.r_to_i', (['r', 'L', 'dx'], {}), '(r, L, dx)\n', (3886, 3896), False, 'from fealty import lattice, field_numerics, walled_field_numerics\n'), ((3905, 3946), 'numpy.zeros', 'np.zeros', (['(r.shape[1] * (M,))'], {'dtype': 'np.int'}), '(r.shape[1] * (M,), dtype=np.int)\n',... |
# -*- coding: future_fstrings -*-
#
# Copyright 2019 <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
#
# This file is part of acados.
#
# The 2-Clause BSD License
#
# Redistribution and use in source and binary forms, with or without
#... | [
"os.path.exists",
"numpy.ones",
"os.getcwd",
"os.chdir",
"os.path.dirname",
"numpy.sum",
"numpy.zeros",
"copy.deepcopy",
"json.load",
"os.system",
"numpy.shape",
"json.dump"
] | [((15748, 15771), 'numpy.sum', 'np.sum', (['opts.time_steps'], {}), '(opts.time_steps)\n', (15754, 15771), True, 'import numpy as np\n'), ((16019, 16059), 'os.path.dirname', 'os.path.dirname', (['current_module.__file__'], {}), '(current_module.__file__)\n', (16034, 16059), False, 'import sys, os, json\n'), ((9215, 923... |
"""
Module containing all the spectrogram classes
"""
# 0.2.0
import torch
import torch.nn as nn
from torch.nn.functional import conv1d, conv2d, fold
import numpy as np
from time import time
from nnAudio.librosa_functions import *
from nnAudio.utils import *
sz_float = 4 # size of a float
epsilon = 10e-8 # fudg... | [
"torch.nn.functional.conv2d",
"numpy.sqrt",
"torch.nn.functional.conv1d",
"torch.sin",
"torch.max",
"torch.sqrt",
"torch.cos",
"torch.arange",
"torch.nn.ReflectionPad1d",
"torch.nn.ConstantPad1d",
"torch.rfft",
"torch.matmul",
"torch.pinverse",
"torch.randn",
"torch.optim.SGD",
"numpy.... | [((4751, 4757), 'time.time', 'time', ([], {}), '()\n', (4755, 4757), False, 'from time import time\n'), ((5660, 5703), 'torch.tensor', 'torch.tensor', (['kernel_sin'], {'dtype': 'torch.float'}), '(kernel_sin, dtype=torch.float)\n', (5672, 5703), False, 'import torch\n'), ((5725, 5768), 'torch.tensor', 'torch.tensor', (... |
""" Represent a triangulated surface using a 3D boolean grid"""
import logging
import numpy as np
from rpl.tools.ray_tracing.bsp_tree_poly import BSP_Element
from rpl.tools.geometry import geom_utils
import data_io
class BSP_Grid(object):
def __init__(self, node_array, tris, allocate_step=100000):
... | [
"mayavi.mlab.points3d",
"numpy.arccos",
"data_io.save_multi_array",
"mayavi.mlab.show",
"rpl.tools.geometry.geom_utils.rotation_about_vector",
"numpy.where",
"numpy.hstack",
"numpy.min",
"numpy.max",
"rpl.tools.ray_tracing.bsp_tree_poly.BSP_Element",
"numpy.array",
"numpy.dot",
"numpy.zeros"... | [((2930, 3002), 'numpy.arange', 'np.arange', (['x_min', "(x_max + settings['voxel_size'])", "settings['voxel_size']"], {}), "(x_min, x_max + settings['voxel_size'], settings['voxel_size'])\n", (2939, 3002), True, 'import numpy as np\n'), ((3017, 3089), 'numpy.arange', 'np.arange', (['y_min', "(y_max + settings['voxel_s... |
from colicoords.synthetic_data import add_readout_noise, draw_poisson
from colicoords import load
import numpy as np
import mahotas as mh
from tqdm import tqdm
import os
import tifffile
def chunk_list(l, sizes):
prev = 0
for s in sizes:
result = l[prev:prev+s]
prev += s
yield result
... | [
"numpy.random.normal",
"numpy.ones_like",
"mahotas.distance",
"colicoords.synthetic_data.draw_poisson",
"numpy.random.rand",
"tqdm.tqdm",
"os.path.join",
"numpy.floor",
"numpy.max",
"numpy.exp",
"numpy.append",
"numpy.zeros",
"colicoords.synthetic_data.add_readout_noise",
"numpy.random.see... | [((4100, 4131), 'numpy.arange', 'np.arange', (['(step / 2)', 'xmax', 'step'], {}), '(step / 2, xmax, step)\n', (4109, 4131), True, 'import numpy as np\n'), ((4141, 4172), 'numpy.arange', 'np.arange', (['(step / 2)', 'ymax', 'step'], {}), '(step / 2, ymax, step)\n', (4150, 4172), True, 'import numpy as np\n'), ((4361, 4... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cv2
import numpy as np
def flow_to_img(flow, normalize=True):
"""Convert flow to viewable image, using color hue to encode flow vector orientation, and color saturation to
encode vector length. This is similar to the OpenCV tutorial on dense optical flow, e... | [
"cv2.normalize",
"numpy.where",
"numpy.any",
"numpy.zeros",
"numpy.isnan",
"cv2.cvtColor"
] | [((764, 823), 'numpy.zeros', 'np.zeros', (['(flow.shape[0], flow.shape[1], 3)'], {'dtype': 'np.uint8'}), '((flow.shape[0], flow.shape[1], 3), dtype=np.uint8)\n', (772, 823), True, 'import numpy as np\n'), ((1011, 1035), 'numpy.isnan', 'np.isnan', (['flow_magnitude'], {}), '(flow_magnitude)\n', (1019, 1035), True, 'impo... |
#!/usr/bin/env python
import chainer
from algs import trpo
from env_makers import EnvMaker
from models import GaussianMLPPolicy, MLPBaseline
from utils import SnapshotSaver
import numpy as np
import os
import logger
log_dir = "data/local/trpo-pendulum"
np.random.seed(42)
# Clean up existing logs
os.system("rm -rf {... | [
"models.GaussianMLPPolicy",
"env_makers.EnvMaker",
"models.MLPBaseline",
"numpy.random.seed",
"logger.session",
"utils.SnapshotSaver"
] | [((256, 274), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (270, 274), True, 'import numpy as np\n'), ((346, 369), 'logger.session', 'logger.session', (['log_dir'], {}), '(log_dir)\n', (360, 369), False, 'import logger\n'), ((387, 410), 'env_makers.EnvMaker', 'EnvMaker', (['"""Pendulum-v0"""'], {}),... |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.collections as mcoll
from matplotlib.ticker import MaxNLocator
plt.style.use('seaborn-darkgrid')
class BaseTraj:
def __init__(self, model, X):
self.model = model
assert len(X.shape) == 2, f"X should be 2... | [
"numpy.sqrt",
"matplotlib.collections.LineCollection",
"numpy.array",
"matplotlib.ticker.MaxNLocator",
"numpy.arctan2",
"matplotlib.pyplot.Normalize",
"numpy.asarray",
"matplotlib.pyplot.style.use",
"numpy.linspace",
"matplotlib.cm.ScalarMappable",
"numpy.vstack",
"numpy.concatenate",
"numpy... | [((158, 191), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-darkgrid"""'], {}), "('seaborn-darkgrid')\n", (171, 191), True, 'import matplotlib.pyplot as plt\n'), ((8329, 8351), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['"""copper"""'], {}), "('copper')\n", (8341, 8351), True, 'import matplotlib.py... |
import cv2
from cv2 import *
import numpy as np
from matplotlib import pyplot as plt
###############################SIFT MATCH Function#################################
def SIFTMATCH(img1,img2):
# Initiate SIFT detector
sift = cv2.xfeatures2d.SIFT_create()
# find the keypoints and descri... | [
"numpy.int32",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.xfeatures2d.SIFT_create",
"cv2.moveWindow",
"cv2.arcLength",
"cv2.contourArea",
"cv2.perspectiveTransform",
"cv2.waitKey",
"cv2.getTickFrequency",
"cv2.drawContours",
"cv2.findHomography",
"cv2.putText",
"cv2.circle",
"cv2.moment... | [((4277, 4295), 'cv2.getTickCount', 'cv2.getTickCount', ([], {}), '()\n', (4293, 4295), False, 'import cv2\n'), ((4792, 4818), 'cv2.imread', 'cv2.imread', (['"""Scene.jpg"""', '(0)'], {}), "('Scene.jpg', 0)\n", (4802, 4818), False, 'import cv2\n'), ((4869, 4894), 'cv2.imread', 'cv2.imread', (['"""img3.jpg"""', '(0)'], ... |
import dash
from dash.exceptions import PreventUpdate
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import dash_bootstrap_components as dbc
import dash_table
import plotly.express as ex
import plotly.graph_objects as go
import pandas as pd
imp... | [
"pandas.read_csv",
"dash.dependencies.Input",
"numpy.argsort",
"dash_html_components.Td",
"dash_bootstrap_components.Label",
"dash_html_components.Div",
"dash.Dash",
"dash_bootstrap_components.Tooltip",
"dash.dependencies.Output",
"dash_html_components.Span",
"numpy.asarray",
"dash_bootstrap_c... | [((345, 398), 'pandas.read_csv', 'pd.read_csv', (['"""./data/Phone_dataset_new.csv"""'], {'header': '(0)'}), "('./data/Phone_dataset_new.csv', header=0)\n", (356, 398), True, 'import pandas as pd\n'), ((409, 458), 'pandas.read_csv', 'pd.read_csv', (['"""./data/Phone_details.csv"""'], {'header': '(0)'}), "('./data/Phone... |
# %% [markdown]
# # Testing python-som with audio dataset
# %% [markdown]
# # Imports
# %%
import matplotlib.pyplot as plt
# import librosa as lr
# import librosa.display as lrdisp
import numpy as np
import pandas as pd
import pickle
import seaborn as sns
import sklearn.preprocessing
from python_som import SOM
FILE... | [
"pickle.dump",
"pandas.read_csv",
"seaborn.color_palette",
"seaborn.diverging_palette",
"pickle.load",
"seaborn.heatmap",
"matplotlib.pyplot.close",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.zeros",
"python_som.SOM",
"seaborn.barplot",
"seaborn.countplot",
"matplotlib.pyplot.draw",... | [((395, 455), 'pandas.read_csv', 'pd.read_csv', (['"""features_means.csv"""'], {'index_col': '(0)', 'verbose': '(True)'}), "('features_means.csv', index_col=0, verbose=True)\n", (406, 455), True, 'import pandas as pd\n'), ((467, 491), 'pandas.to_datetime', 'pd.to_datetime', (['df.index'], {}), '(df.index)\n', (481, 491... |
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
Description :
Author : cmy
date: 2020/1/2
-------------------------------------------------
"""
import datetime
import heapq
import numpy as np
import tensorflow as tf
import time
from metrics import ndcg_at_k
from tr... | [
"numpy.mean",
"train.get_user_record",
"numpy.random.choice",
"metrics.ndcg_at_k",
"tensorflow.Session",
"tensorflow.global_variables_initializer",
"heapq.nlargest",
"numpy.sum",
"datetime.datetime.now",
"DMF.DMF",
"tensorflow.ConfigProto",
"time.time",
"numpy.random.shuffle"
] | [((429, 445), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (443, 445), True, 'import tensorflow as tf\n'), ((766, 791), 'DMF.DMF', 'DMF', (['args', 'n_user', 'n_item'], {}), '(args, n_user, n_item)\n', (769, 791), False, 'from DMF import DMF\n'), ((870, 903), 'train.get_user_record', 'get_user_record',... |
# -*- coding: utf-8 -*-
"""
Sony Colourspaces
=================
Defines the *Sony* colourspaces:
- :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT`.
- :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT3`.
- :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT3_CINE`.
- :attr:`colour.models.RGB_COLOURSPACE_VENICE_S_GAMUT3`.
- ... | [
"numpy.array",
"colour.models.rgb.normalised_primary_matrix",
"colour.models.rgb.RGB_Colourspace",
"numpy.linalg.inv"
] | [((3760, 3813), 'numpy.array', 'np.array', (['[[0.73, 0.28], [0.14, 0.855], [0.1, -0.05]]'], {}), '([[0.73, 0.28], [0.14, 0.855], [0.1, -0.05]])\n', (3768, 3813), True, 'import numpy as np\n'), ((4273, 4421), 'numpy.array', 'np.array', (['[[0.7064827132, 0.1288010498, 0.1151721641], [0.2709796708, 0.7866064112, -\n ... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
import os
import pprint
import unittest
import numpy as np
# pyre-fixme[21]: Could not find module `pytest`.
import pytest
import torch
from parameterized import parameterized
from reagent.core.types import R... | [
"logging.getLogger",
"reagent.gym.utils.build_normalizer",
"reagent.gym.utils.fill_replay_buffer",
"torch.cuda.is_available",
"reagent.replay_memory.circular_replay_buffer.ReplayBuffer",
"unittest.main",
"torch.utils.tensorboard.SummaryWriter",
"numpy.mean",
"reagent.tensorboardX.summary_writer_cont... | [((1286, 1313), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1303, 1313), False, 'import logging\n'), ((2639, 2664), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (2654, 2664), False, 'import os\n'), ((2776, 2807), 'parameterized.parameterized.expand', 'para... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.