code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import os
import tempfile
import numpy as np
import pytest
import calliope
def verify_solution_integrity(model_solution, solution_from_disk, tempdir):
# Check whether the two are the same
np.allclose(model_solution['e_cap'], solution_from_disk['e_cap'])
# Check that config AttrDict has been... | [
"tempfile.TemporaryDirectory",
"calliope.read.read_netcdf",
"numpy.allclose",
"pytest.fixture",
"calliope.read.read_csv",
"calliope.Model",
"os.path.join"
] | [((208, 273), 'numpy.allclose', 'np.allclose', (["model_solution['e_cap']", "solution_from_disk['e_cap']"], {}), "(model_solution['e_cap'], solution_from_disk['e_cap'])\n", (219, 273), True, 'import numpy as np\n'), ((435, 465), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", ... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"numpy.shape",
"numpy.random.randn"
] | [((1836, 1857), 'numpy.shape', 'np.shape', (['mean_action'], {}), '(mean_action)\n', (1844, 1857), True, 'import numpy as np\n'), ((2010, 2044), 'numpy.random.randn', 'np.random.randn', (['*batch_action_dim'], {}), '(*batch_action_dim)\n', (2025, 2044), True, 'import numpy as np\n')] |
from matplotlib.finance import quotes_historical_yahoo
import sys
from datetime import date
import matplotlib.pyplot as plt
import numpy as np
today = date.today()
start = (today.year - 1, today.month, today.day)
symbol = 'DISH'
if len(sys.argv) == 2:
symbol = sys.argv[1]
quotes = quotes_historical_yahoo(symbol,... | [
"matplotlib.finance.quotes_historical_yahoo",
"matplotlib.pyplot.show",
"datetime.date.today",
"matplotlib.pyplot.figure",
"numpy.diff",
"numpy.array"
] | [((152, 164), 'datetime.date.today', 'date.today', ([], {}), '()\n', (162, 164), False, 'from datetime import date\n'), ((289, 334), 'matplotlib.finance.quotes_historical_yahoo', 'quotes_historical_yahoo', (['symbol', 'start', 'today'], {}), '(symbol, start, today)\n', (312, 334), False, 'from matplotlib.finance import... |
import numpy as np
def test_rotation():
board_size = 3
states = np.array([[[[1, 2, 0],
[2, 1, 0],
[0, 1, 2]]],
[[[0, 3, 4],
[0, 0, 0],
[2, 1, 0]]]])
visit_counts = np.array([[0, 0, 3,... | [
"numpy.fliplr",
"numpy.rot90",
"numpy.array",
"numpy.flip"
] | [((74, 163), 'numpy.array', 'np.array', (['[[[[1, 2, 0], [2, 1, 0], [0, 1, 2]]], [[[0, 3, 4], [0, 0, 0], [2, 1, 0]]]]'], {}), '([[[[1, 2, 0], [2, 1, 0], [0, 1, 2]]], [[[0, 3, 4], [0, 0, 0], [2, \n 1, 0]]]])\n', (82, 163), True, 'import numpy as np\n'), ((301, 369), 'numpy.array', 'np.array', (['[[0, 0, 3, 0, 0, 2, 1... |
import numpy as np
import jetyak
import jviz
import sensors
import shapefile
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import utm
from mpl_toolkits.basemap import Basemap
import mpl_toolkits.basemap as mb
from scipy import stats
def lat2str(deg):
min = 60 * (deg - np.floor(deg))
deg... | [
"numpy.abs",
"matplotlib.pyplot.show",
"numpy.floor",
"numpy.arange",
"mpl_toolkits.basemap.Basemap"
] | [((323, 336), 'numpy.floor', 'np.floor', (['deg'], {}), '(deg)\n', (331, 336), True, 'import numpy as np\n'), ((582, 595), 'numpy.floor', 'np.floor', (['deg'], {}), '(deg)\n', (590, 595), True, 'import numpy as np\n'), ((844, 969), 'mpl_toolkits.basemap.Basemap', 'Basemap', ([], {'llcrnrlon': '(-170)', 'llcrnrlat': '(0... |
import torch
import torch.utils.data as data
from torchvision.datasets.folder import has_file_allowed_extension, is_image_file, IMG_EXTENSIONS, pil_loader, accimage_loader,default_loader
from PIL import Image
import sys
import os
import os.path
import numpy as np
from random import shuffle
REGIONS_DICT={'Alabama':... | [
"os.path.expanduser",
"torchvision.datasets.folder.has_file_allowed_extension",
"os.path.isdir",
"random.shuffle",
"os.walk",
"numpy.array",
"os.path.join",
"os.listdir",
"os.scandir",
"numpy.repeat"
] | [((1095, 1118), 'os.path.expanduser', 'os.path.expanduser', (['dir'], {}), '(dir)\n', (1113, 1118), False, 'import os\n'), ((1144, 1159), 'os.listdir', 'os.listdir', (['dir'], {}), '(dir)\n', (1154, 1159), False, 'import os\n'), ((1174, 1199), 'os.path.join', 'os.path.join', (['dir', 'target'], {}), '(dir, target)\n', ... |
import random
import numpy as np
from bayesnet.network import Network
def hmc(model, call_args, parameter=None, sample_size=100, step_size=1e-3, n_step=10):
"""
Hamiltonian Monte Carlo sampling aka Hybrid Monte Carlo sampling
Parameters
----------
model : Network
bayesian network
call... | [
"random.random",
"numpy.square",
"numpy.exp",
"numpy.random.normal"
] | [((3079, 3116), 'numpy.exp', 'np.exp', (['(hamiltonian - hamiltonian_new)'], {}), '(hamiltonian - hamiltonian_new)\n', (3085, 3116), True, 'import numpy as np\n'), ((2184, 2214), 'numpy.random.normal', 'np.random.normal', ([], {'size': 'v.shape'}), '(size=v.shape)\n', (2200, 2214), True, 'import numpy as np\n'), ((3129... |
import collections
import math
import numbers
import numpy as np
from .. import base
from .. import optim
from .. import utils
__all__ = [
'LinearRegression',
'LogisticRegression'
]
class GLM:
"""Generalized Linear Model.
Parameters:
optimizer (optim.Optimizer): The sequential optimizer u... | [
"collections.defaultdict",
"numpy.argsort"
] | [((1625, 1661), 'collections.defaultdict', 'collections.defaultdict', (['initializer'], {}), '(initializer)\n', (1648, 1661), False, 'import collections\n'), ((8519, 8544), 'numpy.argsort', 'np.argsort', (['contributions'], {}), '(contributions)\n', (8529, 8544), True, 'import numpy as np\n')] |
from ROAR.agent_module.agent import Agent
from ROAR.utilities_module.data_structures_models import SensorsData
from ROAR.utilities_module.vehicle_models import Vehicle, VehicleControl
from ROAR.configurations.configuration import Configuration as AgentConfig
import cv2
import numpy as np
import open3d as o3d
from ROAR.... | [
"ROAR.perception_module.ground_plane_detector.GroundPlaneDetector",
"open3d.visualization.Visualizer",
"ROAR.utilities_module.occupancy_map.OccupancyGridMap",
"numpy.asarray",
"open3d.geometry.PointCloud",
"open3d.geometry.TriangleMesh.create_coordinate_frame",
"ROAR.utilities_module.vehicle_models.Vehi... | [((842, 870), 'ROAR.utilities_module.occupancy_map.OccupancyGridMap', 'OccupancyGridMap', ([], {'agent': 'self'}), '(agent=self)\n', (858, 870), False, 'from ROAR.utilities_module.occupancy_map import OccupancyGridMap\n'), ((899, 936), 'ROAR.perception_module.depth_to_pointcloud_detector.DepthToPointCloudDetector', 'De... |
#!/usr/bin/env python3
"""Scan serial ports for ping devices
Symlinks to detected devices are created under /dev/serial/ping/
This script needs root permission to create the symlinks
"""
import subprocess
import numpy as np
import rospy
from brping import PingDevice, PingParser, PingMessage
from brping.defini... | [
"serial.Serial",
"brping.PingParser",
"rospy.Time.now",
"brping.PingDevice",
"numpy.frombuffer",
"subprocess.check_output",
"socket.socket",
"sensor_msgs.msg.MultiEchoLaserScan",
"rospy.Publisher",
"rospy.Rate",
"rospy.loginfo",
"sensor_msgs.msg.Range",
"rospy.is_shutdown",
"brping.PingMes... | [((5198, 5235), 'rospy.init_node', 'rospy.init_node', (['"""ping1d_driver_node"""'], {}), "('ping1d_driver_node')\n", (5213, 5235), False, 'import rospy\n'), ((5323, 5338), 'rospy.Rate', 'rospy.Rate', (['(1.0)'], {}), '(1.0)\n', (5333, 5338), False, 'import rospy\n'), ((5930, 5942), 'brping.PingParser', 'PingParser', (... |
# BSD 3-Clause License
# Copyright (c) 2020, Instit<NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# lis... | [
"numpy.isin",
"scipy.sparse.find",
"numpy.logical_not",
"numpy.zeros",
"networkx.topological_sort",
"networkx.selfloop_edges",
"numpy.cumsum",
"scipy.sparse.csc_matrix",
"numpy.where",
"numpy.array",
"scipy.sparse.csgraph.connected_components",
"networkx.strongly_connected_components",
"netw... | [((2565, 2589), 'numpy.zeros', 'np.zeros', (['(matr_size, 1)'], {}), '((matr_size, 1))\n', (2573, 2589), True, 'import numpy as np\n'), ((3138, 3161), 'scipy.sparse.find', 'sparse.find', (['(t_matr > 0)'], {}), '(t_matr > 0)\n', (3149, 3161), True, 'import scipy.sparse as sparse\n'), ((3860, 3905), 'numpy.isin', 'np.is... |
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 27 22:04:58 2020
@author: zhangjun
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 27 20:06:37 2020
@author: zhangjun
"""
import numpy as np
class perceptron:
def __init__(self):
self.alpha = None
self.b = None
self.w... | [
"numpy.zeros",
"numpy.dot",
"numpy.array",
"numpy.sum"
] | [((1480, 1514), 'numpy.array', 'np.array', (['[[3, 3], [4, 3], [1, 1]]'], {}), '([[3, 3], [4, 3], [1, 1]])\n', (1488, 1514), True, 'import numpy as np\n'), ((1519, 1539), 'numpy.array', 'np.array', (['[1, 1, -1]'], {}), '([1, 1, -1])\n', (1527, 1539), True, 'import numpy as np\n'), ((405, 425), 'numpy.zeros', 'np.zeros... |
import numpy as np
import pylab as pl
from sklearn import mixture
np.random.seed(0)
#C1 = np.array([[3, -2.7], [1.5, 2.7]])
#C2 = np.array([[1, 2.0], [-1.5, 1.7]])
#
#X_train = np.r_[
# np.random.multivariate_normal((-7, -7), C1, size=7),
# np.random.multivariate_normal((7, 7), C2, size=7),
#]
X_train = np.r_[
... | [
"pylab.contour",
"pylab.show",
"numpy.random.seed",
"sklearn.mixture.GaussianMixture",
"pylab.scatter",
"numpy.array",
"numpy.column_stack"
] | [((67, 84), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (81, 84), True, 'import numpy as np\n'), ((470, 533), 'sklearn.mixture.GaussianMixture', 'mixture.GaussianMixture', ([], {'n_components': '(2)', 'covariance_type': '"""full"""'}), "(n_components=2, covariance_type='full')\n", (493, 533), False, ... |
import numpy as np
import pandas as pd
from scipy.optimize import curve_fit
from .helper import exp_fit_func, inverse_exp_func, exp_func
def exp_curve_fit_(x_range, ln_y_range):
popc, pcov = curve_fit(exp_fit_func, x_range, ln_y_range)
ln_a, b = popc
a = np.exp(ln_a)
return a, b
def get_interm_zip_f... | [
"numpy.sum",
"numpy.log",
"scipy.optimize.curve_fit",
"numpy.min",
"numpy.exp",
"numpy.log10"
] | [((197, 241), 'scipy.optimize.curve_fit', 'curve_fit', (['exp_fit_func', 'x_range', 'ln_y_range'], {}), '(exp_fit_func, x_range, ln_y_range)\n', (206, 241), False, 'from scipy.optimize import curve_fit\n'), ((269, 281), 'numpy.exp', 'np.exp', (['ln_a'], {}), '(ln_a)\n', (275, 281), True, 'import numpy as np\n'), ((1105... |
import numpy as np
from scipy.spatial import cKDTree
from scipy.spatial.distance import pdist, squareform
from scipy.sparse import coo_matrix
import pylab as plt
def squared_exponential(x2,D=3):
#x = np.reshape(x,(-1,D))
return np.exp(-x2/2.)
def matern52(x2):
x = np.sqrt(x2)
res = x2
res *= 5./3.... | [
"numpy.meshgrid",
"numpy.sum",
"numpy.ones",
"scipy.sparse.coo_matrix",
"numpy.array",
"numpy.exp",
"numpy.linspace",
"scipy.spatial.cKDTree",
"scipy.spatial.distance.pdist",
"numpy.arange",
"numpy.sqrt"
] | [((237, 254), 'numpy.exp', 'np.exp', (['(-x2 / 2.0)'], {}), '(-x2 / 2.0)\n', (243, 254), True, 'import numpy as np\n'), ((279, 290), 'numpy.sqrt', 'np.sqrt', (['x2'], {}), '(x2)\n', (286, 290), True, 'import numpy as np\n'), ((1032, 1054), 'scipy.spatial.cKDTree', 'cKDTree', (['(points / corr)'], {}), '(points / corr)\... |
# Translation in python of the Matlab implementation of <NAME> and
# <NAME>, of the algorithm described in
# "Mixtures of Probabilistic Principal Component Analysers",
# <NAME> and <NAME>, Neural Computation 11(2),
# pp 443–482, MIT Press, 1999
import numpy as np
def initialization_kmeans(X, p, q, variance_level=No... | [
"numpy.log",
"numpy.eye",
"numpy.random.randn",
"numpy.power",
"numpy.zeros",
"numpy.argmin",
"numpy.random.randint",
"numpy.linalg.inv",
"numpy.exp",
"numpy.dot",
"numpy.unique"
] | [((653, 679), 'numpy.random.randint', 'np.random.randint', (['(0)', 'N', 'p'], {}), '(0, N, p)\n', (670, 679), True, 'import numpy as np\n'), ((828, 844), 'numpy.zeros', 'np.zeros', (['(N, p)'], {}), '((N, p))\n', (836, 844), True, 'import numpy as np\n'), ((860, 887), 'numpy.zeros', 'np.zeros', (['N'], {'dtype': 'np.i... |
import os
import numpy as np
folder = ""
file_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.chdir(file_path)
map_files = {
"main": "main.csv",
"landmass": "landmass.csv"
}
save_file = "map_saves"
def save(maps):
for map_name in maps:
np.savetxt(save_file... | [
"numpy.loadtxt",
"os.path.abspath",
"numpy.savetxt",
"os.chdir"
] | [((121, 140), 'os.chdir', 'os.chdir', (['file_path'], {}), '(file_path)\n', (129, 140), False, 'import os\n'), ((92, 117), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (107, 117), False, 'import os\n'), ((300, 385), 'numpy.savetxt', 'np.savetxt', (["(save_file + '/' + map_files[map_name])",... |
from fromTxtToVec.corpus_build import Corpus
from fromTxtToVec.pad import Pad
from fromTxtToVec.BERT_feat import ExtractBertEmb
from fromTxtToVec.train_vector import Embedding
import numpy as np
class To_vec:
def __init__(self, mode, sent_maxlen):
self.mode = mode
self.sent_maxlen = ... | [
"fromTxtToVec.BERT_feat.ExtractBertEmb",
"numpy.array",
"fromTxtToVec.corpus_build.Corpus",
"fromTxtToVec.train_vector.Embedding",
"fromTxtToVec.pad.Pad"
] | [((1521, 1537), 'numpy.array', 'np.array', (['sents_'], {}), '(sents_)\n', (1529, 1537), True, 'import numpy as np\n'), ((382, 390), 'fromTxtToVec.corpus_build.Corpus', 'Corpus', ([], {}), '()\n', (388, 390), False, 'from fromTxtToVec.corpus_build import Corpus\n'), ((435, 456), 'fromTxtToVec.pad.Pad', 'Pad', (['self.s... |
""" Import needed modules """
"-----------------------------------------------------------------------------"
from scipy.integrate import solve_ivp
from Shared_Funcs.pemfc_transport_funcs import *
import cantera as ct
import numpy as np
import sys
""" Control options for derivative functions """
"---------------------... | [
"numpy.zeros_like",
"numpy.sum",
"numpy.zeros",
"numpy.hstack",
"numpy.append"
] | [((16058, 16100), 'numpy.hstack', 'np.hstack', (['[i_OCV, i_ext0, i_ext1, i_ext2]'], {}), '([i_OCV, i_ext0, i_ext1, i_ext2])\n', (16067, 16100), True, 'import numpy as np\n'), ((13776, 13793), 'numpy.zeros_like', 'np.zeros_like', (['sv'], {}), '(sv)\n', (13789, 13793), True, 'import numpy as np\n'), ((16119, 16139), 'n... |
from proteus import Domain, Context
from proteus.mprans import SpatialTools as st
from proteus import Gauges as ga
from proteus import WaveTools as wt
from math import *
import numpy as np
from proteus.mprans import BodyDynamics as bd
opts=Context.Options([
# predefined test cases
("water_level", 0.325, "Heig... | [
"proteus.mprans.BodyDynamics.CaissonBody",
"proteus.Domain.PlanarStraightLineGraphDomain",
"proteus.Gauges.PointGauges",
"proteus.mprans.SpatialTools.assembleDomain",
"proteus.mprans.SpatialTools.CustomShape",
"numpy.array",
"numpy.linspace",
"proteus.mprans.SpatialTools.Rectangle",
"proteus.Context... | [((242, 3785), 'proteus.Context.Options', 'Context.Options', (["[('water_level', 0.325, 'Height of free surface above bottom'), ('Lgen', \n 1.0, 'Genaration zone in terms of wave lengths'), ('Labs', 1.0,\n 'Absorption zone in terms of wave lengths'), ('Ls', 1.0,\n 'Length of domain from genZone to the front to... |
"""
Helper functions for calculating MMD and performing MMD test
This module contains original code from: https://github.com/fengliu90/DK-for-TST
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentati... | [
"numpy.ceil",
"numpy.ix_",
"numpy.zeros",
"torch.cat",
"torch.diag",
"torch.exp",
"numpy.sort",
"numpy.random.choice",
"torch.sum",
"torch.transpose"
] | [((1922, 1945), 'torch.cat', 'torch.cat', (['(Kx, Kxy)', '(1)'], {}), '((Kx, Kxy), 1)\n', (1931, 1945), False, 'import torch\n'), ((2006, 2032), 'torch.cat', 'torch.cat', (['(Kxxy, Kyxy)', '(0)'], {}), '((Kxxy, Kyxy), 0)\n', (2015, 2032), False, 'import torch\n'), ((4606, 4621), 'numpy.zeros', 'np.zeros', (['N_per'], {... |
import numpy as np
from blind_walking.envs.env_modifiers.env_modifier import EnvModifier
from blind_walking.envs.env_modifiers.heightfield import HeightField
from blind_walking.envs.env_modifiers.stairs import Stairs, boxHalfLength, boxHalfWidth
""" Train robot to walk up stairs curriculum.
Equal chances for t... | [
"numpy.random.uniform",
"numpy.arange",
"numpy.random.choice",
"blind_walking.envs.env_modifiers.stairs.Stairs",
"blind_walking.envs.env_modifiers.heightfield.HeightField"
] | [((3324, 3337), 'blind_walking.envs.env_modifiers.heightfield.HeightField', 'HeightField', ([], {}), '()\n', (3335, 3337), False, 'from blind_walking.envs.env_modifiers.heightfield import HeightField\n'), ((3619, 3632), 'blind_walking.envs.env_modifiers.heightfield.HeightField', 'HeightField', ([], {}), '()\n', (3630, ... |
# 2-electron VMC code for 2dim quantum dot with importance sampling
# Using gaussian rng for new positions and Metropolis- Hastings
# Added energy minimization
from math import exp, sqrt
from random import random, seed, normalvariate
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import A... | [
"scipy.optimize.minimize",
"math.exp",
"math.sqrt",
"random.normalvariate",
"numpy.zeros",
"random.random",
"numpy.array",
"random.seed"
] | [((6999, 7005), 'random.seed', 'seed', ([], {}), '()\n', (7003, 7005), False, 'from random import random, seed, normalvariate\n'), ((7133, 7153), 'numpy.array', 'np.array', (['[0.9, 0.2]'], {}), '([0.9, 0.2])\n', (7141, 7153), True, 'import numpy as np\n'), ((7210, 7312), 'scipy.optimize.minimize', 'minimize', (['Energ... |
import numpy as np
import pandas as pd
import tensorflow as tf
from sklearn.metrics import average_precision_score as auprc
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, concatenate, Input, LSTM
from tensorflow.keras.layers import Conv1D, Reshape, Lambda
from tensorflow.keras.opt... | [
"pandas.DataFrame",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv1D",
"numpy.savetxt",
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.models.Model",
"iterutils.train_generator",
"tensorflow.keras.layers.concatenate",
"tensorflow.... | [((589, 653), 'iterutils.train_generator', 'train_generator', (["path['seq']", 'batchsize', 'seqlen', '"""seq"""', '"""repeat"""'], {}), "(path['seq'], batchsize, seqlen, 'seq', 'repeat')\n", (604, 653), False, 'from iterutils import train_generator\n'), ((852, 922), 'iterutils.train_generator', 'train_generator', (["p... |
import os
import numpy as np
from netCDF4 import Dataset
from compliance_checker.ioos import (
IOOS0_1Check,
IOOS1_1Check,
IOOS1_2_PlatformIDValidator,
IOOS1_2Check,
NamingAuthorityValidator,
)
from compliance_checker.tests import BaseTestCase
from compliance_checker.tests.helpers import MockTime... | [
"netCDF4.Dataset",
"compliance_checker.ioos.IOOS1_1Check",
"compliance_checker.tests.test_cf.get_results",
"compliance_checker.ioos.IOOS0_1Check",
"compliance_checker.ioos.IOOS1_2_PlatformIDValidator",
"compliance_checker.ioos.IOOS1_2Check",
"compliance_checker.ioos.NamingAuthorityValidator",
"numpy.a... | [((737, 751), 'compliance_checker.ioos.IOOS0_1Check', 'IOOS0_1Check', ([], {}), '()\n', (749, 751), False, 'from compliance_checker.ioos import IOOS0_1Check, IOOS1_1Check, IOOS1_2_PlatformIDValidator, IOOS1_2Check, NamingAuthorityValidator\n'), ((1166, 1205), 'netCDF4.Dataset', 'Dataset', (['os.devnull', '"""w"""'], {'... |
import multiprocessing as mp
from multiprocessing.sharedctypes import RawArray
from ctypes import c_bool, c_double
import numpy as np
import pandas as pd
def standardize(X):
"""
Standardize each row in X to mean = 0 and SD = 1.
"""
X_m = np.ma.masked_invalid(X)
return ((X.T - X_m.mean(axis=1)) / X_... | [
"numpy.frombuffer",
"multiprocessing.sharedctypes.RawArray",
"numpy.ma.masked_invalid",
"numpy.isnan",
"multiprocessing.Pool"
] | [((255, 278), 'numpy.ma.masked_invalid', 'np.ma.masked_invalid', (['X'], {}), '(X)\n', (275, 278), True, 'import numpy as np\n'), ((1008, 1032), 'multiprocessing.sharedctypes.RawArray', 'RawArray', (['type', 'arr.flat'], {}), '(type, arr.flat)\n', (1016, 1032), False, 'from multiprocessing.sharedctypes import RawArray\... |
from __future__ import print_function
import torch, PIL.Image, cv2, pickle, sys, argparse
import numpy as np
import openmesh as om
from tqdm import trange
sys.path.append("../src/")
from network import shading_net
import renderer as rd
from utility import subdiv_mesh_x4
from utility import CamPara
from utility import m... | [
"numpy.absolute",
"network.shading_net",
"argparse.ArgumentParser",
"pickle.load",
"utility.subdiv_mesh_x4",
"torch.device",
"sys.path.append",
"numpy.pad",
"torch.load",
"utility.flatten_naval",
"utility.smpl_detoe",
"numpy.max",
"utility.make_trimesh",
"numpy.rollaxis",
"cv2.resize",
... | [((155, 181), 'sys.path.append', 'sys.path.append', (['"""../src/"""'], {}), "('../src/')\n", (170, 181), False, 'import torch, PIL.Image, cv2, pickle, sys, argparse\n'), ((463, 488), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (486, 488), False, 'import torch, PIL.Image, cv2, pickle, sys, a... |
import ovito
print("Hello, this is OVITO %i.%i.%i" % ovito.version)
# Import OVITO modules.
from ovito.io import *
from ovito.modifiers import *
from ovito.data import *
from collections import Counter
# Import standard Python and NumPy modules.
import sys
import numpy
import os
from ovito.pipeline import StaticSourc... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.tight_layout",
"numpy.set_printoptions",
"matplotlib.pyplot.show",
"ovito.pipeline.StaticSource",
"matplotlib.pyplot.imshow",
"sklearn.metrics.accuracy_score",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylabel",
"collections.Counter",
"matplotlib... | [((4035, 4120), 'os.path.join', 'os.path.join', (['ase_db_dataset_dir', "('hcp-sc-fcc-diam-bcc_displacement-30%' + '.db')"], {}), "(ase_db_dataset_dir, 'hcp-sc-fcc-diam-bcc_displacement-30%' + '.db'\n )\n", (4047, 4120), False, 'import os\n'), ((7813, 7845), 'sklearn.metrics.confusion_matrix', 'confusion_matrix', ([... |
import subprocess as sbp
import sys
import os
import numpy as np
import numpy.linalg as la
import pandas as pd
import time
import math
from ast import literal_eval
from pdb import set_trace as pst
'''
decfreq01: The original opitimization with negative freq as first one.
decfreq02: Move the atoms to direction of negat... | [
"numpy.zeros",
"time.time",
"numpy.linalg.eigh",
"numpy.array",
"numpy.linspace",
"os.listdir",
"sys.exit"
] | [((13279, 13290), 'time.time', 'time.time', ([], {}), '()\n', (13288, 13290), False, 'import time\n'), ((3268, 3303), 'numpy.zeros', 'np.zeros', (['(P, P)'], {'dtype': 'np.complex_'}), '((P, P), dtype=np.complex_)\n', (3276, 3303), True, 'import numpy as np\n'), ((4268, 4281), 'numpy.linalg.eigh', 'la.eigh', (['Fuvk'],... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"tf_agents.specs.array_spec.BoundedArraySpec",
"pickle.dump",
"numpy.sum",
"numpy.amin",
"numpy.maximum",
"absl.logging.info",
"tensorflow.compat.v1.Summary.Value",
"numpy.histogram",
"numpy.mean",
"tensorflow.compat.v1.gfile.Exists",
"numpy.linalg.norm",
"os.path.join",
"tensorflow.compat.v... | [((1009, 1094), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""checkpoint_iterations"""', '(50)', '"""Periodicity of checkpoints."""'], {}), "('checkpoint_iterations', 50, 'Periodicity of checkpoints.'\n )\n", (1029, 1094), False, 'from absl import flags\n'), ((1090, 1164), 'absl.flags.DEFINE_integer', '... |
import os
import numpy as np
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, LSTM, TimeDistributed, Activation, Reshape, concatenate, Input
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, CSVLogger, Callback
START_CHAR = '\b'
END_CHAR = '\t'
PADDING_C... | [
"os.remove",
"numpy.sum",
"numpy.argmax",
"numpy.random.multinomial",
"keras.models.Model",
"os.path.isfile",
"numpy.exp",
"keras.layers.Input",
"keras.layers.concatenate",
"keras.callbacks.ModelCheckpoint",
"keras.layers.Dropout",
"numpy.asarray",
"keras.optimizers.Adam",
"numpy.log",
"... | [((6724, 6755), 'keras.callbacks.CSVLogger', 'CSVLogger', (["(model_fname + '.log')"], {}), "(model_fname + '.log')\n", (6733, 6755), False, 'from keras.callbacks import ModelCheckpoint, CSVLogger, Callback\n'), ((6772, 6870), 'keras.callbacks.ModelCheckpoint', 'ModelCheckpoint', (['"""model.hdf5"""'], {'monitor': '"""... |
# Copyright 2020 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"pandas.DataFrame",
"matplotlib.pyplot.tight_layout",
"numpy.stack",
"argparse.ArgumentParser",
"os.path.join",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.r2_score",
"os.environ.get",
"pandas.read_parquet",
"pandas.Series",
"xgboost.XGBRegressor",
"matplotlib.pyplot.ylabel",
... | [((901, 928), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (918, 928), False, 'import logging\n'), ((1798, 1817), 'pandas.DataFrame', 'pd.DataFrame', (['evals'], {}), '(evals)\n', (1810, 1817), True, 'import pandas as pd\n'), ((2275, 2311), 'matplotlib.pyplot.subplots', 'plt.subplots', ... |
from brewgorithm import beer2vec, beer_emb, word_weighter
import numpy as np
import unittest
from sklearn.metrics.pairwise import cosine_similarity
class TestBeer2vec(unittest.TestCase):
def test_most_similar_test(self):
beers = beer2vec.get_beer2vec()
embeddings = beer_emb.embed_doc("apricot peach fruity"... | [
"unittest.main",
"sklearn.metrics.pairwise.cosine_similarity",
"numpy.average",
"brewgorithm.beer_emb.embed_doc",
"brewgorithm.beer2vec.get_beer2vec",
"brewgorithm.beer_emb.most_similar"
] | [((1029, 1044), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1042, 1044), False, 'import unittest\n'), ((237, 260), 'brewgorithm.beer2vec.get_beer2vec', 'beer2vec.get_beer2vec', ([], {}), '()\n', (258, 260), False, 'from brewgorithm import beer2vec, beer_emb, word_weighter\n'), ((279, 352), 'brewgorithm.beer_em... |
import numpy as np
import pandas as pd
import statsmodels.api as sm
from sklearn.preprocessing import OneHotEncoder
import statistics
import math
import sys
import itertools
import time
np.seterr(over='raise', under="ignore")
def batch_pp(df, covariates, batch_column, ignore):
"""This function takes in a df, the ... | [
"pandas.DataFrame",
"statsmodels.api.OLS",
"numpy.seterr",
"pandas.get_dummies",
"statistics.stdev",
"time.time",
"pandas.concat"
] | [((187, 226), 'numpy.seterr', 'np.seterr', ([], {'over': '"""raise"""', 'under': '"""ignore"""'}), "(over='raise', under='ignore')\n", (196, 226), True, 'import numpy as np\n'), ((1670, 1720), 'pandas.get_dummies', 'pd.get_dummies', (['df[batch_column]'], {'drop_first': '(False)'}), '(df[batch_column], drop_first=False... |
from google.protobuf.symbol_database import Default
import nltk
import random
import pickle
from nltk.corpus.reader.chasen import test
from pandas.core.indexes import period
from statsmodels.tsa.seasonal import _extrapolate_trend
nltk.download('punkt')
nltk.download('wordnet')
from nltk.stem import WordNetLemm... | [
"keras.models.load_model",
"streamlit.balloons",
"streamlit.selectbox",
"csv.reader",
"statsmodels.tsa.arima_model.ARIMA",
"streamlit.sidebar.write",
"pandas.read_csv",
"streamlit.radio",
"streamlit.title",
"streamlit.sidebar.title",
"streamlit.sidebar.selectbox",
"nltk.download",
"streamlit... | [((237, 259), 'nltk.download', 'nltk.download', (['"""punkt"""'], {}), "('punkt')\n", (250, 259), False, 'import nltk\n'), ((261, 285), 'nltk.download', 'nltk.download', (['"""wordnet"""'], {}), "('wordnet')\n", (274, 285), False, 'import nltk\n'), ((393, 412), 'nltk.stem.WordNetLemmatizer', 'WordNetLemmatizer', ([], {... |
import spacy
import sys
import numpy as np
import operator
from keras.models import load_model
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import preprocess_data
MAX_SEQUENCE_LENGTH = 100
EMBEDDING_DIM = 300
model = load_model('models/bidirectional_lstm/mod... | [
"keras.models.load_model",
"numpy.ndenumerate",
"numpy.zeros",
"spacy.load",
"operator.itemgetter",
"preprocess_data.load_intents"
] | [((279, 327), 'keras.models.load_model', 'load_model', (['"""models/bidirectional_lstm/model.h5"""'], {}), "('models/bidirectional_lstm/model.h5')\n", (289, 327), False, 'from keras.models import load_model\n'), ((334, 350), 'spacy.load', 'spacy.load', (['"""en"""'], {}), "('en')\n", (344, 350), False, 'import spacy\n'... |
import numpy as np
def train_test(
X: np.ndarray,
y: np.ndarray,
test_size: float,
random_seed: int = 0,
) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
"""
Split input data randomly after shuffling
Args:
X (np.ndarray): decision matrix
y (np.ndarray): ground-t... | [
"numpy.random.seed",
"numpy.arange",
"numpy.concatenate"
] | [((605, 632), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (619, 632), True, 'import numpy as np\n'), ((762, 784), 'numpy.arange', 'np.arange', (['num_samples'], {}), '(num_samples)\n', (771, 784), True, 'import numpy as np\n'), ((1939, 1966), 'numpy.random.seed', 'np.random.seed', (... |
import numpy as np
import pandas as pd
from tqdm import tqdm
def map_prediction_to_emergence_label(results, training_values, test_values, predictors_to_run, test_terms,
emergence_linear_thresholds=(
('rapidly emergent', 0.1),
... | [
"pandas.DataFrame",
"tqdm.tqdm",
"numpy.polyfit"
] | [((3031, 3066), 'pandas.DataFrame', 'pd.DataFrame', (["{'terms': test_terms}"], {}), "({'terms': test_terms})\n", (3043, 3066), True, 'import pandas as pd\n'), ((919, 968), 'numpy.polyfit', 'np.polyfit', (['x_data', 'normalised_counts_to_trend', '(1)'], {}), '(x_data, normalised_counts_to_trend, 1)\n', (929, 968), True... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Data Series Sonification
========================
Functionality for sonifying data series.
"""
import warnings
from inspect import signature, Parameter
import numpy as np
from astropy.table import Table, MaskedColumn
from astropy.time import Time
... | [
"numpy.isnan",
"pyo.Server",
"numpy.diff",
"inspect.signature",
"warnings.warn",
"numpy.repeat"
] | [((4450, 4462), 'pyo.Server', 'pyo.Server', ([], {}), '()\n', (4460, 4462), False, 'import pyo\n'), ((8386, 8422), 'numpy.repeat', 'np.repeat', (["self.data['asf_pitch']", '(2)'], {}), "(self.data['asf_pitch'], 2)\n", (8395, 8422), True, 'import numpy as np\n'), ((8440, 8477), 'numpy.repeat', 'np.repeat', (["self.data[... |
import pickle
import numpy as np
import pandas as pd
from keras.utils import np_utils
from keras.utils.vis_utils import plot_model
from keras.models import Sequential
from keras.preprocessing.sequence import pad_sequences
from keras.layers import LSTM, Dense, Embedding, Dropout
from sklearn.model_selection import train... | [
"pickle.dump",
"numpy.argmax",
"pandas.read_csv",
"keras.preprocessing.sequence.pad_sequences",
"sklearn.model_selection.train_test_split",
"keras.utils.vis_utils.plot_model",
"sklearn.metrics.accuracy_score",
"keras.layers.LSTM",
"keras.layers.Dropout",
"time.time",
"keras.utils.np_utils.to_cat... | [((632, 653), 'pandas.read_csv', 'pd.read_csv', (['filepath'], {}), '(filepath)\n', (643, 653), True, 'import pandas as pd\n'), ((1586, 1657), 'keras.preprocessing.sequence.pad_sequences', 'pad_sequences', ([], {'maxlen': 'input_shape', 'sequences': 'x', 'padding': '"""post"""', 'value': '(0)'}), "(maxlen=input_shape, ... |
# Python Standard Libraries
import warnings
import time
import os
import sys
from pathlib import Path
# Third party imports
# fancy prints
import numpy as np
from tqdm import tqdm
# grAdapt package
import grAdapt.utils.math
import grAdapt.utils.misc
import grAdapt.utils.sampling
from grAdapt import surrogate as sur, ... | [
"numpy.random.seed",
"grAdapt.sampling.equidistributed.MaximalMinDistance",
"grAdapt.surrogate.GPRSlidingWindow",
"grAdapt.optimizer.AMSGradBisection",
"numpy.array",
"numpy.linalg.norm",
"warnings.warn",
"grAdapt.escape.NormalDistributionDecay"
] | [((1506, 1539), 'numpy.random.seed', 'np.random.seed', (['self.random_state'], {}), '(self.random_state)\n', (1520, 1539), True, 'import numpy as np\n'), ((1600, 1622), 'grAdapt.surrogate.GPRSlidingWindow', 'sur.GPRSlidingWindow', ([], {}), '()\n', (1620, 1622), True, 'from grAdapt import surrogate as sur, optimizer as... |
#!/usr/bin/python3
"""modelling.py
Various utility functions for modelling
"""
__author__ = "<NAME>"
import os
import numpy as np
import tensorflow as tf
from tensorflow.keras.callbacks import Callback
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Activation, BatchNormalization, \... | [
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.concatenate",
"tensorflow.keras.layers.Masking",
"os.path.join",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.BatchNormalization",
"nicu_los.src.utils.custom_keras_layers.ApplyMask",
"tensorflow.keras.losses... | [((1471, 1507), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '(None, input_dimension)'}), '(shape=(None, input_dimension))\n', (1476, 1507), False, 'from tensorflow.keras.layers import Activation, BatchNormalization, Bidirectional, concatenate, Conv1D, Dense, Dropout, GlobalAveragePooling1D, GRU, Input, LST... |
from vmad.lib import linalg, mpi
from vmad.testing import BaseScalarTest
from mpi4py import MPI
import numpy
from pprint import pprint
class Test_allreduce(BaseScalarTest):
to_scalar = staticmethod(linalg.to_scalar)
comm = MPI.COMM_WORLD
x = comm.rank + 1.0
y = comm.allreduce(x) ** 2
x_ = numpy... | [
"vmad.lib.mpi.allreduce",
"numpy.eye",
"vmad.lib.mpi.allbcast",
"numpy.sum"
] | [((315, 327), 'numpy.eye', 'numpy.eye', (['(1)'], {}), '(1)\n', (324, 327), False, 'import numpy\n'), ((715, 727), 'numpy.eye', 'numpy.eye', (['(1)'], {}), '(1)\n', (724, 727), False, 'import numpy\n'), ((514, 541), 'vmad.lib.mpi.allreduce', 'mpi.allreduce', (['x', 'self.comm'], {}), '(x, self.comm)\n', (527, 541), Fal... |
import torch.nn as nn
import numpy as np
import torch
class DQN(nn.Module):
'''
pytorch CNN model for Atari games
'''
def __init__(self,img_shape,num_actions):
super(DQN,self).__init__()
self._conv=nn.Sequential(
nn.Conv2d(4,16,kernel_size=5,stride=2),
nn.BatchNor... | [
"torch.nn.ReLU",
"torch.nn.Conv2d",
"numpy.zeros",
"torch.nn.BatchNorm2d",
"numpy.random.random",
"numpy.random.randint",
"torch.nn.Linear",
"torch.no_grad"
] | [((1618, 1636), 'numpy.random.random', 'np.random.random', ([], {}), '()\n', (1634, 1636), True, 'import numpy as np\n'), ((2027, 2053), 'numpy.zeros', 'np.zeros', (['(1, 4, 100, 100)'], {}), '((1, 4, 100, 100))\n', (2035, 2053), True, 'import numpy as np\n'), ((257, 298), 'torch.nn.Conv2d', 'nn.Conv2d', (['(4)', '(16)... |
# coding:utf-8
from load_data import load_data, timer
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.model_selection import GridSearchCV
import numpy as np
import pandas a... | [
"sklearn.naive_bayes.GaussianNB",
"numpy.logspace",
"load_data.load_data",
"sklearn.linear_model.LogisticRegression",
"sklearn.svm.SVC"
] | [((409, 429), 'sklearn.linear_model.LogisticRegression', 'LogisticRegression', ([], {}), '()\n', (427, 429), False, 'from sklearn.linear_model import LogisticRegression\n'), ((685, 697), 'sklearn.naive_bayes.GaussianNB', 'GaussianNB', ([], {}), '()\n', (695, 697), False, 'from sklearn.naive_bayes import GaussianNB\n'),... |
# Copyright 2018 The TensorFlow 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 applicab... | [
"tensorflow.nn.softmax",
"tensorflow.nn.relu",
"research.cvt_text.corpus_processing.minibatching.build_array",
"tensorflow.argmax",
"tensorflow.layers.dense",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"research.cvt_text.model.model_helpers.project",
"research.cvt_text.model.model_helper... | [((1326, 1400), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, None, None]'], {'name': "(task_name + '_labels')"}), "(tf.float32, [None, None, None], name=task_name + '_labels')\n", (1340, 1400), True, 'import tensorflow as tf\n'), ((2901, 2930), 'tensorflow.nn.softmax', 'tf.nn.softmax', (['primary... |
# A simple MDP where agent has to traverse a specific path
# in gridworld - wrong action will throw player back to start or do nothing.
# Player is rewarded for reaching new maximum length in the episode.
#
# State is represented by a positive ndim vector that tells
# where the player is. This is designed to mimic coor... | [
"numpy.floor",
"gym.spaces.Discrete",
"numpy.zeros",
"numpy.random.default_rng",
"random.random",
"gym.spaces.Box"
] | [((1139, 1166), 'numpy.random.default_rng', 'np.random.default_rng', (['seed'], {}), '(seed)\n', (1160, 1166), True, 'import numpy as np\n'), ((2372, 2399), 'numpy.floor', 'np.floor', (['(ndim * mine_ratio)'], {}), '(ndim * mine_ratio)\n', (2380, 2399), True, 'import numpy as np\n'), ((2869, 2901), 'gym.spaces.Discrete... |
# coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
class Naca_4_digit(object):
def __init__(self, int_4, attack_angle_deg, resolution, quasi_equidistant=True, length_adjust=False, from5digit=False):
if from5digit == False:
self.m = float(int_4[0]) / 100 # maximum camber
... | [
"numpy.full",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"numpy.abs",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"numpy.zeros",
"numpy.min",
"numpy.max",
"numpy.array",
"numpy.sin",
"numpy.linspace",
"numpy.cos",
"numpy.arctan",
"numpy.sqrt"
] | [((646, 668), 'numpy.arctan', 'np.arctan', (['self.dyc_dx'], {}), '(self.dyc_dx)\n', (655, 668), True, 'import numpy as np\n'), ((1227, 1276), 'numpy.linspace', 'np.linspace', ([], {'start': '(0)', 'stop': '(1)', 'num': 'self.resolution'}), '(start=0, stop=1, num=self.resolution)\n', (1238, 1276), True, 'import numpy a... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from argparse import ArgumentParser
from collections import defaultdict
from typing import Optional
import fastmri
import numpy as np
import... | [
"fastmri.data.transforms.center_crop_to_smallest",
"numpy.zeros_like",
"torch.optim.lr_scheduler.StepLR",
"argparse.ArgumentParser",
"fastmri.ifft2c",
"torch.cat",
"collections.defaultdict",
"fastmri.data.transforms.center_crop",
"fastmri.pl_modules.mri_module.MriModule.add_model_specific_args",
"... | [((2896, 2982), 'fastmri.models.adaptive_varnet.AdaptiveSensitivityModel', 'AdaptiveSensitivityModel', (['sens_chans', 'sens_pools'], {'num_sense_lines': 'num_sense_lines'}), '(sens_chans, sens_pools, num_sense_lines=\n num_sense_lines)\n', (2920, 2982), False, 'from fastmri.models.adaptive_varnet import AdaptiveSen... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
loading_dataset.py
Created on Thu May 3 12:47:36 2018
@author: sungkyun
"""
import torch
from torch.utils.data.dataset import Dataset
#from torch import from_numpy
import numpy as np
import pandas as pd
#from sklearn import preprocessing
#from sklearn.preprocessing i... | [
"numpy.pad",
"numpy.random.uniform",
"numpy.load",
"nnmnkwii.minmax_scale",
"torch.LongTensor",
"pandas.read_csv",
"numpy.transpose",
"numpy.hstack",
"numpy.arange",
"glob.glob"
] | [((482, 499), 'numpy.arange', 'np.arange', (['(0)', '(420)'], {}), '(0, 420)\n', (491, 499), True, 'import numpy as np\n'), ((799, 815), 'numpy.arange', 'np.arange', (['(4)', '(64)'], {}), '(4, 64)\n', (808, 815), True, 'import numpy as np\n'), ((861, 879), 'numpy.arange', 'np.arange', (['(64)', '(577)'], {}), '(64, 57... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from rlkit.torch.core import PyTorchModule
from rlkit.torch.networks import Mlp
from rlkit.torch import pytorch_util as ptu
from rlkit.torch.torch_meta_irl_algorithm import np_to_pytorch_batch
fr... | [
"torch.mean",
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.nn.BatchNorm1d",
"rlkit.torch.pytorch_util.from_numpy",
"rlkit.torch.distributions.ReparamMultivariateNormalDiag",
"numpy.array",
"torch.nn.Linear",
"torch.sum",
"numpy.concatenate"
] | [((1195, 1220), 'torch.nn.Linear', 'nn.Linear', (['hid_dim', 'z_dim'], {}), '(hid_dim, z_dim)\n', (1204, 1220), True, 'import torch.nn as nn\n'), ((1247, 1272), 'torch.nn.Linear', 'nn.Linear', (['hid_dim', 'z_dim'], {}), '(hid_dim, z_dim)\n', (1256, 1272), True, 'import torch.nn as nn\n'), ((2918, 2942), 'torch.nn.Sequ... |
"""
Module for Magellan/FIRE specific methods.
Important Notes:
- If you are reducing old FIRE data (before the broken happened
in 2016), please change the ord_spat_pos array (see lines from
~220 to ~230)
.. include:: ../include/links.rst
"""
from pkg_resources import resource_filename
import numpy ... | [
"numpy.full",
"numpy.atleast_1d",
"numpy.log",
"pypeit.telescopes.MagellanTelescopePar",
"numpy.asarray",
"pypeit.core.framematch.check_frame_exptime",
"pkg_resources.resource_filename",
"numpy.array",
"numpy.arange",
"numpy.log10",
"pypeit.images.detector_container.DetectorContainer",
"numpy.... | [((988, 1021), 'pypeit.telescopes.MagellanTelescopePar', 'telescopes.MagellanTelescopePar', ([], {}), '()\n', (1019, 1021), False, 'from pypeit import telescopes\n'), ((4078, 4131), 'pypeit.images.detector_container.DetectorContainer', 'detector_container.DetectorContainer', ([], {}), '(**detector_dict)\n', (4114, 4131... |
#%%
import numpy as np
import scipy.signal as signal
import matplotlib.pyplot as plt
#%%
N = 1000
n = np.arange (N)
f = 100
fs = 44100
x = (1.58 * 0.3125) * np.sin (2 * np.pi * n * f / fs)
#%%
e_s_plus = 72
e_s_minus = -72
V_cm = (e_s_plus + e_s_minus) / 2
V_dm = (e_s_plus - e_s_minus) / 2
R_p = 0 # 50000
G = (R_p +... | [
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.plot",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.arange"
] | [((103, 115), 'numpy.arange', 'np.arange', (['N'], {}), '(N)\n', (112, 115), True, 'import numpy as np\n'), ((384, 395), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (392, 395), True, 'import numpy as np\n'), ((578, 590), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (588, 590), True, 'import matplotl... |
# Copyright (C) 2018-2019 <NAME>
# SPDX-License-Identifier: Apache-2.0
import numpy
def read_surfaces(res):
inp = res.input
res.surfaces = {}
if 'probes' not in inp:
return
for probe in inp['probes']:
if not (probe.get('enabled', True) and probe.get('type', '') == 'IsoSurface'):
... | [
"numpy.array"
] | [((2334, 2356), 'numpy.array', 'numpy.array', (['timesteps'], {}), '(timesteps)\n', (2345, 2356), False, 'import numpy\n')] |
import os
import pickle
import numpy as np
def deviation_from_actual_value(array):
"""
Calculates standard deviation for the parameters
:param array: either (num_iters, num_points_in_sim, [n] params) or (num_iters, num_points_in_sim, [n*m] params)
:return:
"""
if array.ndim == 3:
devia... | [
"pickle.dump",
"numpy.std",
"os.getcwd",
"numpy.zeros",
"pickle.load"
] | [((328, 370), 'numpy.zeros', 'np.zeros', (['(array.shape[1], array.shape[2])'], {}), '((array.shape[1], array.shape[2]))\n', (336, 370), True, 'import numpy as np\n'), ((1451, 1465), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1462, 1465), False, 'import pickle\n'), ((1543, 1557), 'pickle.load', 'pickle.load',... |
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
def plot(gather_count, filename):
gather_count = np.log(gather_count + 1)
sns.color_palette("light:b", as_cmap=True)
ax = sns.heatmap(gather_count, vmax=8, vmin=0, cmap="Purples",
xticklabels=False, yticklabels=F... | [
"seaborn.heatmap",
"numpy.log",
"numpy.array",
"seaborn.color_palette",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig"
] | [((128, 152), 'numpy.log', 'np.log', (['(gather_count + 1)'], {}), '(gather_count + 1)\n', (134, 152), True, 'import numpy as np\n'), ((157, 199), 'seaborn.color_palette', 'sns.color_palette', (['"""light:b"""'], {'as_cmap': '(True)'}), "('light:b', as_cmap=True)\n", (174, 199), True, 'import seaborn as sns\n'), ((209,... |
import random
import math
import numpy
from planner.state_space import test_goal, test_parent_operator, StateSpace, Solution, Plan
from misc.numerical import INF
from misc.functions import randomize
def random_policy(current_vertex):
edges = current_vertex.get_successors()
if not edges:
return None # ... | [
"planner.state_space.Plan",
"numpy.average",
"math.sqrt",
"planner.state_space.StateSpace",
"random.choice",
"planner.state_space.test_goal",
"planner.state_space.Solution",
"misc.functions.randomize"
] | [((346, 366), 'random.choice', 'random.choice', (['edges'], {}), '(edges)\n', (359, 366), False, 'import random\n'), ((876, 934), 'planner.state_space.StateSpace', 'StateSpace', (['generator', 'start'], {'max_extensions': 'INF'}), '(generator, start, max_extensions=INF, **kwargs)\n', (886, 934), False, 'from planner.st... |
import numpy as np
import math
from scipy.interpolate import interp1d
import scipy.linalg as LA
import os
import numpy as np
from skimage.transform import resize
from multiprocessing import Process
import shutil
from tqdm import tqdm
from concurrent.futures import ProcessPoolExecutor, as_completed
def compute_tf_fi... | [
"os.mkdir",
"numpy.abs",
"concurrent.futures.ProcessPoolExecutor",
"skimage.transform.resize",
"shutil.rmtree",
"numpy.zeros_like",
"numpy.fft.fft",
"numpy.power",
"os.path.exists",
"numpy.linspace",
"numpy.fft.ifft",
"tqdm.tqdm",
"numpy.ceil",
"numpy.min",
"concurrent.futures.as_complet... | [((604, 652), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', 's_Len'], {'endpoint': '(False)'}), '(0, 2 * np.pi, s_Len, endpoint=False)\n', (615, 652), True, 'import numpy as np\n'), ((743, 798), 'numpy.linspace', 'np.linspace', (['ps_MinFreqHz', 'ps_MaxFreqHz'], {'num': 'ps_FreqSeg'}), '(ps_MinFreqHz, ps_Max... |
from __future__ import absolute_import
from __future__ import print_function
import os,time,cv2,sys,math
import tensorflow as tf
import numpy as np
import time, datetime
import argparse
import random
import os, sys
import subprocess
from utils import utils, helpers
from builders import fusion_model_builde... | [
"argparse.ArgumentParser",
"tensorflow.trainable_variables",
"tensorflow.train.AdamOptimizer",
"tensorflow.ConfigProto",
"numpy.around",
"utils.utils.prepare_data_multiexposure",
"numpy.mean",
"tensorflow.summary.merge",
"utils.utils.count_params",
"os.path.join",
"argparse.ArgumentTypeError",
... | [((1599, 1624), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1622, 1624), False, 'import argparse\n'), ((4663, 4679), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (4677, 4679), True, 'import tensorflow as tf\n'), ((4770, 4795), 'tensorflow.Session', 'tf.Session', ([], {'conf... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 15 22:20:52 2018
@author: Srinivas
"""
import numpy as np
X = np.arange(1, 1000)
Y = X[(X % 3 == 0) | (X % 5 == 0)]
Z = sum(Y)
print(Z)
| [
"numpy.arange"
] | [((121, 139), 'numpy.arange', 'np.arange', (['(1)', '(1000)'], {}), '(1, 1000)\n', (130, 139), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>
email: <EMAIL>
GitHub: phuycke
"""
#%%
import matplotlib.pyplot as plt
import mne
import numpy as np
import os
import pandas as pd
import seaborn as sns
from scipy import ndimage
from matplotlib import ticker... | [
"numpy.sum",
"seaborn.regplot",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"os.path.join",
"numpy.nanmean",
"matplotlib.ticker.ScalarFormatter",
"numpy.meshgrid",
"numpy.zeros_like",
"matplotlib.pyplot.close",
"numpy.max",
"numpy.log10",
"seaborn.set_context",
"seaborn.set... | [((607, 634), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 9)'}), '(figsize=(10, 9))\n', (617, 634), True, 'import matplotlib.pyplot as plt\n'), ((642, 666), 'matplotlib.gridspec.GridSpec', 'gridspec.GridSpec', (['(2)', '(13)'], {}), '(2, 13)\n', (659, 666), False, 'from matplotlib import ticker, rc... |
"""
日期修改
"""
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
np.set_printoptions(threshold=np.inf)
root_dir = '/media/xiayule/bdcp/other'
def modify_date():
img_path = os.path.join(root_dir, '3.jpg')
img = cv2.imread(img_path)
# _, img1 = cv2.threshold(img, 150, 200, cv2.THRESH_BI... | [
"numpy.set_printoptions",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.destroyAllWindows",
"numpy.zeros",
"numpy.ones",
"cv2.imread",
"cv2.inRange",
"numpy.array",
"numpy.exp",
"numpy.linspace",
"cv2.imshow",
"os.path.join",
"cv2.namedWindow"
... | [((85, 122), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.inf'}), '(threshold=np.inf)\n', (104, 122), True, 'import numpy as np\n'), ((199, 230), 'os.path.join', 'os.path.join', (['root_dir', '"""3.jpg"""'], {}), "(root_dir, '3.jpg')\n", (211, 230), False, 'import os\n'), ((241, 261), 'cv2.im... |
from cosymlib.shape import maps
import numpy as np
import sys
def plot_minimum_distortion_path_shape(shape_label1, shape_label2, num_points=20, output=sys.stdout, show_plot=True):
import matplotlib.pyplot as plt
path = get_shape_path(shape_label1, shape_label2, num_points)
shape_map_txt = " {:6} {:6}\n"... | [
"cosymlib.shape.maps.get_shape_map",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.argmax",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.text",
"numpy.array",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((764, 822), 'cosymlib.shape.maps.get_shape_map', 'maps.get_shape_map', (['shape_label1', 'shape_label2', 'num_points'], {}), '(shape_label1, shape_label2, num_points)\n', (782, 822), False, 'from cosymlib.shape import maps\n'), ((1337, 1347), 'matplotlib.pyplot.axes', 'plt.axes', ([], {}), '()\n', (1345, 1347), True,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 13 17:38:37 2018
@author: simao
"""
import numpy as np
from scipy import stats
def onehotencoder(tind, *args):
if len(args) == 0:
maxclasses = max(tind)+1
elif len(args) == 1:
maxclasses = args[0]
else:
raise Not... | [
"numpy.random.uniform",
"scipy.stats.mode",
"numpy.argmax",
"numpy.zeros",
"numpy.arange"
] | [((346, 383), 'numpy.zeros', 'np.zeros', (['(tind.shape[0], maxclasses)'], {}), '((tind.shape[0], maxclasses))\n', (354, 383), True, 'import numpy as np\n'), ((555, 592), 'numpy.zeros', 'np.zeros', (['(tind.shape[0], maxclasses)'], {}), '((tind.shape[0], maxclasses))\n', (563, 592), True, 'import numpy as np\n'), ((763... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
from scipy.optimize import curve_fit
import matplotlib.colors as mcolors
#Write with LaTeX
rc('text', usetex=True)
rc('font', family='serif')
def func(x, a, b):
return (a * x) + b
# Data
B1 = np.array([9.38, 12.46, 15.57])
dB1 = np.arra... | [
"matplotlib.rc",
"matplotlib.pyplot.show",
"scipy.optimize.curve_fit",
"numpy.array",
"numpy.linspace",
"numpy.diag",
"matplotlib.pyplot.subplots"
] | [((169, 192), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (171, 192), False, 'from matplotlib import rc\n'), ((193, 219), 'matplotlib.rc', 'rc', (['"""font"""'], {'family': '"""serif"""'}), "('font', family='serif')\n", (195, 219), False, 'from matplotlib import rc\n'), ((2... |
import os
import numpy as np
import logging
from ..base import float_, int_
from .util import dataset_home, download, checksum, archive_extract, checkpoint
log = logging.getLogger(__name__)
_URL = 'http://ai.stanford.edu/~acoates/stl10/stl10_binary.tar.gz'
_SHA1 = 'b22ebbd7f3c4384ebc9ba3152939186d3750b902'
class ... | [
"numpy.load",
"numpy.fromfile",
"numpy.array",
"numpy.reshape",
"numpy.savez",
"os.path.join",
"logging.getLogger"
] | [((165, 192), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (182, 192), False, 'import logging\n'), ((796, 833), 'os.path.join', 'os.path.join', (['dataset_home', 'self.name'], {}), '(dataset_home, self.name)\n', (808, 833), False, 'import os\n'), ((859, 899), 'os.path.join', 'os.path.jo... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 13 21:46:14 2021
@author: Raj
"""
import sidpy as sid
from sidpy.sid import Reader
from sidpy.sid import Dimension
import os
import numpy as np
import h5py
from pyNSID.io.hdf_io import write_nsid_dataset
from pyNSID.io.hdf_io import create_indexed_group, write_simple_a... | [
"h5py.File",
"pyNSID.io.hdf_io.write_simple_attrs",
"os.path.basename",
"pyNSID.io.hdf_io.write_nsid_dataset",
"os.path.realpath",
"os.path.dirname",
"numpy.zeros",
"pyNSID.io.hdf_io.create_indexed_group",
"os.path.exists",
"numpy.split",
"sidpy.Dataset.from_array",
"numpy.arange",
"numpy.ar... | [((1882, 1909), 'os.path.realpath', 'os.path.realpath', (['self.path'], {}), '(self.path)\n', (1898, 1909), False, 'import os\n'), ((1930, 1956), 'os.path.dirname', 'os.path.dirname', (['full_path'], {}), '(full_path)\n', (1945, 1956), False, 'import os\n'), ((1996, 2023), 'os.path.basename', 'os.path.basename', (['sel... |
import sys,math
import numpy as np
import scipy.sparse.linalg as slin
from scipy.sparse import coo_matrix, csr_matrix, csc_matrix
from svddenseblock import *
from mytools.ioutil import myreadfile
from os.path import expanduser
home = expanduser("~")
def loadtensor2matricization(tensorfile, sumout=[], mtype=coo_matrix... | [
"numpy.array",
"mytools.ioutil.myreadfile",
"os.path.expanduser"
] | [((234, 249), 'os.path.expanduser', 'expanduser', (['"""~"""'], {}), "('~')\n", (244, 249), False, 'from os.path import expanduser\n'), ((499, 527), 'mytools.ioutil.myreadfile', 'myreadfile', (['tensorfile', '"""rb"""'], {}), "(tensorfile, 'rb')\n", (509, 527), False, 'from mytools.ioutil import myreadfile\n'), ((621, ... |
import sys
import os
import numpy as np
from sklearn import metrics
from .model import SmileGAN
from .utils import highest_matching_clustering, consensus_clustering, parse_validation_data
from .clustering import Smile_GAN_train
__author__ = "<NAME>"
__copyright__ = "Copyright 2019-2020 The CBICA & SBIA Lab"
__credits_... | [
"numpy.median",
"numpy.std",
"numpy.mean",
"numpy.array",
"sklearn.metrics.adjusted_rand_score",
"os.path.join",
"numpy.delete"
] | [((1793, 1822), 'numpy.median', 'np.median', (['model_aris'], {'axis': '(1)'}), '(model_aris, axis=1)\n', (1802, 1822), True, 'import numpy as np\n'), ((1876, 1901), 'numpy.delete', 'np.delete', (['median_aris', 'j'], {}), '(median_aris, j)\n', (1885, 1901), True, 'import numpy as np\n'), ((2263, 2282), 'numpy.mean', '... |
import numpy as np
import pandas as pd
import io
import re
import warnings
from scipy.stats import skew, skewtest
from scipy.stats import rankdata
from .plot_1var import *
# from plot_1var import * # for local testing only
from IPython.display import HTML
def print_list(l, br=', '):
o = ''
for e in l:
... | [
"pandas.DataFrame",
"fuzzywuzzy.fuzz.ratio",
"io.StringIO",
"fuzzywuzzy.fuzz.partial_ratio",
"fuzzywuzzy.fuzz.token_sort_ratio",
"warnings.simplefilter",
"numpy.log",
"numpy.datetime_as_string",
"scipy.stats.rankdata",
"numpy.timedelta64",
"numpy.where",
"pandas.Series",
"fuzzywuzzy.fuzz.tok... | [((5613, 5660), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""', 'RuntimeWarning'], {}), "('ignore', RuntimeWarning)\n", (5634, 5660), False, 'import warnings\n'), ((5883, 5896), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (5894, 5896), False, 'import io\n'), ((6257, 6289), 'pandas.DataFrame', 'p... |
import os
import allel
import h5py
import numpy as np
import sys
import time
from fvTools import *
if not len(sys.argv) in [13,15]:
sys.exit("usage:\npython makeFeatureVecsForChrArmFromVcf_ogSHIC.py chrArmFileName chrArm chrLen targetPop winSize numSubWins maskFileName sampleToPopFileName ancestralArmFaFileName st... | [
"numpy.extract",
"allel.read_vcf",
"time.clock",
"sys.stderr.write",
"allel.GenotypeArray",
"sys.exit"
] | [((2142, 2172), 'allel.read_vcf', 'allel.read_vcf', (['chrArmFileName'], {}), '(chrArmFileName)\n', (2156, 2172), False, 'import allel\n'), ((2223, 2279), 'numpy.extract', 'np.extract', (['(chroms == chrArm)', "chrArmFile['variants/POS']"], {}), "(chroms == chrArm, chrArmFile['variants/POS'])\n", (2233, 2279), True, 'i... |
import os
from datasets.types.data_split import DataSplit
from datasets.SOT.constructor.base_interface import SingleObjectTrackingDatasetConstructor
import numpy as np
def construct_TrackingNet(constructor: SingleObjectTrackingDatasetConstructor, seed):
root_path = seed.root_path
data_type = seed.data_split
... | [
"os.path.dirname",
"numpy.loadtxt",
"os.path.join",
"os.listdir"
] | [((1623, 1654), 'os.path.join', 'os.path.join', (['root_path', 'subset'], {}), '(root_path, subset)\n', (1635, 1654), False, 'import os\n'), ((1677, 1712), 'os.path.join', 'os.path.join', (['subset_path', '"""frames"""'], {}), "(subset_path, 'frames')\n", (1689, 1712), False, 'import os\n'), ((1733, 1766), 'os.path.joi... |
import pytest
from ..width import nonparam_width, gauss_model, radial_profile
from .testing_utils import generate_filament_model
import numpy as np
import numpy.testing as npt
from scipy import ndimage as nd
def generate_gaussian_profile(pts, width=3.0, amplitude=2.0, background=0.5):
return amplitude * np.exp... | [
"numpy.ones_like",
"numpy.roll",
"numpy.testing.assert_allclose",
"numpy.arange",
"numpy.exp",
"numpy.linspace",
"pytest.mark.parametrize",
"pytest.mark.xfail"
] | [((1239, 1278), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""theta"""', '[0.0]'], {}), "('theta', [0.0])\n", (1262, 1278), False, 'import pytest\n'), ((1969, 2022), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""cutoff"""', '[10.0, 20.0, 30.0]'], {}), "('cutoff', [10.0, 20.0, 30.0])\n", (199... |
# CASA Next Generation Infrastructure
# Copyright (C) 2021 AUI, Inc. Washington DC, USA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | [
"matplotlib.pyplot.title",
"psutil.virtual_memory",
"numpy.sum",
"casatools.quanta",
"numpy.clip",
"numpy.arange",
"os.path.join",
"numpy.unique",
"multiprocessing.cpu_count",
"pandas.DataFrame",
"os.path.expanduser",
"dask.distributed.Client",
"numpy.prod",
"casacore.tables.default_ms",
... | [((1379, 1436), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'FutureWarning'}), "('ignore', category=FutureWarning)\n", (1402, 1436), False, 'import warnings\n'), ((2192, 2255), 'dask.config.set', 'dask.config.set', (["{'distributed.scheduler.allowed-failures': 10}"], {}), "({'d... |
import math
import os
import xml.etree.ElementTree
import numpy as np
import paddle
import six
from PIL import Image
from utils import image_util
class Settings(object):
def __init__(self,
label_file_path=None,
resize_h=300,
resize_w=300,
mean_... | [
"numpy.random.uniform",
"utils.image_util.sampler",
"utils.image_util.crop_image",
"utils.image_util.generate_batch_samples",
"PIL.Image.open",
"os.path.exists",
"numpy.array",
"numpy.swapaxes",
"PIL.Image.fromarray",
"utils.image_util.distort_image",
"paddle.reader.multiprocess_reader",
"nump... | [((3440, 3453), 'numpy.array', 'np.array', (['img'], {}), '(img)\n', (3448, 3453), True, 'import numpy as np\n'), ((6376, 6401), 'numpy.random.shuffle', 'np.random.shuffle', (['images'], {}), '(images)\n', (6393, 6401), True, 'import numpy as np\n'), ((3012, 3073), 'utils.image_util.generate_batch_samples', 'image_util... |
import numpy as np
from napari.utils import nbscreenshot
def test_nbscreenshot(viewer_factory):
"""Test taking a screenshot."""
view, viewer = viewer_factory()
np.random.seed(0)
data = np.random.random((10, 15))
viewer.add_image(data)
rich_display_object = nbscreenshot(viewer)
assert ha... | [
"numpy.random.random",
"numpy.random.seed",
"napari.utils.nbscreenshot"
] | [((176, 193), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (190, 193), True, 'import numpy as np\n'), ((205, 231), 'numpy.random.random', 'np.random.random', (['(10, 15)'], {}), '((10, 15))\n', (221, 231), True, 'import numpy as np\n'), ((286, 306), 'napari.utils.nbscreenshot', 'nbscreenshot', (['view... |
import os
import numpy as np
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
from medpy.metric import binary
#use gpu if available
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class AE(nn.Module):
def __init__(self, latent_size=100):
super().__init__()
self.init_... | [
"matplotlib.pyplot.title",
"torch.nn.Dropout",
"os.mkdir",
"torch.cat",
"numpy.mean",
"torch.nn.Softmax",
"torch.no_grad",
"torch.nn.MSELoss",
"numpy.copy",
"medpy.metric.binary.dc",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.c... | [((8627, 8663), 'matplotlib.pyplot.plot', 'plt.plot', (['losses', '"""-x"""'], {'label': '"""loss"""'}), "(losses, '-x', label='loss')\n", (8635, 8663), True, 'import matplotlib.pyplot as plt\n'), ((8666, 8685), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""epoch"""'], {}), "('epoch')\n", (8676, 8685), True, 'import ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 30 20:15:18 2019
@author: autol
"""
#%%
from plotxy import plot_gd_xy,iters_gd_plot,plot_gd_contour
from initdata import init_data,init_data1,data_b,init_data_house
from func import gradient_descent_f
from varclass import VarSetX
from sklearn.model_selection import Param... | [
"numpy.stack",
"numpy.random.uniform",
"varclass.VarSetX",
"plotxy.plot_gd_contour",
"numpy.ones",
"initdata.data_b",
"plotxy.iters_gd_plot",
"numpy.amax",
"initdata.init_data1",
"func.gradient_descent_f",
"matplotlib.pyplot.subplots"
] | [((402, 412), 'numpy.ones', 'np.ones', (['(2)'], {}), '(2)\n', (409, 412), True, 'import numpy as np\n'), ((419, 444), 'initdata.init_data1', 'init_data1', (['n', '(45)', 'w'], {'b': '(0)'}), '(n, 45, w, b=0)\n', (429, 444), False, 'from initdata import init_data, init_data1, data_b, init_data_house\n'), ((502, 511), '... |
##########################################################
# pytorch-kaldi v.0.1
# <NAME>, <NAME>
# Mila, University of Montreal
# October 2018
#
# Description: This script generates kaldi ark files containing raw features.
# The file list must be a file containing "snt_id file.wav".
# Note that only wav files are supp... | [
"data_io.write_mat",
"numpy.abs",
"os.makedirs",
"os.stat",
"data_io.read_vec_int_ark",
"numpy.asarray",
"numpy.zeros",
"math.floor"
] | [((1797, 1816), 'os.stat', 'os.stat', (['out_folder'], {}), '(out_folder)\n', (1804, 1816), False, 'import os\n'), ((3554, 3575), 'numpy.asarray', 'np.asarray', (['frame_all'], {}), '(frame_all)\n', (3564, 3575), True, 'import numpy as np\n'), ((3670, 3724), 'data_io.write_mat', 'write_mat', (['out_folder', 'out_file',... |
import argparse
import numpy as np
from scipy.io import wavfile
from tqdm import trange
from ar_model import ARmodel
def correctSignal(signal, model, window_size, pred_size, step, treshold=3):
"""Correct signal using AR model
Args:
signal (np.array): signal to correct
model (ARmodel): autoreg... | [
"numpy.abs",
"argparse.ArgumentParser",
"numpy.copy",
"tqdm.trange",
"numpy.std",
"scipy.io.wavfile.read",
"ar_model.ARmodel",
"scipy.io.wavfile.write",
"numpy.linspace"
] | [((711, 726), 'numpy.copy', 'np.copy', (['signal'], {}), '(signal)\n', (718, 726), True, 'import numpy as np\n'), ((741, 798), 'tqdm.trange', 'trange', (['(0)', '(input.shape[0] - window_size - pred_size)', 'step'], {}), '(0, input.shape[0] - window_size - pred_size, step)\n', (747, 798), False, 'from tqdm import trang... |
import unittest
from numpy import hstack, max, abs, sqrt
from cantera import Solution, gas_constant
import numpy as np
from spitfire import ChemicalMechanismSpec
from os.path import join, abspath
from subprocess import getoutput
test_mech_directory = abspath(join('tests', 'test_mechanisms', 'old_xmls'))
mechs = [x.rep... | [
"unittest.main",
"spitfire.ChemicalMechanismSpec",
"numpy.sum",
"numpy.abs",
"numpy.copy",
"numpy.empty",
"numpy.zeros",
"numpy.ones",
"numpy.hstack",
"numpy.finfo",
"cantera.Solution",
"subprocess.getoutput",
"os.path.join"
] | [((260, 304), 'os.path.join', 'join', (['"""tests"""', '"""test_mechanisms"""', '"""old_xmls"""'], {}), "('tests', 'test_mechanisms', 'old_xmls')\n", (264, 304), False, 'from os.path import join, abspath\n'), ((809, 829), 'numpy.copy', 'np.copy', (['rhs_chem_in'], {}), '(rhs_chem_in)\n', (816, 829), True, 'import numpy... |
import matplotlib, numpy, pprint
# matplotlib.rcParams['pdf.fonttype'] = 42
# matplotlib.rcParams['ps.fonttype'] = 42
matplotlib.use('Agg')
import matplotlib.pyplot as plot
import gzip, csv, pylab
from collections import namedtuple
from rvs import *
from patch import *
"""
task events table contains the following fie... | [
"matplotlib.pyplot.yscale",
"csv.reader",
"matplotlib.pyplot.step",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"matplotlib.pyplot.gca",
"csv.writer",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"numpy.sort",
"matplotlib.use",
"matplotlib.pyplot.ylabel",
"matplotlib... | [((118, 139), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (132, 139), False, 'import matplotlib, numpy, pprint\n'), ((2584, 2613), 'csv.writer', 'csv.writer', (['wf'], {'delimiter': '""","""'}), "(wf, delimiter=',')\n", (2594, 2613), False, 'import gzip, csv, pylab\n'), ((4766, 4794), 'collect... |
from readwrite import get_data
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
import numpy as np
def scatter(path, name):
data = get_data(path)
pd_data = pd.DataFrame(data)
plt.title("column 0 " + name)
plt.plot(pd_data[0])
plt.show()
plt.title("column 1 " + name)
plt... | [
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.boxplot",
"scipy.stats.gaussian_kde",
"numpy.linspace",
"readwrite.get_data"
] | [((173, 187), 'readwrite.get_data', 'get_data', (['path'], {}), '(path)\n', (181, 187), False, 'from readwrite import get_data\n'), ((199, 217), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (211, 217), True, 'import pandas as pd\n'), ((220, 249), 'matplotlib.pyplot.title', 'plt.title', (["('column 0 ... |
#!/usr/bin/env python
"""
# Author: <NAME>
# Created Time : Tue 29 Sep 2020 01:41:23 PM CST
# File Name: function.py
# Description:
"""
import torch
import numpy as np
import os
import scanpy as sc
from anndata import AnnData
from .data import load_data
from .net.vae import VAE
from .net.utils import EarlyStopping
... | [
"scanpy.tl.umap",
"numpy.random.seed",
"os.makedirs",
"torch.manual_seed",
"torch.load",
"scanpy.pp.neighbors",
"scanpy.read_h5ad",
"scanpy.pl.umap",
"torch.save",
"scanpy.tl.leiden",
"sklearn.neighbors.KNeighborsClassifier",
"torch.cuda.is_available",
"torch.cuda.set_device",
"anndata.Ann... | [((3790, 3810), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (3804, 3810), True, 'import numpy as np\n'), ((3822, 3845), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (3839, 3845), False, 'import torch\n'), ((3854, 3879), 'torch.cuda.is_available', 'torch.cuda.is_available'... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 10 14:19:04 2020
@author: corkep
"""
import numpy as np
import numpy.testing as nt
import unittest
from math import pi
import math
from scipy.linalg import logm, expm
from spatialmath.base.transformsNd import *
from spatialmath.base.transforms3d ... | [
"unittest.main",
"spatialmath.base.transforms3d.rotx",
"spatialmath.base.transforms2d.ishom2",
"spatialmath.base.transforms2d.isrot2",
"numpy.testing.assert_almost_equal",
"spatialmath.base.transforms2d.rot2",
"numpy.zeros",
"spatialmath.base.transforms3d.isrot",
"spatialmath.base.transforms2d.trot2... | [((10322, 10337), 'unittest.main', 'unittest.main', ([], {}), '()\n', (10335, 10337), False, 'import unittest\n'), ((994, 1003), 'spatialmath.base.transforms3d.rotx', 'rotx', (['(0.3)'], {}), '(0.3)\n', (998, 1003), False, 'from spatialmath.base.transforms3d import trotx, transl, rotx, isrot, ishom\n'), ((1031, 1086), ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 27 16:40:49 2020
@author: krugefr1
"""
import numpy as np
import os
try:
import arthor
except ImportError:
arthor = None
from rdkit import Chem
from rdkit.Chem import rdSubstructLibrary
import pickle
import random
import pandas as pd
import... | [
"rdkit.Chem.PatternFingerprint",
"os.mkdir",
"pickle.dump",
"numpy.argmax",
"rdkit.Chem.MolToSmiles",
"pandas.DataFrame",
"os.path.exists",
"random.seed",
"rdkit.Chem.rdSubstructLibrary.PatternHolder",
"copy.deepcopy",
"automated_series_classification.Butinaclustering.ApplyButina",
"automated_... | [((1502, 1653), 'automated_series_classification.utilsDataPrep.PrepareData', 'utilsDataPrep.PrepareData', (['self.proj', 'self.datapath', 'filename'], {'distMeasure': '"""Tanimoto"""', 'FP': '"""Morgan2"""', 'calcDists': 'self.calcDists', 'smilesCol': 'smilesCol'}), "(self.proj, self.datapath, filename, distMeasure=\n ... |
"""
Helper script to create config files for BlenderProc.
"""
import os
import yaml
import random
import numpy as np
import binascii
# these paths have to be manually set before creating a config
BLENDERPROC_ROOT = '' # /path/to/BlenderProc
SHAPENET_ROOT = '' # /path/to/ShapeNetCore.v2
SUNCG_ROOT = '' # /path/to/s... | [
"numpy.random.uniform",
"yaml.load",
"os.makedirs",
"binascii.hexlify",
"yaml.dump",
"random.choice",
"numpy.random.randint",
"os.path.join",
"os.urandom"
] | [((7027, 7051), 'numpy.random.randint', 'np.random.randint', (['(5)', '(12)'], {}), '(5, 12)\n', (7044, 7051), True, 'import numpy as np\n'), ((8462, 8476), 'os.urandom', 'os.urandom', (['(20)'], {}), '(20)\n', (8472, 8476), False, 'import os\n'), ((8497, 8528), 'binascii.hexlify', 'binascii.hexlify', (['output_prefix'... |
import h5py
import numpy as np
def load_data(fname):
# load in an hdf5 file and return the X and y values
data_file = h5py.File(fname)
# load in X and y training data, fully into memory
X = data_file['X'][:].reshape(-1, 1) # each row is a data point
y = data_file['y'][:]
return X, y
def eval... | [
"h5py.File",
"numpy.abs"
] | [((127, 143), 'h5py.File', 'h5py.File', (['fname'], {}), '(fname)\n', (136, 143), False, 'import h5py\n'), ((395, 418), 'numpy.abs', 'np.abs', (['(y_pred - y_true)'], {}), '(y_pred - y_true)\n', (401, 418), True, 'import numpy as np\n')] |
import time
import logging
import cv2
import numpy as np
from deep_sort_realtime.deep_sort import nn_matching
from deep_sort_realtime.deep_sort.detection import Detection
from deep_sort_realtime.deep_sort.tracker import Tracker
from deep_sort_realtime.utils.nms import non_max_suppression
log_level = logging.DEBUG
d... | [
"deep_sort_realtime.deep_sort.tracker.Tracker",
"deep_sort_realtime.utils.nms.non_max_suppression",
"cv2.bitwise_and",
"deep_sort_realtime.deep_sort.detection.Detection",
"logging.StreamHandler",
"numpy.zeros",
"cv2.fillPoly",
"logging.Formatter",
"deep_sort_realtime.embedder.embedder_pytorch.Mobile... | [((336, 365), 'logging.getLogger', 'logging.getLogger', (['"""DeepSORT"""'], {}), "('DeepSORT')\n", (353, 365), False, 'import logging\n'), ((411, 434), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (432, 434), False, 'import logging\n'), ((475, 534), 'logging.Formatter', 'logging.Formatter', (['"... |
import cv2
import os
import numpy as np
from PIL import Image
import picamera.array
from picamera import PiCamera
class Face(object):
training_count = 5
threshold = 30
def __init__(self, casc_path, path="./passwords", camera_port=0):
self.path = path
self._cascade = cv2.CascadeClassifi... | [
"cv2.cv.cvtColor",
"cv2.imwrite",
"PIL.Image.open",
"cv2.face.createLBPHFaceRecognizer",
"numpy.array",
"cv2.CascadeClassifier",
"cv2.destroyAllWindows",
"os.path.join",
"os.listdir",
"picamera.PiCamera"
] | [((301, 333), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['casc_path'], {}), '(casc_path)\n', (322, 333), False, 'import cv2\n'), ((399, 422), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (420, 422), False, 'import cv2\n'), ((2335, 2370), 'cv2.face.createLBPHFaceRecognizer', 'cv2.face.cre... |
from __future__ import print_function
import argparse
import os
import csv
import numpy as np
import random
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from data_utils.data_util import PointcloudScaleAndTran... | [
"os.mkdir",
"torch.optim.lr_scheduler.StepLR",
"argparse.ArgumentParser",
"numpy.argmax",
"models.rscnn.RSCNN",
"data_utils.ModelNetDataLoader.ModelNetDataLoader",
"models.pointnet.PointNetCls",
"sys.path.append",
"models.pointnet2.PointNet2ClsMsg",
"random.randint",
"torch.utils.data.DataLoader... | [((637, 662), 'sys.path.append', 'sys.path.append', (['"""./emd/"""'], {}), "('./emd/')\n", (652, 662), False, 'import sys\n'), ((882, 905), 'os.path.exists', 'os.path.exists', (['logname'], {}), '(logname)\n', (896, 905), False, 'import os\n'), ((4609, 4634), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], ... |
from __future__ import print_function, division
import torch
import os
import pandas as pd
from skimage import io, transform
import numpy as np
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
import sklearn
import sklearn.metrics as sklm
import csv
import argparse
import torc... | [
"pandas.read_csv",
"numpy.empty",
"torch.get_rng_state",
"torch.cuda.device_count",
"numpy.mean",
"torchvision.transforms.Normalize",
"numpy.nanmean",
"torch.nn.BCELoss",
"torch.utils.data.DataLoader",
"torchvision.transforms.Scale",
"numpy.std",
"CXRDataset.CXRDataset",
"torch.load",
"os.... | [((673, 698), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (696, 698), False, 'import torch\n'), ((885, 896), 'importlib.reload', 'reload', (['CXR'], {}), '(CXR)\n', (891, 896), False, 'from importlib import reload\n'), ((897, 906), 'importlib.reload', 'reload', (['E'], {}), '(E)\n', (903, 90... |
# coding: utf-8
#
# This code is part of lattpy.
#
# Copyright (c) 2021, <NAME>
#
# This code is licensed under the MIT License. The copyright notice in the
# LICENSE file in the root directory and this permission notice shall
# be included in all copies or substantial portions of the Software.
"""Contains miscellaneo... | [
"numpy.zeros_like",
"numpy.abs",
"logging.StreamHandler",
"logging.getLogger",
"logging.Formatter",
"numpy.min_scalar_type",
"numpy.min",
"numpy.max",
"numpy.unique"
] | [((851, 878), 'logging.getLogger', 'logging.getLogger', (['"""lattpy"""'], {}), "('lattpy')\n", (868, 878), False, 'import logging\n'), ((886, 909), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (907, 909), False, 'import logging\n'), ((1038, 1086), 'logging.Formatter', 'logging.Formatter', (['_FR... |
import numpy as np
import torch
import torch.optim as optim
import torch.nn as nn
from torch.autograd import Variable
import skimage.io as io
import argparse
import os
import sys
import time
# Allow python3 to search for modules outside of this directory
sys.path.append("../")
from models.skip import skip3d
from vo... | [
"argparse.ArgumentParser",
"torch.randn",
"torch.cos",
"tools.Ops.volume_proj",
"os.path.join",
"tools.Ops.rotate_volume",
"sys.path.append",
"os.path.exists",
"torch.zeros",
"tools.Ops.load_binvox",
"tools.Ops.tvloss3d",
"torch.nn.ConstantPad3d",
"torch.optim.Adam",
"torch.clamp",
"nump... | [((257, 279), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (272, 279), False, 'import sys\n'), ((714, 785), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Reconstruciton using deep prior."""'}), "(description='Reconstruciton using deep prior.')\n", (737, 785), ... |
#!/usr/bin/env python
import argparse
from ast import parse
import numpy as np
import bitstring
def to_fixed(x, args):
F = args.fixed_point_bits[0] - args.fixed_point_bits[1]
return np.round(x * 2**F)
def to_float(x, args):
F = args.fixed_point_bits[0] - args.fixed_point_bits[1]
return x * 2**-F
def ... | [
"numpy.load",
"numpy.save",
"numpy.flip",
"argparse.ArgumentParser",
"bitstring.pack",
"numpy.round"
] | [((191, 211), 'numpy.round', 'np.round', (['(x * 2 ** F)'], {}), '(x * 2 ** F)\n', (199, 211), True, 'import numpy as np\n'), ((1090, 1180), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Parse numpy file to FPGA testing for MP7 board"""'}), "(description=\n 'Parse numpy file to FPGA ... |
"""
@brief This file holds classes that store information about the endoscopic images that are
going to be segmented.
@author <NAME> (<EMAIL>).
@date 25 Aug 2015.
"""
import numpy as np
import os
import cv2
# import caffe
import sys
import random
import matplotlib.pyplot as plt
import scipy.misc
import imut... | [
"numpy.sum",
"numpy.ones",
"matplotlib.pyplot.figure",
"numpy.arange",
"common.randbin",
"cv2.imencode",
"cv2.filter2D",
"cv2.cvtColor",
"matplotlib.pyplot.imshow",
"cv2.imwrite",
"numpy.max",
"cv2.LUT",
"cv2.minEnclosingCircle",
"numpy.flipud",
"numpy.min",
"cv2.createCLAHE",
"numpy... | [((533, 553), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (547, 553), True, 'import numpy as np\n'), ((562, 587), 'numpy.arange', 'np.arange', (['(256)'], {'dtype': 'int'}), '(256, dtype=int)\n', (571, 587), True, 'import numpy as np\n'), ((594, 614), 'numpy.random.shuffle', 'np.random.shuffle', ... |
# Copyright 2019 The TensorFlow 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 applica... | [
"tensorflow.python.ops.math_ops.argmin",
"tensorflow.python.ipu.config.IPUConfig",
"tensorflow.python.ops.math_ops.argmax",
"numpy.argmax",
"numpy.dtype",
"numpy.argmin",
"tensorflow.python.platform.googletest.main",
"os.environ.get",
"test_utils.ReportJSON",
"tensorflow.python.framework.ops.devic... | [((1394, 1426), 'numpy.issubdtype', 'np.issubdtype', (['dtype', 'np.integer'], {}), '(dtype, np.integer)\n', (1407, 1426), True, 'import numpy as np\n'), ((1730, 1772), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (['*TESTCASES'], {}), '(*TESTCASES)\n', (1760, 1772), False, 'from abs... |
import pyHiChi as pfc
import numpy as np
import math as ma
def valueEx(x, y, z):
Ex = 0 #for x or y
#Ex=np.sin(z) #for z
return Ex
def valueEy(x, y, z):
#Ey = 0 #for y or z
#Ey = np.sin(x) #for x
Ey = np.sin(x - z) #for xz
return Ey
def valueEz(x, y, z):
Ez = 0 #for x or z or xz
#Ez = np.sin(y) #for y
retur... | [
"matplotlib.pyplot.show",
"numpy.zeros",
"pyHiChi.PeriodicalBC",
"matplotlib.animation.FuncAnimation",
"numpy.sin",
"numpy.arange",
"pyHiChi.vector3d",
"pyHiChi.YeeGrid",
"numpy.sqrt",
"matplotlib.pyplot.subplots",
"pyHiChi.FDTD"
] | [((902, 926), 'pyHiChi.vector3d', 'pfc.vector3d', (['(20)', '(20)', '(20)'], {}), '(20, 20, 20)\n', (914, 926), True, 'import pyHiChi as pfc\n'), ((939, 966), 'pyHiChi.vector3d', 'pfc.vector3d', (['(0.0)', '(0.0)', '(0.0)'], {}), '(0.0, 0.0, 0.0)\n', (951, 966), True, 'import pyHiChi as pfc\n'), ((979, 1024), 'pyHiChi.... |
# ORIE 7590
import numpy as np
from bd_sim_cython import discrete_bessel_sim, discrete_laguerre_sim, cmeixner
from scipy.special import jv, laguerre, poch, eval_laguerre, j0
from scipy.integrate import quad
from math import comb, factorial, exp, sqrt, log
import hankel
def bd_simulator(t, x0, num_paths, method='besse... | [
"math.exp",
"hankel.HankelTransform",
"numpy.maximum",
"scipy.special.eval_laguerre",
"numpy.polyval",
"numpy.random.exponential",
"numpy.zeros",
"numpy.ones",
"numpy.random.gamma",
"scipy.special.poch",
"numpy.mean",
"numpy.array",
"numpy.random.poisson",
"scipy.special.j0",
"numpy.eye"... | [((887, 928), 'numpy.zeros', 'np.zeros', ([], {'dtype': 'np.int64', 'shape': 'num_paths'}), '(dtype=np.int64, shape=num_paths)\n', (895, 928), True, 'import numpy as np\n'), ((6930, 6941), 'numpy.zeros', 'np.zeros', (['N'], {}), '(N)\n', (6938, 6941), True, 'import numpy as np\n'), ((7984, 8027), 'hankel.HankelTransfor... |
import os.path as osp
import sys
import numpy as np
import torch
from matplotlib import pyplot as plt
from scipy.stats import norm
sys.path.append(osp.dirname(sys.path[0]))
from neko import neko_utils
class utils(neko_utils.neko_utils):
def __init__(self):
super(utils, self).__init__()
def plot_lat... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"os.path.dirname",
"numpy.zeros",
"matplotlib.pyplot.figure",
"torch.Tensor",
"numpy.array",
"numpy.linspace"
] | [((149, 173), 'os.path.dirname', 'osp.dirname', (['sys.path[0]'], {}), '(sys.path[0])\n', (160, 173), True, 'import os.path as osp\n'), ((621, 641), 'numpy.zeros', 'np.zeros', (['image_size'], {}), '(image_size)\n', (629, 641), True, 'import numpy as np\n'), ((1203, 1231), 'matplotlib.pyplot.figure', 'plt.figure', ([],... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.