code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
# -*- coding: utf-8 -*-
"""
Helper functions for HDF5
Created on Tue Jun 2 12:37:50 2020
:copyright:
<NAME> (<EMAIL>)
:license:
MIT
"""
# =============================================================================
# Imports
# ==========================================================================... | [
"gc.get_objects",
"mth5.utils.mth5_logger.setup_logger",
"inspect.getmro",
"numpy.array"
] | [((476, 498), 'mth5.utils.mth5_logger.setup_logger', 'setup_logger', (['__name__'], {}), '(__name__)\n', (488, 498), False, 'from mth5.utils.mth5_logger import setup_logger\n'), ((3440, 3456), 'gc.get_objects', 'gc.get_objects', ([], {}), '()\n', (3454, 3456), False, 'import gc\n'), ((6379, 6398), 'inspect.getmro', 'in... |
import os
import random
import numpy as np
import torch
def set_seed(seed=None):
if seed is None:
return None
random.seed(seed)
os.environ['PYTHONHASHSEED'] = ("%s" % seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
... | [
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all",
"random.seed"
] | [((129, 146), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (140, 146), False, 'import random\n'), ((200, 220), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (214, 220), True, 'import numpy as np\n'), ((225, 248), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (24... |
"""Answer to Exercise 1.3
Author: <NAME>
Email : <EMAIL>
"""
from __future__ import print_function
import numpy as np
import keras.backend as K
# create variable w, b and x
w = K.placeholder(shape=(2,), dtype=np.float32)
# note that b is not a scalar
b = K.placeholder(shape=(1,), dtype=np.float32)
x = K.placeholder(... | [
"keras.backend.placeholder",
"keras.backend.exp",
"keras.backend.function",
"keras.backend.sum",
"numpy.array"
] | [((180, 223), 'keras.backend.placeholder', 'K.placeholder', ([], {'shape': '(2,)', 'dtype': 'np.float32'}), '(shape=(2,), dtype=np.float32)\n', (193, 223), True, 'import keras.backend as K\n'), ((258, 301), 'keras.backend.placeholder', 'K.placeholder', ([], {'shape': '(1,)', 'dtype': 'np.float32'}), '(shape=(1,), dtype... |
# 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.
import torch
from lottery.branch import base
import models.registry
from pruning.mask import Mask
from pruning.pruned_model import PrunedModel... | [
"pruning.mask.Mask",
"numpy.argmax",
"utils.tensor_utils.mutual_coherence",
"utils.tensor_utils.gradient_mean",
"numpy.argsort",
"torch.no_grad",
"pruning.pruned_model.PrunedModel.to_mask_name",
"utils.tensor_utils.shuffle_tensor",
"torch.linalg.norm",
"pruning.mask.Mask.load",
"utils.tensor_uti... | [((834, 860), 'pruning.mask.Mask.load', 'Mask.load', (['self.level_root'], {}), '(self.level_root)\n', (843, 860), False, 'from pruning.mask import Mask\n'), ((881, 887), 'pruning.mask.Mask', 'Mask', ([], {}), '()\n', (885, 887), False, 'from pruning.mask import Mask\n'), ((1344, 1369), 'copy.deepcopy', 'copy.deepcopy'... |
# -*- coding: utf-8 -*-
"""
Tic Toe Using pygame , numpy and sys with Graphical User Interface
"""
import pygame
import sys
from pygame.locals import *
import numpy as np
# ------
# constants
# -------
width = 800
height = 800
#row and columns
board_rows = 3
board_columns = 3
cross_width = 25
square_si... | [
"pygame.quit",
"pygame.draw.line",
"pygame.event.get",
"pygame.display.set_mode",
"numpy.zeros",
"pygame.init",
"pygame.display.update",
"pygame.font.Font",
"pygame.display.set_caption",
"sys.exit"
] | [((608, 621), 'pygame.init', 'pygame.init', ([], {}), '()\n', (619, 621), False, 'import pygame\n'), ((632, 672), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(height, width)'], {}), '((height, width))\n', (655, 672), False, 'import pygame\n'), ((674, 716), 'pygame.display.set_caption', 'pygame.display.set_... |
import random
import numpy as np
import heapq as hp
import time
from k_shortest_path import k_shortest_path_algorithm, k_shortest_path_all_destination
def simulated_annealing_unsplittable_flows(graph, commodity_list, nb_iterations=10**5, nb_k_shortest_paths=10, verbose=0):
nb_nodes = len(graph)
nb_commoditie... | [
"random.randint",
"heapq.heappush",
"k_shortest_path.k_shortest_path_all_destination",
"heapq.heappop",
"random.random",
"numpy.array",
"numpy.exp",
"numpy.arange",
"numpy.random.choice"
] | [((2006, 2043), 'random.randint', 'random.randint', (['(0)', '(nb_commodities - 1)'], {}), '(0, nb_commodities - 1)\n', (2020, 2043), False, 'import random\n'), ((3400, 3435), 'numpy.exp', 'np.exp', (['((fitness - new_fitness) / T)'], {}), '((fitness - new_fitness) / T)\n', (3406, 3435), True, 'import numpy as np\n'), ... |
import sys
import os
from mpl_toolkits import mplot3d
import numpy as np
import matplotlib.pyplot as plt
filePath_gt = sys.argv[1]
filePath_results = sys.argv[2]
gt = np.genfromtxt(filePath_gt, delimiter=",", names=["x", "y", "timestamp"])
results = np.genfromtxt(filePath_results, delimiter=",", names=["x", "y", "t... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.genfromtxt",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((171, 243), 'numpy.genfromtxt', 'np.genfromtxt', (['filePath_gt'], {'delimiter': '""","""', 'names': "['x', 'y', 'timestamp']"}), "(filePath_gt, delimiter=',', names=['x', 'y', 'timestamp'])\n", (184, 243), True, 'import numpy as np\n'), ((254, 331), 'numpy.genfromtxt', 'np.genfromtxt', (['filePath_results'], {'delim... |
"""
Module for guiding construction of the Wavelength Image
.. include common links, assuming primary doc root is up one directory
.. include:: ../links.rst
"""
import inspect
import numpy as np
import os
from pypeit import msgs
from pypeit import utils
from pypeit import datamodel
from IPython import embed
class... | [
"numpy.zeros_like",
"numpy.ones_like",
"numpy.invert",
"pypeit.msgs.error",
"pypeit.datamodel.DataContainer.__init__",
"pypeit.utils.func_val",
"inspect.currentframe",
"inspect.stack",
"pypeit.msgs.info"
] | [((997, 1040), 'pypeit.datamodel.DataContainer.__init__', 'datamodel.DataContainer.__init__', (['self'], {'d': 'd'}), '(self, d=d)\n', (1029, 1040), False, 'from pypeit import datamodel\n'), ((4079, 4104), 'numpy.zeros_like', 'np.zeros_like', (['self.tilts'], {}), '(self.tilts)\n', (4092, 4104), True, 'import numpy as ... |
#!/usr/bin/env python
from ATK.Core import DoubleInPointerFilter, DoubleOutPointerFilter
from ATK.Delay import DoubleUniversalVariableDelayLineFilter
from ATK.EQ import DoubleSecondOrderLowPassFilter
from ATK.Tools import DoubleWhiteNoiseGeneratorFilter
import matplotlib.pyplot as plt
sample_rate = 96000
def filter... | [
"ATK.Core.DoubleInPointerFilter",
"ATK.Delay.DoubleUniversalVariableDelayLineFilter",
"ATK.EQ.DoubleSecondOrderLowPassFilter",
"ATK.Core.DoubleOutPointerFilter",
"ATK.Tools.DoubleWhiteNoiseGeneratorFilter",
"numpy.zeros",
"numpy.savetxt",
"numpy.sin",
"numpy.arange"
] | [((397, 436), 'numpy.zeros', 'np.zeros', (['input.shape'], {'dtype': 'np.float64'}), '(input.shape, dtype=np.float64)\n', (405, 436), True, 'import numpy as np\n'), ((451, 486), 'ATK.Core.DoubleInPointerFilter', 'DoubleInPointerFilter', (['input', '(False)'], {}), '(input, False)\n', (472, 486), False, 'from ATK.Core i... |
import cv2
import numpy as np
import skfmm
import skimage
from numpy import ma
def get_mask(sx, sy, scale, step_size):
size = int(step_size // scale) * 2 + 1
mask = np.zeros((size, size))
for i in range(size):
for j in range(size):
if ((i + 0.5) - (size // 2 + sx)) ** 2 + \
... | [
"numpy.pad",
"numpy.ma.masked_values",
"skfmm.distance",
"numpy.zeros",
"skimage.morphology.disk",
"numpy.argmin",
"numpy.rint",
"numpy.max",
"cv2.resize"
] | [((175, 197), 'numpy.zeros', 'np.zeros', (['(size, size)'], {}), '((size, size))\n', (183, 197), True, 'import numpy as np\n'), ((737, 759), 'numpy.zeros', 'np.zeros', (['(size, size)'], {}), '((size, size))\n', (745, 759), True, 'import numpy as np\n'), ((1898, 1939), 'numpy.ma.masked_values', 'ma.masked_values', (['(... |
from CNS_UDP_FAST import CNS
import numpy as np
import time
import random
class ENVCNS(CNS):
def __init__(self, Name, IP, PORT, Monitoring_ENV=None):
super(ENVCNS, self).__init__(threrad_name=Name,
CNS_IP=IP, CNS_Port=PORT,
Remote_I... | [
"numpy.array",
"random.randint",
"time.time"
] | [((2121, 2136), 'numpy.array', 'np.array', (['state'], {}), '(state)\n', (2129, 2136), True, 'import numpy as np\n'), ((7354, 7365), 'time.time', 'time.time', ([], {}), '()\n', (7363, 7365), False, 'import time\n'), ((7046, 7067), 'random.randint', 'random.randint', (['(0)', '(20)'], {}), '(0, 20)\n', (7060, 7067), Fal... |
import argparse
import math
import os
from datetime import datetime
import h5py
import numpy as np
import plyfile
from matplotlib import cm
import rospy
import rospkg
import ros_numpy
import math
import sys
import cv2
from sensor_msgs.msg import PointCloud
from geometry_msgs.msg import Point32
import sensor_msgs.poin... | [
"numpy.load",
"argparse.ArgumentParser",
"rospy.Time.now",
"std_msgs.msg.Header",
"os.path.isdir",
"numpy.zeros",
"rospy.Publisher",
"rospy.Rate",
"sensor_msgs.point_cloud2.create_cloud_xyz32",
"numpy.array",
"rospy.init_node",
"os.path.join",
"os.listdir"
] | [((465, 508), 'rospy.init_node', 'rospy.init_node', (['"""tutorial"""'], {'anonymous': '(True)'}), "('tutorial', anonymous=True)\n", (480, 508), False, 'import rospy\n'), ((530, 544), 'rospy.Rate', 'rospy.Rate', (['(10)'], {}), '(10)\n', (540, 544), False, 'import rospy\n'), ((564, 624), 'rospy.Publisher', 'rospy.Publi... |
import numpy as np
import pandas as pd
def mrd(a, b, M):
'''
Calculate the Multiresolution Decomposition for a given timeseries of two variables
Howell and Mahrt, 1997; Vickers and Mahrt, 2003; Vickers and Mahrt 2006
Args:
a (array) : Array for timeseries "a"
b (array) : Array for tim... | [
"numpy.sum",
"numpy.flip",
"numpy.zeros",
"numpy.split",
"numpy.arange",
"numpy.array"
] | [((542, 553), 'numpy.zeros', 'np.zeros', (['M'], {}), '(M)\n', (550, 553), True, 'import numpy as np\n'), ((562, 573), 'numpy.zeros', 'np.zeros', (['M'], {}), '(M)\n', (570, 573), True, 'import numpy as np\n'), ((639, 655), 'numpy.arange', 'np.arange', (['(M + 1)'], {}), '(M + 1)\n', (648, 655), True, 'import numpy as ... |
"""
python3 py/compare_pdfs.py -f data/test_pdfs/00026_04_fda-K071597_test_data.pdf data/test_pdfs/small_test/copied_data.pdf
"""
import os
import re
import sys
import json
import math
import pickle
import hashlib
import time
import unicodedata
import datetime
import itertools
import subprocess
from path... | [
"numpy.maximum",
"argparse.ArgumentParser",
"json.dumps",
"numpy.argsort",
"pathlib.Path",
"pickle.load",
"os.path.exists",
"datetime.datetime.now",
"json.dump",
"numpy.minimum",
"os.path.realpath",
"fitz.open",
"pydivsufsort.kasai",
"json.load",
"warnings.filterwarnings",
"time.time",... | [((566, 604), 'fitz.TOOLS.mupdf_display_errors', 'fitz.TOOLS.mupdf_display_errors', (['(False)'], {}), '(False)\n', (597, 604), False, 'import fitz\n'), ((623, 656), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (646, 656), False, 'import warnings\n'), ((2506, 2531), 'pyd... |
# encoding: utf-8
import numpy as np
from scipy.special import expit
from keras.datasets import mnist
from keras.utils import to_categorical
np.random.seed(7)
inputs_units = 784
hidden_units = 256
output_units = 10
class MlpNumpy(object):
def __init__(self):
self.__hidden_weight = np.random.randn(hidden... | [
"numpy.random.seed",
"numpy.random.randn",
"keras.datasets.mnist.load_data",
"numpy.square",
"scipy.special.expit",
"numpy.dot",
"keras.utils.to_categorical"
] | [((142, 159), 'numpy.random.seed', 'np.random.seed', (['(7)'], {}), '(7)\n', (156, 159), True, 'import numpy as np\n'), ((298, 341), 'numpy.random.randn', 'np.random.randn', (['hidden_units', 'inputs_units'], {}), '(hidden_units, inputs_units)\n', (313, 341), True, 'import numpy as np\n'), ((373, 416), 'numpy.random.ra... |
import numpy as np
from flow.core import rewards
from flow.core.util import calculate_human_rl_timesteps_spent_in_simulation
from flow.envs import BottleneckEnv
from flow.envs.multiagent import MultiEnv
from gym.spaces import Box
MAX_LANES = 4 # base number of largest number of lanes in the network
EDGE_LIST = ["1", ... | [
"flow.core.rewards.desired_velocity",
"numpy.asarray",
"flow.core.util.calculate_human_rl_timesteps_spent_in_simulation",
"numpy.mean",
"numpy.array",
"gym.spaces.Box",
"numpy.concatenate"
] | [((2644, 2698), 'gym.spaces.Box', 'Box', ([], {'low': '(0)', 'high': '(1)', 'shape': '(num_obs,)', 'dtype': 'np.float32'}), '(low=0, high=1, shape=(num_obs,), dtype=np.float32)\n', (2647, 2698), False, 'from gym.spaces import Box\n'), ((15147, 15215), 'gym.spaces.Box', 'Box', ([], {'low': '(-2000)', 'high': '(2000)', '... |
import yaml
import numpy as np
def load(path):
with open('config/default_values.yaml', 'r') as f:
default_cfg = yaml.load(f, yaml.FullLoader)
with open(path, 'r') as f:
cfg = yaml.load(f, yaml.FullLoader)
default_cfg.update(cfg)
cfg = default_cfg
cfg['data_bounding_box'] = np.arr... | [
"yaml.load",
"numpy.array"
] | [((314, 348), 'numpy.array', 'np.array', (["cfg['data_bounding_box']"], {}), "(cfg['data_bounding_box'])\n", (322, 348), True, 'import numpy as np\n'), ((125, 154), 'yaml.load', 'yaml.load', (['f', 'yaml.FullLoader'], {}), '(f, yaml.FullLoader)\n', (134, 154), False, 'import yaml\n'), ((201, 230), 'yaml.load', 'yaml.lo... |
import pickle
import numpy as np
import pandas as pd
from collections import Counter
def get_xy(dist, normed=False):
counter = Counter(dist)
x=[];y=[]
for xval in sorted(counter.keys()):
x.append(xval)
y.append(counter[xval])
y = np.array(y)
if normed:
y = y/y.sum()
ret... | [
"pickle.dump",
"pandas.read_csv",
"pickle.load",
"numpy.array",
"collections.Counter"
] | [((3245, 3339), 'pandas.read_csv', 'pd.read_csv', (['"""../data/original/Nodes_2015_country_degree_bc_B_Z_P.csv"""'], {'encoding': '"""latin-1"""'}), "('../data/original/Nodes_2015_country_degree_bc_B_Z_P.csv',\n encoding='latin-1')\n", (3256, 3339), True, 'import pandas as pd\n'), ((133, 146), 'collections.Counter'... |
'''
.. module:: skrf.plotting
========================================
plotting (:mod:`skrf.plotting`)
========================================
This module provides general plotting functions.
Plots and Charts
------------------
.. autosummary::
:toctree: generated/
smith
plot_smith
plot_rectangu... | [
"pylab.isinteractive",
"numpy.abs",
"numpy.angle",
"matplotlib.pyplot.quiver",
"numpy.imag",
"pylab.subplots",
"pylab.tight_layout",
"pylab.figure",
"pylab.linspace",
"pylab.gcf",
"pylab.cm.get_cmap",
"pylab.get_fignums",
"pylab.draw",
"numpy.real",
"pylab.array",
"matplotlib.patches.C... | [((4918, 4973), 'matplotlib.patches.Circle', 'Circle', (['[0, 0]', 'smithR'], {'ec': '"""k"""', 'fc': '"""None"""', 'visible': '(True)'}), "([0, 0], smithR, ec='k', fc='None', visible=True)\n", (4924, 4973), False, 'from matplotlib.patches import Circle\n'), ((9732, 9751), 'pylab.isinteractive', 'plb.isinteractive', ([... |
import os
import torch
from itertools import combinations
import six
import collections
from tqdm import tqdm, trange
import numpy as np
np.set_printoptions(threshold=10010)
def check_uniqueness(iterable_list):
flag = 0
for array1, array2 in combinations(iterable_list, 2):
for i in range(len(array1)):... | [
"numpy.set_printoptions",
"tqdm.trange",
"numpy.asarray",
"torch.cat",
"numpy.linalg.eigvalsh",
"itertools.combinations",
"torch.zeros"
] | [((138, 174), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': '(10010)'}), '(threshold=10010)\n', (157, 174), True, 'import numpy as np\n'), ((252, 282), 'itertools.combinations', 'combinations', (['iterable_list', '(2)'], {}), '(iterable_list, 2)\n', (264, 282), False, 'from itertools import combin... |
"""3D Bar plot of a TOF camera with hexagonal pixels"""
from vedo import *
import numpy as np
settings.defaultFont = "Glasgo"
settings.useParallelProjection = True
vals = np.abs(np.random.randn(4*6)) # pixel heights
cols = colorMap(vals, "summer")
k = 0
items = [__doc__]
for i in range(4):
for j in range(6):
... | [
"numpy.random.randn"
] | [((180, 202), 'numpy.random.randn', 'np.random.randn', (['(4 * 6)'], {}), '(4 * 6)\n', (195, 202), True, 'import numpy as np\n')] |
"""
Implements ZOO (Zero-Order Optimization) Attack.
This code is based on the L2-attack from the original implementation of the attack:
https://github.com/huanzhang12/ZOO-Attack/blob/master/l2_attack_black.py
Usage:
>>> import json
>>> from code_soup.ch5.models.zoo_attack import ZOOAttack
>>> config = js... | [
"numpy.abs",
"numpy.sum",
"numpy.argmax",
"numpy.empty",
"numpy.ones",
"numpy.prod",
"torch.square",
"numpy.arctanh",
"numpy.copy",
"numpy.power",
"numpy.max",
"numpy.random.choice",
"torch.log",
"cv2.resize",
"numpy.repeat",
"numpy.minimum",
"torch.zeros_like",
"torch.max",
"num... | [((2303, 2329), 'numpy.prod', 'np.prod', (['input_image_shape'], {}), '(input_image_shape)\n', (2310, 2329), True, 'import numpy as np\n'), ((2498, 2534), 'numpy.zeros', 'np.zeros', (['var_size'], {'dtype': 'np.float32'}), '(var_size, dtype=np.float32)\n', (2506, 2534), True, 'import numpy as np\n'), ((2557, 2593), 'nu... |
import numpy as np
import pickle as pkl
import scipy.sparse as sp
no_of_graphs = int(input(" no. pf graphs "))
start = int(input(" starting point of graphs "))
#total_type_edges = int(input(" type of edges \n"))
total_type_edges = 4
data_folder = "./data/custom/"
for graph_num in range(start,no_of_graphs):
... | [
"scipy.sparse.csr_matrix",
"numpy.zeros"
] | [((498, 517), 'numpy.zeros', 'np.zeros', (['num_nodes'], {}), '(num_nodes)\n', (506, 517), True, 'import numpy as np\n'), ((531, 550), 'numpy.zeros', 'np.zeros', (['num_nodes'], {}), '(num_nodes)\n', (539, 550), True, 'import numpy as np\n'), ((1312, 1328), 'scipy.sparse.csr_matrix', 'sp.csr_matrix', (['X'], {}), '(X)\... |
import numpy as np
# Variables controlling flow of the program
mode_globals = 2
save_history_globals = True
load_recording_globals = False
# Variables used for physical simulation
dt_main_simulation_globals = 0.020
speedup_globals = 1.0
# MPC
dt_mpc_simulation_globals = 0.20
mpc_horizon_globals = 20
# Parameters o... | [
"numpy.sin",
"numpy.random.normal",
"numpy.cos"
] | [((1563, 1578), 'numpy.cos', 'np.cos', (['s.angle'], {}), '(s.angle)\n', (1569, 1578), True, 'import numpy as np\n'), ((1588, 1603), 'numpy.sin', 'np.sin', (['s.angle'], {}), '(s.angle)\n', (1594, 1603), True, 'import numpy as np\n'), ((2289, 2307), 'numpy.random.normal', 'np.random.normal', ([], {}), '()\n', (2305, 23... |
import torch
import random
import numpy as np
from pathlib import Path
from typing import Any, List, Tuple, Dict, Optional, Callable
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
from image_classification.utils import import_class, import_object
import wandb
import l... | [
"torch.utils.data.sampler.SubsetRandomSampler",
"numpy.random.seed",
"torch.utils.data.DataLoader",
"torch.manual_seed",
"pathlib.Path",
"random.seed",
"torch.cuda.is_available",
"image_classification.utils.import_class",
"image_classification.utils.import_object",
"logging.getLogger"
] | [((333, 360), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (350, 360), False, 'import logging\n'), ((756, 788), 'pathlib.Path', 'Path', (['self.config.checkpoint_dir'], {}), '(self.config.checkpoint_dir)\n', (760, 788), False, 'from pathlib import Path\n'), ((945, 962), 'random.seed', '... |
from pandas import DataFrame, read_hdf
import numpy as np
import os
import matplotlib.pyplot as plt
# parameters
directories = ["/data/u_rgast_software/PycharmProjects/BrainNetworks/BasalGanglia/stn_gpe_healthy_opt2/PopulationDrops"]
fid = "PopulationDrop"
params = ['eta_e', 'eta_p', 'eta_a', 'delta_e', 'delta_p', 'de... | [
"matplotlib.pyplot.show",
"pandas.read_hdf",
"matplotlib.pyplot.subplots",
"numpy.round",
"os.listdir"
] | [((875, 889), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (887, 889), True, 'import matplotlib.pyplot as plt\n'), ((957, 1007), 'numpy.round', 'np.round', (["winner['results'].iloc[0][1]"], {'decimals': '(1)'}), "(winner['results'].iloc[0][1], decimals=1)\n", (965, 1007), True, 'import numpy as np\n... |
import random
import numpy as np
import pytest
from pandas import DataFrame
from tests.utils import assert_dataframes_equals
from weaverbird.backends.pandas_executor.steps.rank import execute_rank
from weaverbird.pipeline.steps import RankStep
@pytest.fixture
def sample_df():
return DataFrame(
{'COUNTRY... | [
"pandas.DataFrame",
"weaverbird.backends.pandas_executor.steps.rank.execute_rank",
"random.choice",
"tests.utils.assert_dataframes_equals",
"numpy.random.random",
"weaverbird.pipeline.steps.RankStep"
] | [((292, 388), 'pandas.DataFrame', 'DataFrame', (["{'COUNTRY': ['France'] * 3 + ['USA'] * 4, 'VALUE': [10, 20, 30, 10, 40, 30, 50]\n }"], {}), "({'COUNTRY': ['France'] * 3 + ['USA'] * 4, 'VALUE': [10, 20, 30, \n 10, 40, 30, 50]})\n", (301, 388), False, 'from pandas import DataFrame\n'), ((448, 519), 'weaverbird.pi... |
import numpy as np
import matplotlib.pyplot as plt
from sklearn import decomposition
from matplotlib import pylab
from matplotlib.patches import Rectangle
from pylab import cm
from prettytable import PrettyTable
class DataPlotting:
# singleton
instance = None
def __init__(self, calibration_dat... | [
"matplotlib.pylab.subplot",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.text",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.array",
"prettytable.Pre... | [((1104, 1113), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (1111, 1113), True, 'import matplotlib.pyplot as plt\n'), ((1226, 1260), 'matplotlib.pyplot.setp', 'plt.setp', (['plot_ref'], {'frame_on': '(False)'}), '(plot_ref, frame_on=False)\n', (1234, 1260), True, 'import matplotlib.pyplot as plt\n'), ((1272, ... |
#!/usr/bin/env python
import numpy as np
import cPickle as pk
import tensorflow as tf
from keras import backend as K
from time import time
from variables import DTYPE, EPSILON
from utils import convert_type, discount, LinearVF, gauss_log_prob, numel, dot_not_flat
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = co... | [
"numpy.sum",
"cPickle.load",
"numpy.arange",
"keras.backend.stop_gradient",
"numpy.exp",
"keras.backend.placeholder",
"numpy.zeros_like",
"numpy.copy",
"numpy.random.randn",
"keras.backend.reshape",
"numpy.append",
"utils.discount",
"keras.backend.gradients",
"keras.backend.batch_get_value... | [((543, 553), 'numpy.copy', 'np.copy', (['a'], {}), '(a)\n', (550, 553), True, 'import numpy as np\n'), ((1383, 1393), 'utils.LinearVF', 'LinearVF', ([], {}), '()\n', (1391, 1393), False, 'from utils import convert_type, discount, LinearVF, gauss_log_prob, numel, dot_not_flat\n'), ((1674, 1713), 'keras.backend.variable... |
#!/usr/bin/python
# The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt
#
# This example program shows how you can use dlib to make an object
# detector for things like object, pedestrians, and any other semi-rigid
# object. In particular, we go though the steps to train the ki... | [
"os.path.abspath",
"matplotlib.pyplot.show",
"os.path.dirname",
"matplotlib.pyplot.figure",
"numpy.array",
"dlib.shape_predictor_training_options",
"numpy.int32",
"cv2.rectangle",
"os.path.join",
"os.chdir",
"skimage.io.imread"
] | [((1480, 1506), 'os.path.abspath', 'os.path.abspath', (['os.curdir'], {}), '(os.curdir)\n', (1495, 1506), False, 'import os\n'), ((2154, 2193), 'dlib.shape_predictor_training_options', 'dlib.shape_predictor_training_options', ([], {}), '()\n', (2191, 2193), False, 'import dlib\n'), ((3046, 3072), 'os.path.abspath', 'os... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 13 17:15:16 2020
@author: JAVIER
"""
import numpy as np
import pandas as pd
import pickle
from .. import bci_architectures as athena
from . import bci_penalty_plugin as bci_penalty
from .. import load_brain_data as lb
from Fancy_aggregations import penalties as pn
from... | [
"Fancy_aggregations.binary_parser.parse",
"pandas.DataFrame",
"pickle.dump",
"numpy.minimum",
"numpy.abs",
"numpy.log",
"numpy.argmax",
"pandas.read_csv",
"numpy.zeros",
"numpy.transpose",
"sklearn.model_selection.KFold",
"numpy.equal",
"scipy.optimize.least_squares",
"numpy.mean",
"nump... | [((1445, 1482), 'numpy.log', 'np.log', (['(y * output + (1 - y) * output)'], {}), '(y * output + (1 - y) * output)\n', (1451, 1482), True, 'import numpy as np\n'), ((2555, 2575), 'numpy.swapaxes', 'np.swapaxes', (['X', '(0)', '(1)'], {}), '(X, 0, 1)\n', (2566, 2575), True, 'import numpy as np\n'), ((2727, 2761), 'numpy... |
import matplotlib.image as mpimg
import numpy as np
import pickle
from test_feature_exrtact import *
from lesson_functions import *
color_space = 'YCrCb'
orient = 9
pix_per_cell = 8
cell_per_block = 2
hog_channel = 'ALL'
spatial_size = (32, 32)
hist_bins = 32
spatial_feat = True
hist_feat = True
h... | [
"numpy.random.randint",
"numpy.array",
"numpy.vstack"
] | [((2090, 2115), 'numpy.random.randint', 'np.random.randint', (['(0)', '(100)'], {}), '(0, 100)\n', (2107, 2115), True, 'import numpy as np\n'), ((461, 481), 'numpy.array', 'np.array', (['car_images'], {}), '(car_images)\n', (469, 481), True, 'import numpy as np\n'), ((510, 533), 'numpy.array', 'np.array', (['noncar_ima... |
"""
dlc2kinematics
© <NAME>
https://github.com/AdaptiveMotorControlLab/dlc2kinematics/
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
from mpl_toolkits.mplot3d import Axes3D
from sklearn.decomposition import PCA
from dlc2kinematics.utils import auxiliaryfunct... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"mpl_toolkits.mplot3d.Axes3D",
"pandas.read_hdf",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"numpy.cumsum",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.cla",
"sklearn.decomposition.PCA",
"dlc2kinematics.utils.auxiliaryfunctions.... | [((1270, 1297), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Frame numbers"""'], {}), "('Frame numbers')\n", (1280, 1297), True, 'import matplotlib.pyplot as plt\n'), ((1302, 1329), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""velocity (AU)"""'], {}), "('velocity (AU)')\n", (1312, 1329), True, 'import matplotlib.... |
import numpy as np
from scipy import stats
data = np.array([1,2,3,4])
ans = np.median(data)
print(ans) | [
"numpy.median",
"numpy.array"
] | [((51, 73), 'numpy.array', 'np.array', (['[1, 2, 3, 4]'], {}), '([1, 2, 3, 4])\n', (59, 73), True, 'import numpy as np\n'), ((77, 92), 'numpy.median', 'np.median', (['data'], {}), '(data)\n', (86, 92), True, 'import numpy as np\n')] |
#!/usr/bin/env python
# test_processors.py
#
# Copyright (C) 2020-2021 <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license. See the LICENSE file for details.
from os.path import getsize
import numpy as np
import pytest
from PIL import Image
fro... | [
"pipescaler.processors.ThresholdProcessor",
"pipescaler.processors.XbrzProcessor",
"pipescaler.processors.ESRGANProcessor",
"pipescaler.processors.AppleScriptExternalProcessor",
"pipescaler.processors.SolidColorProcessor",
"pytest.mark.parametrize",
"pipescaler.processors.CropProcessor",
"shared.xfail... | [((958, 974), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (972, 974), False, 'import pytest\n'), ((1113, 1129), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1127, 1129), False, 'import pytest\n'), ((1261, 1277), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1275, 1277), False, 'import pytes... |
#!/usr/bin/env python
#
# A noddy example to exercise most of the features in the "eb" module.
# Demonstrates how I recommend filling in the parameter vector - this
# way internal rearrangements of the vector as the model evolves won't
# break all of your scripts.
#
import numpy
import eb
import matplotlib.pyplot as p... | [
"matplotlib.pyplot.subplot",
"numpy.absolute",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"eb.phicont",
"matplotlib.pyplot.ylim",
"numpy.empty",
"numpy.median",
"numpy.compress",
"numpy.zeros",
"numpy.empty_like",
"numpy.linspace",
"eb.getvder",
"eb.model"
] | [((379, 419), 'numpy.zeros', 'numpy.zeros', (['eb.NPAR'], {'dtype': 'numpy.double'}), '(eb.NPAR, dtype=numpy.double)\n', (390, 419), False, 'import numpy\n'), ((3170, 3204), 'eb.getvder', 'eb.getvder', (['parm', '(-61.070553)', 'ktot'], {}), '(parm, -61.070553, ktot)\n', (3180, 3204), False, 'import eb\n'), ((3405, 342... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 23:00:51 2020
@author: zf
"""
# import pycocotools.coco as coco
from pycocotools.coco import COCO
import os
import shutil
from tqdm import tqdm
import skimage.io as io
import matplotlib.pyplot as plt
import cv2
from PIL import Image, ImageDraw
im... | [
"os.mkdir",
"DataFunction.write_rotate_xml",
"numpy.sin",
"sys.path.append",
"numpy.zeros_like",
"os.path.exists",
"numpy.transpose",
"numpy.int",
"cv2.destroyAllWindows",
"tqdm.tqdm",
"Rotatexml2DotaTxT.eval_rotatexml",
"cv2.waitKey",
"numpy.float",
"numpy.cos",
"numpy.dot",
"numpy.vs... | [((348, 382), 'sys.path.append', 'sys.path.append', (['"""/home/zf/0tools"""'], {}), "('/home/zf/0tools')\n", (363, 382), False, 'import sys\n'), ((2090, 2104), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (2101, 2104), False, 'import cv2\n'), ((2109, 2132), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([... |
#!/usr/bin/env python
# coding: utf-8
import sys
sys.path.append('../../')
import os
import numpy as np
import torch
import scipy as sc
import dill
from core.dynamics import RoboticDynamics
from koopman_core.util import run_experiment, evaluate_ol_pred
from koopman_core.dynamics import BilinearLiftedDynamics
from koopm... | [
"koopman_core.learning.KoopDnn",
"ray.tune.uniform",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.arange",
"koopman_core.util.evaluate_ol_pred",
"os.path.join",
"sys.path.append",
"os.path.abspath",
"koopman_core.dynamics.BilinearLiftedDynamics",
"koopman_core.learning.KoopmanNe... | [((49, 74), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (64, 74), False, 'import sys\n'), ((1229, 1300), 'numpy.array', 'np.array', (['[[0, 0, 1, 0], [0, 0, 0, 1], [0, 0, lambd, 0], [0, 0, 0, mu]]'], {}), '([[0, 0, 1, 0], [0, 0, 0, 1], [0, 0, lambd, 0], [0, 0, 0, mu]])\n', (1237, 1300)... |
import sys
import pandas as pd
import re
import numpy as np
from sqlalchemy import create_engine
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk.stem.porter import PorterStemmer
from sklearn.pipeline import Pipeline
from sklearn.feature_extract... | [
"pandas.DataFrame",
"sklearn.model_selection.GridSearchCV",
"sklearn.feature_extraction.text.CountVectorizer",
"nltk.stem.WordNetLemmatizer",
"sklearn.model_selection.train_test_split",
"joblib.dump",
"sklearn.metrics.classification_report",
"sklearn.ensemble.GradientBoostingClassifier",
"pandas.rea... | [((1068, 1115), 'sqlalchemy.create_engine', 'create_engine', (["('sqlite:///' + database_filepath)"], {}), "('sqlite:///' + database_filepath)\n", (1081, 1115), False, 'from sqlalchemy import create_engine\n'), ((1123, 1172), 'pandas.read_sql_table', 'pd.read_sql_table', (['"""categorized_messages"""', 'engine'], {}), ... |
# * This code is provided solely for the personal and private use of students
# * taking the CSC401 course at the University of Toronto. Copying for purposes
# * other than this use is expressly prohibited. All forms of distribution of
# * this code, including but not limited to public repositories on GitHub,
# * ... | [
"sklearn.ensemble.RandomForestClassifier",
"sklearn.naive_bayes.GaussianNB",
"sklearn.ensemble.AdaBoostClassifier",
"numpy.random.seed",
"argparse.ArgumentParser",
"sklearn.linear_model.SGDClassifier",
"numpy.argmax",
"numpy.load",
"sklearn.model_selection.train_test_split",
"os.path.dirname",
"... | [((1143, 1162), 'numpy.random.seed', 'np.random.seed', (['(401)'], {}), '(401)\n', (1157, 1162), True, 'import numpy as np\n'), ((2351, 2366), 'sklearn.linear_model.SGDClassifier', 'SGDClassifier', ([], {}), '()\n', (2364, 2366), False, 'from sklearn.linear_model import SGDClassifier\n'), ((2464, 2476), 'sklearn.naive_... |
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
import utils
from methods import methods
from visualization import plots
FILENAME = 'datasets/ILThermo_Tm.csv'
MODEL = 'mlp_regressor'
DIRNAME = 'my_test'
descs = sys.argv[1:] if le... | [
"matplotlib.pyplot.title",
"numpy.empty",
"sklearn.model_selection.train_test_split",
"utils.molecular_descriptors",
"matplotlib.pyplot.figure",
"numpy.arange",
"pandas.DataFrame",
"utils.normalization",
"numpy.copy",
"numpy.linspace",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"mat... | [((398, 423), 'utils.read_data', 'utils.read_data', (['FILENAME'], {}), '(FILENAME)\n', (413, 423), False, 'import utils\n'), ((431, 469), 'utils.molecular_descriptors', 'utils.molecular_descriptors', (['df', 'descs'], {}), '(df, descs)\n', (458, 469), False, 'import utils\n'), ((474, 499), 'numpy.empty', 'np.empty', (... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pcompile import ureg
from math import floor
from numpy.random import random
from copy import copy
class NameRegistry(object):
def __init__(self, names=set()):
self.names=names
assert isinstance(self.names, set)
def new(self, tag=None):
... | [
"numpy.random.random",
"copy.copy"
] | [((1403, 1421), 'copy.copy', 'copy', (['_PCR_96_WELL'], {}), '(_PCR_96_WELL)\n', (1407, 1421), False, 'from copy import copy\n'), ((4235, 4259), 'copy.copy', 'copy', (['_CONTAINERS[ctype]'], {}), '(_CONTAINERS[ctype])\n', (4239, 4259), False, 'from copy import copy\n'), ((922, 930), 'numpy.random.random', 'random', ([]... |
import torch
import torch.nn.functional as F
from tensorboardX import SummaryWriter
from sklearn.metrics import roc_auc_score
import numpy as np
import time
from tqdm import tqdm
import os
from utlis.utils import model_name, select_model
from utlis.utils import get_optimizer, make_dataLoader, LoadModel, lr_schedule, ... | [
"utlis.utils.get_optimizer",
"utlis.utils.LoadModel",
"utlis.utils.SaveModel",
"utlis.utils.model_name",
"torch.nn.BCELoss",
"os.path.exists",
"numpy.append",
"utlis.utils.make_dataLoader_chexpert",
"utlis.utils.get_loss",
"tqdm.tqdm",
"torch.zeros_like",
"utlis.utils.make_dataLoader_binary",
... | [((995, 1022), 'utlis.utils.get_optimizer', 'get_optimizer', (['params', 'args'], {}), '(params, args)\n', (1008, 1022), False, 'from utlis.utils import get_optimizer, make_dataLoader, LoadModel, lr_schedule, make_dataLoader_chexpert\n'), ((2051, 2082), 'os.path.exists', 'os.path.exists', (['checkpoint_file'], {}), '(c... |
'''
1、借鉴老师代码V1
2、解读他的代码思路
- trian_labels.csv 的读取
-
3、我未曾用过的库
- glob - 可使用相对路径的库?| 可按照Unix终端所使用的那般规则来查询文件等
'''
import os
import pdb
import cv2
import time
import codecs
import random
import argparse
import numpy as np
import pandas as pd
import seaborn as sns
from tqdm import tqdm
from loguru import logger
from co... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.optim.lr_scheduler.StepLR",
"numpy.mean",
"torch.no_grad",
"loguru.logger.add",
"torch.utils.data.DataLoader",
"numpy.random.RandomState",
"random.seed",
"torch.utils.tensorboard.SummaryWriter",
"torch.nn.Linear",
"torch.nn.BCEWithLogitsLo... | [((1197, 1286), 'loguru.logger.add', 'logger.add', (['"""/home/alben/code/kaggle_SETI_search_ET/log/train.log"""'], {'rotation': '"""1 day"""'}), "('/home/alben/code/kaggle_SETI_search_ET/log/train.log', rotation\n ='1 day')\n", (1207, 1286), False, 'from loguru import logger\n'), ((1507, 1527), 'numpy.random.seed',... |
import glob
import os.path as pth
import numpy as np
import collections
import matplotlib.pylab as plt
import keras.utils
class RgbdSetElement(object):
def __init__(self, npz_path):
self.npz_path = npz_path
self.npz_file = pth.basename(npz_path)
self.set_name = self.npz_file.split("_", max... | [
"numpy.load",
"matplotlib.pylab.show",
"os.path.basename",
"collections.defaultdict",
"glob.glob",
"collections.deque",
"matplotlib.pylab.figure"
] | [((4473, 4505), 'collections.defaultdict', 'collections.defaultdict', (['RgbdSet'], {}), '(RgbdSet)\n', (4496, 4505), False, 'import collections\n'), ((4526, 4549), 'glob.glob', 'glob.glob', (['glob_pattern'], {}), '(glob_pattern)\n', (4535, 4549), False, 'import glob\n'), ((245, 267), 'os.path.basename', 'pth.basename... |
import os
import os.path as path
import pandas as pd
import numpy as np
from scipy import stats
def read_data_sets(file_path):
column_names = ['timestamp','x-axis', 'y-axis', 'z-axis','x1-axis', 'y1-axis', 'z1-axis','x2-axis', 'y2-axis', 'z2-axis','activity']
data = pd.read_csv(file_path,header = None, names = ... | [
"numpy.dstack",
"numpy.save",
"scipy.stats.mode",
"pandas.read_csv",
"numpy.empty",
"numpy.std",
"pandas.get_dummies",
"numpy.mean"
] | [((5542, 5597), 'numpy.save', 'np.save', (['"""Datasets/OutSet_AddMagnetic/x_train"""', 'x_train'], {}), "('Datasets/OutSet_AddMagnetic/x_train', x_train)\n", (5549, 5597), True, 'import numpy as np\n'), ((5597, 5652), 'numpy.save', 'np.save', (['"""Datasets/OutSet_AddMagnetic/y_train"""', 'y_train'], {}), "('Datasets/... |
from bokeh.plotting import figure, curdoc, vplot, hplot
from bokeh.models.widgets import Button, Toggle, Slider, VBoxForm, HBox, VBox, CheckboxGroup
from bokeh.driving import linear
import numpy as np
# Forward & reverse propagating waves. Use global variables to pass values into function.
def forward_wave():
re... | [
"bokeh.plotting.figure",
"bokeh.models.widgets.CheckboxGroup",
"bokeh.models.widgets.VBox",
"numpy.exp",
"numpy.linspace",
"numpy.cos",
"bokeh.models.widgets.Slider",
"bokeh.plotting.curdoc",
"bokeh.models.widgets.Toggle",
"bokeh.models.widgets.Button"
] | [((921, 953), 'numpy.linspace', 'np.linspace', (['zmin', 'zmax', 'numpnts'], {}), '(zmin, zmax, numpnts)\n', (932, 953), True, 'import numpy as np\n'), ((1277, 1448), 'bokeh.plotting.figure', 'figure', ([], {'plot_width': '(600)', 'plot_height': '(400)', 'x_range': '(zmin, zmax)', 'y_range': '(-2.1, 2.1)', 'title': '""... |
"""
Particular class of real traffic network
@author: <NAME>
"""
import configparser
import logging
import numpy as np
import matplotlib.pyplot as plt
import os
import seaborn as sns
import time
from envs.env import PhaseMap, PhaseSet, TrafficSimulator
from real_net.data.build_file import gen_rou_file
sns.set_color_c... | [
"os.mkdir",
"logging.basicConfig",
"matplotlib.pyplot.plot",
"seaborn.set_color_codes",
"os.path.exists",
"real_net.data.build_file.gen_rou_file",
"time.sleep",
"numpy.sort",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.array",
"matplotlib.pyplot.ylabel",
"configparser.ConfigParser",
"... | [((305, 326), 'seaborn.set_color_codes', 'sns.set_color_codes', ([], {}), '()\n', (324, 326), True, 'import seaborn as sns\n'), ((5980, 5990), 'numpy.sort', 'np.sort', (['X'], {}), '(X)\n', (5987, 5990), True, 'import numpy as np\n'), ((6061, 6111), 'matplotlib.pyplot.plot', 'plt.plot', (['sorted_data', 'yvals'], {'col... |
import numpy as np
import torch
import gym
import argparse
import os
import utils
import TD3
import kerbal_rl.env as envs
def generate_input(obs) :
mean_altitude = obs[1].mean_altitude
speed = obs[1].vertical_speed
dry_mass = obs[0].dry_mass
mass = obs[0].mass
max_thrust = obs[0].max_thrust
thrust = obs[0].t... | [
"numpy.save",
"numpy.random.seed",
"argparse.ArgumentParser",
"os.makedirs",
"kerbal_rl.env.hover_v0",
"torch.manual_seed",
"os.path.exists",
"TD3.TD3",
"numpy.array",
"numpy.random.normal",
"utils.ReplayBuffer"
] | [((1050, 1075), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1073, 1075), False, 'import argparse\n'), ((2795, 2810), 'kerbal_rl.env.hover_v0', 'envs.hover_v0', ([], {}), '()\n', (2808, 2810), True, 'import kerbal_rl.env as envs\n'), ((2825, 2853), 'torch.manual_seed', 'torch.manual_seed', (... |
import numpy as np
def fdr(pvalues, alpha=0.05):
"""
Calculate the p-value cut-off to control for
the false discovery rate (FDR) for multiple testing.
If by controlling for FDR, all of n null hypotheses
are rejected, the conservative Bonferroni bound (alpha/n)
is returned instead.
Argume... | [
"numpy.sort",
"numpy.where",
"numpy.arange"
] | [((1609, 1628), 'numpy.arange', 'np.arange', (['n', '(0)', '(-1)'], {}), '(n, 0, -1)\n', (1618, 1628), True, 'import numpy as np\n'), ((1574, 1590), 'numpy.sort', 'np.sort', (['pvalues'], {}), '(pvalues)\n', (1581, 1590), True, 'import numpy as np\n'), ((1701, 1717), 'numpy.where', 'np.where', (['search'], {}), '(searc... |
import os
import json
import logging
import azure.functions as func
from flass.model import load_mlflow_model
import flass
import numpy as np
CACHED_MODEL = None
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info(f"Flass is at {flass.__file__}")
logging.info("Python HTTP trigge... | [
"logging.error",
"flass.model.load_mlflow_model",
"json.loads",
"logging.info",
"numpy.array",
"azure.functions.HttpResponse",
"os.getenv"
] | [((237, 282), 'logging.info', 'logging.info', (['f"""Flass is at {flass.__file__}"""'], {}), "(f'Flass is at {flass.__file__}')\n", (249, 282), False, 'import logging\n'), ((288, 367), 'logging.info', 'logging.info', (['"""Python HTTP trigger function processed a request to Flass func."""'], {}), "('Python HTTP trigger... |
from typing import Tuple
import torch
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.filters import gaussian_filter
import numpy as np
class Augmentation(object):
"""
Super class for all augmentations.
"""
def __init__(self) -> None:
"""
Constructor method... | [
"torch.randn_like",
"scipy.ndimage.interpolation.map_coordinates",
"numpy.arange",
"numpy.reshape",
"numpy.random.rand",
"torch.abs",
"torch.tensor",
"torch.from_numpy"
] | [((2083, 2139), 'torch.tensor', 'torch.tensor', (['(input.shape[2] // 2, input.shape[1] // 2)'], {}), '((input.shape[2] // 2, input.shape[1] // 2))\n', (2095, 2139), False, 'import torch\n'), ((2251, 2305), 'torch.abs', 'torch.abs', (['(bounding_boxes[:, 0] - bounding_boxes[:, 2])'], {}), '(bounding_boxes[:, 0] - bound... |
from tqdm import tqdm
import numpy as np
import argparse
parser = argparse.ArgumentParser(
description='Binarize dense extreme prediction data sets.')
parser.add_argument('input', help='Path to input file')
parser.add_argument(
'-f', '--filter', help='Path to file containing indices to filter by.')
parser.add_... | [
"argparse.ArgumentParser",
"numpy.fromfile",
"numpy.empty",
"numpy.float32",
"numpy.array"
] | [((67, 155), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Binarize dense extreme prediction data sets."""'}), "(description=\n 'Binarize dense extreme prediction data sets.')\n", (90, 155), False, 'import argparse\n'), ((527, 561), 'numpy.empty', 'np.empty', (['(n, d)'], {'dtype': '... |
import os
from enum import Enum
import numpy as np
from PIL import Image
from tensorflow.keras.applications.imagenet_utils import preprocess_input
from keras_preprocessing import image
from tensorflow.python.keras.models import load_model
DATASET_PATH = os.environ['DATASET_PATH']
TARGET_RESOLUTION = (64, 64)
class ... | [
"tensorflow.python.keras.models.load_model",
"tensorflow.keras.applications.imagenet_utils.preprocess_input",
"numpy.argmax",
"numpy.expand_dims",
"keras_preprocessing.image.img_to_array",
"PIL.Image.open",
"numpy.array",
"os.listdir",
"numpy.vstack"
] | [((449, 494), 'os.listdir', 'os.listdir', (['f"""{DATASET_PATH}/Train/Carnaval/"""'], {}), "(f'{DATASET_PATH}/Train/Carnaval/')\n", (459, 494), False, 'import os\n'), ((709, 750), 'os.listdir', 'os.listdir', (['f"""{DATASET_PATH}/Train/Face/"""'], {}), "(f'{DATASET_PATH}/Train/Face/')\n", (719, 750), False, 'import os\... |
# 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... | [
"numpy.pad",
"mindspore.context.set_context",
"os.mkdir",
"numpy.load",
"mindspore.Model",
"os.path.exists",
"mindspore.common.tensor.Tensor",
"numpy.array",
"mindspore.train.serialization.load_checkpoint",
"numpy.linspace",
"src.model.Generator",
"os.path.join",
"os.listdir",
"numpy.conca... | [((1019, 1087), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE', 'device_target': '"""Ascend"""'}), "(mode=context.GRAPH_MODE, device_target='Ascend')\n", (1038, 1087), True, 'import mindspore.context as context\n'), ((1121, 1165), 'mindspore.context.set_context', 'context.set... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/math/primes.py
# Get prime numbers
# @code
# np = primes ( 1000 )## get all prime numbers that are smaller than 1000
# @endcode
# The function <code>primes</code> use sieve... | [
"ostap.logger.logger.getLogger",
"builtins.range",
"numpy.ones",
"random.choice",
"numpy.nonzero",
"numpy.array",
"ostap.utils.docme.docme",
"bisect.bisect_left"
] | [((1641, 1671), 'ostap.logger.logger.getLogger', 'getLogger', (['"""ostap.math.primes"""'], {}), "('ostap.math.primes')\n", (1650, 1671), False, 'from ostap.logger.logger import getLogger\n'), ((1713, 1732), 'ostap.logger.logger.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (1722, 1732), False, 'from ost... |
import numpy as np
# from scipy.fft import fft, ifft
from numpy.fft import fft, ifft, fftfreq, fftshift
import matplotlib.pyplot as plt
f = np.array([
1, 2-1j, -1j, -1+2j
])
print(f"The vector of values if {f}")
F = fft(f)
print(f"The fourier transform is {F}")
f_hat = ifft(F)
error = np.abs(f - f_hat)
print(f"... | [
"numpy.fft.ifft",
"numpy.abs",
"matplotlib.pyplot.show",
"numpy.fft.fft",
"numpy.fft.fftfreq",
"numpy.fft.fftshift",
"numpy.array",
"matplotlib.pyplot.subplots"
] | [((141, 182), 'numpy.array', 'np.array', (['[1, 2 - 1.0j, -1.0j, -1 + 2.0j]'], {}), '([1, 2 - 1.0j, -1.0j, -1 + 2.0j])\n', (149, 182), True, 'import numpy as np\n'), ((223, 229), 'numpy.fft.fft', 'fft', (['f'], {}), '(f)\n', (226, 229), False, 'from numpy.fft import fft, ifft, fftfreq, fftshift\n'), ((278, 285), 'numpy... |
import os
import numpy as np
from tqdm import tqdm
import copy
import shutil
from data_info.data_info import DataInfo
from heatmap_generator.anisotropic_laplace_heatmap_generator import AnisotropicLaplaceHeatmapGenerator
class DatasetGenerator:
@classmethod
def generate_dataset(cls):
print('\nStep 1:... | [
"numpy.load",
"numpy.save",
"copy.deepcopy",
"os.makedirs",
"tqdm.tqdm",
"numpy.zeros",
"os.path.exists",
"heatmap_generator.anisotropic_laplace_heatmap_generator.AnisotropicLaplaceHeatmapGenerator",
"numpy.array",
"os.path.join",
"os.listdir"
] | [((838, 860), 'numpy.zeros', 'np.zeros', (['(400, 19, 2)'], {}), '((400, 19, 2))\n', (846, 860), True, 'import numpy as np\n'), ((884, 906), 'numpy.zeros', 'np.zeros', (['(400, 19, 2)'], {}), '((400, 19, 2))\n', (892, 906), True, 'import numpy as np\n'), ((931, 953), 'numpy.zeros', 'np.zeros', (['(400, 19, 2)'], {}), '... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),
# acting on behalf of its Max Planck Institute for Intelligent Systems and the
# Max Planck Institute for Biological Cybernetics. All rights reserved.
#
# Max-Planck-Gesellschaft zur Förderung der Wissens... | [
"torch.nn.Parameter",
"numpy.load",
"human_body_prior.tools.model_loader.load_vposer",
"numpy.zeros",
"torch.cat",
"torch.no_grad",
"torch.tensor",
"numpy.repeat"
] | [((2797, 2863), 'numpy.repeat', 'np.repeat', (["smpl_dict['v_template'][np.newaxis]", 'batch_size'], {'axis': '(0)'}), "(smpl_dict['v_template'][np.newaxis], batch_size, axis=0)\n", (2806, 2863), True, 'import numpy as np\n'), ((2384, 2419), 'numpy.load', 'np.load', (['bm_path'], {'encoding': '"""latin1"""'}), "(bm_pat... |
# -*- coding: utf-8 -*-
"""System transmission plots.
This code creates transmission line and interface plots.
@author: <NAME>, <NAME>
"""
import os
import logging
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.colors as mcolors
import matplotlib.d... | [
"marmot.plottingmodules.plotutils.plot_exceptions.MissingInputData",
"matplotlib.pyplot.axes",
"marmot.plottingmodules.plotutils.plot_exceptions.InputSheetError",
"marmot.plottingmodules.plotutils.plot_exceptions.UnsupportedAggregation",
"numpy.arange",
"marmot.plottingmodules.plotutils.plot_exceptions.Da... | [((1941, 1985), 'logging.getLogger', 'logging.getLogger', (["('marmot_plot.' + __name__)"], {}), "('marmot_plot.' + __name__)\n", (1958, 1985), False, 'import logging\n'), ((2013, 2044), 'marmot.config.mconfig.parser', 'mconfig.parser', (['"""font_settings"""'], {}), "('font_settings')\n", (2027, 2044), True, 'import m... |
import os
import numpy as np
import h5py
import lsst.sims.photUtils as photUtils
import GCRCatalogs
from GCR import GCRQuery
import time
import argparse
import multiprocessing
def validate_chunk(data_in,
in_dir, healpix,
read_lock, write_lock, output_dict):
galaxy_id = data... | [
"numpy.abs",
"argparse.ArgumentParser",
"numpy.argsort",
"os.path.isfile",
"os.path.join",
"numpy.copy",
"GCR.GCRQuery",
"lsst.sims.photUtils.Sed",
"numpy.isfinite",
"numpy.random.RandomState",
"h5py.File",
"numpy.testing.assert_array_equal",
"lsst.sims.photUtils.getImsimFluxNorm",
"GCRCat... | [((1044, 1097), 'lsst.sims.photUtils.BandpassDict.loadTotalBandpassesFromFiles', 'photUtils.BandpassDict.loadTotalBandpassesFromFiles', ([], {}), '()\n', (1095, 1097), True, 'import lsst.sims.photUtils as photUtils\n'), ((1114, 1161), 'os.path.join', 'os.path.join', (['in_dir', "('sed_fit_%d.h5' % healpix)"], {}), "(in... |
import numpy as np
def bb_iou(a, b):
a_x_tl = a[2]
a_y_tl = a[3]
a_x_br = a[0]
a_y_br = a[1]
b_x_tl = b[2]
b_y_tl = b[3]
b_x_br = b[0]
b_y_br = b[1]
# a_x_tl = a[0]-a[2]
# a_y_tl = a[1]-a[3]
# a_x_br = a[0]
# a_y_br = a[1]
#
# b_x_tl = b[0]-b[2]
# b_y_tl = ... | [
"numpy.shape"
] | [((928, 947), 'numpy.shape', 'np.shape', (['gt_bboxes'], {}), '(gt_bboxes)\n', (936, 947), True, 'import numpy as np\n')] |
import sys
sys.path.append('..')
import numpy as np
import math
from geneticalgorithm import geneticalgorithm as ga
def f(X):
dim = len(X)
OF = 0
for i in range (0, dim):
OF+=(X[i]**2)-10*math.cos(2*math.pi*X[i])+10
return OF
def test_rastrigin():
parameters={'max_num_iteration': 1000,
... | [
"sys.path.append",
"numpy.array",
"math.cos",
"geneticalgorithm.geneticalgorithm"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((749, 778), 'numpy.array', 'np.array', (['([[-5.12, 5.12]] * 2)'], {}), '([[-5.12, 5.12]] * 2)\n', (757, 778), True, 'import numpy as np\n'), ((790, 907), 'geneticalgorithm.geneticalgorithm', 'ga', ([], ... |
import numpy as np
from glip.math import mat4
def test_is_similarity():
assert mat4.is_similarity(mat4.translate(4.0, 56.7, 2.3))
assert mat4.is_similarity(mat4.rotate_axis_angle(0, 1, 0, 0.453))
assert mat4.is_similarity(mat4.scale(1, -1, 1))
assert not mat4.is_similarity(mat4.scale(2, 1, 1))
as... | [
"glip.math.mat4.translate",
"numpy.random.randn",
"glip.math.mat4.rotate_axis_angle",
"glip.math.mat4.scale"
] | [((104, 134), 'glip.math.mat4.translate', 'mat4.translate', (['(4.0)', '(56.7)', '(2.3)'], {}), '(4.0, 56.7, 2.3)\n', (118, 134), False, 'from glip.math import mat4\n'), ((166, 204), 'glip.math.mat4.rotate_axis_angle', 'mat4.rotate_axis_angle', (['(0)', '(1)', '(0)', '(0.453)'], {}), '(0, 1, 0, 0.453)\n', (188, 204), F... |
import numpy as np
import copy
import pickle
# Data loading related
def load_from_pickle(filename, n_jets):
jets = []
fd = open(filename, "rb")
for i in range(n_jets):
jet = pickle.load(fd)
jets.append(jet)
fd.close()
return jets
# Jet related
def _pt(v):
pz = v[2]
p... | [
"copy.deepcopy",
"numpy.arctan2",
"numpy.log",
"numpy.zeros",
"numpy.isfinite",
"pickle.load",
"numpy.array",
"numpy.where",
"numpy.exp",
"numpy.cosh"
] | [((1061, 1079), 'copy.deepcopy', 'copy.deepcopy', (['jet'], {}), '(jet)\n', (1074, 1079), False, 'import copy\n'), ((1631, 1649), 'copy.deepcopy', 'copy.deepcopy', (['jet'], {}), '(jet)\n', (1644, 1649), False, 'import copy\n'), ((2803, 2821), 'copy.deepcopy', 'copy.deepcopy', (['jet'], {}), '(jet)\n', (2816, 2821), Fa... |
import sklearn
import numpy as np
import sklearn.datasets as skdata
from matplotlib import pyplot as plt
boston_housing_data = skdata.load_boston()
print(boston_housing_data)
x = boston_housing_data.data
feat_names = boston_housing_data.feature_names
print(feat_names)
#print(boston_housing_data.DESCR)
y = boston_... | [
"matplotlib.pyplot.show",
"sklearn.datasets.load_boston",
"matplotlib.pyplot.figure",
"numpy.max",
"numpy.min"
] | [((128, 148), 'sklearn.datasets.load_boston', 'skdata.load_boston', ([], {}), '()\n', (146, 148), True, 'import sklearn.datasets as skdata\n'), ((390, 402), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (400, 402), True, 'from matplotlib import pyplot as plt\n'), ((2491, 2503), 'matplotlib.pyplot.figure',... |
import pandas as pd
import numpy as np
import sklearn
import warnings
import sys
# sys.path.append('Feature Comparison/Basic.py')
from sklearn.naive_bayes import GaussianNB
from sklearn.naive_bayes import MultinomialNB
from sklearn.svm import SVC
from sklearn.linear_model import LogisticRegression
from sklearn.metric... | [
"pandas.DataFrame",
"sklearn.naive_bayes.GaussianNB",
"numpy.load",
"sklearn.naive_bayes.MultinomialNB",
"warnings.filterwarnings",
"pandas.read_csv",
"sklearn.model_selection.cross_val_score",
"sklearn.metrics.accuracy_score",
"sklearn.preprocessing.MinMaxScaler",
"numpy.hstack",
"sklearn.linea... | [((1042, 1133), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'FutureWarning', 'module': '"""sklearn"""', 'lineno': '(196)'}), "('ignore', category=FutureWarning, module='sklearn',\n lineno=196)\n", (1065, 1133), False, 'import warnings\n'), ((1130, 1221), 'warnings.filterwarn... |
from pylightnix import ( RRef, Build, rref2path, rref2dref, match_some,
realizeMany, match_latest, store_buildtime, store_buildelta, store_context,
BuildArgs, mkdrv, build_wrapper, match_only, build_setoutpaths, readjson )
from stagedml.stages.all import *
from stagedml.stages.bert_finetune_glue import ( Model... | [
"stagedml.imports.sys.environ.get",
"official.nlp.bert.classifier_data_lib.convert_single_example",
"numpy.argmax",
"official.nlp.bert.classifier_data_lib.InputExample",
"pylightnix.store_context",
"tensorflow.constant",
"pylightnix.build_wrapper",
"stagedml.imports.sys.json_dump",
"stagedml.stages.... | [((1178, 1210), 'stagedml.imports.sys.environ.get', 'environ.get', (['"""REPIMG"""', 'genimgdir'], {}), "('REPIMG', genimgdir)\n", (1189, 1210), False, 'from stagedml.imports.sys import read_csv, OrderedDict, DataFrame, makedirs, json_dump, environ, contextmanager\n'), ((1212, 1246), 'stagedml.imports.sys.makedirs', 'm... |
from kepler import *
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import streamlit as st
import streamlit.components.v1 as components
test = keplerCalc()
el = test.ellipse()
x = el[0]
y = el[1]
def update_line(i, x,y ,line):
ax.patches = []
x = x[i]
y = y[i]
... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylim",
"streamlit.title",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.Circle",
"numpy.random.rand",
"matplotlib.pyplot.xlabel"
] | [((456, 468), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (466, 468), True, 'import matplotlib.pyplot as plt\n'), ((586, 607), 'numpy.random.rand', 'np.random.rand', (['(2)', '(25)'], {}), '(2, 25)\n', (600, 607), True, 'import numpy as np\n'), ((616, 670), 'matplotlib.pyplot.Circle', 'plt.Circle', (['(... |
from __future__ import annotations
import numpy as np
import pandas as pd
from sklearn import datasets
from IMLearn.metrics import mean_square_error
from IMLearn.utils import split_train_test
from IMLearn.model_selection import cross_validate
from IMLearn.learners.regressors import PolynomialFitting, LinearRegression, ... | [
"numpy.random.uniform",
"numpy.random.seed",
"IMLearn.learners.regressors.RidgeRegression",
"plotly.graph_objects.Figure",
"sklearn.datasets.load_diabetes",
"numpy.argmin",
"IMLearn.learners.regressors.PolynomialFitting",
"IMLearn.model_selection.cross_validate",
"IMLearn.utils.split_train_test",
... | [((1383, 1429), 'IMLearn.utils.split_train_test', 'split_train_test', (['X', 'y'], {'train_proportion': '(2 / 3)'}), '(X, y, train_proportion=2 / 3)\n', (1399, 1429), False, 'from IMLearn.utils import split_train_test\n'), ((1440, 1451), 'plotly.graph_objects.Figure', 'go.Figure', ([], {}), '()\n', (1449, 1451), True, ... |
import threading
import unittest
import tensorflow as tf
import numpy as np
import fedlearner.common.fl_logging as logging
from fedlearner.fedavg import train_from_keras_model
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train = x_train.reshape(x_train.shape[0], -1).astype(np.float32) /... | [
"unittest.main",
"threading.Thread",
"fedlearner.fedavg.train_from_keras_model",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.datasets.mnist.load_data",
"numpy.isclose",
"fedlearner.common.fl_logging.se... | [((216, 251), 'tensorflow.keras.datasets.mnist.load_data', 'tf.keras.datasets.mnist.load_data', ([], {}), '()\n', (249, 251), True, 'import tensorflow as tf\n'), ((3083, 3109), 'fedlearner.common.fl_logging.set_level', 'logging.set_level', (['"""debug"""'], {}), "('debug')\n", (3100, 3109), True, 'import fedlearner.com... |
#! /usr/bin/env python3
import os
import time
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm
from sklearn.datasets import make_blobs
from lib_dist_app import plt_data, nns
# ### do a loop for the number of dimensions and the values of p.
ti = time.time()
np.random.seed(0)
N = 601
n... | [
"matplotlib.pyplot.tight_layout",
"numpy.random.seed",
"lib_dist_app.nns",
"matplotlib.pyplot.close",
"sklearn.datasets.make_blobs",
"time.time",
"lib_dist_app.plt_data",
"numpy.mean",
"numpy.max",
"matplotlib.pyplot.subplots"
] | [((280, 291), 'time.time', 'time.time', ([], {}), '()\n', (289, 291), False, 'import time\n'), ((292, 309), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (306, 309), True, 'import numpy as np\n'), ((1880, 1973), 'sklearn.datasets.make_blobs', 'make_blobs', ([], {'n_samples': 'n_samples', 'centers': 'ce... |
from __future__ import print_function
import numpy as np
c0prop = np.array([4, -2, 0, 0, 5]) # Frosting
c1prop = np.array([0, 5, -1, 0, 8]) # Candy
c2prop = np.array([-1, 0, 5, 0, 6]) # Butterscotch
c3prop = np.array([0, 0, -2, 2, 1]) # Sugar
max_score = 0
max_500_score = 0
for c0 in range(101):
for c1 in... | [
"numpy.outer",
"numpy.array",
"numpy.arange",
"numpy.prod"
] | [((67, 93), 'numpy.array', 'np.array', (['[4, -2, 0, 0, 5]'], {}), '([4, -2, 0, 0, 5])\n', (75, 93), True, 'import numpy as np\n'), ((116, 142), 'numpy.array', 'np.array', (['[0, 5, -1, 0, 8]'], {}), '([0, 5, -1, 0, 8])\n', (124, 142), True, 'import numpy as np\n'), ((162, 188), 'numpy.array', 'np.array', (['[-1, 0, 5,... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 12 12:07:33 2020
@author: student
"""
import numpy as np
import tensorflow as tf
from base_functions import one_one
# File path for saving the tfrecords files
path = '/home/student/Work/Keras/GAN/mySRGAN/new_implementation/multiGPU_datasetAPI/cust... | [
"tensorflow.train.Int64List",
"tensorflow.reshape",
"matplotlib.pyplot.figure",
"tensorflow.train.FloatList",
"numpy.random.randn",
"matplotlib.pyplot.close",
"matplotlib.pyplot.imshow",
"tensorflow.io.decode_raw",
"base_functions.one_one",
"tensorflow.train.BytesList",
"numpy.save",
"tensorfl... | [((1597, 1640), 'tensorflow.keras.datasets.fashion_mnist.load_data', 'tf.keras.datasets.fashion_mnist.load_data', ([], {}), '()\n', (1638, 1640), True, 'import tensorflow as tf\n'), ((1693, 1720), 'numpy.expand_dims', 'np.expand_dims', (['x_train', '(-1)'], {}), '(x_train, -1)\n', (1707, 1720), True, 'import numpy as n... |
from scipy import linalg
import numpy as np
def error_norm(theta_star, theta_hat, norm='frobenius', scaling=True, squared=True):
""" sklearn Graphical LASSO """
# compute the error
error = theta_star - theta_hat
# compute the error norm
if norm == "frobenius":
squared_norm = np.sum(error *... | [
"numpy.dot",
"numpy.sum",
"numpy.sqrt"
] | [((306, 324), 'numpy.sum', 'np.sum', (['(error ** 2)'], {}), '(error ** 2)\n', (312, 324), True, 'import numpy as np\n'), ((769, 790), 'numpy.sqrt', 'np.sqrt', (['squared_norm'], {}), '(squared_norm)\n', (776, 790), True, 'import numpy as np\n'), ((400, 422), 'numpy.dot', 'np.dot', (['error.T', 'error'], {}), '(error.T... |
"""
Script that trains Tensorflow multitask models on PCBA dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import numpy as np
import shutil
from pcba_datasets import load_pcba
from deepchem.utils.save import load_from_disk
from deepch... | [
"pcba_datasets.load_pcba",
"deepchem.utils.evaluate.Evaluator",
"numpy.random.seed",
"deepchem.metrics.Metric"
] | [((577, 596), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (591, 596), True, 'import numpy as np\n'), ((640, 651), 'pcba_datasets.load_pcba', 'load_pcba', ([], {}), '()\n', (649, 651), False, 'from pcba_datasets import load_pcba\n'), ((723, 784), 'deepchem.metrics.Metric', 'Metric', (['metrics.roc... |
import numpy as np
import pandas as pd
def table_atm(h, parametr):
"""
Cтандартная атмосфера для высот h = -2000 м ... 80000 м (ГОСТ 4401-81)
arguments: h высота [м], parametr:
1 - температура [К];
2 - давление [Па];
3 -... | [
"pandas.read_csv",
"numpy.interp",
"numpy.sqrt"
] | [((611, 697), 'pandas.read_csv', 'pd.read_csv', (['"""data_constants/table_atm.csv"""'], {'names': "['h', 'p', 'rho', 'T']", 'sep': '""","""'}), "('data_constants/table_atm.csv', names=['h', 'p', 'rho', 'T'],\n sep=',')\n", (622, 697), True, 'import pandas as pd\n'), ((1934, 2008), 'pandas.read_csv', 'pd.read_csv', ... |
from tensorflow.keras import models
import numpy as np
# for using PIL, we have to add "Pillow" to requirements.txt
from PIL import Image
import io
from flask import jsonify, make_response
import json
import base64
import cv2 as cv
from google.cloud import storage
# Xception Fine Tuning モデルを読み込む( Global variable として定義... | [
"tensorflow.keras.models.load_model",
"numpy.argmax",
"cv2.imdecode",
"numpy.expand_dims",
"json.dumps",
"google.cloud.storage.Client",
"numpy.array",
"numpy.fromstring"
] | [((409, 425), 'google.cloud.storage.Client', 'storage.Client', ([], {}), '()\n', (423, 425), False, 'from google.cloud import storage\n'), ((622, 656), 'tensorflow.keras.models.load_model', 'models.load_model', (['"""/tmp/tmp.hdf5"""'], {}), "('/tmp/tmp.hdf5')\n", (639, 656), False, 'from tensorflow.keras import models... |
import sys, os
sys.path.append(os.path.abspath(__file__).split('test')[0])
import pandas as pd
import numpy as np
from pyml.supervised.linear_regression.LinearRegression import LinearRegression
"""
----------------------------------------------------------------------------------------------------------------------... | [
"numpy.matrix",
"os.path.abspath",
"numpy.concatenate",
"numpy.ravel",
"pandas.read_csv",
"pandas.get_dummies",
"numpy.ones",
"pyml.supervised.linear_regression.LinearRegression.LinearRegression"
] | [((894, 957), 'pandas.read_csv', 'pd.read_csv', (['"""../../../data/ex1data1.txt"""'], {'sep': '""","""', 'header': 'None'}), "('../../../data/ex1data1.txt', sep=',', header=None)\n", (905, 957), True, 'import pandas as pd\n'), ((2303, 2333), 'pyml.supervised.linear_regression.LinearRegression.LinearRegression', 'Linea... |
import unittest
import sys
sys.path.append('..')
from scipy.stats import hypergeom, fisher_exact
import numpy as np
from server.from_uniprot_get_go import create_all_go_map
from server.go_processing import process_ontology
from server.add_go_from_higherup import enrich_cnag_map
from server.cnag_list_to_go import find... | [
"sys.path.append",
"unittest.main",
"server.go_processing.process_ontology",
"numpy.array",
"server.add_go_from_higherup.enrich_cnag_map",
"server.from_uniprot_get_go.create_all_go_map"
] | [((28, 49), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (43, 49), False, 'import sys\n'), ((4986, 5001), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4999, 5001), False, 'import unittest\n'), ((576, 645), 'server.from_uniprot_get_go.create_all_go_map', 'create_all_go_map', (['"""test/t... |
"""
Test the CONMIN optimizer component
"""
import unittest
import numpy
# pylint: disable=F0401,E0611
from openmdao.main.api import Assembly, Component, VariableTree, set_as_top, Driver
from openmdao.main.datatypes.api import Float, Array, Str, VarTree
from openmdao.lib.casehandlers.api import ListCaseRecorder
from ... | [
"unittest.main",
"openmdao.main.api.Assembly",
"openmdao.main.datatypes.api.Str",
"openmdao.util.testutil.assert_rel_error",
"openmdao.main.interfaces.implements",
"openmdao.main.datatypes.api.Float",
"openmdao.util.decorators.add_delegate",
"openmdao.main.datatypes.api.Array",
"numpy.array",
"ope... | [((1529, 1565), 'openmdao.main.datatypes.api.Array', 'Array', ([], {'iotype': '"""in"""', 'low': '(-10)', 'high': '(99)'}), "(iotype='in', low=-10, high=99)\n", (1534, 1565), False, 'from openmdao.main.datatypes.api import Float, Array, Str, VarTree\n'), ((1574, 1610), 'openmdao.main.datatypes.api.Array', 'Array', (['[... |
# _SequenceGenerator.py
__module_name__ = "_SequenceGenerator.py"
__author__ = ", ".join(["<NAME>"])
__email__ = ", ".join(["<EMAIL>",])
# package imports #
# --------------- #
import numpy as np
def _set_weight_simplex(A=1, C=1, G=1, T=1):
"""
Change the composition of weights for sampling bases at r... | [
"numpy.array",
"numpy.random.choice"
] | [((653, 675), 'numpy.array', 'np.array', (['[A, C, G, T]'], {}), '([A, C, G, T])\n', (661, 675), True, 'import numpy as np\n'), ((1359, 1389), 'numpy.array', 'np.array', (["['A', 'C', 'G', 'T']"], {}), "(['A', 'C', 'G', 'T'])\n", (1367, 1389), True, 'import numpy as np\n'), ((2134, 2187), 'numpy.random.choice', 'np.ran... |
#!/usr/bin/env python
import sys
import argparse
import matplotlib
import numpy as np
import pandas as pd
matplotlib.use('Agg')
from pathlib import Path
import matplotlib.pyplot as plt
def get_ase(ase_fname):
"""parse the ASE TSV for the top n most promising str-tissue pairs"""
ase = pd.read_csv(
ase... | [
"numpy.poly1d",
"argparse.ArgumentParser",
"numpy.polyfit",
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.clf",
"numpy.var",
"matplotlib.pyplot.figure",
"matplotlib.use",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pypl... | [((106, 127), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (120, 127), False, 'import matplotlib\n'), ((296, 508), 'pandas.read_csv', 'pd.read_csv', (['ase_fname'], {'sep': '"""\t"""', 'header': '(0)', 'index_col': "['str', 'tissue']", 'usecols': "['str', 'tissue', 'chrom', 'str_pos', 'str_a1',... |
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from ez_torch.base_module import Module
from ez_torch.utils import get_uv_grid
def leaky(slope=0.2):
return nn.LeakyReLU(slope, inplace=True)
def conv_block(i, o, ks, s, p, a=leaky(), d=1, bn=True):
block = [nn... | [
"torch.nn.ConvTranspose2d",
"torch.nn.functional.grid_sample",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"numpy.prod",
"torch.nn.BatchNorm2d",
"ez_torch.utils.get_uv_grid",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"torch.tensor",
"torch.nn.Sigmoid"
] | [((212, 245), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (['slope'], {'inplace': '(True)'}), '(slope, inplace=True)\n', (224, 245), True, 'import torch.nn as nn\n'), ((493, 514), 'torch.nn.Sequential', 'nn.Sequential', (['*block'], {}), '(*block)\n', (506, 514), True, 'import torch.nn as nn\n'), ((920, 941), 'torch.nn.Seque... |
import tensorflow as tf
import numpy as np
x_data = np.array([
[0,0] , [0,1], [1,0], [1,1]
])
y_data = np.array([
[1,0], #0
[1,0], #0
[1,0], #0
[0,1] #1
])
X = tf.placeholder(tf.float32)
Y = tf.placeholder(tf.float32)
W = tf.Variable(tf.random_uniform([2, 2], -1., 1.))
b = tf.Variable(tf.zeros([2]))
model... | [
"tensorflow.random_uniform",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.placeholder",
"tensorflow.floor",
"tensorflow.zeros",
"numpy.array",
"tensorflow.cast",
"tensorflow.matmul",
"tensorflow.log",
"tensorflow.train.GradientDescentOptimizer"
] | [((54, 96), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [1, 0], [1, 1]]'], {}), '([[0, 0], [0, 1], [1, 0], [1, 1]])\n', (62, 96), True, 'import numpy as np\n'), ((108, 150), 'numpy.array', 'np.array', (['[[1, 0], [1, 0], [1, 0], [0, 1]]'], {}), '([[1, 0], [1, 0], [1, 0], [0, 1]])\n', (116, 150), True, 'import numpy ... |
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)
from __future__ import division
import numpy as np
import warnings
import random
from .external.da... | [
"p3iv_core.bindings.interaction_dataset.track_reader.track_reader",
"numpy.empty"
] | [((761, 864), 'p3iv_core.bindings.interaction_dataset.track_reader.track_reader', 'track_reader', (["configurations['map']", "configurations['dataset']", "configurations['track_file_number']"], {}), "(configurations['map'], configurations['dataset'],\n configurations['track_file_number'])\n", (773, 864), False, 'fro... |
#!python
# -*- coding: utf-8 -*-
#
# This software and supporting documentation are distributed by
# Institut Federatif de Recherche 49
# CEA/NeuroSpin, Batiment 145,
# 91191 Gif-sur-Yvette cedex
# France
#
# This software is governed by the CeCILL license version 2 under
# French law and abiding b... | [
"argparse.ArgumentParser",
"soma.aims.Volume",
"joblib.cpu_count",
"numpy.asarray",
"soma.aims.write",
"soma.aims.read",
"glob.glob",
"re.search"
] | [((2251, 2262), 'joblib.cpu_count', 'cpu_count', ([], {}), '()\n', (2260, 2262), False, 'from joblib import cpu_count\n'), ((2502, 2622), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""write_skeleton.py"""', 'description': '"""Generates bucket files converted from volume files"""'}), "(prog='wr... |
#!/usr/bin/python3
import sys
from nuscenes.nuscenes import NuScenes
import nuscenes.utils.geometry_utils as geoutils
from pyquaternion import Quaternion
import numpy as np
import os
import numpy.linalg as la
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage: ./nuscenes2kitti.py <dataset_fold... | [
"os.makedirs",
"nuscenes.nuscenes.NuScenes",
"os.path.exists",
"numpy.max",
"numpy.min",
"numpy.linalg.inv",
"pyquaternion.Quaternion",
"numpy.dot",
"os.path.join"
] | [((414, 476), 'nuscenes.nuscenes.NuScenes', 'NuScenes', ([], {'version': '"""v1.0-mini"""', 'dataroot': 'dataroot', 'verbose': '(True)'}), "(version='v1.0-mini', dataroot=dataroot, verbose=True)\n", (422, 476), False, 'from nuscenes.nuscenes import NuScenes\n'), ((1018, 1055), 'os.path.join', 'os.path.join', (['sys.arg... |
"""
Test the various utilities in serpentTools/utils.py
"""
from unittest import TestCase
from numpy import arange, ndarray, array, ones, ones_like, zeros_like
from numpy.testing import assert_array_equal
from serpentTools.utils import (
convertVariableName,
splitValsUncs,
str2vec,
getCommonKeys,
... | [
"numpy.zeros_like",
"numpy.ones_like",
"serpentTools.utils.formatPlot",
"numpy.testing.assert_array_equal",
"serpentTools.utils.splitValsUncs",
"numpy.ones",
"serpentTools.utils.directCompare",
"tests.plotAttrTest",
"serpentTools.utils.getOverlaps",
"serpentTools.utils.getCommonKeys",
"serpentTo... | [((9305, 9312), 'numpy.ones', 'ones', (['(4)'], {}), '(4)\n', (9309, 9312), False, 'from numpy import arange, ndarray, array, ones, ones_like, zeros_like\n'), ((9345, 9370), 'numpy.array', 'array', (['[0, 0.2, 0.1, 0.2]'], {}), '([0, 0.2, 0.1, 0.2])\n', (9350, 9370), False, 'from numpy import arange, ndarray, array, on... |
# Filename: ahrs.py
# -*- coding: utf-8 -*-
# pylint: disable=locally-disabled
"""
AHRS calibration.
"""
import io
from collections import defaultdict
import time
import xml.etree.ElementTree as ET
import km3db
import numpy as np
from numpy import cos, sin, arctan2
import km3pipe as kp
from km3pipe.tools import tim... | [
"km3db.CLBMap",
"io.BytesIO",
"numpy.arctan2",
"io.StringIO",
"numpy.degrees",
"numpy.median",
"km3pipe.logger.get_logger",
"km3db.DBManager",
"collections.defaultdict",
"time.time",
"km3pipe.tools.timed_cache",
"numpy.sin",
"numpy.array",
"numpy.cos",
"km3db.tools.clbupi2compassupi",
... | [((444, 474), 'km3pipe.logger.get_logger', 'kp.logger.get_logger', (['__name__'], {}), '(__name__)\n', (464, 474), True, 'import km3pipe as kp\n'), ((4368, 4415), 'km3pipe.tools.timed_cache', 'timed_cache', ([], {'hours': '(1)', 'maxsize': 'None', 'typed': '(False)'}), '(hours=1, maxsize=None, typed=False)\n', (4379, 4... |
import topas2numpy as t2np
import numpy as np
import os
######################
os.chdir("/home/ethanb/TOPAS/Linac_Model/output/PDD")
######################
cyl1 = t2np.BinnedResult("../../mac/PDDCyl.csv")
depth = np.flip(cyl1.dimensions[2].get_bin_centers())
files = {}
for filename in os.listdir():
print(file... | [
"topas2numpy.BinnedResult",
"os.stat",
"numpy.asarray",
"numpy.savetxt",
"os.chdir",
"numpy.squeeze",
"os.listdir"
] | [((81, 134), 'os.chdir', 'os.chdir', (['"""/home/ethanb/TOPAS/Linac_Model/output/PDD"""'], {}), "('/home/ethanb/TOPAS/Linac_Model/output/PDD')\n", (89, 134), False, 'import os\n'), ((167, 208), 'topas2numpy.BinnedResult', 't2np.BinnedResult', (['"""../../mac/PDDCyl.csv"""'], {}), "('../../mac/PDDCyl.csv')\n", (184, 208... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020 <NAME>
# Licensed under the MIT License
"""Main module for applying zreion function."""
import warnings
import numpy as np
import pyfftw
from . import _zreion
# define constants
b0 = 1.0 / 1.686
def tophat(x):
"""
Compute spherical tophat Fourier window functio... | [
"numpy.meshgrid",
"numpy.ones_like",
"warnings.simplefilter",
"numpy.abs",
"numpy.fft.irfftn",
"numpy.fft.rfftn",
"pyfftw.empty_aligned",
"numpy.fft.rfftfreq",
"numpy.fft.fftfreq",
"numpy.sin",
"warnings.catch_warnings",
"pyfftw.FFTW",
"numpy.cos",
"numpy.float64",
"numpy.sqrt"
] | [((4212, 4284), 'pyfftw.empty_aligned', 'pyfftw.empty_aligned', (['padded_shape', 'input_dtype'], {'n': 'pyfftw.simd_alignment'}), '(padded_shape, input_dtype, n=pyfftw.simd_alignment)\n', (4232, 4284), False, 'import pyfftw\n'), ((6634, 6655), 'numpy.fft.rfftn', 'np.fft.rfftn', (['density'], {}), '(density)\n', (6646,... |
import tensorflow as tf
import tensorflow_probability as tfp
import numpy as np
import src.utils as utils
def gaussian_d(x, y):
"""
A conceptual lack of understanding here.
Do I need a dx to calculate this over?
Doesnt make sense for a single point!?
"""
d = tf.norm(x - y, axis=1)
return tf... | [
"numpy.pad",
"tensorflow.nn.relu",
"tensorflow.keras.layers.Conv2D",
"tensorflow.abs",
"tensorflow.losses.mean_squared_error",
"tensorflow.enable_eager_execution",
"tensorflow.zeros_like",
"tensorflow.constant",
"tensorflow.keras.layers.Activation",
"tensorflow.exp",
"tensorflow.random_normal",
... | [((284, 306), 'tensorflow.norm', 'tf.norm', (['(x - y)'], {'axis': '(1)'}), '(x - y, axis=1)\n', (291, 306), True, 'import tensorflow as tf\n'), ((4033, 4060), 'tensorflow.enable_eager_execution', 'tf.enable_eager_execution', ([], {}), '()\n', (4058, 4060), True, 'import tensorflow as tf\n'), ((4069, 4103), 'tensorflow... |
# ===============================================================================
# Copyright 2014 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | [
"pychron.graph.time_series_graph.TimeSeriesStackedGraph",
"traits.api.Instance",
"numpy.array",
"os.path.join",
"pychron.core.helpers.filetools.fileiter"
] | [((1282, 1297), 'traits.api.Instance', 'Instance', (['Graph'], {}), '(Graph)\n', (1290, 1297), False, 'from traits.api import HasTraits, Instance\n'), ((1336, 1394), 'os.path.join', 'os.path.join', (['paths.spectrometer_scans_dir', '"""scan-005.txt"""'], {}), "(paths.spectrometer_scans_dir, 'scan-005.txt')\n", (1348, 1... |
import os
import torch
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torch.utils.tensorboard import SummaryWriter
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns
import sklearn
from sklearn.model_selection import train_test_split
fro... | [
"os.path.abspath",
"torch.nn.MSELoss",
"torch.utils.data.DataLoader",
"torch.nn.ModuleList",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.MinMaxScaler",
"torch.clamp",
"torch.cuda.is_available",
"numpy.array",
"torch.utils.tensorboard.SummaryWriter",
"t... | [((497, 540), 'os.path.abspath', 'os.path.abspath', (["(__file__ + '/../vis_data/')"], {}), "(__file__ + '/../vis_data/')\n", (512, 540), False, 'import os\n'), ((1918, 1953), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {'feature_range': '(-1, 1)'}), '(feature_range=(-1, 1))\n', (1930, 1953), False, 'fro... |
import sys
import random
import numpy as np
from numpy.random import randn
sys.path.append('../DescriptiveStatisticsFunction')
sys.path.append('../HelperFunctions')
from HelperFunctions.HelperFunctions import lib_mean
from HelperFunctions.HelperFunctions import lib_median
from HelperFunctions.HelperFunctions import lib... | [
"DescriptiveStatisticsFunction.DescriptiveStatisticsFunction.created_median",
"DescriptiveStatisticsFunction.DescriptiveStatisticsFunction.created_quartile",
"DescriptiveStatisticsFunction.DescriptiveStatisticsFunction.created_skewness",
"HelperFunctions.HelperFunctions.lib_zscore",
"DescriptiveStatisticsFu... | [((75, 126), 'sys.path.append', 'sys.path.append', (['"""../DescriptiveStatisticsFunction"""'], {}), "('../DescriptiveStatisticsFunction')\n", (90, 126), False, 'import sys\n'), ((127, 164), 'sys.path.append', 'sys.path.append', (['"""../HelperFunctions"""'], {}), "('../HelperFunctions')\n", (142, 164), False, 'import ... |
from abc import ABC, abstractmethod
from multiprocessing import Pool
from shutil import rmtree
from time import time
import numpy as np
import os
import progressbar
import pysam
import pysamstats
class PileupGenerator(ABC):
"""
Base class for generating pileups from read alignments.
Usage:
X, y ... | [
"numpy.save",
"os.makedirs",
"numpy.argmax",
"pysam.AlignmentFile",
"os.path.exists",
"time.time",
"numpy.max",
"multiprocessing.Pool",
"shutil.rmtree",
"pysamstats.stat_variation",
"progressbar.ProgressBar",
"numpy.concatenate"
] | [((6509, 6548), 'pysam.AlignmentFile', 'pysam.AlignmentFile', (['self.bam_file_path'], {}), '(self.bam_file_path)\n', (6528, 6548), False, 'import pysam\n'), ((9409, 9448), 'pysam.AlignmentFile', 'pysam.AlignmentFile', (['self.bam_file_path'], {}), '(self.bam_file_path)\n', (9428, 9448), False, 'import pysam\n'), ((153... |
import numpy as np
class Method:
def __call__(self, x):
raise NotImplementedError()
def disable(self, index, x):
raise NotImplementedError
def __repr__(self):
raise NotImplementedError
class Max(Method):
def __call__(self, x):
return x.argmax()
def disable(self... | [
"numpy.argpartition",
"numpy.arange",
"numpy.sum",
"numpy.ravel"
] | [((848, 859), 'numpy.ravel', 'np.ravel', (['x'], {}), '(x)\n', (856, 859), True, 'import numpy as np\n'), ((905, 922), 'numpy.arange', 'np.arange', (['x.size'], {}), '(x.size)\n', (914, 922), True, 'import numpy as np\n'), ((1174, 1191), 'numpy.arange', 'np.arange', (['x.size'], {}), '(x.size)\n', (1183, 1191), True, '... |
import numpy as np
from scipy import interpolate
from scipy.ndimage import gaussian_filter
import functools
from . import mdfmodels, fast_mdfmodels
import dynesty as dy
from dynesty import plotting as dyplot
"""
TODO: figure out how to deal with error bars.
Do I just have to hierarchical inference it?
"""
def ptfor... | [
"functools.partial",
"dynesty.DynamicNestedSampler",
"numpy.sum"
] | [((513, 524), 'numpy.sum', 'np.sum', (['lnp'], {}), '(lnp)\n', (519, 524), True, 'import numpy as np\n'), ((653, 705), 'functools.partial', 'functools.partial', (['lnlkhd_leaky_box'], {'fehdata': 'fehdata'}), '(lnlkhd_leaky_box, fehdata=fehdata)\n', (670, 705), False, 'import functools\n'), ((831, 889), 'dynesty.Dynami... |
import numpy as np
import os
import numpy as np
import math
import matplotlib as mpl
mpl.rcParams.update({
"axes.titlesize" : "medium"
})
import matplotlib.pyplot as plt
plt.rcParams.update({
"pgf.texsystem": "pdflatex",
"pgf.preamble": [
r"\usepackage[utf8x]{inputenc}",
r"\usepackage[... | [
"numpy.load",
"matplotlib.pyplot.show",
"matplotlib.rcParams.update",
"numpy.square",
"numpy.min",
"matplotlib.pyplot.rcParams.update",
"numpy.mean",
"numpy.max",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((88, 137), 'matplotlib.rcParams.update', 'mpl.rcParams.update', (["{'axes.titlesize': 'medium'}"], {}), "({'axes.titlesize': 'medium'})\n", (107, 137), True, 'import matplotlib as mpl\n'), ((178, 313), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'pgf.texsystem': 'pdflatex', 'pgf.preamble': [\n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.