code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
Functions for explaining classifiers that use tabular data (matrices).
"""
import collections
import json
import copy
import numpy as np
import sklearn
import sklearn.preprocessing
from . import lime_base
from . import explanation
class TableDomainMapper(explanation.DomainMapper):
"""Maps feature ids to names,... | [
"numpy.random.normal",
"numpy.mean",
"numpy.random.choice",
"numpy.searchsorted",
"numpy.std",
"json.dumps",
"numpy.min",
"numpy.max",
"sklearn.preprocessing.StandardScaler",
"numpy.sum",
"numpy.zeros",
"numpy.array",
"collections.defaultdict",
"numpy.exp",
"numpy.argsort",
"copy.deepc... | [((2727, 2750), 'json.dumps', 'json.dumps', (['show_scaled'], {}), '(show_scaled)\n', (2737, 2750), False, 'import json\n'), ((7312, 7365), 'sklearn.preprocessing.StandardScaler', 'sklearn.preprocessing.StandardScaler', ([], {'with_mean': '(False)'}), '(with_mean=False)\n', (7348, 7365), False, 'import sklearn\n'), ((1... |
import os
import numpy as np
import pandas as pd
from databroker.assets.handlers_base import HandlerBase
class APBBinFileHandler(HandlerBase):
"Read electrometer *.bin files"
def __init__(self, fpath):
# It's a text config file, which we don't store in the resources yet, parsing for now
fpat... | [
"pandas.DataFrame",
"numpy.fromfile",
"os.path.splitext",
"numpy.zeros"
] | [((892, 926), 'numpy.fromfile', 'np.fromfile', (['fpath'], {'dtype': 'np.int32'}), '(fpath, dtype=np.int32)\n', (903, 926), True, 'import numpy as np\n'), ((1187, 1239), 'numpy.zeros', 'np.zeros', (['(raw_data.shape[0], raw_data.shape[1] - 1)'], {}), '((raw_data.shape[0], raw_data.shape[1] - 1))\n', (1195, 1239), True,... |
import numpy as np
import pandas as pd
import sys
import re
# question type definition
S = 0 # [S, col, corr [,rate]]
MS = 1 # [MS, [cols,..], [corr,..] [,rate]]
Num = 2 # [Num, [cols,..], [corr,..] [,rate]]
SS = 3 # [SS, [start,end], [corr,...] [,rate]]
# the list of question type and reference
# [type, column, ... | [
"pandas.read_csv",
"re.compile",
"argparse.ArgumentParser",
"pandas.merge",
"numpy.sort",
"numpy.zeros",
"pandas.concat"
] | [((9321, 9347), 're.compile', 're.compile', (['""".*学群(.+学類).*"""'], {}), "('.*学群(.+学類).*')\n", (9331, 9347), False, 'import re\n'), ((2271, 2309), 'numpy.zeros', 'np.zeros', (['num_squestions'], {'dtype': 'np.int'}), '(num_squestions, dtype=np.int)\n', (2279, 2309), True, 'import numpy as np\n'), ((4017, 4055), 'numpy... |
"""Generalized Gell-Mann matrices."""
from typing import Union
from scipy import sparse
import numpy as np
def gen_gell_mann(
ind_1: int, ind_2: int, dim: int, is_sparse: bool = False
) -> Union[np.ndarray, sparse.lil_matrix]:
r"""
Produce a generalized Gell-Mann operator [WikGM2]_.
Construct a :cod... | [
"scipy.sparse.lil_matrix",
"numpy.sqrt",
"numpy.ones",
"scipy.sparse.eye",
"numpy.append",
"numpy.zeros"
] | [((2791, 2820), 'scipy.sparse.lil_matrix', 'sparse.lil_matrix', (['(dim, dim)'], {}), '((dim, dim))\n', (2808, 2820), False, 'from scipy import sparse\n'), ((2437, 2452), 'scipy.sparse.eye', 'sparse.eye', (['dim'], {}), '(dim)\n', (2447, 2452), False, 'from scipy import sparse\n'), ((2488, 2522), 'numpy.sqrt', 'np.sqrt... |
import matplotlib.widgets as mwidgets
class Slider(mwidgets.Slider):
"""Slider widget to select a value from a floating point range.
Parameters
----------
ax : :class:`~matplotlib.axes.Axes` instance
The parent axes for the widget
value_range : (float, float)
(min, max) value allo... | [
"numpy.sin",
"matplotlib.widgets.AxesWidget.__init__",
"matplotlib.pyplot.subplot2grid",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((3822, 3866), 'matplotlib.pyplot.subplot2grid', 'plt.subplot2grid', (['(10, 1)', '(0, 0)'], {'rowspan': '(8)'}), '((10, 1), (0, 0), rowspan=8)\n', (3838, 3866), True, 'import matplotlib.pyplot as plt\n'), ((3883, 3916), 'matplotlib.pyplot.subplot2grid', 'plt.subplot2grid', (['(10, 1)', '(9, 0)'], {}), '((10, 1), (9, ... |
# -*- coding: utf-8 -*-
from __future__ import print_function,division,absolute_import
import logging
log = logging.getLogger(__name__) # __name__ is "foo.bar" here
import numpy as np
import numbers
np.seterr(all='ignore')
def findSlice(array,lims):
start = np.ravel(np.argwhere(array>lims[0]))[0]
stop = np.rav... | [
"logging.getLogger",
"numpy.abs",
"numpy.digitize",
"numpy.asarray",
"numpy.squeeze",
"numpy.argwhere",
"numpy.nanmax",
"numpy.argmin",
"dualtree.dualtree.baseline",
"numpy.gradient",
"numpy.seterr"
] | [((109, 136), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (126, 136), False, 'import logging\n'), ((202, 225), 'numpy.seterr', 'np.seterr', ([], {'all': '"""ignore"""'}), "(all='ignore')\n", (211, 225), True, 'import numpy as np\n'), ((815, 833), 'numpy.asarray', 'np.asarray', (['value... |
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
m_f = np.load('objects/simulation_model_freq.npy')[:50]
m_p = np.load('objects/simulation_model_power.npy')[:50]
eeg_f = np.load('objects/real_eeg_freq.npy0.npy')[:50]
eeg_p = np.load('objects/real_eeg_power_0.npy')[:50]
plt.figure()
plt.se... | [
"matplotlib.pyplot.semilogy",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"numpy.load",
"matplotlib.pyplot.show"
] | [((53, 76), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (66, 76), True, 'import matplotlib.pyplot as plt\n'), ((301, 313), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (311, 313), True, 'import matplotlib.pyplot as plt\n'), ((314, 362), 'matplotlib.pyplot.semil... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | [
"numpy.ma.max",
"astropy.stats.sigma_clip",
"numpy.log",
"numpy.array",
"copy.deepcopy",
"numpy.ma.masked_array",
"astropy.stats.sigma_clipped_stats",
"numpy.zeros_like"
] | [((1256, 1309), 'astropy.stats.sigma_clip', 'sigma_clip', (['data'], {'sigma': 'sigma', 'iters': 'None', 'copy': '(False)'}), '(data, sigma=sigma, iters=None, copy=False)\n', (1266, 1309), False, 'from astropy.stats import sigma_clip, sigma_clipped_stats\n'), ((1979, 2042), 'astropy.stats.sigma_clip', 'sigma_clip', (['... |
import sys
import numpy as np
from skimage.measure import label
def getSegType(mid):
m_type = np.uint64
if mid<2**8:
m_type = np.uint8
elif mid<2**16:
m_type = np.uint16
elif mid<2**32:
m_type = np.uint32
return m_type
def seg2Count(seg,do_sort=True,rm_zero=False):
sm =... | [
"numpy.unique",
"numpy.minimum",
"numpy.hstack",
"numpy.where",
"numpy.in1d",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.count_nonzero",
"numpy.stack",
"numpy.vstack",
"skimage.measure.label",
"numpy.maximum",
"sys.stdout.flush",
"numpy.arange"
] | [((2022, 2049), 'numpy.zeros', 'np.zeros', (['mid'], {'dtype': 'm_type'}), '(mid, dtype=m_type)\n', (2030, 2049), True, 'import numpy as np\n'), ((2348, 2365), 'numpy.where', 'np.where', (['(seg > 0)'], {}), '(seg > 0)\n', (2356, 2365), True, 'import numpy as np\n'), ((6322, 6371), 'numpy.zeros', 'np.zeros', (['(1 + um... |
"""
LFW dataloading
"""
import argparse
import time
import numpy as np
import torch
from PIL import Image
from torch.utils.data import DataLoader, Dataset
from torchvision import transforms
import os
import glob
import matplotlib.pyplot as plt
class LFWDataset(Dataset):
def __init__(self, path_to_folder: str, tr... | [
"numpy.mean",
"PIL.Image.open",
"matplotlib.pyplot.savefig",
"torchvision.transforms.RandomAffine",
"argparse.ArgumentParser",
"numpy.std",
"matplotlib.pyplot.axis",
"numpy.array",
"matplotlib.pyplot.figure",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.title",
"torchvision.transforms.ToT... | [((1044, 1069), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1067, 1069), False, 'import argparse\n'), ((1762, 1859), 'torch.utils.data.DataLoader', 'DataLoader', (['dataset'], {'batch_size': 'args.batch_size', 'shuffle': '(False)', 'num_workers': 'args.num_workers'}), '(dataset, batch_size=... |
import numpy as np
import pytest
from rsgeo.geometry import Polygon # noqa
class TestPolygon:
def setup_method(self):
self.p = Polygon([(0, 0), (1, 1), (1, 0), (0, 0)])
def test_repr(self):
str_repr = str(self.p)
exp = "Polygon([(0, 0), (1, 1), (1, 0), (0, 0)])"
assert str_r... | [
"numpy.testing.assert_array_equal",
"numpy.array",
"pytest.raises",
"rsgeo.geometry.Polygon"
] | [((143, 184), 'rsgeo.geometry.Polygon', 'Polygon', (['[(0, 0), (1, 1), (1, 0), (0, 0)]'], {}), '([(0, 0), (1, 1), (1, 0), (0, 0)])\n', (150, 184), False, 'from rsgeo.geometry import Polygon\n'), ((922, 969), 'numpy.testing.assert_array_equal', 'np.testing.assert_array_equal', (['result', 'expected'], {}), '(result, exp... |
import numpy as np
from sim.sim2d import sim_run
# Simulator options.
options = {}
options['FIG_SIZE'] = [8,8]
options['OBSTACLES'] = True
class ModelPredictiveControl:
def __init__(self):
self.horizon = 20
self.dt = 0.2
# Reference or set point the controller will achieve.
self.r... | [
"numpy.sqrt",
"numpy.tan",
"sim.sim2d.sim_run",
"numpy.cos",
"numpy.sin"
] | [((1671, 1711), 'sim.sim2d.sim_run', 'sim_run', (['options', 'ModelPredictiveControl'], {}), '(options, ModelPredictiveControl)\n', (1678, 1711), False, 'from sim.sim2d import sim_run\n'), ((1370, 1412), 'numpy.sqrt', 'np.sqrt', (['(obs_dist_x ** 2 + obs_dist_y ** 2)'], {}), '(obs_dist_x ** 2 + obs_dist_y ** 2)\n', (13... |
import numpy as np
import random
import cv2
import os
import json
from csv_utils import load_csv
import rect
import mask
def plot_one_box(x, img, color=None, label=None, line_thickness=None):
"""
description: Plots one bounding box on image img,
this function comes from YoLov5 project.
ar... | [
"cv2.rectangle",
"cv2.imwrite",
"argparse.ArgumentParser",
"os.makedirs",
"cv2.polylines",
"csv_utils.load_csv",
"os.path.join",
"cv2.putText",
"os.path.isfile",
"os.path.isdir",
"numpy.min",
"json.load",
"cv2.getTextSize",
"cv2.imread",
"random.randint"
] | [((882, 951), 'cv2.rectangle', 'cv2.rectangle', (['img', 'c1', 'c2', 'color'], {'thickness': 'tl', 'lineType': 'cv2.LINE_AA'}), '(img, c1, c2, color, thickness=tl, lineType=cv2.LINE_AA)\n', (895, 951), False, 'import cv2\n'), ((2169, 2236), 'cv2.polylines', 'cv2.polylines', (['img', '[pts]'], {'isClosed': '(True)', 'co... |
""" This is a modified version of simple.py script bundled with Read Until API"""
import argparse
import logging
import sys
import traceback
import time
import numpy
import read_until
import cffi
import os
import h5py
import glob
import concurrent.futures
import dyss
def _get_parser():
parser = argparse.ArgumentPa... | [
"logging.getLogger",
"logging.basicConfig",
"argparse.ArgumentParser",
"dyss.Dyss",
"time.sleep",
"read_until.ReadUntilClient",
"numpy.fromstring",
"time.time"
] | [((301, 390), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Dyss -- a tiny program for selective sequencing on MinION"""'], {}), "(\n 'Dyss -- a tiny program for selective sequencing on MinION')\n", (324, 390), False, 'import argparse\n'), ((3065, 3090), 'logging.getLogger', 'logging.getLogger', (['"""... |
import numpy as np
import xarray as xr
from numpy import asarray
import scipy.sparse
from itertools import product
from .util import get_shape_of_data
from .grid_stretching_transforms import scs_transform
from .constants import R_EARTH_m
def get_troposphere_mask(ds):
"""
Returns a mask array for picking out t... | [
"numpy.sqrt",
"numpy.array",
"numpy.arctan2",
"numpy.sin",
"numpy.arange",
"numpy.flip",
"numpy.cross",
"numpy.sort",
"itertools.product",
"numpy.asarray",
"numpy.max",
"numpy.linspace",
"numpy.min",
"numpy.rad2deg",
"numpy.round",
"numpy.abs",
"numpy.size",
"numpy.squeeze",
"num... | [((13666, 14423), 'numpy.array', 'np.array', (['[0.0, 0.04804826, 6.593752, 13.1348, 19.61311, 26.09201, 32.57081, 38.98201,\n 45.33901, 51.69611, 58.05321, 64.36264, 70.62198, 78.83422, 89.09992, \n 99.36521, 109.1817, 118.9586, 128.6959, 142.91, 156.26, 169.609, \n 181.619, 193.097, 203.259, 212.15, 218.776,... |
#! /usr/bin/env python
"""
InstrumentData Class -- defines data format, wavelength info, mask geometry
Instruments/masks supported:
NIRISS AMI
GPI, VISIR, NIRC2 removed - too much changed for the JWST NIRISS class
"""
# Standard Imports
import numpy as np
from astropy.io import fits
import os, sys, time
import copy
... | [
"numpy.random.normal",
"nrm_analysis.misctools.utils.get_src_spec",
"nrm_analysis.misctools.mask_definitions.NRM_mask_definitions",
"nrm_analysis.misctools.utils.Affine2d",
"nrm_analysis.misctools.utils.get_filt_spec",
"sys.exit",
"nrm_analysis.misctools.utils.combine_src_filt",
"numpy.linalg.norm",
... | [((6375, 6409), 'nrm_analysis.misctools.utils.get_cw_beta', 'utils.get_cw_beta', (['self.throughput'], {}), '(self.throughput)\n', (6392, 6409), False, 'from nrm_analysis.misctools import utils\n'), ((7371, 7469), 'nrm_analysis.misctools.mask_definitions.NRM_mask_definitions', 'NRM_mask_definitions', ([], {'maskname': ... |
# load .t7 file and save as .pkl data
import torchfile
import cv2
import numpy as np
import scipy.io as sio
import pickle
import time
data_path = './data/test_PC/'
# panoContext
#img_tr = torchfile.load('./data/panoContext_img_train.t7')
#print(img_tr.shape)
#lne_tr = torchfile.load('./data/panoContext_line_train.t7... | [
"numpy.where",
"torchfile.load",
"numpy.array",
"numpy.loadtxt",
"numpy.transpose"
] | [((870, 918), 'torchfile.load', 'torchfile.load', (['"""./data/panoContext_img_test.t7"""'], {}), "('./data/panoContext_img_test.t7')\n", (884, 918), False, 'import torchfile\n'), ((948, 997), 'torchfile.load', 'torchfile.load', (['"""./data/panoContext_line_test.t7"""'], {}), "('./data/panoContext_line_test.t7')\n", (... |
#
# BSD 3-Clause License
#
# Copyright (c) 2022 University of Wisconsin - Madison
# 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 copyrig... | [
"numpy.array",
"numpy.linalg.norm",
"rclpy.init",
"numpy.delete",
"numpy.asarray",
"ament_index_python.packages.get_package_share_directory",
"numpy.linspace",
"scipy.interpolate.splev",
"numpy.argmin",
"rclpy.shutdown",
"matplotlib.patches.Circle",
"numpy.abs",
"matplotlib.use",
"matplotl... | [((8571, 8592), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (8581, 8592), False, 'import rclpy\n'), ((8630, 8649), 'rclpy.spin', 'rclpy.spin', (['planner'], {}), '(planner)\n', (8640, 8649), False, 'import rclpy\n'), ((8681, 8697), 'rclpy.shutdown', 'rclpy.shutdown', ([], {}), '()\n', (8695, 86... |
from __future__ import absolute_import
import os.path
import argparse
import logging
import json
from six import iteritems
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.externals import joblib
from keras.models import load_model
from tensorflow.python.client import device_lib
f... | [
"preprocessing.split_data",
"logging.getLogger",
"tensorflow.python.client.device_lib.list_local_devices",
"utils.load_data",
"numpy.array",
"models.CatBoost",
"preprocessing.clean_text",
"argparse.ArgumentParser",
"json.dumps",
"metrics.get_metrics",
"features.catboost_features",
"utils.embed... | [((697, 903), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""-f TRAIN_FILE -t TEST_FILE -o OUTPUT_FILE -e EMBEDS_FILE [-l LOGGER_FILE] [--swear-words SWEAR_FILE] [--wrong-words WRONG_WORDS_FILE] [--format-embeds FALSE]"""'}), "(description=\n '-f TRAIN_FILE -t TEST_FILE -o OUTPUT_FILE... |
#!/usr/bin/env python
#import standard libraries
import obspy.imaging.beachball
import datetime
import os
import csv
import pandas as pd
import numpy as np
import fnmatch
from geopy.distance import geodesic
from math import *
#from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from matplotlib imp... | [
"pandas.read_csv",
"pandas.datetime.strptime",
"numpy.isfinite",
"datetime.timedelta",
"numpy.arange",
"pandas.to_datetime",
"datetime.datetime",
"matplotlib.path.Path",
"numpy.dot",
"fnmatch.fnmatch",
"numpy.vstack",
"pandas.DataFrame",
"csv.reader",
"numpy.size",
"os.path.isfile",
"n... | [((12234, 12263), 'datetime.datetime', 'datetime.datetime', (['(1900)', '(1)', '(1)'], {}), '(1900, 1, 1)\n', (12251, 12263), False, 'import datetime\n'), ((12274, 12300), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (12298, 12300), False, 'import datetime\n'), ((15450, 15469), 'numpy.size'... |
import numpy as np
import matplotlib.pyplot as plt
import math
from scipy.optimize import linprog
from cvxpy import *
class CuttingPlaneModel:
def __init__(self, dim, bounds):
self.dim = dim
self.bounds = bounds
self.coefficients = np.empty((0,dim+1))
def __call__(self, x):#REMOVE
... | [
"numpy.abs",
"numpy.eye",
"numpy.multiply",
"numpy.hstack",
"matplotlib.pyplot.colorbar",
"numpy.asarray",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.append",
"matplotlib.pyplot.contour",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.empty",
"test_function.TestFunction",
"matpl... | [((261, 283), 'numpy.empty', 'np.empty', (['(0, dim + 1)'], {}), '((0, dim + 1))\n', (269, 283), True, 'import numpy as np\n'), ((501, 554), 'numpy.asarray', 'np.asarray', (['[[c[1], c[2]] for c in self.coefficients]'], {}), '([[c[1], c[2]] for c in self.coefficients])\n', (511, 554), True, 'import numpy as np\n'), ((6... |
from gekko import GEKKO
import numpy as np
import matplotlib.pyplot as plt
# generate training data
x = np.linspace(0.0,2*np.pi,20)
y = np.sin(x)
# option for fitting function
select = True # True / False
if select:
# Size with cosine function
nin = 1 # inputs
n1 = 1 # hidden layer 1 (linear)
n2 ... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"gekko.GEKKO",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.sin",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((107, 138), 'numpy.linspace', 'np.linspace', (['(0.0)', '(2 * np.pi)', '(20)'], {}), '(0.0, 2 * np.pi, 20)\n', (118, 138), True, 'import numpy as np\n'), ((139, 148), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (145, 148), True, 'import numpy as np\n'), ((660, 667), 'gekko.GEKKO', 'GEKKO', ([], {}), '()\n', (665, 66... |
import argparse
import os
import sys
import numpy as np
import pdb
from tqdm import tqdm
import cv2
import glob
import numpy as np
from numpy import *
import matplotlib
#matplotlib.use("Agg")
#matplotlib.use("wx")
#matplotlib.use('tkagg')
import matplotlib.pyplot as plt
import scipy
from scipy.special import softmax
... | [
"modeling.sync_batchnorm.replicate.patch_replication_callback",
"numpy.mean",
"PIL.Image.open",
"numpy.logical_and",
"argparse.ArgumentParser",
"torch.load",
"numpy.bitwise_xor",
"numpy.logical_or",
"numpy.subtract",
"torch.nn.DataParallel",
"torch.from_numpy",
"numpy.sum",
"numpy.array",
... | [((1440, 1463), 'torch.load', 'torch.load', (['args.resume'], {}), '(args.resume)\n', (1450, 1463), False, 'import torch\n'), ((1961, 1990), 'numpy.expand_dims', 'np.expand_dims', (['image'], {'axis': '(0)'}), '(image, axis=0)\n', (1975, 1990), True, 'import numpy as np\n'), ((2333, 2360), 'numpy.logical_or', 'np.logic... |
import numpy as np
from scipy.integrate import odeint
class MorrisLecar:
"""
Creates a MorrisLecar model.
"""
def __init__(self, C=20, VL=-60, VCa=120, VK=-84, gL=2, gCa=4, gK=8,
V1=-1.2, V2=18, V3=12, V4=17.4, phi=0.06):
"""
Initializes the model.
Args:
... | [
"scipy.integrate.odeint",
"numpy.tanh",
"numpy.cosh",
"numpy.arange"
] | [((2678, 2707), 'numpy.arange', 'np.arange', (['(0)', 'self.t', 'self.dt'], {}), '(0, self.t, self.dt)\n', (2687, 2707), True, 'import numpy as np\n'), ((2720, 2777), 'scipy.integrate.odeint', 'odeint', (['self._system_equations', 'X0', 'self.tvec', '(current,)'], {}), '(self._system_equations, X0, self.tvec, (current,... |
import logging
import numpy as np
from .transformer import Transformer, FFTTransformer
logger = logging.getLogger(__name__)
class MapScaler:
def __init__(self, xmap, scattering='xray'):
self.xmap = xmap
self.scattering = scattering
self._model_map = xmap.zeros_like(xmap)
def subtr... | [
"logging.getLogger",
"numpy.dot"
] | [((99, 126), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (116, 126), False, 'import logging\n'), ((1942, 1975), 'numpy.dot', 'np.dot', (['model_masked', 'xmap_masked'], {}), '(model_masked, xmap_masked)\n', (1948, 1975), True, 'import numpy as np\n'), ((1989, 2021), 'numpy.dot', 'np.do... |
from robot.thymio_robot import ThymioII
from robot.vrep_robot import VrepRobot
from aseba.aseba import Aseba
from utility.util_functions import normalize
import numpy as np
T_SEN_MIN = 0
T_SEN_MAX = 4500
class EvolvedRobot(VrepRobot, ThymioII):
def __init__(self, name, client_id, id, op_mode, chromosome, robot_... | [
"numpy.array",
"robot.vrep_robot.VrepRobot.__init__",
"utility.util_functions.normalize",
"robot.thymio_robot.ThymioII.__init__"
] | [((335, 395), 'robot.vrep_robot.VrepRobot.__init__', 'VrepRobot.__init__', (['self', 'client_id', 'id', 'op_mode', 'robot_type'], {}), '(self, client_id, id, op_mode, robot_type)\n', (353, 395), False, 'from robot.vrep_robot import VrepRobot\n'), ((404, 433), 'robot.thymio_robot.ThymioII.__init__', 'ThymioII.__init__',... |
#
# 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... | [
"datetime.datetime",
"numpy.abs",
"nomad.datamodel.metainfo.simulation.method.BasisSet",
"os.path.isfile",
"numpy.array",
"os.path.dirname",
"nomad.datamodel.metainfo.simulation.system.Atoms",
"nomad.parsing.file_parser.Quantity"
] | [((2539, 2557), 'os.path.isfile', 'path.isfile', (['fname'], {}), '(fname)\n', (2550, 2557), False, 'from os import path\n'), ((4514, 4532), 'os.path.isfile', 'path.isfile', (['fname'], {}), '(fname)\n', (4525, 4532), False, 'from os import path\n'), ((7185, 7199), 'numpy.array', 'np.array', (['coxp'], {}), '(coxp)\n',... |
import numpy as np
MAX = 10000
matrix = np.full((MAX, MAX), False)
def pretty_print(matrix):
print_matrix = np.full(matrix.shape, ".")
print_matrix[matrix] = "#"
for row in print_matrix:
for symb in row:
print(symb, end="")
print()
def fold_once(matrix, axis, value):
if ... | [
"numpy.full",
"numpy.logical_or"
] | [((41, 67), 'numpy.full', 'np.full', (['(MAX, MAX)', '(False)'], {}), '((MAX, MAX), False)\n', (48, 67), True, 'import numpy as np\n'), ((115, 141), 'numpy.full', 'np.full', (['matrix.shape', '"""."""'], {}), "(matrix.shape, '.')\n", (122, 141), True, 'import numpy as np\n'), ((502, 559), 'numpy.logical_or', 'np.logica... |
# 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, ... | [
"argparse.ArgumentParser",
"cv2.threshold",
"cv2.HoughCircles",
"cv2.imshow",
"cv2.waitKey",
"cv2.circle",
"cv2.destroyAllWindows",
"numpy.around",
"cv2.cvtColor",
"cv2.GaussianBlur",
"cv2.imread"
] | [((632, 657), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (655, 657), False, 'import argparse\n'), ((733, 758), 'cv2.imread', 'cv2.imread', (['args.filename'], {}), '(args.filename)\n', (743, 758), False, 'import cv2\n'), ((766, 802), 'cv2.cvtColor', 'cv2.cvtColor', (['im', 'cv2.COLOR_BGR2GR... |
from itertools import combinations
import numpy as np
from PlanningCore.core.constants import State
from PlanningCore.core.physics import (
ball_ball_collision,
ball_cushion_collision,
cue_strike,
evolve_ball_motion,
get_ball_ball_collision_time,
get_ball_cushion_collision_time,
get_roll_t... | [
"PlanningCore.core.utils.get_rel_velocity",
"numpy.all",
"PlanningCore.core.physics.get_ball_cushion_collision_time",
"PlanningCore.core.physics.get_ball_ball_collision_time",
"PlanningCore.core.physics.get_roll_time",
"PlanningCore.core.physics.evolve_ball_motion",
"PlanningCore.core.physics.get_slide_... | [((7095, 7130), 'PlanningCore.core.physics.cue_strike', 'cue_strike', (['v_cue', 'phi', 'theta', 'a', 'b'], {}), '(v_cue, phi, theta, a, b)\n', (7105, 7130), False, 'from PlanningCore.core.physics import ball_ball_collision, ball_cushion_collision, cue_strike, evolve_ball_motion, get_ball_ball_collision_time, get_ball_... |
"""
The :mod:`fatf.utils.models.models` module holds custom models.
The models implemented in this module are mainly used for used for
FAT Forensics package testing and the examples in the documentation.
"""
# Author: <NAME> <<EMAIL>>
# License: new BSD
import abc
from typing import Optional
import numpy as np
imp... | [
"fatf.exceptions.IncorrectShapeError",
"fatf.exceptions.UnfittedModelError",
"fatf.utils.array.validation.is_structured_array",
"numpy.argsort",
"fatf.utils.array.validation.is_1d_array",
"numpy.array",
"fatf.utils.array.validation.is_2d_array",
"fatf.exceptions.PrefittedModelError",
"numpy.where",
... | [((6935, 6953), 'numpy.ndarray', 'np.ndarray', (['(0, 0)'], {}), '((0, 0))\n', (6945, 6953), True, 'import numpy as np\n'), ((7004, 7020), 'numpy.ndarray', 'np.ndarray', (['(0,)'], {}), '((0,))\n', (7014, 7020), True, 'import numpy as np\n'), ((7105, 7121), 'numpy.ndarray', 'np.ndarray', (['(0,)'], {}), '((0,))\n', (71... |
import cv2
import numpy as np
import sys
import haar_cascade as cascade
from datetime import datetime
import os.path
output_dir = "../images"
class SmileDetectStatus:
def __init__(self):
self.begin_take_photo = False
self.face_found = False
self.smile_detected = False
self.restart ... | [
"cv2.rectangle",
"numpy.copy",
"cv2.imwrite",
"cv2.flip",
"cv2.imshow",
"haar_cascade.detect_faces",
"datetime.datetime.now",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"sys.exit",
"haar_cascade.detect_mouth",
"cv2.waitKey",
"haar_cascade.detect_eyes"
] | [((3573, 3592), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (3589, 3592), False, 'import cv2\n'), ((645, 661), 'cv2.flip', 'cv2.flip', (['img', '(1)'], {}), '(img, 1)\n', (653, 661), False, 'import cv2\n'), ((687, 709), 'numpy.copy', 'np.copy', (['self.captured'], {}), '(self.captured)\n', (694, 709... |
import logging
import time
from torch.utils.data import DataLoader
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
import torch
import torch.nn.functional as functional
import numpy as np
from DTI import models, dataset, cli, utils, analyse
import os
device = torch.device('cuda:0... | [
"logging.getLogger",
"os.path.exists",
"logging.basicConfig",
"DTI.dataset.get_hcp_s1200",
"DTI.models.HARmodel",
"torch.nn.CrossEntropyLoss",
"DTI.utils.setup_seed",
"torch.load",
"numpy.append",
"torch.cuda.is_available",
"DTI.analyse.analyse_3class",
"DTI.cli.create_parser",
"torch.utils.... | [((381, 401), 'DTI.utils.setup_seed', 'utils.setup_seed', (['(18)'], {}), '(18)\n', (397, 401), False, 'from DTI import models, dataset, cli, utils, analyse\n'), ((419, 430), 'time.time', 'time.time', ([], {}), '()\n', (428, 430), False, 'import time\n'), ((615, 747), 'torch.utils.data.DataLoader', 'DataLoader', (['tra... |
import numpy as np
from io import BytesIO
import wave
import struct
from dcase_models.util.gui import encode_audio
#from .utils import save_model_weights,save_model_json, get_data_train, get_data_test
#from .utils import init_model, evaluate_model, load_scaler, save, load
#from .model import debugg_model, pr... | [
"dash_html_components.Button",
"dcase_models.util.files.save_pickle",
"numpy.array",
"plotly.graph_objects.layout.Title",
"dash_audio_components.DashAudioComponents",
"dash_html_components.Div",
"librosa.core.load",
"dash_html_components.Br",
"plotly.graph_objects.Scatter",
"numpy.argmin",
"plot... | [((1746, 1769), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['"""viridis"""'], {}), "('viridis')\n", (1758, 1769), True, 'import matplotlib.pyplot as plt\n'), ((4152, 4181), 'plotly.subplots.make_subplots', 'make_subplots', ([], {'rows': '(1)', 'cols': '(1)'}), '(rows=1, cols=1)\n', (4165, 4181), False, 'from plotly... |
import numpy as np
import matplotlib.pyplot as plt
# documentation
# https://matplotlib.org/3.1.3/api/pyplot_summary.html
# scatter plot
x = np.random.randint(100, size=(100))
y = np.random.randint(100, size=(100))
plt.scatter(x, y, c='tab:blue', label='stuff')
plt.legend(loc=2)
# plt.show()
# line plot
x = np.a... | [
"numpy.random.normal",
"matplotlib.pyplot.xticks",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.array",
"numpy.random.randint",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.leg... | [((145, 177), 'numpy.random.randint', 'np.random.randint', (['(100)'], {'size': '(100)'}), '(100, size=100)\n', (162, 177), True, 'import numpy as np\n'), ((184, 216), 'numpy.random.randint', 'np.random.randint', (['(100)'], {'size': '(100)'}), '(100, size=100)\n', (201, 216), True, 'import numpy as np\n'), ((219, 265)... |
from . import core
import io
import re
import requests
import pytz
import time
import datetime as dt
import dateutil.parser as du
import numpy as np
import pandas as pd
from typing import Tuple, Dict, List, Union, ClassVar, Any, Optional, Type
import types
class ... | [
"datetime.datetime.utcfromtimestamp",
"requests.cookies.cookiejar_from_dict",
"dateutil.parser.isoparse",
"re.compile",
"time.sleep",
"requests.get",
"datetime.datetime.now",
"numpy.array",
"pandas.DataFrame",
"io.StringIO"
] | [((12645, 12704), 'requests.get', 'requests.get', (['"""https://finance.yahoo.com/quote/SPY/history"""'], {}), "('https://finance.yahoo.com/quote/SPY/history')\n", (12657, 12704), False, 'import requests\n'), ((12733, 12792), 'requests.cookies.cookiejar_from_dict', 'requests.cookies.cookiejar_from_dict', (["{'B': r.coo... |
import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy
from ..measure import ConditionedLognormalSampler
class ScalarImage:
"""
Class containing a scalar image.
"""
def __init__(self, height=1000, width=1000):
""" Instantiate scalar image with shape (<height>, <width>).... | [
"numpy.zeros",
"numpy.log",
"matplotlib.pyplot.subplots",
"copy.deepcopy"
] | [((1067, 1120), 'numpy.zeros', 'np.zeros', (['(self.height, self.width)'], {'dtype': 'np.float64'}), '((self.height, self.width), dtype=np.float64)\n', (1075, 1120), True, 'import numpy as np\n'), ((3047, 3059), 'copy.deepcopy', 'deepcopy', (['xy'], {}), '(xy)\n', (3055, 3059), False, 'from copy import deepcopy\n'), ((... |
from ...Renderer.Buffer import VertexBuffer, IndexBuffer, BufferLayout
from OpenGL.GL import glGenBuffers, glBufferData, glDeleteBuffers, glBindBuffer, glBufferSubData
from OpenGL.GL import GL_ARRAY_BUFFER, GL_STATIC_DRAW, GL_ELEMENT_ARRAY_BUFFER, GL_DYNAMIC_DRAW
import ctypes
import numpy as np
from multipledispatch... | [
"OpenGL.GL.glBufferData",
"OpenGL.GL.glGenBuffers",
"numpy.array",
"numpy.zeros",
"multipledispatch.dispatch",
"ctypes.c_void_p",
"OpenGL.GL.glBindBuffer",
"OpenGL.GL.glDeleteBuffers"
] | [((451, 465), 'multipledispatch.dispatch', 'dispatch', (['list'], {}), '(list)\n', (459, 465), False, 'from multipledispatch import dispatch\n'), ((815, 828), 'multipledispatch.dispatch', 'dispatch', (['int'], {}), '(int)\n', (823, 828), False, 'from multipledispatch import dispatch\n'), ((545, 581), 'numpy.array', 'np... |
import numpy as np
import cv2
from semantic_segmentation.data_structure.image_handler import ImageHandler
class Preprocessor:
def __init__(self, image_size):
self.image_size = image_size
self.min_height = 16
self.min_width = 16
self.max_height = 900
self.max_width = 900
... | [
"numpy.mean",
"numpy.reshape",
"numpy.ones",
"semantic_segmentation.data_structure.image_handler.ImageHandler",
"numpy.max",
"numpy.zeros",
"numpy.expand_dims",
"numpy.min",
"numpy.var"
] | [((389, 408), 'semantic_segmentation.data_structure.image_handler.ImageHandler', 'ImageHandler', (['image'], {}), '(image)\n', (401, 408), False, 'from semantic_segmentation.data_structure.image_handler import ImageHandler\n'), ((687, 701), 'numpy.mean', 'np.mean', (['image'], {}), '(image)\n', (694, 701), True, 'impor... |
import numpy as np
def compute_intensity(pos, pos_list, radius):
return (norm(np.array(pos_list) - np.array(pos), axis=1) < radius).sum()
def compute_colours(all_pos):
colours = [compute_intensity(pos, all_pos, 1e-4) for pos in all_pos]
colours /= max(colours)
return colours
| [
"numpy.array"
] | [((84, 102), 'numpy.array', 'np.array', (['pos_list'], {}), '(pos_list)\n', (92, 102), True, 'import numpy as np\n'), ((105, 118), 'numpy.array', 'np.array', (['pos'], {}), '(pos)\n', (113, 118), True, 'import numpy as np\n')] |
__author__ = "<NAME>"
__email__ = "<EMAIL>"
""" Baseline parallel BFS implementation.
Algorithm 1 Parallel BFS algorithm: High-level overview [1] was implemented.
Reference:
[1] https://www.researchgate.net/publication/220782745_Scalable_Graph_Exploration_on_Multicore_Processors
"""
import n... | [
"multiprocessing.cpu_count",
"src.load_graph.gen_balanced_tree",
"functools.partial",
"multiprocessing.Pool",
"numpy.concatenate",
"time.time"
] | [((1822, 1833), 'time.time', 'time.time', ([], {}), '()\n', (1831, 1833), False, 'import time\n'), ((1844, 1882), 'src.load_graph.gen_balanced_tree', 'gen_balanced_tree', (['(3)', '(4)'], {'directed': '(True)'}), '(3, 4, directed=True)\n', (1861, 1882), False, 'from src.load_graph import get_graph, gen_balanced_tree\n'... |
import numpy as np
import numpy.testing as npt
import pytest
from openscm_units import unit_registry as ur
from test_model_base import TwoLayerVariantTester
from openscm_twolayermodel import ImpulseResponseModel, TwoLayerModel
from openscm_twolayermodel.base import _calculate_geoffroy_helper_parameters
from openscm_tw... | [
"numpy.testing.assert_equal",
"openscm_units.unit_registry",
"numpy.testing.assert_allclose",
"openscm_twolayermodel.base._calculate_geoffroy_helper_parameters",
"numpy.exp",
"numpy.array",
"openscm_twolayermodel.TwoLayerModel",
"numpy.isnan",
"pytest.raises"
] | [((1204, 1221), 'numpy.isnan', 'np.isnan', (['res.erf'], {}), '(res.erf)\n', (1212, 1221), True, 'import numpy as np\n'), ((1237, 1261), 'numpy.isnan', 'np.isnan', (['res._temp1_mag'], {}), '(res._temp1_mag)\n', (1245, 1261), True, 'import numpy as np\n'), ((1277, 1301), 'numpy.isnan', 'np.isnan', (['res._temp2_mag'], ... |
import pandas as pd
from util import StockAnalysis, AllStocks
import talib
import os
import numpy as np
class FilterEma:
def __init__(self, barCount, showtCount=None, longCount=None):
self.sa = StockAnalysis()
self.jsonData = self.sa.GetJson
self.trendLength = int(os.getenv('FILTER_TREND_LE... | [
"talib.EMA",
"os.getenv",
"util.StockAnalysis",
"util.AllStocks.GetDailyStockData",
"numpy.isnan",
"util.AllStocks.Run"
] | [((207, 222), 'util.StockAnalysis', 'StockAnalysis', ([], {}), '()\n', (220, 222), False, 'from util import StockAnalysis, AllStocks\n'), ((2150, 2185), 'util.AllStocks.GetDailyStockData', 'AllStocks.GetDailyStockData', (['symbol'], {}), '(symbol)\n', (2177, 2185), False, 'from util import StockAnalysis, AllStocks\n'),... |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# %matplotlib inline
from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'inline')
sns.set()
def gl_confmatrix_2_confmatrix(sf,number_label=3):
Nlabels=max(len(sf['target_label'].unique()),len(sf['predicted_label'].... | [
"IPython.get_ipython",
"seaborn.set",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"seaborn.heatmap",
"matplotlib.pyplot.figure",
"numpy.zeros",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots"
] | [((182, 191), 'seaborn.set', 'sns.set', ([], {}), '()\n', (189, 191), True, 'import seaborn as sns\n'), ((342, 396), 'numpy.zeros', 'np.zeros', (['[number_label, number_label]'], {'dtype': 'np.float'}), '([number_label, number_label], dtype=np.float)\n', (350, 396), True, 'import numpy as np\n'), ((595, 643), 'matplotl... |
import argparse
parser = argparse.ArgumentParser(description='This script takes a dihedral trajectory and detects change points using SIMPLE (simultaneous Penalized Likelihood Estimation, see Fan et al. P. Natl. Acad. Sci, 2015, 112, 7454-7459). Two parameters alpha and lambda are controlling the extent of simultaneous... | [
"numpy.loadtxt",
"SIMPLEchangepoint.ComputeChanges",
"argparse.ArgumentParser"
] | [((25, 487), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""This script takes a dihedral trajectory and detects change points using SIMPLE (simultaneous Penalized Likelihood Estimation, see Fan et al. P. Natl. Acad. Sci, 2015, 112, 7454-7459). Two parameters alpha and lambda are controll... |
import os
import pandas as pd
import numpy as np
from collections import Counter, defaultdict
def train_from_file(dir_path, leap_limit=15):
file_list = os.listdir(dir_path)
pig_format = [
"id",
"onset",
"offset",
"pitch",
"onsetvel",
"offsetvel",
"hand"... | [
"pandas.Series",
"numpy.tile",
"os.listdir",
"numpy.triu_indices",
"pandas.read_csv",
"numpy.log",
"numpy.argmax",
"pandas.DataFrame.from_dict",
"collections.Counter",
"numpy.zeros",
"numpy.apply_along_axis",
"collections.defaultdict",
"pandas.DataFrame",
"numpy.tril_indices",
"numpy.ama... | [((158, 178), 'os.listdir', 'os.listdir', (['dir_path'], {}), '(dir_path)\n', (168, 178), False, 'import os\n'), ((367, 376), 'collections.Counter', 'Counter', ([], {}), '()\n', (374, 376), False, 'from collections import Counter, defaultdict\n'), ((406, 415), 'collections.Counter', 'Counter', ([], {}), '()\n', (413, 4... |
import pymongo
import numpy as np
from tqdm import tqdm
from datetime import datetime, timedelta
def mongo_query(**kwargs):
"""Create a MongoDB query based on a set of conditions."""
query = {}
if 'start_date' in kwargs:
if not ('CreationDate' in query):
query['CreationDate'] = {}
... | [
"datetime.datetime",
"tqdm.tqdm",
"numpy.array_split",
"pymongo.MongoClient",
"datetime.timedelta"
] | [((1136, 1162), 'datetime.datetime', 'datetime', (['year', 'month', 'day'], {}), '(year, month, day)\n', (1144, 1162), False, 'from datetime import datetime, timedelta\n'), ((822, 848), 'datetime.datetime', 'datetime', (['start_year', '(1)', '(1)'], {}), '(start_year, 1, 1)\n', (830, 848), False, 'from datetime import ... |
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('seaborn-darkgrid')
x = range(8)
y = np.linspace(1.1, 5.0, 8)
ylabel = map(lambda num: bin(num)[2:], x)
xlabel = map(lambda num: "{0:.2f}".format(num), y)
plt.step(x, y)
plt.yticks(y, ylabel)
plt.xticks(x, xlabel, rotation=45)
plt.ylabel("Binary Output... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.style.use",
"numpy.linspace",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.step"
] | [((51, 84), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-darkgrid"""'], {}), "('seaborn-darkgrid')\n", (64, 84), True, 'import matplotlib.pyplot as plt\n'), ((103, 127), 'numpy.linspace', 'np.linspace', (['(1.1)', '(5.0)', '(8)'], {}), '(1.1, 5.0, 8)\n', (114, 127), True, 'import numpy as np\n'), ((223... |
from pandas import read_sql_query
from sqlite3 import connect
from pickle import load, dump
from time import time
from gensim.utils import simple_preprocess
from gensim.models import Phrases
from gensim.models.phrases import Phraser
from gensim.parsing.preprocessing import STOPWORDS
from gensim.corpora import Dictiona... | [
"pandas.read_sql_query",
"gensim.models.AuthorTopicModel",
"gensim.models.AuthorTopicModel.load",
"gensim.corpora.Dictionary.load",
"pickle.dump",
"sqlite3.connect",
"gensim.corpora.Dictionary",
"nltk.SnowballStemmer",
"pickle.load",
"nltk.WordNetLemmatizer",
"gensim.utils.simple_preprocess",
... | [((451, 469), 'numpy.random.seed', 'np.random.seed', (['(59)'], {}), '(59)\n', (465, 469), True, 'import numpy as np\n'), ((873, 879), 'time.time', 'time', ([], {}), '()\n', (877, 879), False, 'from time import time\n'), ((2337, 2343), 'time.time', 'time', ([], {}), '()\n', (2341, 2343), False, 'from time import time\n... |
import argparse
import sys
import optax
import torch
import numpy as np
import time
import jax
import jax.numpy as jnp
import matplotlib as mp
import haiku as hk
import dill as pickle
try:
mp.use("Qt5Agg")
mp.rc('text', usetex=True)
mp.rcParams['text.latex.preamble'] = [r"\usepackage{amsmath}"]
import... | [
"deep_lagrangian_networks.utils.load_dataset",
"numpy.array",
"matplotlib.rc",
"numpy.arange",
"dill.load",
"numpy.mean",
"numpy.max",
"numpy.concatenate",
"numpy.min",
"matplotlib.cm.get_cmap",
"numpy.ones",
"matplotlib.use",
"jax.numpy.cumsum",
"matplotlib.patches.Patch",
"numpy.std",
... | [((194, 210), 'matplotlib.use', 'mp.use', (['"""Qt5Agg"""'], {}), "('Qt5Agg')\n", (200, 210), True, 'import matplotlib as mp\n'), ((215, 241), 'matplotlib.rc', 'mp.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (220, 241), True, 'import matplotlib as mp\n'), ((4554, 4581), 'matplotlib.pyplot.rc... |
#!/usr/bin/env python
import numpy as np
import scipy.sparse
from sklearn import svm
from sklearn.metrics import f1_score, recall_score, precision_score, accuracy_score, make_scorer
from sklearn.model_selection import cross_val_score
def zero_pivot_columns(matrix, pivots):
matrix_lil = scipy.sparse.lil_matrix(matr... | [
"sklearn.metrics.f1_score",
"numpy.where",
"numpy.delete",
"sklearn.svm.LinearSVC",
"sklearn.metrics.make_scorer",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"numpy.zeros",
"numpy.matrix",
"sklearn.metrics.accuracy_score"
] | [((481, 509), 'numpy.matrix', 'np.matrix', (['array'], {'copy': '(False)'}), '(array, copy=False)\n', (490, 509), True, 'import numpy as np\n'), ((1070, 1120), 'sklearn.metrics.recall_score', 'recall_score', (['y_test', 'preds'], {'pos_label': 'score_label'}), '(y_test, preds, pos_label=score_label)\n', (1082, 1120), F... |
import numpy as np
from algorithm.base import Algorithm
class Greedy(Algorithm):
def __init__(self, knapsack):
assert isinstance(knapsack, dict)
self.capacity = knapsack['capacity'][0]
self.weights = knapsack['weights']
self.profits = knapsack['profits']
self.n = ... | [
"numpy.zeros",
"numpy.arange"
] | [((736, 768), 'numpy.zeros', 'np.zeros', (['self.n'], {'dtype': 'np.int64'}), '(self.n, dtype=np.int64)\n', (744, 768), True, 'import numpy as np\n'), ((479, 496), 'numpy.arange', 'np.arange', (['self.n'], {}), '(self.n)\n', (488, 496), True, 'import numpy as np\n')] |
# script to test the parallelized gradient / divergence from pymirc
import numpy as np
import pymirc.image_operations as pi
# seed the random generator
np.random.seed(1)
# create a random 3D/4D image
shape = (6,200,190,180)
# create random array and pad with 0s
x = np.pad(np.random.rand(*shape), 1)
# allocate arra... | [
"numpy.random.rand",
"pymirc.image_operations.grad",
"pymirc.image_operations.div",
"numpy.zeros",
"numpy.random.seed"
] | [((154, 171), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (168, 171), True, 'import numpy as np\n'), ((348, 392), 'numpy.zeros', 'np.zeros', (['((x.ndim,) + x.shape)'], {'dtype': 'x.dtype'}), '((x.ndim,) + x.shape, dtype=x.dtype)\n', (356, 392), True, 'import numpy as np\n'), ((421, 439), 'pymirc.ima... |
import numpy as np
class Grid:
def __init__(self, width, heigth, discount = 0.9):
self.width = width
self.heigth = heigth
self.x_pos = 0
self.y_pos = 0
self.values = np.zeros((heigth, width))
self.discount = discount
self.vertex_sources = []
self.vert... | [
"numpy.zeros",
"numpy.random.rand"
] | [((2602, 2618), 'numpy.zeros', 'np.zeros', (['(5, 5)'], {}), '((5, 5))\n', (2610, 2618), True, 'import numpy as np\n'), ((211, 236), 'numpy.zeros', 'np.zeros', (['(heigth, width)'], {}), '((heigth, width))\n', (219, 236), True, 'import numpy as np\n'), ((808, 843), 'numpy.zeros', 'np.zeros', (['(self.heigth, self.width... |
import numpy as np
import tensorflow as tf
#----------------------------------------------------------------------------
# Encoder network.
# Extract the feature of content and style image
# Use VGG19 network to extract features.
ENCODER_LAYERS = (
'conv1_1', 'relu1_1', 'conv1_2', 'relu1_2', 'pool1',
'conv2... | [
"tensorflow.nn.conv2d",
"tensorflow.local_variables_initializer",
"tensorflow.nn.max_pool",
"tensorflow.pad",
"tensorflow.variable_scope",
"tensorflow.transpose",
"tensorflow.nn.relu",
"tensorflow.nn.avg_pool",
"tensorflow.Session",
"tensorflow.Variable",
"tensorflow.global_variables_initializer... | [((3289, 3348), 'tensorflow.pad', 'tf.pad', (['x', '[[0, 0], [1, 1], [1, 1], [0, 0]]'], {'mode': '"""REFLECT"""'}), "(x, [[0, 0], [1, 1], [1, 1], [0, 0]], mode='REFLECT')\n", (3295, 3348), True, 'import tensorflow as tf\n'), ((3384, 3453), 'tensorflow.nn.conv2d', 'tf.nn.conv2d', (['x_padded', 'kernel'], {'strides': '[1... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'newGui.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, ... | [
"PyQt5.QtGui.QIcon",
"matplotlib.pyplot.specgram",
"PyQt5.QtWidgets.QApplication",
"pyqtgraph.mkPen",
"pyqtgraph.QtCore.QTimer",
"numpy.genfromtxt",
"PyQt5.QtCore.QFileInfo",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.Qt... | [((553, 577), 'matplotlib.use', 'matplotlib.use', (['"""Qt5Agg"""'], {}), "('Qt5Agg')\n", (567, 577), False, 'import matplotlib\n'), ((23354, 23386), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (23376, 23386), False, 'from PyQt5 import QtCore, QtGui, QtWidgets, QtPrintS... |
import h5py
import matplotlib.pyplot as plt
import numpy as np
import scipy.io
import scipy.stats
import complex_pca
def plot_pca_variance_curve(x: np.ndarray, title: str = 'PCA -- Variance Explained Curve') -> None:
pca = complex_pca.ComplexPCA(n_components=x.shape[1])
pca.fit(x)
plt.figure()
plt.p... | [
"matplotlib.pyplot.grid",
"numpy.log10",
"matplotlib.pyplot.ylabel",
"numpy.hstack",
"complex_pca.ComplexPCA",
"numpy.unwrap",
"numpy.array",
"numpy.imag",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.diff",
"numpy.real",
"numpy.linspace",
"matplotlib.pypl... | [((230, 277), 'complex_pca.ComplexPCA', 'complex_pca.ComplexPCA', ([], {'n_components': 'x.shape[1]'}), '(n_components=x.shape[1])\n', (252, 277), False, 'import complex_pca\n'), ((298, 310), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (308, 310), True, 'import matplotlib.pyplot as plt\n'), ((436, 480),... |
import os
from random import sample
import numpy as np
from numpy import cos
from scipy.linalg import lstsq
from compmech.constants import CMHOME
from compmech.logger import *
def load_c0(name, funcnum, m0, n0):
path = os.path.join(CMHOME, 'conecyl', 'imperfections', 'c0',
'c0_{0}_f{1}_m{2:03d}_n{3:0... | [
"scipy.linalg.lstsq",
"os.path.isfile",
"os.path.basename",
"numpy.savetxt",
"numpy.loadtxt",
"mgi.fa"
] | [((380, 400), 'os.path.isfile', 'os.path.isfile', (['path'], {}), '(path)\n', (394, 400), False, 'import os\n'), ((5034, 5077), 'mgi.fa', 'mgi.fa', (['m0', 'n0', 'xs', 'thetas'], {'funcnum': 'funcnum'}), '(m0, n0, xs, thetas, funcnum=funcnum)\n', (5040, 5077), False, 'import mgi\n'), ((417, 433), 'numpy.loadtxt', 'np.l... |
import numpy as np
from cost_functions import trajectory_cost_fn
import time
class Controller():
def __init__(self):
pass
# Get the appropriate action(s) for this state(s)
def get_action(self, state):
pass
class RandomController(Controller):
def __init__(self, env):
""" YOUR... | [
"numpy.argmin",
"numpy.array",
"numpy.empty",
"cost_functions.trajectory_cost_fn"
] | [((1235, 1327), 'numpy.empty', 'np.empty', (['(self.num_simulated_paths, self.horizon, self.env.observation_space.shape[0])'], {}), '((self.num_simulated_paths, self.horizon, self.env.\n observation_space.shape[0]))\n', (1243, 1327), True, 'import numpy as np\n'), ((1364, 1456), 'numpy.empty', 'np.empty', (['(self.n... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 09:15:33 2020
@author: dhulls
"""
# Imports
import numpy as np
np.random.seed(100)
from tensorflow import random
random.set_seed(100)
import os
import pathlib
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
os.chdir('/... | [
"tensorflow.random.set_seed",
"pandas.read_csv",
"numpy.power",
"tensorflow_docs.modeling.EpochDots",
"os.chdir",
"tensorflow.keras.layers.Dense",
"numpy.random.seed",
"pandas.DataFrame",
"tensorflow.keras.optimizers.RMSprop"
] | [((138, 157), 'numpy.random.seed', 'np.random.seed', (['(100)'], {}), '(100)\n', (152, 157), True, 'import numpy as np\n'), ((188, 208), 'tensorflow.random.set_seed', 'random.set_seed', (['(100)'], {}), '(100)\n', (203, 208), False, 'from tensorflow import random\n'), ((309, 371), 'os.chdir', 'os.chdir', (['"""/Users/s... |
from abc import ABC, abstractmethod
from typing import Callable, cast, Set, List, Dict, Optional
import numpy as np
from autofit import ModelInstance, Analysis, DirectoryPaths
from autofit.graphical.expectation_propagation import AbstractFactorOptimiser
from autofit.graphical.expectation_propagation import EPMeanFiel... | [
"numpy.prod",
"autofit.mapper.prior_model.collection.CollectionPriorModel",
"autofit.graphical.expectation_propagation.EPMeanField.from_approx_dists",
"autofit.graphical.expectation_propagation.EPOptimiser",
"autofit.graphical.messages.NormalMessage.from_prior",
"typing.cast"
] | [((2759, 2819), 'autofit.graphical.expectation_propagation.EPMeanField.from_approx_dists', 'EPMeanField.from_approx_dists', (['self.graph', 'self.message_dict'], {}), '(self.graph, self.message_dict)\n', (2788, 2819), False, 'from autofit.graphical.expectation_propagation import EPMeanField\n'), ((2985, 3158), 'autofit... |
from shapely.geometry import shape
import fiona
import networkx as nx
import matplotlib.pyplot as plt
import math
import random
import traffic
import pickle
from datetime import datetime
from request import Request
import numpy as np
try:
from itertools import izip as zip
except ImportError:
pass
def main():... | [
"numpy.sqrt",
"shapely.geometry.shape",
"networkx.astar_path",
"numpy.divide",
"datetime.datetime",
"numpy.multiply",
"matplotlib.pyplot.plot",
"numpy.subtract",
"fiona.open",
"matplotlib.pyplot.axis",
"random.randint",
"traffic.process_traffic",
"pickle.load",
"numpy.cos",
"matplotlib.p... | [((804, 821), 'matplotlib.pyplot.axis', 'plt.axis', (['"""equal"""'], {}), "('equal')\n", (812, 821), True, 'import matplotlib.pyplot as plt\n'), ((826, 836), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (834, 836), True, 'import matplotlib.pyplot as plt\n'), ((2669, 2760), 'fiona.open', 'fiona.open', (['"""... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"numpy.array",
"paddle.disable_static",
"unittest.main",
"paddle.CPUPlace",
"numpy.random.random",
"paddle.vision.ops.psroi_pool",
"paddle.vision.ops.PSRoIPool",
"paddle.fluid.create_lod_tensor",
"paddle.enable_static",
"paddle.to_tensor",
"paddle.fluid.core.is_compiled_with_cuda",
"paddle.set... | [((1156, 1178), 'numpy.zeros', 'np.zeros', (['output_shape'], {}), '(output_shape)\n', (1164, 1178), True, 'import numpy as np\n'), ((13311, 13326), 'unittest.main', 'unittest.main', ([], {}), '()\n', (13324, 13326), False, 'import unittest\n'), ((3454, 3476), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '... |
#!/usr/bin/env python3
import random
import time
import sys
import pygame
from pygame.locals import *
import pygame.surfarray as surfarray # for performance
import numpy as np
import colors # color definition
SCREEN_SIZE = (1600, 900) # change it to your screen size
#color definition... | [
"colors.random_color",
"sys.exit",
"pygame.init",
"random.shuffle",
"pygame.event.get",
"pygame.Surface",
"pygame.display.set_mode",
"pygame.display.update",
"pygame.quit",
"numpy.bool",
"numpy.roll",
"pygame.mouse.set_visible",
"numpy.zeros",
"pygame.surfarray.blit_array",
"pygame.time.... | [((1014, 1027), 'pygame.init', 'pygame.init', ([], {}), '()\n', (1025, 1027), False, 'import pygame\n'), ((1032, 1063), 'pygame.mouse.set_visible', 'pygame.mouse.set_visible', (['(False)'], {}), '(False)\n', (1056, 1063), False, 'import pygame\n'), ((1075, 1127), 'pygame.display.set_mode', 'pygame.display.set_mode', ([... |
# ------------------------------------------------------------
# Copyright (c) 2017-present, SeetaTech, Co.,Ltd.
#
# Licensed under the BSD 2-Clause License.
# You should have received a copy of the BSD 2-Clause License
# along with the software. If not, See,
#
# <https://opensource.org/licenses/BSD-2-Clause>
#
# ... | [
"dragon.workspace.HasTensor",
"numpy.array",
"dragon.vm.torch.c_api.device"
] | [((1121, 1150), 'dragon.vm.torch.c_api.device', '_Device', (['types[0]', 'indices[0]'], {}), '(types[0], indices[0])\n', (1128, 1150), True, 'from dragon.vm.torch.c_api import device as _Device\n'), ((1487, 1496), 'dragon.vm.torch.c_api.device', '_Device', ([], {}), '()\n', (1494, 1496), True, 'from dragon.vm.torch.c_a... |
"""
This module is the main API used to create track collections
"""
# Standard library imports
import copy
import random
import inspect
import logging
import itertools
from typing import Any
from typing import List
from typing import Union
from typing import Tuple
from typing import Callable
from dataclasses impo... | [
"logging.getLogger",
"itertools.islice",
"random.sample",
"copy.deepcopy",
"random.shuffle",
"dataclasses.asdict",
"itertools.tee",
"networkx.Graph",
"networkx.shortest_path_length",
"numpy.argsort",
"numpy.array",
"inspect.getsource",
"spotify_flows.database.SpotifyDatabase",
"pandas.Data... | [((1263, 1282), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1280, 1282), False, 'import logging\n'), ((1788, 1815), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (1793, 1815), False, 'from dataclasses import dataclass, field, asdict\n'), ((20879, 20906), '... |
'''
makeRankingCard.py:制作评分卡。
Author: HeRaNO
'''
import sys
import imblearn
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression as LR
# Read data start
model = pd.read_csv("model_data.csv", index_col = 0)
vali = pd.read_csv("vali_data.csv", index_col = 0)
# Read data end
# S... | [
"pandas.read_csv",
"numpy.log",
"pandas.cut",
"sklearn.linear_model.LogisticRegression",
"numpy.sum",
"pandas.DataFrame"
] | [((204, 246), 'pandas.read_csv', 'pd.read_csv', (['"""model_data.csv"""'], {'index_col': '(0)'}), "('model_data.csv', index_col=0)\n", (215, 246), True, 'import pandas as pd\n'), ((256, 297), 'pandas.read_csv', 'pd.read_csv', (['"""vali_data.csv"""'], {'index_col': '(0)'}), "('vali_data.csv', index_col=0)\n", (267, 297... |
import datetime
import os
import uuid
from os.path import join as opjoin
from pathlib import Path
import numpy as np
import requests
import yaml
from celery.result import AsyncResult
from django.db.models import Q
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import mi... | [
"backend_app.models.Model.objects.filter",
"backend_app.models.Project.objects.filter",
"numpy.trunc",
"drf_yasg.utils.swagger_auto_schema",
"backend_app.models.Project.objects.get",
"yaml.load",
"backend_app.models.AllowedProperty.objects.all",
"backend_app.models.TrainingSetting",
"backend_app.mod... | [((816, 852), 'backend_app.models.AllowedProperty.objects.all', 'models.AllowedProperty.objects.all', ([], {}), '()\n', (850, 852), False, 'from backend_app import mixins as BAMixins, models, serializers, swagger\n'), ((2601, 2653), 'backend_app.models.Dataset.objects.filter', 'models.Dataset.objects.filter', ([], {'is... |
# Copyright (c) 2018 IoTeX
# This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
# warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
# permitted by law, all liability for your use of the code is... | [
"consensus_failurestop.ConsensusFS",
"consensus_client.Consensus",
"numpy.random.lognormal"
] | [((2124, 2152), 'consensus_client.Consensus', 'consensus_client.Consensus', ([], {}), '()\n', (2150, 2152), False, 'import consensus_client\n'), ((6945, 6999), 'numpy.random.lognormal', 'np.random.lognormal', (['self.NORMAL_MEAN', 'self.NORMAL_STD'], {}), '(self.NORMAL_MEAN, self.NORMAL_STD)\n', (6964, 6999), True, 'im... |
import numpy as np
import matplotlib.pyplot as plt
import math
TIME_SLEEP = 0.000000001
def train_sgd(X, y, alpha, w=None):
"""Trains a linear regression model using stochastic gradient descent.
Parameters
----------
X : numpy.ndarray
Numpy array of data
y : numpy.ndarray
Numpy a... | [
"numpy.ones",
"matplotlib.pyplot.show",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.plot",
"numpy.sum",
"matplotlib.pyplot.figure",
"numpy.zeros",
"math.fabs",
"matplotlib.pyplot.pause",
"numpy.transpose",
"matplotlib.pyplot.ion"
] | [((2701, 2710), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (2708, 2710), True, 'import matplotlib.pyplot as plt\n'), ((2715, 2766), 'matplotlib.pyplot.plot', 'plt.plot', (['X[:, 0]', 'y_predict', '"""r-"""', 'X[:, 0]', 'y', '"""o"""'], {}), "(X[:, 0], y_predict, 'r-', X[:, 0], y, 'o')\n", (2723, 2766), True,... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.5.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# Separation via Time-Fre... | [
"numpy.abs",
"nussl.core.masks.BinaryMask",
"nussl.play_utils.multitrack",
"nussl.utils.visualize_spectrogram",
"nussl.utils.visualize_sources_as_waveform",
"nussl.utils.visualize_sources_as_masks",
"matplotlib.pyplot.subplot",
"numpy.angle",
"matplotlib.pyplot.figure",
"numpy.exp",
"nussl.core.... | [((671, 682), 'time.time', 'time.time', ([], {}), '()\n', (680, 682), False, 'import time\n'), ((692, 729), 'nussl.datasets.MUSDB18', 'nussl.datasets.MUSDB18', ([], {'download': '(True)'}), '(download=True)\n', (714, 729), False, 'import nussl\n'), ((1045, 1072), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize... |
from course_lib.Base.BaseRecommender import BaseRecommender
import numpy as np
import scipy.sparse as sps
class SearchFieldWeightICMRecommender(BaseRecommender):
""" Search Field Weight ICM Recommender """
RECOMMENDER_NAME = "SearchFieldWeightICMRecommender"
def __init__(self, URM_train, ICM_train, reco... | [
"numpy.ones",
"scipy.sparse.diags"
] | [((846, 884), 'numpy.ones', 'np.ones', ([], {'shape': 'self.ICM_train.shape[1]'}), '(shape=self.ICM_train.shape[1])\n', (853, 884), True, 'import numpy as np\n'), ((1138, 1169), 'scipy.sparse.diags', 'sps.diags', (['item_feature_weights'], {}), '(item_feature_weights)\n', (1147, 1169), True, 'import scipy.sparse as sps... |
from typing import Dict, List, Optional, Union
import numpy as np
import torch
MOLECULAR_ATOMS = (
"H,He,Li,Be,B,C,N,O,F,Ne,Na,Mg,Al,Si,P,S,Cl,Ar,K,Ca,Sc,Ti,V,Cr,Mn,Fe,Co,Ni,Cu,Zn,"
"Ga,Ge,As,Se,Br,Kr,Rb,Sr,Y,Zr,Nb,Mo,Tc,Ru,Rh,Pd,Ag,Cd,In,Sn,Sb,Te,I,Xe,Cs,Ba,La,Ce,"
"Pr,Nd,Pm,Sm,Eu,Gd,Tb,Dy,Ho,Er,Tm,Yb,Lu... | [
"torch.tensor",
"numpy.empty"
] | [((3918, 3970), 'numpy.empty', 'np.empty', (['(max_seq_len, max_seq_len)'], {'dtype': 'np.int64'}), '((max_seq_len, max_seq_len), dtype=np.int64)\n', (3926, 3970), True, 'import numpy as np\n'), ((8457, 8496), 'torch.tensor', 'torch.tensor', (["encodings['position_ids']"], {}), "(encodings['position_ids'])\n", (8469, 8... |
# importing libraries
import warnings
warnings.filterwarnings("ignore")
import sys
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import xgboost as xgb
from catboost import CatBoostRegressor
import lightgbm as lgb
from sqlalchemy import create_engine
import pickle
from sklearn.metrics impor... | [
"sqlalchemy.create_engine",
"lightgbm.LGBMRegressor",
"catboost.CatBoostRegressor",
"numpy.array",
"xgboost.XGBRegressor",
"numpy.exp",
"numpy.random.seed",
"pandas.read_sql_table",
"sklearn.metrics.mean_absolute_error",
"sklearn.metrics.r2_score",
"warnings.filterwarnings",
"numpy.arange",
... | [((38, 71), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (61, 71), False, 'import warnings\n'), ((1432, 1451), 'numpy.array', 'np.array', (['rolling_X'], {}), '(rolling_X)\n', (1440, 1451), True, 'import numpy as np\n'), ((1468, 1487), 'numpy.array', 'np.array', (['rolli... |
import base64
import io
from matplotlib import pyplot
import numpy as np
import rasterio
def read_raster_file(input_fn, band = 1):
with rasterio.open(input_fn) as src:
return src.read(band)
def plot_raster_layer(input_fn, band = 1, from_logits = True):
pyplot.figure(figsize = (10,10))
data ... | [
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.savefig",
"rasterio.open",
"io.BytesIO",
"matplotlib.pyplot.close",
"numpy.exp",
"matplotlib.pyplot.figure",
"numpy.rint",
"matplotlib.pyplot.show"
] | [((278, 309), 'matplotlib.pyplot.figure', 'pyplot.figure', ([], {'figsize': '(10, 10)'}), '(figsize=(10, 10))\n', (291, 309), False, 'from matplotlib import pyplot\n'), ((407, 442), 'matplotlib.pyplot.imshow', 'pyplot.imshow', (['data'], {'cmap': '"""viridis"""'}), "(data, cmap='viridis')\n", (420, 442), False, 'from m... |
#!/bin/python
#sca_test.py
import matplotlib.pyplot as plt
import coevo2 as ce
import itertools as it
import numpy as np
import copy
import time
reload(ce)
names = ['glgA', 'glgC', 'cydA', 'cydB']
algPath = 'TestSet/eggNOG_aligns/slice_0.9/'
prots = ce.prots_from_scratch(names,path2alg=algPath)
ps = ce.ProtSet(prots... | [
"coevo2.ProtSet",
"itertools.izip",
"coevo2.PhyloSet",
"coevo2.sca",
"numpy.save",
"coevo2.prots_from_scratch"
] | [((253, 299), 'coevo2.prots_from_scratch', 'ce.prots_from_scratch', (['names'], {'path2alg': 'algPath'}), '(names, path2alg=algPath)\n', (274, 299), True, 'import coevo2 as ce\n'), ((304, 328), 'coevo2.ProtSet', 'ce.ProtSet', (['prots', 'names'], {}), '(prots, names)\n', (314, 328), True, 'import coevo2 as ce\n'), ((42... |
# coding: utf-8
""" MIT License """
'''
<NAME> & <NAME>
<NAME> & <NAME>
---
Description:
Function designed to evaluate all parameters provided to the gp and identify the best parameters.
Saves all fitness of individuals by logging them into csv files which will then be evaluated on plots.py... | [
"utils.load_data",
"numpy.column_stack",
"os.getcwd",
"numpy.zeros",
"numpy.random.seed",
"pandas.DataFrame"
] | [((777, 866), 'utils.load_data', 'utils.load_data', ([], {'filename': '"""data_trimmed.csv"""', 'clean': '(False)', 'normalize': '(True)', 'resample': '(2)'}), "(filename='data_trimmed.csv', clean=False, normalize=True,\n resample=2)\n", (792, 866), False, 'import utils\n'), ((1019, 1042), 'numpy.column_stack', 'np.... |
"""
Most recently tested against PySAM 2.1.4
"""
from pathlib import Path
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import PySAM.Singleowner as Singleowner
import time
import multiprocessing
from itertools import product
import PySAM.Pvsamv1 as Pvsamv1
solar_resourc... | [
"PySAM.Pvsamv1.default",
"PySAM.Singleowner.default",
"numpy.reshape",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"pathlib.Path",
"matplotlib.pyplot.xlabel",
"itertools.product",
"numpy.array",
"matplotlib.pyplot.figure",
"mpl_toolkits.mplot3d.Axes3D",
"matplotlib.pyplot.contour",
... | [((1671, 1687), 'numpy.arange', 'np.arange', (['(1)', '(10)'], {}), '(1, 10)\n', (1680, 1687), True, 'import numpy as np\n'), ((1696, 1712), 'numpy.arange', 'np.arange', (['(1)', '(10)'], {}), '(1, 10)\n', (1705, 1712), True, 'import numpy as np\n'), ((1723, 1742), 'time.process_time', 'time.process_time', ([], {}), '(... |
from viroconcom.fitting import Fit
from viroconcom.contours import IFormContour
import numpy as np
prng = np.random.RandomState(42)
# Draw 1000 observations from a Weibull distribution with
# shape=1.5 and scale=3, which represents significant
# wave height.
sample_0 = prng.weibull(1.5, 1000) * 3
# Let the second sa... | [
"numpy.exp",
"viroconcom.fitting.Fit",
"viroconcom.contours.IFormContour",
"numpy.random.RandomState"
] | [((107, 132), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (128, 132), True, 'import numpy as np\n'), ((1458, 1525), 'viroconcom.fitting.Fit', 'Fit', (['(sample_0, sample_1)', '(dist_description_0, dist_description_1)'], {}), '((sample_0, sample_1), (dist_description_0, dist_descriptio... |
import numpy as np
from numpy.testing import assert_array_equal
from seai_deap import dim
def test_calculate_building_volume() -> None:
expected_output = np.array(4)
output = dim.calculate_building_volume(
ground_floor_area=np.array(1),
first_floor_area=np.array(1),
second_floor_are... | [
"numpy.array",
"numpy.testing.assert_array_equal"
] | [((162, 173), 'numpy.array', 'np.array', (['(4)'], {}), '(4)\n', (170, 173), True, 'import numpy as np\n'), ((546, 589), 'numpy.testing.assert_array_equal', 'assert_array_equal', (['output', 'expected_output'], {}), '(output, expected_output)\n', (564, 589), False, 'from numpy.testing import assert_array_equal\n'), ((6... |
import pdb
import numpy
import geometry.conversions
import geometry.helpers
import geometry.quaternion
import geodesy.conversions
import environments.earth
import spherical_geometry.vector
import spherical_geometry.great_circle_arc
def line_distance(point_1, point_2, ignore_alt=True):
"""Compute the straight l... | [
"numpy.array",
"numpy.zeros",
"numpy.cross",
"numpy.linalg.norm"
] | [((810, 831), 'numpy.linalg.norm', 'numpy.linalg.norm', (['dX'], {}), '(dX)\n', (827, 831), False, 'import numpy\n'), ((760, 797), 'numpy.array', 'numpy.array', (['[1.0, 1.0, 0.0]'], {'ndmin': '(2)'}), '([1.0, 1.0, 0.0], ndmin=2)\n', (771, 797), False, 'import numpy\n'), ((2757, 2783), 'numpy.zeros', 'numpy.zeros', (['... |
# Copyright 2017 Neosapience, 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 to in wri... | [
"tensorflow.reset_default_graph",
"tensorflow.layers.flatten",
"darkon.Gradcam.candidate_featuremap_op_names",
"darkon.Gradcam",
"tensorflow.reduce_sum",
"tensorflow.placeholder",
"tensorflow.Session",
"numpy.any",
"tensorflow.reduce_max",
"tensorflow.global_variables_initializer",
"tensorflow.l... | [((799, 856), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '(1, 2, 2, 3)', '"""x_placeholder"""'], {}), "(tf.float32, (1, 2, 2, 3), 'x_placeholder')\n", (813, 856), True, 'import tensorflow as tf\n'), ((865, 925), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32'], {'name': '"""y_placeholder"""', ... |
import numpy as np
import sys
def micrograph2np(width,shift):
r = int(width/shift-1)
#I = np.load("../DATA_SETS/004773_ProtRelionRefine3D/kino.micrograph.numpy.npy")
I = np.load("../DATA_SETS/004773_ProtRelionRefine3D/full_micrograph.stack_0001.numpy.npy")
I = (I-I.mean())/I.std()
N = int(I.shape[0]/sh... | [
"numpy.array",
"numpy.load",
"numpy.save"
] | [((180, 276), 'numpy.load', 'np.load', (['"""../DATA_SETS/004773_ProtRelionRefine3D/full_micrograph.stack_0001.numpy.npy"""'], {}), "(\n '../DATA_SETS/004773_ProtRelionRefine3D/full_micrograph.stack_0001.numpy.npy'\n )\n", (187, 276), True, 'import numpy as np\n'), ((541, 552), 'numpy.array', 'np.array', (['S'], ... |
import os
import warnings
import torch.backends.cudnn as cudnn
warnings.filterwarnings("ignore")
from torch.utils.data import DataLoader
from decaps import CapsuleNet
from torch.optim import Adam
import numpy as np
from config import options
import torch
import torch.nn.functional as F
from utils.eval_utils import bina... | [
"torch.nn.CrossEntropyLoss",
"utils.loss_utils.ReconstructionLoss",
"numpy.array",
"torch.nn.functional.upsample_bilinear",
"utils.loss_utils.MarginLoss",
"os.path.exists",
"dataset.chexpert_dataset.CheXpertDataSet.cuda",
"config.options.load_model_path.split",
"dataset.chexpert_dataset.CheXpertData... | [((63, 96), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (86, 96), False, 'import warnings\n'), ((650, 665), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (663, 665), False, 'import torch\n'), ((722, 733), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (730, 73... |
#!/usr/bin/env python
# coding: utf-8
"""
Classification Using Hidden Markov Model
========================================
This is a demonstration using the implemented Hidden Markov model to classify multiple targets.
We will attempt to classify 3 targets in an undefined region.
Our sensor will be all-seeing, and p... | [
"numpy.array",
"stonesoup.hypothesiser.categorical.CategoricalHypothesiser",
"datetime.timedelta",
"numpy.vstack",
"stonesoup.initiator.categorical.SimpleCategoricalInitiator",
"stonesoup.tracker.simple.MultiTargetTracker",
"stonesoup.types.state.CategoricalState",
"stonesoup.predictor.categorical.HMM... | [((2407, 2421), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (2419, 2421), False, 'from datetime import datetime, timedelta\n'), ((4603, 4653), 'numpy.array', 'np.array', (['[[0.99, 0.01], [0.5, 0.5], [0.01, 0.99]]'], {}), '([[0.99, 0.01], [0.5, 0.5], [0.01, 0.99]])\n', (4611, 4653), True, 'import numpy a... |
#!/usr/bin/env python3
import numpy as np
import os
import sys
import argparse
import glob
import time
import onnx
import onnxruntime
import cv2
import caffe
from cvi_toolkit.model import OnnxModel
from cvi_toolkit.utils.yolov3_util import preprocess, postprocess_v2, postprocess_v3, postprocess_v4_tiny, draw
def chec... | [
"cv2.imwrite",
"cvi_toolkit.utils.yolov3_util.draw",
"numpy.savez",
"os.path.exists",
"onnx.save",
"argparse.ArgumentParser",
"onnxruntime.InferenceSession",
"os.path.isfile",
"cvi_toolkit.utils.yolov3_util.preprocess",
"numpy.append",
"numpy.array",
"onnx.helper.ValueInfoProto",
"onnx.load"... | [((669, 727), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Eval YOLO networks."""'}), "(description='Eval YOLO networks.')\n", (692, 727), False, 'import argparse\n'), ((2620, 2647), 'cv2.imread', 'cv2.imread', (['args.input_file'], {}), '(args.input_file)\n', (2630, 2647), False, 'imp... |
import pickle
import time
import numpy as np
from macrel import graphs
from macrel import vast11data as vast
INTERVAL_SEC = 900.0
N = len(vast.NODES)
SERVICES = {
1: "Mux",
17: "Quote",
21: "FTP",
22: "SSH",
23: "Telnet",
25: "SMTP",
53: "DNS",
80: "HTTP",
88: "Kerberos",
... | [
"macrel.vast11data.FWEventParser",
"numpy.asarray",
"macrel.vast11data.NODE_BY_IP.get",
"time.gmtime",
"macrel.graphs.ConnectionTally"
] | [((575, 600), 'macrel.graphs.ConnectionTally', 'graphs.ConnectionTally', (['N'], {}), '(N)\n', (597, 600), False, 'from macrel import graphs\n'), ((1344, 1364), 'macrel.vast11data.FWEventParser', 'vast.FWEventParser', ([], {}), '()\n', (1362, 1364), True, 'from macrel import vast11data as vast\n'), ((1466, 1489), 'time... |
import sys
from pathlib import Path
import os
import torch
from torch.optim import Adam
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from networks.critic import Critic
from networks.actor import NoisyActor, CategoricalActor, GaussianActor
base_dir = Path(__file__).resolve().parent.parent.... | [
"torch.nn.init.constant_",
"torch.nn.utils.clip_grad_norm_",
"numpy.log",
"torch.min",
"numpy.array",
"torch.sum",
"networks.actor.NoisyActor",
"os.path.exists",
"networks.actor.CategoricalActor",
"pathlib.Path",
"torch.nn.init.xavier_uniform_",
"torch.mean",
"networks.actor.GaussianActor",
... | [((569, 616), 'torch.nn.init.xavier_uniform_', 'torch.nn.init.xavier_uniform_', (['m.weight'], {'gain': '(1)'}), '(m.weight, gain=1)\n', (598, 616), False, 'import torch\n'), ((625, 659), 'torch.nn.init.constant_', 'torch.nn.init.constant_', (['m.bias', '(0)'], {}), '(m.bias, 0)\n', (648, 659), False, 'import torch\n')... |
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | [
"numpy.mean",
"matplotlib.pylab.xlim",
"matplotlib.pylab.savefig",
"numpy.sqrt",
"matplotlib.pylab.errorbar",
"sys.exit",
"matplotlib.pylab.figure",
"matplotlib.pylab.axhline",
"matplotlib.pylab.ylim",
"matplotlib.pylab.legend",
"IPython.embed",
"matplotlib.pylab.xlabel",
"matplotlib.pylab.s... | [((930, 973), 'numpy.loadtxt', 'np.loadtxt', (['"""results/callibration_mmds.csv"""'], {}), "('results/callibration_mmds.csv')\n", (940, 973), True, 'import numpy as np\n'), ((998, 1024), 'numpy.mean', 'np.mean', (['callibration_mmds'], {}), '(callibration_mmds)\n', (1005, 1024), True, 'import numpy as np\n'), ((1250, ... |
# --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file
path
#Code starts here
data=pd.read_csv(path)
data.rename(columns={'Total':'Total_Medals'},inplace=True)
data.head(10)
# --------------
#Code starts here
data['Better_E... | [
"matplotlib.pyplot.xticks",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots"
] | [((169, 186), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (180, 186), True, 'import pandas as pd\n'), ((1371, 1389), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(3)', '(1)'], {}), '(3, 1)\n', (1383, 1389), True, 'import matplotlib.pyplot as plt\n'), ((2807, 2834), 'matplotlib.pyplot.xlabel', 'plt... |
from numpy import ndarray, array
from electripy.physics.charges import PointCharge
class _ChargesSet:
"""
A _ChargesSet instance is a group of charges. The electric
field at a given point can be calculated as the sum of each
electric field at that point for every charge in the charge
set.
"""
... | [
"numpy.array"
] | [((566, 583), 'numpy.array', 'array', (['[0.0, 0.0]'], {}), '([0.0, 0.0])\n', (571, 583), False, 'from numpy import ndarray, array\n')] |
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, TrafficLightArray , TrafficLight
from std_msgs.msg import Int32
import numpy as np
from threading import Thread, Lock
from copy import deepcopy
class GT_TL_Pub(object):
def __init__(self):
rospy.in... | [
"rospy.logerr",
"numpy.uint8",
"rospy.Subscriber",
"rospy.is_shutdown",
"rospy.init_node",
"rospy.get_time",
"threading.Lock",
"rospy.Rate",
"rospy.Publisher"
] | [((312, 346), 'rospy.init_node', 'rospy.init_node', (['"""gt_TL_Publisher"""'], {}), "('gt_TL_Publisher')\n", (327, 346), False, 'import rospy\n'), ((356, 416), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/current_pose"""', 'PoseStamped', 'self.pose_cb'], {}), "('/current_pose', PoseStamped, self.pose_cb)\n", (372, 4... |
import numpy as np
import torch
class ModuleMixin(object):
"""
Adds convenince functions to a torch module
"""
def number_of_parameters(self, trainable=True):
return number_of_parameters(self, trainable)
def number_of_parameters(model, trainable=True):
"""
Returns number of trainable... | [
"numpy.eye",
"torch.__version__.split",
"torch.eye",
"torch.set_grad_enabled",
"torch.is_grad_enabled"
] | [((5383, 5415), 'numpy.eye', 'np.eye', (['num_classes'], {'dtype': 'dtype'}), '(num_classes, dtype=dtype)\n', (5389, 5415), True, 'import numpy as np\n'), ((5535, 5592), 'torch.eye', 'torch.eye', (['num_classes'], {'device': 'labels.device', 'dtype': 'dtype'}), '(num_classes, device=labels.device, dtype=dtype)\n', (554... |
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for pyvo.dal.datalink
"""
from functools import partial
from urllib.parse import parse_qsl
from pyvo.dal.adhoc import DatalinkResults
from pyvo.dal.params import find_param_by_keyword, get_converter
from pyvo.dal.exceptions... | [
"pytest.mark.filterwarnings",
"pyvo.dal.params.find_param_by_keyword",
"pyvo.dal.adhoc.DatalinkResults.from_result_url",
"astropy.utils.data.get_pkg_data_contents",
"numpy.array",
"functools.partial",
"pytest.mark.usefixtures",
"pytest.raises",
"pytest.fixture",
"urllib.parse.parse_qsl"
] | [((505, 575), 'functools.partial', 'partial', (['get_pkg_data_contents'], {'package': '__package__', 'encoding': '"""binary"""'}), "(get_pkg_data_contents, package=__package__, encoding='binary')\n", (512, 575), False, 'from functools import partial\n'), ((605, 674), 'functools.partial', 'partial', (['get_pkg_data_file... |
import numpy as np
__copyright__ = 'Copyright (C) 2018 ICTP'
__author__ = '<NAME> <<EMAIL>>'
__credits__ = ["<NAME>", "<NAME>"]
def get_x(lon, clon, cone):
if clon >= 0.0 and lon >= 0.0 or clon < 0.0 and lon < 0.0:
return np.radians(clon - lon) * cone
elif clon >= 0.0:
if abs(clon - lon + 3... | [
"numpy.radians",
"numpy.sqrt",
"numpy.isscalar",
"numpy.cos",
"numpy.sin",
"numpy.vectorize"
] | [((238, 260), 'numpy.radians', 'np.radians', (['(clon - lon)'], {}), '(clon - lon)\n', (248, 260), True, 'import numpy as np\n'), ((829, 844), 'numpy.radians', 'np.radians', (['lat'], {}), '(lat)\n', (839, 844), True, 'import numpy as np\n'), ((860, 875), 'numpy.radians', 'np.radians', (['lon'], {}), '(lon)\n', (870, 8... |
import logging
import os
import shutil
import tempfile
from urllib import request as request
from urllib.error import HTTPError, URLError
from ase import Atoms
import numpy as np
from schnetpack.data import AtomsData
from schnetpack.environment import SimpleEnvironmentProvider
class MD17(AtomsData):
"""
MD1... | [
"os.path.exists",
"os.makedirs",
"urllib.request.urlretrieve",
"ase.Atoms",
"os.path.join",
"numpy.array",
"tempfile.mkdtemp",
"shutil.rmtree",
"numpy.load",
"logging.info",
"logging.error",
"schnetpack.environment.SimpleEnvironmentProvider"
] | [((2703, 2742), 'os.path.join', 'os.path.join', (['self.dbdir', 'self.database'], {}), '(self.dbdir, self.database)\n', (2715, 2742), False, 'import os\n'), ((2822, 2849), 'schnetpack.environment.SimpleEnvironmentProvider', 'SimpleEnvironmentProvider', ([], {}), '()\n', (2847, 2849), False, 'from schnetpack.environment... |
"""
Aggregator
====================================
*Aggregators* are used to combine multiple matrices to a single matrix.
This is used to combine similarity and dissimilarity matrices of multiple attributes to a single one.
Thus, an *Aggregator* :math:`\\mathcal{A}` is a mapping of the form
:math:`\\mathcal{A} : \\ma... | [
"numpy.mean",
"numpy.median",
"numpy.min",
"numpy.max"
] | [((3369, 3394), 'numpy.mean', 'np.mean', (['matrices'], {'axis': '(0)'}), '(matrices, axis=0)\n', (3376, 3394), True, 'import numpy as np\n'), ((4191, 4218), 'numpy.median', 'np.median', (['matrices'], {'axis': '(0)'}), '(matrices, axis=0)\n', (4200, 4218), True, 'import numpy as np\n'), ((4816, 4840), 'numpy.max', 'np... |
""" suggest a sensible tolerance for a matrix and coverage-rate (default 0.6).
"""
from typing import Optional
import numpy as np
from tqdm import trange
from logzero import logger
from .coverage_rate import coverage_rate
# fmt: off
def suggest_tolerance(
mat: np.ndarray,
c_rate: float = 0.66,
... | [
"numpy.asarray",
"logzero.logger.warning",
"logzero.logger.info",
"tqdm.trange",
"logzero.logger.erorr"
] | [((480, 495), 'numpy.asarray', 'np.asarray', (['mat'], {}), '(mat)\n', (490, 495), True, 'import numpy as np\n'), ((804, 836), 'tqdm.trange', 'trange', (['(tolerance + 1)', '(limit + 1)'], {}), '(tolerance + 1, limit + 1)\n', (810, 836), False, 'from tqdm import trange\n'), ((999, 1074), 'logzero.logger.warning', 'logg... |
import gym
from gym import spaces
import numpy as np
import os
import sys
from m_gym.envs.createsim import CreateSimulation
from m_gym.envs.meveahandle import MeveaHandle
from time import sleep
from math import exp
class ExcavatorDiggingSparseEnv(gym.Env):
def __init__(self):
super(ExcavatorDiggingSparseEnv, ... | [
"numpy.ones",
"m_gym.envs.meveahandle.MeveaHandle",
"m_gym.envs.createsim.CreateSimulation",
"time.sleep",
"gym.spaces.Box",
"numpy.zeros",
"os.path.abspath"
] | [((754, 783), 'm_gym.envs.createsim.CreateSimulation', 'CreateSimulation', (['self.config'], {}), '(self.config)\n', (770, 783), False, 'from m_gym.envs.createsim import CreateSimulation\n'), ((1156, 1196), 'numpy.zeros', 'np.zeros', (['self.obs_len'], {'dtype': 'np.float32'}), '(self.obs_len, dtype=np.float32)\n', (11... |
#!/usr/bin/env python
"""PyDEC: Software and Algorithms for Discrete Exterior Calculus
"""
DOCLINES = __doc__.split("\n")
import os
import sys
CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
Intended Audience :: Education
License :... | [
"os.path.exists",
"sys.path.insert",
"os.path.join",
"numpy.distutils.misc_util.Configuration",
"os.getcwd",
"os.chdir",
"os.path.abspath",
"os.remove"
] | [((762, 788), 'os.path.exists', 'os.path.exists', (['"""MANIFEST"""'], {}), "('MANIFEST')\n", (776, 788), False, 'import os\n'), ((790, 811), 'os.remove', 'os.remove', (['"""MANIFEST"""'], {}), "('MANIFEST')\n", (799, 811), False, 'import os\n'), ((934, 979), 'numpy.distutils.misc_util.Configuration', 'Configuration', ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.