code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
#importing
import pandas as pd
import os
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import argparse
import csv
## parsing arguments
parser = argparse.ArgumentParser()
parser.add_argument("-n", "--nbins", type=int, help="The number of bins to divide each gene into")
parser.add_argument("-i... | [
"matplotlib.pyplot.title",
"os.mkdir",
"argparse.ArgumentParser",
"pandas.read_csv",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure",
"numpy.histogram",
"os.path.join",
"numpy.unique",
"csv.DictWriter",
"numpy.std",
"matplotlib.pyplot.close",
"matplotlib.pyplot.semilogy",
"matplo... | [((172, 197), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (195, 197), False, 'import argparse\n'), ((5090, 5120), 'os.path.join', 'os.path.join', (['OUT_DIR', 'TMP_DIR'], {}), '(OUT_DIR, TMP_DIR)\n', (5102, 5120), False, 'import os\n'), ((6074, 6105), 'numpy.average', 'np.average', (['total_... |
import sys
import numpy as np
import torch
import torch.nn as nn
class Net(nn.Module):
def __init__(self, state, event):
super().__init__()
self.event = event
self.state = state
self.fc = nn.Linear(1, 1)
self.welford = self.event.Welford()
self.state["net"] = self
... | [
"torch.set_printoptions",
"numpy.prod",
"sys.exit",
"torch.nn.Linear"
] | [((772, 822), 'torch.set_printoptions', 'torch.set_printoptions', ([], {'precision': '(8)', 'linewidth': '(120)'}), '(precision=8, linewidth=120)\n', (794, 822), False, 'import torch\n'), ((985, 996), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (993, 996), False, 'import sys\n'), ((226, 241), 'torch.nn.Linear', 'nn... |
import tensorflow as tf
from config import *
from networks import vgg16, FormResNet
from ops import sobel
import os,csv
from PIL import Image
import numpy as np
from skimage.measure import compare_psnr as psnr
from skimage.measure import compare_ssim as ssim
from skimage import util
class Main:
def __init__(self)... | [
"numpy.uint8",
"networks.vgg16",
"csv.writer",
"tensorflow.train.Saver",
"numpy.random.shuffle",
"ops.sobel",
"tensorflow.Session",
"numpy.zeros",
"numpy.clip",
"PIL.Image.open",
"tensorflow.placeholder",
"networks.FormResNet",
"tensorflow.square",
"numpy.random.normal",
"tensorflow.trai... | [((347, 400), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, None, None, IMG_C]'], {}), '(tf.float32, [None, None, None, IMG_C])\n', (361, 400), True, 'import tensorflow as tf\n'), ((427, 480), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, None, None, IMG_C]'], {}), '(tf.float... |
"""
This module provides the core object-oriented framework for generating
synthetic data sets with clusters. The classes contained here are mainly
abstract superclasses. They require subclasses to concretely implement
much of the specified functionality.
CLASSES AND METHODS
ClusterData : top-level object for gen... | [
"numpy.random.seed",
"scipy.spatial.distance.mahalanobis",
"numpy.mean",
"numpy.random.randint",
"numpy.arange",
"numpy.random.normal",
"matplotlib.pyplot.gca",
"numpy.sin",
"numpy.full",
"numpy.std",
"numpy.savetxt",
"numpy.transpose",
"numpy.max",
"scipy.stats.ortho_group.rvs",
"numpy.... | [((11365, 11385), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (11379, 11385), True, 'import numpy as np\n'), ((14294, 14341), 'scipy.stats.ortho_group.rvs', 'stats.ortho_group.rvs', (['n_dim'], {'random_state': 'seed'}), '(n_dim, random_state=seed)\n', (14315, 14341), True, 'import scipy.stats as... |
import os
from tqdm import tqdm
from datetime import datetime
import pandas as pd
import numpy as np
from scipy.io import wavfile
import tensorflow as tf
from tensorflow.keras.layers import Conv2D, MaxPool2D, Flatten
from tensorflow.keras.layers import LSTM, TimeDistributed
from tensorflow.keras.layers import Dropout, ... | [
"numpy.argmax",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"tensorflow.keras.layers.Dense",
"datetime.datetime.datetime.now",
"tensorflow.keras.callbacks.ModelCheckpoint",
"scipy.io.wavfile.read",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.keras.models.Sequential",
"numpy... | [((2472, 2491), 'cfg.Config', 'Config', ([], {'mode': '"""conv"""'}), "(mode='conv')\n", (2478, 2491), False, 'from cfg import Config\n'), ((2502, 2561), 'pandas.read_csv', 'pd.read_csv', (['"""data/train/roadsound_labels.csv"""'], {'index_col': '(0)'}), "('data/train/roadsound_labels.csv', index_col=0)\n", (2513, 2561... |
# Author: <NAME>
# License: BSD
import numpy as np
from seglearn.datasets import load_watch
from seglearn.base import TS_Data
from seglearn import util
def test_util():
df = load_watch()
data = TS_Data(df['X'], df['side'])
Xt, Xc = util.get_ts_data_parts(data)
assert np.array_equal(Xc, df['side'])... | [
"seglearn.base.TS_Data",
"seglearn.util.check_ts_data",
"seglearn.util.ts_stats",
"seglearn.util.get_ts_data_parts",
"seglearn.datasets.load_watch",
"numpy.array_equal"
] | [((182, 194), 'seglearn.datasets.load_watch', 'load_watch', ([], {}), '()\n', (192, 194), False, 'from seglearn.datasets import load_watch\n'), ((207, 235), 'seglearn.base.TS_Data', 'TS_Data', (["df['X']", "df['side']"], {}), "(df['X'], df['side'])\n", (214, 235), False, 'from seglearn.base import TS_Data\n'), ((249, 2... |
# 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 typing import Any, Dict, Optional
import numpy as np
from synthetic_problems import (
Branin1DEmbedding,
Branin2DBase,
Hartm... | [
"synthetic_problems.Hartmann6DBase",
"numpy.arange",
"numpy.ones",
"synthetic_problems.Branin2DBase"
] | [((1242, 1329), 'synthetic_problems.Branin2DBase', 'Branin2DBase', ([], {'context_name_list': 'context_name_list', 'context_weights': 'context_weights'}), '(context_name_list=context_name_list, context_weights=\n context_weights)\n', (1254, 1329), False, 'from synthetic_problems import Branin1DEmbedding, Branin2DBas... |
import random
import numpy as np
def int_to_bin(number: int, length=8) -> str:
b = bin(number)[2:]
return ('0' * (-len(b) % length)) + b
def bin_to_int(number: str) -> int:
return int(number, base=2)
def random_string(length=8):
return ''.join([chr(random.randint(0, 127)) for _ in range(length)])... | [
"numpy.array",
"random.randint",
"numpy.prod",
"numpy.ravel"
] | [((722, 738), 'numpy.prod', 'np.prod', (['I.shape'], {}), '(I.shape)\n', (729, 738), True, 'import numpy as np\n'), ((2411, 2422), 'numpy.array', 'np.array', (['B'], {}), '(B)\n', (2419, 2422), True, 'import numpy as np\n'), ((2452, 2463), 'numpy.array', 'np.array', (['R'], {}), '(R)\n', (2460, 2463), True, 'import num... |
"""Use of Bertran to calculate sparse segments."""
import numpy as np
import chaospy as cp
def sparse_segment(cords):
r"""
Create a segment of a sparse grid.
Convert a ol-index to sparse grid coordinates on ``[0, 1]^N`` hyper-cube.
A sparse grid of order ``D`` coencide with the set of sparse_segments... | [
"numpy.array",
"numpy.prod"
] | [((1165, 1180), 'numpy.array', 'np.array', (['cords'], {}), '(cords)\n', (1173, 1180), True, 'import numpy as np\n'), ((1336, 1359), 'numpy.prod', 'np.prod', (['grid.shape[1:]'], {}), '(grid.shape[1:])\n', (1343, 1359), True, 'import numpy as np\n')] |
import ipinfo
import numpy as np
import re
from rich.console import Console
from rich.table import Column, Table
import sys
import time
IPINFO_TOKEN = "<PASSWORD>_TOKEN"
def parse_line(line: str):
regex = r'[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z CLOSE host=([a-zA-Z0-9]{0,4}:[a-zA-Z0-9]{... | [
"numpy.median",
"numpy.std",
"numpy.mean",
"rich.console.Console",
"re.search",
"rich.table.Table",
"ipinfo.getHandler"
] | [((515, 552), 're.search', 're.search', (['regex', 'line', 're.IGNORECASE'], {}), '(regex, line, re.IGNORECASE)\n', (524, 552), False, 'import re\n'), ((825, 856), 'ipinfo.getHandler', 'ipinfo.getHandler', (['IPINFO_TOKEN'], {}), '(IPINFO_TOKEN)\n', (842, 856), False, 'import ipinfo\n'), ((2220, 2241), 'numpy.median', ... |
import numpy as np
from utils.distributions import bernoulli
# ----------------------------------------------------------------------------------------------------------------------
class Recombination(object):
def __init__(self):
pass
def recombination(self, x):
pass
# --------------------... | [
"numpy.random.permutation",
"numpy.arange",
"utils.distributions.bernoulli",
"numpy.clip"
] | [((970, 991), 'numpy.arange', 'np.arange', (['x.shape[0]'], {}), '(x.shape[0])\n', (979, 991), True, 'import numpy as np\n'), ((1107, 1140), 'numpy.random.permutation', 'np.random.permutation', (['x.shape[0]'], {}), '(x.shape[0])\n', (1128, 1140), True, 'import numpy as np\n'), ((1220, 1253), 'numpy.random.permutation'... |
from __future__ import annotations
from typing import Optional
import numpy as np
from .transformation import Transformation
class TransformationWithCovariance(Transformation):
"""Light weight transformation class with added covariance propagation."""
def __init__(self,
*,
tran_w_... | [
"numpy.zeros_like",
"numpy.zeros"
] | [((1403, 1419), 'numpy.zeros', 'np.zeros', (['(6, 6)'], {}), '((6, 6))\n', (1411, 1419), True, 'import numpy as np\n'), ((2260, 2303), 'numpy.zeros_like', 'np.zeros_like', (['*self._C_ba.shape[:-2]', '(6)', '(6)'], {}), '(*self._C_ba.shape[:-2], 6, 6)\n', (2273, 2303), True, 'import numpy as np\n')] |
# <NAME>
# 17CS30033
# The functions are written in the order of the questions and solution to, for example 1a is named as _1a_plot
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from copy import copy
import json
# loading training data
try:
train_data = pd.read_csv('train.csv')
excep... | [
"pandas.DataFrame",
"json.dump",
"matplotlib.pyplot.title",
"json.load",
"matplotlib.pyplot.show",
"numpy.sum",
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"numpy.power",
"numpy.zeros",
"numpy.ones",
"copy.copy",
"numpy.array",
"numpy.dot",
"matplotlib.pyplot.ylabel",
"matplotlib.p... | [((290, 314), 'pandas.read_csv', 'pd.read_csv', (['"""train.csv"""'], {}), "('train.csv')\n", (301, 314), True, 'import pandas as pd\n'), ((560, 583), 'pandas.read_csv', 'pd.read_csv', (['"""test.csv"""'], {}), "('test.csv')\n", (571, 583), True, 'import pandas as pd\n'), ((6868, 6882), 'matplotlib.pyplot.subplots', 'p... |
import h5py
from tqdm import tqdm
import librosa
import numpy as np
from keras.utils.np_utils import to_categorical
from sklearn.utils import shuffle
import cv2
import torch
germanBats = {
"Rhinolophus ferrumequinum": 0,
"Rhinolophus hipposideros": 1,
"Myotis daubentonii": 2,
"Myotis brandtii": 3,
... | [
"h5py.File",
"librosa.util.peak_pick",
"numpy.asarray",
"numpy.mean",
"sklearn.utils.shuffle",
"cv2.resize"
] | [((1306, 1334), 'numpy.mean', 'np.mean', (['spectrogram'], {'axis': '(1)'}), '(spectrogram, axis=1)\n', (1313, 1334), True, 'import numpy as np\n'), ((1376, 1473), 'librosa.util.peak_pick', 'librosa.util.peak_pick', (['env'], {'pre_max': '(3)', 'post_max': '(5)', 'pre_avg': '(3)', 'post_avg': '(5)', 'delta': '(0.6)', '... |
# 隐马尔可夫模型
# 2020/09/27
import re
import jieba
import numpy as np
def trainParameter(filename):
"""
依据训练文本统计 PI, A, B
:param filename: 训练文本
:return: 模型参数
"""
statusDict = {'B': 0, 'M': 1, 'E': 2, 'S': 3}
# 初始化模型参数
PI = np.zeros(4)
A = np.zeros((4, 4))
B = np.z... | [
"jieba.cut",
"numpy.log",
"numpy.zeros",
"numpy.sum"
] | [((269, 280), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (277, 280), True, 'import numpy as np\n'), ((290, 306), 'numpy.zeros', 'np.zeros', (['(4, 4)'], {}), '((4, 4))\n', (298, 306), True, 'import numpy as np\n'), ((316, 336), 'numpy.zeros', 'np.zeros', (['(4, 65536)'], {}), '((4, 65536))\n', (324, 336), True,... |
import threading
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import models
import cv2
import numpy as np
import matplotlib.pyplot as plt
import math
import random
import tkinter as tk
##### Input trainned model #####
model = keras.models.load_model('mnist_model1.h5')
model2 ... | [
"tkinter.StringVar",
"cv2.GaussianBlur",
"tkinter.Text",
"cv2.erode",
"tkinter.Label",
"cv2.dilate",
"tkinter.Button",
"cv2.cvtColor",
"matplotlib.pyplot.imshow",
"tkinter.Entry",
"cv2.imwrite",
"numpy.reshape",
"tkinter.Tk",
"cv2.resize",
"cv2.Canny",
"tensorflow.keras.models.load_mod... | [((269, 311), 'tensorflow.keras.models.load_model', 'keras.models.load_model', (['"""mnist_model1.h5"""'], {}), "('mnist_model1.h5')\n", (292, 311), False, 'from tensorflow import keras\n'), ((322, 363), 'tensorflow.keras.models.load_model', 'keras.models.load_model', (['"""alpha_model.h5"""'], {}), "('alpha_model.h5')... |
# Copyright 2021 <NAME>
# SPDX-License-Identifier: Apache-2.0
'colorex numpy'
import numpy as np
from colorex.cex_constants import (
REC_709_LUMA_WEIGHTS,
MAX_COMPONENT_VALUE,
SMALL_COMPONENT_VALUE,
M_RGB_TO_XYZ_T,
M_XYZ_TO_RGB_T,
D50_TO_D65_T,
)
def gamma_correct(values, gamma):
'apply a g... | [
"numpy.stack",
"numpy.power",
"numpy.matmul",
"numpy.clip"
] | [((392, 415), 'numpy.power', 'np.power', (['values', 'gamma'], {}), '(values, gamma)\n', (400, 415), True, 'import numpy as np\n'), ((1184, 1226), 'numpy.power', 'np.power', (['((arr[mask] + 0.055) / 1.055)', '(2.4)'], {}), '((arr[mask] + 0.055) / 1.055, 2.4)\n', (1192, 1226), True, 'import numpy as np\n'), ((1437, 149... |
#!/usr/bin/env python
import sys
from cvangysel import argparse_utils, logging_utils, sklearn_utils, trec_utils
from sert import inference, math_utils, models
import argparse
import collections
import io
import logging
import numpy as np
import os
import operator
import pickle
import scipy
import scipy.spatial
impor... | [
"numpy.sum",
"argparse.ArgumentParser",
"collections.defaultdict",
"numpy.argsort",
"pickle.load",
"numpy.linalg.norm",
"logging.error",
"logging.warning",
"cvangysel.trec_utils.write_run",
"cvangysel.sklearn_utils.neighbors_algorithm",
"scipy.spatial.distance.cdist",
"os.path.basename",
"cv... | [((387, 412), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (410, 412), False, 'import argparse\n'), ((1883, 1915), 'cvangysel.trec_utils.parse_topics', 'trec_utils.parse_topics', (['topic_f'], {}), '(topic_f)\n', (1906, 1915), False, 'from cvangysel import argparse_utils, logging_utils, sklea... |
import numpy as np
rslt_binomial_0 = np.array([0, 6.618737, 0.004032037, 0.01433665, 0.01265635,
0.006173346, 0.01067706])
rslt_binomial_1 = np.array([0, 1.029661, 0.02180239, 0.07769613, 0.06756466,
0.03156418, 0.05851878])
rslt_binomial_2 = np.array([0, 0.160... | [
"numpy.array"
] | [((38, 128), 'numpy.array', 'np.array', (['[0, 6.618737, 0.004032037, 0.01433665, 0.01265635, 0.006173346, 0.01067706]'], {}), '([0, 6.618737, 0.004032037, 0.01433665, 0.01265635, 0.006173346, \n 0.01067706])\n', (46, 128), True, 'import numpy as np\n'), ((171, 259), 'numpy.array', 'np.array', (['[0, 1.029661, 0.021... |
import matplotlib.patches as mpatches
from nilearn import plotting, image, datasets
from nilearn.input_data import NiftiSpheresMasker
from nilearn.connectome import ConnectivityMeasure
import numpy as np
import pandas as pd
from common.paths import POWER
POWER_NUM_NODES = 264
POWER_DATASET = datasets.fetch_coords_pow... | [
"nilearn.connectome.ConnectivityMeasure",
"pandas.read_csv",
"nilearn.input_data.NiftiSpheresMasker",
"nilearn.datasets.fetch_coords_power_2011",
"numpy.zeros",
"numpy.triu_indices",
"numpy.array",
"numpy.triu_indices_from",
"matplotlib.patches.Patch",
"numpy.vstack"
] | [((295, 329), 'nilearn.datasets.fetch_coords_power_2011', 'datasets.fetch_coords_power_2011', ([], {}), '()\n', (327, 329), False, 'from nilearn import plotting, image, datasets\n'), ((449, 484), 'pandas.read_csv', 'pd.read_csv', (['POWER'], {'index_col': '"""ROI"""'}), "(POWER, index_col='ROI')\n", (460, 484), True, '... |
"""
Unit tests for PowerExpansion class
"""
__author__ = '<NAME>'
import unittest
import numpy as np
from scipy.special import sph_harm
import onsager.PowerExpansion as PE
T3D = PE.Taylor3D
T2D = PE.Taylor2D
class PowerExpansionTests(unittest.TestCase):
"""Tests to make sure our power expansions are constructed... | [
"scipy.special.sph_harm",
"numpy.random.uniform",
"numpy.abs",
"numpy.tensordot",
"numpy.allclose",
"numpy.zeros",
"numpy.sin",
"numpy.array",
"numpy.exp",
"numpy.linspace",
"numpy.cos",
"numpy.dot",
"numpy.eye",
"onsager.PowerExpansion.factorial",
"numpy.sqrt"
] | [((20126, 20150), 'numpy.exp', 'np.exp', (['(1.0j * l * theta)'], {}), '(1.0j * l * theta)\n', (20132, 20150), True, 'import numpy as np\n'), ((5139, 5176), 'numpy.array', 'np.array', (['[[-4.2, 2.67], [1.3, 3.21]]'], {}), '([[-4.2, 2.67], [1.3, 3.21]])\n', (5147, 5176), True, 'import numpy as np\n'), ((12788, 12824), ... |
# -*- coding: utf-8 -*-
"""
author: <NAME>
"""
import numpy as np
import imageio
class MNISTImageReader():
"""
brief: read image data from .idx3-ubyte file as numpy array
use cases:
# case 1
with MNISTImageReader('t10k-images.idx3-ubyte') as reader:
# the reader was designed as... | [
"numpy.frombuffer"
] | [((2822, 2867), 'numpy.frombuffer', 'np.frombuffer', (['raw_image_data'], {'dtype': 'np.uint8'}), '(raw_image_data, dtype=np.uint8)\n', (2835, 2867), True, 'import numpy as np\n'), ((6043, 6088), 'numpy.frombuffer', 'np.frombuffer', (['raw_label_data'], {'dtype': 'np.uint8'}), '(raw_label_data, dtype=np.uint8)\n', (605... |
"""
MIT License
Copyright (c) 2019 Chodera lab // Memorial Sloan Kettering Cancer Center,
Weill Cornell Medical College, Nicea Research, and Authors
Authors:
<NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to de... | [
"tensorflow.keras.layers.Dense",
"pandas.read_csv",
"sklearn.metrics.r2_score",
"tensorflow.reshape",
"gin.probabilistic.gn.GraphNet.batch",
"numpy.mean",
"lime.nets.for_gn.ConcatenateThenFullyConnect",
"tensorflow.one_hot",
"numpy.std",
"tensorflow.concat",
"tensorflow.keras.optimizers.Adam",
... | [((1353, 1390), 'pandas.read_csv', 'pd.read_csv', (['"""data/Lipophilicity.csv"""'], {}), "('data/Lipophilicity.csv')\n", (1364, 1390), True, 'import pandas as pd\n'), ((2069, 2130), 'gin.i_o.from_smiles.to_mols_with_attributes', 'gin.i_o.from_smiles.to_mols_with_attributes', (['x_array', 'y_array'], {}), '(x_array, y_... |
import sys
import os.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.modules[__name__].__file__), "..")))
import matplotlib.pyplot as plt
import numpy as np
from sklearn.neighbors import KernelDensity
from tensorflow.python.keras.datasets import mnist
from data.data_handler import ProcessedNNHan... | [
"data.data_handler.ProcessedNNHandler",
"matplotlib.pyplot.show",
"sklearn.neighbors.KernelDensity",
"numpy.zeros",
"numpy.array",
"tensorflow.python.keras.datasets.mnist.load_data",
"matplotlib.pyplot.rc",
"numpy.linspace",
"matplotlib.pyplot.subplots_adjust",
"numpy.exp",
"matplotlib.pyplot.su... | [((2940, 2958), 'evaluation.create_plot.save_plot', 'save_plot', (['"""mnist"""'], {}), "('mnist')\n", (2949, 2958), False, 'from evaluation.create_plot import save_plot\n'), ((2960, 2970), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2968, 2970), True, 'import matplotlib.pyplot as plt\n'), ((431, 454), 'ma... |
import numpy as np
import pysam
import utils
import pdb
MIN_MAP_QUAL = 10
class Genome():
def __init__(self, fasta_filename, map_filename):
self._seq_handle = pysam.FastaFile(fasta_filename)
self._map_handles = [pysam.TabixFile(map_filename+'_%d.gz'%r)
for r in utils... | [
"pysam.FastaFile",
"pysam.TabixFile",
"numpy.zeros",
"utils.make_complement",
"numpy.array"
] | [((175, 206), 'pysam.FastaFile', 'pysam.FastaFile', (['fasta_filename'], {}), '(fasta_filename)\n', (190, 206), False, 'import pysam\n'), ((5431, 5464), 'pysam.TabixFile', 'pysam.TabixFile', (["(filename + '.gz')"], {}), "(filename + '.gz')\n", (5446, 5464), False, 'import pysam\n'), ((6353, 6375), 'numpy.array', 'np.a... |
import cv2
import numpy as np
from nnga.inference.base_predictor import BasePredictor
from nnga.utils.data_manipulation import adjust_image_shape, normalize_image
class SegmentationPredictor(BasePredictor):
"""Image predictor to NNGA models
Parameters
----------
model_dir : {str}
Path... | [
"cv2.threshold",
"nnga.utils.data_manipulation.adjust_image_shape",
"numpy.array"
] | [((1045, 1088), 'nnga.utils.data_manipulation.adjust_image_shape', 'adjust_image_shape', (['inpt', 'self._image_shape'], {}), '(inpt, self._image_shape)\n', (1063, 1088), False, 'from nnga.utils.data_manipulation import adjust_image_shape, normalize_image\n'), ((1738, 1794), 'cv2.threshold', 'cv2.threshold', (['predcit... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from scipy.interpolate import interp1d
from scipy.signal import find_peaks, peak_widths
ALLOWED_STATISTICS = ["n_spikes",
"spike_rate",
"latency_to_first_spike",
"average_AP_overshoot",
... | [
"numpy.sum",
"numpy.abs",
"matplotlib.pyplot.figure",
"scipy.signal.find_peaks",
"numpy.mean",
"matplotlib.pyplot.hlines",
"scipy.signal.peak_widths",
"numpy.max",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.rc",
"matplotlib.ticker.FormatStrFormatter",
"seaborn.set",
"seaborn.set... | [((13594, 13603), 'seaborn.set', 'sns.set', ([], {}), '()\n', (13601, 13603), True, 'import seaborn as sns\n'), ((13608, 13632), 'seaborn.set_context', 'sns.set_context', (['"""paper"""'], {}), "('paper')\n", (13623, 13632), True, 'import seaborn as sns\n'), ((13637, 13690), 'seaborn.set_style', 'sns.set_style', (['"""... |
import numpy as np
lin = open("__21_d25.txt").read().splitlines(); gm = np.array([list(line) for line in lin])
def st(hN, gm):
tM = gm == hN; gS = np.roll(gm, -1, 1 if hN == ">" else 0)
tM[gS != '.'] = False; gm[tM] = '.'; tS = np.roll(tM, 1, 1 if hN == ">" else 0)
gm[tS] = hN; return len(gm[tM])
count = 1
while ... | [
"numpy.roll"
] | [((150, 188), 'numpy.roll', 'np.roll', (['gm', '(-1)', "(1 if hN == '>' else 0)"], {}), "(gm, -1, 1 if hN == '>' else 0)\n", (157, 188), True, 'import numpy as np\n'), ((232, 269), 'numpy.roll', 'np.roll', (['tM', '(1)', "(1 if hN == '>' else 0)"], {}), "(tM, 1, 1 if hN == '>' else 0)\n", (239, 269), True, 'import nump... |
"""A domain for real-world experiments."""
import time
from itertools import combinations
from pathlib import Path
from typing import Tuple, Union
from inquire.environments.gym_wrapper_environment import Environment
from inquire.interactions.feedback import Trajectory
from numba import jit
import numpy as np
import... | [
"numpy.sum",
"numpy.empty",
"numpy.random.default_rng",
"numpy.sin",
"numpy.linalg.norm",
"numpy.exp",
"numpy.append",
"numpy.linspace",
"time.perf_counter",
"itertools.combinations",
"numpy.cos",
"numpy.argwhere",
"numpy.random.uniform",
"numpy.zeros",
"numpy.where",
"numba.jit",
"n... | [((15354, 15372), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (15357, 15372), False, 'from numba import jit\n'), ((15497, 15517), 'numpy.empty', 'np.empty', (['(2, count)'], {}), '((2, count))\n', (15505, 15517), True, 'import numpy as np\n'), ((1407, 1440), 'numpy.random.default_rng', 'np.ra... |
"""grid_world.py
A simple grid world environment. Edges of the map are treated like obstacles
Map must be a image file whose values represent free (255, white), occupied (0, black).
"""
from __future__ import print_function, absolute_import, division
import cv2
import numpy as np
from bc_exploration.mapping.costmap i... | [
"numpy.zeros_like",
"bc_exploration.utilities.util.xy_to_rc",
"numpy.concatenate",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.getStructuringElement",
"cv2.imread",
"numpy.max",
"numpy.random.randint",
"numpy.array",
"bc_exploration.utilities.util.compute_connected_pixels",
... | [((3156, 3196), 'numpy.random.randint', 'np.random.randint', (['valid_points.shape[0]'], {}), '(valid_points.shape[0])\n', (3173, 3196), True, 'import numpy as np\n'), ((4845, 4865), 'cv2.imread', 'cv2.imread', (['filename'], {}), '(filename)\n', (4855, 4865), False, 'import cv2\n'), ((4980, 5022), 'cv2.cvtColor', 'cv2... |
from __future__ import print_function
import save_novel
import tensorflow as tf
import os
import sys
import random
import numpy as np
import re
import MeCab
from glob import glob
from keras.optimizers import RMSprop
from keras.layers import LSTM
from keras.layers import Dense
from keras.models import Sequential
from ke... | [
"sys.stdout.write",
"numpy.sum",
"numpy.log",
"tensorflow.config.experimental.get_memory_growth",
"numpy.argmax",
"numpy.random.multinomial",
"numpy.asarray",
"os.path.exists",
"tensorflow.config.experimental.set_memory_growth",
"keras.callbacks.LambdaCallback",
"MeCab.Tagger",
"numpy.exp",
... | [((375, 426), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (419, 426), True, 'import tensorflow as tf\n'), ((821, 845), 'MeCab.Tagger', 'MeCab.Tagger', (['"""-Owakati"""'], {}), "('-Owakati')\n", (833, 845), False, 'import MeCa... |
import en_core_web_lg
import json
import pickle
import numpy as np
import rdflib
class FoodEmbeddingSims:
def run(self, *,
spacy_savefile = '../data/out/spacy_ing_sim.pkl',
w2v_savefile = '../data/out/w2v_ing_sim.pkl',
substitution_data_file = '../data/in/foodsubs_data.json',
... | [
"pickle.dump",
"rdflib.Graph",
"json.load",
"numpy.multiply",
"numpy.sum",
"rdflib.URIRef",
"en_core_web_lg.load",
"numpy.mean",
"numpy.array",
"gensim.models.KeyedVectors.load_word2vec_format"
] | [((459, 473), 'rdflib.Graph', 'rdflib.Graph', ([], {}), '()\n', (471, 473), False, 'import rdflib\n'), ((1741, 1762), 'en_core_web_lg.load', 'en_core_web_lg.load', ([], {}), '()\n', (1760, 1762), False, 'import en_core_web_lg\n'), ((3939, 3995), 'gensim.models.KeyedVectors.load_word2vec_format', 'KeyedVectors.load_word... |
import os
from numpy.testing import assert_allclose, assert_equal
from astropy.io import fits
import shutil
import numpy as np
def spectrum_answer_testing(spec, filename, answer_store, answer_dir):
testfile = os.path.join(answer_dir, filename)
if answer_store:
spec.write_h5_file(testfile, overwrite=Tr... | [
"astropy.io.fits.open",
"numpy.testing.assert_equal",
"shutil.copy",
"numpy.testing.assert_allclose",
"os.path.join",
"numpy.issubdtype"
] | [((215, 249), 'os.path.join', 'os.path.join', (['answer_dir', 'filename'], {}), '(answer_dir, filename)\n', (227, 249), False, 'import os\n'), ((699, 733), 'os.path.join', 'os.path.join', (['answer_dir', 'filename'], {}), '(answer_dir, filename)\n', (711, 733), False, 'import os\n'), ((395, 451), 'numpy.testing.assert_... |
# An example of using a tensorflow custom core estimator with contrib predictor for increased inference performance.
# Attempts to use up-to-date best practice for tensorflow development and keep dependencies to a minimum.
# Performs a regression using a deep neural network where the number of inputs and outputs can ... | [
"numpy.full",
"tensorflow.estimator.export.PredictOutput",
"tensorflow.train.get_global_step",
"tensorflow.losses.mean_squared_error",
"tensorflow.estimator.export.ServingInputReceiver",
"tensorflow.layers.dense",
"tensorflow.train.AdagradOptimizer",
"numpy.float32",
"time.clock",
"tensorflow.laye... | [((2948, 3012), 'tensorflow.contrib.predictor.from_estimator', 'tf.contrib.predictor.from_estimator', (['estimator', 'serving_input_fn'], {}), '(estimator, serving_input_fn)\n', (2983, 3012), True, 'import tensorflow as tf\n'), ((3045, 3077), 'numpy.random.rand', 'np.random.rand', (['(1)', 'FEATURES_RANK'], {}), '(1, F... |
from covariance import Covariance
import numpy as np
from scipy.special import gamma
"""Covariance run 1: COSMOS-like with no lensing fields"""
# Generate non-fit parameters.
# .. These values should be motivated to reflect actual data
# .. Postage stamp size
Nx = 150
Ny = 150
# .. Standard galaxy size (in pixels)
a... | [
"scipy.special.gamma",
"numpy.array",
"numpy.sqrt"
] | [((891, 959), 'numpy.array', 'np.array', (['(0.5, 0.5, ns, rs, q, phi, psi111, psi112, psi122, psi222)'], {}), '((0.5, 0.5, ns, rs, q, phi, psi111, psi112, psi122, psi222))\n', (899, 959), True, 'import numpy as np\n'), ((775, 802), 'numpy.sqrt', 'np.sqrt', (['((1 + q ** 2.0) / 2)'], {}), '((1 + q ** 2.0) / 2)\n', (782... |
from behaviour_cloning import *
import tensorflow as tf
import pickle
import mujoco_py
import gym
import numpy as np
def main():
observations, actions = process_expert_data("Humanoid-v2")
comp_returns= np.zeros(shape=(20,20))
comp_avg_return=[]
for i in range (20):
train_model(observations, act... | [
"numpy.zeros",
"numpy.concatenate"
] | [((211, 235), 'numpy.zeros', 'np.zeros', ([], {'shape': '(20, 20)'}), '(shape=(20, 20))\n', (219, 235), True, 'import numpy as np\n'), ((525, 582), 'numpy.concatenate', 'np.concatenate', (['(observations, eval_observations)'], {'axis': '(0)'}), '((observations, eval_observations), axis=0)\n', (539, 582), True, 'import ... |
#!/usr/bin/env python3
'''
<NAME>, <EMAIL>
2020/05/23
Python code to read the sensor data from the
Silicon Labs Thunderboard Sense2
command-line input parameters:
--time [seconds]
--sensor
outputs:
CSV of all sensor data
plot of all specific sensor
v0.1 : inital version
'''
import serial
import datetime
im... | [
"serial.Serial",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"matplotlib.pyplot.ioff",
"serial.tools.list_ports.comports",
"matplotlib.pyplot.subplots",
"time.sleep",
"datetime.datetime",
"numpy.append",
"matplotlib.pyplot.style.use",
"datetime.datetime.utcnow",
"numpy.array",
"plat... | [((509, 532), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (530, 532), False, 'import datetime\n'), ((638, 655), 'platform.system', 'platform.system', ([], {}), '()\n', (653, 655), False, 'import platform\n'), ((657, 671), 'appnope.nope', 'appnope.nope', ([], {}), '()\n', (669, 671), False, 'impo... |
import fridge.utilities.mcnpCreatorFunctions as MCF
import numpy as np
def test_getRCC():
surfaceCard = MCF.getRCC(0.5, 10, [0.0, 0.0, 0.5555555], 1, '$ Comment')
surfaceCardKnown = '1 RCC 0.0 0.0 0.55556 0 0 10 0.5 $ Comment'
assert surfaceCard == surfaceCardKnown
def test_getRHP():
surfaceCard = M... | [
"fridge.utilities.mcnpCreatorFunctions.getCoolantWireWrapSmear",
"fridge.utilities.mcnpCreatorFunctions.getRHP",
"fridge.utilities.mcnpCreatorFunctions.getSmearedMaterial",
"fridge.utilities.mcnpCreatorFunctions.getOutsideCell",
"fridge.utilities.mcnpCreatorFunctions.getAssemblyUniverseCell",
"fridge.util... | [((110, 168), 'fridge.utilities.mcnpCreatorFunctions.getRCC', 'MCF.getRCC', (['(0.5)', '(10)', '[0.0, 0.0, 0.5555555]', '(1)', '"""$ Comment"""'], {}), "(0.5, 10, [0.0, 0.0, 0.5555555], 1, '$ Comment')\n", (120, 168), True, 'import fridge.utilities.mcnpCreatorFunctions as MCF\n'), ((319, 377), 'fridge.utilities.mcnpCre... |
import numpy as np
import matplotlib.pyplot as plt
def threshold_convolved_image(convolved_image):
tci = np.copy(convolved_image)
for i in range(3):
m = np.mean(convolved_image[:, :, i])
s = np.std(convolved_image[:, :, i])
thr = m
tci[convolved_image[:, :, i] < thr, i] = 0
... | [
"matplotlib.pyplot.subplot",
"numpy.load",
"matplotlib.pyplot.show",
"numpy.sum",
"numpy.copy",
"numpy.std",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.figure",
"numpy.mean"
] | [((883, 915), 'numpy.load', 'np.load', (['"""../data/test/ci=0.npy"""'], {}), "('../data/test/ci=0.npy')\n", (890, 915), True, 'import numpy as np\n'), ((920, 959), 'numpy.load', 'np.load', (['"""../data/kernels/kernel=0.npy"""'], {}), "('../data/kernels/kernel=0.npy')\n", (927, 959), True, 'import numpy as np\n'), ((9... |
import copy
import warnings
from keras import backend as K
from keras import activations, regularizers
from keras.engine import InputSpec
from keras.layers import Recurrent
import numpy as np
from ...data.instances.text_classification.logical_form_instance import SHIFT_OP, REDUCE2_OP, REDUCE3_OP
class TreeCompositi... | [
"keras.backend.dot",
"copy.deepcopy",
"keras.backend.concatenate",
"keras.activations.get",
"keras.regularizers.get",
"keras.backend.zeros_like",
"keras.backend.sum",
"numpy.zeros",
"keras.backend.equal",
"keras.backend.tile",
"keras.engine.InputSpec",
"warnings.warn",
"keras.backend.permute... | [((2554, 2581), 'keras.activations.get', 'activations.get', (['activation'], {}), '(activation)\n', (2569, 2581), False, 'from keras import activations, regularizers\n'), ((2614, 2647), 'keras.activations.get', 'activations.get', (['inner_activation'], {}), '(inner_activation)\n', (2629, 2647), False, 'from keras impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''checkplotserver_handlers.py - <NAME> (<EMAIL>) -
Jan 2017
These are Tornado handlers for serving checkplots and operating on them.
'''
####################
## SYSTEM IMPORTS ##
####################
import os
import os.path
import gzi... | [
"os.remove",
"base64.b64decode",
"numpy.full_like",
"json.loads",
"os.path.dirname",
"numpy.logical_not",
"os.path.exists",
"numpy.isfinite",
"json.JSONEncoder.default",
"json.dump",
"io.BytesIO",
"os.path.basename",
"numpy.min",
"tornado.escape.xhtml_escape",
"time.time",
"numpy.any",... | [((1733, 1760), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1750, 1760), False, 'import logging\n'), ((37454, 37476), 'tornado.escape.xhtml_escape', 'xhtml_escape', (['objectid'], {}), '(objectid)\n', (37466, 37476), False, 'from tornado.escape import xhtml_escape, xhtml_unescape, url... |
# Newton-Raphson method for orbit calculations using numpy arrays;
from numpy import linspace, abs, sqrt, sin, cos, arctan2, array, pi
def orbit(m0, e, a, inclination, ascension, n, acc=1.e-2):
m = linspace(m0, 2 * pi + m0, n)
ecc_anom = m
ecc_anom_old = 0
while acc < abs(ecc_anom - ecc_anom_old).max(... | [
"numpy.abs",
"numpy.sin",
"numpy.array",
"numpy.linspace",
"numpy.cos",
"numpy.sqrt"
] | [((204, 232), 'numpy.linspace', 'linspace', (['m0', '(2 * pi + m0)', 'n'], {}), '(m0, 2 * pi + m0, n)\n', (212, 232), False, 'from numpy import linspace, abs, sqrt, sin, cos, arctan2, array, pi\n'), ((1117, 1133), 'numpy.array', 'array', (['(x, y, z)'], {}), '((x, y, z))\n', (1122, 1133), False, 'from numpy import lins... |
# -*- encoding: utf-8 -*-
# Copyright (c) 2020 <NAME> <<EMAIL>>
# ISC License <https://choosealicense.com/licenses/isc>
"""Contains some common necessary frame transformation helper methods.
These transformation methods are useful for optimizing face detection in frames.
Typically face detection takes much longer the... | [
"numpy.abs",
"cv2.cvtColor",
"numpy.float32",
"cv2.warpAffine",
"cv2.convertScaleAbs",
"cv2.flip",
"cv2.getRotationMatrix2D",
"cv2.resize"
] | [((4081, 4170), 'cv2.resize', 'cv2.resize', ([], {'src': 'frame', 'dsize': 'None', 'fx': 'factor', 'fy': 'factor', 'interpolation': 'interpolation'}), '(src=frame, dsize=None, fx=factor, fy=factor, interpolation=\n interpolation)\n', (4091, 4170), False, 'import cv2\n'), ((9345, 9424), 'cv2.getRotationMatrix2D', 'cv... |
#This code comes from: https://github.com/becomequantum/kryon
from PIL import Image,ImageDraw,ImageFont
import numpy as np
#This code is only about animation. 本代码只是和做演示动画相关.
VideoSize = (1280, 720)
DemoImageSize = (48, 36)
标题位置 = (60, 16)
注释1位置 = (1000, 76)
网格位置 = (32, 76)
比例 = 17
网格颜色 = (230, 230, 230)
网三位置... | [
"PIL.ImageFont.truetype",
"PIL.ImageDraw.Draw",
"PIL.Image.new",
"numpy.array"
] | [((603, 639), 'PIL.ImageFont.truetype', 'ImageFont.truetype', (['"""msyh.ttf"""', 'Size'], {}), "('msyh.ttf', Size)\n", (621, 639), False, 'from PIL import Image, ImageDraw, ImageFont\n'), ((1592, 1628), 'PIL.Image.new', 'Image.new', (['"""RGB"""', 'VideoSize', 'BgColor'], {}), "('RGB', VideoSize, BgColor)\n", (1601, 1... |
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import librosa
import librosa.display
import numpy as np
def summary(x):
if x.ndim == 1:
SUM = ('\n{0:>10s}: {1:>15.4f}').format('min', np.amin(x))
SUM += ('\n{0:>10s}: {1:>15.4f}').format('1st Quar', np.percentile(x, 25))
SUM += ('\n{0:>10s... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.amin",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"numpy.median",
"numpy.std",
"matplotlib.pyplot.colorbar",
"numpy.percentile",
"numpy.amax",
"matplotlib.pyplot.figure... | [((1882, 1910), 'numpy.linspace', 'np.linspace', (['to', 'ti', 'samples'], {}), '(to, ti, samples)\n', (1893, 1910), True, 'import numpy as np\n'), ((2373, 2388), 'matplotlib.pyplot.title', 'plt.title', (['text'], {}), '(text)\n', (2382, 2388), True, 'import matplotlib.pyplot as plt\n'), ((2390, 2400), 'matplotlib.pypl... |
import sys
import os
from datetime import datetime
import traceback
import time
from pathlib import Path
import h5py
import pickle
import nept
import scipy
import numpy as np
import pandas as pd
from fooof import FOOOF
# cwd = Path(os.getcwd())
# pkg_dir = cwd.parent
# sys.path.append(str(pkg_dir))
import Utils.rob... | [
"pickle.dump",
"numpy.sum",
"scipy.signal.welch",
"numpy.abs",
"numpy.argmax",
"numpy.empty",
"matplotlib.pyplot.subplot2grid",
"numpy.floor",
"numpy.ones",
"numpy.around",
"pathlib.Path",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.histogram",
"sys.exc_info",
"numpy.mean",
"p... | [((391, 434), 'seaborn.set', 'sns.set', ([], {'style': '"""whitegrid"""', 'palette': '"""muted"""'}), "(style='whitegrid', palette='muted')\n", (398, 434), True, 'import seaborn as sns\n'), ((1238, 1254), 'pathlib.Path', 'Path', (["task['sp']"], {}), "(task['sp'])\n", (1242, 1254), False, 'from pathlib import Path\n'),... |
"""
Wisconsin Autonomous - https://www.wisconsinautonomous.org
Copyright (c) 2021 wisconsinautonomous.org
All rights reserved.
Use of this source code is governed by a BSD-style license that can be found
in the LICENSE file at the top level of the repo
"""
from abc import abstractmethod # Abstract Base Class
# WA ... | [
"wa_simulator.utils._load_json",
"wa_simulator.core.WAVector",
"wa_simulator.utils._WAStaticAttribute",
"wa_simulator.core.WAQuaternion.from_z_rotation",
"numpy.clip",
"numpy.sin",
"numpy.tan",
"numpy.cos",
"numpy.interp"
] | [((1120, 1140), 'wa_simulator.utils._load_json', '_load_json', (['filename'], {}), '(filename)\n', (1130, 1140), False, 'from wa_simulator.utils import _load_json, _WAStaticAttribute, get_wa_data_file\n'), ((4498, 4557), 'wa_simulator.utils._WAStaticAttribute', '_WAStaticAttribute', (['"""_GO_KART_MODEL_FILE"""', 'get_... |
# Copyright 2021 The Petuum 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 applicable... | [
"unittest.main",
"texar.torch.data.data.data_iterators.DataIterator",
"iu_xray_data.IU_XRay_Dataset",
"numpy.sum",
"numpy.ones_like",
"evaluation_metrics.HammingLoss",
"evaluation_metrics.MultiLabelF1",
"numpy.zeros",
"models.cv_model.MLCTrainer",
"sklearn.metrics.roc_auc_score",
"evaluation_met... | [((6509, 6524), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6522, 6524), False, 'import unittest\n'), ((2203, 2232), 'iu_xray_data.IU_XRay_Dataset', 'IU_XRay_Dataset', (['data_hparams'], {}), '(data_hparams)\n', (2218, 2232), False, 'from iu_xray_data import IU_XRay_Dataset\n'), ((2295, 2316), 'texar.torch.dat... |
# -*- encoding:utf-8 -*-
"""
选股示例因子:价格选股因子
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from .ABuPickStockBase import AbuPickStockBase, reversed_result
from ..TLineBu.ABuTL import AbuTLine
from ..CoreBu.ABuEnv import EMarketDat... | [
"numpy.array"
] | [((1076, 1100), 'numpy.array', 'np.array', (['shift_distance'], {}), '(shift_distance)\n', (1084, 1100), True, 'import numpy as np\n'), ((3289, 3312), 'numpy.array', 'np.array', (['cmp_top_array'], {}), '(cmp_top_array)\n', (3297, 3312), True, 'import numpy as np\n')] |
import matplotlib.pyplot as plt
import numpy as np
import cv2
from os import path
from math import floor
import os
cwd = os.getcwd()
dirname = path.join(cwd, path.dirname(__file__))
class DIP:
def bilinear_insert(self, img, gain_x=1.5, gain_y=1.5):
H, W, C = img.shape
gain_h = round(H*gain_x)
... | [
"os.getcwd",
"os.path.dirname",
"os.path.join",
"numpy.arange"
] | [((123, 134), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (132, 134), False, 'import os\n'), ((160, 182), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (172, 182), False, 'from os import path\n'), ((739, 778), 'os.path.join', 'path.join', (['dirname', '"""./imori_out25.jpg"""'], {}), "(dirname,... |
import os
import cv2
import numpy as np
from keras.utils import np_utils
from keras.models import Sequential
from keras.layers import Dense, Conv2D, MaxPooling2D, Flatten, Dropout
from sklearn.model_selection import train_test_split
X = []
y = []
data_path = "./data"
for number in os.listdir(data_path):
for img_n... | [
"cv2.cvtColor",
"sklearn.model_selection.train_test_split",
"numpy.asarray",
"keras.layers.MaxPooling2D",
"keras.layers.Dropout",
"keras.layers.Flatten",
"keras.utils.np_utils.to_categorical",
"keras.layers.Dense",
"keras.layers.Conv2D",
"keras.models.Sequential",
"os.path.join",
"os.listdir"
... | [((284, 305), 'os.listdir', 'os.listdir', (['data_path'], {}), '(data_path)\n', (294, 305), False, 'import os\n'), ((613, 626), 'numpy.asarray', 'np.asarray', (['X'], {}), '(X)\n', (623, 626), True, 'import numpy as np\n'), ((678, 691), 'numpy.asarray', 'np.asarray', (['y'], {}), '(y)\n', (688, 691), True, 'import nump... |
from zenoh_service.core.zenoh_net import ZenohNet
from zenoh_service.zenoh_net_publisher import ZenohNetPublisher
import sys
import time
from datetime import datetime
import numpy as np
import cv2
import simplejson as json
from enum import Enum
import logging
import argparse
# from hurry.filesize import size as fsize
f... | [
"cv2.resize",
"argparse.ArgumentParser",
"cv2.waitKey",
"nanocamera.Camera",
"cv2.imshow",
"logging.getLogger",
"time.time",
"cv2.VideoCapture",
"pycore.extras.functions.humanbytes",
"cv2.imencode",
"numpy.vstack",
"cv2.resizeWindow",
"cv2.destroyAllWindows",
"datetime.datetime.now",
"ze... | [((674, 736), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Zenoh Publisher example"""'}), "(description='Zenoh Publisher example')\n", (697, 736), False, 'import argparse\n'), ((2016, 2043), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2033, 2043), Fal... |
import numpy as np
from vec_io import fvecs_read
from sorter import parallel_sort
from lsh import SRP
from transform import spherical_transform, simple_lsh
def intersect(gs, ids):
rc = np.mean([
len(np.intersect1d(g, list(id)))
for g, id in zip(gs, ids)])
return rc
def recalls(index, q_, gt)... | [
"numpy.random.uniform",
"numpy.random.seed",
"sorter.parallel_sort",
"vec_io.fvecs_read",
"transform.spherical_transform",
"numpy.linalg.norm",
"lsh.SRP"
] | [((1078, 1096), 'vec_io.fvecs_read', 'fvecs_read', (['x_path'], {}), '(x_path)\n', (1088, 1096), False, 'from vec_io import fvecs_read\n'), ((1208, 1227), 'numpy.random.seed', 'np.random.seed', (['(808)'], {}), '(808)\n', (1222, 1227), True, 'import numpy as np\n'), ((1236, 1261), 'numpy.random.uniform', 'np.random.uni... |
# -*- coding: utf-8 -*-
"""
Create my own style of colorbar
"""
__title__ = "Replace Hex Colors"
__author__ = "<NAME>"
__version__ = "1.1(19.02.2018)"
__email__ = "<EMAIL>"
#==============================================================================
# modules
import numpy as np
import matplotlib ... | [
"ipdb.set_trace",
"matplotlib.colors.BoundaryNorm",
"numpy.array",
"numpy.arange",
"matplotlib.colors.ListedColormap"
] | [((2074, 2109), 'matplotlib.colors.ListedColormap', 'mpl.colors.ListedColormap', (['cmaplist'], {}), '(cmaplist)\n', (2099, 2109), True, 'import matplotlib as mpl\n'), ((2243, 2282), 'matplotlib.colors.BoundaryNorm', 'mpl.colors.BoundaryNorm', (['bounds', 'cmap.N'], {}), '(bounds, cmap.N)\n', (2266, 2282), True, 'impor... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import json
import random
from typing import List, Optional, Tuple
import cv2
import numpy as np
import torchvision.transforms as T
from detectron2.config import CfgNode
from detectron2.data.transforms import Transform, Tra... | [
"json.loads",
"numpy.amin",
"random.uniform",
"numpy.ceil",
"numpy.float32",
"numpy.ones",
"detectron2.data.transforms.NoOpTransform",
"torchvision.transforms.functional._get_inverse_affine_matrix",
"numpy.amax",
"numpy.linalg.inv",
"cv2.getAffineTransform",
"numpy.array",
"numpy.random.choi... | [((6971, 6990), 'json.loads', 'json.loads', (['arg_str'], {}), '(arg_str)\n', (6981, 6990), False, 'import json\n'), ((1468, 1497), 'numpy.ones', 'np.ones', (['(1, coords.shape[1])'], {}), '((1, coords.shape[1]))\n', (1475, 1497), True, 'import numpy as np\n'), ((1515, 1540), 'numpy.vstack', 'np.vstack', (['(coords, on... |
import logging
import warnings
import numpy as np
import pandas as pd
from scipy import integrate, stats
from scipy.interpolate import InterpolatedUnivariateSpline
from .util import log_err_func
def cal_chi_square(f_hat_array, f_array):
chi_square = np.sum((f_hat_array - f_array) ** 2 / f_hat_array)
return... | [
"numpy.zeros_like",
"numpy.sum",
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.log",
"warnings.filterwarnings",
"numpy.ones_like",
"numpy.polyval",
"scipy.stats.gaussian_kde",
"numpy.isfinite",
"logging.info",
"numpy.arange",
"numpy.sqrt"
] | [((259, 309), 'numpy.sum', 'np.sum', (['((f_hat_array - f_array) ** 2 / f_hat_array)'], {}), '((f_hat_array - f_array) ** 2 / f_hat_array)\n', (265, 309), True, 'import numpy as np\n'), ((417, 451), 'scipy.interpolate.InterpolatedUnivariateSpline', 'InterpolatedUnivariateSpline', (['x', 'y'], {}), '(x, y)\n', (445, 451... |
#!/usr/bin/env python
"""
A simple python script for parsing CASTEP (http://www.castep.org/) output files especially for ELNES calculations.
This includes some functions for reading .cell, .castep, .bands, and .eels_mat files, calculating excitation energy, and forming core-loss spectra with Gaussian smearing.
Copyri... | [
"numpy.abs",
"numpy.array",
"numpy.exp",
"numpy.sqrt",
"os.path.join",
"numpy.prod",
"re.compile"
] | [((3729, 3794), 're.compile', 're.compile', (['f"""Atomic calculation performed for {element}{suffix}"""'], {}), "(f'Atomic calculation performed for {element}{suffix}')\n", (3739, 3794), False, 'import re\n'), ((3807, 3886), 're.compile', 're.compile', (['"""Converged in \\\\d+ iterations to an ae energy of ([\\\\d\\\... |
# Copyright The PyTorch Lightning team.
#
# 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 i... | [
"flash.data.data_utils.labels_from_categorical_csv",
"pathlib.Path",
"flash.vision.ImageClassificationData.from_folders",
"numpy.random.randint",
"os.path.splitext",
"torch.rand",
"flash.vision.ImageClassificationData.from_filepaths",
"os.path.join",
"torchvision.transforms.ToTensor"
] | [((876, 897), 'torch.rand', 'torch.rand', (['(3)', '(64)', '(64)'], {}), '(3, 64, 64)\n', (886, 897), False, 'import torch\n'), ((1051, 1233), 'flash.vision.ImageClassificationData.from_filepaths', 'ImageClassificationData.from_filepaths', ([], {'train_filepaths': "['a', 'b']", 'train_labels': '[0, 1]', 'train_transfor... |
# -*- coding: utf8 -*-
#
# Module ELEMENT
#
# Part of Nutils: open source numerical utilities for Python. Jointly developed
# by HvZ Computational Engineering, TU/e Multiscale Engineering Fluid Dynamics,
# and others. More info at http://nutils.org <<EMAIL>>. (c) 2014
"""
The transform module.
"""
from __future__ imp... | [
"numpy.eye",
"numpy.asarray",
"numpy.where",
"numpy.take",
"numpy.linalg.inv",
"numpy.array",
"numpy.dot",
"numpy.all"
] | [((11918, 11939), 'numpy.asarray', 'numpy.asarray', (['coords'], {}), '(coords)\n', (11931, 11939), False, 'import numpy\n'), ((2660, 2676), 'numpy.array', 'numpy.array', (['(1.0)'], {}), '(1.0)\n', (2671, 2676), False, 'import numpy\n'), ((2898, 2914), 'numpy.array', 'numpy.array', (['(1.0)'], {}), '(1.0)\n', (2909, 2... |
#!/usr/bin/env python
import argparse
import numpy as np
import pandas as pd
from scipy import linalg
from tqdm import tqdm
import os
import logging
def get_args():
parser = argparse.ArgumentParser(description="calculate splicing scores per gene/cell")
parser.add_argument("--input", help="Name of the input file... | [
"pandas.DataFrame",
"logging.exception",
"argparse.ArgumentParser",
"logging.basicConfig",
"numpy.square",
"numpy.transpose",
"logging.info",
"scipy.linalg.svd",
"pandas.read_parquet",
"pandas.Series"
] | [((180, 258), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""calculate splicing scores per gene/cell"""'}), "(description='calculate splicing scores per gene/cell')\n", (203, 258), False, 'import argparse\n'), ((1029, 1184), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename':... |
# -*- coding: utf-8 -*-
import numpy as np
from . import utils
def bias(predicted, reference):
"""
Calculate the bias between PREDICTED and REFERENCE.
B = mean(p) - mean(r)
where p is the predicted values, and r is the reference values.
Note that p & r must have the same number of values.
... | [
"numpy.mean"
] | [((727, 745), 'numpy.mean', 'np.mean', (['predicted'], {}), '(predicted)\n', (734, 745), True, 'import numpy as np\n'), ((748, 766), 'numpy.mean', 'np.mean', (['reference'], {}), '(reference)\n', (755, 766), True, 'import numpy as np\n')] |
"""Module for base class of Circle and Sphere."""
import numpy as np
from skspatial._functions import _contains_point
from skspatial.objects._base_spatial import _BaseSpatial
from skspatial.objects.point import Point
from skspatial.objects.vector import Vector
from skspatial.typing import array_like
class _BaseSpher... | [
"numpy.array_repr",
"skspatial.objects.point.Point",
"skspatial._functions._contains_point",
"skspatial.objects.vector.Vector.from_points"
] | [((558, 570), 'skspatial.objects.point.Point', 'Point', (['point'], {}), '(point)\n', (563, 570), False, 'from skspatial.objects.point import Point\n'), ((743, 768), 'numpy.array_repr', 'np.array_repr', (['self.point'], {}), '(self.point)\n', (756, 768), True, 'import numpy as np\n'), ((1241, 1279), 'skspatial._functio... |
import numpy
import openmm
import openmm.app
import openmm.unit
import qm3
import qm3.engines.openmm
import qm3.engines.xtb
import qm3.utils
import qm3.utils.hessian
import qm3.actions.minimize
import sys
import os
cwd = os.path.abspath( os.path.dirname( sys.argv[0] ) ) + os.sep
mol = qm3.molecule()
mol.p... | [
"qm3.engines.xtb.run",
"qm3.utils.hessian.numerical",
"qm3.utils.hessian.frequencies",
"qm3.utils.RT_modes",
"os.path.dirname",
"numpy.logical_not",
"qm3.molecule",
"qm3.utils.hessian.manage",
"qm3.actions.minimize.baker",
"openmm.app.charmmparameterset.CharmmParameterSet",
"numpy.array",
"ope... | [((300, 314), 'qm3.molecule', 'qm3.molecule', ([], {}), '()\n', (312, 314), False, 'import qm3\n'), ((360, 391), 'numpy.array', 'numpy.array', (['[40.0, 40.0, 40.0]'], {}), '([40.0, 40.0, 40.0])\n', (371, 391), False, 'import numpy\n'), ((476, 536), 'openmm.app.charmmpsffile.CharmmPsfFile', 'openmm.app.charmmpsffile.Ch... |
import numpy as np
import tensorflow as tf
from tensorflow.keras import Input, Model
from tensorflow.keras.layers import Dense
units = 4
enc = np.random.rand(4, 16, 32).reshape(4, -1, 32).astype('float32')
dec = np.random.rand(4, 32).reshape(4, 1, 32).astype('float32')
enc_h = Input(shape=(None, 32))
dec_h = Input(s... | [
"tensorflow.nn.softmax",
"tensorflow.reduce_sum",
"tensorflow.nn.tanh",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Input",
"tensorflow.keras.Model",
"numpy.random.rand"
] | [((281, 304), 'tensorflow.keras.Input', 'Input', ([], {'shape': '(None, 32)'}), '(shape=(None, 32))\n', (286, 304), False, 'from tensorflow.keras import Input, Model\n'), ((313, 333), 'tensorflow.keras.Input', 'Input', ([], {'shape': '(1, 32)'}), '(shape=(1, 32))\n', (318, 333), False, 'from tensorflow.keras import Inp... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
import scipy.integrate as integrate
plt.close('all')
# ------ defining constants ----- #
# -- using mks for convenience -- #
c = 2.998e8 # m / s
h = 6.626e-34 # m^s * kg / s
k = 1.31e-23 # J / K
b = 2.898e-3 # m * K
# ------ FU... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.close",
"numpy.asarray",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.loadtxt",
"numpy.exp",
"scipy.integrate.trapz",
"matplotlib.pyplot... | [((127, 143), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (136, 143), True, 'import matplotlib.pyplot as plt\n'), ((732, 771), 'numpy.loadtxt', 'np.loadtxt', (['"""UBV_ma06.txt"""'], {'skiprows': '(17)'}), "('UBV_ma06.txt', skiprows=17)\n", (742, 771), True, 'import numpy as np\n'), ((944,... |
import numpy as np
import matplotlib.pyplot as plt
c = 0.2
g = lambda x: 1 if x > 1.0 else 0
R = 0.005
eta1 = lambda w, rho: -R*g(rho)*np.heaviside(w, 0)
eta2 = lambda w, rho: -R*g(rho)*np.heaviside(w, 0)
fa = lambda a, b, w1: w1*(a - a*b)
fb = lambda a, b, w2: -w2*(b - a*b)
def evolve( T, a0, b0, w1_0, w2_0 ):
... | [
"numpy.heaviside",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.grid"
] | [((920, 938), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(3)'], {}), '(1, 3)\n', (932, 938), True, 'import matplotlib.pyplot as plt\n'), ((1029, 1039), 'matplotlib.pyplot.grid', 'plt.grid', ([], {}), '()\n', (1037, 1039), True, 'import matplotlib.pyplot as plt\n'), ((1193, 1203), 'matplotlib.pyplot.show', ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 27 16:12:58 2019
@author: LKK
"""
import numpy as np
from sys import getsizeof
import time
import copy
def dominate (record1, record2) :
result = record1.att - record2.att
if np.all(result>=0) :
return 1 #record dominate target
if np.all(result... | [
"copy.deepcopy",
"sys.getsizeof",
"numpy.all",
"time.time"
] | [((239, 258), 'numpy.all', 'np.all', (['(result >= 0)'], {}), '(result >= 0)\n', (245, 258), True, 'import numpy as np\n'), ((307, 325), 'numpy.all', 'np.all', (['(result < 0)'], {}), '(result < 0)\n', (313, 325), True, 'import numpy as np\n'), ((465, 476), 'time.time', 'time.time', ([], {}), '()\n', (474, 476), False,... |
import multiprocessing
import tensorflow as tf
import numpy as np
print("version de tensorflow:", tf.__version__)
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
import matplotlib.pyplot as plt
# Los Ejemplos de entrenamiento estan en:
# mnist... | [
"PIL.Image.new",
"numpy.argmax",
"tensorflow.ConfigProto",
"tensorflow.matmul",
"tensorflow.truncated_normal",
"multiprocessing.cpu_count",
"tensorflow.nn.softmax",
"tensorflow.nn.relu",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.placeholder",
"matplotlib.pyplot.show",
"ten... | [((183, 236), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""MNIST_data"""'], {'one_hot': '(True)'}), "('MNIST_data', one_hot=True)\n", (208, 236), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((2504, 2549), 'tensorflow.placeholder', 'tf.pl... |
import pickle
from typing import Dict, Union
import numpy as np
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, f1_score, roc_auc_score
SklearnClassifierModel = Union[LogisticRegression, DecisionTreeCl... | [
"pickle.dump",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.f1_score",
"numpy.exp"
] | [((708, 724), 'numpy.exp', 'np.exp', (['predicts'], {}), '(predicts)\n', (714, 724), True, 'import numpy as np\n'), ((902, 916), 'numpy.exp', 'np.exp', (['target'], {}), '(target)\n', (908, 916), True, 'import numpy as np\n'), ((950, 982), 'sklearn.metrics.accuracy_score', 'accuracy_score', (['target', 'predicts'], {})... |
import numpy as np
import matplotlib.pyplot as plt
cfs_to_tafd = 2.29568411*10**-5 * 86400 / 1000
# we'll use the "loadtxt" function from numpy to read the CSV
# the delimiter is a comma (other options might be tab or space)
# we want to skip the header row and the first (0th) column
# In general it's better to use ... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((378, 453), 'numpy.loadtxt', 'np.loadtxt', (['"""data/SHA.csv"""'], {'delimiter': '""","""', 'skiprows': '(1)', 'usecols': '[1, 2, 3, 4]'}), "('data/SHA.csv', delimiter=',', skiprows=1, usecols=[1, 2, 3, 4])\n", (388, 453), True, 'import numpy as np\n'), ((615, 632), 'matplotlib.pyplot.plot', 'plt.plot', (['storage']... |
import numpy as np
from future._greyreconstruct import reconstruction_loop
from skimage.filters._rank_order import rank_order
y, x = np.mgrid[:20:0.5, :20:0.5]
bumps = np.sin(x) + np.sin(y)
h = 0.3
seed = bumps - h
mask = bumps
assert tuple(seed.shape) == tuple(mask.shape)
selem = np.ones([3] * seed.ndim, dtype=boo... | [
"numpy.full",
"skimage.filters._rank_order.rank_order",
"numpy.sum",
"numpy.zeros",
"numpy.ones",
"numpy.argsort",
"numpy.min",
"numpy.sin",
"numpy.array",
"numpy.int64"
] | [((286, 322), 'numpy.ones', 'np.ones', (['([3] * seed.ndim)'], {'dtype': 'bool'}), '([3] * seed.ndim, dtype=bool)\n', (293, 322), True, 'import numpy as np\n'), ((332, 373), 'numpy.array', 'np.array', (['[(d // 2) for d in selem.shape]'], {}), '([(d // 2) for d in selem.shape])\n', (340, 373), True, 'import numpy as np... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 8 09:24:07 2019
@author: madsa
"""
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import numpy as np
import matplotlib
import pickle
import matplotlib.tri a... | [
"matplotlib.pyplot.figure",
"pickle.load",
"matplotlib.pyplot.show",
"numpy.meshgrid"
] | [((436, 459), 'pickle.load', 'pickle.load', (['pickleFile'], {}), '(pickleFile)\n', (447, 459), False, 'import pickle\n'), ((582, 594), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (592, 594), True, 'import matplotlib.pyplot as plt\n'), ((653, 670), 'numpy.meshgrid', 'np.meshgrid', (['x', 'y'], {}), '(x,... |
# Copyright (c) 2014 Evalf
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, s... | [
"numpy.pad",
"numpy.dtype",
"numpy.array",
"numpy.zeros_like"
] | [((5611, 5629), 'numpy.dtype', 'numpy.dtype', (['""">i1"""'], {}), "('>i1')\n", (5622, 5629), False, 'import contextlib, numpy\n'), ((5640, 5658), 'numpy.dtype', 'numpy.dtype', (['""">u1"""'], {}), "('>u1')\n", (5651, 5658), False, 'import contextlib, numpy\n'), ((5681, 5699), 'numpy.dtype', 'numpy.dtype', (['""">i2"""... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Filename: csvs_to_plots.py
# @Author: <NAME>
# @Time: 8/12/21 10:03
import re
from os import walk
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
def main():
path = '../test_unlabeled/'
dataset = 'titanic'
files = next(... | [
"matplotlib.pyplot.show",
"pandas.read_csv",
"os.walk",
"re.findall",
"numpy.array",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((1234, 1285), 'numpy.array', 'np.array', (['[acc_algorithms[x] for x, _ in order_acc]'], {}), '([acc_algorithms[x] for x, _ in order_acc])\n', (1242, 1285), True, 'import numpy as np\n'), ((1464, 1515), 'numpy.array', 'np.array', (['[mse_algorithms[x] for x, _ in order_mse]'], {}), '([mse_algorithms[x] for x, _ in or... |
# -*- coding: utf-8 -*-
"""Trains a convolutional neural network on the MNIST dataset, then attacks it with the FGSM attack."""
from __future__ import absolute_import, division, print_function, unicode_literals
from os.path import abspath
import sys
sys.path.append(abspath('.'))
import keras.backend as k
import tenso... | [
"os.path.abspath",
"numpy.save",
"numpy.argmax",
"keras.layers.Dropout",
"art.classifiers.KerasClassifier",
"keras.layers.Flatten",
"keras.backend.set_learning_phase",
"keras.layers.Dense",
"keras.layers.Conv2D",
"keras.models.Sequential",
"art.attacks.fast_gradient.FastGradientMethod",
"keras... | [((940, 963), 'keras.backend.set_learning_phase', 'k.set_learning_phase', (['(1)'], {}), '(1)\n', (960, 963), True, 'import keras.backend as k\n'), ((973, 985), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (983, 985), False, 'from keras.models import Sequential\n'), ((994, 1093), 'keras.layers.Conv2D', 'C... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
from moviepy.editor import VideoFileClip
from src.sliding_window import SlidingWindow
from src.lane_line import LaneLine
from src.image_reader import ImageReader
from src.image_plotter import ImagePlotter
from src.camera import Camera
from src.threshold_app... | [
"numpy.dstack",
"src.camera.Camera",
"cv2.warpPerspective",
"numpy.zeros_like",
"cv2.putText",
"moviepy.editor.VideoFileClip",
"numpy.argmax",
"src.threshold_applier.ThresholdApplier",
"src.image_plotter.ImagePlotter",
"numpy.empty",
"src.sliding_window.SlidingWindow",
"cv2.fillPoly",
"src.i... | [((6900, 6928), 'src.image_reader.ImageReader', 'ImageReader', ([], {'read_mode': '"""RGB"""'}), "(read_mode='RGB')\n", (6911, 6928), False, 'from src.image_reader import ImageReader\n'), ((6938, 6954), 'src.camera.Camera', 'Camera', (['ir', 'None'], {}), '(ir, None)\n', (6944, 6954), False, 'from src.camera import Cam... |
import numpy as np
import matplotlib.pyplot as plt
import pickle
# load data
data_folder = "traffic-signs-data/"
training_file = data_folder+"train.p"
validation_file = data_folder+"valid.p"
testing_file = data_folder+"test.p"
with open(training_file, mode='rb') as f:
train = pickle.load(f)
with open(validation_... | [
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss",
"LeNet.LeNet",
"pickle.load",
"numpy.where",
"Dataset.SignDataset",
"cv2.normalize"
] | [((2092, 2132), 'Dataset.SignDataset', 'SignDataset', (['X_train', 'y_train', 'n_classes'], {}), '(X_train, y_train, n_classes)\n', (2103, 2132), False, 'from Dataset import SignDataset\n'), ((2148, 2186), 'Dataset.SignDataset', 'SignDataset', (['X_test', 'y_test', 'n_classes'], {}), '(X_test, y_test, n_classes)\n', (2... |
# -*- coding: utf-8 -*-
"""img-grid-processing.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1rrkKK1WGrbCC5TnJSGX8772RCMdavj-L
"""
from google.colab import drive
drive.mount('/content/drive')
import os
import PIL
img_dir = "/content/drive/MyD... | [
"PIL.Image.open",
"numpy.random.choice",
"google.colab.drive.mount",
"matplotlib.pyplot.subplots",
"os.listdir",
"matplotlib.pyplot.savefig"
] | [((238, 267), 'google.colab.drive.mount', 'drive.mount', (['"""/content/drive"""'], {}), "('/content/drive')\n", (249, 267), False, 'from google.colab import drive\n'), ((345, 364), 'os.listdir', 'os.listdir', (['img_dir'], {}), '(img_dir)\n', (355, 364), False, 'import os\n'), ((455, 511), 'PIL.Image.open', 'PIL.Image... |
from typing import Dict
import matplotlib.pyplot as plt
import numpy as np
from IPython.core.display import display
from matplotlib.ticker import FormatStrFormatter, MaxNLocator
from mpl_toolkits.mplot3d import Axes3D
from plotly import offline as plotly, graph_objs as go, tools
PLOT_TYPES = {'random', 'grid', 'explo... | [
"plotly.offline.iplot",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.close",
"matplotlib.ticker.MaxNLocator",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.ticker.FormatStrFormatter",
"plotly.tools.make_subplots",
"plotly.offline.init_notebook_mode",
"matplo... | [((2187, 2228), 'plotly.offline.init_notebook_mode', 'plotly.init_notebook_mode', ([], {'connected': '(True)'}), '(connected=True)\n', (2212, 2228), True, 'from plotly import offline as plotly, graph_objs as go, tools\n'), ((2586, 2700), 'plotly.tools.make_subplots', 'tools.make_subplots', ([], {'rows': '(1)', 'cols': ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six.moves import range
import os
import logging
logging.basicConfig(level=logging.DEBUG)
import sys
#sys.stdout = sys.stderr
# Prevent reaching to maximum recursion depth in `theano.tensor.grad`
#sys.set... | [
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"numpy.random.seed",
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.regularizers.l2",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers... | [((164, 204), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (183, 204), False, 'import logging\n'), ((364, 387), 'numpy.random.seed', 'np.random.seed', (['(2 ** 10)'], {}), '(2 ** 10)\n', (378, 387), True, 'import numpy as np\n'), ((1034, 1066), 'logging.debu... |
import numpy as np
def _load_embeddings(fn):
return np.load(fn)
a = _load_embeddings('_embs/symptoms-en.npy')
b = _load_embeddings('_output/paraphrase-MiniLM-L6-v2-symptoms-en.npy')
for x, y in zip(a, b):
for n, m in zip(x, y):
if abs(n - m) > 1e-5:
print(abs(n - m))
| [
"numpy.load"
] | [((57, 68), 'numpy.load', 'np.load', (['fn'], {}), '(fn)\n', (64, 68), True, 'import numpy as np\n')] |
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import os
import torch
import torch.nn.functional as F
import torch.optim as optim
from torchvision import transforms
import torch.nn as nn
import numpy as np
import cv2
import os.path as osp
from glob import glob
from tqdm import tqdm
c... | [
"numpy.zeros",
"os.path.join",
"numpy.maximum"
] | [((1154, 1187), 'os.path.join', 'osp.join', (['self.root_dir', 'taskname'], {}), '(self.root_dir, taskname)\n', (1162, 1187), True, 'import os.path as osp\n'), ((4893, 4931), 'os.path.join', 'osp.join', (['self.root_dir', 'self.taskname'], {}), '(self.root_dir, self.taskname)\n', (4901, 4931), True, 'import os.path as ... |
import argparse
import os
import sys
import time
import traceback
import multiprocessing
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.animation as animation
from collections import OrderedDict
from pynput.keyboard import Listener, Key, KeyCo... | [
"pynput.keyboard.KeyCode.from_char",
"os.mkdir",
"argparse.ArgumentParser",
"matplotlib.pyplot.clf",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure",
"os.path.join",
"matplotlib.pyplot.imshow",
"os.path.exists",
"numpy.reshape",
"traceback.format_exc",
"matplotlib.image.imread... | [((517, 539), 'pynput.keyboard.KeyCode.from_char', 'KeyCode.from_char', (['"""a"""'], {}), "('a')\n", (534, 539), False, 'from pynput.keyboard import Listener, Key, KeyCode\n'), ((541, 563), 'pynput.keyboard.KeyCode.from_char', 'KeyCode.from_char', (['"""b"""'], {}), "('b')\n", (558, 563), False, 'from pynput.keyboard ... |
from conway import conway
import unittest
import numpy as np
class TestConway(unittest.TestCase):
def test_still(self):
"""2x2 block"""
A = np.zeros((10,10))
A[1:3,1:3] = 1
B = conway(A)
assert (A == B).all()
def test_scillator(self):
"""blinker"""
A =... | [
"unittest.main",
"conway.conway",
"numpy.zeros",
"numpy.random.random"
] | [((712, 727), 'unittest.main', 'unittest.main', ([], {}), '()\n', (725, 727), False, 'import unittest\n'), ((163, 181), 'numpy.zeros', 'np.zeros', (['(10, 10)'], {}), '((10, 10))\n', (171, 181), True, 'import numpy as np\n'), ((216, 225), 'conway.conway', 'conway', (['A'], {}), '(A)\n', (222, 225), False, 'from conway ... |
import numpy as np
import torch
from pruning import RePruning
class RePruningConvDet(RePruning):
def __init__(self, softness, magnitude_threshold, metric_quantile, lr, sample, lb, scale):
super().__init__()
self.masks = {}
self.strength = softness
self.magnitude_threshold = magnit... | [
"torch.ones_like",
"torch.zeros_like",
"torch.norm",
"numpy.isnan",
"torch.no_grad",
"torch.abs"
] | [((571, 586), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (584, 586), False, 'import torch\n'), ((5141, 5156), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (5154, 5156), False, 'import torch\n'), ((5728, 5743), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (5741, 5743), False, 'import torch\n'), ((... |
import numpy as np
import pandas as pd
import pytest
from sklearn.model_selection import train_test_split
from mercari.datasets_mx import prepare_vectorizer_1, prepare_vectorizer_2, prepare_vectorizer_3
from mercari.datasets_tf import prepare_vectorizer_1_tf, prepare_vectorizer_2_tf, prepare_vectorizer_3_tf
from merca... | [
"mercari.datasets_tf.prepare_vectorizer_3_tf",
"mercari.mx_sparse.MXRegression",
"mercari.datasets_mx.prepare_vectorizer_2",
"mercari.mercari_io.load_train",
"mercari.datasets_mx.prepare_vectorizer_3",
"mercari.tf_sparse.RegressionClf",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
... | [((1584, 1708), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""n_rows"""', "[None, 'random', 1, 2, 2 ** 10, 2 ** 13 - 1, 2 ** 13, 2 ** 13 + 1, 2 ** 13 +\n 2 ** 10]"], {}), "('n_rows', [None, 'random', 1, 2, 2 ** 10, 2 ** 13 -\n 1, 2 ** 13, 2 ** 13 + 1, 2 ** 13 + 2 ** 10])\n", (1607, 1708), False, 'im... |
import argparse
from source import tools
from config import option
import random
from source import runtime
from source import constants as C
import json
import numpy as np
parser = argparse.ArgumentParser(description="Im2Latex Training Program")
parser.add_argument("-m", "--mode", dest="mode", choices=("train", "test... | [
"source.tools.get_blind_maze",
"argparse.ArgumentParser",
"random.uniform",
"numpy.square",
"random.choice",
"source.runtime.RuntimeGlobalInfo",
"json.dumps"
] | [((183, 247), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Im2Latex Training Program"""'}), "(description='Im2Latex Training Program')\n", (206, 247), False, 'import argparse\n'), ((1888, 1915), 'source.runtime.RuntimeGlobalInfo', 'runtime.RuntimeGlobalInfo', ([], {}), '()\n', (1913, 1... |
import os
import random
import torch
import numpy as np
from time import time
from tqdm import tqdm
from copy import deepcopy
from pathlib import Path
from prettytable import PrettyTable
from common.test import test_v2
from common.utils import early_stopping, print_dict
from common.config import parse_args
from comm... | [
"os.mkdir",
"numpy.random.seed",
"common.test.test_v2",
"random.sample",
"torch.cat",
"common.dataset.CKGData",
"pathlib.Path",
"prettytable.PrettyTable",
"common.utils.print_dict",
"torch.no_grad",
"common.utils.early_stopping",
"torch.load",
"random.seed",
"torch.zeros",
"torch.cuda.se... | [((761, 791), 'tqdm.tqdm', 'tqdm', (['train_loader'], {'ascii': '(True)'}), '(train_loader, ascii=True)\n', (765, 791), False, 'from tqdm import tqdm\n'), ((2927, 2940), 'prettytable.PrettyTable', 'PrettyTable', ([], {}), '()\n', (2938, 2940), False, 'from prettytable import PrettyTable\n'), ((3351, 3383), 'pathlib.Pat... |
import numpy as np
import copy
from scipy import optimize
from astropy.stats import median_absolute_deviation
from astropy.table import Column, Table, vstack
from numpy.polynomial import legendre
from scipy import interpolate
from xwavecal.images import Image
from xwavecal.stages import Stage, ApplyCalibration
from x... | [
"xwavecal.utils.wavelength_utils.pixel_order_as_array",
"numpy.sum",
"numpy.allclose",
"xwavecal.utils.misc_utils.minmax",
"xwavecal.utils.wavelength_utils._sigma_clip",
"numpy.argmin",
"numpy.ones",
"numpy.isclose",
"numpy.arange",
"scipy.interpolate.interp1d",
"xwavecal.utils.wavelength_utils.... | [((806, 833), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (823, 833), False, 'import logging\n'), ((41291, 41326), 'numpy.arange', 'np.arange', (['min_pixel', '(max_pixel + 1)'], {}), '(min_pixel, max_pixel + 1)\n', (41300, 41326), True, 'import numpy as np\n'), ((42242, 42393), 'xwave... |
import sys
import numpy as np
from vebio.Utilities import dict_to_yaml, yaml_to_dict
from joblib import dump, load
import matplotlib as mpl
if len(sys.argv) > 1:
params_filename = sys.argv[1]
ve_params = yaml_to_dict(params_filename)
else:
ve_params = {}
font={'family':'Helvetica', 'size':'15'}
mpl.rc('f... | [
"vebio.Utilities.dict_to_yaml",
"matplotlib.rc",
"numpy.load",
"vebio.Utilities.yaml_to_dict",
"numpy.power",
"numpy.array",
"numpy.exp",
"joblib.load"
] | [((311, 333), 'matplotlib.rc', 'mpl.rc', (['"""font"""'], {}), "('font', **font)\n", (317, 333), True, 'import matplotlib as mpl\n'), ((333, 362), 'matplotlib.rc', 'mpl.rc', (['"""xtick"""'], {'labelsize': '(14)'}), "('xtick', labelsize=14)\n", (339, 362), True, 'import matplotlib as mpl\n'), ((362, 391), 'matplotlib.r... |
"""
data_curation_functions.py
Extract Kevin's functions for curation of public datasets
Modify them to match Jonathan's curation methods in notebook
01/30/2020
"""
import os
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib_venn import venn3
import seaborn as sns
impor... | [
"imp.reload",
"atomsci.ddm.utils.datastore_functions.dataset_key_exists",
"atomsci.ddm.utils.datastore_functions.upload_df_to_DS",
"atomsci.ddm.utils.datastore_functions.retrieve_dataset_by_datasetkey",
"atomsci.ddm.utils.datastore_functions.config_client",
"atomsci.ddm.utils.curate_data.average_and_remov... | [((6452, 6471), 'atomsci.ddm.utils.datastore_functions.config_client', 'dsf.config_client', ([], {}), '()\n', (6469, 6471), True, 'import atomsci.ddm.utils.datastore_functions as dsf\n'), ((11650, 11664), 'pandas.concat', 'pd.concat', (['lst'], {}), '(lst)\n', (11659, 11664), True, 'import pandas as pd\n'), ((14964, 14... |
# Licensed under an MIT style license -- see LICENSE.md
import numpy as np
import os
from pesummary.core.file.formats.base_read import (
Read, SingleAnalysisRead, MultiAnalysisRead
)
__author__ = ["<NAME> <<EMAIL>>"]
class SingleAnalysisDefault(SingleAnalysisRead):
"""Class to handle result files which only... | [
"pesummary.core.file.formats.csv.read_csv",
"pesummary.core.file.formats.numpy.read_numpy",
"pesummary.core.file.formats.sql.read_sql",
"pesummary.core.file.formats.hdf5.read_hdf5",
"os.path.isfile",
"numpy.array",
"pesummary.core.file.formats.base_read.Read.extension_from_path",
"pesummary.core.file.... | [((4663, 4709), 'pesummary.core.file.formats.base_read.Read.extension_from_path', 'Read.extension_from_path', (['path_to_results_file'], {}), '(path_to_results_file)\n', (4687, 4709), False, 'from pesummary.core.file.formats.base_read import Read, SingleAnalysisRead, MultiAnalysisRead\n'), ((6122, 6136), 'pesummary.cor... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | [
"torch.cuda.synchronize",
"trimesh.load",
"argparse.ArgumentParser",
"torch.cat",
"numpy.ones",
"numpy.linalg.norm",
"numpy.tile",
"torch.no_grad",
"soft_renderer.SoftRenderer",
"cv2.imwrite",
"ext_utils.joint_catalog.SMALJointInfo",
"os.path.dirname",
"numpy.transpose",
"torch.load",
"t... | [((669, 702), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""third_party"""'], {}), "(0, 'third_party')\n", (684, 702), False, 'import sys, os\n'), ((702, 726), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./"""'], {}), "(0, './')\n", (717, 726), False, 'import sys, os\n'), ((1174, 1218), 'argparse.ArgumentPa... |
import unittest
import numpy as np
class TestCase(unittest.TestCase):
def test_approx_k(self):
try:
from task import k, U, Sigma, Vt, approx
approx_test = U @ Sigma[:, :k] @ Vt[:k, :]
np.testing.assert_array_equal(approx, approx_test,
... | [
"numpy.testing.assert_array_equal"
] | [((235, 331), 'numpy.testing.assert_array_equal', 'np.testing.assert_array_equal', (['approx', 'approx_test', '"""The approximation does not look right."""'], {}), "(approx, approx_test,\n 'The approximation does not look right.')\n", (264, 331), True, 'import numpy as np\n')] |
import numpy as np
# Adapted from https://github.com/Hakuyume/chainer-ssd
def decode_onnx(loc, priors, variances):
"""Decode locations from predictions using priors to undo
the encoding we did for offset regression at train time.
Args:
loc (tensor): location predictions for loc layers,
... | [
"numpy.exp",
"numpy.concatenate"
] | [((1494, 1836), 'numpy.concatenate', 'np.concatenate', (['(priors[:, :2] + pre[:, :2] * variances[0] * priors[:, 2:], priors[:, :2] +\n pre[:, 2:4] * variances[0] * priors[:, 2:], priors[:, :2] + pre[:, 4:6] *\n variances[0] * priors[:, 2:], priors[:, :2] + pre[:, 6:8] * variances[0\n ] * priors[:, 2:], priors... |
#-*-coding:utf-8-*-
# date:2020-03-28
# Author: X.L.Eric
# function: image pixel - float (0.~1.)
import cv2 # 加载 OpenCV 库
import numpy as np # 加载 numpy 库
if __name__ == "__main__":
img_h = 480
img_w = 640
img = np.zeros([img_h,img_w], dtype = np.float)
cv2.namedWindow('image_0', 1)
cv2.imshow('ima... | [
"cv2.waitKey",
"cv2.imshow",
"numpy.zeros",
"cv2.namedWindow"
] | [((224, 264), 'numpy.zeros', 'np.zeros', (['[img_h, img_w]'], {'dtype': 'np.float'}), '([img_h, img_w], dtype=np.float)\n', (232, 264), True, 'import numpy as np\n'), ((271, 300), 'cv2.namedWindow', 'cv2.namedWindow', (['"""image_0"""', '(1)'], {}), "('image_0', 1)\n", (286, 300), False, 'import cv2\n'), ((305, 331), '... |
import numpy as np
import matplotlib.pyplot as plt
class House():
def __init__(self, K: float=0.5, C: float=0.3, Qhvac: float=9, hvacON: float=0, occupancy: float=1, Tin_initial: float=30):
self.K = K # thermal conductivity
self.C = C # thermal capacity
self.Tin = Tin_initial # Inside Tempe... | [
"numpy.full",
"random.randint",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"numpy.finfo",
"numpy.random.randint",
"matplotlib.pyplot.subplots"
] | [((592, 603), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (601, 603), True, 'import matplotlib.pyplot as plt\n'), ((632, 650), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {}), '(1, 1)\n', (644, 650), True, 'import matplotlib.pyplot as plt\n'), ((3837, 3849), 'matplotlib.pyplot.legend', ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
#0. SET PARAMETERS
###Path to directory with models (one or several models to be tested)
model_dir = ''
###DIRECTORY WITH IMAGES
#Tumor
base_dir_tu = ''
#Benign
base_dir_norm = ''
###OUTPUT DIRECTORY FOR RESULT FILES
result_dir = ''
###
#1. IMPORT... | [
"staintools.BrightnessStandardizer",
"keras.models.load_model",
"statistics.median",
"numpy.float32",
"staintools.StainNormalizer",
"numpy.expand_dims",
"staintools.read_image",
"keras.preprocessing.image.img_to_array",
"keras.preprocessing.image.load_img",
"numpy.array",
"PIL.ImageOps.flip",
... | [((867, 919), 'staintools.read_image', 'staintools.read_image', (['"""standard_he_stain_small.jpg"""'], {}), "('standard_he_stain_small.jpg')\n", (888, 919), False, 'import staintools\n'), ((970, 1005), 'staintools.BrightnessStandardizer', 'staintools.BrightnessStandardizer', ([], {}), '()\n', (1003, 1005), False, 'imp... |
"""Functions to configure energy demand outputs for supply model
"""
import os
import logging
import numpy as np
import pandas as pd
from energy_demand.basic import date_prop, testing_functions, lookup_tables
def constrained_results(
results_constrained,
results_unconstrained_no_heating,
submo... | [
"pandas.DataFrame",
"energy_demand.basic.lookup_tables.basic_lookups",
"logging.debug",
"numpy.sum",
"energy_demand.basic.date_prop.convert_h_to_day_year_and_h",
"energy_demand.basic.testing_functions.test_if_minus_value_in_array",
"logging.info"
] | [((5766, 5853), 'logging.info', 'logging.info', (['"""... Prepared results for energy supply model in unconstrained mode"""'], {}), "(\n '... Prepared results for energy supply model in unconstrained mode')\n", (5778, 5853), False, 'import logging\n'), ((7133, 7175), 'logging.info', 'logging.info', (['"""... writing... |
#!/usr/bin/env python
######################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2017, Rice University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that t... | [
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.plot",
"matplotlib.colors.Normalize",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.axis",
"numpy.cumsum",
"matplotlib.pyplot.figure",
"matplotlib.path.Path",
"numpy.sin",
"numpy.loadtxt",
"numpy.cos",
"matplotlib.pyplot.gca",
"matplotlib.pyplo... | [((2421, 2433), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (2431, 2433), True, 'import matplotlib.pyplot as plt\n'), ((2434, 2451), 'matplotlib.pyplot.axis', 'plt.axis', (['"""equal"""'], {}), "('equal')\n", (2442, 2451), True, 'import matplotlib.pyplot as plt\n'), ((2457, 2493), 'matplotlib.pyplot.axe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.