code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 26 13:12:28 2021
@author: <NAME> -workshop-LA-UP_IIT
"""
import geopandas as gpd
import fiona,io
from tqdm import tqdm
import pyproj
# pd.set_option('display.max_columns', None)
nanjing_epsg=32650 #Nanjing
data_dic={
'road_network':r'.\data\GIS\road Network Data OF ... | [
"osgeo.gdal.Open",
"numpy.ma.masked_equal",
"pandas.read_csv",
"io.BytesIO",
"earthpy.spatial.stack",
"pyproj.Transformer.from_crs",
"shapely.geometry.Polygon",
"earthpy.plot.plot_bands",
"earthpy.spatial.crop_image",
"copy.deepcopy",
"pandas.read_excel",
"geopandas.points_from_xy",
"xml.etr... | [((2833, 2872), 'geopandas.read_file', 'gpd.read_file', (['kml_extent'], {'driver': '"""KML"""'}), "(kml_extent, driver='KML')\n", (2846, 2872), True, 'import geopandas as gpd\n'), ((2913, 2936), 'pyproj.CRS', 'pyproj.CRS', (['"""EPSG:4326"""'], {}), "('EPSG:4326')\n", (2923, 2936), False, 'import pyproj\n'), ((3082, 3... |
"""
Plot figures for the TreeTime validation, comparison with other methods on the
simulated dataset.
To plot the validation results, CSV files generated by the
'generate_simulated_data.py' script are required.
The script plots the reconstruction of the mutation rate and the tiome of the
most recent common ancestor ... | [
"numpy.mean",
"numpy.median",
"numpy.ones",
"numpy.unique",
"pandas.read_csv",
"matplotlib.pyplot.hlines",
"matplotlib.pyplot.figure",
"plot_defaults.shift_point_by_markersize",
"numpy.std",
"pandas.DataFrame",
"numpy.percentile"
] | [((954, 1001), 'pandas.read_csv', 'pandas.read_csv', (['fname'], {'names': 'columns', 'header': '(0)'}), '(fname, names=columns, header=0)\n', (969, 1001), False, 'import pandas\n'), ((1881, 1928), 'pandas.read_csv', 'pandas.read_csv', (['fname'], {'names': 'columns', 'header': '(0)'}), '(fname, names=columns, header=0... |
import cv2
import numpy as np
import sys
sys.path.append('build')
import kosutils
from tracker import *
# Setting the dimensions for output window
H = 700
W = 700
dispWindow = np.zeros((H,W,3),dtype=np.uint8)
PREDICTOR_PATH = "../shape_predictor_5_face_landmarks.dat"
# Creating the object for obj3D class
obj1 = kos... | [
"numpy.copy",
"cv2.flip",
"kosutils.kos_Obj3D",
"numpy.zeros",
"cv2.VideoCapture",
"sys.path.append",
"kosutils.kos_vcam"
] | [((42, 66), 'sys.path.append', 'sys.path.append', (['"""build"""'], {}), "('build')\n", (57, 66), False, 'import sys\n'), ((179, 214), 'numpy.zeros', 'np.zeros', (['(H, W, 3)'], {'dtype': 'np.uint8'}), '((H, W, 3), dtype=np.uint8)\n', (187, 214), True, 'import numpy as np\n'), ((317, 357), 'kosutils.kos_Obj3D', 'kosuti... |
from torch.utils.data import Dataset
import torch
from torchvision import transforms
import cv2 as cv
from PIL import Image
import librosa
import os
import numpy as np
def one_hot_encode(x, size):
temp = [0] * size
temp[x] = 1
return temp
from videotransforms.video_transforms import Compose, Resize, Rando... | [
"PIL.Image.fromarray",
"os.listdir",
"videotransforms.video_transforms.Resize",
"videotransforms.volume_transforms.ClipToTensor",
"numpy.array",
"videotransforms.video_transforms.ColorJitter",
"cv2.VideoCapture",
"videotransforms.video_transforms.Compose",
"videotransforms.video_transforms.RandomRot... | [((718, 743), 'os.listdir', 'os.listdir', (['self.root_dir'], {}), '(self.root_dir)\n', (728, 743), False, 'import os\n'), ((1120, 1149), 'videotransforms.video_transforms.Compose', 'Compose', (['video_transform_list'], {}), '(video_transform_list)\n', (1127, 1149), False, 'from videotransforms.video_transforms import ... |
import sys
import matplotlib
#matplotlib.use('Agg')
matplotlib.use('TkAgg') # revert above
import matplotlib.pyplot as plt
import os
import numpy as np
import glob
def ballistic_flight(v0, g, t):
# assumes perfectly verticle launch and are matching units
# v0-initial velocity
# g-gravitational acceleration... | [
"matplotlib.use",
"numpy.linspace",
"matplotlib.pyplot.plot",
"numpy.where"
] | [((52, 75), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (66, 75), False, 'import matplotlib\n'), ((643, 668), 'numpy.linspace', 'np.linspace', (['(0)', '(500)', '(1000)'], {}), '(0, 500, 1000)\n', (654, 668), True, 'import numpy as np\n'), ((707, 727), 'matplotlib.pyplot.plot', 'plt.plot',... |
import pytesseract
import cv2
import numpy as np
pytesseract.pytesseract.tesseract_cmd = "C:/Program Files/Tesseract-OCR/tesseract.exe"
# Error prevention code
def ocr_from_img(path):
img_array = np.fromfile(path, np.uint8)
#한글경로 오류 방지 코드
img = cv2.imdecode(img_array, cv2.IMREAD_UNCHANGED) # img = cv2... | [
"numpy.fromfile",
"cv2.adaptiveThreshold",
"cv2.imdecode",
"pytesseract.image_to_string",
"cv2.cvtColor"
] | [((203, 230), 'numpy.fromfile', 'np.fromfile', (['path', 'np.uint8'], {}), '(path, np.uint8)\n', (214, 230), True, 'import numpy as np\n'), ((260, 305), 'cv2.imdecode', 'cv2.imdecode', (['img_array', 'cv2.IMREAD_UNCHANGED'], {}), '(img_array, cv2.IMREAD_UNCHANGED)\n', (272, 305), False, 'import cv2\n'), ((346, 383), 'c... |
import numpy as np
import math
def _t(x):
return [[x[i][j] for i in range(len(x))] for j in range(len(x[0]))]
class Geometry:
@classmethod
def fromobjstr(cls, code, flip=False):
from .loader import readobj
from io import BytesIO
obj = readobj(BytesIO(code))
if flip:
... | [
"taichi_three.reset",
"taichi_three.GUI",
"taichi_three.Light",
"io.BytesIO",
"math.cos",
"numpy.array",
"taichi_three.readobj",
"numpy.linalg.norm",
"taichi_three.Scene",
"numpy.arange",
"numpy.cross",
"numpy.linspace",
"taichi_three.Vector",
"numpy.concatenate",
"numpy.meshgrid",
"nu... | [((4620, 4668), 'numpy.concatenate', 'np.concatenate', (["[obj['vp'], other['vp']]"], {'axis': '(0)'}), "([obj['vp'], other['vp']], axis=0)\n", (4634, 4668), True, 'import numpy as np\n'), ((4685, 4733), 'numpy.concatenate', 'np.concatenate', (["[obj['vn'], other['vn']]"], {'axis': '(0)'}), "([obj['vn'], other['vn']], ... |
import json
import os
import sys
from datetime import date, datetime
import numpy as np
import pandas as pd
from dateutil import rrule
from config import *
class Krypfolio:
def __init__(self, debug=True) -> None:
super().__init__()
self.debug = debug
def _print(self, msg):
if self.d... | [
"os.path.exists",
"numpy.abs",
"dateutil.rrule.rrule",
"datetime.datetime.strptime",
"os.mkdir",
"pandas.DataFrame",
"datetime.date.today"
] | [((3771, 3807), 'datetime.datetime.strptime', 'datetime.strptime', (['start', '"""%Y-%m-%d"""'], {}), "(start, '%Y-%m-%d')\n", (3788, 3807), False, 'from datetime import date, datetime\n'), ((3824, 3836), 'datetime.date.today', 'date.today', ([], {}), '()\n', (3834, 3836), False, 'from datetime import date, datetime\n'... |
import numpy as np
from numpy.testing import assert_equal
import pandas as pd
from pandas.testing import assert_frame_equal, assert_series_equal
import pytest
from linearmodels.iv.data import IVData
try:
import xarray as xr
MISSING_XARRAY = False
except ImportError:
MISSING_XARRAY = True
def test_numpy... | [
"pandas.Series",
"numpy.testing.assert_equal",
"numpy.ones",
"numpy.arange",
"pandas.Categorical",
"numpy.random.randn",
"numpy.empty",
"pytest.raises",
"xarray.DataArray",
"pytest.mark.skipif",
"pandas.DataFrame",
"pandas.testing.assert_frame_equal",
"linearmodels.iv.data.IVData",
"pandas... | [((2017, 2082), 'pytest.mark.skipif', 'pytest.mark.skipif', (['MISSING_XARRAY'], {'reason': '"""xarray not installed"""'}), "(MISSING_XARRAY, reason='xarray not installed')\n", (2035, 2082), False, 'import pytest\n'), ((2856, 2921), 'pytest.mark.skipif', 'pytest.mark.skipif', (['MISSING_XARRAY'], {'reason': '"""xarray ... |
# utility functions such as statistics
import skimage.io as io
import json
import argparse
import numpy as np
import os
def get_subset_stats(json_path):
"""
Calculate the statistics of subset dataset
Args:
json_path: A path to subset json file
"""
with open(json_path) as json_f... | [
"os.listdir",
"argparse.ArgumentParser",
"os.path.join",
"numpy.max",
"numpy.empty",
"skimage.io.imsave",
"numpy.nonzero",
"numpy.min",
"json.load",
"numpy.round"
] | [((1507, 1530), 'os.listdir', 'os.listdir', (['metric_path'], {}), '(metric_path)\n', (1517, 1530), False, 'import os\n'), ((4299, 4313), 'numpy.round', 'np.round', (['mask'], {}), '(mask)\n', (4307, 4313), True, 'import numpy as np\n'), ((4327, 4343), 'numpy.nonzero', 'np.nonzero', (['mask'], {}), '(mask)\n', (4337, 4... |
import numpy as np
from tsfuse.transformers.uniqueness import *
from tsfuse.data import Collection
def test_has_duplicate_true():
x = Collection.from_array([1, 2, 3, 3])
actual = HasDuplicate().transform(x).values
np.testing.assert_equal(actual, True)
def test_has_duplicate_false():
x = Collection.... | [
"numpy.testing.assert_equal",
"tsfuse.data.Collection.from_array"
] | [((141, 176), 'tsfuse.data.Collection.from_array', 'Collection.from_array', (['[1, 2, 3, 3]'], {}), '([1, 2, 3, 3])\n', (162, 176), False, 'from tsfuse.data import Collection\n'), ((229, 266), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['actual', '(True)'], {}), '(actual, True)\n', (252, 266), True, 'imp... |
"""
Centrographic measures for point patterns
TODO
- testing
- documentation
"""
__author__ = "<NAME> <EMAIL>"
__all__ = ['mbr', 'hull', 'mean_center', 'weighted_mean_center',
'manhattan_median', 'std_distance', 'euclidean_median', 'ellipse',
'skyum', 'dtot',"_circle"]
import sys
import nump... | [
"numpy.median",
"numpy.sqrt",
"pysal.lib.cg.Ray",
"scipy.optimize.minimize",
"numpy.asarray",
"scipy.spatial.ConvexHull",
"numpy.lexsort",
"numpy.dot",
"warnings.warn",
"numpy.cos",
"copy.deepcopy",
"numpy.sin",
"pysal.lib.cg.is_clockwise",
"numpy.arctan"
] | [((1284, 1302), 'numpy.asarray', 'np.asarray', (['points'], {}), '(points)\n', (1294, 1302), True, 'import numpy as np\n'), ((1935, 1953), 'numpy.asarray', 'np.asarray', (['points'], {}), '(points)\n', (1945, 1953), True, 'import numpy as np\n'), ((1962, 1980), 'scipy.spatial.ConvexHull', 'ConvexHull', (['points'], {})... |
# ======================================================================================================================
# * Weighted Holistic Atom Localization and Entity Shape (WHALES) descriptors *
# v. 1, May 2018
# --------------------------------------------------------------------------------------------------... | [
"mol_properties.get_coordinates_and_prop",
"numpy.where",
"numpy.delete",
"rdkit.Chem.SanitizeMol",
"numpy.concatenate",
"numpy.full",
"lcm.lmahal",
"numpy.round"
] | [((2986, 3007), 'lcm.lmahal', 'lcm.lmahal', (['coords', 'w'], {}), '(coords, w)\n', (2996, 3007), False, 'import lcm\n'), ((3663, 3678), 'numpy.where', 'np.where', (['(w < 0)'], {}), '(w < 0)\n', (3671, 3678), True, 'import numpy as np\n'), ((3797, 3817), 'numpy.delete', 'np.delete', (['res', 'a', '(0)'], {}), '(res, a... |
"""Plot energy dispersion example."""
import matplotlib.pyplot as plt
import astropy.units as u
import numpy as np
from gammapy.irf import EnergyDispersion
ebounds = np.logspace(-1, 2, 101) * u.TeV
energy_dispersion = EnergyDispersion.from_gauss(e_true=ebounds,
e_reco=eb... | [
"gammapy.irf.EnergyDispersion.from_gauss",
"numpy.logspace",
"matplotlib.pyplot.show"
] | [((219, 289), 'gammapy.irf.EnergyDispersion.from_gauss', 'EnergyDispersion.from_gauss', ([], {'e_true': 'ebounds', 'e_reco': 'ebounds', 'sigma': '(0.3)'}), '(e_true=ebounds, e_reco=ebounds, sigma=0.3)\n', (246, 289), False, 'from gammapy.irf import EnergyDispersion\n'), ((419, 429), 'matplotlib.pyplot.show', 'plt.show'... |
#!/usr/bin/env/python
from typing import Tuple, List, Any, Sequence
import tensorflow as tf
import time
import os
import json
import numpy as np
import pickle
import random
import utils
from utils import MLP, dataset_info, ThreadedIterator, graph_to_adj_mat, SMALL_NUMBER, LARGE_NUMBER, graph_to_adj_mat
import csv
cla... | [
"tensorflow.local_variables_initializer",
"tensorflow.transpose",
"tensorflow.set_random_seed",
"tensorflow.variables_initializer",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.placeholder",
"json.dumps",
"numpy.random.seed",
"os.getpid",
"tensorflow.ConfigProto",
"tensorflow.train.Ad... | [((2081, 2145), 'os.path.join', 'os.path.join', (['log_dir', "('%s_log_%s.json' % (self.run_id, dataset))"], {}), "(log_dir, '%s_log_%s.json' % (self.run_id, dataset))\n", (2093, 2145), False, 'import os\n'), ((2177, 2231), 'os.path.join', 'os.path.join', (['log_dir', "('%s_model.pickle' % self.run_id)"], {}), "(log_di... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
from pandas.api.types import is_string_dtype, is_numeric_dtype
import logging
import os
import os.path as osp
import numpy as np
import json
from ray.tune.util import flatten_dict
logger =... | [
"logging.getLogger",
"pandas.api.types.is_numeric_dtype",
"pandas.api.types.is_string_dtype",
"os.path.join",
"json.load",
"numpy.argwhere",
"pandas.DataFrame",
"os.walk"
] | [((321, 348), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (338, 348), False, 'import logging\n'), ((1563, 1581), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (1575, 1581), True, 'import pandas as pd\n'), ((1703, 1727), 'pandas.api.types.is_numeric_dtype', 'is_numeric... |
"""
Functions related to STAAR
"""
import numpy as np
from scipy.stats import cauchy
c = cauchy()
def cct(pvals, weights=None):
"""
Python port of the CCT function as defined in the STAAR R-package (https://github.com/xihaoli/STAAR/blob/2f67fafec591a45e81a54eca24564b09ce90e252/R/CCT.R)
An analytical... | [
"scipy.stats.cauchy",
"numpy.isnan",
"numpy.ones_like",
"numpy.tan"
] | [((94, 102), 'scipy.stats.cauchy', 'cauchy', ([], {}), '()\n', (100, 102), False, 'from scipy.stats import cauchy\n'), ((1630, 1649), 'numpy.ones_like', 'np.ones_like', (['pvals'], {}), '(pvals)\n', (1642, 1649), True, 'import numpy as np\n'), ((1025, 1040), 'numpy.isnan', 'np.isnan', (['pvals'], {}), '(pvals)\n', (103... |
import matlab.engine
import argparse
import torch
from torch.autograd import Variable
import numpy as np
import time, math, glob
import scipy.io as sio
import cv2
parser = argparse.ArgumentParser(description="PyTorch EDSR Eval")
parser.add_argument("--cuda", action="store_true", help="use cuda?")
parser.add... | [
"numpy.clip",
"numpy.mean",
"argparse.ArgumentParser",
"torch.load",
"scipy.io.loadmat",
"torch.from_numpy",
"numpy.array",
"torch.cuda.is_available",
"math.log10",
"time.time",
"glob.glob"
] | [((182, 238), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch EDSR Eval"""'}), "(description='PyTorch EDSR Eval')\n", (205, 238), False, 'import argparse\n'), ((1233, 1264), 'glob.glob', 'glob.glob', (["(opt.dataset + '/*.*')"], {}), "(opt.dataset + '/*.*')\n", (1242, 1264), False... |
import subprocess
import numpy as np
from matplotlib import pyplot as plt
import os
cmd = f'go run main.go'.replace('\\', '/')
print(cmd)
subprocess.check_output(cmd, shell=True)
data = np.genfromtxt('out.csv', delimiter=",")
print(data)
plt.plot(data[:, 0], data[:, 1], label="Track")
plt.plot(data[:, 2], data[:, ... | [
"subprocess.check_output",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"os.remove",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"numpy.genfromtxt",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((140, 180), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {'shell': '(True)'}), '(cmd, shell=True)\n', (163, 180), False, 'import subprocess\n'), ((189, 228), 'numpy.genfromtxt', 'np.genfromtxt', (['"""out.csv"""'], {'delimiter': '""","""'}), "('out.csv', delimiter=',')\n", (202, 228), True, 'import... |
# Authors: <NAME> <<EMAIL>>
# License: BSD
import glob
import os.path as op
import numpy as np
import pytest
from mne import what, create_info
from mne.datasets import testing
from mne.io import RawArray
from mne.preprocessing import ICA
from mne.utils import requires_sklearn
data_path = testing.data_path(download=... | [
"mne.datasets.testing.data_path",
"mne.create_info",
"os.path.join",
"os.path.splitext",
"mne.what",
"mne.preprocessing.ICA",
"numpy.random.RandomState",
"pytest.warns"
] | [((293, 326), 'mne.datasets.testing.data_path', 'testing.data_path', ([], {'download': '(False)'}), '(download=False)\n', (310, 326), False, 'from mne.datasets import testing\n'), ((485, 500), 'mne.preprocessing.ICA', 'ICA', ([], {'max_iter': '(1)'}), '(max_iter=1)\n', (488, 500), False, 'from mne.preprocessing import ... |
import pandas as pd
import pickle
import numpy as np
from keras import backend as K
import tensorflow as tf
import os
from tune_hyperparameters import TuneNeuralNet
# Load training data and stopwords
train_data = pd.read_pickle('../../../data/train_data.pkl')
with open('../../../data/stopwords.pkl', 'rb') as f:
st... | [
"pandas.read_pickle",
"tensorflow.compat.v1.ConfigProto",
"tune_hyperparameters.TuneNeuralNet",
"keras.backend.set_session",
"pickle.load",
"numpy.linspace",
"tensorflow.compat.v1.Session"
] | [((214, 260), 'pandas.read_pickle', 'pd.read_pickle', (['"""../../../data/train_data.pkl"""'], {}), "('../../../data/train_data.pkl')\n", (228, 260), True, 'import pandas as pd\n'), ((423, 616), 'tensorflow.compat.v1.ConfigProto', 'tf.compat.v1.ConfigProto', ([], {'intra_op_parallelism_threads': 'NUM_PARALLEL_EXEC_UNIT... |
from typing import Any, List, Optional
import numpy as np
from rdkit.Chem import rdchem, rdmolfiles, rdmolops, rdDistGeom, rdPartialCharges
class MolFeatureExtractionError(Exception):
pass
def one_hot(x: Any, allowable_set: List[Any]) -> List[int]:
"""One hot encode labels.
If label `x` is not include... | [
"numpy.eye",
"rdkit.Chem.rdPartialCharges.ComputeGasteigerCharges",
"numpy.power",
"rdkit.Chem.rdmolops.AssignStereochemistry",
"rdkit.Chem.rdmolops.RemoveHs",
"rdkit.Chem.rdmolops.GetAdjacencyMatrix",
"numpy.diag",
"numpy.array",
"numpy.zeros",
"rdkit.Chem.rdchem.HybridizationType.names.values",
... | [((2724, 2769), 'rdkit.Chem.rdPartialCharges.ComputeGasteigerCharges', 'rdPartialCharges.ComputeGasteigerCharges', (['mol'], {}), '(mol)\n', (2764, 2769), False, 'from rdkit.Chem import rdchem, rdmolfiles, rdmolops, rdDistGeom, rdPartialCharges\n'), ((2806, 2841), 'rdkit.Chem.rdmolops.AssignStereochemistry', 'rdmolops.... |
import tensorflow as tf
from sparkflow.pipeline_util import PysparkReaderWriter
import numpy as np
from pyspark.ml.param import Param, Params, TypeConverters
from pyspark.ml.param.shared import HasInputCol, HasPredictionCol, HasLabelCol
from pyspark.ml.base import Estimator
from pyspark.ml import Model
from pyspark.ml... | [
"json.loads",
"pyspark.SparkContext._active_spark_context.getConf",
"pyspark.ml.param.Params._dummy",
"numpy.asarray",
"sparkflow.ml_util.convert_weights_to_json",
"sparkflow.ml_util.predict_func"
] | [((1728, 1753), 'numpy.asarray', 'np.asarray', (['data[inp_col]'], {}), '(data[inp_col])\n', (1738, 1753), True, 'import numpy as np\n'), ((1765, 1790), 'numpy.asarray', 'np.asarray', (['data[inp_col]'], {}), '(data[inp_col])\n', (1775, 1790), True, 'import numpy as np\n'), ((1955, 1970), 'pyspark.ml.param.Params._dumm... |
import json
import logging
import os
import sys
from argparse import ArgumentParser
import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics import confusion_matrix, accuracy_score, precision_score, recall_score, f1_score
from transformers import AutoTokenizer
from src.data.bitext import WMT14Transform... | [
"logging.getLogger",
"logging.StreamHandler",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"transformers.AutoTokenizer.from_pretrained",
"logging.info",
"os.path.exists",
"argparse.ArgumentParser",
"matplotlib.pyplot.xlabel",
"numpy.ndenumerate",
"matplotlib.pyplot.yticks",... | [((399, 415), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (413, 415), False, 'from argparse import ArgumentParser\n'), ((2195, 2214), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (2212, 2214), False, 'import logging\n'), ((2746, 2805), 'transformers.AutoTokenizer.from_pretrained', 'Aut... |
# Copyright (c) 2020 NVIDIA Corporation
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, d... | [
"trimesh.transformations.inverse_matrix",
"trimesh.transformations.rotation_matrix",
"numpy.eye",
"trimesh.transformations.compose_matrix",
"trimesh.collision.fcl.Box",
"trimesh.points.PointCloud",
"os.path.join",
"trimesh.load",
"numpy.linspace",
"numpy.array",
"trimesh.util.concatenate",
"tr... | [((1526, 1535), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)\n', (1532, 1535), True, 'import numpy as np\n'), ((2319, 2344), 'trimesh.transformations.inverse_matrix', 'tra.inverse_matrix', (['value'], {}), '(value)\n', (2337, 2344), True, 'import trimesh.transformations as tra\n'), ((3131, 3140), 'numpy.eye', 'np.eye', (... |
import serial
import paho.mqtt.client as mqtt
import json
from datetime import datetime
from o2_helper import GetO2Voltage
import numpy as np
import socket
ser = serial.Serial('/dev/ttyUSB0', 9600)
ser.readline()
ser.readline()
THINGSBOARD_HOST = '192.168.0.200'
ACCESS_TOKEN = socket.gethostname()
client = mqtt.Clien... | [
"o2_helper.GetO2Voltage",
"numpy.linalg.solve",
"paho.mqtt.client.Client",
"json.dumps",
"numpy.array",
"datetime.datetime.now",
"serial.Serial",
"socket.gethostname"
] | [((163, 198), 'serial.Serial', 'serial.Serial', (['"""/dev/ttyUSB0"""', '(9600)'], {}), "('/dev/ttyUSB0', 9600)\n", (176, 198), False, 'import serial\n'), ((280, 300), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (298, 300), False, 'import socket\n'), ((310, 323), 'paho.mqtt.client.Client', 'mqtt.Clien... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import sys
import os
import time
currentUrl = os.path.dirname(__file__)
parentUrl = os.path.abspath(os.path.join(currentUr... | [
"utils.vis.vis_keypoints",
"sys.path.insert",
"config.default.update_config",
"numpy.array",
"utils.transforms.cam2pixel",
"sys.path.append",
"numpy.arange",
"numpy.mean",
"argparse.ArgumentParser",
"numpy.stack",
"numpy.concatenate",
"torchvision.transforms.ToTensor",
"utils.preprocessing.t... | [((244, 269), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (259, 269), False, 'import os\n'), ((335, 361), 'sys.path.append', 'sys.path.append', (['parentUrl'], {}), '(parentUrl)\n', (350, 361), False, 'import sys\n'), ((298, 333), 'os.path.join', 'os.path.join', (['currentUrl', 'os.pardir'... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import astropy.io.fits as pyfits
import numpy as np
import matplotlib.pyplot as plt
import cv2
from matplotlib import gridspec
filename = '/home/bquint/Data/SAM/Lateral_Glowing/DARK180s.fits'
data = pyfits.getdata(filename=filename)
print(data.mean())
print(np.median(data... | [
"matplotlib.pyplot.imshow",
"numpy.mean",
"numpy.median",
"cv2.medianBlur",
"numpy.max",
"astropy.io.fits.getdata",
"numpy.min",
"matplotlib.pyplot.show"
] | [((247, 280), 'astropy.io.fits.getdata', 'pyfits.getdata', ([], {'filename': 'filename'}), '(filename=filename)\n', (261, 280), True, 'import astropy.io.fits as pyfits\n'), ((928, 951), 'cv2.medianBlur', 'cv2.medianBlur', (['data', '(5)'], {}), '(data, 5)\n', (942, 951), False, 'import cv2\n'), ((1148, 1171), 'matplotl... |
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University
# Berlin, 14195 Berlin, Germany.
# 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 ... | [
"pyemma.coordinates.transform.tica.TICA",
"pyemma.coordinates.pipelines.Discretizer",
"pyemma.coordinates.clustering.kmeans.KmeansClustering",
"pyemma.util.log.getLogger",
"pyemma.coordinates.data.frames_from_file.frames_from_file",
"pyemma.coordinates.clustering.assign.AssignCenters",
"pyemma.coordinat... | [((3302, 3331), 'pyemma.util.log.getLogger', '_getLogger', (['"""coordinates.api"""'], {}), "('coordinates.api')\n", (3312, 3331), True, 'from pyemma.util.log import getLogger as _getLogger\n'), ((5360, 5382), 'pyemma.coordinates.data.featurizer.MDFeaturizer', '_MDFeaturizer', (['topfile'], {}), '(topfile)\n', (5373, 5... |
#!/usr/bin/env python
"@package ReadForceField Read force field from a file and print information out."
from forcebalance.parser import parse_inputs
from forcebalance.forcefield import FF
from forcebalance.nifty import printcool
from sys import argv
import os
import numpy as np
def main():
## Set some basic opti... | [
"numpy.array",
"forcebalance.forcefield.FF",
"forcebalance.parser.parse_inputs"
] | [((451, 472), 'forcebalance.parser.parse_inputs', 'parse_inputs', (['argv[1]'], {}), '(argv[1])\n', (463, 472), False, 'from forcebalance.parser import parse_inputs\n'), ((484, 495), 'forcebalance.forcefield.FF', 'FF', (['options'], {}), '(options)\n', (486, 495), False, 'from forcebalance.forcefield import FF\n'), ((5... |
#encoding=utf-8
from nltk.corpus import stopwords
from sklearn.preprocessing import LabelEncoder
from sklearn.pipeline import FeatureUnion
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.linear_model import Ridge
from scipy.sparse import hstack, csr_matrix
import pandas as pd
i... | [
"sklearn.cross_validation.KFold",
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"re.compile",
"numpy.log",
"numpy.array",
"xgboost.DMatrix",
"re.split",
"nltk.corpus.stopwords.words",
"xgboost.train",
"numpy.empty",
"numpy.concatenate",
"pandas.DataFrame",
"scipy.sparse.csr_matr... | [((2487, 2499), 'gc.collect', 'gc.collect', ([], {}), '()\n', (2497, 2499), False, 'import gc, re\n'), ((2525, 2580), 'pandas.DataFrame', 'pd.DataFrame', (['train_features'], {'columns': "['image_quality']"}), "(train_features, columns=['image_quality'])\n", (2537, 2580), True, 'import pandas as pd\n'), ((2605, 2659), ... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 5 10:02:44 2018
@author: wuxiaochuna
"""
import os
import numpy as np
import time
import PIL
import argparse
parser = argparse.ArgumentParser()
parser.add_agrument('--path_val', type=str, default='..\2011_trainaug\raw_segmentation_results',
help='T... | [
"PIL.Image.fromarray",
"os.listdir",
"PIL.Image.open",
"argparse.ArgumentParser",
"numpy.argmax",
"numpy.array",
"numpy.zeros",
"time.time",
"numpy.bincount"
] | [((169, 194), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (192, 194), False, 'import argparse\n'), ((990, 1022), 'os.listdir', 'os.listdir', (['FLAGS.FLAGS.path_val'], {}), '(FLAGS.FLAGS.path_val)\n', (1000, 1022), False, 'import os\n'), ((1662, 1673), 'time.time', 'time.time', ([], {}), '()... |
# build_matrix.py
#
# <NAME>
# <EMAIL>
#
# APPM 4380: Project 3. Least Squares Inversion
# Code to build equation matrix.
#
# The Algorithm works by counting the number of points along the trajectory
# of the X-Ray in each grid-box. The number of points tallied correspond
# to the coefficient in the equation matrix.
#
... | [
"numpy.sqrt",
"numpy.tan",
"numpy.delete",
"numpy.linspace",
"numpy.zeros",
"numpy.all",
"numpy.genfromtxt"
] | [((1177, 1214), 'numpy.linspace', 'np.linspace', (['theta_i', 'theta_f', 'Ntheta'], {}), '(theta_i, theta_f, Ntheta)\n', (1188, 1214), True, 'import numpy as np\n'), ((1245, 1275), 'numpy.zeros', 'np.zeros', (['[m * Ntheta, N ** 2]'], {}), '([m * Ntheta, N ** 2])\n', (1253, 1275), True, 'import numpy as np\n'), ((1275,... |
#!/usr/bin/env python3
# pylint: disable=too-many-instance-attributes
"""
Handling of logs and plots for learning
"""
import os
import sys
script_dir = os.path.dirname(__file__)
parent_dir = os.path.abspath(os.path.join(script_dir, os.pardir))
sys.path.insert(1, parent_dir)
import shutil
import pickle
from dataclasse... | [
"sys.path.insert",
"matplotlib.pyplot.ylabel",
"scipy.interpolate.interp1d",
"matplotlib.pyplot.fill_between",
"numpy.array",
"numpy.arange",
"numpy.mean",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.max",
"matplotlib.pyplot.close",
"os.mkdir",
"numpy.min",
"matplotlib.pyp... | [((153, 178), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (168, 178), False, 'import os\n'), ((245, 275), 'sys.path.insert', 'sys.path.insert', (['(1)', 'parent_dir'], {}), '(1, parent_dir)\n', (260, 275), False, 'import sys\n'), ((208, 243), 'os.path.join', 'os.path.join', (['script_dir',... |
import numpy as np
from scipy import linalg
from pressio4py import logger, solvers, ode
class MySys1:
def createResidual(self):
return np.zeros(5)
def createJacobian(self):
return np.zeros((5,2))
def residual(self, stateIn, R):
for i in range(5):
R[i] = float(i)
def jacobian(self, stateIn... | [
"pressio4py.logger.initialize",
"numpy.allclose",
"numpy.ones",
"pressio4py.logger.finalize",
"numpy.array",
"numpy.zeros",
"scipy.linalg.lapack.dgetrf",
"scipy.linalg.lapack.dgetrs",
"pressio4py.solvers.create_gauss_newton",
"pressio4py.logger.setVerbosity"
] | [((741, 781), 'pressio4py.logger.initialize', 'logger.initialize', (['logger.logto.terminal'], {}), '(logger.logto.terminal)\n', (758, 781), False, 'from pressio4py import logger, solvers, ode\n'), ((784, 828), 'pressio4py.logger.setVerbosity', 'logger.setVerbosity', (['[logger.loglevel.debug]'], {}), '([logger.logleve... |
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | [
"pandas.read_csv",
"modin.pandas.Series",
"modin.pandas.read_csv",
"pyarrow.Table.from_pydict",
"numpy.int32",
"pandas.Index",
"modin.pandas.test.utils.df_equals",
"modin.pandas.concat",
"modin.pandas.utils.from_arrow",
"pandas.MultiIndex.from_tuples",
"numpy.arange",
"pandas.to_datetime",
"... | [((1116, 1140), 'modin.config.IsExperimental.put', 'IsExperimental.put', (['(True)'], {}), '(True)\n', (1134, 1140), False, 'from modin.config import IsExperimental, Engine, StorageFormat\n'), ((1141, 1161), 'modin.config.Engine.put', 'Engine.put', (['"""native"""'], {}), "('native')\n", (1151, 1161), False, 'from modi... |
import sys
import numpy as np
import pandas as pd
from pspy import so_dict, so_map
d = so_dict.so_dict()
d.read_from_file(sys.argv[1])
binary = so_map.read_map(d["template"])
if binary.data.ndim > 2:
# Only use temperature
binary.data = binary.data[0]
binary.data = binary.data.astype(np.int16)
binary.data[:]... | [
"pspy.so_dict.so_dict",
"pandas.read_csv",
"pspy.so_map.read_map",
"numpy.deg2rad",
"pandas.read_table"
] | [((89, 106), 'pspy.so_dict.so_dict', 'so_dict.so_dict', ([], {}), '()\n', (104, 106), False, 'from pspy import so_dict, so_map\n'), ((147, 177), 'pspy.so_map.read_map', 'so_map.read_map', (["d['template']"], {}), "(d['template'])\n", (162, 177), False, 'from pspy import so_dict, so_map\n'), ((424, 489), 'pandas.read_ta... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"numpy.log10",
"numpy.sqrt",
"numpy.argsort",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.imshow",
"numpy.mean",
"numpy.where",
"numpy.tanh",
"numpy.max",
"numpy.dot",
"numpy.linalg.lstsq",
"numpy.min",
"numpy.linalg.eigh",
"numpy.eye",
"numpy.ones",
"numpy.squeeze",
"numpy.t... | [((1461, 1472), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (1469, 1472), True, 'import numpy as np\n'), ((6899, 6948), 'numpy.array', 'np.array', (['[datum_b_c for datum_b_c in data_a_b_c]'], {}), '([datum_b_c for datum_b_c in data_a_b_c])\n', (6907, 6948), True, 'import numpy as np\n'), ((6964, 7004), 'numpy.tra... |
import sys
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle, PathPatch
from scipy.sparse import csr_matrix, coo_matrix
from scipy.sparse.csgraph import dijkstra
from timeit import default_timer as timer
from mpl_toolkits.mplot3d import axes3d
import mpl_toolk... | [
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.savefig",
"numpy.sqrt",
"matplotlib.use",
"timeit.default_timer",
"numpy.floor",
"scipy.sparse.csgraph.dijkstra",
"numpy.dot",
"numpy.zeros",
"matplotlib.pyplot.figure",
"mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d",
"scipy.sparse.coo_matrix... | [((348, 371), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (362, 371), False, 'import matplotlib\n'), ((2255, 2307), 'numpy.zeros', 'np.zeros', (['(self.n_x + 1, self.n_y + 1, self.n_z + 1)'], {}), '((self.n_x + 1, self.n_y + 1, self.n_z + 1))\n', (2263, 2307), True, 'import numpy as np\n')... |
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
def plot_2ala_ramachandran(traj, ax=None, weights=None):
import mdtraj as md
if ax == None:
ax = plt.gca()
if isinstance(weights, np.ndarray):
ax.hist2d(
md.compute_phi(traj)[1].reshape(-1),
... | [
"matplotlib.pyplot.gca",
"mdtraj.compute_psi",
"numpy.linspace",
"mdtraj.compute_phi",
"matplotlib.colors.LogNorm"
] | [((192, 201), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (199, 201), True, 'import matplotlib.pyplot as plt\n'), ((460, 480), 'matplotlib.colors.LogNorm', 'mpl.colors.LogNorm', ([], {}), '()\n', (478, 480), True, 'import matplotlib as mpl\n'), ((748, 768), 'matplotlib.colors.LogNorm', 'mpl.colors.LogNorm', (... |
import autograd.numpy as anp
import numpy as np
from numpy import linalg as LA
from pymoo.util.misc import stack
from pymoo.model.problem import Problem
class Lamp(Problem):
def __init__(self, focal_z):
super().__init__(n_var=21,
n_obj=3,
n_constr=0,
xl=anp.array(21*[0]),
xu=anp.array(21*[1])... | [
"numpy.reshape",
"numpy.ones",
"autograd.numpy.column_stack",
"autograd.numpy.array",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.empty_like",
"numpy.concatenate",
"numpy.linalg.norm"
] | [((673, 724), 'numpy.array', 'np.array', (['[2 * scale, 2 * scale, self.focalPoint_z]'], {}), '([2 * scale, 2 * scale, self.focalPoint_z])\n', (681, 724), True, 'import numpy as np\n'), ((1124, 1154), 'autograd.numpy.column_stack', 'anp.column_stack', (['[f1, f2, f3]'], {}), '([f1, f2, f3])\n', (1140, 1154), True, 'imp... |
"""plotlib.py: Module is used to plotting tools"""
__author__ = "<NAME>."
__copyright__ = ""
__credits__ = []
__license__ = "MIT"
__version__ = "1.0."
__maintainer__ = "<NAME>."
__email__ = "<EMAIL>"
__status__ = "Research"
import matplotlib as mpl
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as ... | [
"numpy.abs",
"matplotlib.rcParams.update",
"matplotlib.use",
"matplotlib.pyplot.style.use",
"numpy.min",
"numpy.max",
"matplotlib.pyplot.close",
"numpy.angle",
"matplotlib.pyplot.figure",
"scipy.stats.pearsonr",
"matplotlib.pyplot.subplots"
] | [((270, 291), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (284, 291), False, 'import matplotlib\n'), ((325, 359), 'matplotlib.pyplot.style.use', 'plt.style.use', (["['science', 'ieee']"], {}), "(['science', 'ieee'])\n", (338, 359), True, 'import matplotlib.pyplot as plt\n'), ((3478, 3566), 'ma... |
"""
Copyright 2018 <NAME>, S.A.
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
d... | [
"random.sample",
"collections.deque",
"numpy.random.rand",
"random.randrange"
] | [((1244, 1262), 'collections.deque', 'deque', ([], {'maxlen': '(2000)'}), '(maxlen=2000)\n', (1249, 1262), False, 'from collections import deque\n'), ((1800, 1843), 'random.sample', 'random.sample', (['self.memory', 'self.batch_size'], {}), '(self.memory, self.batch_size)\n', (1813, 1843), False, 'import random\n'), ((... |
from __future__ import division, print_function, absolute_import
__author__ = '<NAME>'
import numpy
from hep_ml.losses import CompositeLossFunction, MSELossFunction
from pruning import greedy, utils
def test_pruner(mx_filename='../data/formula.mx', higgs_filename='../data/training.csv'):
with open(mx_filename, ... | [
"hep_ml.losses.CompositeLossFunction",
"pruning.utils.get_higgs_data",
"numpy.array",
"hep_ml.losses.MSELossFunction"
] | [((379, 415), 'pruning.utils.get_higgs_data', 'utils.get_higgs_data', (['higgs_filename'], {}), '(higgs_filename)\n', (399, 415), False, 'from pruning import greedy, utils\n'), ((424, 455), 'numpy.array', 'numpy.array', (['X'], {'dtype': '"""float32"""'}), "(X, dtype='float32')\n", (435, 455), False, 'import numpy\n'),... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 10 19:39:26 2017
@author: PiotrTutak
"""
import numpy as np
from itertools import zip_longest
from operator import itemgetter
import random
import sys
"""
Różne funkcje aktywacji używane w testowaniu neuronu:
"""
def ident(x):
return float(x)
... | [
"random.sample",
"numpy.random.choice",
"itertools.zip_longest",
"numpy.exp",
"numpy.array",
"numpy.dot",
"numpy.random.ranf",
"operator.itemgetter"
] | [((2467, 2484), 'numpy.array', 'np.array', (['weights'], {}), '(weights)\n', (2475, 2484), True, 'import numpy as np\n'), ((3098, 3119), 'numpy.array', 'np.array', (['inputValues'], {}), '(inputValues)\n', (3106, 3119), True, 'import numpy as np\n'), ((3449, 3466), 'numpy.array', 'np.array', (['weights'], {}), '(weight... |
# -*- coding: utf-8 -*-
import matplotlib
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
# from mpl_toolkits.basemap import Basemap
import xarray as xr
import re
from collections import OrderedDict
from datetime import datetime, timedelta
from scipy.spatial import cKDTree, KDTree
f... | [
"numpy.radians",
"numpy.ma.getmaskarray",
"numpy.sqrt",
"numpy.column_stack",
"numpy.iinfo",
"numpy.array",
"numpy.arctan2",
"numpy.sin",
"datetime.timedelta",
"numpy.ma.isMaskedArray",
"logging.info",
"numpy.arange",
"datetime.datetime",
"numpy.select",
"numpy.full_like",
"numpy.sort"... | [((446, 541), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(levelname)s - %(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s - %(levelname)s - %(message)s',\n level=logging.INFO)\n", (465, 541), False, 'import logging\n'), ((5604, 5625), 'numpy.ma.isMaskedArray', 'm... |
#!/usr/bin/env python3
import numpy as np
from main import sympy_simplex, LP
"""
use jupyter notebook or qtconsole to see formatted results
e.g. > jupyter qtconsole
then in the console:
> %load usage.py
then press ENTER twice
"""
aufgabe1 = LP( # Blatt 2
np.matrix('2 0 6; -2 8 4; 3 6 5'),
np.matrix('10;... | [
"numpy.matrix",
"main.sympy_simplex"
] | [((810, 840), 'main.sympy_simplex', 'sympy_simplex', (['blatt5_aufgabe1'], {}), '(blatt5_aufgabe1)\n', (823, 840), False, 'from main import sympy_simplex, LP\n'), ((267, 300), 'numpy.matrix', 'np.matrix', (['"""2 0 6; -2 8 4; 3 6 5"""'], {}), "('2 0 6; -2 8 4; 3 6 5')\n", (276, 300), True, 'import numpy as np\n'), ((30... |
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... | [
"algorithm.wolrd.World",
"src.utils.logging_engine.logger.error",
"src.utils.json_tools.convert_nodes_to_json",
"src.utils.json_tools.read_json_from_file",
"src.utils.json_tools.get_order_item_dict",
"src.utils.json_tools.get_vehicle_instance_dict",
"copy.copy",
"numpy.load",
"src.utils.input_utils.... | [((1623, 1658), 'numpy.load', 'np.load', (['"""algorithm/factory2id.npy"""'], {}), "('algorithm/factory2id.npy')\n", (1630, 1658), True, 'import numpy as np\n'), ((1667, 1705), 'numpy.load', 'np.load', (['"""algorithm/shortest_path.npy"""'], {}), "('algorithm/shortest_path.npy')\n", (1674, 1705), True, 'import numpy as... |
from PIL import Image, ImageDraw, ImageFont
import numpy as np
import random
from phi.fluidformat import *
def text_to_pixels(text, size=10, binary=False, as_numpy_array=True):
image = Image.new("1" if binary else "L", (len(text)*size*3//4, size), 0)
draw = ImageDraw.Draw(image)
try:
font = ImageF... | [
"random.choice",
"PIL.ImageFont.truetype",
"numpy.sum",
"numpy.array",
"PIL.ImageDraw.Draw",
"numpy.zeros",
"numpy.linspace",
"numpy.all",
"random.randint"
] | [((268, 289), 'PIL.ImageDraw.Draw', 'ImageDraw.Draw', (['image'], {}), '(image)\n', (282, 289), False, 'from PIL import Image, ImageDraw, ImageFont\n'), ((861, 876), 'numpy.zeros', 'np.zeros', (['shape'], {}), '(shape)\n', (869, 876), True, 'import numpy as np\n'), ((1620, 1635), 'numpy.zeros', 'np.zeros', (['shape'], ... |
import sys
from typing import Callable, Dict, Optional, Tuple, Union
import numpy as np
import scipy.sparse
import scipy.sparse.linalg
from datafold.utils.general import is_symmetric_matrix, sort_eigenpairs
class NumericalMathError(Exception):
"""Use for numerical problems/issues, such as singular matrices or t... | [
"numpy.ones",
"datafold.utils.general.is_symmetric_matrix",
"numpy.any",
"numpy.real",
"datafold.utils.general.sort_eigenpairs",
"numpy.isfinite",
"numpy.linalg.norm"
] | [((8006, 8040), 'datafold.utils.general.sort_eigenpairs', 'sort_eigenpairs', (['eigvals', 'eigvects'], {}), '(eigvals, eigvects)\n', (8021, 8040), False, 'from datafold.utils.general import is_symmetric_matrix, sort_eigenpairs\n'), ((7519, 7572), 'numpy.any', 'np.any', (['(eigvals.imag > 100.0 * sys.float_info.epsilon)... |
########################################
__author__ = "<NAME>"
__license__ = "GNU GPLv3"
__version__ = "0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
########################################
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.nn... | [
"torch.nn.functional.conv2d",
"torch.nn.parameter.Parameter",
"torch.rand",
"numpy.arange",
"torch.nn.init.xavier_uniform_",
"torch.unsqueeze",
"torch.Tensor",
"torch.exp",
"torch.nn.init.kaiming_uniform_",
"torch.nn.functional.sigmoid",
"torch.nn.functional.softplus",
"torch.sum",
"scipy.st... | [((1536, 1581), 'torch.nn.functional.max_pool2d', 'F.max_pool2d', (['c1', 'ds', 'ds'], {'return_indices': '(True)'}), '(c1, ds, ds, return_indices=True)\n', (1548, 1581), True, 'import torch.nn.functional as F\n'), ((2012, 2060), 'torch.nn.functional.max_pool2d', 'F.max_pool2d', (['c2_ds', 'ds', 'ds'], {'return_indices... |
## -*- coding: utf-8 -*
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import numpy as np
import math
class Draw(QGraphicsItem):
def __init__(self,width=180, height=180, size=90):
super(Draw,self).__init__()
self.offsetx = 10
self.offsety = 10
se... | [
"numpy.sin",
"numpy.cos",
"numpy.savetxt",
"math.radians"
] | [((7293, 7372), 'numpy.savetxt', 'np.savetxt', (['csv_filename', 'self.angvel_list'], {'delimiter': '""","""', 'header': '""" """', 'fmt': '"""%f"""'}), "(csv_filename, self.angvel_list, delimiter=',', header=' ', fmt='%f')\n", (7303, 7372), True, 'import numpy as np\n'), ((4987, 5032), 'numpy.sin', 'np.sin', (['((90.0... |
"""
Copyright (C) 2019 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license
(https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
import torch
from torch.utils.data import Dataset
import numpy as np
import time
import os
import cv2
import sys
import utils
from datasets.sca... | [
"numpy.log",
"utils.resize_mask",
"numpy.array",
"utils.compute_overlaps",
"numpy.arctan2",
"numpy.linalg.norm",
"utils.writePointCloud",
"utils.compose_image_meta",
"numpy.save",
"numpy.arange",
"os.path.exists",
"numpy.where",
"numpy.stack",
"utils.extract_bboxes",
"numpy.random.seed",... | [((20837, 20957), 'utils.resize_image', 'utils.resize_image', (['image'], {'min_dim': 'config.IMAGE_MAX_DIM', 'max_dim': 'config.IMAGE_MAX_DIM', 'padding': 'config.IMAGE_PADDING'}), '(image, min_dim=config.IMAGE_MAX_DIM, max_dim=config.\n IMAGE_MAX_DIM, padding=config.IMAGE_PADDING)\n', (20855, 20957), False, 'impor... |
import os, sys
import numpy as np
import pybullet as p
class Util:
def __init__(self, pid, np_random):
self.id = pid
self.ik_lower_limits = {}
self.ik_upper_limits = {}
self.ik_joint_ranges = {}
self.ik_rest_poses = {}
self.np_random = np_random
def enable_gpu(... | [
"pkgutil.get_loader",
"numpy.mean",
"numpy.abs",
"numpy.cross",
"GPUtil.getGPUs",
"numpy.any",
"numpy.array",
"numpy.dot",
"GPUtil.showUtilization",
"numpy.cos",
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.sin",
"pybullet.loadPlugin"
] | [((904, 925), 'GPUtil.showUtilization', 'GPU.showUtilization', ([], {}), '()\n', (923, 925), True, 'import GPUtil as GPU\n'), ((988, 1017), 'GPUtil.showUtilization', 'GPU.showUtilization', ([], {'all': '(True)'}), '(all=True)\n', (1007, 1017), True, 'import GPUtil as GPU\n'), ((1219, 1232), 'GPUtil.getGPUs', 'GPU.getGP... |
import bpy
import numpy
import mathutils
from enum import Enum
from mathutils import Matrix, Quaternion, Vector
import xml.etree.ElementTree as ET
import os
os.system('cls')
mesh_targets = {}
controller_targets = {}
images = {}
class SourceType(Enum):
Name_array = 0
float_array = 1
class DataType(Enum):
... | [
"mathutils.Matrix.Identity",
"numpy.asarray",
"xml.etree.ElementTree.Element",
"xml.etree.ElementTree.ElementTree",
"mathutils.Quaternion",
"mathutils.Matrix.Translation",
"os.system",
"xml.etree.ElementTree.SubElement"
] | [((158, 174), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (167, 174), False, 'import os\n'), ((695, 726), 'xml.etree.ElementTree.SubElement', 'ET.SubElement', (['domNode', '"""input"""'], {}), "(domNode, 'input')\n", (708, 726), True, 'import xml.etree.ElementTree as ET\n'), ((975, 1007), 'xml.etree.Ele... |
#!/usr/bin/python
import os
import sys
import glob
import argparse
import tempfile
import numpy as np
import matplotlib.pyplot as plt
import pickle
import scipy.stats as stats
from copy import deepcopy
from subprocess import Popen, PIPE
from get_qdec_info import get_qdec_info
from fs_load_stats import fs_load_stats
f... | [
"numpy.array",
"scipy.stats.ttest_ind",
"numpy.mean",
"argparse.ArgumentParser",
"subprocess.Popen",
"os.path.split",
"scipy.stats.spearmanr",
"get_qdec_info.get_qdec_info",
"pickle.load",
"numpy.nonzero",
"numpy.std",
"os.path.abspath",
"fs_load_stats.fs_load_stats",
"pickle.dump",
"os.... | [((770, 884), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Analyze aparc12 surface annotation: Surface area and average thickness"""'}), "(description=\n 'Analyze aparc12 surface annotation: Surface area and average thickness')\n", (793, 884), False, 'import argparse\n'), ((1810, 18... |
import pandas
import os
import math
import numpy
from scipy import stats
pandas.set_option('display.max_rows', 200, 'display.max_columns', 200) # change it to see more or less rows and/or columns
# Ask inputs to read the TSV file
dirPath = input('Enter path to TSV file: ')
inputName = input('Enter TSV name (input fil... | [
"pandas.isnull",
"numpy.mean",
"pandas.merge",
"numpy.log",
"math.sqrt",
"os.path.join",
"os.path.splitext",
"pandas.set_option",
"math.isnan"
] | [((74, 144), 'pandas.set_option', 'pandas.set_option', (['"""display.max_rows"""', '(200)', '"""display.max_columns"""', '(200)'], {}), "('display.max_rows', 200, 'display.max_columns', 200)\n", (91, 144), False, 'import pandas\n'), ((5100, 5199), 'pandas.merge', 'pandas.merge', (['meanAN_DF_gnomAD', 'meanAN_DF_CSVS'],... |
import numpy as np
import pandas as pd
import qrcode
import os
import sys
import time
#图像类别:emoji,动图,商品图片,文字图片,二维码,小程序码
#图像分类
from cv2 import cv2
from PIL import Image,ImageDraw
from datetime import datetime
import time
from pytesseract import image_to_string
class Detect():
def __init__(self):
pass
... | [
"PIL.Image.open",
"os.listdir",
"cv2.cv2.imread",
"cv2.cv2.CascadeClassifier",
"datetime.datetime.now",
"numpy.array",
"PIL.ImageDraw.Draw",
"pytesseract.image_to_string",
"cv2.cv2.cvtColor"
] | [((4069, 4083), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (4081, 4083), False, 'from datetime import datetime\n'), ((545, 567), 'cv2.cv2.imread', 'cv2.imread', (['image_name'], {}), '(image_name)\n', (555, 567), False, 'from cv2 import cv2\n'), ((591, 676), 'cv2.cv2.CascadeClassifier', 'cv2.CascadeClas... |
import os, sys
import numpy as np
from math import sqrt
# testing without install
#sys.path.insert(0, '../build/lib.macosx-10.9-x86_64-3.8')
import poppunk_refine
# Original PopPUNK function (with some improvements)
def withinBoundary(dists, x_max, y_max, slope=2):
boundary_test = np.ones((dists.shape[0]))
fo... | [
"poppunk_refine.assignThreshold",
"numpy.ones",
"math.sqrt",
"poppunk_refine.edgeThreshold",
"poppunk_refine.thresholdIterate2D",
"numpy.array",
"poppunk_refine.thresholdIterate1D",
"numpy.finfo",
"numpy.meshgrid",
"numpy.all",
"numpy.arange"
] | [((1345, 1383), 'numpy.arange', 'np.arange', (['(0)', '(1)', '(0.1)'], {'dtype': 'np.float32'}), '(0, 1, 0.1, dtype=np.float32)\n', (1354, 1383), True, 'import numpy as np\n'), ((1388, 1426), 'numpy.arange', 'np.arange', (['(0)', '(1)', '(0.1)'], {'dtype': 'np.float32'}), '(0, 1, 0.1, dtype=np.float32)\n', (1397, 1426)... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals, division, print_function
"""
This module implements various equation of states.
Note: Most of the code were initially adapted from ASE and deltafactor by
@gmatteo but ... | [
"logging.getLogger",
"numpy.polyfit",
"pymatgen.util.plotting.pretty_plot",
"scipy.optimize.minimize",
"numpy.log",
"numpy.roots",
"numpy.exp",
"numpy.array",
"scipy.optimize.leastsq",
"numpy.linspace",
"numpy.polyder",
"warnings.simplefilter",
"six.with_metaclass",
"copy.deepcopy",
"num... | [((701, 728), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (718, 728), False, 'import logging\n'), ((745, 772), 'six.with_metaclass', 'six.with_metaclass', (['ABCMeta'], {}), '(ABCMeta)\n', (763, 772), False, 'import six\n'), ((1099, 1116), 'numpy.array', 'np.array', (['volumes'], {}), ... |
# -*- coding: utf-8 -*-
import numpy as np
import cv2
import tensorflow as tf
import sys
from demographics_architecture import image_size, cnn_architecture
tf.logging.set_verbosity(tf.logging.INFO)
# Set default flags for the output directories
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string(
flag_name='c... | [
"demographics_architecture.cnn_architecture",
"tensorflow.placeholder",
"tensorflow.train.Saver",
"tensorflow.logging.set_verbosity",
"tensorflow.Session",
"tensorflow.app.flags.DEFINE_string",
"numpy.argmax",
"tensorflow.global_variables_initializer",
"cv2.resize",
"cv2.imread"
] | [((159, 200), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.INFO'], {}), '(tf.logging.INFO)\n', (183, 200), True, 'import tensorflow as tf\n'), ((276, 382), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', ([], {'flag_name': '"""checkpoint_path"""', 'default_value': '"... |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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 applicable... | [
"tensorflow.VarLenFeature",
"tensor2tensor.data_generators.timeseries_data_generator.generate_data",
"tensor2tensor.data_generators.text_encoder.RealEncoder",
"numpy.array",
"tensor2tensor.data_generators.generator_utils.shuffle_dataset",
"tensorflow.reshape"
] | [((5791, 5833), 'tensor2tensor.data_generators.generator_utils.shuffle_dataset', 'generator_utils.shuffle_dataset', (['all_paths'], {}), '(all_paths)\n', (5822, 5833), False, 'from tensor2tensor.data_generators import generator_utils\n'), ((6909, 6925), 'numpy.array', 'np.array', (['series'], {}), '(series)\n', (6917, ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import pickle
import os
import argparse
import torch
from torch import distributions as td
#%%
def example1(e=1, N=10000):
#independent causes
beta = np.array([3.0, 2, 0])
x2_m... | [
"torch.sin",
"torch.sqrt",
"torch.square",
"numpy.array",
"torch.nn.MSELoss",
"torch.normal",
"torch.sum",
"torch.squeeze",
"numpy.mean",
"os.path.exists",
"argparse.ArgumentParser",
"numpy.random.seed",
"torch.randn",
"torch.distributions.Uniform",
"numpy.abs",
"torch.optim.SGD",
"t... | [((290, 311), 'numpy.array', 'np.array', (['[3.0, 2, 0]'], {}), '([3.0, 2, 0])\n', (298, 311), True, 'import numpy as np\n'), ((326, 349), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (343, 349), True, 'import numpy as np\n'), ((360, 392), 'torch.normal', 'torch.normal', (['x2_mean', '... |
import numpy as np
import pickle
"""
The first part of this file is to test if the data.py prepare the data correctly
The second part of this file is to test if the data_FlIC_plus.py prepare the data correctly
"""
### The first part
n_joint = 9 # the number of joint that you want to display
y_test = np.load('y_test_fl... | [
"matplotlib.pyplot.imshow",
"numpy.reshape",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"pickle.load",
"numpy.max",
"numpy.random.randint",
"matplotlib.pyplot.figure",
"numpy.zeros",
"numpy.load",
"matplotlib.pyplot.show"
] | [((302, 328), 'numpy.load', 'np.load', (['"""y_test_flic.npy"""'], {}), "('y_test_flic.npy')\n", (309, 328), True, 'import numpy as np\n'), ((338, 364), 'numpy.load', 'np.load', (['"""x_test_flic.npy"""'], {}), "('x_test_flic.npy')\n", (345, 364), True, 'import numpy as np\n'), ((408, 450), 'numpy.random.randint', 'np.... |
import torch
import torchvision
from torchvision import datasets, transforms
import matplotlib.pyplot as plt
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import argparse
import utils
import dataloader
from lpgnn_wrapper import GNNWrapper, SemiSupGNNWrapper
#
# # fix random seeds for repro... | [
"dataloader.get_karate",
"utils.prepare_device",
"lpgnn_wrapper.GNNWrapper.Config",
"torch.nn.Tanh",
"argparse.ArgumentParser",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"networkx.karate_club_graph",
"numpy.full",
"lpgnn_wrapper.SemiSupGNNWrapper"
] | [((529, 575), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch"""'}), "(description='PyTorch')\n", (552, 575), False, 'import argparse\n'), ((2405, 2473), 'utils.prepare_device', 'utils.prepare_device', ([], {'n_gpu_use': 'args.n_gpu_use', 'gpu_id': 'args.cuda_dev'}), '(n_gpu_use=a... |
# first-order finite-difference implicit method for linear advection
#
# We are solving a_t + u a_x = 0
#
# The upwinded implicit update appears as:
#
# n+1 n+1 n
# -C a + (1 - C) a = a
# i-1 i i
#
# where C is the CFL number
#
# We use a periodic grid with N points, ... | [
"numpy.linalg.solve",
"matplotlib.pyplot.savefig",
"numpy.logical_and",
"matplotlib.pyplot.ylabel",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.zeros",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.legend"
] | [((3002, 3032), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""$x$"""'], {'fontsize': '(16)'}), "('$x$', fontsize=16)\n", (3012, 3032), True, 'import matplotlib.pyplot as plt\n'), ((3033, 3063), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""$a$"""'], {'fontsize': '(16)'}), "('$a$', fontsize=16)\n", (3043, 3063), Tru... |
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
import os
image_size = (224, 224, 3)
def create_white_noise_dataset(n=1):
# creates uniform white noise
seeds = [i for i in range(n)]
for s in seeds:
rs = np.random.RandomState(seed=... | [
"PIL.Image.fromarray",
"os.listdir",
"PIL.Image.open",
"matplotlib.use",
"os.path.join",
"numpy.random.RandomState"
] | [((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (32, 39), False, 'import matplotlib\n'), ((293, 322), 'numpy.random.RandomState', 'np.random.RandomState', ([], {'seed': 's'}), '(seed=s)\n', (314, 322), True, 'import numpy as np\n'), ((417, 451), 'PIL.Image.fromarray', 'Image.fromarray'... |
import keras
from keras import layers
from keras import datasets
from keras.preprocessing.text import one_hot
from keras.preprocessing.sequence import pad_sequences
import numpy as np
from dnpy.layers import *
from dnpy.net import *
from dnpy.optimizers import *
from dnpy.regularizers import *
from dnpy import metrics... | [
"keras.datasets.imdb.load_data",
"dnpy.losses.BinaryCrossEntropy",
"numpy.random.seed",
"numpy.expand_dims",
"dnpy.metrics.BinaryAccuracy",
"keras.preprocessing.sequence.pad_sequences"
] | [((369, 387), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (383, 387), True, 'import numpy as np\n'), ((727, 790), 'keras.datasets.imdb.load_data', 'datasets.imdb.load_data', ([], {'maxlen': 'max_length', 'num_words': 'max_words'}), '(maxlen=max_length, num_words=max_words)\n', (750, 790), False, 'f... |
from __future__ import print_function
from __future__ import division
import random
import time
import itertools as it
import numpy as np
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
from utils import load_data
from train_lstm import LSTM
from train_tdlstm import TDLSTM
from train_tclstm import TC... | [
"hyperopt.fmin",
"random.sample",
"tensorflow.reset_default_graph",
"utils.load_data",
"train_tclstm.TCLSTM",
"train_lstm.LSTM",
"itertools.product",
"tensorflow.logging.set_verbosity",
"hyperopt.hp.quniform",
"train_tdlstm.TDLSTM",
"numpy.random.randint",
"time.time",
"numpy.arange",
"hyp... | [((162, 204), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)\n', (186, 204), True, 'import tensorflow as tf\n'), ((680, 724), 'random.sample', 'random.sample', (['expanded_param_grid', 'sampsize'], {}), '(expanded_param_grid, sampsize)\n', (693, 724), Fal... |
# -*- coding: utf-8 -*-
#==========================================
# Title: CoCaBO_Base.py
# Author: <NAME> and <NAME>
# Date: 20 August 2019
# Link: https://arxiv.org/abs/1906.08878
#==========================================
import collections
import pickle
import random
import numpy as np
from scipy.optimize... | [
"numpy.sqrt",
"numpy.array",
"numpy.mean",
"numpy.where",
"numpy.max",
"numpy.exp",
"numpy.random.seed",
"numpy.vstack",
"numpy.argmin",
"numpy.abs",
"utils.probability.distr",
"utils.probability.draw",
"scipy.optimize.minimize",
"numpy.argmax",
"numpy.std",
"pickle.dump",
"utils.Dep... | [((2286, 2304), 'numpy.argmin', 'np.argmin', (['y_tries'], {}), '(y_tries)\n', (2295, 2304), True, 'import numpy as np\n'), ((2358, 2457), 'scipy.optimize.minimize', 'minimize', (['single_evaluation', 'x_init_min'], {'method': '"""BFGS"""', 'options': "{'gtol': 1e-06, 'disp': False}"}), "(single_evaluation, x_init_min,... |
import argparse
import os
import random
# import sys
# sys.path.insert(0, "")
import numpy as np
import habitat
from habitat.core.challenge import Challenge
class RandomWalker(habitat.Agent):
def __init__(self):
self._POSSIBLE_ACTIONS = np.array([0,1,2,3])
def reset(self):
pass
def act(se... | [
"numpy.random.choice",
"numpy.array",
"habitat.core.challenge.Challenge",
"argparse.ArgumentParser"
] | [((434, 459), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (457, 459), False, 'import argparse\n'), ((674, 696), 'habitat.core.challenge.Challenge', 'Challenge', ([], {'phase': 'phase'}), '(phase=phase)\n', (683, 696), False, 'from habitat.core.challenge import Challenge\n'), ((250, 272), 'nu... |
from keras import backend as K
import numpy as np
def Active_Contour_Loss(y_true, y_pred):
#y_pred = K.cast(y_pred, dtype = 'float64')
"""
lenth term
"""
x = y_pred[:,:,1:,:] - y_pred[:,:,:-1,:] # horizontal and vertical directions
y = y_pred[:,:,:,1:] - y_pred[:,:,:,:-1]
delta_x = x[:,:,1:,:-2]**2
del... | [
"numpy.ones",
"keras.backend.sum",
"keras.backend.sqrt",
"numpy.zeros",
"keras.backend.abs"
] | [((355, 379), 'keras.backend.abs', 'K.abs', (['(delta_x + delta_y)'], {}), '(delta_x + delta_y)\n', (360, 379), True, 'from keras import backend as K\n'), ((578, 597), 'numpy.ones', 'np.ones', (['(256, 256)'], {}), '((256, 256))\n', (585, 597), True, 'import numpy as np\n'), ((605, 625), 'numpy.zeros', 'np.zeros', (['(... |
import unittest
from transition_sampling.engines import ShootingResult
from transition_sampling.algo.aimless_shooting import AsyncAimlessShooting, \
generate_velocities
import numpy as np
import tempfile
class NextPositionTest(unittest.TestCase):
"""Test that picking the next position works"""
def test_... | [
"tempfile.TemporaryDirectory",
"numpy.histogram",
"transition_sampling.algo.aimless_shooting.generate_velocities",
"numpy.argmax",
"numpy.max",
"numpy.zeros",
"numpy.random.seed",
"numpy.linalg.norm",
"unittest.main",
"transition_sampling.algo.aimless_shooting.AsyncAimlessShooting",
"transition_... | [((3102, 3117), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3115, 3117), False, 'import unittest\n'), ((461, 478), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (475, 478), True, 'import numpy as np\n'), ((1422, 1439), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (1436, 1439)... |
import sys, os
sys.path.insert(1, "../")
sys.path.append("../../../")
sys.path.append("../../../competitors/AIF360/")
import numpy as np
np.random.seed(0)
from aif360.datasets import SalaryDataset, BinaryLabelDataset, StructuredDataset
from aif360.metrics import BinaryLabelDatasetMetric
from aif360.metrics import C... | [
"aif360.algorithms.inprocessing.adversarial_debiasing.AdversarialDebiasing",
"sys.path.insert",
"numpy.all",
"numpy.in1d",
"tensorflow.Session",
"find_discm_points.entire_test_suite",
"aif360.datasets.SalaryDataset",
"numpy.array",
"os.path.realpath",
"numpy.random.seed",
"load_salary.permutatio... | [((15, 40), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../"""'], {}), "(1, '../')\n", (30, 40), False, 'import sys, os\n'), ((43, 71), 'sys.path.append', 'sys.path.append', (['"""../../../"""'], {}), "('../../../')\n", (58, 71), False, 'import sys, os\n'), ((72, 119), 'sys.path.append', 'sys.path.append', (['""... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"tensorflow.batch_matmul",
"numpy.reshape",
"numpy.random.rand",
"tensorflow.batch_cholesky",
"tensorflow.test.main",
"numpy.diag",
"numpy.array",
"numpy.dot",
"tensorflow.constant",
"six.moves.xrange",
"numpy.vstack",
"numpy.empty",
"tensorflow.matmul",
"numpy.tril",
"tensorflow.cholesk... | [((3532, 3546), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (3544, 3546), True, 'import tensorflow as tf\n'), ((2147, 2183), 'numpy.array', 'np.array', (['[[[1.0, 0.0], [0.0, 5.0]]]'], {}), '([[[1.0, 0.0], [0.0, 5.0]]])\n', (2155, 2183), True, 'import numpy as np\n'), ((2326, 2389), 'numpy.array', 'np.arr... |
# License: BSD 3 clause
from copy import copy
from datetime import datetime
from typing import List, Tuple
import numpy as np
import pyspark.sql.functions as sf
import pytz
from pyspark.ml.feature import Bucketizer
from pyspark.sql import DataFrame
from scalpel.core.cohort import Cohort
from scalpel.core.util import... | [
"pyspark.sql.functions.lit",
"numpy.ceil",
"pyspark.ml.feature.Bucketizer",
"scalpel.core.cohort.Cohort",
"pyspark.sql.functions.col",
"scalpel.core.util.rename_df_columns",
"copy.copy"
] | [((6959, 7035), 'pyspark.ml.feature.Bucketizer', 'Bucketizer', ([], {'splits': 'self.age_groups', 'inputCol': 'input_col', 'outputCol': 'output_col'}), '(splits=self.age_groups, inputCol=input_col, outputCol=output_col)\n', (6969, 7035), False, 'from pyspark.ml.feature import Bucketizer\n'), ((7477, 7497), 'copy.copy',... |
# Copyright 2019 Image Analysis Lab, German Center for Neurodegenerative Diseases (DZNE), Bonn
#
# 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... | [
"lapy.FuncIO.export_ev",
"numpy.amin",
"numpy.cross",
"lapy.TriaMesh.TriaMesh",
"lapy.Solver.Solver",
"numpy.where",
"optparse.OptionParser",
"numpy.min",
"numpy.max",
"numpy.sum",
"lapy.read_geometry.read_geometry",
"numpy.empty",
"sys.exit",
"numpy.amax",
"nibabel.freesurfer.io.write_g... | [((2205, 2328), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'version': '"""$Id: spherically_project,v 1.1 2017/01/30 20:42:08 ltirrell Exp $"""', 'usage': 'HELPTEXT'}), "(version=\n '$Id: spherically_project,v 1.1 2017/01/30 20:42:08 ltirrell Exp $',\n usage=HELPTEXT)\n", (2226, 2328), False, 'import ... |
# Copyright 2020 The TensorFlow Quantum 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... | [
"cirq.GridQubit.rect",
"tensorflow_quantum.core.ops.noise.noisy_sampled_expectation_op.sampled_expectation",
"tensorflow_quantum.python.util.convert_to_tensor",
"cirq.GridQubit",
"cirq.DensityMatrixSimulator",
"tensorflow_quantum.python.util.get_supported_channels",
"absl.testing.parameterized.parameter... | [((10987, 11226), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (["[{'n_qubits': 13, 'batch_size': 1, 'noisy': False}, {'n_qubits': 6,\n 'batch_size': 25, 'noisy': False}, {'n_qubits': 6, 'batch_size': 10,\n 'noisy': True}, {'n_qubits': 8, 'batch_size': 1, 'noisy': True}]"], {}), "([{'n_qub... |
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"numpy.clip",
"os.getenv",
"jax.util.safe_zip",
"numpy.array",
"time.time"
] | [((2173, 2189), 'numpy.array', 'onp.array', (['times'], {}), '(times)\n', (2182, 2189), True, 'import numpy as onp\n'), ((2075, 2086), 'time.time', 'time.time', ([], {}), '()\n', (2084, 2086), False, 'import time\n'), ((2105, 2116), 'time.time', 'time.time', ([], {}), '()\n', (2114, 2116), False, 'import time\n'), ((17... |
# coding: utf-8
import chainer
class Range(chainer.Chain):
def forward(self, x):
return range(x)
class RangeStop(chainer.Chain):
def forward(self, x, y):
return range(x, y)
class RangeStep(chainer.Chain):
def forward(self, x, y, z):
return range(x, y, z)
class RangeListComp(... | [
"chainer_compiler.ch2o.generate_testcase",
"numpy.int64",
"numpy.random.rand",
"numpy.random.randint"
] | [((618, 652), 'chainer_compiler.ch2o.generate_testcase', 'ch2o.generate_testcase', (['Range', '[5]'], {}), '(Range, [5])\n', (640, 652), False, 'from chainer_compiler import ch2o\n'), ((857, 889), 'numpy.random.randint', 'np.random.randint', (['(0)', '(5)'], {'size': 'wn'}), '(0, 5, size=wn)\n', (874, 889), True, 'impo... |
#####################################################
# Title: HTML parse- and analyser
# Author: <NAME> (<EMAIL>)
# Licence: GPLv2
#####################################################
#!/usr/bin/python
import sys
import sqlite3
import datetime
import timeit
import math
import re
import pandas as pd
imp... | [
"sklearn.feature_selection.VarianceThreshold",
"sklearn.metrics.balanced_accuracy_score",
"sklearn.metrics.classification_report",
"sklearn.metrics.auc",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.roc_curve",
"numpy.mean",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.tree.Decis... | [((1454, 1469), 'sklearn.naive_bayes.MultinomialNB', 'MultinomialNB', ([], {}), '()\n', (1467, 1469), False, 'from sklearn.naive_bayes import MultinomialNB\n'), ((1483, 1521), 'sklearn.ensemble.RandomForestClassifier', 'RandomForestClassifier', ([], {'random_state': '(0)'}), '(random_state=0)\n', (1505, 1521), False, '... |
import argparse
import json
import os
from pathlib import Path
import numpy as np
import torch
import torch.nn as nn
import torchvision
from torch.utils.data import Dataset, ConcatDataset, DataLoader
from torchvision import transforms
from torchvision.datasets.folder import pil_loader
from tqdm import tran... | [
"torch.nn.CrossEntropyLoss",
"torch.max",
"numpy.array_split",
"torch.sum",
"numpy.mean",
"os.listdir",
"argparse.ArgumentParser",
"pathlib.Path",
"numpy.asarray",
"numpy.concatenate",
"torchvision.transforms.ToTensor",
"numpy.random.permutation",
"torch.Tensor.cpu",
"torchvision.transform... | [((6253, 6268), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (6266, 6268), False, 'import torch\n'), ((6856, 6871), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (6869, 6871), False, 'import torch\n'), ((4501, 4606), 'torch.utils.data.DataLoader', 'DataLoader', (['train_data'], {'batch_size': 'batch_size',... |
import pickle
from collections import defaultdict
from pathlib import Path
from typing import Optional, Callable
import numpy as np
import torch
import torch.utils.data as torchdata
from ignite.contrib.handlers import ProgressBar
from ignite.engine import create_supervised_evaluator, Events, Engine
from ignite.metrics... | [
"ignite.engine.create_supervised_evaluator",
"torch.utils.data.ConcatDataset",
"ignite.metrics.Loss",
"ignite.metrics.Accuracy",
"torch.max",
"alr.training.utils.PLPredictionSaver",
"alr.MCDropout",
"ignite.engine.Engine",
"alr.data.datasets.Dataset.MNIST.get_fixed",
"numpy.array",
"torch.cuda.i... | [((6568, 6598), 'torch.utils.data.DataLoader', 'torchdata.DataLoader', ([], {}), '(**kwargs)\n', (6588, 6598), True, 'import torch.utils.data as torchdata\n'), ((8645, 8658), 'ignite.engine.Engine', 'Engine', (['_step'], {}), '(_step)\n', (8651, 8658), False, 'from ignite.engine import create_supervised_evaluator, Even... |
"""
Objective functions can be implemented in this file.
Author:
<NAME>
"""
from random import Random
from zoopt.dimension import Dimension
import numpy as np
class SetCover:
"""
set cover problem for discrete optimization
this problem has some extra initialization tasks, thus we define this problem... | [
"numpy.random.normal",
"numpy.sqrt",
"random.Random",
"zoopt.dimension.Dimension",
"numpy.exp",
"numpy.cos"
] | [((4688, 4696), 'random.Random', 'Random', ([], {}), '()\n', (4694, 4696), False, 'from random import Random\n'), ((4178, 4216), 'zoopt.dimension.Dimension', 'Dimension', (['dim_size', 'dim_regs', 'dim_tys'], {}), '(dim_size, dim_regs, dim_tys)\n', (4187, 4216), False, 'from zoopt.dimension import Dimension\n'), ((5275... |
from typing import Iterable, Union, Optional
from time import strftime, localtime
import pandas as pd
import numpy as np
from tqdm import tqdm
import qontrol
from plab.config import logger, CONFIG
from plab.measurement import measurement, Measurement
from plab.smu.smu_control import smu_control
@measurement
def sweep... | [
"numpy.linspace",
"numpy.zeros_like"
] | [((637, 667), 'numpy.linspace', 'np.linspace', (['imin', 'imax', 'steps'], {}), '(imin, imax, steps)\n', (648, 667), True, 'import numpy as np\n'), ((843, 866), 'numpy.zeros_like', 'np.zeros_like', (['currents'], {}), '(currents)\n', (856, 866), True, 'import numpy as np\n')] |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"mindspore.common.initializer.Zero",
"numpy.ones",
"psutil.Process",
"mindspore.common.initializer.random_normal",
"mindspore.ops.Pow",
"numpy.zeros",
"mindspore.ops.ReduceSum",
"model.resnet.resnet50",
"mindspore.ops.ReduceMean",
"os.getpid",
"mindspore.common.initializer.Normal",
"mindspore.... | [((1060, 1071), 'os.getpid', 'os.getpid', ([], {}), '()\n', (1069, 1071), False, 'import os\n'), ((1081, 1100), 'psutil.Process', 'psutil.Process', (['pid'], {}), '(pid)\n', (1095, 1100), False, 'import psutil\n'), ((2104, 2156), 'mindspore.common.initializer.random_normal', 'random_normal', (['arr.shape', 'seed', 'see... |
"""
An example training an SGDClassifier, performing grid search
using TuneGridSearchCV.
This example uses early stopping to further improve runtimes
by eliminating worse hyperparameter choices early based off
of its average test score from cross validation.
"""
from tune_sklearn import TuneGridSearchCV
from sklearn.... | [
"sklearn.linear_model.SGDClassifier",
"sklearn.model_selection.train_test_split",
"tune_sklearn.TuneGridSearchCV",
"ray.tune.schedulers.MedianStoppingRule",
"sklearn.datasets.load_digits",
"numpy.array"
] | [((516, 538), 'sklearn.datasets.load_digits', 'datasets.load_digits', ([], {}), '()\n', (536, 538), False, 'from sklearn import datasets\n'), ((608, 645), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x', 'y'], {'test_size': '(0.2)'}), '(x, y, test_size=0.2)\n', (624, 645), False, 'from sklearn.mod... |
import argparse
import numpy as np
import rdkit
from moses.metrics.metrics import get_all_metrics
from moses.script_utils import read_smiles_csv
lg = rdkit.RDLogger.logger()
lg.setLevel(rdkit.RDLogger.CRITICAL)
def main(config, print_metrics=True):
test = None
test_scaffolds = None
ptest = None
ptes... | [
"moses.script_utils.read_smiles_csv",
"argparse.ArgumentParser",
"rdkit.RDLogger.logger",
"moses.metrics.metrics.get_all_metrics",
"numpy.load"
] | [((152, 175), 'rdkit.RDLogger.logger', 'rdkit.RDLogger.logger', ([], {}), '()\n', (173, 175), False, 'import rdkit\n'), ((957, 989), 'moses.script_utils.read_smiles_csv', 'read_smiles_csv', (['config.gen_path'], {}), '(config.gen_path)\n', (972, 989), False, 'from moses.script_utils import read_smiles_csv\n'), ((1004, ... |
# coding=utf-8
# Copyright 2020 The Ravens 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 applicable law or... | [
"pybullet.getQuaternionFromEuler",
"numpy.int32",
"ravens.utils.utils.eulerXYZ_to_quatXYZW",
"numpy.random.rand"
] | [((1923, 1968), 'ravens.utils.utils.eulerXYZ_to_quatXYZW', 'utils.eulerXYZ_to_quatXYZW', (['(0, 0, np.pi / 2)'], {}), '((0, 0, np.pi / 2))\n', (1949, 1968), False, 'from ravens.utils import utils\n'), ((3223, 3269), 'ravens.utils.utils.eulerXYZ_to_quatXYZW', 'utils.eulerXYZ_to_quatXYZW', (['(roll, pitch, yaw)'], {}), '... |
"""
Blending module.
Check Blending_ section of W3C recommendation for blending mode definitions.
.. _Blending: https://www.w3.org/TR/compositing/#blending
"""
from __future__ import absolute_import, unicode_literals
import logging
from psd_tools.utils import new_registry
from psd_tools.constants import BlendMode
fr... | [
"logging.getLogger",
"numpy.abs",
"numpy.copy",
"numpy.sqrt",
"numpy.minimum",
"PIL.Image.new",
"numpy.min",
"numpy.max",
"PIL.Image.alpha_composite",
"numpy.stack",
"numpy.expand_dims",
"psd_tools.utils.new_registry",
"numpy.maximum",
"numpy.zeros_like"
] | [((367, 394), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (384, 394), False, 'import logging\n'), ((424, 438), 'psd_tools.utils.new_registry', 'new_registry', ([], {}), '()\n', (436, 438), False, 'from psd_tools.utils import new_registry\n'), ((1013, 1049), 'PIL.Image.new', 'Image.new'... |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import numpy.linalg as la
bear_black = (0.141, 0.11, 0.11)
bear_white = (0.89, 0.856, 0.856)
magenta = (0xfc / 255, 0x75 / 255, 0xdb / 255) # Brighter magenta
orange = (218 / 255, 171 / 255, 115 / 255)
green = (175 / 255, 219 ... | [
"matplotlib.use",
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros_like",
"matplotlib.pyplot.subplots"
] | [((19, 40), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (33, 40), False, 'import matplotlib\n'), ((1770, 3781), 'numpy.array', 'np.array', (['[[2.0030351, 2.229253, 2.1639012, 2.0809546, 1.9728726, 1.8974666, \n 1.8924396, 2.0030351, np.nan, 2.7017972, 2.8500957, 2.9707453, \n 3.0159889,... |
import cv2, time
#TODO: fix ipcam
#import urllib2, base64
import numpy as np
class ipCamera(object):
def __init__(self,url, user = None, password = None):
self.url = url
auth_encoded = base64.encodestring('%s:%s' % (user, password))[:-1]
self.req = urllib2.Request(self.url)
self.r... | [
"numpy.ones",
"cv2.VideoCapture",
"cv2.imdecode",
"cv2.putText"
] | [((540, 566), 'cv2.imdecode', 'cv2.imdecode', (['img_array', '(1)'], {}), '(img_array, 1)\n', (552, 566), False, 'import cv2, time\n'), ((667, 691), 'cv2.VideoCapture', 'cv2.VideoCapture', (['camera'], {}), '(camera)\n', (683, 691), False, 'import cv2, time\n'), ((1003, 1041), 'numpy.ones', 'np.ones', (['(480, 640, 3)'... |
"""
Test the multi-PCA module
"""
import numpy as np
from nose.tools import assert_raises
import nibabel
from nilearn.decomposition.multi_pca import MultiPCA
from nilearn.input_data import MultiNiftiMasker
def test_multi_pca():
# Smoke test the MultiPCA
# XXX: this is mostly a smoke test
shape = (6, 8,... | [
"numpy.eye",
"numpy.testing.assert_array_almost_equal",
"numpy.ones",
"numpy.arange",
"nose.tools.assert_raises",
"nilearn.decomposition.multi_pca.MultiPCA",
"nibabel.Nifti1Image",
"numpy.random.RandomState"
] | [((341, 350), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)\n', (347, 350), True, 'import numpy as np\n'), ((361, 385), 'numpy.random.RandomState', 'np.random.RandomState', (['(0)'], {}), '(0)\n', (382, 385), True, 'import numpy as np\n'), ((758, 797), 'nilearn.decomposition.multi_pca.MultiPCA', 'MultiPCA', ([], {'mask': ... |
#!/usr/bin/env python
# Generic code for a classifier
#
# Subscribes to a feature vector (custom_msgs/Float32MultiArray) and a label (custom_msgs/String)
# Uses upcoming feature data to fit a classifier to predict the label
# Interface with topic command (Start/Stop learning)
import rospy
import numpy as np
import si... | [
"scipy.io.savemat",
"rospy.init_node",
"scipy.io.loadmat",
"numpy.array",
"rospy.Rate",
"copy.deepcopy",
"sys.exit",
"numpy.greater",
"threading.Lock",
"numpy.concatenate",
"joblib.load",
"rospy.Subscriber",
"joblib.dump",
"rospy.Time.now",
"EpicToolbox.mkdirfile",
"rospy.Publisher",
... | [((914, 922), 'custom_msgs.msg.String', 'String', ([], {}), '()\n', (920, 922), False, 'from custom_msgs.msg import String, Float32MultiArray\n'), ((937, 948), 'std_msgs.msg.String', 'StdString', ([], {}), '()\n', (946, 948), True, 'from std_msgs.msg import String as StdString\n'), ((960, 1011), 'rospy.Publisher', 'ros... |
import unittest
from rcwa import Source, Layer, Plotter, Crystal, Solver, LayerStack
from rcwa.shorthand import *
from rcwa.testing import *
from rcwa.matrices import *
from rcwa import numpyArrayFromFile, testLocation, numpyArrayFromSeparatedColumnsFile
import numpy as np
class TestSolver(unittest.TestCase):
de... | [
"numpy.arange",
"rcwa.Source",
"rcwa.Crystal",
"rcwa.Solver",
"numpy.array",
"numpy.loadtxt",
"rcwa.LayerStack",
"rcwa.numpyArrayFromSeparatedColumnsFile",
"rcwa.Layer",
"numpy.transpose",
"rcwa.numpyArrayFromFile"
] | [((5963, 5984), 'rcwa.Layer', 'Layer', ([], {'er': '(2.0)', 'ur': '(1.0)'}), '(er=2.0, ur=1.0)\n', (5968, 5984), False, 'from rcwa import Source, Layer, Plotter, Crystal, Solver, LayerStack\n'), ((6013, 6034), 'rcwa.Layer', 'Layer', ([], {'er': '(9.0)', 'ur': '(1.0)'}), '(er=9.0, ur=1.0)\n', (6018, 6034), False, 'from ... |
from os import path
import numpy as np
from PIL import Image
from scipy import ndimage
from glob import glob
from medraw_handler import medraw2mask
from skimage.color import label2rgb
for f_idx in [1, 2]: # process two images
auto_label = np.array(Image.open('auto_segs/{}_auto_seg.png'.format(f_idx)))
he_imag... | [
"os.path.exists",
"PIL.Image.fromarray",
"medraw_handler.medraw2mask",
"scipy.ndimage.measurements.label",
"scipy.ndimage.binary_fill_holes",
"numpy.zeros",
"skimage.color.label2rgb",
"numpy.zeros_like"
] | [((445, 460), 'os.path.exists', 'path.exists', (['fn'], {}), '(fn)\n', (456, 460), False, 'from os import path\n'), ((664, 690), 'numpy.zeros_like', 'np.zeros_like', (['human_label'], {}), '(human_label)\n', (677, 690), True, 'import numpy as np\n'), ((484, 499), 'medraw_handler.medraw2mask', 'medraw2mask', (['fn'], {}... |
# Copyright (c) 2017 OpenAI (http://openai.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | [
"numpy.prod",
"numpy.allclose",
"numpy.corrcoef",
"numpy.array",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.var"
] | [((1948, 1957), 'numpy.var', 'np.var', (['y'], {}), '(y)\n', (1954, 1957), True, 'import numpy as np\n'), ((2109, 2126), 'numpy.var', 'np.var', (['y'], {'axis': '(0)'}), '(y, axis=0)\n', (2115, 2126), True, 'import numpy as np\n'), ((2299, 2341), 'numpy.concatenate', 'np.concatenate', (['[arr.flat for arr in arrs]'], {... |
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import ast
import json
import math
import os
import six
import numpy as np
import paddle.fluid as fluid
from paddle.fluid.core import PaddleTensor, AnalysisConfig, create... | [
"os.path.exists",
"paddle.fluid.io.load_inference_model",
"paddlehub.module.module.moduleinfo",
"simnet_bow.processor.postprocess",
"argparse.ArgumentParser",
"simnet_bow.processor.preprocess",
"os.path.join",
"paddle.fluid.CPUPlace",
"paddlehub.io.parser.txt_parser.parse",
"simnet_bow.processor.l... | [((821, 1023), 'paddlehub.module.module.moduleinfo', 'moduleinfo', ([], {'name': '"""simnet_bow"""', 'version': '"""1.1.0"""', 'summary': '"""Baidu\'s open-source similarity network model based on bow_pairwise."""', 'author': '"""baidu-nlp"""', 'author_email': '""""""', 'type': '"""nlp/sentiment_analysis"""'}), '(name=... |
from itertools import combinations
import numpy as np
import utility
def sol2(vet1, indice, vet_in):
out = []
while indice >= 1:
# converto in lista la combinations
vet2 = list(combinations(vet1, indice))
for riga in vet2:
# trasformo il vettore in input in un array
... | [
"itertools.combinations",
"numpy.array"
] | [((203, 229), 'itertools.combinations', 'combinations', (['vet1', 'indice'], {}), '(vet1, indice)\n', (215, 229), False, 'from itertools import combinations\n'), ((331, 345), 'numpy.array', 'np.array', (['riga'], {}), '(riga)\n', (339, 345), True, 'import numpy as np\n')] |
import os
import pytest
import taichi as ti
from taichi import approx
def run_mpm88_test():
dim = 2
N = 64
n_particles = N * N
n_grid = 128
dx = 1 / n_grid
inv_dx = 1 / dx
dt = 2.0e-4
p_vol = (dx * 0.5)**2
p_rho = 1
p_mass = p_vol * p_rho
E = 400
x = ti.Vector.field(... | [
"taichi.Vector.zero",
"taichi.test",
"taichi.ndarray",
"os.getenv",
"taichi.Matrix.ndarray",
"taichi.approx",
"taichi.Matrix",
"taichi.Vector.field",
"taichi.field",
"numpy.zeros",
"taichi.Matrix.zero",
"taichi.Vector",
"taichi.any_arr",
"taichi.Vector.ndarray",
"taichi.Matrix.field"
] | [((3540, 3549), 'taichi.test', 'ti.test', ([], {}), '()\n', (3547, 3549), True, 'import taichi as ti\n'), ((3882, 3959), 'taichi.test', 'ti.test', ([], {'require': 'ti.extension.async_mode', 'exclude': '[ti.metal]', 'async_mode': '(True)'}), '(require=ti.extension.async_mode, exclude=[ti.metal], async_mode=True)\n', (3... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.