code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
File Name: DetectCubeCenter.py
Author: <NAME>
Description: This program calculates the center of a cube object
and sends it back to the Roborio via NetworkTables. This was created
for the 2018 FIRST Robotics Competition.
Copyright (c) <NAME> 2018
"""
import cv2
import numpy as np
from picamera.arra... | [
"cv2.GaussianBlur",
"cv2.findContours",
"cv2.circle",
"cv2.contourArea",
"cv2.bitwise_and",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.moments",
"camera.Camera",
"cv2.imshow",
"cv2.VideoCapture",
"cv2.setMouseCallback",
"numpy.array",
"networktables.NetworkTables.initialize",
"cv2.destroyAllWin... | [((525, 544), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (541, 544), False, 'import cv2\n'), ((552, 560), 'camera.Camera', 'Camera', ([], {}), '()\n', (558, 560), False, 'from camera import Camera\n'), ((570, 584), 'datatransfer.DataTransfer', 'DataTransfer', ([], {}), '()\n', (582, 584), False, 'f... |
"""
In this example we use the pysid library to estimate a SISO arx model
"""
#Import Libraries
from numpy import sqrt
from numpy.random import rand, randn #To generate the experiment
from scipy.signal import lfilter #To generate the data
from pysid import armax #To estimate an arx model
#True Sy... | [
"numpy.random.randn",
"scipy.signal.lfilter",
"pysid.armax",
"numpy.random.rand",
"numpy.sqrt"
] | [((1024, 1051), 'pysid.armax', 'armax', (['na', 'nb', 'nc', 'nk', 'u', 'y'], {}), '(na, nb, nc, nk, u, y)\n', (1029, 1051), False, 'from pysid import armax\n'), ((825, 836), 'numpy.random.randn', 'randn', (['N', '(1)'], {}), '(N, 1)\n', (830, 836), False, 'from numpy.random import rand, randn\n'), ((910, 936), 'scipy.s... |
#!/usr/bin/env python
# coding: utf-8
# <a href="https://colab.research.google.com/github/TrickyTroll/ML-intro/blob/Tricky/OCR.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# # Following a tutorial to learn about classification
#
# https://www.p... | [
"numpy.argmax",
"tensorflow.keras.layers.Dense",
"google.colab.patches.cv2_imshow",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"cv2.cvtColor",
"matplotlib.pyplot.imshow",
"matplotlib.pypl... | [((831, 848), 'tensorflow.keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (846, 848), False, 'from tensorflow.keras.datasets import mnist\n'), ((860, 894), 'numpy.vstack', 'np.vstack', (['[train_data, test_data]'], {}), '([train_data, test_data])\n', (869, 894), True, 'import numpy as np\n'), ((90... |
from pm4py.objects.log.importer.xes import importer as xes_importer
from pm4py.objects.log.util import get_log_representation
import pandas as pd
from sklearn.ensemble import IsolationForest
import numpy as np
import pickle as pickle
def find_anonmalies_with_isolation_forest(log, original_features, original_log_df,re... | [
"pandas.DataFrame",
"pickle.dump",
"sklearn.ensemble.IsolationForest",
"numpy.setxor1d",
"pm4py.objects.log.util.get_log_representation.get_representation",
"numpy.union1d"
] | [((370, 537), 'pm4py.objects.log.util.get_log_representation.get_representation', 'get_log_representation.get_representation', (['log'], {'str_ev_attr': "['concept:name']", 'str_tr_attr': '[]', 'num_ev_attr': '[]', 'num_tr_attr': '[]', 'str_evsucc_attr': "['concept:name']"}), "(log, str_ev_attr=['concept:name'],\n s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 27 16:35:53 2019
@author: essys
"""
import json
import numpy as np
import os
import skimage
import cv2
import time
import scipy.misc
from PIL import Image
dataset_dir = "/home/essys/datasets/bdd_dataset"
input_dir = 'labels'
mode = 'val'
images_... | [
"cv2.waitKey",
"cv2.destroyAllWindows",
"numpy.zeros",
"time.time",
"cv2.imread",
"numpy.array",
"numpy.int32",
"cv2.imshow",
"os.path.join"
] | [((329, 378), 'os.path.join', 'os.path.join', (['dataset_dir', '"""images"""', '"""100k"""', 'mode'], {}), "(dataset_dir, 'images', '100k', mode)\n", (341, 378), False, 'import os\n'), ((531, 570), 'os.path.join', 'os.path.join', (['dataset_dir', '"""annotation"""'], {}), "(dataset_dir, 'annotation')\n", (543, 570), Fa... |
# coding: utf-8
# In[1]:
import keras
import tensorflow as tf
from keras import backend as K
import numpy as np
import os
config=tf.ConfigProto(gpu_options=tf.GPUOptions(allow_growth=True))
session = tf.Session(config=config)
K.set_session(session)
from keras.models import Sequential,model_from_json
from keras.lay... | [
"numpy.argmax",
"keras.layers.Activation",
"keras.backend.set_session",
"tensorflow.Session",
"keras.layers.Dense",
"numpy.loadtxt",
"keras.models.Sequential",
"keras.optimizers.RMSprop",
"tensorflow.GPUOptions",
"keras.utils.to_categorical"
] | [((204, 229), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (214, 229), True, 'import tensorflow as tf\n'), ((230, 252), 'keras.backend.set_session', 'K.set_session', (['session'], {}), '(session)\n', (243, 252), True, 'from keras import backend as K\n'), ((2217, 2263), 'numpy.loa... |
import os
import sys
import gc
current_path = os.path.dirname(os.path.realpath(__file__))
root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(root_path)
import time
import json
import random
import math
from PIL import Image
import signal
import threading
import multiprocessing
im... | [
"numpy.random.seed",
"torch.cat",
"multiprocessing.get_context",
"gc.collect",
"torch.arange",
"torch.device",
"sklearn.svm.SVC",
"torch.no_grad",
"os.path.join",
"torch.isnan",
"sys.path.append",
"torch.logical_not",
"os.path.exists",
"experiments.distributed.ErrorHandler",
"random.seed... | [((164, 190), 'sys.path.append', 'sys.path.append', (['root_path'], {}), '(root_path)\n', (179, 190), False, 'import sys\n'), ((63, 89), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (79, 89), False, 'import os\n'), ((1543, 1580), 'os.path.join', 'os.path.join', (['model_path', '"""synthes... |
import json
import boto3
import logging
import io
import numpy as np
import pandas as pd
from utils import create_response_obj
# scaler = load(open('scaler.pkl', 'rb'))
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def post(event, context):
if event['body'] is not None:
body = json.loads(e... | [
"io.StringIO",
"json.loads",
"boto3.client",
"numpy.arange",
"numpy.array",
"utils.create_response_obj",
"logging.getLogger"
] | [((181, 200), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (198, 200), False, 'import logging\n'), ((1051, 1078), 'numpy.arange', 'np.arange', (['start', 'end', 'step'], {}), '(start, end, step)\n', (1060, 1078), True, 'import numpy as np\n'), ((1346, 1359), 'io.StringIO', 'io.StringIO', ([], {}), '()\n'... |
import csv
from ast import literal_eval
from collections import defaultdict
import click
import numpy as np
import torch
from tqdm import tqdm
from transformers import BertForTokenClassification, AlbertForTokenClassification, ElectraForTokenClassification, \
RobertaForTokenClassification, XLNetForTokenClassificati... | [
"utils.get_api_and_experiment",
"utils.f1_semeval",
"numpy.argmax",
"dataset.DatasetModule",
"model.LitModule.load_from_checkpoint",
"click.option",
"click.command",
"collections.defaultdict",
"numpy.mean",
"numpy.array",
"torch.no_grad"
] | [((742, 757), 'click.command', 'click.command', ([], {}), '()\n', (755, 757), False, 'import click\n'), ((759, 870), 'click.option', 'click.option', (['"""--experiment"""'], {'required': '(True)', 'type': 'str', 'help': '"""For example ce132011516346c99185d139fb23c70c"""'}), "('--experiment', required=True, type=str, h... |
"""Multi classifier testing"""
__author__ = 'thor'
import csv
import itertools
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from datetime import datetime
from sklearn.pipeline import Pipeline
from sklearn.model_selection import StratifiedKFold
from sklearn import ensemble
from skle... | [
"sklearn.datasets.load_iris",
"sklearn.preprocessing.StandardScaler",
"numpy.floor",
"sklearn.tree.DecisionTreeClassifier",
"numpy.shape",
"matplotlib.pyplot.style.use",
"sklearn.svm.SVC",
"itertools.cycle",
"pandas.DataFrame",
"sklearn.linear_model.SGDClassifier",
"ut.daf.manip.reorder_columns_... | [((1222, 1254), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (1235, 1254), True, 'import matplotlib.pyplot as plt\n'), ((1718, 1745), 'itertools.cycle', 'itertools.cycle', (["['o', 'D']"], {}), "(['o', 'D'])\n", (1733, 1745), False, 'import itertools\n'), ((1... |
import numpy
from trefoil.analysis.summary import summarize_areas_by_category, calculate_weighted_statistics
from trefoil.utilities.window import Window
# Days per month from Tim, starting with January. Useful for weighting statistics when rolling months up to year.
# Assumes 365 day calendar with no leap year... | [
"numpy.ones_like",
"numpy.abs",
"numpy.zeros",
"trefoil.analysis.summary.calculate_weighted_statistics",
"numpy.ma.masked_array",
"numpy.sqrt"
] | [((5469, 5483), 'numpy.sqrt', 'numpy.sqrt', (['r2'], {}), '(r2)\n', (5479, 5483), False, 'import numpy\n'), ((1886, 1930), 'numpy.ma.masked_array', 'numpy.ma.masked_array', (['data'], {'mask': 'areas.mask'}), '(data, mask=areas.mask)\n', (1907, 1930), False, 'import numpy\n'), ((3150, 3178), 'numpy.zeros', 'numpy.zeros... |
""" DataManager organizing the data for the benchmarks.
DataManager organizing the download of the data. Each data set should have an
own DataManger. The load function of a DataManger downloads the data from a
given online source and splits the data train, test and optional validation
splits.
For OpenML data sets (de... | [
"numpy.dstack",
"gzip.open",
"scipy.io.loadmat",
"numpy.float32",
"oslo_concurrency.lockutils.synchronized",
"urllib.request.urlopen",
"logging.getLogger",
"time.time",
"urllib.request.urlretrieve",
"numpy.product",
"pickle.load",
"numpy.mean",
"numpy.array",
"itertools.product",
"tarfil... | [((14909, 15057), 'oslo_concurrency.lockutils.synchronized', 'lockutils.synchronized', (['"""not_thread_process_safe"""'], {'external': '(True)', 'lock_path': 'f"""{hpolib.config_file.cache_dir}/lock_nasbench_201_data"""', 'delay': '(0.5)'}), "('not_thread_process_safe', external=True, lock_path=\n f'{hpolib.config_... |
import pandas as pd
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
# Read back in the normalised data
df = pd.read_csv('norm_auto_mpg.csv', sep=',')
# Sort the data into output and input
input_data = [[row['cylinders'], row['displacement'], row['horsepower'], row['weight'], row['accelerati... | [
"numpy.random.seed",
"matplotlib.pyplot.show",
"pandas.read_csv",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.placeholder",
"tensorflow.matmul",
"numpy.mean",
"tensorflow.random_normal",
"numpy.max",
"numpy.min",
"tensorflow.square",
"tensorflow.train.AdamOpt... | [((136, 177), 'pandas.read_csv', 'pd.read_csv', (['"""norm_auto_mpg.csv"""'], {'sep': '""","""'}), "('norm_auto_mpg.csv', sep=',')\n", (147, 177), True, 'import pandas as pd\n'), ((570, 587), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (584, 587), True, 'import numpy as np\n'), ((990, 1052), 'tensorf... |
from __future__ import print_function
from __future__ import division
import numpy as np
class OUNoise:
'''docstring for OUNoise'''
def __init__(self, action_dimension, mu=0, theta=0.15, sigma=0.2):
self.action_dimension = action_dimension
self.mu = mu
self.theta = theta
self... | [
"numpy.ones"
] | [((356, 386), 'numpy.ones', 'np.ones', (['self.action_dimension'], {}), '(self.action_dimension)\n', (363, 386), True, 'import numpy as np\n'), ((461, 491), 'numpy.ones', 'np.ones', (['self.action_dimension'], {}), '(self.action_dimension)\n', (468, 491), True, 'import numpy as np\n')] |
#externel
import torch
import csv, os
import numpy as np
import pickle as pk
import networkx as nx
import scipy.sparse as sp
from torch_geometric.utils import to_undirected
from torch_geometric.datasets import WebKB, WikipediaNetwork
#internel
from utils.hermitian import *
def load_cora(q, path = '../../dataset/cora/... | [
"csv.reader",
"os.makedirs",
"os.path.isdir",
"numpy.dtype",
"numpy.zeros",
"torch_geometric.utils.to_undirected",
"numpy.ones",
"networkx.generate_edgelist",
"os.path.isfile",
"scipy.sparse.csr_matrix",
"numpy.array",
"scipy.sparse.coo_matrix",
"torch.zeros",
"numpy.dot",
"networkx.DiGr... | [((1508, 1543), 'networkx.generate_edgelist', 'nx.generate_edgelist', (['G'], {'data': '(False)'}), '(G, data=False)\n', (1528, 1543), True, 'import networkx as nx\n'), ((1739, 1767), 'torch.from_numpy', 'torch.from_numpy', (['edge_index'], {}), '(edge_index)\n', (1755, 1767), False, 'import torch\n'), ((2631, 2682), '... |
from os import path
import numpy as np
import torch as ch
import pytorch_lightning as pl
from torch.utils.data import random_split, DataLoader, TensorDataset, Dataset
import scipy.stats as stats
DEFAULT_PATH = '../datasets/sequentially_encoded_spatial_wang_science_2018.npz'
DEFAULT_PATH = path.join(path.dirname(path... | [
"scipy.stats.expon.ppf",
"numpy.load",
"torch.randint",
"torch.utils.data.get_worker_info",
"torch.stack",
"torch.utils.data.DataLoader",
"scipy.stats.expon.fit",
"os.path.realpath",
"torch.index_select",
"numpy.mean",
"numpy.random.randint",
"torch.utils.data.TensorDataset",
"scipy.stats.ex... | [((5438, 5469), 'scipy.stats.expon.fit', 'stats.expon.fit', (['sample'], {'floc': '(0)'}), '(sample, floc=0)\n', (5453, 5469), True, 'import scipy.stats as stats\n'), ((316, 339), 'os.path.realpath', 'path.realpath', (['__file__'], {}), '(__file__)\n', (329, 339), False, 'from os import path\n'), ((1453, 1485), 'torch.... |
import itertools
import os
import pickle
import pandas as pd
import numpy as np
from plotly.subplots import make_subplots
import plotly.graph_objects as go
from clusterevaluator import SmellEvaluator
from clusterconfigurator import ClusterConfigurator
from data import Data
import cliffsDelta
#Rule-based Detector
fr... | [
"pandas.DataFrame",
"rulebased.detector.duplicateblocks.evaluate_script_with_rule",
"cliffsDelta.cliffsDelta",
"os.makedirs",
"rulebased.detector.toomanyattributes.evaluate_script_with_rule",
"os.path.dirname",
"clusterconfigurator.ClusterConfigurator",
"os.path.exists",
"plotly.graph_objects.Box",
... | [((731, 781), 'os.path.join', 'os.path.join', (['root_folder', '"""results"""', '"""case_study"""'], {}), "(root_folder, 'results', 'case_study')\n", (743, 781), False, 'import os\n'), ((796, 841), 'os.path.join', 'os.path.join', (['root_folder', '"""dataminer"""', '"""tmp"""'], {}), "(root_folder, 'dataminer', 'tmp')\... |
"""script runs small example of the animation manager usage"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
from mpl_animationmanager import AnimationManager
def fAnim(j, ax, lineColl):
'''define the modification animation function'''
ax.collections = [] # clean a... | [
"mpl_toolkits.mplot3d.axes3d.get_test_data",
"matplotlib.pyplot.figure",
"mpl_animationmanager.AnimationManager",
"numpy.cos"
] | [((409, 443), 'matplotlib.pyplot.figure', 'plt.figure', (['"""3D wireframe example"""'], {}), "('3D wireframe example')\n", (419, 443), True, 'import matplotlib.pyplot as plt\n'), ((573, 599), 'mpl_toolkits.mplot3d.axes3d.get_test_data', 'axes3d.get_test_data', (['(0.05)'], {}), '(0.05)\n', (593, 599), False, 'from mpl... |
__author__ = 'jeremy'
import os
import cv2
import numpy as np
import logging
logging.basicConfig(level=logging.INFO)
import json
from trendi import constants
from trendi.utils import imutils
from trendi import Utils
def convert_labels_dir(indir,outdir,jpgdir=None,converter=constants.fashionista_aug_zerobased_to_pixl... | [
"trendi.Utils.ensure_dir",
"json.dump",
"trendi.utils.imutils.show_mask_with_labels",
"logging.debug",
"logging.basicConfig",
"os.path.basename",
"cv2.imwrite",
"numpy.zeros",
"cv2.imread",
"os.path.isfile",
"os.path.join",
"os.listdir",
"numpy.unique"
] | [((78, 117), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (97, 117), False, 'import logging\n'), ((916, 940), 'trendi.Utils.ensure_dir', 'Utils.ensure_dir', (['outdir'], {}), '(outdir)\n', (932, 940), False, 'from trendi import Utils\n'), ((2864, 2899), 'numpy... |
import numpy as np
import pickle
from dias.dataIO.dataPreProcess import refine_gt
class IonoDataManager():
def __init__(self, cfgs):
"""load train and test list
"""
self.cfgs = cfgs
self.base_path = cfgs['Data']['BasePath']
train_list_file_path = self.base_path + cfgs['Data'... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"numpy.shape",
"matplotlib.pyplot.figure",
"pickle.load",
"numpy.max",
"dias.dataIO.dataPreProcess.refine_gt"
] | [((5042, 5054), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (5052, 5054), True, 'import matplotlib.pyplot as plt\n'), ((5059, 5079), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(1)', '(2)', '(1)'], {}), '(1, 2, 1)\n', (5070, 5079), True, 'import matplotlib.pyplot as plt\n'), ((5082, 5113), 'matplotli... |
import threading
import numpy as np
import multiprocessing
import time
import Queue
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class Iterator(object):
"""Abstract base class for image data iterators.
# Arguments
n: Integer, total number of... | [
"threading.Thread",
"numpy.random.seed",
"logging.basicConfig",
"multiprocessing.Lock",
"Queue.Queue",
"time.sleep",
"threading.Lock",
"numpy.arange",
"threading.Event",
"multiprocessing.Queue",
"numpy.random.permutation",
"multiprocessing.Event",
"multiprocessing.Process",
"logging.getLog... | [((100, 121), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (119, 121), False, 'import logging\n'), ((131, 158), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (148, 158), False, 'import logging\n'), ((768, 784), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (782... |
import getopt
import sys
import joblib
import numpy
import pandas
from IPython.display import display
from sklearn.dummy import DummyClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.feature_selection import SelectFromModel
from sklearn.linear_model import LogisticRegression
from sklearn.line... | [
"getopt.getopt",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"preprocessing.DataFrameOneHotEncoder",
"sklearn.preprocessing.MinMaxScaler",
"joblib.dump",
"numpy.logspace",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.svm.SVC",
"pandas.DataFrame",
"sklearn.dummy.DummyClassif... | [((3659, 3723), 'pandas.read_csv', 'pandas.read_csv', (['(self.dataFile if filename is None else filename)'], {}), '(self.dataFile if filename is None else filename)\n', (3674, 3723), False, 'import pandas\n'), ((4064, 4091), 'preprocessing.binarize', 'binarize', (['Yall'], {'threshold': '(3)'}), '(Yall, threshold=3)\n... |
import glob
import os
from pathlib import Path
from librosa import feature
import pandas as pd
import librosa
import datetime
import numpy as np
from sklearn.preprocessing import LabelEncoder
from tensorflow.keras.utils import to_categorical
from sklearn.model_selection import train_test_split
from sklearn.preprocessi... | [
"matplotlib.pyplot.title",
"tensorflow.keras.layers.Dense",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.figure",
"pathlib.Path",
"tensorflow.keras.models.Sequential",
"tensorflow.keras.backend.epsilon",
"librosa.feature.mfcc",
"tensorflow.keras.callbacks.EarlyStopping",
"pandas.... | [((1128, 1142), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1140, 1142), True, 'import pandas as pd\n'), ((2924, 2947), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (2945, 2947), False, 'import datetime\n'), ((3309, 3327), 'numpy.array', 'np.array', (['features'], {}), '(features)\n', ... |
import sys
import wandb
import numpy as np
import pandas as pd
import torch
from tqdm import tqdm
from torch.utils.data import DataLoader
from dataset import GrooveMidiDatasetTap2Drum, process_dataset
from utils import eval_log_freq, update_dict_with_tapped
import pickle
# Adding to path repos located at same level i... | [
"dataset.GrooveMidiDatasetTap2Drum",
"wandb.log",
"torch.nn.MSELoss",
"torch.nn.BCEWithLogitsLoss",
"torch.utils.data.DataLoader",
"wandb.finish",
"wandb.watch",
"Subset_Creators.subsetters.GrooveMidiSubsetter",
"dataset.process_dataset",
"utils.update_dict_with_tapped",
"sys.path.insert",
"Gr... | [((369, 420), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../BaseGrooveTransformers/"""'], {}), "(1, '../../BaseGrooveTransformers/')\n", (384, 420), False, 'import sys\n'), ((421, 469), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../BaseGrooveTransformers/"""'], {}), "(1, '../BaseGrooveTransformers/')... |
# coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. 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 re... | [
"numpy.sum",
"megatron.initialize.initialize_megatron",
"megatron.text_generation_utils.pad_batch",
"megatron.get_args",
"os.path.dirname",
"megatron.get_tokenizer",
"megatron.checkpointing.load_checkpoint",
"megatron.model.GPT2Model",
"torch.cuda.LongTensor",
"megatron.training.get_model",
"meg... | [((1528, 1567), 'megatron.print_rank_0', 'print_rank_0', (['"""building GPT2 model ..."""'], {}), "('building GPT2 model ...')\n", (1540, 1567), False, 'from megatron import print_rank_0\n'), ((1580, 1630), 'megatron.model.GPT2Model', 'GPT2Model', ([], {'num_tokentypes': '(0)', 'parallel_output': '(False)'}), '(num_tok... |
from os import getcwd, listdir
import numpy as np
from scipy import signal as sp
from higrid.utils import wavread
def emulatescene(insig, gain, irspath):
"""
Emulates a scene by convolving a source input signal with em32 AIRs
:param insig: (Single-channel) input signal
:param gain: Gain (scalar)
... | [
"higrid.utils.wavread",
"os.getcwd",
"numpy.zeros",
"scipy.signal.fftconvolve",
"os.listdir",
"numpy.sqrt"
] | [((448, 464), 'os.listdir', 'listdir', (['irspath'], {}), '(irspath)\n', (455, 464), False, 'from os import getcwd, listdir\n'), ((494, 524), 'higrid.utils.wavread', 'wavread', (["(irspath + '/' + dr[0])"], {}), "(irspath + '/' + dr[0])\n", (501, 524), False, 'from higrid.utils import wavread\n'), ((534, 564), 'numpy.z... |
import numpy as np
from fractions import Fraction
abcd=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
a=np.array([(3,3),(2,5)])
print(a)
ste=input("Ente... | [
"numpy.dot",
"numpy.linalg.det",
"numpy.array",
"numpy.matmul"
] | [((270, 296), 'numpy.array', 'np.array', (['[(3, 3), (2, 5)]'], {}), '([(3, 3), (2, 5)])\n', (278, 296), True, 'import numpy as np\n'), ((683, 711), 'numpy.array', 'np.array', (['[(5, -3), (-2, 3)]'], {}), '([(5, -3), (-2, 3)])\n', (691, 711), True, 'import numpy as np\n'), ((1072, 1088), 'numpy.dot', 'np.dot', (['inv'... |
import random
import numpy as np
import matplotlib.pyplot as plt
class ColoredPath:
COLORMAPS = plt.colormaps()
def __init__(self, path, shape) -> None:
self.path = path
self.img = np.zeros((shape[0],shape[1],3))
def get_colored_path(self, cmap=None):
if cmap is None: cmap = random... | [
"random.choice",
"numpy.zeros",
"matplotlib.pyplot.cm.get_cmap",
"matplotlib.pyplot.colormaps"
] | [((101, 116), 'matplotlib.pyplot.colormaps', 'plt.colormaps', ([], {}), '()\n', (114, 116), True, 'import matplotlib.pyplot as plt\n'), ((206, 239), 'numpy.zeros', 'np.zeros', (['(shape[0], shape[1], 3)'], {}), '((shape[0], shape[1], 3))\n', (214, 239), True, 'import numpy as np\n'), ((363, 384), 'matplotlib.pyplot.cm.... |
import torch
from pytorch_toolbelt.utils.torch_utils import count_parameters
from torch import nn
from xview.dataset import OUTPUT_MASK_KEY
from xview.losses import ArcFaceLoss2d, OHEMCrossEntropyLoss
from xview.models.deeplab import resnet34_deeplab128
from xview.models.fpn_v2 import (
resnet101_fpncatv2_256,
... | [
"xview.models.hrnet_arc.hrnet18_arc",
"xview.models.selim.unet.DensenetUnet",
"xview.losses.OHEMCrossEntropyLoss",
"xview.models.unetv2.resnet101_unet_v2",
"torch.randn",
"xview.models.unet.resnet18_unet32",
"xview.losses.ArcFaceLoss2d",
"torch.no_grad",
"pytorch_toolbelt.utils.torch_utils.count_par... | [((1005, 1020), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1018, 1020), False, 'import torch\n'), ((1283, 1298), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1296, 1298), False, 'import torch\n'), ((1466, 1481), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1479, 1481), False, 'import torch\n')... |
import pandas as pd
from utils_dr_pre_word_simi import *
import os
from utils import *
from transformers import *
from dataset import Dataset_dr
import torch
import numpy as np
TRAIN_DR = './con_rew_data/para/train.csv'
DEV_DR = './con_rew_data/para/dev.csv'
TEST_DR = './con_rew_data/para/test.csv'
fw = ... | [
"pandas.DataFrame",
"torch.ones",
"os.path.abspath",
"dataset.Dataset_dr",
"pandas.read_csv",
"torch.cuda.is_available",
"numpy.array",
"torch.zeros"
] | [((1956, 1980), 'pandas.read_csv', 'pd.read_csv', (['ROC_TEST_HE'], {}), '(ROC_TEST_HE)\n', (1967, 1980), True, 'import pandas as pd\n'), ((3817, 3838), 'os.path.abspath', 'os.path.abspath', (['file'], {}), '(file)\n', (3832, 3838), False, 'import os\n'), ((447, 472), 'torch.cuda.is_available', 'torch.cuda.is_available... |
import numpy as np
import cv2
import imutils
import datetime
import base64
import re
import time
import socketio
import eventlet
import os
from pyzbar import pyzbar
from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponseRedirect
from django.urls import reverse
from we... | [
"os.mkdir",
"cv2.putText",
"django.utils.timezone.now",
"pyzbar.pyzbar.decode",
"socketio.Server",
"cv2.imdecode",
"datetime.datetime.now",
"cv2.rectangle",
"django.urls.reverse",
"cv2.VideoWriter",
"django.shortcuts.render",
"re.sub",
"numpy.fromstring"
] | [((943, 981), 'socketio.Server', 'socketio.Server', ([], {'async_mode': 'async_mode'}), '(async_mode=async_mode)\n', (958, 981), False, 'import socketio\n'), ((1854, 1979), 'cv2.VideoWriter', 'cv2.VideoWriter', (['f"""{settings.MEDIA_ROOT}/{section_id}/capture.mp4"""', '(33)', '(24)', '(settings.VIDEO_WIDTH, settings.V... |
import numpy as np
import math
from math import pi
from math import log
import torch
import torch.nn.functional as F
from .submodule import calc_A_re, calc_A_im
from .submodule import display_result
def DP_DRT(freq_vec, Z_exp, lambda_limit=1e-4, learning_rate=1e-5, display=False):
gamma, R_inf = train_model(freq_... | [
"torch.randn",
"torch.mm",
"torch.nn.init.zeros_",
"numpy.imag",
"numpy.real",
"torch.nn.Linear",
"torch.from_numpy"
] | [((1206, 1223), 'torch.randn', 'torch.randn', (['(1)', '(1)'], {}), '(1, 1)\n', (1217, 1223), False, 'import torch\n'), ((892, 916), 'torch.from_numpy', 'torch.from_numpy', (['A_re.T'], {}), '(A_re.T)\n', (908, 916), False, 'import torch\n'), ((958, 982), 'torch.from_numpy', 'torch.from_numpy', (['A_im.T'], {}), '(A_im... |
import numpy as np
from tqdm.auto import tqdm
import iisignature
from joblib import Parallel, delayed
import utils
class Price(object):
"""Base class for data (i.e. price models)."""
def __init__(self, *args, **kwargs):
pass
@staticmethod
def _sig(path, order):
return np.r_[1., iisi... | [
"numpy.random.seed",
"tqdm.auto.tqdm",
"utils.transform",
"numpy.array",
"numpy.mean",
"joblib.Parallel",
"joblib.delayed"
] | [((531, 551), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (545, 551), True, 'import numpy as np\n'), ((1391, 1412), 'numpy.mean', 'np.mean', (['sigs'], {'axis': '(0)'}), '(sigs, axis=0)\n', (1398, 1412), True, 'import numpy as np\n'), ((645, 664), 'joblib.Parallel', 'Parallel', ([], {'n_jobs': '(... |
from typing import Callable
import numpy as np
from ..situation import Situation
from ..utils import get_rng
def play_strategies(game,
strategies,
*,
rng=None,
seed=None,
start: Situation = None,
... | [
"numpy.mean",
"numpy.var"
] | [((1834, 1858), 'numpy.mean', 'np.mean', (['payoffs'], {'axis': '(0)'}), '(payoffs, axis=0)\n', (1841, 1858), True, 'import numpy as np\n'), ((1860, 1883), 'numpy.var', 'np.var', (['payoffs'], {'axis': '(0)'}), '(payoffs, axis=0)\n', (1866, 1883), True, 'import numpy as np\n')] |
import argparse
import time
import os
import time
import logging, numpy as np
from src import utils as U
from utils import Model, update_parameters
logging.getLogger().setLevel(logging.INFO)
def init_parser():
parser = argparse.ArgumentParser(description='Method for Skeleton-based Action Recognition')
# ... | [
"utils.Model",
"argparse.ArgumentParser",
"utils.update_parameters",
"os.getcwd",
"numpy.random.randn",
"time.time",
"logging.info",
"logging.getLogger"
] | [((229, 317), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Method for Skeleton-based Action Recognition"""'}), "(description=\n 'Method for Skeleton-based Action Recognition')\n", (252, 317), False, 'import argparse\n'), ((3066, 3097), 'utils.update_parameters', 'update_parameters',... |
import string
import numpy as np
import tensorflow as tf
from distutils.version import LooseVersion
TF_VERSION_MIN = '1.1'
def check_tf(tf_):
error_message = "Please use TensorFlow {} or later".format(TF_VERSION_MIN)
tf_version = tf_.__version__
condition = LooseVersion(tf_version) > LooseVersion(TF_VERS... | [
"numpy.full",
"distutils.version.LooseVersion",
"tensorflow.Session",
"tensorflow.constant",
"tensorflow.set_random_seed",
"numpy.random.randint",
"tensorflow.Graph",
"numpy.array_equal",
"tensorflow.get_default_graph"
] | [((898, 924), 'numpy.random.randint', 'np.random.randint', (['(1)', '(5)', '(2)'], {}), '(1, 5, 2)\n', (915, 924), True, 'import numpy as np\n'), ((937, 962), 'numpy.random.randint', 'np.random.randint', (['(1)', '(100)'], {}), '(1, 100)\n', (954, 962), True, 'import numpy as np\n'), ((974, 1019), 'numpy.full', 'np.ful... |
#!/usr/bin/env python3
import numpy as np
import scipy
import copy as cp
import warnings
try:
import utils.math_tools as umath
import utils.optimize as uopt
from utils.math_tools import AVAILABLE_OUTPUT_ACTIVATIONS
except ModuleNotFoundError:
import lib.utils.math_tools as umath
import lib.utils.op... | [
"sklearn.datasets.load_iris",
"numpy.moveaxis",
"lib.utils.optimize.SGA",
"sklearn.model_selection.train_test_split",
"numpy.allclose",
"numpy.ones",
"matplotlib.pyplot.figure",
"numpy.exp",
"lib.utils.optimize.NewtonRaphson",
"warnings.simplefilter",
"warnings.catch_warnings",
"numpy.linspace... | [((11730, 11750), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (11748, 11750), False, 'from sklearn import datasets\n'), ((12332, 12399), 'sklearn.model_selection.train_test_split', 'sk_modsel.train_test_split', (['X', 'y'], {'test_size': 'test_size', 'shuffle': '(True)'}), '(X, y, test_size=te... |
#!/usr/bin/env python3
import os
import numpy as np
import glob
import re
import json
from collections import defaultdict, OrderedDict
from matplotlib.patches import Rectangle
from matplotlib.lines import Line2D
from matplotlib.text import Text
from matplotlib.font_manager import FontProperties
import matplotlib.pyplot... | [
"collections.defaultdict",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"glob.glob",
"matplotlib.pyplot.tick_params",
"matplotlib.font_manager.FontProperties",
"matplotlib.patches.Rectangle",
"matplotlib.rcParams.update",
"os.path.exists",
"re.search",
"matplotlib.text.Text",
"matplotl... | [((353, 393), 'matplotlib.rcParams.update', 'mpl.rcParams.update', (['mpl.rcParamsDefault'], {}), '(mpl.rcParamsDefault)\n', (372, 393), True, 'import matplotlib as mpl\n'), ((402, 426), 'collections.defaultdict', 'defaultdict', (['(lambda : [])'], {}), '(lambda : [])\n', (413, 426), False, 'from collections import def... |
#!/usr/bin/env python3
# -*- coding=utf-8 -*-
from __future__ import print_function
from license_plate import LicensePlateDetector
from imutils import paths
import numpy as np
import argparse
import imutils
import cv2 as cv
import logging
__version__ = "1.0.0"
logging.basicConfig(level=logging.INFO,
... | [
"numpy.dstack",
"imutils.paths.list_images",
"argparse.ArgumentParser",
"logging.basicConfig",
"license_plate.LicensePlateDetector",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.imread",
"numpy.vstack",
"numpy.array",
"imutils.resize",
"cv2.drawContours",
"cv2.imshow",
"logging.getLogger"
... | [((278, 428), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""[%(asctime)8s][%(filename)s][%(levelname)s] - %(message)s"""', 'datefmt': '"""%a, %d %b %Y %H:%M:%S"""'}), "(level=logging.INFO, format=\n '[%(asctime)8s][%(filename)s][%(levelname)s] - %(message)s', datefmt=\n ... |
from keras.models import model_from_json
from keras.optimizers import RMSprop
import numpy as np
import csv
## Loads model weights.
with open('06.CIFAR-10_CombinedNet.config', 'r') as text_file:
json_config = text_file.read()
model = model_from_json(json_config)
model.load_weights('06.CIFAR-10_CombinedNet.... | [
"numpy.load",
"keras.models.model_from_json",
"csv.writer",
"numpy.argmax"
] | [((384, 422), 'numpy.load', 'np.load', (['"""06.Kaggle_CIFAR-10_test.npz"""'], {}), "('06.Kaggle_CIFAR-10_test.npz')\n", (391, 422), True, 'import numpy as np\n'), ((601, 631), 'numpy.argmax', 'np.argmax', (['predictions'], {'axis': '(1)'}), '(predictions, axis=1)\n', (610, 631), True, 'import numpy as np\n'), ((243, 2... |
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('inputdir')
parser.add_argument("-p", dest='postfix', default='', help="plot postfix")
parser.add_argument("-c", dest='compa... | [
"numpy.load",
"argparse.ArgumentParser",
"matplotlib.pyplot.clf",
"numpy.logspace",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"pandas.DataFrame",
"scipy.interpolate.InterpolatedUnivariateSpline",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"sklearn.metrics.roc_auc_score",
... | [((57, 78), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (71, 78), False, 'import matplotlib\n'), ((157, 173), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (171, 173), False, 'from argparse import ArgumentParser\n'), ((829, 841), 'matplotlib.pyplot.figure', 'plt.figure', ([], ... |
from pathlib import Path
import sys
path = str(Path(Path(__file__).parent.absolute()).parent.absolute())
sys.path.insert(0, path)
from sklearn.cluster import DBSCAN
from sklearn.decomposition import PCA
from sklearn.metrics import accuracy_score, adjusted_rand_score
from sklearn.preprocessing import StandardScaler
from... | [
"numpy.zeros_like",
"sklearn.preprocessing.StandardScaler",
"math.ceil",
"sklearn.metrics.accuracy_score",
"numpy.unique",
"sys.path.insert",
"pathlib.Path",
"numpy.where",
"tabulate.tabulate",
"sklearn.metrics.adjusted_rand_score",
"numpy.bincount",
"sklearn.cluster.DBSCAN"
] | [((105, 129), 'sys.path.insert', 'sys.path.insert', (['(0)', 'path'], {}), '(0, path)\n', (120, 129), False, 'import sys\n'), ((489, 506), 'numpy.unique', 'np.unique', (['_y_int'], {}), '(_y_int)\n', (498, 506), True, 'import numpy as np\n'), ((1158, 1202), 'sklearn.cluster.DBSCAN', 'DBSCAN', ([], {'eps': 'epsilon', 'm... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#-------------------------------------------------------------------------------
'''
@Author : {SEASON}
@License : (C) Copyright 2013-2022, {OLD_IT_WANG}
@Contact : {<EMAIL>}
@Software: PyCharm
@File : NLP_DEMO -- semantic network
@Time : 2020/6/2 10:51... | [
"pandas.DataFrame",
"jieba.cut",
"numpy.zeros",
"matplotlib.pyplot.figure",
"networkx.spring_layout",
"networkx.Graph",
"numpy.arange",
"collections.Counter",
"re.sub",
"matplotlib.pyplot.savefig",
"re.compile"
] | [((606, 616), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (614, 616), True, 'import networkx as nx\n'), ((618, 647), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(100, 70)'}), '(figsize=(100, 70))\n', (628, 647), True, 'import matplotlib.pyplot as plt\n'), ((900, 941), 're.compile', 're.compile', (['... |
"""
Test file for analysis of pNEUMA data
"""
from pneumapackage.settings import *
import pneumapackage.compute as cp
from pneumapackage.__init__ import read_pickle, write_pickle, path_data, path_results
import pneumapackage.iodata as rd
import test_network as tn
import test_data as td
import numpy as np
import panda... | [
"matplotlib.pyplot.title",
"numpy.arange",
"os.path.join",
"matplotlib.pyplot.Normalize",
"pandas.DataFrame",
"pneumapackage.iodata.get_group",
"pneumapackage.compute.vehicle_crossings",
"matplotlib.pyplot.close",
"test_data.get_hdf_names",
"matplotlib.pyplot.subplots",
"pandas.concat",
"matpl... | [((1290, 1339), 'pneumapackage.compute.vehicle_crossings', 'cp.vehicle_crossings', (['line_traj', 'df_det'], {}), '(line_traj, df_det, **kwargs)\n', (1310, 1339), True, 'import pneumapackage.compute as cp\n'), ((1554, 1580), 'test_data.get_hdf_names', 'td.get_hdf_names', (['group_id'], {}), '(group_id)\n', (1570, 1580)... |
import pandas as pd
import csv
import numpy as np
import glob
def gain_pools(directory, predmonth, stocknum):
selected_model = directory + 'for' + predmonth + '\\SelectedModels' + predmonth + '.csv'
df = pd.read_csv(selected_model)
df = df.ix[:, 2:]
stockpool = []
for j in range(len(df.columns))... | [
"csv.reader",
"csv.writer",
"pandas.read_csv",
"numpy.array",
"glob.glob"
] | [((2037, 2093), 'glob.glob', 'glob.glob', (["(path0 + '/monthly/ReportDF_V*_V*_Index*_MP*/')"], {}), "(path0 + '/monthly/ReportDF_V*_V*_Index*_MP*/')\n", (2046, 2093), False, 'import glob\n'), ((215, 242), 'pandas.read_csv', 'pd.read_csv', (['selected_model'], {}), '(selected_model)\n', (226, 242), True, 'import pandas... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import dataset as data
import utils
X, y, tX, ty = data.get_data()
X = data.normalize(X)
tX = data.normalize(tX)
X = X[:15000]
tX = tX[:1000]
y = y[:15000]
ty = ty[:1000]
#region init w and b
k = 1e-2
w1 = np.random.uniform(-10, 10, (X.shape[1... | [
"pandas.DataFrame",
"numpy.random.uniform",
"matplotlib.pyplot.show",
"utils.dReLU",
"matplotlib.pyplot.plot",
"utils.Randomize",
"numpy.argmax",
"utils.Softmax",
"dataset.normalize",
"dataset.get_data",
"utils.ReLU",
"utils.CELoss",
"matplotlib.pyplot.subplots"
] | [((124, 139), 'dataset.get_data', 'data.get_data', ([], {}), '()\n', (137, 139), True, 'import dataset as data\n'), ((145, 162), 'dataset.normalize', 'data.normalize', (['X'], {}), '(X)\n', (159, 162), True, 'import dataset as data\n'), ((168, 186), 'dataset.normalize', 'data.normalize', (['tX'], {}), '(tX)\n', (182, 1... |
import argparse
import os
import random
import shutil
import warnings
import sys
warnings.filterwarnings("ignore")
from keras import backend as K
import numpy as np
from PIL import Image, ImageFilter
from skimage.measure import compare_ssim as SSIM
import keras
import tensorflow as tf
import os
from helper import lo... | [
"keras.models.load_model",
"numpy.save",
"helper.load_data",
"warnings.filterwarnings",
"numpy.append",
"helper.Coverage",
"numpy.array"
] | [((82, 115), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (105, 115), False, 'import warnings\n'), ((935, 953), 'helper.load_data', 'load_data', (['dataset'], {}), '(dataset)\n', (944, 953), False, 'from helper import load_data\n'), ((1145, 1167), 'keras.models.load_mode... |
#
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"packaging.version.parse",
"tsfresh.extract_features",
"numpy.unique"
] | [((2982, 3103), 'tsfresh.extract_features', 'extract_features', (['input_df'], {'column_id': 'column_id', 'column_sort': 'column_sort', 'kind_to_fc_parameters': 'kind_to_fc_parameters'}), '(input_df, column_id=column_id, column_sort=column_sort,\n kind_to_fc_parameters=kind_to_fc_parameters)\n', (2998, 3103), False,... |
''''| Author: <NAME>
| Date: 29/09/2018
| https://github.com/Jeanvit/PySkinDetection
'''
import cv2
import numpy as np
import os
import sys
import time
class SkinDetector(object):
# class constructor
def __init__(self, imageName, saveName):
self.image = cv2.imread(imageName)
self.save_name... | [
"sys.stdout.write",
"cv2.bitwise_and",
"cv2.dilate",
"cv2.cvtColor",
"cv2.imwrite",
"cv2.threshold",
"cv2.add",
"cv2.watershed",
"cv2.imread",
"numpy.array",
"cv2.convertScaleAbs",
"numpy.int32",
"sys.stdout.flush",
"cv2.erode",
"cv2.inRange",
"os.listdir"
] | [((3936, 3956), 'os.listdir', 'os.listdir', (['base_dir'], {}), '(base_dir)\n', (3946, 3956), False, 'import os\n'), ((276, 297), 'cv2.imread', 'cv2.imread', (['imageName'], {}), '(imageName)\n', (286, 297), False, 'import cv2\n'), ((607, 650), 'cv2.cvtColor', 'cv2.cvtColor', (['self.image', 'cv2.COLOR_BGR2HSV'], {}), ... |
import os, re
import json
from PIL import Image, ImageDraw
import PIL.ImageFile
import numpy as np
import scipy.ndimage
src = '/Volumes/CKXZ 1/@City/363, FP/Dataset(s)/sorted img_dataset/'
data = open('/Volumes/CKXZ 1/@City/363, FP/Dataset(s)/improved_facial_landmarks img_dataset_v1/facial_landmarks.json')
data = json... | [
"numpy.stack",
"os.mkdir",
"json.load",
"numpy.median",
"numpy.float32",
"os.path.exists",
"numpy.flipud",
"numpy.clip",
"PIL.Image.open",
"numpy.hypot",
"os.path.isfile",
"numpy.mean",
"numpy.array",
"numpy.rint",
"PIL.ImageDraw.Draw",
"re.sub"
] | [((316, 331), 'json.load', 'json.load', (['data'], {}), '(data)\n', (325, 331), False, 'import json\n'), ((535, 558), 'os.path.exists', 'os.path.exists', (['dst_dir'], {}), '(dst_dir)\n', (549, 558), False, 'import os, re\n'), ((562, 579), 'os.mkdir', 'os.mkdir', (['dst_dir'], {}), '(dst_dir)\n', (570, 579), False, 'im... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 18 15:31:36 2017
@author: mirla
"""
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
#%%
# AND
entradas = np.array([[0,0],[0,1], [1,0], [1,1]])
saidas = np.array([0,0,0,1])
# OR
#entradas = np.array([[0,0],[0,1], [1,0], [1,1]])
#sa... | [
"matplotlib.pyplot.xlim",
"numpy.meshgrid",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"seaborn.scatterplot",
"matplotlib.pyplot.ylim",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.contourf",
"matplotlib.pyplot.tight_layout"
] | [((191, 233), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [1, 0], [1, 1]]'], {}), '([[0, 0], [0, 1], [1, 0], [1, 1]])\n', (199, 233), True, 'import numpy as np\n'), ((239, 261), 'numpy.array', 'np.array', (['[0, 0, 0, 1]'], {}), '([0, 0, 0, 1])\n', (247, 261), True, 'import numpy as np\n'), ((354, 367), 'numpy.zeros... |
"""
1. Used skills not mentioned in zero shot paper:
1. random crop, fill_mode='reflect'
2. horizontal_flip
3. nesterov momentum
"""
import os
import sys
import math
import numpy as np
import tensorflow as tf
from utils.preprocess import get_cifar10_data
from utils.preprocess import get_fashion_mnist_data
f... | [
"net.wide_resnet.WideResidualNetwork",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.models.load_model",
"os.makedirs",
"argparse.ArgumentParser",
"os.getcwd",
"utils.preprocess.to_categorical",
"utils.preprocess.get_cifar10_data",
"tensorflow.keras.callbacks.ModelChec... | [((1684, 1720), 'os.makedirs', 'os.makedirs', (['save_dir'], {'exist_ok': '(True)'}), '(save_dir, exist_ok=True)\n', (1695, 1720), False, 'import os\n'), ((1843, 1857), 'utils.seed.set_seed', 'set_seed', (['seed'], {}), '(seed)\n', (1851, 1857), False, 'from utils.seed import set_seed\n'), ((3041, 3068), 'utils.preproc... |
import random
import numpy as np
from codit.outbreak import Outbreak
from codit.outbreak_recorder import VariantComponent
from codit.society import TestingTracingSociety, ContactTestingSociety
from codit.society.strategic import TwoTrackTester
from codit.disease import Covid
ALL_TIME_DAYS = 15
def test_covid_model(... | [
"codit.outbreak_recorder.VariantComponent",
"codit.society.ContactTestingSociety",
"numpy.random.seed",
"codit.society.strategic.TwoTrackTester",
"codit.disease.Covid",
"random.seed",
"numpy.testing.assert_allclose"
] | [((418, 433), 'random.seed', 'random.seed', (['(42)'], {}), '(42)\n', (429, 433), False, 'import random\n'), ((438, 456), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (452, 456), True, 'import numpy as np\n'), ((692, 1332), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['o.recorder... |
"""
Copyright (c) 2022-2022 Blue Brain Project/EPFL
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | [
"numpy.median",
"logging.getLogger",
"numpy.where",
"numpy.linalg.norm",
"numpy.all"
] | [((697, 724), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (714, 724), False, 'import logging\n'), ((1977, 2042), 'numpy.linalg.norm', 'np.linalg.norm', (['(points[edges[:, 1]] - points[edges[:, 0]])'], {'axis': '(1)'}), '(points[edges[:, 1]] - points[edges[:, 0]], axis=1)\n', (1991, 20... |
class Metrics(object):
def sum(self, array, axis=None):
raise NotImplementedError('Abstract method')
def max(self, array, axis=None):
raise NotImplementedError('Abstract method')
def min(self, array, axis=None):
raise NotImplementedError('Abstract method')
def expand_dims(self... | [
"numpy.sum",
"numpy.expand_dims",
"emd.emd",
"numpy.max",
"numpy.min",
"numpy.sqrt"
] | [((4533, 4557), 'numpy.sum', 'np.sum', (['array'], {'axis': 'axis'}), '(array, axis=axis)\n', (4539, 4557), True, 'import numpy as np\n'), ((4611, 4635), 'numpy.max', 'np.max', (['array'], {'axis': 'axis'}), '(array, axis=axis)\n', (4617, 4635), True, 'import numpy as np\n'), ((4689, 4713), 'numpy.min', 'np.min', (['ar... |
#!/usr/bin/env python
# coding: utf8
""" Unit testing for Separator class. """
__email__ = '<EMAIL>'
__author__ = '<NAME>'
__license__ = 'MIT License'
from os import makedirs
from os.path import join
from tempfile import TemporaryDirectory
import pytest
import numpy as np
from spleeter.__main__ import evaluate
fro... | [
"tempfile.TemporaryDirectory",
"os.makedirs",
"spleeter.__main__.evaluate",
"numpy.median",
"spleeter.audio.adapter.AudioAdapter.default",
"numpy.random.RandomState",
"pytest.mark.parametrize",
"os.path.join"
] | [((1558, 1613), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""backend"""', 'TEST_CONFIGURATIONS'], {}), "('backend', TEST_CONFIGURATIONS)\n", (1581, 1613), False, 'import pytest\n'), ((1074, 1096), 'spleeter.audio.adapter.AudioAdapter.default', 'AudioAdapter.default', ([], {}), '()\n', (1094, 1096), False... |
# -*- coding: utf-8 -*-
"""
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
"""
import os
import... | [
"matplotlib.pyplot.title",
"os.walk",
"matplotlib.pyplot.figure",
"numpy.mean",
"os.path.join",
"os.chdir",
"labelme.utils.newIcon",
"os.path.exists",
"re.findall",
"traceback.format_exc",
"matplotlib.pyplot.pause",
"subprocess.Popen",
"matplotlib.pyplot.show",
"os.path.basename",
"matpl... | [((796, 824), 'logging.getLogger', 'logging.getLogger', (['"""sdktool"""'], {}), "('sdktool')\n", (813, 824), False, 'import logging\n'), ((4774, 4796), 'os.walk', 'os.walk', (['directoryName'], {}), '(directoryName)\n', (4781, 4796), False, 'import os\n'), ((5967, 5978), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (59... |
import os
import pdb
import random
import tempfile
import fastestimator as fe
import numpy as np
import tensorflow as tf
from fastestimator.dataset import LabeledDirDataset
from fastestimator.op.numpyop.meta import OneOf
from fastestimator.op.numpyop.numpyop import NumpyOp
from fastestimator.op.numpyop.univariate impo... | [
"PIL.ImageEnhance.Brightness",
"fastestimator.schedule.cosine_decay",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.matmul",
"fastestimator.op.numpyop.meta.OneOf",
"os.path.join",
"tensorflow.nn.s... | [((7694, 7727), 'tensorflow.matmul', 'tf.matmul', (['q', 'k'], {'transpose_b': '(True)'}), '(q, k, transpose_b=True)\n', (7703, 7727), True, 'import tensorflow as tf\n'), ((7857, 7904), 'tensorflow.nn.softmax', 'tf.nn.softmax', (['scaled_attention_logits'], {'axis': '(-1)'}), '(scaled_attention_logits, axis=-1)\n', (78... |
import numpy as np
class Grid():
"""
This class contains all data related to the grid in which the game is contained.
The information is stored as a numpy array of pixels.
The grid is treated as a cartesian [x,y] plane in which [0,0] is located at
the upper left most pixel and [max_x, max_y] is lo... | [
"numpy.abs",
"numpy.asarray",
"numpy.zeros",
"numpy.random.randint",
"numpy.array",
"numpy.array_equal"
] | [((556, 591), 'numpy.array', 'np.array', (['[1, 0, 0]'], {'dtype': 'np.uint8'}), '([1, 0, 0], dtype=np.uint8)\n', (564, 591), True, 'import numpy as np\n'), ((607, 644), 'numpy.array', 'np.array', (['[255, 0, 0]'], {'dtype': 'np.uint8'}), '([255, 0, 0], dtype=np.uint8)\n', (615, 644), True, 'import numpy as np\n'), ((6... |
import pandas as pd
import numpy as np
import HFSSLibrary as hfss
precision_frequency = 10.0050125313283 # GHz
N = 8
# beam_ports = np.array([0,1])
beam_ports = np.arange(N)
# N=8
#Open Circular Array File Before running script
[oAnsys, oDesktop] = hfss.openHFSS()
oProject = oDesktop.setActiveProject('cyl_array') #... | [
"pandas.read_csv",
"numpy.zeros",
"numpy.ones",
"numpy.arange",
"HFSSLibrary.openHFSS"
] | [((164, 176), 'numpy.arange', 'np.arange', (['N'], {}), '(N)\n', (173, 176), True, 'import numpy as np\n'), ((253, 268), 'HFSSLibrary.openHFSS', 'hfss.openHFSS', ([], {}), '()\n', (266, 268), True, 'import HFSSLibrary as hfss\n'), ((688, 712), 'numpy.zeros', 'np.zeros', (['(2 * N, 2 * N)'], {}), '((2 * N, 2 * N))\n', (... |
from numpy import array, polyfit, RankWarning, seterr
from warnings import catch_warnings, filterwarnings
# Represents a polynomial function on a graph
# Uses polynomial regression to get terms of the polynomial form of the function
# Also overloads the call operator for testing the function
class Function:
def _... | [
"numpy.array",
"numpy.polyfit"
] | [((725, 738), 'numpy.array', 'array', (['self.x'], {}), '(self.x)\n', (730, 738), False, 'from numpy import array, polyfit, RankWarning, seterr\n'), ((751, 764), 'numpy.array', 'array', (['self.y'], {}), '(self.y)\n', (756, 764), False, 'from numpy import array, polyfit, RankWarning, seterr\n'), ((777, 803), 'numpy.pol... |
import matplotlib.pyplot as plt
import numpy as np
from multiprocessing import cpu_count
from sklearn.datasets import load_wine
from sklearn.ensemble import RandomForestClassifier
from sklearn.feature_selection import SelectFromModel
from sklearn.model_selection import cross_val_score
from sklearn.linear_mod... | [
"sklearn.datasets.load_wine",
"numpy.random.seed",
"matplotlib.pyplot.show",
"sklearn.model_selection.cross_val_score",
"sklearn.tree.DecisionTreeClassifier",
"numpy.argsort",
"sklearn.feature_selection.SelectFromModel",
"sklearn.linear_model.LogisticRegression",
"numpy.mean",
"numpy.sort",
"skl... | [((469, 489), 'numpy.random.seed', 'np.random.seed', (['(1000)'], {}), '(1000)\n', (483, 489), True, 'import numpy as np\n'), ((558, 584), 'sklearn.datasets.load_wine', 'load_wine', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (567, 584), False, 'from sklearn.datasets import load_wine\n'), ((629, 681), 'sklea... |
from acados_template import *
import acados_template as at
from export_ode_model import *
import numpy as np
import scipy.linalg
from ctypes import *
FORMULATION = 1 # 0 for linear soft bounds,
# 1 for equivalent nonlinear soft constraint
def export_nonlinear_constraint():
con_name = 'nl_con'
#... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.zeros",
"matplotlib.pyplot.ylabel",
"numpy.ones",
"matplotlib.pyplot.step",
"numpy.array",
"numpy.linspace",
"numpy.eye",
"matplotlib.pyplot.xlabel",
"numpy.ndarray",
"matplot... | [((1505, 1514), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)\n', (1511, 1514), True, 'import numpy as np\n'), ((1574, 1583), 'numpy.eye', 'np.eye', (['(1)'], {}), '(1)\n', (1580, 1583), True, 'import numpy as np\n'), ((1648, 1666), 'numpy.zeros', 'np.zeros', (['(ny, nx)'], {}), '((ny, nx))\n', (1656, 1666), True, 'import... |
"""Various utilities for working with Webots scenarios."""
import math
import numpy as np
from scenic.core.geometry import normalizeAngle
def webotsToScenicPosition(pos):
"""Convert a Webots position to a Scenic position.
Drops the Webots Y coordinate.
"""
x, y, z = pos
return (x, -z)
def scen... | [
"scenic.core.geometry.normalizeAngle",
"numpy.array",
"numpy.linalg.norm"
] | [((799, 816), 'numpy.array', 'np.array', (['rot[:3]'], {}), '(rot[:3])\n', (807, 816), True, 'import numpy as np\n'), ((950, 981), 'scenic.core.geometry.normalizeAngle', 'normalizeAngle', (['(angle + math.pi)'], {}), '(angle + math.pi)\n', (964, 981), False, 'from scenic.core.geometry import normalizeAngle\n'), ((871, ... |
import glob
import hashlib
import logging
import os
import random
import sys
from itertools import product
import numpy as np
import pandas as pd
import yaml
from attrdict import AttrDict
from deepsense import neptune
from tqdm import tqdm
def read_yaml(filepath):
with open(filepath) as f:
config = yaml.... | [
"tqdm.tqdm",
"yaml.load",
"numpy.random.seed",
"numpy.log",
"pandas.read_csv",
"logging.StreamHandler",
"numpy.clip",
"pandas.DatetimeIndex",
"logging.Formatter",
"random.seed",
"pandas.to_datetime",
"itertools.product",
"attrdict.AttrDict",
"os.path.join",
"pandas.concat",
"logging.ge... | [((339, 355), 'attrdict.AttrDict', 'AttrDict', (['config'], {}), '(config)\n', (347, 355), False, 'from attrdict import AttrDict\n'), ((390, 423), 'logging.getLogger', 'logging.getLogger', (['"""talking-data"""'], {}), "('talking-data')\n", (407, 423), False, 'import logging\n'), ((479, 574), 'logging.Formatter', 'logg... |
import numpy as np
import pandas as pd
from talib import abstract
from lib.strategy.base_strategy import BaseStrategy
class DcBreakout(BaseStrategy):
# settings
low_period = 10
high_period = 20
def __init__(self, feed: pd.DataFrame):
super().__init__(feed)
if self.has_enough_feed()... | [
"numpy.isnan",
"talib.abstract.MAX",
"talib.abstract.MIN"
] | [((340, 401), 'talib.abstract.MAX', 'abstract.MAX', (["self.feed['close']"], {'timeperiod': 'self.high_period'}), "(self.feed['close'], timeperiod=self.high_period)\n", (352, 401), False, 'from talib import abstract\n'), ((420, 480), 'talib.abstract.MIN', 'abstract.MIN', (["self.feed['close']"], {'timeperiod': 'self.lo... |
import sys
import torch
import wandb
import numpy as np
sys.path.insert(1, "../../model")
from dataset import GrooveMidiDatasetInfilling
from torch.utils.data import DataLoader
sys.path.insert(1, "../../../GrooveEvaluator")
sys.path.insert(1, "../../../BaseGrooveTransformers/")
sys.path.append('../../../preprocessed_... | [
"sys.path.append",
"numpy.stack",
"wandb.log",
"numpy.zeros_like",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.MSELoss",
"torch.utils.data.DataLoader",
"utils.get_hvo_idx_for_voice",
"Subset_Creators.subsetters.GrooveMidiSubsetter",
"dataset.GrooveMidiDatasetInfilling",
"sys.path.insert",
"numpy.a... | [((57, 90), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../model"""'], {}), "(1, '../../model')\n", (72, 90), False, 'import sys\n'), ((179, 225), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../../GrooveEvaluator"""'], {}), "(1, '../../../GrooveEvaluator')\n", (194, 225), False, 'import sys\n'), ((2... |
import numpy as np
def rle2mask(rle, img_shape):
width, height = img_shape[0], img_shape[1]
mask= np.zeros(width * height, dtype=np.uint8)
array = np.asarray([int(x) for x in rle.split()])
starts = array[0::2]
lengths = array[1::2]
current_position = 0
for index, start in enumerate(starts)... | [
"numpy.zeros"
] | [((107, 147), 'numpy.zeros', 'np.zeros', (['(width * height)'], {'dtype': 'np.uint8'}), '(width * height, dtype=np.uint8)\n', (115, 147), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
#
# Copyright (c) 2018-2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | [
"numpy.load",
"tensorflow.make_tensor_proto",
"argparse.ArgumentParser",
"tensorflow_serving.apis.predict_pb2.PredictRequest",
"numpy.argmax",
"numpy.ptp",
"numpy.average",
"numpy.zeros",
"tensorflow.make_ndarray",
"numpy.append",
"tensorflow_serving.apis.prediction_service_pb2_grpc.PredictionSe... | [((871, 1017), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Sends requests via TFS gRPC API using images in numpy format. It measures performance statistics."""'}), "(description=\n 'Sends requests via TFS gRPC API using images in numpy format. It measures performance statistics.'\n... |
import operator
import warnings
import numpy as np
import pandas as pd
import Bio
import Bio.SeqIO
from Bio import pairwise2
from Bio.PDB import PDBParser
from biograph.structure import StructureModel
from biograph.downloader import PdbDownloader
from biograph.constants import amino_1code, valid_amino_3, valid_amino_1
... | [
"biograph.structure.StructureModel",
"pandas.DataFrame",
"biograph.constants.amino_1code",
"Bio.SeqIO.parse",
"numpy.sum",
"warnings.simplefilter",
"biograph.downloader.PdbDownloader",
"numpy.mean",
"numpy.array",
"warnings.catch_warnings",
"Bio.PDB.PDBParser",
"biograph.constants.valid_amino_... | [((1026, 1070), 'biograph.downloader.PdbDownloader', 'PdbDownloader', (['[pdb_id]'], {'base_path': 'base_path'}), '([pdb_id], base_path=base_path)\n', (1039, 1070), False, 'from biograph.downloader import PdbDownloader\n'), ((4392, 4419), 'biograph.structure.StructureModel', 'StructureModel', (['ids', 'coords'], {}), '... |
"""
Generate a large batch of image samples from a model and save them as a large
numpy array. This can be used to produce samples for FID evaluation.
"""
import argparse
import os, time
os.environ["CUDA_VISIBLE_DEVICES"] = "6"
os.environ['OPENAI_LOGDIR'] = 'logs_test_2e-5'
if not os.path.exists(os.environ['OPENAI_L... | [
"os.mkdir",
"argparse.ArgumentParser",
"torch.distributed.all_gather",
"torch.distributed.get_world_size",
"improved_diffusion.dist_util.load_state_dict",
"improved_diffusion.dist_util.setup_dist",
"improved_diffusion.script_util.model_and_diffusion_defaults",
"os.path.exists",
"improved_diffusion.d... | [((285, 328), 'os.path.exists', 'os.path.exists', (["os.environ['OPENAI_LOGDIR']"], {}), "(os.environ['OPENAI_LOGDIR'])\n", (299, 328), False, 'import os, time\n'), ((334, 371), 'os.mkdir', 'os.mkdir', (["os.environ['OPENAI_LOGDIR']"], {}), "(os.environ['OPENAI_LOGDIR'])\n", (342, 371), False, 'import os, time\n'), ((7... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from datetime import date
import pandas_datareader as pdr
from keras.models import load_model
import streamlit as st
start = '2015-01-01'
end = date.isoformat(date.today())
st.title("STOCK PRICE PREDICTION")
input= st.text_input("enter t... | [
"pandas_datareader.DataReader",
"streamlit.subheader",
"keras.models.load_model",
"streamlit.text_input",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"sklearn.preprocessing.MinMaxScaler",
"datetime.date.today",
"streamlit.title",
"streamlit.write",
"matplotl... | [((255, 289), 'streamlit.title', 'st.title', (['"""STOCK PRICE PREDICTION"""'], {}), "('STOCK PRICE PREDICTION')\n", (263, 289), True, 'import streamlit as st\n'), ((298, 372), 'streamlit.text_input', 'st.text_input', (['"""enter the stock ticker(ex : for Apple it is AAPL)"""', '"""AAPL"""'], {}), "('enter the stock ti... |
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
def plot(data, title):
plot.i += 1
plt.subplot(2,3,plot.i)
plt.imshow(data)
plt.title(title)
plot.i = 0
def plot_his(data, title):
plot.i += 1
plt.subplot(2,3,plot.i)
plt.plot(data)
plt.title(title)
plot.i = 0
im... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"PIL.Image.open",
"numpy.array"
] | [((442, 471), 'numpy.array', 'np.array', (['img'], {'dtype': 'np.int64'}), '(img, dtype=np.int64)\n', (450, 471), True, 'import numpy as np\n'), ((513, 526), 'numpy.zeros', 'np.zeros', (['(256)'], {}), '(256)\n', (521, 526), True, 'import numpy as np\n'), ((714, 727), 'numpy.zeros', 'np.zeros', (['(256)'], {}), '(256)\... |
"""
Reproduce Table 2
Condorcet Efficiencies under Random Society and
Spatial Model Assumptions
(201 voters, 5 candidates)
from
<NAME> III, "A Comparison of Efficiency of Multicandidate
Electoral Systems", American Journal of Political Science, vol. 28,
no. 1, pp. 23-48, 1984. :doi:`10.2307/2110786`
Typical result... | [
"elsim.elections.normed_dist_utilities",
"time.gmtime",
"elsim.strategies.approval_optimal",
"time.monotonic",
"tabulate.tabulate",
"numpy.array",
"elsim.elections.normal_electorate",
"elsim.strategies.honest_rankings",
"collections.Counter",
"elsim.methods.condorcet"
] | [((2153, 2169), 'time.monotonic', 'time.monotonic', ([], {}), '()\n', (2167, 2169), False, 'import time\n'), ((4156, 4192), 'numpy.array', 'np.array', (["[c['CW'] for c in results]"], {}), "([c['CW'] for c in results])\n", (4164, 4192), True, 'import numpy as np\n'), ((2533, 2542), 'collections.Counter', 'Counter', ([]... |
# coding: utf-8
import tensorflow as tf, numpy as np
from config import Config as BaseConfig
from models.base import Model as BaseModel
from utils.wv_utils import load_global_embedding_matrix
from models.model_ops import embedded,attention_han,bi_gru,conv_with_max_pool,build_loss,build_summaries
class Config(BaseCon... | [
"tensorflow.reduce_sum",
"tensorflow.trainable_variables",
"tensorflow.maximum",
"models.model_ops.conv_with_max_pool",
"tensorflow.train.AdamOptimizer",
"tensorflow.global_variables",
"tensorflow.greater_equal",
"tensorflow.abs",
"models.model_ops.build_loss",
"tensorflow.placeholder_with_default... | [((1026, 1150), 'utils.wv_utils.load_global_embedding_matrix', 'load_global_embedding_matrix', (["self.config.wv_config['path_w']", "self.config.wv_config['path_c']", 'self.config.global_dict'], {}), "(self.config.wv_config['path_w'], self.config.\n wv_config['path_c'], self.config.global_dict)\n", (1054, 1150), Fal... |
import numpy
import scipy.sparse
import unittest
import pytest
from xminds.lib.utils import deep_hash, classproperty, retry
def test_deep_hash():
val = {
'arrays': {
'int': numpy.arange(1000),
'struct': numpy.array([(11, 12), (21, 22)], [('a', int), ('b', int)]),
's... | [
"xminds.lib.utils.deep_hash",
"numpy.float32",
"xminds.lib.utils.retry",
"numpy.array",
"numpy.arange",
"numpy.bytes_"
] | [((788, 802), 'xminds.lib.utils.deep_hash', 'deep_hash', (['val'], {}), '(val)\n', (797, 802), False, 'from xminds.lib.utils import deep_hash, classproperty, retry\n'), ((969, 983), 'xminds.lib.utils.deep_hash', 'deep_hash', (['val'], {}), '(val)\n', (978, 983), False, 'from xminds.lib.utils import deep_hash, classprop... |
# Importing Libraries
from foolbox.criteria import TargetClass
from foolbox.criteria import Misclassification
from numpy import linalg as LA
import matplotlib.pyplot as plt
from foolbox.attacks import CarliniWagnerL2Attack
from foolbox.attacks import SaliencyMapAttack
from foolbox.attacks import GradientSignAttack
... | [
"ISMAIL_big_picture_journal_lib.sup_lbl_from_lbl",
"tensorflow.keras.models.load_model",
"ISMAIL_big_picture_journal_lib.Imperceptibility",
"numpy.sum",
"timeit.default_timer",
"ISMAIL_big_picture_journal_lib.cvxPy_pert_gen",
"numpy.zeros",
"numpy.ones",
"numpy.argmin",
"keras.utils.np_utils.to_ca... | [((755, 777), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (775, 777), False, 'import timeit\n'), ((1472, 1515), 'tensorflow.keras.datasets.fashion_mnist.load_data', 'tf.keras.datasets.fashion_mnist.load_data', ([], {}), '()\n', (1513, 1515), True, 'import tensorflow as tf\n'), ((1817, 1858), 'kera... |
# -*- coding: utf-8 -*-
"""util.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1BpuYZIMKiZOv-FsGhPqYLJq28NTe7PxO
"""
import pandas as pd
import numpy as np
import json
import re
import nltk
nltk.download('stopwords')
nltk.download('punkt')
from ... | [
"json.dump",
"numpy.load",
"json.load",
"pandas.date_range",
"numpy.ones_like",
"nltk.stem.snowball.EnglishStemmer",
"numpy.max",
"numpy.min",
"numpy.array",
"pandas.to_datetime",
"nltk.corpus.stopwords.words",
"nltk.stem.snowball.GermanStemmer",
"nltk.download",
"re.sub",
"re.compile"
] | [((265, 291), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (278, 291), False, 'import nltk\n'), ((292, 314), 'nltk.download', 'nltk.download', (['"""punkt"""'], {}), "('punkt')\n", (305, 314), False, 'import nltk\n'), ((763, 789), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"... |
import os
import random
from copy import deepcopy
import pandas as pd
import logging
from tqdm import tqdm
import json
import glob
import re
from resemblyzer import VoiceEncoder
import traceback
import numpy as np
import pretty_midi
import librosa
from scipy.interpolate import interp1d
import torch
from textgrid import... | [
"copy.deepcopy",
"data_gen.tts.base_binarizer.BinarizationError",
"traceback.print_exc",
"os.makedirs",
"os.path.basename",
"data_gen.tts.data_gen_utils.build_phone_encoder",
"random.shuffle",
"numpy.asarray",
"data_gen.tts.data_gen_utils.get_pitch",
"numpy.zeros",
"os.path.exists",
"random.se... | [((1313, 1333), 'copy.deepcopy', 'deepcopy', (['item_names'], {}), '(item_names)\n', (1321, 1333), False, 'from copy import deepcopy\n'), ((3535, 3589), 'os.makedirs', 'os.makedirs', (["hparams['binary_data_dir']"], {'exist_ok': '(True)'}), "(hparams['binary_data_dir'], exist_ok=True)\n", (3546, 3589), False, 'import o... |
import json
import numpy as np
import keras
import keras.preprocessing.text as kpt
from keras.preprocessing.text import Tokenizer
from keras.models import model_from_json
tokenizer = Tokenizer()
wine_training = np.genfromtxt('ranked_wine.csv', delimiter=',', skip_header=1,usecols=(1,3),dtype=None, filling_values= 0, ... | [
"json.load",
"numpy.argmax",
"numpy.genfromtxt",
"keras.preprocessing.text.Tokenizer",
"keras.models.model_from_json",
"keras.preprocessing.text.text_to_word_sequence"
] | [((185, 196), 'keras.preprocessing.text.Tokenizer', 'Tokenizer', ([], {}), '()\n', (194, 196), False, 'from keras.preprocessing.text import Tokenizer\n'), ((213, 362), 'numpy.genfromtxt', 'np.genfromtxt', (['"""ranked_wine.csv"""'], {'delimiter': '""","""', 'skip_header': '(1)', 'usecols': '(1, 3)', 'dtype': 'None', 'f... |
from sklearn import datasets
from sklearn import svm
import numpy as np
from sklearn import random_projection
import matplotlib.pyplot as plt
def ex1(): # loading an example dataset
iris = datasets.load_iris()
digits = datasets.load_digits()
clf = svm.SVC(gamma=0.001, C=100.)
clf.fit(digits.data[:-1]... | [
"matplotlib.pyplot.title",
"sklearn.datasets.load_iris",
"sklearn.datasets.load_digits",
"numpy.arange",
"matplotlib.pyplot.contourf",
"sklearn.svm.SVC",
"numpy.unique",
"sklearn.random_projection.GaussianRandomProjection",
"matplotlib.pyplot.yticks",
"numpy.random.RandomState",
"sklearn.svm.Lin... | [((196, 216), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (214, 216), False, 'from sklearn import datasets\n'), ((230, 252), 'sklearn.datasets.load_digits', 'datasets.load_digits', ([], {}), '()\n', (250, 252), False, 'from sklearn import datasets\n'), ((263, 292), 'sklearn.svm.SVC', 'svm.SVC'... |
#!/usr/bin/env python3
# Simple k-means implementation with animated plot.
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.datasets import make_classification
sns.set(style="white", color_codes=True)
customPalette = pd.Series(['#630C3A', '#39C8C6', '#D3500C']... | [
"pandas.DataFrame",
"numpy.random.randn",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.scatter",
"sklearn.metrics.v_measure_score",
"numpy.square",
"sklearn.datasets.make_classification",
"numpy.arange",
"pandas.Series",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.pause",
"seaborn.set"
] | [((220, 260), 'seaborn.set', 'sns.set', ([], {'style': '"""white"""', 'color_codes': '(True)'}), "(style='white', color_codes=True)\n", (227, 260), True, 'import seaborn as sns\n'), ((277, 321), 'pandas.Series', 'pd.Series', (["['#630C3A', '#39C8C6', '#D3500C']"], {}), "(['#630C3A', '#39C8C6', '#D3500C'])\n", (286, 321... |
import numpy as np
from laserchicken.feature_extractor.base_feature_extractor import FeatureExtractor
from laserchicken.keys import point
class MeanStdCoeffFeatureExtractor(FeatureExtractor):
"""Calculates mean, standard deviation and the ratio between the two."""
def __init__(self, data_key='z'):
se... | [
"numpy.std",
"numpy.mean"
] | [((930, 940), 'numpy.mean', 'np.mean', (['z'], {}), '(z)\n', (937, 940), True, 'import numpy as np\n'), ((961, 970), 'numpy.std', 'np.std', (['z'], {}), '(z)\n', (967, 970), True, 'import numpy as np\n')] |
#!/usr/bin/env python
import yaml
import pydmps
import rospy
import sys
import tf
import std_msgs
import numpy as np
from os.path import join
from geometry_msgs.msg import PoseStamped
from nav_msgs.msg import Path
from ros_dmp.srv import *
class LearnDmp:
def __init__(self):
'''Ros interface for learning ... | [
"geometry_msgs.msg.PoseStamped",
"rospy.logerr",
"nav_msgs.msg.Path",
"numpy.asarray",
"yaml.dump",
"rospy.Publisher",
"rospy.Rate",
"pydmps.dmp_discrete.DMPs_discrete",
"rospy.loginfo",
"rospy.get_param",
"rospy.init_node",
"tf.transformations.euler_from_quaternion",
"rospy.spin",
"rospy.... | [((387, 444), 'rospy.init_node', 'rospy.init_node', (['"""learn_dynamic_motion_primitive_service"""'], {}), "('learn_dynamic_motion_primitive_service')\n", (402, 444), False, 'import rospy\n'), ((464, 558), 'rospy.Service', 'rospy.Service', (['"""learn_dynamic_motion_primitive_service"""', 'LearnDMP', 'self.learn_dmp_h... |
from assembly import *
import matplotlib.pyplot as plt
from scipy.linalg import eig
import numpy as np
#
assemble_te = False
assemble_tn = True
#
# Compute the ground state for H2
#
N = 2 # number of electrons in molecule
halfN = 1
M = 2 # number of nuclei in molecule
# Position of nuclei
R = np.array([[0,0,0]... | [
"numpy.load",
"numpy.save",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.ones",
"scipy.linalg.eig",
"numpy.array",
"numpy.linalg.norm",
"numpy.diag",
"matplotlib.pyplot.subplots"
] | [((303, 337), 'numpy.array', 'np.array', (['[[0, 0, 0], [1.4, 0, 0]]'], {}), '([[0, 0, 0], [1.4, 0, 0]])\n', (311, 337), True, 'import numpy as np\n'), ((1065, 1095), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': '(1)', 'ncols': '(3)'}), '(nrows=1, ncols=3)\n', (1077, 1095), True, 'import matplotlib.pypl... |
import h5py
import click
import itertools as it
from pathlib import Path
from datetime import datetime
import numpy as np
from scipy import signal
def downsample_signal(
dataset: h5py.Dataset, ds_factor: int, block_len: int = None
):
# 8th order chebyshev filter for downsampling
flt = signal.iirfilter(
... | [
"h5py.File",
"scipy.signal.sosfilt",
"numpy.empty",
"numpy.zeros",
"click.option",
"click.command",
"datetime.datetime.utcfromtimestamp",
"scipy.signal.iirfilter",
"pathlib.Path",
"click.Path"
] | [((1468, 1483), 'click.command', 'click.command', ([], {}), '()\n', (1481, 1483), False, 'import click\n'), ((1593, 1653), 'click.option', 'click.option', (['"""--sampling-rate"""', '"""-r"""'], {'type': 'int', 'default': '(100)'}), "('--sampling-rate', '-r', type=int, default=100)\n", (1605, 1653), False, 'import clic... |
import numpy as np
import torch
import torch.nn as nn
import re
from torch.autograd import Variable
from collections import OrderedDict, defaultdict, Counter
# from torch.profiler import profile, record_function, ProfilerActivity
from itertools import zip_longest
import pprint
import sys
GLOBAL_LAYER_IDX = 0
def ge... | [
"torch.cuda.max_memory_allocated",
"torch.cuda.reset_peak_memory_stats",
"itertools.zip_longest",
"re.match",
"torch.optim.Adam",
"torch.cuda.is_available",
"torch.cuda.max_memory_reserved",
"torch.rand",
"collections.OrderedDict",
"torch.sum",
"numpy.prod",
"torch.optim.SGD"
] | [((10831, 10844), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (10842, 10844), False, 'from collections import OrderedDict, defaultdict, Counter\n'), ((17834, 17847), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (17845, 17847), False, 'from collections import OrderedDict, defaultdict, Coun... |
#To use pylagrit, import the module.
import pylagrit
import numpy
#Instantiate the lagrit object.
lg = pylagrit.PyLaGriT()
# Create list with mesh object as first element
dxyz = numpy.array([0.25]*3)
mins = numpy.array([0.]*3)
maxs = numpy.array([1.]*3)
ms = [lg.createpts_dxyz(dxyz,mins,maxs,'tet',connect=True,name='... | [
"pylagrit.PyLaGriT",
"numpy.array"
] | [((104, 123), 'pylagrit.PyLaGriT', 'pylagrit.PyLaGriT', ([], {}), '()\n', (121, 123), False, 'import pylagrit\n'), ((180, 203), 'numpy.array', 'numpy.array', (['([0.25] * 3)'], {}), '([0.25] * 3)\n', (191, 203), False, 'import numpy\n'), ((209, 231), 'numpy.array', 'numpy.array', (['([0.0] * 3)'], {}), '([0.0] * 3)\n',... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Author: <NAME>
Email: <EMAIL>, <EMAIL>
github: https://github.com/viebboy
"""
import pytest
import os
import shutil
import utility
import numpy as np
import random
from GOP.utility import gop_utils, gop_operators
INPUT_DIM = utility.INPUT_DIM
OUTPUT_DIM = utility.OUT... | [
"os.mkdir",
"GOP.utility.gop_operators.get_default_nodal_set",
"GOP.utility.gop_utils.block_update_standalone",
"numpy.allclose",
"os.path.exists",
"utility.get_random_model_data",
"random.choice",
"pytest.main",
"utility.get_all_operators",
"GOP.utility.gop_operators.get_default_activation_set",
... | [((404, 446), 'os.path.join', 'os.path.join', (['tmpdir.dirname', '"""test_model"""'], {}), "(tmpdir.dirname, 'test_model')\n", (416, 446), False, 'import os\n'), ((454, 480), 'os.path.exists', 'os.path.exists', (['model_path'], {}), '(model_path)\n', (468, 480), False, 'import os\n'), ((520, 540), 'os.mkdir', 'os.mkdi... |
import numpy as np
from math import sqrt
from sklearn.neighbors import NearestNeighbors
class Ilamp:
"""Inverse projection using the ILAMP algorithm described in "iLAMP: exploring high-dimensional spacing through
backward multidimensional projection" (https://ieeexplore.ieee.org/document/6400489)."""
def ... | [
"numpy.sum",
"math.sqrt",
"numpy.zeros",
"numpy.transpose",
"numpy.linalg.svd",
"sklearn.neighbors.NearestNeighbors",
"numpy.matmul",
"numpy.dot"
] | [((1060, 1091), 'sklearn.neighbors.NearestNeighbors', 'NearestNeighbors', ([], {'n_neighbors': 'k'}), '(n_neighbors=k)\n', (1076, 1091), False, 'from sklearn.neighbors import NearestNeighbors\n'), ((2218, 2231), 'numpy.sum', 'np.sum', (['alpha'], {}), '(alpha)\n', (2224, 2231), True, 'import numpy as np\n'), ((2890, 29... |
#!/usr/bin/python3
import MiningEnv
import argparse
import numpy as np
import tensorflow as tf
import time
import pickle
from pdb import set_trace
import os
import errno
import gym
import maddpg.common.tf_util as U
from maddpg.trainer.maddpg import MADDPGAgentTrainer
import tensorflow.contrib.layers as layers
def pa... | [
"pickle.dump",
"gym.make",
"argparse.ArgumentParser",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.train.Saver",
"maddpg.common.tf_util.save_state",
"os.path.dirname",
"maddpg.common.tf_util.single_threaded_session",
"tensorflow.variable_scope",
"numpy.clip",
"time.time",
"time.sle... | [((345, 439), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Reinforcement Learning experiments for multiagent environments"""'], {}), "(\n 'Reinforcement Learning experiments for multiagent environments')\n", (368, 439), False, 'import argparse\n'), ((3465, 3489), 'gym.make', 'gym.make', (['"""MiningEn... |
#
# Copyright (C) 2021 <NAME> and GHOST contributors
#
# 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, mer... | [
"pandas.DataFrame",
"numpy.random.seed",
"sklearn.metrics.roc_curve",
"numpy.argmax",
"numpy.median",
"numpy.std",
"sklearn.model_selection.train_test_split",
"numpy.random.randint",
"numpy.array",
"sklearn.metrics.cohen_kappa_score",
"sklearn.utils.resample",
"numpy.round"
] | [((2815, 2842), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (2829, 2842), True, 'import numpy as np\n'), ((2862, 2911), 'numpy.random.randint', 'np.random.randint', (['(N_subsets * 10)'], {'size': 'N_subsets'}), '(N_subsets * 10, size=N_subsets)\n', (2879, 2911), True, 'import numpy... |
import numpy as np
class Rms_prop():
"""
Class that implements a RMSProp optimisation.
RMSprop is a very effective, but currently unpublished adaptive learning
rate method.
Amusingly, everyone who uses this method in their work currently cites slide
29 of Lecture 6 of <NAME>on's Coursera clas... | [
"numpy.zeros_like",
"numpy.sqrt"
] | [((1622, 1638), 'numpy.zeros_like', 'np.zeros_like', (['w'], {}), '(w)\n', (1635, 1638), True, 'import numpy as np\n'), ((1765, 1784), 'numpy.sqrt', 'np.sqrt', (['self.cache'], {}), '(self.cache)\n', (1772, 1784), True, 'import numpy as np\n')] |
""" A module for creating videos that show tracks (both in world coordinates and pixel coordinates)
"""
import imageio as iio
import cv2
import numpy as np
from random import shuffle, choice
from bisect import bisect
import click
from os.path import isfile
from tracking import DetTrack
from tracking_world import Worl... | [
"random.shuffle",
"click.option",
"os.path.isfile",
"cv2.rectangle",
"cv2.cvtColor",
"util.left_remove",
"os.path.exists",
"click.command",
"util.right_remove",
"util.print_flush",
"apply_mask.Masker",
"imageio.get_reader",
"cv2.circle",
"bisect.bisect",
"imageio.get_writer",
"numpy.co... | [((7560, 7575), 'click.command', 'click.command', ([], {}), '()\n', (7573, 7575), False, 'import click\n'), ((7577, 7636), 'click.option', 'click.option', (['"""--dataset"""'], {'type': 'str', 'help': '"""Name of dataset"""'}), "('--dataset', type=str, help='Name of dataset')\n", (7589, 7636), False, 'import click\n'),... |
import gurobipy as gp
import numpy as np
from mip.mip_nn import MIP_NN
from globals import EPSILON, CONT, GUROBI_ENV, LOG
class MAX_M(MIP_NN):
def __init__(self, data, architecture, bound, reg, fair):
model = gp.Model("Gurobi_NN", env=GUROBI_ENV)
if not LOG:
model.setParam("OutputFlag", 0)
self.N... | [
"numpy.full",
"mip.mip_nn.MIP_NN.extract_values",
"gurobipy.Model"
] | [((217, 254), 'gurobipy.Model', 'gp.Model', (['"""Gurobi_NN"""'], {'env': 'GUROBI_ENV'}), "('Gurobi_NN', env=GUROBI_ENV)\n", (225, 254), True, 'import gurobipy as gp\n'), ((3393, 3430), 'mip.mip_nn.MIP_NN.extract_values', 'MIP_NN.extract_values', (['self', 'get_func'], {}), '(self, get_func)\n', (3414, 3430), False, 'f... |
"""Utility functions."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
import numpy as np
from .externals.mne import _validate_type
def _hammfilt(x, winsz):
"""Convolve with a hamming window."""
assert len(x) > winsz
win = np.hamming(winsz)
win /= sum(win)
r... | [
"numpy.convolve",
"scipy.signal.savgol_filter",
"numpy.round",
"numpy.hamming"
] | [((277, 294), 'numpy.hamming', 'np.hamming', (['winsz'], {}), '(winsz)\n', (287, 294), True, 'import numpy as np\n'), ((326, 353), 'numpy.convolve', 'np.convolve', (['x', 'win', '"""same"""'], {}), "(x, win, 'same')\n", (337, 353), True, 'import numpy as np\n'), ((1603, 1673), 'scipy.signal.savgol_filter', 'savgol_filt... |
from .dataset_tools import ExplicitPathDataset
from .definitions import resolve_path
import os
import pandas as pd
import numpy as np
import math
import glob
import json
def list_image_paths(basedir, prefixes=[""], extensions=["jpg", "jpeg", "png"]):
acc = []
for prefix in prefixes:
for ext in extensi... | [
"pandas.DataFrame",
"os.mkdir",
"os.makedirs",
"os.path.basename",
"os.path.isdir",
"os.path.dirname",
"os.rename",
"os.path.exists",
"os.path.realpath",
"numpy.arange",
"pandas.read_parquet",
"glob.glob",
"os.rmdir",
"os.symlink"
] | [((3836, 3864), 'os.path.dirname', 'os.path.dirname', (['output_path'], {}), '(output_path)\n', (3851, 3864), False, 'import os\n'), ((3869, 3904), 'os.makedirs', 'os.makedirs', (['dirname'], {'exist_ok': '(True)'}), '(dirname, exist_ok=True)\n', (3880, 3904), False, 'import os\n'), ((3920, 3949), 'os.path.basename', '... |
import torch
from torch.utils.data import Dataset
import numpy as np
import scipy.io as sio
import utils
import copy
import os
import cv2
class RoomTypeDataset(Dataset):
def __init__(self, data_root, phase, max_room_per_type):
self.data_split_root = os.path.join(data_root, phase)
self.floorplans =... | [
"os.listdir",
"scipy.io.loadmat",
"torch.FloatTensor",
"numpy.zeros",
"numpy.ones",
"torch.sub",
"numpy.array",
"os.path.join",
"torch.div",
"numpy.concatenate"
] | [((264, 294), 'os.path.join', 'os.path.join', (['data_root', 'phase'], {}), '(data_root, phase)\n', (276, 294), False, 'import os\n'), ((321, 353), 'os.listdir', 'os.listdir', (['self.data_split_root'], {}), '(self.data_split_root)\n', (331, 353), False, 'import os\n'), ((729, 779), 'os.path.join', 'os.path.join', (['s... |
#!/usr/bin/env python3
# encoding: utf-8
import warnings
import click
import h5py
import matplotlib.pyplot as pl
import numpy as np
import pandas as pd
import pypllon as plon
from pypllon.parsers import load_simdata
from glob import glob
pl.style.use('ggplot')
try:
from tools.helpers import Progress
except Imp... | [
"numpy.sum",
"tools.helpers.Progress",
"numpy.abs",
"numpy.ravel",
"click.option",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure",
"numpy.linalg.norm",
"numpy.mean",
"pandas.read_hdf",
"pypllon.recover",
"warnings.simplefilter",
"pypllon.parsers.load_simdata",
"warnings.catch_wa... | [((242, 264), 'matplotlib.pyplot.style.use', 'pl.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (254, 264), True, 'import matplotlib.pyplot as pl\n'), ((374, 387), 'click.group', 'click.group', ([], {}), '()\n', (385, 387), False, 'import click\n'), ((668, 692), 'click.argument', 'click.argument', (['"""h5file"""'... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 9 08:05:52 2020
@author: BK
"""
import numpy as np
import matplotlib.pyplot as plt
import math
import cmath
def par(alpha,bata):
"""
並聯運算
"""
par_result = (alpha*bata)/(alpha+bata)
return par_result
def circuit_list2mat_diagonal(circuit_list... | [
"numpy.zeros",
"numpy.imag",
"numpy.linalg.inv",
"numpy.real",
"numpy.dot"
] | [((1223, 1292), 'numpy.zeros', 'np.zeros', (['[circuit_mat.shape[0], circuit_mat.shape[0]]'], {'dtype': 'complex'}), '([circuit_mat.shape[0], circuit_mat.shape[0]], dtype=complex)\n', (1231, 1292), True, 'import numpy as np\n'), ((2050, 2076), 'numpy.zeros', 'np.zeros', (['(1)'], {'dtype': 'complex'}), '(1, dtype=compl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.