code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
# -*- coding: UTF-8 -*-
# @Time : 22/04/2019 17:43
# @Author : QYD
import torch
import numpy as np
import functools
from models.fpn_inception import FPNInception
import torch.nn as nn
import cv2 as cv
model_use = ["FPNInception", "FPNMobileNet"]
def post_process(x: torch.Tensor) -> np.ndarray:
... | [
"functools.partial",
"numpy.concatenate",
"cv2.imwrite",
"torch.load",
"models.fpn_inception.FPNInception",
"numpy.transpose",
"cv2.imread",
"numpy.arange",
"numpy.reshape",
"torch.tensor",
"numpy.sqrt"
] | [((791, 827), 'numpy.reshape', 'np.reshape', (['blurred_field', '(h, w, 1)'], {}), '(blurred_field, (h, w, 1))\n', (801, 827), True, 'import numpy as np\n'), ((1124, 1168), 'numpy.concatenate', 'np.concatenate', (['[img, blurred_field]'], {'axis': '(2)'}), '([img, blurred_field], axis=2)\n', (1138, 1168), True, 'import... |
import json
import os
import re
from typing import List, Tuple, Dict, Any, Optional
import math
import numpy as np
from numpy import ma
from ..numpy.pose_body import NumPyPoseBody
from ..pose import Pose
from ..pose_header import PoseHeader, PoseHeaderDimensions, PoseHeaderComponent
BODY_POINTS = ["Nose", "Neck", "R... | [
"numpy.stack",
"json.load",
"numpy.zeros",
"math.floor",
"re.findall",
"numpy.ma.masked_array",
"os.scandir"
] | [((7821, 7887), 'numpy.zeros', 'np.zeros', ([], {'shape': '(num_frames, 1, total_points, 2)', 'dtype': 'np.float32'}), '(shape=(num_frames, 1, total_points, 2), dtype=np.float32)\n', (7829, 7887), True, 'import numpy as np\n'), ((7905, 7968), 'numpy.zeros', 'np.zeros', ([], {'shape': '(num_frames, 1, total_points)', 'd... |
import numpy as np
import pytest
import pandas._libs.index as _index
from pandas.errors import PerformanceWarning
import pandas as pd
from pandas import DataFrame, Index, MultiIndex, Series
import pandas._testing as tm
class TestMultiIndexBasic:
def test_multiindex_perf_warn(self):
df = DataFrame(
... | [
"pandas.DataFrame",
"pandas.MultiIndex.from_tuples",
"pandas.MultiIndex.from_arrays",
"pandas._testing.assert_produces_warning",
"pandas.Index",
"pytest.raises",
"pandas.to_datetime",
"pandas._testing.assert_frame_equal",
"numpy.arange",
"numpy.random.rand"
] | [((1192, 1298), 'pandas.DataFrame', 'DataFrame', (["{'a': ['R1', 'R2', np.nan, 'R4'], 'b': ['C1', 'C2', 'C3', 'C4'], 'c': [10, \n 15, np.nan, 20]}"], {}), "({'a': ['R1', 'R2', np.nan, 'R4'], 'b': ['C1', 'C2', 'C3', 'C4'],\n 'c': [10, 15, np.nan, 20]})\n", (1201, 1298), False, 'from pandas import DataFrame, Index,... |
import numpy as np
from sklearn.utils import check_random_state
from sklearn.covariance import EmpiricalCovariance, LedoitWolf, OAS
def rand_pts_overall_cov_init(X, n_components, cov_est_method='LW',
covariance_type='full', random_state=None):
"""
Sets the means to randomly selec... | [
"sklearn.utils.check_random_state",
"numpy.array",
"sklearn.covariance.OAS",
"sklearn.covariance.EmpiricalCovariance",
"numpy.diag",
"sklearn.covariance.LedoitWolf",
"numpy.repeat"
] | [((1002, 1034), 'sklearn.utils.check_random_state', 'check_random_state', (['random_state'], {}), '(random_state)\n', (1020, 1034), False, 'from sklearn.utils import check_random_state\n'), ((2243, 2258), 'numpy.array', 'np.array', (['means'], {}), '(means)\n', (2251, 2258), True, 'import numpy as np\n'), ((1131, 1173)... |
import numpy as np
from bokeh.plotting import figure, output_file, show
x = np.linspace(-6, 6, 500)
y = 8*np.sin(x)*np.sinc(x)
p = figure(width=800, height=300, title="", tools="",
toolbar_location=None, match_aspect=True)
p.line(x, y, color="navy", alpha=0.4, line_width=4)
p.background_fill_color = "#ef... | [
"bokeh.plotting.figure",
"bokeh.plotting.output_file",
"numpy.sinc",
"numpy.sin",
"bokeh.plotting.show",
"numpy.linspace"
] | [((78, 101), 'numpy.linspace', 'np.linspace', (['(-6)', '(6)', '(500)'], {}), '(-6, 6, 500)\n', (89, 101), True, 'import numpy as np\n'), ((134, 229), 'bokeh.plotting.figure', 'figure', ([], {'width': '(800)', 'height': '(300)', 'title': '""""""', 'tools': '""""""', 'toolbar_location': 'None', 'match_aspect': '(True)'}... |
# ------------------------------------------------------------------------------
# Modified from HRNet-Human-Pose-Estimation
# (https://github.com/HRNet/HRNet-Human-Pose-Estimation)
# Copyright (c) Microsoft
# ------------------------------------------------------------------------------
from __future__ import absolu... | [
"numpy.minimum",
"numpy.maximum",
"numpy.zeros",
"numpy.spacing",
"numpy.where",
"numpy.array",
"numpy.exp"
] | [((1776, 1796), 'numpy.zeros', 'np.zeros', (['d.shape[0]'], {}), '(d.shape[0])\n', (1784, 1796), True, 'import numpy as np\n'), ((4192, 4225), 'numpy.zeros', 'np.zeros', (['max_dets'], {'dtype': 'np.intp'}), '(max_dets, dtype=np.intp)\n', (4200, 4225), True, 'import numpy as np\n'), ((1023, 1055), 'numpy.maximum', 'np.... |
import os
import PIL
import wandb
import numpy
import torch
import torchvision
import seaborn as sns
import matplotlib.pyplot as plt
from Utils.helpers import DeNormalize
class Tensorboard:
def __init__(self, config, online=False, root_dir="./"):
# os.environ['WANDB_API_KEY'] = "your key"
os.syste... | [
"os.mkdir",
"wandb.plot.bar",
"torch.numel",
"seaborn.heatmap",
"wandb.finish",
"matplotlib.pyplot.clf",
"Utils.helpers.DeNormalize",
"torch.argmax",
"numpy.asarray",
"torch.sum",
"os.path.exists",
"os.system",
"torchvision.transforms.ToPILImage",
"torch.softmax",
"wandb.init",
"wandb.... | [((312, 336), 'os.system', 'os.system', (['"""wandb login"""'], {}), "('wandb login')\n", (321, 336), False, 'import os\n'), ((437, 515), 'wandb.init', 'wandb.init', ([], {'project': "config['name']", 'name': "config['experim_name']", 'config': 'config'}), "(project=config['name'], name=config['experim_name'], config=c... |
import numpy as np
from data import load_data, farthest_subsample_points, random_Rt
import open3d as o3d
import random
import h5py
def load_h5(path):
f = h5py.File(path, 'r+')
data = f['data'][:].astype('float32')
label = f['label'][:].astype('int64')
seg = f['seg'][:].astype('int64')
re... | [
"h5py.File",
"open3d.geometry.PointCloud",
"open3d.visualization.draw_geometries",
"numpy.tile",
"numpy.matmul",
"open3d.utility.Vector3dVector",
"data.random_Rt"
] | [((166, 187), 'h5py.File', 'h5py.File', (['path', '"""r+"""'], {}), "(path, 'r+')\n", (175, 187), False, 'import h5py\n'), ((1239, 1264), 'open3d.geometry.PointCloud', 'o3d.geometry.PointCloud', ([], {}), '()\n', (1262, 1264), True, 'import open3d as o3d\n'), ((1276, 1301), 'open3d.geometry.PointCloud', 'o3d.geometry.P... |
# -*- coding: utf-8 -*-
''' PYNALTY.PY
Realiza a análise de um imagem png no momento que a bola entra no gol em pênaltis
Inputs: argv[1] = name_image.png
argv[2] = number of frames from the kick until the ball enters the goal
argv[3] = Frequency sample of video
Clicar em para c... | [
"matplotlib.pyplot.title",
"numpy.matrix",
"numpy.size",
"matplotlib.image.imread",
"matplotlib.pyplot.imshow",
"numpy.asarray",
"matplotlib.pyplot.close",
"numpy.zeros",
"numpy.linalg.norm",
"numpy.linalg.inv",
"matplotlib.pyplot.ginput",
"matplotlib.pyplot.xlabel",
"numpy.round"
] | [((1116, 1131), 'matplotlib.pyplot.imshow', 'plt.imshow', (['img'], {}), '(img)\n', (1126, 1131), True, 'import matplotlib.pyplot as plt\n'), ((1136, 1159), 'matplotlib.pyplot.title', 'plt.title', (['titleinstruc'], {}), '(titleinstruc)\n', (1145, 1159), True, 'import matplotlib.pyplot as plt\n'), ((1164, 1225), 'matpl... |
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import sys
import benchmark_decorator as dectimer
#--------------------------------
# Function: matrix_multiplication
#--------------------------------
@dectimer.bench_time(3)
def matrix_multiplication(A, B):
"""
Evaluate the ... | [
"numpy.random.rand",
"numpy.dot",
"sys.exit",
"benchmark_decorator.bench_time"
] | [((235, 257), 'benchmark_decorator.bench_time', 'dectimer.bench_time', (['(3)'], {}), '(3)\n', (254, 257), True, 'import benchmark_decorator as dectimer\n'), ((608, 628), 'numpy.random.rand', 'np.random.rand', (['N', 'N'], {}), '(N, N)\n', (622, 628), True, 'import numpy as np\n'), ((633, 653), 'numpy.random.rand', 'np... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | [
"doctest.testmod",
"numpy.zeros",
"pyspark.since",
"pyspark.mllib.linalg.Vectors.sparse",
"pyspark.sql.SparkSession.builder.master",
"numpy.append",
"warnings.warn",
"pyspark.mllib.common.callMLlibFunc",
"pyspark.mllib.linalg._convert_to_vector"
] | [((2528, 2542), 'pyspark.since', 'since', (['"""1.0.0"""'], {}), "('1.0.0')\n", (2533, 2542), False, 'from pyspark import SparkContext, since\n'), ((5132, 5146), 'pyspark.since', 'since', (['"""1.0.0"""'], {}), "('1.0.0')\n", (5137, 5146), False, 'from pyspark import SparkContext, since\n'), ((6190, 6204), 'pyspark.sin... |
import argparse
import array
import caffe
import json
import numpy as np
import scipy
from PIL import Image
def parseInputMetaDataFile(metaDataFileName):
with open(metaDataFileName) as metaData:
jsonData = json.loads(metaData.read())
return jsonData
def preprocessRGBInput(imageFileName, metaDat... | [
"caffe.set_mode_gpu",
"argparse.ArgumentParser",
"numpy.zeros",
"numpy.clip",
"PIL.Image.open",
"numpy.array",
"array.array",
"scipy.misc.imresize",
"PIL.Image.fromarray",
"caffe.Net"
] | [((2835, 2860), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2858, 2860), False, 'import argparse\n'), ((2954, 2974), 'caffe.set_mode_gpu', 'caffe.set_mode_gpu', ([], {}), '()\n', (2972, 2974), False, 'import caffe\n'), ((2981, 3106), 'caffe.Net', 'caffe.Net', (['"""../models/vsenseSalNet360... |
# This code has been carried out for the Applications subject of the
# Master's Degree in Computer Vision at the Rey Juan Carlos University
# of Madrid.
# Date: April 2021
# Authors: <NAME>, <NAME> and <NAME>
from sklearn.metrics import confusion_matrix
from tensorflow.keras.utils import to_categorical
import numpy a... | [
"matplotlib.pyplot.title",
"os.mkdir",
"tensorflow.keras.layers.MaxPooling2D",
"numpy.argmax",
"tensorflow.keras.layers.Dense",
"sklearn.model_selection.train_test_split",
"tensorflow.keras.callbacks.ModelCheckpoint",
"matplotlib.pyplot.figure",
"numpy.rot90",
"SafetyCheckUtil.MetalImperfectionsUt... | [((1105, 1129), 'SafetyCheckUtil.MetalImperfectionsUtil', 'MetalImperfectionsUtil', ([], {}), '()\n', (1127, 1129), False, 'from SafetyCheckUtil import MetalImperfectionsUtil\n'), ((1900, 1926), 'tensorflow.compat.v1.ConfigProto', 'tf.compat.v1.ConfigProto', ([], {}), '()\n', (1924, 1926), True, 'import tensorflow as t... |
# Copyright (C) 2020. 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... | [
"shapely.ops.split",
"smarts.core.coordinates.RefLinePoint",
"hashlib.md5",
"logging.debug",
"smarts.core.utils.id.SocialAgentId.new",
"shapely.geometry.Polygon",
"random.uniform",
"smarts.core.utils.math.rotate_around_point",
"shapely.geometry.MultiPolygon",
"dataclasses.field",
"shapely.geomet... | [((4130, 4152), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (4139, 4152), False, 'from dataclasses import dataclass, field\n'), ((5410, 5432), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (5419, 5432), False, 'from dataclasses import datac... |
#!/usr/bin/env python3
import base64
import argparse
import colorsys
import numpy as np
import gdspy
import pyclipper
import mapbox_earcut as earcut
def area_of_poly(poly):
'''
Returns: The area enclosed by given polygon.
Area is positive, if polygon points are ordered CCW.
'''
area = 0
for ... | [
"gdspy.GdsLibrary",
"argparse.ArgumentParser",
"colorsys.hsv_to_rgb",
"numpy.roll",
"numpy.asarray",
"mapbox_earcut.triangulate_int32",
"numpy.hstack",
"numpy.argsort",
"pyclipper.Pyclipper",
"numpy.vstack"
] | [((1950, 1971), 'pyclipper.Pyclipper', 'pyclipper.Pyclipper', ([], {}), '()\n', (1969, 1971), False, 'import pyclipper\n'), ((2884, 2916), 'numpy.asarray', 'np.asarray', (['rings'], {'dtype': '"""int32"""'}), "(rings, dtype='int32')\n", (2894, 2916), True, 'import numpy as np\n'), ((2930, 2945), 'numpy.vstack', 'np.vst... |
#!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("input", help="Input single-line json file")
parser.add_argument(
"--drop-header",
action="store_true",
help="If enabled, the header line will be dropped",
)
parser.add_argument(
"--deglitch-pressure",
ac... | [
"argparse.ArgumentParser",
"json.loads",
"processor.flow_calibrator.FlowCalibrator",
"numpy.min",
"numpy.array"
] | [((50, 75), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (73, 75), False, 'import argparse\n'), ((728, 744), 'processor.flow_calibrator.FlowCalibrator', 'FlowCalibrator', ([], {}), '()\n', (742, 744), False, 'from processor.flow_calibrator import FlowCalibrator\n'), ((2376, 2393), 'numpy.min'... |
import numpy as np
import unittest
from entropy import petrosian_fd, katz_fd, higuchi_fd, detrended_fluctuation
np.random.seed(1234567)
RANDOM_TS = np.random.rand(3000)
SF_TS = 100
PURE_SINE = np.sin(2 * np.pi * 1 * np.arange(3000) / 100)
class TestEntropy(unittest.TestCase):
def test_petrosian_fd(self):
... | [
"entropy.petrosian_fd",
"entropy.katz_fd",
"numpy.random.seed",
"entropy.higuchi_fd",
"entropy.detrended_fluctuation",
"numpy.arange",
"numpy.random.rand",
"numpy.round"
] | [((114, 137), 'numpy.random.seed', 'np.random.seed', (['(1234567)'], {}), '(1234567)\n', (128, 137), True, 'import numpy as np\n'), ((150, 170), 'numpy.random.rand', 'np.random.rand', (['(3000)'], {}), '(3000)\n', (164, 170), True, 'import numpy as np\n'), ((329, 352), 'entropy.petrosian_fd', 'petrosian_fd', (['RANDOM_... |
# pylint: disable=wrong-or-nonexistent-copyright-notice
import cirq
import numpy as np
import pytest
def test_kraus_channel_from_channel():
q0 = cirq.LineQubit(0)
dp = cirq.depolarize(0.1)
kc = cirq.KrausChannel.from_channel(dp, key='dp')
assert cirq.measurement_key_name(kc) == 'dp'
cirq.testing.a... | [
"cirq.measurement_key_name",
"cirq.with_measurement_key_mapping",
"numpy.zeros",
"cirq.KrausChannel",
"cirq.with_key_path",
"cirq.Simulator",
"cirq.KrausChannel.from_channel",
"pytest.raises",
"cirq.H",
"numpy.array",
"cirq.LineQubit",
"cirq.depolarize",
"cirq.testing.assert_consistent_chann... | [((151, 168), 'cirq.LineQubit', 'cirq.LineQubit', (['(0)'], {}), '(0)\n', (165, 168), False, 'import cirq\n'), ((178, 198), 'cirq.depolarize', 'cirq.depolarize', (['(0.1)'], {}), '(0.1)\n', (193, 198), False, 'import cirq\n'), ((208, 252), 'cirq.KrausChannel.from_channel', 'cirq.KrausChannel.from_channel', (['dp'], {'k... |
from dlr import DLRModel
import time
import numpy as np
# from tvm import relay
# from tvm.relay.backend.contrib import tidl
model_dir='custom_model'
model = DLRModel(model_dir, 'cpu')
img = np.random.rand(1, 9,1024, 512)
t=time.time()
res = model.run(img)
print("total_time",(time.time() - t)*1000)
| [
"dlr.DLRModel",
"numpy.random.rand",
"time.time"
] | [((159, 185), 'dlr.DLRModel', 'DLRModel', (['model_dir', '"""cpu"""'], {}), "(model_dir, 'cpu')\n", (167, 185), False, 'from dlr import DLRModel\n'), ((192, 223), 'numpy.random.rand', 'np.random.rand', (['(1)', '(9)', '(1024)', '(512)'], {}), '(1, 9, 1024, 512)\n', (206, 223), True, 'import numpy as np\n'), ((225, 236)... |
import numpy as np
from pytest import approx, raises
from scipy.integrate import solve_ivp
from scipy.linalg import norm
import netket.legacy as nk
from netket.exact import PyExactTimePropagation
import pytest
pytestmark = pytest.mark.legacy
ATOL = 1e-9
RTOL = 1e-9
TIME = 20.0
def _setup_model():
L = 8
hi... | [
"netket.exact.PyExactTimePropagation",
"numpy.allclose",
"scipy.integrate.solve_ivp",
"numpy.vdot",
"netket.legacy.hilbert.Spin",
"scipy.linalg.norm",
"netket.legacy.graph.Hypercube",
"numpy.linspace",
"numpy.random.rand",
"pytest.approx"
] | [((499, 509), 'scipy.linalg.norm', 'norm', (['psi0'], {}), '(psi0)\n', (503, 509), False, 'from scipy.linalg import norm\n'), ((774, 911), 'netket.exact.PyExactTimePropagation', 'PyExactTimePropagation', (['ham'], {'dt': 'TIME', 't0': '(0.0)', 'initial_state': 'psi0', 'propagation_type': '"""real"""', 'solver_kwargs': ... |
from nose import SkipTest
import networkx as nx
from networkx.generators.degree_seq import havel_hakimi_graph
class TestSpectrum(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
global numpy
global assert_equal
... | [
"nose.SkipTest",
"networkx.laplacian_spectrum",
"numpy.testing.assert_almost_equal",
"networkx.generators.degree_seq.havel_hakimi_graph",
"networkx.path_graph",
"numpy.array",
"networkx.adjacency_spectrum",
"numpy.sqrt"
] | [((613, 636), 'networkx.generators.degree_seq.havel_hakimi_graph', 'havel_hakimi_graph', (['deg'], {}), '(deg)\n', (631, 636), False, 'from networkx.generators.degree_seq import havel_hakimi_graph\n'), ((653, 669), 'networkx.path_graph', 'nx.path_graph', (['(3)'], {}), '(3)\n', (666, 669), True, 'import networkx as nx\... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
nx, ny = (1000,1000)
x = np.linspace(-2,1,nx)
y = np.linspace(-1.5,1.5,ny)
X, Y = np.meshgrid(x,y)
cgrid = X + 1j*Y
# For some numbers c doing z^2 + c again and again from 0 will diverge, not for others, plot it to get the mandelbrot set
Z... | [
"numpy.meshgrid",
"numpy.abs",
"matplotlib.pyplot.show",
"matplotlib.pyplot.clf",
"numpy.power",
"matplotlib.pyplot.pcolormesh",
"numpy.linspace",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.subplots"
] | [((104, 126), 'numpy.linspace', 'np.linspace', (['(-2)', '(1)', 'nx'], {}), '(-2, 1, nx)\n', (115, 126), True, 'import numpy as np\n'), ((129, 155), 'numpy.linspace', 'np.linspace', (['(-1.5)', '(1.5)', 'ny'], {}), '(-1.5, 1.5, ny)\n', (140, 155), True, 'import numpy as np\n'), ((161, 178), 'numpy.meshgrid', 'np.meshgr... |
import cv2
import numpy as np
from .constants import LANE_AREA_SRC, LANE_AREA_DST
def binarize_lane_line_pixels(img, output_binary=False, s_thresh=(170, 255),
sx_thresh=(20, 100)) -> np.ndarray:
"""Binarize lane line pixels using Sobel X thresholding and S-channel
thresholding.
... | [
"numpy.absolute",
"cv2.warpPerspective",
"numpy.zeros_like",
"numpy.copy",
"cv2.cvtColor",
"cv2.getPerspectiveTransform",
"numpy.zeros",
"numpy.max",
"numpy.linalg.pinv",
"cv2.Sobel"
] | [((1015, 1027), 'numpy.copy', 'np.copy', (['img'], {}), '(img)\n', (1022, 1027), True, 'import numpy as np\n'), ((1038, 1074), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2HLS'], {}), '(img, cv2.COLOR_BGR2HLS)\n', (1050, 1074), False, 'import cv2\n'), ((1175, 1213), 'cv2.Sobel', 'cv2.Sobel', (['l_channel', '... |
#!/usr/bin/env python3
"""
This file contains model template and implementation for Forecaster. All forecasting models should inherit from
ForecastModel, and override the _do_fit and _do_predict abstract methods
"""
from util.constants import LOG
from abc import ABC, abstractmethod
import numpy as np
import torch
imp... | [
"torch.nn.MSELoss",
"sklearn.preprocessing.MinMaxScaler",
"torch.FloatTensor",
"numpy.append",
"torch.nn.Module.__init__",
"torch.nn.Linear",
"torch.zeros",
"torch.nn.LSTM",
"torch.no_grad"
] | [((4383, 4407), 'torch.nn.Module.__init__', 'nn.Module.__init__', (['self'], {}), '(self)\n', (4401, 4407), True, 'import torch.nn as nn\n'), ((4520, 4558), 'torch.nn.LSTM', 'nn.LSTM', (['input_size', 'hidden_layer_size'], {}), '(input_size, hidden_layer_size)\n', (4527, 4558), True, 'import torch.nn as nn\n'), ((4583,... |
"""
This script generates a json file containing several parameters for multifractal analysis.
These parameters are then used to compare the results obtained with the mf_analysis python package
and with the PLBMF Matlab toolbox.
* The following parameters are varied across tests:
j1 - smallest scale analysis
j2 - lar... | [
"json.dump",
"numpy.arange"
] | [((1984, 2036), 'json.dump', 'json.dump', (['params', 'outfile'], {'indent': '(4)', 'sort_keys': '(True)'}), '(params, outfile, indent=4, sort_keys=True)\n', (1993, 2036), False, 'import json\n'), ((735, 754), 'numpy.arange', 'np.arange', (['(-8)', '(9)', '(1)'], {}), '(-8, 9, 1)\n', (744, 754), True, 'import numpy as ... |
"""
Script to generate simulated data and run the SVM algorithm on it.
The data is generated using np.random.normal and np.random.uniform functions.
It is a simple dataset consisting of 100 observations and 10 features.
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.linalg
im... | [
"numpy.random.uniform",
"numpy.random.seed",
"sklearn.model_selection.train_test_split",
"numpy.asarray",
"numpy.zeros",
"numpy.random.normal",
"Svm.Svm"
] | [((470, 489), 'numpy.random.seed', 'np.random.seed', (['(100)'], {}), '(100)\n', (484, 489), True, 'import numpy as np\n'), ((501, 520), 'numpy.zeros', 'np.zeros', (['(100, 10)'], {}), '((100, 10))\n', (509, 520), True, 'import numpy as np\n'), ((541, 588), 'numpy.random.normal', 'np.random.normal', ([], {'loc': '(2)',... |
import numpy as np #For handling array data
import matplotlib.pyplot as plt
from matplotlib import style
style.use('ggplot')
#Self-exlainatory
#Take random data to keep going
data = {-1:np.array([[2,4],[3,6],[5,9]]),1:np.array([[5,2],[12,14],[2,9]])}
#OOP begins
class SVM:
def _init_(self,visualization=True):
... | [
"matplotlib.pyplot.figure",
"numpy.array",
"matplotlib.style.use"
] | [((105, 124), 'matplotlib.style.use', 'style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (114, 124), False, 'from matplotlib import style\n'), ((186, 220), 'numpy.array', 'np.array', (['[[2, 4], [3, 6], [5, 9]]'], {}), '([[2, 4], [3, 6], [5, 9]])\n', (194, 220), True, 'import numpy as np\n'), ((218, 254), 'numpy.arra... |
import gym
import numpy as np
from .vanilla import VanillaGoalEnv
class FixedObjectGoalEnv(VanillaGoalEnv):
def __init__(self, args):
VanillaGoalEnv.__init__(self, args)
self.env.reset()
self.fixed_obj = True
def reset(self):
self.reset_ep()
self.sim.set_state(self.initial_state)
if self.has_object:
... | [
"numpy.random.uniform",
"numpy.array"
] | [((505, 552), 'numpy.array', 'np.array', (['[self.obj_range * 0.5, random_offset]'], {}), '([self.obj_range * 0.5, random_offset])\n', (513, 552), True, 'import numpy as np\n'), ((575, 616), 'numpy.array', 'np.array', (['[random_offset, self.obj_range]'], {}), '([random_offset, self.obj_range])\n', (583, 616), True, 'i... |
import bempp.api
import numpy as np
# Solve the (Calderon preconditioned) EFIE
k = 2
def incident_field(x):
return np.array([0*x[0],0*x[0],np.exp(1j * k * x[0])])
def tangential_trace(x, n, domain_index, result):
result[:] = np.cross(incident_field(x), n, axis=0)
grid = bempp.api.shapes.sphere(h=0.4)
e2,e ... | [
"numpy.exp",
"numpy.zeros",
"bemplot.slices"
] | [((1767, 1862), 'bemplot.slices', 'bemplot.slices', (['"""max_slice_x.msh"""', 'evaluator'], {'x': '[0]', 'ndims': '(25, 25)', 'extent': '[-6, 6, -4, 8]'}), "('max_slice_x.msh', evaluator, x=[0], ndims=(25, 25), extent=\n [-6, 6, -4, 8])\n", (1781, 1862), False, 'import bemplot\n'), ((1897, 1992), 'bemplot.slices', ... |
import time
from contextlib import contextmanager
from collections import deque
import gym
from mpi4py import MPI
import tensorflow as tf
import numpy as np
import stable_baselines.common.tf_util as tf_util
from stable_baselines.common import explained_variance, zipsame, dataset, fmt_row, colorize, ActorCriticRLModel... | [
"stable_baselines.logger.record_tabular",
"stable_baselines.common.tf_util.get_trainable_vars",
"stable_baselines.common.explained_variance",
"tensorflow.reduce_sum",
"stable_baselines.common.fmt_row",
"tensorflow.clip_by_value",
"stable_baselines.trpo_mpi.utils.add_successor_features",
"tensorflow.ma... | [((5303, 5329), 'stable_baselines.common.SetVerbosity', 'SetVerbosity', (['self.verbose'], {}), '(self.verbose)\n', (5315, 5329), False, 'from stable_baselines.common import explained_variance, zipsame, dataset, fmt_row, colorize, ActorCriticRLModel, SetVerbosity, TensorboardWriter\n'), ((5595, 5620), 'mpi4py.MPI.COMM_... |
# This file implements a MultiIsoVisual class that can be used to show
# multiple layers of isosurface simultaneously. It is derived from the original
# VolumeVisual class in vispy.visuals.volume, which is releaed under a BSD license
# included here:
#
# =================================================================... | [
"numpy.array"
] | [((11584, 11704), 'numpy.array', 'np.array', (['[[0, 0, 0], [1, 0, 0], [0, 1, 0], [1, 1, 0], [0, 0, 1], [1, 0, 1], [0, 1, 1\n ], [1, 1, 1]]'], {'dtype': 'np.float32'}), '([[0, 0, 0], [1, 0, 0], [0, 1, 0], [1, 1, 0], [0, 0, 1], [1, 0, 1],\n [0, 1, 1], [1, 1, 1]], dtype=np.float32)\n', (11592, 11704), True, 'import... |
import numpy as np
def calcGoodHeightmap(worldSlice):
"""**Calculates a heightmap ideal for building.**
Trees are ignored and water is considered ground.
Args:
worldSlice (WorldSlice): an instance of the WorldSlice class containing the raw heightmaps and block data
Returns:
any: nump... | [
"numpy.sin",
"numpy.minimum",
"numpy.cos",
"numpy.deg2rad"
] | [((1088, 1113), 'numpy.deg2rad', 'np.deg2rad', (['(rotation * 90)'], {}), '(rotation * 90)\n', (1098, 1113), True, 'import numpy as np\n'), ((888, 925), 'numpy.minimum', 'np.minimum', (['hm_mbnl', 'heightmapNoTrees'], {}), '(hm_mbnl, heightmapNoTrees)\n', (898, 925), True, 'import numpy as np\n'), ((1148, 1161), 'numpy... |
import torch
from torch import nn
from torch.nn import functional as F
from torchvision.utils import save_image
import os
import time
import cv2 as cv
import numpy as np
from tqdm import tqdm
from numpy.linalg import inv
from utils import AverageMeter
from data_gen import DeepHNDataset
from mobilenet_v2 import MobileN... | [
"torch.no_grad",
"torch.utils.data.DataLoader",
"utils.AverageMeter",
"cv2.imwrite",
"torch.load",
"numpy.transpose",
"torch.unbind",
"numpy.add",
"tqdm.tqdm",
"data_gen.DeepHNDataset",
"numpy.array2string",
"torchvision.utils.save_image",
"numpy.linalg.inv",
"os.makedirs",
"torch.nn.L1L... | [((487, 505), 'numpy.array', 'np.array', (['out_list'], {}), '(out_list)\n', (495, 505), True, 'import numpy as np\n'), ((515, 569), 'numpy.array', 'np.array', (['[256, 256, 256, 1280, 1280, 1280, 1280, 256]'], {}), '([256, 256, 256, 1280, 1280, 1280, 1280, 256])\n', (523, 569), True, 'import numpy as np\n'), ((579, 62... |
#!/usr/bin/env python
# Inspired by:
# https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/
import codecs
import os
import re
import sys
from setuptools import Extension, find_packages, setup
from setuptools.command.build_ext import build_ext
# PROJECT SPECIFIC
NAME = "exoplanet"
PACKAGES = f... | [
"tempfile.NamedTemporaryFile",
"setuptools.Extension",
"pybind11.get_include",
"os.path.realpath",
"numpy.get_include",
"setuptools.command.build_ext.build_ext.build_extensions",
"os.path.join",
"setuptools.find_packages"
] | [((319, 345), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (332, 345), False, 'from setuptools import Extension, find_packages, setup\n'), ((358, 405), 'os.path.join', 'os.path.join', (['"""src"""', '"""exoplanet"""', '"""__init__.py"""'], {}), "('src', 'exoplanet', '__i... |
#===============================================================================#
# PyGrouper - <NAME>
from __future__ import print_function
import re, os, sys, time
import itertools
import json
import logging
from time import sleep
from collections import defaultdict
from functools import partial
from math import cei... | [
"numpy.sum",
"time.ctime",
"collections.defaultdict",
"os.path.isfile",
"RefProtDB.utils.fasta_dict_from_file",
"numpy.mean",
"pandas.read_table",
"os.path.join",
"pandas.set_option",
"pandas.DataFrame",
"os.path.abspath",
"pandas.merge",
"traceback.format_exc",
"pandas.concat",
"functoo... | [((790, 853), 'pandas.set_option', 'pd.set_option', (['"""display.width"""', '(170)', '"""display.max_columns"""', '(500)'], {}), "('display.width', 170, 'display.max_columns', 500)\n", (803, 853), True, 'import pandas as pd\n'), ((1234, 1296), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'logfilenam... |
import numpy as np
import matplotlib.pyplot as plt
import copy
# Coupled Discrete Algebraic Riccati Equation solver. *** Does not work for non-zero R12 and R21 (I think).
def coupled_DARE_solve(A, B1, B2, Q1, Q2,
R11, R12, R21, R22, N=500):
'''Solves the Coupled Algebraic Riccati Equation
by Lyapunov iterat... | [
"numpy.eye",
"numpy.linalg.matrix_rank",
"numpy.zeros"
] | [((446, 467), 'numpy.zeros', 'np.zeros', (['(n, n * m1)'], {}), '((n, n * m1))\n', (454, 467), True, 'import numpy as np\n'), ((504, 525), 'numpy.zeros', 'np.zeros', (['(n, n * m2)'], {}), '((n, n * m2))\n', (512, 525), True, 'import numpy as np\n'), ((553, 562), 'numpy.eye', 'np.eye', (['n'], {}), '(n)\n', (559, 562),... |
from typing import Union, cast
import warnings
import numpy as np
from pandas._libs.lib import no_default
import pandas._libs.testing as _testing
from pandas.core.dtypes.common import (
is_bool,
is_categorical_dtype,
is_extension_array_dtype,
is_interval_dtype,
is_number,
is_numeric_dtype,
... | [
"pandas.core.dtypes.common.needs_i8_conversion",
"typing.cast",
"pandas.core.dtypes.common.is_numeric_dtype",
"numpy.isnan",
"pandas.io.formats.printing.pprint_thing",
"numpy.round",
"pandas.core.dtypes.common.is_categorical_dtype",
"pandas._libs.testing.assert_almost_equal",
"pandas._libs.testing.a... | [((6476, 6542), 'pandas._libs.testing.assert_dict_equal', '_testing.assert_dict_equal', (['left', 'right'], {'compare_keys': 'compare_keys'}), '(left, right, compare_keys=compare_keys)\n', (6502, 6542), True, 'import pandas._libs.testing as _testing\n'), ((2655, 2891), 'warnings.warn', 'warnings.warn', (['"""The \'chec... |
import collections
import functools
import itertools
import math
import os
import platform
from contextlib import contextmanager
import re
import numpy as np
import torch as th
import torch.distributed as dist
import torch.distributions as dis
import torch.nn.functional as F
from torch import nn
from . import tree_uti... | [
"torch.distributed.is_initialized",
"torch.distributions.Bernoulli",
"torch.distributions.Categorical",
"torch.cat",
"collections.defaultdict",
"torch.arange",
"torch.distributed.get_world_size",
"pandas.DataFrame",
"numpy.zeros_like",
"platform.node",
"torch.nn.Linear",
"torch.is_tensor",
"... | [((7696, 7717), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (7715, 7717), False, 'import functools\n'), ((8103, 8124), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (8122, 8124), False, 'import functools\n'), ((1330, 1369), 'pandas.DataFrame', 'pandas.DataFrame', (['rows'], {'colum... |
"""
Maze environment for reinforcement learning, with the python package tkinter.
Red rectangle: explorer.
Black rectangle: hells [reward = -1]
Yellow bin circle: paradise [reward = +1]
All other state: ground [reward = 0]
Alse referenced the tutorial of morvanzhou: https://morvanzhou.github.i... | [
"tkinter.Canvas",
"random.randint",
"argparse.ArgumentParser",
"time.sleep",
"random.seed",
"numpy.array"
] | [((7796, 7821), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (7819, 7821), False, 'import argparse\n'), ((2980, 3065), 'tkinter.Canvas', 'tk.Canvas', (['self'], {'bg': '"""white"""', 'height': '(self.maze_h * UNIT)', 'width': '(self.maze_w * UNIT)'}), "(self, bg='white', height=self.maze_h * ... |
import os
import numpy as np
from pydrake.all import PiecewisePolynomial
from examples.setup_simulations import (
run_quasistatic_sim)
from qsim.simulator import QuasistaticSimParameters
from qsim.model_paths import models_dir
object_sdf_path = os.path.join(models_dir, "box_1m_rotation.sdf")
model_directive_path... | [
"numpy.zeros",
"pydrake.all.PiecewisePolynomial.FirstOrderHold",
"examples.setup_simulations.run_quasistatic_sim",
"numpy.array",
"os.path.join"
] | [((252, 299), 'os.path.join', 'os.path.join', (['models_dir', '"""box_1m_rotation.sdf"""'], {}), "(models_dir, 'box_1m_rotation.sdf')\n", (264, 299), False, 'import os\n'), ((323, 366), 'os.path.join', 'os.path.join', (['models_dir', '"""box_pushing.yml"""'], {}), "(models_dir, 'box_pushing.yml')\n", (335, 366), False,... |
#Author: <NAME>
#E-mail: <EMAIL>
"""Simple python code to plot an interactive graph of IVIM multiexponential model using Bokeh.
"""
import numpy as np
from bokeh.layouts import column, row
from bokeh.models import CustomJS, Slider
from bokeh.plotting import ColumnDataSource, figure, show
PF0 = 1.5e-1
DC0 = 4.0E-2
... | [
"bokeh.plotting.figure",
"bokeh.models.Slider",
"bokeh.plotting.show",
"numpy.exp",
"numpy.linspace",
"bokeh.layouts.column"
] | [((339, 363), 'numpy.linspace', 'np.linspace', (['(0)', '(900)', '(500)'], {}), '(0, 900, 500)\n', (350, 363), True, 'import numpy as np\n'), ((469, 576), 'bokeh.plotting.figure', 'figure', ([], {'x_range': '(1.0, 1000.0)', 'y_range': '(1e-06, 1.0)', 'y_axis_type': '"""log"""', 'plot_width': '(400)', 'plot_height': '(4... |
from amber.utils import testing_utils
from amber.architect.controller import GeneralController
from amber.architect.trainEnv import ControllerTrainEnvironment
from amber.bootstrap.mock_manager import MockManager
from amber.bootstrap.simple_conv1d_space import get_state_space
import tensorflow as tf
import numpy as np
i... | [
"tensorflow.test.main",
"amber.architect.controller.GeneralController",
"amber.bootstrap.mock_manager.MockManager",
"tempfile.TemporaryDirectory",
"os.path.join",
"os.path.dirname",
"tensorflow.device",
"tensorflow.Session",
"numpy.mean",
"amber.bootstrap.simple_conv1d_space.get_state_space",
"p... | [((364, 381), 'platform.system', 'platform.system', ([], {}), '()\n', (379, 381), False, 'import platform\n'), ((1514, 1701), 'amber.bootstrap.mock_manager.MockManager', 'MockManager', ([], {'history_fn_list': 'history_fn_list', 'model_compile_dict': "{'loss': 'binary_crossentropy', 'optimizer': 'adam', 'metrics': ['ac... |
# A hunter is searching for a treasure! :| But WHY???????????
import random
import os
from collections import Counter
import numpy as np
import gym
import visdom
import time
from .env_map import EnvMap
class FruitCollectionEnv(gym.Env):
"""The agent is looking for fruit without getting hit by lightning"""
... | [
"numpy.stack",
"gym.make",
"os.path.realpath",
"numpy.zeros",
"visdom.Visdom",
"time.time",
"random.random",
"collections.Counter",
"os.path.join"
] | [((7435, 7465), 'gym.make', 'gym.make', (['"""FruitCollection-v0"""'], {}), "('FruitCollection-v0')\n", (7443, 7465), False, 'import gym\n'), ((515, 530), 'visdom.Visdom', 'visdom.Visdom', ([], {}), '()\n', (528, 530), False, 'import visdom\n'), ((2700, 2729), 'numpy.zeros', 'np.zeros', (['self.total_treasure'], {}), '... |
"""
A module containing unit tests for the `wcsutil` module.
Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
import math
from distutils.version import LooseVersion
import numpy as np
from astropy.modeling import Model, Parameter
from astropy.modeling.models import AffineTransformation2D, Identity
f... | [
"numpy.arctan2",
"tweakwcs.tpwcs.JWSTgWCS._tpcorr_init",
"tweakwcs.tpwcs.JWSTgWCS._v2v3_to_tpcorr_from_full",
"numpy.sin",
"numpy.insert",
"math.cos",
"numpy.linalg.multi_dot",
"distutils.version.LooseVersion",
"astropy.coordinates.ICRS",
"astropy.modeling.models.Identity",
"gwcs.geometry.Cartes... | [((724, 773), 'gwcs.geometry.SphericalToCartesian', 'SphericalToCartesian', ([], {'name': '"""s2c"""', 'wrap_lon_at': '(180)'}), "(name='s2c', wrap_lon_at=180)\n", (744, 773), False, 'from gwcs.geometry import CartesianToSpherical, SphericalToCartesian\n'), ((785, 834), 'gwcs.geometry.CartesianToSpherical', 'CartesianT... |
"""
Generate samples with GPT-2 and filter out those that are likely to be
memorized samples from the training set.
"""
import logging
logging.basicConfig(level='ERROR')
import argparse
import numpy as np
from pprint import pprint
import sys
import torch
import zlib
from transformers import GPT2Tokenizer, GPT2LMHeadM... | [
"tqdm.tqdm",
"argparse.ArgumentParser",
"logging.basicConfig",
"numpy.ceil",
"numpy.log",
"transformers.GPT2LMHeadModel.from_pretrained",
"numpy.asarray",
"numpy.argsort",
"torch.exp",
"torch.cuda.is_available",
"pprint.pprint",
"transformers.GPT2Tokenizer.from_pretrained",
"torch.no_grad"
] | [((136, 170), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '"""ERROR"""'}), "(level='ERROR')\n", (155, 170), False, 'import logging\n'), ((730, 745), 'torch.exp', 'torch.exp', (['loss'], {}), '(loss)\n', (739, 745), False, 'import torch\n'), ((1549, 1586), 'transformers.GPT2Tokenizer.from_pretrained', '... |
""" Module for treating images as the vertices of a graph. Includes both Edge and Vertex (ImageNode) classes. """
from __future__ import absolute_import, division, print_function
from scitbx.matrix import sqr
from cctbx.uctbx import unit_cell
import numpy as np
import math
import logging
from cctbx.array_family import ... | [
"xfel.cxi.postrefine.mod_leastsqr.get_crystal_orientation",
"cctbx.array_family.flex.exp",
"cctbx.uctbx.unit_cell",
"xfel.cxi.postrefine.mod_partiality.partiality_handler",
"xfel.cxi.postrefine.mod_leastsqr.prep_input",
"numpy.isnan",
"xfel.cxi.postrefine.test_rs.calc_spot_radius",
"numpy.array",
"c... | [((879, 922), 'xfel.clustering.singleframe.SingleFrame.__init__', 'SingleFrame.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (899, 922), False, 'from xfel.clustering.singleframe import SingleFrame\n'), ((2162, 2205), 'xfel.cxi.postrefine.mod_leastsqr.prep_output', 'prep_output', (['params_in', 'self.... |
import pytest
from datetime import datetime, timedelta
import pytz
import numpy as np
from pandas import (NaT, Index, Timestamp, Timedelta, Period,
DatetimeIndex, PeriodIndex,
TimedeltaIndex, Series, isna)
from pandas.util import testing as tm
from pandas._libs.tslib import iNa... | [
"pandas.Timestamp",
"pandas.util.testing.assert_produces_warning",
"numpy.isnan",
"datetime.datetime",
"pandas.DatetimeIndex",
"pandas.util.testing.assert_index_equal",
"pytest.raises",
"datetime.timedelta",
"pandas.Series",
"pandas.NaT.isoformat",
"pandas.Timedelta",
"pandas.Period",
"pytes... | [((2130, 2194), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""klass"""', '[Timestamp, Timedelta, Period]'], {}), "('klass', [Timestamp, Timedelta, Period])\n", (2153, 2194), False, 'import pytest\n'), ((2654, 2718), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""klass"""', '[Timestamp, Timede... |
import pyximport, numpy
pyximport.install(setup_args={'include_dirs': numpy.get_include()})
from .fatafl import Game
| [
"numpy.get_include"
] | [((70, 89), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (87, 89), False, 'import pyximport, numpy\n')] |
# coding=utf-8
"""A Na\"{i}ve Bayes model for stance classification"""
import numpy as np
from sklearn import naive_bayes
import stance_detect_base
# Level of smoothing
_PARAM_GRID = {'alpha': np.linspace(1e-10, 3., 10)}
class StanceDetectorNB(stance_detect_base.StanceDetector):
def __init__(self, name='Naive B... | [
"sklearn.naive_bayes.MultinomialNB",
"numpy.linspace"
] | [((195, 222), 'numpy.linspace', 'np.linspace', (['(1e-10)', '(3.0)', '(10)'], {}), '(1e-10, 3.0, 10)\n', (206, 222), True, 'import numpy as np\n'), ((401, 428), 'sklearn.naive_bayes.MultinomialNB', 'naive_bayes.MultinomialNB', ([], {}), '()\n', (426, 428), False, 'from sklearn import naive_bayes\n')] |
# -*- coding: utf-8 -*-
"""Utility functions to speed up linear algebraic operations.
In general, things like np.dot and linalg.svd should be used directly
because they are smart about checking for bad values. However, in cases where
things are done repeatedly (e.g., thousands of times on tiny matrices), the
overhead ... | [
"numpy.empty",
"scipy._lib._util._asarray_validated",
"numpy.linalg.LinAlgError",
"scipy.linalg.get_lapack_funcs",
"numpy.linalg.eigh",
"scipy.linalg.LinAlgError",
"functools.lru_cache",
"numpy.sqrt"
] | [((896, 921), 'functools.lru_cache', 'functools.lru_cache', (['None'], {}), '(None)\n', (915, 921), False, 'import functools\n'), ((1052, 1077), 'functools.lru_cache', 'functools.lru_cache', (['None'], {}), '(None)\n', (1071, 1077), False, 'import functools\n'), ((2921, 2946), 'functools.lru_cache', 'functools.lru_cach... |
import numpy as np
import pandas as pd
from statsmodels.distributions.empirical_distribution import ECDF
from scipy.stats import t
def cmds(D, k=2):
"""Classical multidimensional scaling
Theory and code references:
https://en.wikipedia.org/wiki/Multidimensional_scaling#Classical_multidimensional_scal... | [
"pandas.DataFrame",
"pandas.crosstab",
"numpy.sum",
"numpy.square",
"numpy.ones",
"numpy.argsort",
"numpy.linalg.eigh",
"numpy.arange",
"numpy.eye",
"scipy.stats.t.ppf",
"numpy.sqrt"
] | [((767, 779), 'numpy.square', 'np.square', (['D'], {}), '(D)\n', (776, 779), True, 'import numpy as np\n'), ((1169, 1186), 'numpy.linalg.eigh', 'np.linalg.eigh', (['B'], {}), '(B)\n', (1183, 1186), True, 'import numpy as np\n'), ((2237, 2282), 'pandas.DataFrame', 'pd.DataFrame', (['(0)'], {'index': 'groups', 'columns':... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os
import time
import sys
import tensorflow as tf
import numpy as np
import importlib
import itertools
import argparse
# import facenet
import bioid
#import lfw
import libr... | [
"tensorflow.train.Coordinator",
"numpy.random.seed",
"argparse.ArgumentParser",
"tensorflow.trainable_variables",
"tensorflow.identity",
"tensorflow.get_collection",
"tensorflow.train.batch_join",
"tensorflow.reshape",
"tensorflow.nn.l2_normalize",
"tensorflow.local_variables_initializer",
"tens... | [((1569, 1599), 'numpy.random.seed', 'np.random.seed', ([], {'seed': 'args.seed'}), '(seed=args.seed)\n', (1583, 1599), True, 'import numpy as np\n'), ((1616, 1648), 'bioid.get_dataset', 'bioid.get_dataset', (['args.data_dir'], {}), '(args.data_dir)\n', (1633, 1648), False, 'import bioid\n'), ((14726, 14750), 'six.move... |
# 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.context.set_context",
"mindspore.export",
"mindspore.load_param_into_net",
"mindspore.load_checkpoint",
"numpy.ones",
"src.proxylessnas_mobile.proxylessnas_mobile"
] | [((982, 1086), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE', 'device_target': 'config.device_target', 'save_graphs': '(False)'}), '(mode=context.GRAPH_MODE, device_target=config.\n device_target, save_graphs=False)\n', (1001, 1086), False, 'from mindspore import Tensor, ... |
r"""
Tests for news results
Author: <NAME>
License: BSD-3
"""
from statsmodels.compat.pandas import NumericIndex
from statsmodels.compat.pandas import (
assert_frame_equal,
assert_series_equal,
)
import numpy as np
from numpy.testing import assert_, assert_allclose, assert_equal
import pandas as pd
import py... | [
"statsmodels.tsa.statespace.varmax.VARMAX",
"numpy.arange",
"pytest.mark.parametrize",
"statsmodels.datasets.macrodata.load_pandas",
"statsmodels.compat.pandas.assert_series_equal",
"pandas.RangeIndex",
"statsmodels.compat.pandas.assert_frame_equal",
"pytest.raises",
"numpy.testing.assert_equal",
... | [((520, 575), 'pandas.period_range', 'pd.period_range', ([], {'start': '"""1959Q1"""', 'end': '"""2009Q3"""', 'freq': '"""Q"""'}), "(start='1959Q1', end='2009Q3', freq='Q')\n", (535, 575), True, 'import pandas as pd\n'), ((11476, 11527), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""revisions"""', '[True,... |
# -*- coding: utf-8 -*-
"""
ARRI ALEXA Wide Gamut Colourspace
=================================
Defines the *ARRI ALEXA Wide Gamut* colourspace:
- :attr:`colour.models.ALEXA_WIDE_GAMUT_COLOURSPACE`.
See Also
--------
`RGB Colourspaces Jupyter Notebook
<http://nbviewer.jupyter.org/github/colour-science/colour-noteb... | [
"colour.models.rgb.RGB_Colourspace",
"numpy.array"
] | [((1313, 1373), 'numpy.array', 'np.array', (['[[0.684, 0.313], [0.221, 0.848], [0.0861, -0.102]]'], {}), '([[0.684, 0.313], [0.221, 0.848], [0.0861, -0.102]])\n', (1321, 1373), True, 'import numpy as np\n'), ((1889, 2001), 'numpy.array', 'np.array', (['[[0.638008, 0.214704, 0.097744], [0.291954, 0.823841, -0.115795], [... |
import cv2
import mss
import time
import numpy as np
from winlaunch import current_windows, win_name, win_size
# mss.init()
# img show
# img = cv2.imread('fl.png')
# cv2.imshow('the image', img)
# cv2.waitKey(0)
# vid
# cap = cv2.VideoCapture('b.mp4')
# cap = cv2.VideoCapture(0)
# while True:
# success, img = ca... | [
"cv2.waitKey",
"winlaunch.current_windows",
"mss.mss",
"numpy.array",
"winlaunch.win_size",
"winlaunch.win_name",
"cv2.destroyAllWindows"
] | [((1850, 1867), 'winlaunch.current_windows', 'current_windows', ([], {}), '()\n', (1865, 1867), False, 'from winlaunch import current_windows, win_name, win_size\n'), ((1117, 1126), 'mss.mss', 'mss.mss', ([], {}), '()\n', (1124, 1126), False, 'import mss\n'), ((1880, 1896), 'winlaunch.win_name', 'win_name', (['window']... |
#!/usr/bin/env python3
import sys,os,re
import numpy as np
import numpy.random as random
import pandas
csvFile = sys.argv[1] if len(sys.argv) >= 2 else ''
separator = '\t'
def DataFrame(csvFile):
if csvFile == '':
body = []
for line in sys.stdin:
body.append([ x.strip() for x in line.split(separator) ... | [
"pandas.DataFrame",
"os.path.basename",
"numpy.linalg.eig",
"numpy.argsort",
"numpy.array",
"pandas.read_table",
"numpy.cov",
"numpy.mat"
] | [((879, 902), 'numpy.cov', 'np.cov', (['A'], {'rowvar': '(False)'}), '(A, rowvar=False)\n', (885, 902), True, 'import numpy as np\n'), ((911, 930), 'numpy.linalg.eig', 'np.linalg.eig', (['CONV'], {}), '(CONV)\n', (924, 930), True, 'import numpy as np\n'), ((334, 356), 'pandas.DataFrame', 'pandas.DataFrame', (['body'], ... |
#! /usr/bin/env python3
"""
Example of invocation of this script:
python m3dc1_single.py -nodes 1 -cores 32 -ntask 20 -nrun 800 -machine cori
where:
-nodes is the number of compute nodes
-cores is the number of cores per node
-ntask is the number of different matrix sizes that will be tuned
-nrun is... | [
"os.path.abspath",
"computer.Computer",
"argparse.ArgumentParser",
"gptune.GPTune",
"mpi4py.MPI.Info.Create",
"numpy.floor",
"os.system",
"numpy.argmin",
"data.Categoricalnorm",
"mpi4py.MPI.COMM_SELF.Spawn",
"numpy.array",
"data.Data",
"options.Options"
] | [((631, 675), 'os.path.abspath', 'os.path.abspath', (["(__file__ + '/../../GPTune/')"], {}), "(__file__ + '/../../GPTune/')\n", (646, 675), False, 'import os\n'), ((1814, 1831), 'mpi4py.MPI.Info.Create', 'MPI.Info.Create', ([], {}), '()\n', (1829, 1831), False, 'from mpi4py import MPI\n'), ((3296, 3317), 'os.system', '... |
import cv2
import numpy as np
import time
class CaptureManager(object):
def __init__(self,capture,previewWindowManager= None,shouldMirrorPreivew=False):
self.previewWindowManager = previewWindowManager
self.shouldMirrorPreivew = shouldMirrorPreivew
self._capture= capture
se... | [
"cv2.putText",
"cv2.VideoWriter_fourcc",
"cv2.waitKey",
"cv2.imwrite",
"time.time",
"cv2.rectangle",
"numpy.fliplr",
"cv2.destroyWindow",
"cv2.VideoWriter",
"cv2.HOGDescriptor_getDefaultPeopleDetector",
"cv2.HOGDescriptor",
"cv2.imshow",
"cv2.namedWindow"
] | [((3030, 3072), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (['"""M"""', '"""J"""', '"""P"""', '"""G"""'], {}), "('M', 'J', 'P', 'G')\n", (3052, 3072), False, 'import cv2\n'), ((4463, 4482), 'cv2.HOGDescriptor', 'cv2.HOGDescriptor', ([], {}), '()\n', (4480, 4482), False, 'import cv2\n'), ((5691, 5724), 'cv2.nam... |
import os
from collections import defaultdict
import mmcv
import numpy as np
from mmcv.utils import print_log
from .api_wrappers import COCO
from .builder import DATASETS
from .coco import CocoDataset
try:
import panopticapi
from panopticapi.evaluation import pq_compute_multi_core, VOID
from panopticapi.... | [
"panopticapi.utils.id2rgb",
"mmcv.load",
"os.path.dirname",
"numpy.unique",
"numpy.zeros",
"collections.defaultdict",
"numpy.array",
"mmcv.dump",
"panopticapi.evaluation.pq_compute_multi_core",
"os.path.join",
"mmcv.utils.print_log"
] | [((15243, 15296), 'mmcv.dump', 'mmcv.dump', (['pan_json_results', "result_files['panoptic']"], {}), "(pan_json_results, result_files['panoptic'])\n", (15252, 15296), False, 'import mmcv\n'), ((15753, 15788), 'mmcv.load', 'mmcv.load', (["result_files['panoptic']"], {}), "(result_files['panoptic'])\n", (15762, 15788), Fa... |
import numpy as np
from math import ceil
from .. utils import logger, verbose
@verbose
def peak_finder(x0, thresh=None, extrema=1, verbose=None):
"""Noise-tolerant fast peak-finding algorithm.
Parameters
----------
x0 : 1d array
A real vector from the maxima will be found (required).
thr... | [
"numpy.argmax",
"math.ceil",
"numpy.asanyarray",
"numpy.zeros",
"numpy.finfo",
"numpy.min",
"numpy.diff",
"numpy.where",
"numpy.max",
"numpy.concatenate"
] | [((1229, 1246), 'numpy.asanyarray', 'np.asanyarray', (['x0'], {}), '(x0)\n', (1242, 1246), True, 'import numpy as np\n'), ((1558, 1569), 'numpy.diff', 'np.diff', (['x0'], {}), '(x0)\n', (1565, 1569), True, 'import numpy as np\n'), ((1845, 1887), 'numpy.concatenate', 'np.concatenate', (['(x0[:1], x0[ind], x0[-1:])'], {}... |
import numpy as np
import xarray as xr
import pytest
from intake_io import to_xarray
def _random_image(dtype, shape, **kwargs):
try:
info = np.iinfo(dtype)
image = np.random.randint(info.min, info.max, shape, dtype)
except ValueError:
info = np.finfo(dtype)
image = np.random.ra... | [
"intake_io.to_xarray",
"numpy.iinfo",
"numpy.finfo",
"numpy.mean",
"numpy.random.randint",
"numpy.random.rand",
"numpy.prod"
] | [((418, 444), 'intake_io.to_xarray', 'to_xarray', (['image'], {}), '(image, **kwargs)\n', (427, 444), False, 'from intake_io import to_xarray\n'), ((773, 799), 'intake_io.to_xarray', 'to_xarray', (['image'], {}), '(image, **kwargs)\n', (782, 799), False, 'from intake_io import to_xarray\n'), ((154, 169), 'numpy.iinfo',... |
import os
import sys
import numpy as np
import subprocess
import pytest
@pytest.mark.light
def test_cqd():
env = os.environ.copy()
env['PYTHONPATH'] = '.'
cmd_str = 'python3 main.py --do_test --data_path data/NELL-betae-tiny -n 1 -b 1000 -d 1000 -lr 0.1 ' \
'--max_steps 1000 --cpu_num 0 ... | [
"numpy.testing.assert_allclose",
"os.environ.copy",
"subprocess.Popen",
"pytest.main"
] | [((122, 139), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (137, 139), False, 'import os\n'), ((665, 750), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'env': 'env', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.STDOUT'}), '(cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT\n )\n',... |
"""Module to play against trained algorithm."""
import numpy as np
import pickle
import matplotlib.pyplot as plt
import matplotlib as mpl
import os
from checkwin import checkwin
from decideplay import decideplay
from evalboard import recall_board, diffuse_utility, nd3_to_tuple
from transform import board_transform, bo... | [
"matplotlib.pyplot.title",
"updateutility.update_utility",
"pickle.dump",
"updateboard.make_move",
"plot.plot_state",
"matplotlib.pyplot.close",
"numpy.zeros",
"evalboard.recall_board",
"os.path.isfile",
"pickle.load",
"plot.plotforhuman",
"decideplay.decideplay",
"evalboard.diffuse_utility"... | [((2302, 2340), 'os.path.isfile', 'os.path.isfile', (['fnames[machine_player]'], {}), '(fnames[machine_player])\n', (2316, 2340), False, 'import os\n'), ((2628, 2644), 'numpy.zeros', 'np.zeros', (['(3, 3)'], {}), '((3, 3))\n', (2636, 2644), True, 'import numpy as np\n'), ((2432, 2446), 'pickle.load', 'pickle.load', (['... |
""" <NAME> <<EMAIL>>
Sept 17, 2018
"""
import getopt
import sys
import csv
import numpy as np
import dill as pickle # see https://stackoverflow.com/questions/25348532/can-python-pickle-lambda-functions
import random
from tqdm import tqdm
from mdp import MDP
from sarsa import SARSA
from forward import FORWARD
from... | [
"arbitrator.BayesRelEstimator",
"numpy.load",
"pickle.dump",
"csv.reader",
"getopt.getopt",
"numpy.zeros",
"sarsa.SARSA",
"forward.FORWARD",
"arbitrator.AssocRelEstimator",
"numpy.append",
"random.randrange",
"mdp.MDP",
"numpy.random.choice",
"functools.reduce",
"sys.exit"
] | [((9878, 9983), 'mdp.MDP', 'MDP', (['MDP_STAGES'], {'more_control_input': 'MORE_CONTROL_INPUT', 'legacy_mode': 'LEGACY_MODE', 'task_type': 'TASK_TYPE'}), '(MDP_STAGES, more_control_input=MORE_CONTROL_INPUT, legacy_mode=\n LEGACY_MODE, task_type=TASK_TYPE)\n', (9881, 9983), False, 'from mdp import MDP\n'), ((10322, 1... |
# -*- coding: utf-8 -*-
import os
import tempfile
import ansys.grpc.dpf
import numpy as np
import ansys.dpf.core.operators as op
from ansys.dpf import core
def test_workflowwithgeneratedcode(allkindofcomplexity):
disp = core.operators.result.displacement()
ds = core.DataSources(allkindofcomplexity)
node... | [
"os.remove",
"ansys.dpf.core.operators.result.stress_X",
"numpy.allclose",
"ansys.dpf.core.operators.math.norm_fc",
"ansys.dpf.core.operators.logic.identical_fc",
"numpy.isclose",
"ansys.dpf.core.operators.serialization.serializer",
"ansys.dpf.core.operators.math.add.default_config",
"ansys.dpf.core... | [((228, 264), 'ansys.dpf.core.operators.result.displacement', 'core.operators.result.displacement', ([], {}), '()\n', (262, 264), False, 'from ansys.dpf import core\n'), ((274, 311), 'ansys.dpf.core.DataSources', 'core.DataSources', (['allkindofcomplexity'], {}), '(allkindofcomplexity)\n', (290, 311), False, 'from ansy... |
# MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020
#
# 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
# r... | [
"torchaudio.transforms.Spectrogram",
"random.shuffle",
"logging.getLogger",
"torch.device",
"torch.cuda.current_device",
"torch.no_grad",
"deepspeech_pytorch.utils.load_decoder",
"torch.log1p",
"warpctc_pytorch.CTCLoss",
"apex.amp.scale_loss",
"art.utils.get_file",
"deepspeech_pytorch.configs.... | [((1952, 1979), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1969, 1979), False, 'import logging\n'), ((10819, 10829), 'deepspeech_pytorch.configs.inference_config.LMConfig', 'LMConfig', ([], {}), '()\n', (10827, 10829), False, 'from deepspeech_pytorch.configs.inference_config import L... |
#!/usr/bin/env python
# coding: utf-8
# # Developing an AI application
#
# Going forward, AI algorithms will be incorporated into more and more everyday applications. For example, you might want to include an image classifier in a smart phone app. To do this, you'd use a deep learning model trained on hundreds of tho... | [
"torch.nn.Dropout",
"torch.optim.lr_scheduler.StepLR",
"numpy.clip",
"torch.nn.NLLLoss",
"matplotlib.pyplot.figure",
"torchvision.transforms.Normalize",
"torch.no_grad",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.Linear",
"torchvision.transforms.CenterCrop",
"torchvision.models.vgg... | [((9208, 9237), 'torchvision.models.vgg16', 'models.vgg16', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (9220, 9237), False, 'from torchvision import transforms, datasets, models\n'), ((12117, 12129), 'torch.nn.NLLLoss', 'nn.NLLLoss', ([], {}), '()\n', (12127, 12129), False, 'from torch import nn, optim\n'),... |
"""
@Author:
@Date: 25/09/18
@Module Name: json_utils
This is an utility module to manage operations on json files
"""
import numpy as np
import simplejson
from sklearn.base import BaseEstimator
def load_json(file_path):
"""
Loads JSON data from file. Special python objects are
h... | [
"simplejson.load",
"simplejson.dump",
"numpy.array"
] | [((518, 560), 'simplejson.load', 'simplejson.load', (['f'], {'object_hook': '_from_json'}), '(f, object_hook=_from_json)\n', (533, 560), False, 'import simplejson\n'), ((885, 959), 'simplejson.dump', 'simplejson.dump', (['data', 'f'], {'default': '_to_json', 'tuple_as_array': '(False)', 'indent': '(4)'}), '(data, f, de... |
import copy
import warnings
from typing import Any, Dict, List, Optional, Tuple, Union
from ConfigSpace.configuration_space import Configuration, ConfigurationSpace
from ConfigSpace.forbidden import ForbiddenAndConjunction, ForbiddenEqualsClause
import numpy as np
from sklearn.base import ClassifierMixin
import tor... | [
"autoPyTorch.pipeline.components.setup.network_embedding.NetworkEmbeddingChoice",
"autoPyTorch.pipeline.components.setup.lr_scheduler.SchedulerChoice",
"autoPyTorch.pipeline.components.preprocessing.tabular_preprocessing.TabularColumnTransformer.TabularColumnTransformer",
"autoPyTorch.pipeline.components.prep... | [((9615, 9666), 'autoPyTorch.pipeline.components.training.metrics.utils.get_metrics', 'get_metrics', (['self.dataset_properties', '[metric_name]'], {}), '(self.dataset_properties, [metric_name])\n', (9626, 9666), False, 'from autoPyTorch.pipeline.components.training.metrics.utils import get_metrics, calculate_score\n')... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 31 16:45:58 2019
@author: <NAME> and <NAME>
"""
import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mpl
from matplotlib import cm
mpl.rcParams['mathtext.fon... | [
"numpy.meshgrid",
"uposham.differential_correction.get_total_energy",
"matplotlib.pyplot.show",
"uposham.coupled_quartic_hamiltonian.half_period_coupled",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.close",
"os.path.dirname",
"numpy.zeros",
"uposham.differential_correction.get_eq_pts",
"uposham.di... | [((1032, 1098), 'numpy.array', 'np.array', (['[MASS_A, MASS_B, EPSILON_S, ALPHA, BETA, OMEGA, EPSILON]'], {}), '([MASS_A, MASS_B, EPSILON_S, ALPHA, BETA, OMEGA, EPSILON])\n', (1040, 1098), True, 'import numpy as np\n'), ((1272, 1374), 'uposham.differential_correction.get_eq_pts', 'diffcorr.get_eq_pts', (['eqNum', 'coup... |
import numpy as np
class Field(np.ndarray):
'''The value of some physical quantity for each point in some coordinate system.
Parameters
----------
arr : array_like
An array of values or tensors for each point in the :class:`Grid`.
grid : Grid
The corresponding :class:`Grid` on which the values are set.
Att... | [
"numpy.asarray",
"numpy.ndarray.__new__",
"numpy.array"
] | [((3862, 3912), 'numpy.ndarray.__new__', 'np.ndarray.__new__', (['baseclass', 'baseshape', 'basetype'], {}), '(baseclass, baseshape, basetype)\n', (3880, 3912), True, 'import numpy as np\n'), ((999, 1023), 'numpy.array', 'np.array', (["tree['values']"], {}), "(tree['values'])\n", (1007, 1023), True, 'import numpy as np... |
"""
Reference:
[1] <NAME> - Wind Turbine Aerodynamics and Vorticity Based Method, Springer, 2017, page 477
Coordinate system:
z: helix axis
x: "upward"
y: "side"
psi: positive around z
if WT
"""
import numpy as np
import unittest
try:
from pybra.clean_exceptions import *
except:
pa... | [
"unittest.main",
"numpy.abs",
"numpy.arctan2",
"numpy.log",
"warnings.filterwarnings",
"numpy.testing.assert_almost_equal",
"numpy.asarray",
"numpy.logical_not",
"numpy.zeros",
"numpy.arange",
"numpy.exp",
"numpy.sqrt"
] | [((861, 874), 'numpy.asarray', 'np.asarray', (['r'], {}), '(r)\n', (871, 874), True, 'import numpy as np\n'), ((891, 907), 'numpy.asarray', 'np.asarray', (['psih'], {}), '(psih)\n', (901, 907), True, 'import numpy as np\n'), ((1228, 1245), 'numpy.zeros', 'np.zeros', (['r.shape'], {}), '(r.shape)\n', (1236, 1245), True,... |
# --------------------------------------------------------------------------
# Copyright (c) <2017> <<NAME>>
# BE-BI-PM, CERN (European Organization for Nuclear Research)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwa... | [
"numpy.polyfit",
"PyQt5.QtWidgets.QVBoxLayout",
"numpy.mean",
"numpy.arange",
"PyQt5.QtWidgets.QWidget",
"matplotlib.colors.Normalize",
"lib.utils.theoretical_laser_position",
"numpy.std",
"matplotlib.cm.ScalarMappable",
"configparser.RawConfigParser",
"numpy.max",
"matplotlib.pyplot.get_cmap"... | [((2135, 2148), 'PyQt5.QtWidgets.QWidget', 'QWidget', (['self'], {}), '(self)\n', (2142, 2148), False, 'from PyQt5.QtWidgets import QWidget, QVBoxLayout\n'), ((2229, 2258), 'PyQt5.QtWidgets.QVBoxLayout', 'QVBoxLayout', (['self.main_widget'], {}), '(self.main_widget)\n', (2240, 2258), False, 'from PyQt5.QtWidgets import... |
import numpy as np
import geopandas as gpd
import matplotlib as mpl
mpl.use('Agg', force=True)
import matplotlib.pyplot as plt
import iris
import os
import time
import logging
import warnings
import argparse
import yaml
from time import localtime, strftime
from climi.uuuu import *
from climi.pppp import *
_here_ = ... | [
"numpy.nanpercentile",
"numpy.abs",
"matplotlib.style.use",
"argparse.ArgumentParser",
"os.path.isfile",
"iris.load_cube",
"yaml.safe_load",
"numpy.nanmean",
"matplotlib.pyplot.close",
"geopandas.pd.concat",
"time.localtime",
"matplotlib.use",
"numpy.nanmax",
"os.makedirs",
"logging.basi... | [((68, 94), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {'force': '(True)'}), "('Agg', force=True)\n", (75, 94), True, 'import matplotlib as mpl\n'), ((5110, 5121), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (5119, 5121), True, 'import matplotlib.pyplot as plt\n'), ((10801, 10812), 'matplotlib.pyplot.cl... |
import os
import kp
import numpy as np
import logging
import pyshader as ps
DIRNAME = os.path.dirname(os.path.abspath(__file__))
def test_opalgobase_file():
"""
Test basic OpMult operation
"""
tensor_in_a = kp.Tensor([2, 2, 2])
tensor_in_b = kp.Tensor([1, 2, 3])
tensor_out = kp.Tensor([0, 0,... | [
"os.path.abspath",
"pyshader.Array",
"numpy.zeros",
"kp.Manager",
"numpy.arange",
"kp.Shader.compile_source",
"kp.Tensor",
"os.path.join"
] | [((104, 129), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (119, 129), False, 'import os\n'), ((227, 247), 'kp.Tensor', 'kp.Tensor', (['[2, 2, 2]'], {}), '([2, 2, 2])\n', (236, 247), False, 'import kp\n'), ((266, 286), 'kp.Tensor', 'kp.Tensor', (['[1, 2, 3]'], {}), '([1, 2, 3])\n', (275, 28... |
# %%
import numpy as nd
import pandas as pd
import functools
import allocate
import matplotlib.pyplot as plt
# %%
# Generate 30 days of orders using the Poisson distribution with the given rates
order_rates = [
("aaa", 400/30),
("bbb", 500/30),
("ccc", 500/30),
("xxx", 800/30),
("yyy", 800/30),
... | [
"allocate.allocate",
"matplotlib.pyplot.show",
"allocate.plot_simprod",
"pandas.date_range",
"allocate.print_result_summary",
"allocate.plot_simstat",
"numpy.random.poisson",
"allocate.download",
"matplotlib.pyplot.subplots"
] | [((779, 793), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (791, 793), True, 'import matplotlib.pyplot as plt\n'), ((896, 906), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (904, 906), True, 'import matplotlib.pyplot as plt\n'), ((942, 1084), 'allocate.allocate', 'allocate.allocate', ([], ... |
import unittest
import numpy as np
from ifcb.data.files import DataDirectory, FilesetBin
from ifcb.data.stitching import Stitcher, InfilledImages
from .fileset_info import TEST_FILES, TEST_DATA_DIR
class TestStitcher(unittest.TestCase):
def test_stitched_size(self):
dd = DataDirectory(TEST_DATA_DIR)
... | [
"ifcb.data.files.DataDirectory",
"ifcb.data.stitching.Stitcher",
"ifcb.data.stitching.InfilledImages",
"numpy.all"
] | [((288, 316), 'ifcb.data.files.DataDirectory', 'DataDirectory', (['TEST_DATA_DIR'], {}), '(TEST_DATA_DIR)\n', (301, 316), False, 'from ifcb.data.files import DataDirectory, FilesetBin\n'), ((907, 935), 'ifcb.data.files.DataDirectory', 'DataDirectory', (['TEST_DATA_DIR'], {}), '(TEST_DATA_DIR)\n', (920, 935), False, 'fr... |
# coding: utf-8
"""
Borrowed from https://github.com/1996scarlet/Dense-Head-Pose-Estimation/blob/main/service/CtypesMeshRender.py
To use this render, you should build the clib first:
```
cd utils/asset
gcc -shared -Wall -O3 render.c -o render.so -fPIC
cd ../..
```
"""
import sys
sys.path.append('../../3DDFA')
impo... | [
"sys.path.append",
"numpy.zeros_like",
"numpy.ctypeslib.as_ctypes",
"cv2.imwrite",
"os.path.realpath",
"numpy.ascontiguousarray",
"os.path.exists",
"cv2.addWeighted",
"numpy.array",
"ctypes.CDLL",
"utils.functions.plot_image"
] | [((284, 314), 'sys.path.append', 'sys.path.append', (['"""../../3DDFA"""'], {}), "('../../3DDFA')\n", (299, 314), False, 'import sys\n'), ((949, 967), 'ctypes.CDLL', 'ctypes.CDLL', (['clibs'], {}), '(clibs)\n', (960, 967), False, 'import ctypes\n'), ((991, 1024), 'numpy.array', 'np.array', (['light'], {'dtype': 'np.flo... |
# Copyright 2019 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, ... | [
"tensorflow.test.main",
"tensorflow_model_analysis.metrics.metric_util.to_scalar",
"tensorflow_model_analysis.metrics.metric_util.to_label_prediction_example_weight",
"tensorflow_model_analysis.metrics.metric_util.select_class_id",
"tensorflow_model_analysis.metrics.metric_util.select_top_k",
"tensorflow_... | [((14039, 14053), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (14051, 14053), True, 'import tensorflow as tf\n'), ((1605, 1692), 'tensorflow_model_analysis.metrics.metric_util.to_label_prediction_example_weight', 'metric_util.to_label_prediction_example_weight', (['example'], {'output_name': '"""output_na... |
import time
import matplotlib.pyplot as plt
import numpy as np
class AnimateScatter():
"""creates an animated scatter plot which can be updated"""
def __init__(self, xmin, xmax, ymin, ymax, pos, col, func, resolution, t):
plt.ion()
self.xmin = xmin
self.xmax = xmax
self.ymin ... | [
"numpy.meshgrid",
"time.sleep",
"matplotlib.pyplot.ion",
"numpy.arange",
"matplotlib.pyplot.subplots"
] | [((241, 250), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (248, 250), True, 'import matplotlib.pyplot as plt\n'), ((381, 395), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (393, 395), True, 'import matplotlib.pyplot as plt\n'), ((529, 585), 'numpy.arange', 'np.arange', (['self.xmin', '(self... |
import numpy as np
from scipy.ndimage import distance_transform_edt, label
from skimage import feature
from skimage import filters
from skimage.data import astronaut
# from wspy import watershed
from wsxt import watershed
data = astronaut()[:256, :256]
edges = feature.canny(data[..., 0] / 255.)
distances = distance_... | [
"scipy.ndimage.distance_transform_edt",
"skimage.data.astronaut",
"numpy.unique",
"numpy.ones",
"skimage.filters.gaussian",
"scipy.ndimage.label",
"skimage.feature.canny",
"wsxt.watershed"
] | [((264, 299), 'skimage.feature.canny', 'feature.canny', (['(data[..., 0] / 255.0)'], {}), '(data[..., 0] / 255.0)\n', (277, 299), False, 'from skimage import feature\n'), ((311, 347), 'scipy.ndimage.distance_transform_edt', 'distance_transform_edt', (['(edges < 0.25)'], {}), '(edges < 0.25)\n', (333, 347), False, 'from... |
# -*- coding: utf-8 -*-
import argparse
import errno
import itertools
import math
import matplotlib.pyplot as plt
import mlflow
import mlflow.sklearn
import numpy as np
import os
import pydot
import random
import scipy.stats as stats
import shutil
import sklearn.metrics as metrics
import sys
from dask.diagnostics impo... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"os.unlink",
"sklearn.preprocessing.StandardScaler",
"sklearn.metrics.r2_score",
"sklearn.metrics.mean_absolute_error",
"os.path.isfile",
"numpy.arange",
"mlflow.log_artifacts",
"os.path.join",
"argparse.ArgumentTypeError",
"mlflow.log_param",
... | [((1027, 1043), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1037, 1043), False, 'import os\n'), ((1469, 1499), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(15, 10)'}), '(figsize=(15, 10))\n', (1481, 1499), True, 'import matplotlib.pyplot as plt\n'), ((1802, 1853), 'matplotlib.pyplot.leg... |
# Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
from typing import Callable, Dict, List
import numpy as np
import pandas as pd
from responsibleai.databalanceanalysis.balance_measures import BalanceMeasures
from responsibleai.databalanceanalysis.constants import Measures
def _get_generalized... | [
"numpy.absolute",
"pandas.DataFrame.from_dict",
"numpy.log",
"numpy.power",
"numpy.mean",
"numpy.prod"
] | [((1305, 1322), 'numpy.mean', 'np.mean', (['benefits'], {}), '(benefits)\n', (1312, 1322), True, 'import numpy as np\n'), ((2600, 2617), 'numpy.mean', 'np.mean', (['benefits'], {}), '(benefits)\n', (2607, 2617), True, 'import numpy as np\n'), ((1262, 1283), 'numpy.absolute', 'np.absolute', (['benefits'], {}), '(benefit... |
#!/usr/bin/python3
# This script generates the quorum interconnection matrices for different quorum sizes stored in
# src/quorumnet/conn_matrix.h and used to establish a quorum p2p mesh that establishes a set of
# connections with good partial connectivity using a minimal number of outgoing connections.
#
# It works b... | [
"terminaltables.SingleTable",
"numpy.zeros"
] | [((2057, 2092), 'numpy.zeros', 'np.zeros', (['[nodes, nodes]'], {'dtype': 'int'}), '([nodes, nodes], dtype=int)\n', (2065, 2092), True, 'import numpy as np\n'), ((3827, 3862), 'numpy.zeros', 'np.zeros', (['[nodes, nodes]'], {'dtype': 'int'}), '([nodes, nodes], dtype=int)\n', (3835, 3862), True, 'import numpy as np\n'),... |
# ---------------------------------------------------
# Intermediate Python - Basic plots with Matplotlib
# 21 set 2020
# VNTBJR
# ---------------------------------------------------
#
# Load packages
library(reticulate)
# Load modules
import pandas as pd
import matplotlib as plt
# Load data
gapminder = pd.read_... | [
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.text",
"numpy.array",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.... | [((312, 358), 'pandas.read_csv', 'pd.read_csv', (['"""Datasets/Gapminder.csv"""'], {'sep': '""","""'}), "('Datasets/Gapminder.csv', sep=',')\n", (323, 358), True, 'import pandas as pd\n'), ((4720, 4739), 'matplotlib.pyplot.plot', 'plt.plot', (['year', 'pop'], {}), '(year, pop)\n', (4728, 4739), True, 'import matplotlib... |
#
# Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | [
"numpy.argmax",
"rl_coach.schedules.LinearSchedule",
"rl_coach.utils.dynamic_import_and_instantiate_module_from_params",
"rl_coach.exploration_policies.additive_noise.AdditiveNoiseParameters",
"numpy.random.rand"
] | [((1216, 1248), 'rl_coach.schedules.LinearSchedule', 'LinearSchedule', (['(0.5)', '(0.01)', '(50000)'], {}), '(0.5, 0.01, 50000)\n', (1230, 1248), False, 'from rl_coach.schedules import Schedule, LinearSchedule\n'), ((1344, 1369), 'rl_coach.exploration_policies.additive_noise.AdditiveNoiseParameters', 'AdditiveNoisePar... |
from lazy_dataset import Dataset, FilterException
import numpy as np
import numbers
class MixUpDataset(Dataset):
"""
>>> ds = MixUpDataset(range(10), SampleMixupComponents((.0,1.)), (lambda x: x), buffer_size=2)
>>> list(ds)
"""
def __init__(self, input_dataset, sample_fn, mixup_fn, buffer_size=10... | [
"numpy.sum",
"numpy.ceil",
"numpy.zeros",
"numpy.array",
"numpy.random.rand"
] | [((3984, 4007), 'numpy.array', 'np.array', (['start_indices'], {}), '(start_indices)\n', (3992, 4007), True, 'import numpy as np\n'), ((4031, 4053), 'numpy.array', 'np.array', (['stop_indices'], {}), '(stop_indices)\n', (4039, 4053), True, 'import numpy as np\n'), ((4263, 4318), 'numpy.zeros', 'np.zeros', (['stft_shape... |
from itertools import count
from threading import Thread
from queue import Queue
import json
import cv2
import numpy as np
import torch
import torch.multiprocessing as mp
from alphapose.utils.presets import SimpleTransform
import os
class VidorFileDetectionLoader():
def __init__(self, input_source, cfg, opt, fo... | [
"threading.Thread",
"json.load",
"os.makedirs",
"torch.multiprocessing.Value",
"os.path.exists",
"torch.FloatTensor",
"cv2.imread",
"numpy.array",
"torch.multiprocessing.Process",
"alphapose.utils.presets.SimpleTransform",
"torch.multiprocessing.Queue",
"os.path.join",
"queue.Queue"
] | [((1639, 1690), 'os.path.join', 'os.path.join', (['opt.vidor_root', 'save_name', 'folder_idx'], {}), '(opt.vidor_root, save_name, folder_idx)\n', (1651, 1690), False, 'import os\n'), ((700, 859), 'alphapose.utils.presets.SimpleTransform', 'SimpleTransform', (['self'], {'scale_factor': '(0)', 'input_size': 'self._input_... |
import io
import os
import shutil
from pathlib import Path
from typing import Iterable, List, Optional, Union
import cv2
import mmcv
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.lines import Line2D
from mpl_toolkits.mplot3d import Axes3D
from mmhuman3d.core.conventions.cameras import enc_ca... | [
"mmcv.mkdir_or_exist",
"cv2.imdecode",
"matplotlib.pyplot.figure",
"pathlib.Path",
"shutil.rmtree",
"os.path.join",
"matplotlib.lines.Line2D",
"mmhuman3d.utils.ffmpeg_utils.images_to_video",
"cv2.cvtColor",
"matplotlib.pyplot.close",
"mmhuman3d.core.conventions.cameras.enc_camera_convention",
... | [((16407, 16419), 'io.BytesIO', 'io.BytesIO', ([], {}), '()\n', (16417, 16419), False, 'import io\n'), ((16566, 16590), 'cv2.imdecode', 'cv2.imdecode', (['img_arr', '(1)'], {}), '(img_arr, 1)\n', (16578, 16590), False, 'import cv2\n'), ((16601, 16637), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2RGB'], {}),... |
from EXOSIMS.Prototypes.PlanetPopulation import PlanetPopulation
import numpy as np
import astropy.units as u
class EarthTwinHabZone1(PlanetPopulation):
"""
Population of Earth twins (1 R_Earth, 1 M_Eearth, 1 p_Earth)
On circular Habitable zone orbits (0.7 to 1.5 AU)
Note that these values may not... | [
"numpy.random.uniform",
"EXOSIMS.Prototypes.PlanetPopulation.PlanetPopulation.__init__"
] | [((754, 794), 'EXOSIMS.Prototypes.PlanetPopulation.PlanetPopulation.__init__', 'PlanetPopulation.__init__', (['self'], {}), '(self, **specs)\n', (779, 794), False, 'from EXOSIMS.Prototypes.PlanetPopulation import PlanetPopulation\n'), ((1320, 1366), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': 'v[0]', 'hig... |
# -*- coding: utf-8 -*-
# @Time : 2020/8/18
# @Author : <NAME>
# @Email : <EMAIL>
r"""
ItemKNN
################################################
Reference:
Aiolli,F et al. Efficient top-n recommendation for very large scale binary rated datasets.
In Proceedings of the 7th ACM conference on Recommender system... | [
"torch.from_numpy",
"numpy.sum",
"numpy.multiply",
"numpy.expand_dims",
"numpy.ones",
"numpy.argsort",
"scipy.sparse.csr_matrix",
"numpy.array",
"torch.zeros",
"numpy.sqrt"
] | [((2087, 2108), 'numpy.sqrt', 'np.sqrt', (['sumOfSquared'], {}), '(sumOfSquared)\n', (2094, 2108), True, 'import numpy as np\n'), ((4749, 4849), 'scipy.sparse.csr_matrix', 'sp.csr_matrix', (['(values, (rows, cols))'], {'shape': '(self.n_columns, self.n_columns)', 'dtype': 'np.float32'}), '((values, (rows, cols)), shape... |
# -*- coding: UTF-8 -*-
from __future__ import division
import cv2
import numpy as np
from ..io import imread
from .resize import imresize
from icv.utils.itis import is_np_array,is_seq,is_empty
def immerge(img_list, origin="x", resize=None):
assert len(img_list) > 0
assert origin in ["x", "y"], "param origin ... | [
"numpy.abs",
"icv.utils.itis.is_empty",
"numpy.ceil",
"numpy.empty",
"icv.data.shape.transforms.bbox_clip",
"numpy.ones",
"cv2.warpAffine",
"icv.utils.itis.is_seq",
"numpy.array",
"icv.data.shape.transforms.bbox_scaling",
"icv.utils.itis.is_np_array",
"numpy.round",
"cv2.getRotationMatrix2D"... | [((901, 957), 'numpy.concatenate', 'np.concatenate', (['img_list'], {'axis': "(1 if origin == 'x' else 0)"}), "(img_list, axis=1 if origin == 'x' else 0)\n", (915, 957), True, 'import numpy as np\n'), ((2904, 2950), 'cv2.getRotationMatrix2D', 'cv2.getRotationMatrix2D', (['center', '(-angle)', 'scale'], {}), '(center, -... |
import os
import numpy as np
import pandas as pd
import scipy.io as spio
from itertools import combinations
from dataclasses import dataclass
from typing import Any
import urllib
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.colors as colors
import math
import shapefile as shp
import geopan... | [
"pandas.DataFrame",
"os.makedirs",
"scipy.io.loadmat",
"numpy.median",
"matplotlib.colors.BoundaryNorm",
"os.path.dirname",
"os.path.exists",
"numpy.flipud",
"itertools.combinations",
"urllib.request.urlretrieve",
"shapefile.Writer",
"numpy.array",
"pandas.Series",
"numpy.array_equal",
"... | [((1824, 1856), 'shapefile.Writer', 'shp.Writer', (['shp_out', 'shp.POLYGON'], {}), '(shp_out, shp.POLYGON)\n', (1834, 1856), True, 'import shapefile as shp\n'), ((2963, 2984), 'itertools.combinations', 'combinations', (['args', '(2)'], {}), '(args, 2)\n', (2975, 2984), False, 'from itertools import combinations\n'), (... |
import numpy as np
class ReplayStacker:
def __init__(self, columns, window_length=100):
self._data = np.zeros((window_length, columns))
self.capacity = window_length
self.size = 0
self.columns = columns
def update(self, x):
self._add(x)
def _add(self,... | [
"numpy.roll",
"numpy.zeros",
"numpy.linspace",
"numpy.random.choice"
] | [((1769, 1813), 'numpy.linspace', 'np.linspace', (['(0)', '(replay_size - 1)', 'sample_size'], {}), '(0, replay_size - 1, sample_size)\n', (1780, 1813), True, 'import numpy as np\n'), ((1824, 1874), 'numpy.random.choice', 'np.random.choice', (['indx', 'sample_size'], {'replace': '(False)'}), '(indx, sample_size, replac... |
import logging
import os
import csv
from typing import List
from ... import InputExample
import numpy as np
logger = logging.getLogger(__name__)
class CEBinaryAccuracyEvaluator:
"""
This evaluator can be used with the CrossEncoder class.
It is designed for CrossEncoders with 1 outputs. It ... | [
"numpy.sum",
"csv.writer",
"os.path.isfile",
"os.path.join",
"logging.getLogger"
] | [((127, 154), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (144, 154), False, 'import logging\n'), ((2070, 2104), 'numpy.sum', 'np.sum', (['(pred_labels == self.labels)'], {}), '(pred_labels == self.labels)\n', (2076, 2104), True, 'import numpy as np\n'), ((2265, 2305), 'os.path.join', ... |
'''
inference framework
'''
import os
import h5py
import numpy as np
import zeus
import emcee
import scipy.stats as stat
import scipy.optimize as op
from speclite import filters as specFilter
class MCMC(object):
''' base class object for MCMC inference
Parameters
----------
prior : Prior cl... | [
"numpy.sum",
"numpy.abs",
"numpy.empty",
"numpy.ones",
"numpy.random.mtrand.RandomState",
"os.path.isfile",
"numpy.mean",
"numpy.diag",
"numpy.prod",
"zeus.EnsembleSampler",
"numpy.atleast_2d",
"scipy.optimize.minimize",
"numpy.random.randn",
"numpy.isfinite",
"numpy.cumsum",
"numpy.ma... | [((9392, 9516), 'zeus.EnsembleSampler', 'zeus.EnsembleSampler', (['self.nwalkers', 'self.ndim_sampling', 'self.lnPost'], {'args': 'lnpost_args', 'kwargs': 'lnpost_kwargs', 'pool': 'pool'}), '(self.nwalkers, self.ndim_sampling, self.lnPost, args=\n lnpost_args, kwargs=lnpost_kwargs, pool=pool)\n', (9412, 9516), False... |
# -*- coding: utf-8 -*-
# Copyright 2014 Novo Nordisk Foundation Center for Biosustainability, DTU.
#
# 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/LICE... | [
"cameo.flux_analysis.structural.find_blocked_reactions_nullspace",
"numpy.abs",
"cameo.util.float_floor",
"numpy.isnan",
"IPython.core.display.HTML",
"pandas.pandas.concat",
"numpy.isposinf",
"pandas.DataFrame",
"cameo.flux_analysis.analysis.flux_variability_analysis",
"warnings.simplefilter",
"... | [((2362, 2389), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2379, 2389), False, 'import logging\n'), ((1954, 1979), 'warnings.catch_warnings', 'warnings.catch_warnings', ([], {}), '()\n', (1977, 1979), False, 'import warnings\n'), ((1985, 2016), 'warnings.simplefilter', 'warnings.simp... |
from __future__ import annotations
from typing import Literal, Tuple, Callable, List
import numpy as np
from numpy.random import permutation
import pandas as pd
import geopandas as gpd
import libpysal as lps
from esda import Moran_Local
from functools import partial
from multiprocessing import cpu_count, Pool
from da... | [
"libpysal.weights.w_union",
"numpy.nan_to_num",
"libpysal.weights.KNN.from_dataframe",
"splot.libpysal.plot_spatial_weights",
"numpy.isnan",
"numpy.ones",
"numpy.nanmean",
"pandas.DataFrame",
"multiprocessing.cpu_count",
"pandas.merge",
"numpy.apply_along_axis",
"functools.partial",
"datetim... | [((18470, 18555), 'esda.Moran_Local', 'Moran_Local', (['col', 'W'], {'geoda_quads': '(True)', 'permutations': 'permutations', 'seed': 'self.seed'}), '(col, W, geoda_quads=True, permutations=permutations, seed=self.seed\n )\n', (18481, 18555), False, 'from esda import Moran_Local\n'), ((5823, 5837), 'pandas.DataFrame... |
#!/usr/env/python
"""
cts_lattice_gas.py: continuous-time stochastic version of a lattice-gas cellular
automaton model.
GT Sep 2014
"""
from __future__ import print_function
import random
import time
from numpy import arange, bincount, zeros
from pylab import axis, plot, show, subplots, title, xlabel, ylabel
from l... | [
"landlab.HexModelGrid",
"pylab.title",
"pylab.show",
"landlab.ca.celllab_cts.Transition",
"random.randint",
"pylab.axis",
"pylab.ylabel",
"landlab.ca.oriented_hex_cts.OrientedHexCTS",
"time.time",
"random.random",
"pylab.subplots",
"numpy.arange",
"pylab.xlabel",
"numpy.bincount",
"matpl... | [((11517, 11528), 'time.time', 'time.time', ([], {}), '()\n', (11526, 11528), False, 'import time\n'), ((11614, 11684), 'landlab.HexModelGrid', 'HexModelGrid', (['nr', 'nc', '(1.0)'], {'orientation': '"""vertical"""', 'reorient_links': '(True)'}), "(nr, nc, 1.0, orientation='vertical', reorient_links=True)\n", (11626, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.